<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://matolanorbert.hu/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://matolanorbert.hu/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://matolanorbert.hu/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://matolanorbert.hu/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://matolanorbert.hu/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
        <style id="tf-head-css">
        .tf-hidden { display: none !important; }
        .tf-vintage-btn { background:rgba(27, 17, 11, 0.85) !important; border:1px solid rgba(212,175,55,0.4) !important; color:#d4af37 !important; font-family:"Uncial Antiqua", Georgia, serif !important; font-size:10px !important; letter-spacing:1px !important; text-transform:uppercase !important; padding:4px 12px !important; border-radius:3px !important; cursor:pointer !important; box-shadow:0 4px 6px rgba(0,0,0,0.6) !important; transition:all 0.2s ease !important; }
        .tf-vintage-btn:hover { background:rgba(62, 38, 21, 0.95) !important; border-color:rgba(212,175,55,0.8) !important; color:#fff !important; transform:translateY(-1px) !important; box-shadow:0 6px 10px rgba(0,0,0,0.8) !important; }
        .tf-world-item { display:inline-flex !important; align-items:center !important; justify-content:center !important; position:relative !important; margin:4px 6px !important; padding:0 !important; user-select:none !important; transition:transform 0.2s ease-out, opacity 0.4s ease !important; z-index:25 !important; pointer-events:auto !important; overflow:hidden !important; cursor:default !important; }
        .tf-world-item.tf-collected-hide { display:none !important; }
        .tf-world-item-inner { display:inline-flex !important; align-items:center !important; justify-content:center !important; position:relative !important; pointer-events:none !important; cursor:default !important; }
        .tf-world-emoji { font-size:28px !important; line-height:1 !important; display:inline-block !important; padding:6px !important; cursor:default !important; }
        .tf-world-img { max-width:120px !important; max-height:120px !important; object-fit:contain !important; display:block !important; cursor:default !important; }
        .tf-collecting { animation:tfVintageFadeOut 0.4s ease forwards !important; pointer-events:none !important; }
        @keyframes tfVintageFadeOut { 0% { transform:scale(1); opacity:1; } 100% { transform:scale(0.82); opacity:0; } }
        @keyframes tfSubtleShake { 0%, 100% { transform:translateX(0); } 25% { transform:translateX(-3px); } 50% { transform:translateX(3px); } 75% { transform:translateX(-2px); } }
        .tf-shake { animation:tfSubtleShake 0.3s ease !important; }
        
        .tf-inventory-grid { display:grid !important; grid-template-columns:repeat(4, 1fr) !important; gap:6px !important; padding-bottom:10px !important; cursor:default !important; }
        .tf-grid-square { width:100% !important; aspect-ratio:1/1 !important; border:1px dashed rgba(74, 55, 35, 0.4) !important; background:rgba(227,210,179,0.1) !important; display:flex !important; align-items:center !important; justify-content:center !important; position:relative !important; border-radius:2px !important; cursor:default !important; transition:all 0.15s ease !important; box-sizing:border-box !important; }
        .tf-grid-square:hover { background:rgba(227,210,179,0.3) !important; border-color:#3e2615 !important; }
        .tf-grid-square.is-silhouette { cursor:default !important; }
        .tf-grid-square.is-silhouette img, .tf-grid-square.is-silhouette span.tf-emoji-icon { filter:brightness(0) opacity(0.12) !important; }
        .tf-grid-square.is-silhouette:hover { background:rgba(227,210,179,0.1) !important; border-color:rgba(74, 55, 35, 0.4) !important; }
        .tf-grid-square img { max-width:80% !important; max-height:80% !important; object-fit:contain !important; pointer-events:none !important; }
        .tf-grid-square span.tf-emoji-icon { font-size:24px !important; pointer-events:none !important; display:block !important; line-height:1 !important; }
        .tf-grid-square.is-draggable { cursor:grab !important; }
        .tf-grid-square.is-drop-target { border:1px solid #d4af37 !important; background:rgba(212,175,55,0.2) !important; }

        .tf-alchemy-combiner { background:rgba(227,210,179,0.1) !important; border:1px dashed rgba(132,102,53,0.4) !important; padding:10px !important; text-align:center !important; border-radius:4px !important; width:100% !important; height:100% !important; box-sizing:border-box !important; position:relative !important; display:flex !important; flex-direction:column !important; align-items:center !important; justify-content:center !important; cursor:default !important; }
        .tf-alchemy-slots { display:flex !important; justify-content:center !important; gap:8px !important; margin:10px 0 !important; cursor:default !important; }
        .tf-alchemy-slot { width:46px !important; height:46px !important; border:1px dashed rgba(124,105,82,0.6) !important; background:rgba(56,36,22,0.2) !important; display:flex !important; align-items:center !important; justify-content:center !important; position:relative !important; touch-action:none !important; border-radius:4px !important; cursor:default !important; }
        .tf-alchemy-slot.has-item { border:1px solid rgba(212,175,55,0.6) !important; cursor:grab !important; }
        .tf-alchemy-slot.is-drop-target { transform:scale(1.1) !important; border-color:#d4af37 !important; z-index:10 !important; }
        .tf-alchemy-slot img { max-width:80% !important; max-height:80% !important; object-fit:contain !important; pointer-events:none !important; }
        .tf-alchemy-slot span.tf-emoji-icon { font-size:24px !important; pointer-events:none !important; display:block !important; line-height:1 !important; }
        .tf-burner-control { display:inline-block !important; width:60px !important; height:15px !important; border:1px solid #846635 !important; cursor:pointer !important; margin:6px 0 10px 0 !important; border-radius:8px !important; transition:all 0.3s ease !important; }
        .tf-burner-control.heat-0 { background:#222 !important; } .tf-burner-control.heat-1 { background:#822 !important; box-shadow:0 -5px 10px rgba(255,100,0,0.4) !important; border-color:#f60 !important; } .tf-burner-control.heat-2 { background:#d50 !important; box-shadow:0 -10px 15px rgba(255,100,0,0.6) !important; border-color:#f80 !important; } .tf-burner-control.heat-3 { background:#f20 !important; box-shadow:0 -15px 20px rgba(255,50,0,0.8) !important; border-color:#f00 !important; }
        
        .tf-brewing-overlay { position:absolute !important; inset:0 !important; background:rgba(43,29,18,0.85) !important; z-index:50 !important; display:none; align-items:center !important; justify-content:center !important; border-radius:4px !important; pointer-events:auto !important; cursor:default !important; }
        .tf-brewing-overlay.is-active { display:flex !important; }
        .tf-brew-timer { position:relative !important; width:140px !important; height:140px !important; border-radius:50% !important; background:#e3d2b3 !important; border:6px solid #3a2612 !important; box-shadow:0 10px 25px rgba(0,0,0,0.8), inset 0 0 20px rgba(0,0,0,1) !important; pointer-events:none !important; cursor:default !important; }
        .tf-clock-inner { position:absolute !important; inset:4px !important; border:1px solid #846635 !important; border-radius:50% !important; }
        .tf-clock-center { position:absolute !important; top:50% !important; left:50% !important; width:12px !important; height:12px !important; background:#1a0f08 !important; border:2px solid #d4af37 !important; border-radius:50% !important; transform:translate(-50%, -50%) !important; z-index:10 !important; box-shadow:0 2px 4px rgba(0,0,0,0.5) !important; }
        .tf-clock-hand { position:absolute !important; bottom:50% !important; left:50% !important; width:4px !important; height:50px !important; background:linear-gradient(to top, #1a0f08 0%, #3e2615 100%) !important; transform-origin:bottom center !important; transform:translateX(-50%) rotate(0deg); border-radius:2px 2px 0 0 !important; box-shadow:2px 2px 5px rgba(0,0,0,0.5) !important; transition:transform 1s linear !important; z-index:9 !important; pointer-events:none !important; }
        .tf-clock-hand::after { content:"" !important; position:absolute !important; top:-6px !important; left:-3px !important; border-left:5px solid transparent !important; border-right:5px solid transparent !important; border-bottom:8px solid #3e2615 !important; }
        .tf-clock-mark { position:absolute !important; top:5px !important; left:50% !important; transform-origin:50% 59px !important; font-family:"Uncial Antiqua",serif !important; font-size:12px !important; color:#3a2612 !important; font-weight:bold !important; text-align:center !important; width:20px !important; margin-left:-10px !important; text-shadow:0 0 5px #d4af37 !important; }
        .tf-magic-smoke { position:absolute !important; bottom:-20px !important; left:50% !important; transform:translateX(-50%) !important; width:120px !important; height:120px !important; background:radial-gradient(circle, rgba(200,180,150,0.4) 0%, transparent 60%) !important; border-radius:50% !important; filter:blur(10px) !important; animation:tfSmokeRise 2s ease-in infinite alternate !important; pointer-events:none !important; z-index:20 !important; }
        @keyframes tfSpin { 100% { transform:rotate(360deg); } }
        @keyframes tfSpinReverse { 100% { transform:rotate(-360deg); } }
        @keyframes tfSmokeRise { 0% { transform:translate(-50%, 10px) scale(0.8); opacity:0.3; } 100% { transform:translate(-50%, -20px) scale(1.2); opacity:0.7; } }
        
        .tf-brew-result-popup { position:absolute !important; top:50% !important; left:50% !important; transform:translate(-50%, -50%) scale(0.8) !important; background:#d4c2a5 !important; border:2px solid #5a3d22 !important; padding:20px 30px !important; border-radius:2px !important; box-shadow:0 15px 35px rgba(0,0,0,0.9), inset 0 0 20px rgba(90,60,30,0.2) !important; z-index:100 !important; display:none; opacity:0 !important; transition:all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) !important; pointer-events:auto !important; cursor:default !important; }
        .tf-brew-result-popup.is-visible { display:block !important; opacity:1 !important; transform:translate(-50%, -50%) scale(1) !important; }
        .tf-brew-result-text { font-family:"Uncial Antiqua", serif !important; font-size:16px !important; color:#1a0f08 !important; text-align:center !important; line-height:1.4 !important; margin-top:10px !important; cursor:default !important; }
        .tf-brew-result-close { position:absolute !important; top:5px !important; right:8px !important; font-size:16px !important; color:#5a3d22 !important; cursor:pointer !important; font-weight:bold !important; border:none !important; background:none !important; }
        .tf-brew-result-close:hover { color:#8a2424 !important; }

        .tf-secret-compartment-wrapper { position:absolute !important; bottom:0px !important; right:0px !important; width:190px !important; height:40px !important; overflow:hidden !important; border-radius:2px !important; border:1px solid rgba(26,11,5,0.8) !important; background:#1e130b !important; box-shadow:inset 0 2px 4px rgba(0,0,0,0.8) !important; z-index:20 !important; cursor:default !important; }
        .tf-hidden-cryptex { position:absolute !important; inset:0 !important; display:flex !important; align-items:center !important; justify-content:center !important; padding-right:10px !important; cursor:default !important; }
        .tf-cryptex-assembly { display:flex !important; flex-direction:row !important; flex-wrap:nowrap !important; gap:2px !important; margin:0 !important; padding:0 !important; border:none !important; background:transparent !important; cursor:default !important; }
        .tf-cryptex-wheel { width:24px !important; height:36px !important; background:#c8a464 !important; border:1px solid #3a2612 !important; display:flex !important; flex-direction:column !important; align-items:center !important; justify-content:space-between !important; cursor:ns-resize !important; touch-action:none !important; position:relative !important; overflow:hidden !important; }
        .tf-cryptex-wheel::before { content:"" !important; position:absolute !important; top:13px !important; left:0 !important; right:0 !important; height:10px !important; border-top:1px solid rgba(122, 28, 28, 0.4) !important; border-bottom:1px solid rgba(122, 28, 28, 0.4) !important; pointer-events:none !important; }
        .tf-wheel-prev, .tf-wheel-next { font-size:8px !important; color:rgba(35,23,13,0.45) !important; pointer-events:none !important; line-height:10px !important; }
        .tf-wheel-curr { font-family:"Uncial Antiqua",serif !important; font-size:16px !important; font-weight:normal !important; color:#1b0f08 !important; pointer-events:none !important; line-height:16px !important; z-index:2 !important; }
        
        .tf-secret-wood-panel { position:absolute !important; inset:0 !important; background:#d4c2a5 !important; cursor:grab !important; display:flex !important; align-items:center !important; justify-content:center !important; transition:transform 0.4s ease !important; z-index:5 !important; border-left:1px dashed rgba(132,102,53,0.6) !important; }
        .tf-secret-wood-panel.is-open { transform:translateX(100%) !important; }
        .tf-secret-wood-panel.is-dragging { transition:none !important; cursor:grabbing !important; }

        .tf-grimoire-list { width:100% !important; height:100% !important; overflow-y:auto !important; display:flex !important; flex-direction:column !important; gap:10px !important; padding-right:5px !important; cursor:default !important; }
        .tf-recipe-entry { border:1px solid rgba(132,102,53,0.6) !important; padding:10px !important; background:rgba(227,210,179,0.4) !important; cursor:pointer !important; border-radius:3px !important; text-align:left !important; margin-bottom:10px !important; }
        .tf-recipe-title { font-family:"Uncial Antiqua",serif !important; font-size:13px !important; color:#3e2615 !important; margin-bottom:4px !important; cursor:pointer !important; }
        .tf-recipe-body { font-size:12px !important; color:#1f140b !important; display:none !important; margin-top:6px !important; padding-top:6px !important; border-top:1px dotted rgba(132,102,53,0.4) !important; cursor:default !important; }
        .tf-recipe-entry.is-open .tf-recipe-body { display:block !important; }

        .tf-modal-parchment { width:320px !important; background:#e3d2b3 !important; border:1px solid #846635 !important; padding:18px !important; text-align:center !important; box-shadow:0 10px 30px rgba(0,0,0,0.8) !important; position:relative !important; border-radius:3px !important; pointer-events:auto !important; z-index:9999998 !important; cursor:default !important; }
        .tf-modal-close { position:absolute !important; top:8px !important; right:12px !important; background:transparent !important; border:none !important; font-size:14px !important; color:#4a3423 !important; cursor:pointer !important; }
        .tf-modal-img-wrap { width:80px !important; height:80px !important; margin:0 auto 10px auto !important; display:flex !important; align-items:center !important; justify-content:center !important; border:1px dashed #846635 !important; border-radius:4px !important; background:rgba(56,36,22,0.1) !important; cursor:default !important; }
        .tf-modal-img-wrap img { max-width:80% !important; max-height:80% !important; object-fit:contain !important; pointer-events:none !important; }
        .tf-modal-img-wrap span { font-size:36px !important; filter:sepia(0.5) !important; display:block !important; line-height:1 !important; cursor:default !important; }
        .tf-modal-title { font-family:"Uncial Antiqua",serif !important; font-size:16px !important; color:#1a0f08 !important; margin:0 0 10px 0 !important; border-bottom:1px solid rgba(90, 60, 30, 0.5) !important; padding-bottom:6px !important; cursor:default !important; }
        .tf-modal-desc { font-family:Georgia,serif !important; font-size:12px !important; line-height:16px !important; color:#2b1b10 !important; text-align:justify !important; cursor:default !important; }
        
        #tf-drag-ghost { position:fixed !important; top:-200px; left:-200px; width:46px !important; height:46px !important; margin-left:-23px !important; margin-top:-23px !important; pointer-events:none !important; z-index:9999999 !important; display:none; align-items:center !important; justify-content:center !important; filter:drop-shadow(0 10px 15px rgba(0,0,0,0.85)) !important; }
        #tf-drag-ghost.is-dragging { display:flex !important; }
        #tf-drag-ghost img { max-width:80% !important; max-height:80% !important; object-fit:contain !important; }
        #tf-drag-ghost span { font-size:30px !important; line-height:1 !important; display:block !important; }

        #tf-tooltip { position:fixed !important; background:#f4e4bc !important; border:2px solid #8b4513 !important; padding:4px 8px !important; color:#4a3423 !important; font-family:'Courier New', Courier, monospace !important; font-size:11px !important; font-weight:bold !important; border-radius:4px !important; display:none; z-index:9999999 !important; pointer-events:none !important; box-shadow:3px 3px 5px rgba(0,0,0,0.4) !important; white-space:nowrap !important; }
        </style>
        <div id="tf-drag-ghost"></div>
        <div id="tf-tooltip"></div>
        <script id="tf-engine-js">
        (function() {
            if (window.TF_Engine_Loaded) return; window.TF_Engine_Loaded = true;
            const TF_Config = {"ajax_url":"https:\/\/matolanorbert.hu\/wp-admin\/admin-ajax.php","nonce":"e904dbedbe","items":{"36":{"id":36,"title":"R\u00e9gi R\u00e9zkulcs","type":"tool","emoji":"\ud83d\udddd","image":"","reward_text":"A M\u0171helyben h\u00fazd r\u00e1 a Z\u00e1rt Bor\u00edt\u00e9kra!","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"37":{"id":37,"title":"Viaszpecs\u00e9tes Bor\u00edt\u00e9k","type":"locked","emoji":"\u2709","image":"","reward_text":"A bor\u00edt\u00e9kban egy elfeledett, t\u00f6bboldalas k\u00e9zirat lapult.\n---\nII. oldal: \u201eAki az \u00c9jjell\u00e1t\u00f3 Elix\u00edrt k\u00edv\u00e1nja megf\u0151zni, h\u00fazzon egym\u00e1s mell\u00e9 Sz\u00e1r\u00edtott Holdf\u00fcvet \u00e9s Por\u00edtott Borosty\u00e1nt a M\u0171hely asztal\u00e1n...\u201d\n---\nIII. oldal: \u201eAz \u00c1loml\u00e1t\u00f3 F\u0151zethez k\u00e9t r\u00e9sz Sz\u00e1r\u00edtott Holdf\u0171 \u00e9s egy \u00c9jf\u00e9li Harmatgomba sz\u00fcks\u00e9ges.\u201d","req_item_id":36,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"38":{"id":38,"title":"Holdf\u00e9ny L\u00e1mp\u00e1s","type":"tool","emoji":"\ud83c\udfee","image":"","reward_text":"Vedd k\u00e9zbe ezt a l\u00e1mp\u00e1st! Am\u00edg akt\u00edv, az eg\u00e9rmutat\u00f3d f\u00e9nyk\u00f6re felfedi a [titkos_tinta] elemeket az oldalon.","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"39":{"id":39,"title":"Hajnali Harmatcsepp","type":"daily","emoji":"\u2727","image":"","reward_text":"Tiszta esszencia, amellyel az alv\u00f3 n\u00f6v\u00e9nyeket t\u00e1pl\u00e1lhatod a M\u0171helyben.","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"40":{"id":40,"title":"Alv\u00f3 Holdvir\u00e1g","type":"evolving","emoji":"\ud83c\udf31","image":"","reward_text":"A Holdvir\u00e1g kiny\u00edlt! Ez\u00fcst\u00f6s szirmai k\u00f6z\u00f6tt egy \u0151si dallam csend\u00fcl fel.","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":3,"ink_clue":""},"41":{"id":41,"title":"Az \u00cdr\u00f3asztal Titkos Rekesze","type":"code_locked","emoji":"\ud83d\udcdc","image":"https:\/\/matolanorbert.hu\/wp-content\/uploads\/2026\/06\/wall.png","reward_text":"A z\u00e1rszerkezet kattanva engedett! Megtal\u00e1ltad a rejtett napl\u00f3bejegyz\u00e9st.","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":3,"ink_clue":"BAGOLY"},"51":{"id":51,"title":"Cseresznyefa Nagy\u00edt\u00f3 & M\u00e9cses","type":"tool","emoji":"\ud83d\udd0d","image":"","reward_text":"K\u00fcl\u00f6nleges optikai lencse \u00e9s m\u00e9cses. Felfedi a [titkos_tinta] \u00e9s [titkos_parazs] sorokat, ha pedig k\u00e9zbe veszed, a [titkos_vizjel] jegyzeteket is kibogar\u00e1szhatod vele!","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"52":{"id":52,"title":"Alv\u00f3 Holdvir\u00e1g Mag","type":"evolving","emoji":"\ud83c\udf30","image":"","reward_text":"A Holdvir\u00e1g teljes pomp\u00e1j\u00e1ban kiny\u00edlt! Ez\u00fcst\u00f6s szirmai k\u00f6z\u00f6tt egy \u0151si feljegyz\u00e9s v\u00e1lt olvashat\u00f3v\u00e1.","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":3,"ink_clue":""},"53":{"id":53,"title":"T\u00f6r\u00f6tt Ir\u00e1nyt\u0171 H\u00e1z","type":"fragment","emoji":"\u2699","image":"","reward_text":"S\u00e1rgar\u00e9z ir\u00e1nyt\u0171h\u00e1z, amelyb\u0151l hi\u00e1nyzik a m\u00e1gnest\u0171.","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"54":{"id":54,"title":"M\u00e1gnesezett Csillagt\u0171","type":"fragment","emoji":"\ud83e\udded","image":"","reward_text":"Finoman megmunk\u00e1lt ac\u00e9lt\u0171. Csoportos\u00edtsd a h\u00e1z\u00e1val a M\u0171helyben!","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"55":{"id":55,"title":"Asztr\u00e1lis Ir\u00e1nyt\u0171","type":"craftable","emoji":"\u2638","image":"","reward_text":"Sikeresen \u00f6sszeillesztetted a polcon!","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[67,68],"crush_result_id":0,"req_essence":1,"ink_clue":""},"56":{"id":56,"title":"Sz\u00e1r\u00edtott Holdf\u0171","type":"ingredient","emoji":"\ud83c\udf3f","image":"","reward_text":"Dobd az \u00fcstbe m\u00e1sodikk\u00e9nt!","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"57":{"id":57,"title":"Por\u00edtott Borosty\u00e1n","type":"ingredient","emoji":"\u26b1","image":"","reward_text":"Finomra \u0151r\u00f6lt feny\u0151gyanta-k\u0151zet. M\u00e1s alapanyagokkal csoportos\u00edtva elix\u00edrr\u00e9 f\u0151zhet\u0151.","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"58":{"id":58,"title":"\u00c9jf\u00e9li Harmatgomba","type":"ingredient","emoji":"\ud83c\udf44","image":"","reward_text":"Ritka, k\u00e9kesen dereng\u0151 gomba. K\u00e9t Sz\u00e1r\u00edtott Holdf\u0171vel kombin\u00e1lva \u00c1loml\u00e1t\u00f3 F\u0151zet k\u00e9sz\u00edthet\u0151 bel\u0151le.","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"59":{"id":59,"title":"\u00c9jjell\u00e1t\u00f3 Elix\u00edr","type":"potion","emoji":"\ud83e\uddea","image":"","reward_text":"Elk\u00e9sz\u00fclt a f\u0151zet!","req_item_id":0,"req_recipe_id":80,"req_heat":3,"req_fragments":[84,56,69],"crush_result_id":0,"req_essence":1,"ink_clue":""},"60":{"id":60,"title":"\u00c1loml\u00e1t\u00f3 F\u0151zet","type":"potion","emoji":"\u2697","image":"","reward_text":"Elk\u00e9sz\u00fclt a f\u0151zet az \u00fcstben!","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[56,56,69],"crush_result_id":0,"req_essence":1,"ink_clue":""},"61":{"id":61,"title":"Titkos Rekesz","type":"code_locked","emoji":"\ud83d\udcdc","image":"","reward_text":"A Kriptex t\u00e1rcs\u00e1i a hely\u00fckre \u00e1lltak! Megtal\u00e1ltad a rejtett napl\u00f3bejegyz\u00e9st.","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":"BAGOLY"},"62":{"id":62,"title":"Rejtett Fi\u00f3k Kincse","type":"simple","emoji":"\ud83c\udffa","image":"","reward_text":"A helyes ritmus\u00fa kopogtat\u00e1sra kipattant az \u00edr\u00f3asztal rejtett oldalfi\u00f3kja!","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"63":{"id":63,"title":"Z\u00e1rt Bor\u00edt\u00e9k","type":"locked","emoji":"\u2709","image":"","reward_text":"Kiny\u00edlt a titkos lev\u00e9l!","req_item_id":36,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"64":{"id":64,"title":"Nagy\u00edt\u00f3 & M\u00e9cses","type":"tool","emoji":"\ud83d\udd0d","image":"","reward_text":"Felfedi a [titkos_tinta] \u00e9s [titkos_parazs] sorokat, k\u00e9zbe v\u00e9ve a [titkos_vizjel]-et is!","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"65":{"id":65,"title":"Hajnali Harmat","type":"daily","emoji":"\u2727","image":"","reward_text":"Az asztalr\u00f3l h\u00fazd r\u00e1 a polcon l\u00e9v\u0151 alv\u00f3 magra!","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"66":{"id":66,"title":"Alv\u00f3 Mag","type":"evolving","emoji":"\ud83c\udf30","image":"","reward_text":"Kiny\u00edlt!","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":3,"ink_clue":""},"67":{"id":67,"title":"T\u00f6r\u00f6tt Ir\u00e1nyt\u0171","type":"fragment","emoji":"\u2699","image":"","reward_text":"H\u00fazd r\u00e1 a Csillagt\u0171re a polcon!","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"68":{"id":68,"title":"Csillagt\u0171","type":"fragment","emoji":"\ud83e\udded","image":"","reward_text":"H\u00fazd \u00f6ssze a T\u00f6r\u00f6tt Ir\u00e1nyt\u0171vel a polcon!","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"69":{"id":69,"title":"Krist\u00e1lypor","type":"ingredient","emoji":"\u2728","image":"","reward_text":"Finomra \u0151r\u00f6lt krist\u00e1ly. Dobd az \u00fcstbe!","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"70":{"id":70,"title":"Nyers Holdkrist\u00e1ly","type":"crushable","emoji":"\ud83d\udc8e","image":"","reward_text":"H\u00fazd az asztalon l\u00e9v\u0151 mozs\u00e1rba, \u00e9s koppints r\u00e1 3-szor!","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":69,"req_essence":1,"ink_clue":""},"71":{"id":71,"title":"Titkos Rekesz (Kriptexhez)","type":"code_locked","emoji":"\ud83d\udcdc","image":"","reward_text":"A Kriptex kinyitotta!","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":"BAGOLY"},"72":{"id":72,"title":"Csillagkapu (Asztrol\u00e1biumhoz)","type":"locked","emoji":"\ud83c\udf0c","image":"","reward_text":"Az Asztrol\u00e1bium kinyitotta!","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"73":{"id":73,"title":"Arany Fi\u00f3k (M\u00e9rleghez)","type":"locked","emoji":"\ud83c\udffa","image":"","reward_text":"A M\u00e9rleg kiegyens\u00falyoz\u00e1sa kinyitotta!","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"80":{"id":80,"title":"Elfeledett Lapt\u00f6red\u00e9k","type":"recipe_page","emoji":"\ud83d\udcc4","image":"","reward_text":"Titkos \u00c9jjell\u00e1t\u00f3 Elix\u00edr: Tiszt\u00edtott V\u00edz, Sz\u00e1r\u00edtott Holdf\u0171, Krist\u00e1lypor. Magas l\u00e1ngon (3).","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""},"84":{"id":84,"title":"Tiszt\u00edtott V\u00edz","type":"ingredient","emoji":"\ud83d\udca7","image":"","reward_text":"Tiszta folyad\u00e9k alap.","req_item_id":0,"req_recipe_id":0,"req_heat":0,"req_fragments":[],"crush_result_id":0,"req_essence":1,"ink_clue":""}},"initial_state":{"collected":[],"unlocked_locks":[],"evolved":[],"feed_counts":[],"ingredients":[],"essence":0,"last_daily":"","server_rev":0}};
            const CRYPTEX_CHARS = ['·','A','Á','B','C','D','E','É','F','G','H','I','Í','J','K','L','M','N','O','Ó','Ö','Ő','P','Q','R','S','T','U','Ú','Ü','Ű','V','W','X','Y','Z','0','1','2','3','4','5','6','7','8','9'];
            const itemsDB = TF_Config.items || {};
            let userState = normalizeState(TF_Config.initial_state);
            let cauldronContents = [null, null, null]; let cauldronHeat = 0; let mortarContent = null; let mortarHits = 0; let dragContext = null; let isBrewing = false;
            let panelDragContext = null;

            function getEmptyState() { return { collected: [], unlocked_locks: [], evolved: [], feed_counts: {}, ingredients: {}, essence: 0 }; }
            function normalizeState(rawState) {
                const st = Object.assign(getEmptyState(), rawState || {});
                st.collected = (st.collected || []).map(Number); st.unlocked_locks = (st.unlocked_locks || []).map(Number); st.evolved = (st.evolved || []).map(Number);
                if (!st.ingredients || typeof st.ingredients !== 'object') st.ingredients = {}; return st;
            }
            function applyServerState(state) { userState = normalizeState(state); refreshAllUI(); }
            function getIngredientCount(itemId) { return (userState.ingredients && userState.ingredients[itemId]) ? Number(userState.ingredients[itemId]) : 0; }
            function isLockOpened(item) { return !item || item.type !== 'locked' || userState.unlocked_locks.includes(Number(item.id)); }
            function getDisplayImage(item) { return item.image; }
            function getDisplayEmoji(item) { return item.emoji; }

            function ensureDragGhost() { let g = document.getElementById('tf-drag-ghost'); if (!g) { g = document.createElement('div'); g.id = 'tf-drag-ghost'; document.body.appendChild(g); } return g; }
            function startCustomDrag(e, mode, itemId, slotIdx = -1) {
                if (isBrewing) return;
                const item = itemsDB[itemId]; if (!item) return;
                e.preventDefault(); e.stopPropagation(); const ghost = ensureDragGhost();
                ghost.innerHTML = getDisplayImage(item) ? '<img src="'+getDisplayImage(item)+'">' : '<span>'+getDisplayEmoji(item)+'</span>';
                ghost.style.left = e.clientX + 'px'; ghost.style.top = e.clientY + 'px'; ghost.classList.add('is-dragging');
                dragContext = { mode: mode, itemId: itemId, slotIdx: slotIdx };
                const tt = document.getElementById('tf-tooltip'); if(tt) tt.style.display = 'none';
            }

            document.addEventListener('pointerdown', function(e) {
                const wp = e.target.closest('#tf-secret-wood-panel');
                if (wp) {
                    e.preventDefault(); e.stopPropagation();
                    panelDragContext = { el: wp, startX: e.clientX, currX: 0 };
                    wp.style.transition = 'none';
                    wp.classList.add('is-dragging');
                    wp.setPointerCapture(e.pointerId);
                }
            });

            document.addEventListener('pointermove', function(e) {
                if (panelDragContext) {
                    e.preventDefault(); e.stopPropagation();
                    let diff = e.clientX - panelDragContext.startX;
                    if (diff < 0) diff = 0; if (diff > 180) diff = 180;
                    panelDragContext.currX = diff;
                    panelDragContext.el.style.transform = 'translateX(' + diff + 'px)';
                }
                
                const tt = document.getElementById('tf-tooltip');
                if (dragContext) {
                    if (tt) tt.style.display = 'none';
                    const ghost = ensureDragGhost(); ghost.style.left = e.clientX + 'px'; ghost.style.top = e.clientY + 'px';
                    document.querySelectorAll('.is-drop-target').forEach(el => el.classList.remove('is-drop-target'));
                    const under = document.elementFromPoint(e.clientX, e.clientY); if (!under) return;
                    const item = itemsDB[dragContext.itemId];
                    if (item.type === 'ingredient') { const slot = under.closest('.tf-alchemy-slot.cauldron-slot'); if (slot) slot.classList.add('is-drop-target'); }
                    else if (item.type === 'crushable') { const slot = under.closest('.tf-alchemy-slot.mortar-slot'); if (slot && !mortarContent) slot.classList.add('is-drop-target'); }
                    else if (item.type === 'tool') { const row = under.closest('.tf-grid-square.is-locked'); if (row) row.classList.add('is-drop-target'); }
                    else if (item.type === 'fragment') { const row = under.closest('.tf-grid-square[data-type="fragment"]'); if (row && Number(row.dataset.itemId) !== item.id) row.classList.add('is-drop-target'); }
                } else if (!panelDragContext) {
                    let target = e.target.closest('[data-tooltip-text]');
                    if (target && tt) {
                        tt.innerText = target.dataset.tooltipText; tt.style.display = 'block'; tt.style.left = e.clientX + 15 + 'px'; tt.style.top = e.clientY + 15 + 'px';
                    } else if (tt) { tt.style.display = 'none'; }
                }
            });

            document.addEventListener('pointerup', function(e) {
                if (panelDragContext) {
                    const el = panelDragContext.el;
                    el.classList.remove('is-dragging');
                    el.style.transition = 'transform 0.4s ease';
                    if (panelDragContext.currX > 90) { el.style.transform = 'translateX(100%)'; el.classList.add('is-open'); }
                    else { el.style.transform = 'translateX(0)'; el.classList.remove('is-open'); }
                    el.releasePointerCapture(e.pointerId);
                    panelDragContext = null;
                }

                if (!dragContext) return; const ctx = dragContext; dragContext = null;
                const ghost = ensureDragGhost(); ghost.classList.remove('is-dragging');
                document.querySelectorAll('.is-drop-target').forEach(el => el.classList.remove('is-drop-target'));
                const under = document.elementFromPoint(e.clientX, e.clientY);
                const item = itemsDB[ctx.itemId];
                if (item.type === 'ingredient') {
                    const slot = under ? under.closest('.tf-alchemy-slot.cauldron-slot') : null;
                    if (slot) { const sIdx = Number(slot.dataset.slotIdx); if(ctx.slotIdx !== -1) { cauldronContents[ctx.slotIdx] = cauldronContents[sIdx]; } cauldronContents[sIdx] = ctx.itemId; renderAlchemy(); }
                    else if (ctx.slotIdx !== -1) { cauldronContents[ctx.slotIdx] = null; renderAlchemy(); }
                } else if (item.type === 'crushable') {
                    const slot = under ? under.closest('.tf-alchemy-slot.mortar-slot') : null;
                    if (slot && !mortarContent) { mortarContent = item.id; mortarHits = 0; renderAlchemy(); }
                } else if (item.type === 'tool') {
                    const row = under ? under.closest('.tf-grid-square.is-locked') : null;
                    if (row) { const rId = Number(row.dataset.itemId); sendAction('unlock_lock', rId, { key_id: ctx.itemId }, () => { openItemModal(itemsDB[rId]); }); }
                } else if (item.type === 'fragment') {
                    const row = under ? under.closest('.tf-grid-square[data-type="fragment"]') : null;
                    if (row) {
                        const rId = Number(row.dataset.itemId);
                        if (rId !== ctx.itemId) {
                            const sorted = [ctx.itemId, rId].sort((a,b)=>a-b).join(',');
                            const match = Object.values(itemsDB).find(it => it.type==='craftable' && Array.isArray(it.req_fragments) && [...it.req_fragments].map(Number).sort((a,b)=>a-b).join(',') === sorted);
                            if (match) sendAction('craft', Number(match.id), {}, () => { openItemModal(itemsDB[match.id]); });
                        }
                    }
                }
            });

            function updateCryptexWheelDisplay(wheelEl, newIndex) {
                const len = CRYPTEX_CHARS.length; const idx = ((newIndex % len) + len) % len;
                wheelEl.dataset.index = String(idx);
                const pEl = wheelEl.querySelector('.tf-wheel-prev'); const cEl = wheelEl.querySelector('.tf-wheel-curr'); const nEl = wheelEl.querySelector('.tf-wheel-next');
                if (pEl) pEl.textContent = CRYPTEX_CHARS[(idx - 1 + len) % len];
                if (cEl) cEl.textContent = CRYPTEX_CHARS[idx];
                if (nEl) nEl.textContent = CRYPTEX_CHARS[(idx + 1) % len];
            }

            function checkCryptex() {
                const wheels = document.querySelectorAll('.tf-cryptex-wheel');
                let val = ''; wheels.forEach(w => { const ch = CRYPTEX_CHARS[Number(w.dataset.index || 0)] || ''; if (ch !== '·') val += ch; }); val = val.trim();
                if (!val) return;
                const match = Object.values(itemsDB).find(it => it.type === 'code_locked' && (it.ink_clue || '').toUpperCase() === val);
                if (match && !userState.collected.includes(Number(match.id))) {
                    sendAction('unlock_code', 0, { code: val }, (resData) => {
                        wheels.forEach(w => updateCryptexWheelDisplay(w, 0));
                        if (resData && resData.unlocked_id && itemsDB[resData.unlocked_id]) { setTimeout(() => openItemModal(itemsDB[resData.unlocked_id]), 900); }
                    });
                }
            }

            function initCryptexWheels() {
                document.querySelectorAll('.tf-cryptex-wheel').forEach(wheel => {
                    if (wheel._tfBound) return; wheel._tfBound = true;
                    let dragging = false; let startY = 0; let totalMoved = 0; let lastWheelStepTime = 0; let wheelDeltaAccum = 0; let cryptexTimeout = null;
                    wheel.addEventListener('pointerdown', e => { e.preventDefault(); e.stopPropagation(); dragging = true; startY = e.clientY; totalMoved = 0; wheel.setPointerCapture(e.pointerId); });
                    wheel.addEventListener('pointermove', e => {
                        if (!dragging) return; e.preventDefault(); e.stopPropagation(); const dy = e.clientY - startY; totalMoved += Math.abs(dy);
                        if (Math.abs(dy) >= 30) { updateCryptexWheelDisplay(wheel, Number(wheel.dataset.index || 0) + (dy > 0 ? -1 : 1)); startY = e.clientY; }
                    });
                    wheel.addEventListener('pointerup', e => {
                        if (!dragging) return; dragging = false; try { wheel.releasePointerCapture(e.pointerId); } catch (err) {}
                        if (totalMoved < 6) {
                            const r = wheel.getBoundingClientRect(); const cy = e.clientY - r.top; const cur = Number(wheel.dataset.index || 0);
                            if (cy < r.height * 0.42) updateCryptexWheelDisplay(wheel, cur - 1); else if (cy > r.height * 0.58) updateCryptexWheelDisplay(wheel, cur + 1);
                        }
                        clearTimeout(cryptexTimeout); cryptexTimeout = setTimeout(checkCryptex, 400);
                    });
                    wheel.addEventListener('wheel', e => {
                        e.preventDefault(); e.stopPropagation(); const now = performance.now();
                        if (now - lastWheelStepTime < 180) return;
                        wheelDeltaAccum += e.deltaY;
                        if (Math.abs(wheelDeltaAccum) >= 20) { updateCryptexWheelDisplay(wheel, Number(wheel.dataset.index || 0) + (wheelDeltaAccum > 0 ? 1 : -1)); wheelDeltaAccum = 0; lastWheelStepTime = now; clearTimeout(cryptexTimeout); cryptexTimeout = setTimeout(checkCryptex, 400); }
                    }, { passive: false });
                });
            }

            function ensureItemModal() {
                let overlay = document.getElementById('altar-modal-overlay');
                let modal = document.getElementById('tf-item-modal-small');
                if (modal && modal.parentElement !== overlay) { modal.remove(); modal = null; }
                if (!modal) {
                    modal = document.createElement('div'); modal.id = 'tf-item-modal-small'; modal.className = 'tf-modal-parchment'; modal.style.position = 'absolute'; modal.style.display = 'none';
                    modal.innerHTML = '<button type="button" class="tf-modal-close">&#10005;</button><div class="tf-modal-img-wrap" id="tf-modal-img"></div><h3 class="tf-modal-title" id="tf-modal-title"></h3><div class="tf-modal-desc" id="tf-modal-desc" style="max-height:220px;overflow-y:auto;"></div>';
                    if (overlay) overlay.appendChild(modal);
                    modal.addEventListener('click', function(e) { if (e.target.classList.contains('tf-modal-close')) { e.preventDefault(); e.stopPropagation(); modal.style.display = 'none'; } });
                } return modal;
            }

            function openItemModal(item) {
                const modal = ensureItemModal();
                const dImg = getDisplayImage(item); const dEmoji = getDisplayEmoji(item);
                modal.querySelector('#tf-modal-img').innerHTML = dImg ? '<img src="' + dImg + '">' : '<span class="tf-emoji-icon">' + dEmoji + '</span>';
                modal.querySelector('#tf-modal-title').textContent = item.title;
                let rawText = item.reward_text || 'Ereklye.';
                if (item.type === 'ingredient' || item.type === 'potion') rawText += '<br><br>(Készleten: ' + getIngredientCount(item.id) + ' db)';
                if (item.type === 'crushable') rawText += '<br><br>Ezt a kristályt a Mozsárba kell dobnod, hogy össze tudd törni!';
                modal.querySelector('#tf-modal-desc').innerHTML = rawText.replace(/\n/g, '<br>');
                modal.style.display = 'block';
            }

            function syncWithServer() {
                const formData = new FormData(); formData.append('action', 'tf_sync_state'); formData.append('nonce', TF_Config.nonce);
                fetch(TF_Config.ajax_url, { method: 'POST', body: formData, credentials: 'same-origin' }).then(r => r.json()).then(res => { if (res.success && res.data && res.data.state) applyServerState(res.data.state); });
            }

            function sendAction(actionType, itemId, extra = {}, onSuccess = null, onError = null) {
                const formData = new FormData(); formData.append('action', 'tf_action'); formData.append('nonce', TF_Config.nonce); formData.append('action_type', actionType); formData.append('item_id', itemId);
                Object.keys(extra).forEach(k => formData.append(k, extra[k]));
                fetch(TF_Config.ajax_url, { method: 'POST', body: formData, credentials: 'same-origin' }).then(r => r.json()).then(res => { if (res.success) { applyServerState(res.data.state); if (onSuccess) onSuccess(res.data); } else { if (onError) onError(res.data); } });
            }

            document.addEventListener('click', function(e) {
                const popup = document.getElementById('tf-brew-result-popup');
                if (popup && popup.classList.contains('is-visible') && e.target.closest('.tf-brew-result-close')) {
                    e.preventDefault(); e.stopPropagation();
                    popup.classList.remove('is-visible');
                    const storedCraftId = popup.dataset.craftedItemId;
                    if (storedCraftId && itemsDB[storedCraftId]) openItemModal(itemsDB[storedCraftId]);
                    popup.dataset.craftedItemId = '';
                    return;
                }
                
                const openGrimoireBtn = e.target.closest('.tf-open-grimoire-btn');
                if (openGrimoireBtn) {
                    e.preventDefault(); e.stopPropagation();
                    const modal = ensureItemModal();
                    modal.innerHTML = '<button type="button" class="tf-modal-close">&#10005;</button><h3 class="tf-modal-title">Receptkönyv</h3><div class="tf-grimoire-list-modal" id="tf-grimoire-list-modal" style="width:100%;height:220px;"></div>';
                    const list = modal.querySelector('#tf-grimoire-list-modal');
                    const pages = Object.values(itemsDB).filter(it => it.type === 'recipe_page');
                    pages.forEach(p => {
                        const isCol = userState.collected.includes(Number(p.id));
                        const div = document.createElement('div'); div.className = 'tf-recipe-entry';
                        div.innerHTML = '<div class="tf-recipe-title">'+(isCol?p.title:'Szakadt Laptöredék')+'</div><div class="tf-recipe-body">'+(isCol?p.reward_text.replace(/\n/g,'<br>'):'A recept hiányzik. Keresd meg a világban!')+'</div>';
                        list.appendChild(div);
                    });
                    modal.style.display = 'block';
                    if(typeof jQuery !== 'undefined' && jQuery.fn.mCustomScrollbar) jQuery('#tf-grimoire-list-modal').mCustomScrollbar("vertical",300,"easeOutCirc",1.05,"auto","yes","no",0);
                    return;
                }

                if (e.target.closest('.tf-brewing-overlay') || e.target.closest('.tf-brew-result-popup')) { e.preventDefault(); e.stopPropagation(); return; }

                const burner = e.target.closest('#tf-burner-ctrl');
                if (burner) { e.preventDefault(); e.stopPropagation(); if (isBrewing) return; cauldronHeat = (cauldronHeat + 1) % 4; burner.className = 'tf-burner-control heat-' + cauldronHeat; return; }
                
                const stirBtn = e.target.closest('.tf-cauldron-stir-btn');
                if (stirBtn) {
                    e.preventDefault(); e.stopPropagation();
                    if (isBrewing) return;
                    const seq = cauldronContents.filter(Boolean).join(',');
                    if (!seq) return;
                    isBrewing = true;
                    stirBtn.style.display = 'none';
                    const pourBtn = document.querySelector('.tf-cauldron-pour-btn'); if (pourBtn) pourBtn.style.display = 'none';
                    const overlayDiv = document.getElementById('tf-brewing-overlay');
                    if (overlayDiv) overlayDiv.classList.add('is-active');
                    
                    let clockSeconds = 0; const clockHand = document.getElementById('tf-clock-hand');
                    const timerInterval = setInterval(() => { clockSeconds++; if(clockHand) clockHand.style.transform = `translateX(-50%) rotate(${clockSeconds * 30}deg)`; }, 833);
                    
                    setTimeout(() => {
                        clearInterval(timerInterval); if(clockHand) clockHand.style.transform = `translateX(-50%) rotate(0deg)`;
                        isBrewing = false; if (overlayDiv) overlayDiv.classList.remove('is-active');
                        stirBtn.style.display = ''; if (pourBtn) pourBtn.style.display = '';
                        
                        const pText = document.getElementById('tf-brew-result-text');
                        const match = Object.values(itemsDB).find(it => it.type==='potion' && Array.isArray(it.req_fragments) && it.req_fragments.join(',')===seq && Number(it.req_heat)===cauldronHeat);
                        if (match) {
                            if(pText) pText.innerHTML = 'Főzet Elkészült!<br><span style="font-family:Georgia;font-size:12px;color:#3e2615;">Tökéletes elegy.</span>';
                            sendAction('craft', Number(match.id), { consumed_cauldron: seq, cauldron_heat: cauldronHeat }, () => {
                                cauldronContents = [null,null,null]; renderAlchemy();
                                if(popup) { popup.dataset.craftedItemId = match.id; popup.classList.add('is-visible'); }
                            });
                        } else {
                            if(pText) pText.innerHTML = 'Sikertelen Elegy...<br><span style="font-family:Georgia;font-size:12px;color:#8a2424;">Az anyagok megsemmisültek.</span>';
                            sendAction('fail_craft', 0, { consumed_cauldron: seq }, () => {
                                cauldronContents = [null,null,null]; renderAlchemy();
                                if(popup) { popup.dataset.craftedItemId = ''; popup.classList.add('is-visible'); }
                            });
                        }
                    }, 10000);
                    return;
                }
                const pourBtn = e.target.closest('.tf-cauldron-pour-btn');
                if (pourBtn) { e.preventDefault(); e.stopPropagation(); if (isBrewing) return; cauldronContents = [null,null,null]; renderAlchemy(); return; }
                
                const gridSq = e.target.closest('.tf-grid-square:not(.is-silhouette)');
                if (gridSq) { e.preventDefault(); e.stopPropagation(); const pId = Number(gridSq.dataset.itemId); const pIt = itemsDB[pId]; if (pIt && (pIt.type !== 'locked' || isLockOpened(pIt))) openItemModal(pIt); return; }
                
            });

            function renderCodexGrid() {
                document.querySelectorAll('.tf-inventory-grid').forEach(grid => {
                    grid.innerHTML = '';
                    Object.values(itemsDB).forEach(it => {
                        if (it.type === 'recipe_page' || it.type === 'daily' || it.type === 'crushable') return;
                        const isCol = userState.collected.includes(Number(it.id)); const isLock = (it.type==='locked' && !isLockOpened(it));
                        const qty = getIngredientCount(it.id); if (it.type === 'ingredient' && qty <= 0) return;
                        const sq = document.createElement('div');
                        let classes = 'tf-grid-square'; if (!isCol) classes += ' is-silhouette'; else if (isLock) classes += ' is-locked';
                        if (isCol && (it.type==='tool'||it.type==='fragment'||it.type==='ingredient')) classes += ' is-draggable';
                        sq.className = classes; sq.dataset.itemId = it.id; sq.dataset.type = it.type;
                        let tt = it.title; if (isCol) tt += isLock ? ' (Lezárva)' : ((it.type==='ingredient'||it.type==='potion') ? ' (Készlet: '+qty+' db)' : ''); else tt += ' (Hiányzik)';
                        sq.dataset.tooltipText = tt;
                        const visual = getDisplayImage(it) ? '<img src="'+getDisplayImage(it)+'">' : '<span class="tf-emoji-icon">'+getDisplayEmoji(it)+'</span>';
                        sq.innerHTML = visual;
                        if (isCol && (it.type==='tool'||it.type==='fragment'||it.type==='ingredient')) { sq.addEventListener('pointerdown', e => { startCustomDrag(e, 'grid-drag', Number(it.id)); }); }
                        grid.appendChild(sq);
                    });
                });
            }

            function renderAlchemy() {
                document.querySelectorAll('.tf-alchemy-list').forEach(cont => {
                    cont.innerHTML = ''; const comb = document.createElement('div'); comb.className = 'tf-alchemy-combiner';
                    let slotsHtml = '';
                    for (let i=0; i<3; i++) {
                        const sId = cauldronContents[i]; const sIt = sId ? itemsDB[sId] : null;
                        const inner = sIt ? (getDisplayImage(sIt) ? '<img src="'+getDisplayImage(sIt)+'">' : '<span class="tf-emoji-icon">'+getDisplayEmoji(sIt)+'</span>') : '';
                        slotsHtml += '<div class="tf-alchemy-slot cauldron-slot '+(sIt?'has-item':'')+'" data-slot-idx="'+i+'">'+inner+'</div>';
                    }
                    comb.innerHTML = '<div class="tf-alchemy-slots">'+slotsHtml+'</div><div id="tf-burner-ctrl" class="tf-burner-control heat-'+cauldronHeat+'" data-tooltip-text="Hőfokszabályzó"></div><br><button type="button" class="tf-cauldron-stir-btn tf-vintage-btn">Főzés</button> <button type="button" class="tf-cauldron-pour-btn tf-vintage-btn" style="border-color:#8a2424;color:#ffaaaa;display:none;">Kiürítés</button>';
                    cont.appendChild(comb);
                    comb.querySelectorAll('.tf-alchemy-slot.has-item').forEach(slot => { slot.addEventListener('pointerdown', e => { const idx = Number(slot.dataset.slotIdx); const cId = cauldronContents[idx]; if (cId) startCustomDrag(e, 'slot-drag', cId, idx); }); });
                    if(cauldronContents.filter(Boolean).length > 0) { const pb = comb.querySelector('.tf-cauldron-pour-btn'); if(pb) pb.style.display = 'inline-block'; }
                });
            }

            function refreshAllUI() {
                initCryptexWheels();
                const today = new Date().toISOString().slice(0, 10);
                document.querySelectorAll('.tf-world-item').forEach(el => {
                    const id = Number(el.dataset.itemId); const item = itemsDB[id]; if (!item) return;
                    if (item.type === 'daily') { if (userState.last_daily === today) el.classList.add('tf-collected-hide'); else el.classList.remove('tf-collected-hide'); }
                    else if (userState.collected.includes(id)) { el.classList.add('tf-collected-hide'); }
                    else { el.classList.remove('tf-collected-hide'); }
                });
                renderCodexGrid(); renderAlchemy();
            }

            let observerTimeout = null;
            const observer = new MutationObserver((mutations) => {
                let shouldUpdate = false;
                for (let i = 0; i < mutations.length; i++) {
                    const m = mutations[i]; if (m.target && (m.target.closest('.news-spread-book') || m.target.closest('#tf-item-modal-overlay') || m.target.closest('.tf-world-item') || m.target.closest('#tf-drag-ghost'))) continue;
                    if (m.addedNodes && m.addedNodes.length > 0) { shouldUpdate = true; break; }
                }
                if (shouldUpdate) { clearTimeout(observerTimeout); observerTimeout = setTimeout(() => { refreshAllUI(); }, 90); }
            });

            function boot() { refreshAllUI(); syncWithServer(); if (document.body) observer.observe(document.body, { childList: true, subtree: true }); }
            if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', boot); else boot();
        })();
        </script>
        