/* Alissa Valley – HUD, Hotbar, Panels, Dialoge, Angeln, Tarkify, Mobile */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; font-size: calc(14px * var(--ui-scale)); }
#hud > *, #hud button { pointer-events: auto; }
.hud-card { background: rgba(30, 22, 38, 0.82); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; box-shadow: 0 4px 14px rgba(0,0,0,.3); backdrop-filter: blur(4px); }
#hud-top-left { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: calc(10px + env(safe-area-inset-left)); display: flex; flex-direction: column; gap: 8px; max-width: min(300px, 46vw); }
#hud-top-left > * { pointer-events: auto; }
.clock-time { font-size: 1.7em; font-weight: 900; letter-spacing: .03em; line-height: 1; color: #fff3cf; text-shadow: 0 2px 0 rgba(0,0,0,.35); }
.clock-date { font-size: .9em; color: var(--ink-dim); margin-top: 3px; font-weight: 700; }
.clock-weather { font-size: .85em; color: var(--muted); margin-top: 2px; }
.hud-quest { font-size: .85em; }
.hq-title { font-weight: 800; color: var(--gold); margin-bottom: 3px; }
.hq-goal { color: var(--ink-dim); line-height: 1.45; } .hq-goal.done { color: var(--green); text-decoration: line-through; opacity: .8; }
#hud-top-right { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#hud-gold { font-weight: 900; font-size: 1.25em; display: flex; align-items: center; gap: 8px; color: #ffe39a; }
.coin { width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff3b0, #f2c94c 45%, #b8862a); box-shadow: inset 0 -2px 0 rgba(0,0,0,.2), 0 0 0 2px #7a5a1a; display: inline-block; }
#hud-energy { width: 170px; }
.energy-bar { height: 12px; border-radius: 6px; background: rgba(0,0,0,.4); overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.5); }
.energy-bar span { display: block; height: 100%; transition: width .3s; }
#hud-energy small { display: block; margin-top: 4px; color: var(--ink-dim); font-weight: 700; font-size: .8em; }
#hud-buttons { display: flex; gap: 6px; }
.hud-btn { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: rgba(30,22,38,.82); font-size: 20px; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.3); }
.hud-btn:hover { background: rgba(60,48,72,.92); transform: translateY(-1px); }

/* Hotbar */
.hotbar { position: absolute; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 5px; padding: 6px; background: rgba(30,22,38,.85); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.hotbar .slot { --s: clamp(36px, 9vw, 52px); width: var(--s); height: var(--s); }
.slot { position: relative; border-radius: 10px; background: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.03)); border: 2px solid rgba(255,255,255,.1); cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; touch-action: none; }
.slot img { width: 78%; height: 78%; pointer-events: none; image-rendering: pixelated; }
.slot .qty { position: absolute; right: 3px; bottom: 1px; font-weight: 900; font-size: 12px; color: #fff; text-shadow: 0 1px 0 #000, 0 0 3px #000; pointer-events: none; }
.slot .key { position: absolute; left: 4px; top: 1px; font-size: 10px; font-weight: 800; color: rgba(255,255,255,.5); pointer-events: none; }
.slot .meter { position: absolute; left: 4px; bottom: 3px; height: 3px; border-radius: 2px; background: #5aa1c9; max-width: calc(100% - 8px); pointer-events: none; }
.slot .price { position: absolute; left: 0; right: 0; bottom: -2px; font-size: 10px; font-weight: 800; text-align: center; color: #ffe39a; text-shadow: 0 1px 0 #000; pointer-events: none; }
.slot .price.no { color: rgba(255,255,255,.35); }
.slot.sel { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(242,201,76,.35), inset 0 0 12px rgba(242,201,76,.25); transform: translateY(-2px); }
.slot:hover { border-color: rgba(255,255,255,.35); }
.slot.hot { background: linear-gradient(180deg, rgba(124,196,90,.14), rgba(124,196,90,.04)); }

/* Hinweise, Toasts, Banner */
.hint { position: absolute; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(6px); background: rgba(20,14,30,.85); padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: .92em; opacity: 0; transition: opacity .15s, transform .15s; white-space: nowrap; border: 1px solid var(--line); pointer-events: none !important; }
.hint.show { opacity: 1; transform: translateX(-50%); }
#toasts { position: absolute; right: calc(10px + env(safe-area-inset-right)); top: 190px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; pointer-events: none !important; max-width: min(360px, 70vw); }
.toast { display: flex; align-items: center; gap: 8px; background: rgba(30,22,38,.92); border: 1px solid var(--line); border-left: 4px solid var(--green); padding: 7px 12px; border-radius: 10px; font-weight: 700; font-size: .9em; box-shadow: 0 4px 12px rgba(0,0,0,.3); animation: toastIn .25s ease-out; }
.toast img { width: 24px; height: 24px; }
.toast.warn { border-left-color: var(--coral); } .toast.quest { border-left-color: var(--gold); } .toast.info { border-left-color: var(--sky); }
.toast.out { opacity: 0; transform: translateX(20px); transition: .35s; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } }
#region-banner { position: absolute; top: 18%; left: 50%; transform: translateX(-50%); text-align: center; opacity: 0; pointer-events: none !important; }
#region-banner.show { animation: banner 3.2s ease-out forwards; }
.rb-title { font-size: 2em; font-weight: 900; color: #fff3cf; text-shadow: 0 3px 0 rgba(0,0,0,.45), 0 0 24px rgba(0,0,0,.4); letter-spacing: .04em; }
.rb-sub { color: var(--ink); font-weight: 700; text-shadow: 0 2px 6px rgba(0,0,0,.8); margin-top: 4px; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, 10px); } 12%, 75% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
.tutorial-box { position: absolute; left: calc(10px + env(safe-area-inset-left)); bottom: calc(90px + env(safe-area-inset-bottom)); width: min(320px, 80vw); background: rgba(30,22,38,.92); border: 1px solid rgba(242,201,76,.5); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); animation: toastIn .3s; }
.tut-head { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); font-weight: 800; margin-bottom: 4px; }
.tut-text { line-height: 1.5; margin-bottom: 8px; font-size: .95em; }

/* Tarkify-Button */
#tarkify-btn { position: absolute; right: calc(12px + env(safe-area-inset-right)); bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; border: 1px solid rgba(127,200,240,.45); background: linear-gradient(135deg, rgba(36,40,72,.95), rgba(48,30,70,.95)); color: #e8f4ff; font: 800 14px var(--font); cursor: pointer; box-shadow: 0 6px 20px rgba(40,120,200,.35); }
#tarkify-btn:hover { filter: brightness(1.15); }
.tk-orb { width: 30px; height: 30px; border-radius: 50%; background: conic-gradient(from 0deg, #5fd3ff, #a77cff, #ff7ad9, #5fd3ff); animation: spin 6s linear infinite; box-shadow: 0 0 14px rgba(95,211,255,.7), inset 0 0 8px rgba(255,255,255,.6); position: relative; }
.tk-orb::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff, #bfe8ff 40%, #5a7bd8); }
#tarkify-btn[data-state=listening] .tk-orb { animation: spin 1s linear infinite, pulse .8s ease-in-out infinite; }
#tarkify-btn.open { box-shadow: 0 0 0 2px rgba(127,200,240,.6), 0 6px 20px rgba(40,120,200,.35); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { box-shadow: 0 0 24px rgba(255,90,120,.9); } }

/* Panels */
#panel-layer { position: fixed; inset: 0; z-index: 20; background: rgba(10,6,20,.5); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); font-size: calc(14px * var(--ui-scale)); }
.panel { width: min(960px, 96vw); max-height: min(90vh, 900px); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.panel.anim { animation: pop .18s ease-out; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.panel-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { margin: 0; font-size: 1.25em; flex: none; }
.tabs { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tab { appearance: none; border: 0; background: transparent; color: var(--ink-dim); font: 700 .95em var(--font); padding: 8px 10px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.tab.active { background: rgba(242,201,76,.16); color: var(--gold); } .tab:hover { color: var(--ink); }
.panel-head .icon-btn { margin-left: auto; }
.panel-body { padding: 14px; overflow-y: auto; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.panel-body h3 { margin: 12px 0 8px; font-size: 1.05em; }
.slot-grid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; max-width: 560px; }
.slot-grid .slot { aspect-ratio: 1; }
.slot-grid.chest { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.inv-wrap { display: grid; grid-template-columns: minmax(0, 560px) 1fr; gap: 18px; }
.inv-side { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.inv-side p { margin: 0; line-height: 1.5; }
.item-card { display: flex; gap: 10px; align-items: center; }
.item-card img { width: 48px; height: 48px; background: rgba(0,0,0,.25); border-radius: 10px; padding: 4px; }
.item-card small { display: block; color: var(--muted); }
.trash-zone { border: 2px dashed rgba(232,115,90,.5); color: #ffb08a; padding: 8px 10px; border-radius: 10px; font-size: .85em; font-weight: 700; flex: 1; text-align: center; }
#drag-ghost { position: fixed; z-index: 200; width: 44px; height: 44px; pointer-events: none; }
#drag-ghost img { width: 44px; height: 44px; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); }
#drag-ghost span { position: absolute; right: 0; bottom: 0; font-weight: 900; text-shadow: 0 1px 0 #000; }
#tooltip { position: fixed; z-index: 150; max-width: 260px; background: rgba(20,14,30,.97); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; pointer-events: none; font-size: 13px; box-shadow: var(--shadow); }
#tooltip b { display: block; } #tooltip small { color: var(--muted); } #tooltip p { margin: 4px 0 0; color: var(--ink-dim); line-height: 1.4; }
#tooltip .tt-e { color: #a8e86a; } #tooltip .tt-g { color: #ffe39a; }
.recipe-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.recipe { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.recipe > img { width: 44px; height: 44px; background: rgba(0,0,0,.25); border-radius: 10px; padding: 4px; }
.recipe.can { border-color: rgba(124,196,90,.55); } .recipe.locked { opacity: .55; } .recipe.locked > img { filter: brightness(0) opacity(.5); }
.r-info small { display: block; color: var(--muted); font-size: .8em; margin: 2px 0 4px; }
.ings { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.ing { display: inline-flex; align-items: center; gap: 3px; font-size: .8em; font-weight: 700; }
.ing img { width: 16px; height: 16px; } .ing.ok { color: #a8e86a; } .ing.no { color: #ff9a80; }
.quest-wrap { display: grid; grid-template-columns: 280px 1fr; gap: 16px; }
.quest-list { display: flex; flex-direction: column; gap: 4px; }
.quest-list h3 { margin: 6px 0 4px; font-size: .9em; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.quest-item { appearance: none; text-align: left; border: 1px solid transparent; background: var(--panel-2); color: var(--ink); padding: 8px 10px; border-radius: 10px; font: 700 .92em var(--font); cursor: pointer; }
.quest-item.active { border-color: var(--gold); background: rgba(242,201,76,.1); } .quest-item.done { opacity: .55; cursor: default; font-weight: 600; }
.tag { font-size: .7em; background: var(--gold); color: #2a1f2d; padding: 1px 6px; border-radius: 6px; margin-left: 4px; }
.quest-detail { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.quest-detail p { line-height: 1.55; }
.goal { padding: 6px 0; font-weight: 600; } .goal.done { color: var(--green); } .goal b { float: right; }
.pbar { height: 6px; border-radius: 4px; background: rgba(0,0,0,.35); margin-top: 4px; overflow: hidden; }
.pbar span { display: block; height: 100%; background: linear-gradient(90deg, #5ea24c, #a8e86a); }
.reward { color: #ffe39a; font-weight: 700; }
.map-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.map-canvas { width: 100%; max-width: 860px; height: auto; border-radius: 12px; border: 2px solid var(--line); image-rendering: auto; }
.friends { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.friend { display: grid; grid-template-columns: 56px 1fr; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; }
.friend .portrait { width: 56px; height: 56px; image-rendering: pixelated; background: radial-gradient(circle, #4f8f45, #2f5a2a); border-radius: 10px; }
.friend small { display: block; color: var(--muted); } .friend p { margin: 4px 0 0; font-size: .85em; color: var(--ink-dim); line-height: 1.45; }
.friend.unknown .portrait { filter: brightness(0) opacity(.6); }
.hearts { color: #ff7a8a; letter-spacing: 1px; font-size: .85em; }
table.stats { width: 100%; border-collapse: collapse; max-width: 560px; }
table.stats td { padding: 7px 10px; border-bottom: 1px solid var(--line); } table.stats td:last-child { text-align: right; font-weight: 800; color: var(--gold); }
/* Shop */
.shop-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; color: var(--ink-dim); flex-wrap: wrap; }
.gold-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; color: #ffe39a; background: rgba(0,0,0,.3); padding: 5px 10px; border-radius: 999px; }
.shop-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.shop-list { display: flex; flex-direction: column; gap: 5px; max-height: 56vh; overflow-y: auto; touch-action: pan-y; }
.shop-row { appearance: none; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); padding: 6px 10px; border-radius: 10px; cursor: pointer; font: 700 .95em var(--font); text-align: left; }
.shop-row img { width: 32px; height: 32px; } .shop-row .p { color: #ffe39a; } .shop-row.poor .p { color: #ff9a80; }
.shop-row.active { border-color: var(--gold); background: rgba(242,201,76,.1); }
.shop-row .svc { font-size: 24px; text-align: center; }
.shop-detail { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.shop-detail p { margin: 0; line-height: 1.5; }
.qty-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; } .qv { min-width: 44px; text-align: center; font-weight: 900; font-size: 1.1em; }
.total { font-size: 1.05em; }
.ship-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ship-item { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); border-radius: 10px; padding: 5px 9px; font: 600 .9em var(--font); cursor: pointer; }
.ship-item img { width: 24px; height: 24px; } .ship-item b { color: #ffe39a; }
.note-card { background: #efe2c2; color: #3a2a22; border-radius: 6px; padding: 16px; max-width: 440px; box-shadow: 0 8px 20px rgba(0,0,0,.35); transform: rotate(-1deg); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.note-card img { width: 40px; height: 40px; } .note-card p { margin: 0; line-height: 1.5; }
.pause-col { max-width: 340px; } .pause-col .btn { justify-content: flex-start; }
.summary-weather { font-size: 1.05em; } .summary-list { line-height: 1.8; padding-left: 18px; }
/* Bestätigung */
#confirm-layer { position: fixed; inset: 0; z-index: 60; background: rgba(10,6,20,.55); display: flex; align-items: center; justify-content: center; }
.confirm-box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; width: min(440px, 92vw); box-shadow: var(--shadow); animation: pop .15s; }
.confirm-box p { line-height: 1.55; margin: 0 0 14px; } .confirm-box .row { justify-content: flex-end; }

/* Dialog */
#dialog-box { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(780px, 96vw); z-index: 25; display: flex; gap: 14px; background: linear-gradient(180deg, rgba(44,34,54,.97), rgba(32,24,40,.97)); border: 2px solid rgba(242,201,76,.35); border-radius: 18px; padding: 14px; box-shadow: var(--shadow); cursor: pointer; font-size: calc(15px * var(--ui-scale)); animation: pop .15s; }
.dlg-portrait { flex: none; width: 88px; height: 88px; border-radius: 14px; background: radial-gradient(circle at 50% 60%, #6fae5a, #2f5a2a); border: 2px solid rgba(255,255,255,.15); overflow: hidden; }
.dlg-portrait canvas { width: 100%; height: 100%; image-rendering: pixelated; }
.dlg-main { flex: 1; min-width: 0; position: relative; }
.dlg-name { margin-bottom: 4px; } .dlg-name b { color: var(--gold); font-size: 1.05em; } .dlg-name span { color: var(--muted); font-size: .85em; } .dlg-name em { color: #ff7a8a; font-style: normal; font-size: .75em; margin-left: 6px; letter-spacing: 1px; }
.dlg-text { line-height: 1.55; min-height: 3em; white-space: pre-line; }
.dlg-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.dlg-next { position: absolute; right: 0; bottom: -4px; color: var(--gold); animation: bob 1s infinite; }
@keyframes bob { 50% { transform: translateY(3px); } }

/* Angeln */
#fishing-ui { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 15; width: min(460px, 92vw); pointer-events: none; }
.fish-card { background: rgba(30,22,38,.92); border: 2px solid rgba(127,200,240,.4); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); }
.fish-title { font-weight: 900; text-align: center; margin-bottom: 8px; color: #bfe8ff; }
.fish-bar { position: relative; height: 26px; border-radius: 13px; background: linear-gradient(90deg, #5a2a3a, #3a2a4a 50%, #5a2a3a); overflow: hidden; box-shadow: inset 0 2px 6px rgba(0,0,0,.5); }
.fish-zone { position: absolute; top: 0; bottom: 0; background: linear-gradient(180deg, rgba(124,196,90,.85), rgba(78,154,58,.85)); border-left: 2px solid #c8f0a0; border-right: 2px solid #c8f0a0; }
.fish-needle { position: absolute; top: -2px; bottom: -2px; width: 5px; background: #fff; border-radius: 3px; box-shadow: 0 0 6px rgba(255,255,255,.8); }
.fish-needle.in { background: #ffe39a; box-shadow: 0 0 10px #ffe39a; }
.fish-progress { height: 10px; border-radius: 6px; background: rgba(0,0,0,.4); margin-top: 8px; overflow: hidden; }
.fish-progress span { display: block; height: 100%; background: linear-gradient(90deg, #5fd3ff, #a8e86a); }
.fish-hint { font-size: 12.5px; color: var(--ink-dim); text-align: center; margin-top: 8px; }

/* Tarkify-Panel */
#tarkify-panel { position: fixed; right: calc(12px + env(safe-area-inset-right)); bottom: calc(70px + env(safe-area-inset-bottom)); width: min(400px, 94vw); height: min(620px, 74vh); z-index: 30; display: flex; flex-direction: column; background: linear-gradient(170deg, rgba(26,30,58,.97), rgba(40,24,60,.97)); border: 1px solid rgba(127,200,240,.35); border-radius: 20px; box-shadow: 0 16px 40px rgba(20,40,90,.5), 0 0 0 1px rgba(255,255,255,.04) inset; overflow: hidden; animation: pop .18s; font-size: calc(14px * var(--ui-scale)); }
.tk-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px; border-bottom: 1px solid rgba(127,200,240,.2); background: linear-gradient(90deg, rgba(95,211,255,.08), rgba(167,124,255,.08)); }
.tk-title { flex: 1; } .tk-title b { display: block; font-size: 1.15em; letter-spacing: .04em; background: linear-gradient(90deg, #8fe3ff, #d2a8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tk-title small { color: #9fb4d8; font-size: .78em; }
.tk-orb-big { width: 42px; height: 42px; position: relative; flex: none; }
.tk-orb-big span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(143,227,255,.6); animation: ring 3s ease-in-out infinite; }
.tk-orb-big span:nth-child(2) { inset: 6px; border-color: rgba(210,168,255,.7); animation-delay: .4s; }
.tk-orb-big span:nth-child(3) { inset: 12px; border: 0; background: radial-gradient(circle at 40% 35%, #fff, #8fe3ff 45%, #6a5ad8); box-shadow: 0 0 16px rgba(143,227,255,.8); animation: breathe 3s ease-in-out infinite; }
@keyframes ring { 50% { transform: scale(1.12); opacity: .5; } }
@keyframes breathe { 50% { transform: scale(.85); } }
#tarkify-panel[data-state=listening] .tk-orb-big span { border-color: rgba(255,110,140,.9); animation-duration: .7s; }
#tarkify-panel[data-state=listening] .tk-orb-big span:nth-child(3) { background: radial-gradient(circle at 40% 35%, #fff, #ff8aa8 45%, #d83a6a); box-shadow: 0 0 20px rgba(255,110,140,.9); animation-duration: .6s; }
#tarkify-panel[data-state=thinking] .tk-orb-big span:nth-child(1) { border-style: dashed; animation: spin 1.2s linear infinite; }
#tarkify-panel[data-state=speaking] .tk-orb-big span { animation-duration: .5s; }
.tk-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; touch-action: pan-y; -webkit-user-select: text; user-select: text; }
.tk-msg { display: flex; flex-direction: column; max-width: 88%; }
.tk-msg.user { align-self: flex-end; align-items: flex-end; }
.tk-bubble { padding: 9px 12px; border-radius: 14px; line-height: 1.5; white-space: pre-line; font-size: .95em; }
.tk-msg.bot .tk-bubble { background: rgba(143,227,255,.1); border: 1px solid rgba(143,227,255,.2); border-top-left-radius: 4px; }
.tk-msg.user .tk-bubble { background: linear-gradient(135deg, #5a6ad8, #8a5ad8); border-top-right-radius: 4px; }
.tk-msg small { color: #9fb4d8; font-size: .7em; margin-top: 2px; }
.tk-chips { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 6px; scrollbar-width: none; flex: none; }
.tk-chips .chip { white-space: nowrap; border-color: rgba(143,227,255,.25); background: rgba(143,227,255,.07); font-size: 12px; }
.tk-status { padding: 2px 12px 6px; font-size: 12px; color: #9fb4d8; min-height: 18px; }
.tk-status.warn { color: #ffb08a; } .tk-status.live { color: #ff9ab4; font-weight: 700; }
.tk-input { display: flex; gap: 8px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(127,200,240,.2); align-items: center; }
.tk-input input { flex: 1; min-width: 0; background: rgba(0,0,0,.35); border: 1px solid rgba(143,227,255,.25); color: #fff; border-radius: 12px; padding: 10px 12px; font-size: 16px; }
.tk-input input:focus { outline: 2px solid rgba(143,227,255,.6); }
.tk-mic { width: 50px; height: 50px; border-radius: 50%; border: 0; cursor: pointer; flex: none; background: radial-gradient(circle at 40% 35%, #8fe3ff, #4a6ad8); box-shadow: 0 4px 14px rgba(74,106,216,.5); font-size: 22px; touch-action: none; -webkit-touch-callout: none; transition: transform .1s; }
.tk-mic.rec { background: radial-gradient(circle at 40% 35%, #ff9ab4, #d83a6a); transform: scale(1.12); animation: pulse .8s infinite; }
.tk-mic.unsupported { filter: grayscale(1); opacity: .6; }
.tk-mic .mic-ic { pointer-events: none; }

/* Mobile Steuerung */
#mobile-controls { position: fixed; inset: 0; pointer-events: none; z-index: 12; }
#joystick { position: absolute; left: calc(18px + env(safe-area-inset-left)); bottom: calc(22px + env(safe-area-inset-bottom)); width: 132px; height: 132px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.12), rgba(255,255,255,.05)); border: 2px solid rgba(255,255,255,.22); pointer-events: auto; touch-action: none; }
#joystick-knob { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, rgba(255,255,255,.7), rgba(200,210,230,.35)); box-shadow: 0 4px 12px rgba(0,0,0,.35); pointer-events: none; }
#touch-buttons { position: absolute; right: calc(16px + env(safe-area-inset-right)); bottom: calc(22px + env(safe-area-inset-bottom)); width: 170px; height: 150px; pointer-events: none; }
.tbtn { position: absolute; pointer-events: auto; touch-action: none; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); color: #fff; font: 900 15px var(--font); box-shadow: 0 4px 12px rgba(0,0,0,.35); -webkit-touch-callout: none; }
.tbtn.active { transform: scale(.92); filter: brightness(1.3); }
.tbtn-use { right: 0; bottom: 0; width: 84px; height: 84px; background: radial-gradient(circle at 40% 35%, rgba(143,209,106,.9), rgba(78,154,58,.85)); }
.tbtn-interact { right: 92px; bottom: 6px; width: 62px; height: 62px; background: radial-gradient(circle at 40% 35%, rgba(127,200,240,.9), rgba(60,110,180,.85)); font-size: 20px; }
.tbtn-inv { right: 14px; bottom: 94px; width: 52px; height: 52px; background: rgba(60,48,72,.85); font-size: 22px; }
body.joy-right #joystick { left: auto; right: calc(18px + env(safe-area-inset-right)); }
body.joy-right #touch-buttons { right: auto; left: calc(16px + env(safe-area-inset-left)); transform: scaleX(-1); }
body.joy-right .tbtn { transform: scaleX(-1); }
body.touch-ui #tarkify-btn { bottom: auto; top: calc(186px + env(safe-area-inset-top)); padding: 6px; }
body.touch-ui #tarkify-btn .tk-label { display: none; }
body.touch-ui .hint { bottom: calc(80px + env(safe-area-inset-bottom)); }
body.touch-ui .tutorial-box { bottom: calc(120px + env(safe-area-inset-bottom)); left: calc(10px + env(safe-area-inset-left)); width: min(300px, calc(100vw - 20px)); font-size: 12.5px; padding: 8px 10px; }
@media (orientation: portrait) {
  body.touch-ui .hotbar { bottom: calc(170px + env(safe-area-inset-bottom)); }
  body.touch-ui .hint { bottom: calc(232px + env(safe-area-inset-bottom)); }
  body.touch-ui #fishing-ui { bottom: calc(240px + env(safe-area-inset-bottom)); }
  body.touch-ui .tutorial-box { bottom: calc(282px + env(safe-area-inset-bottom)); }
}

/* Responsive */
@media (max-width: 760px) {
  #hud { font-size: calc(12.5px * var(--ui-scale)); }
  #hud-energy { width: 120px; }
  .hud-btn { width: 34px; height: 34px; font-size: 15px; border-radius: 10px; }
  #hud-buttons { gap: 4px; }
  .hud-card { padding: 6px 9px; }
  .clock-time { font-size: 1.5em; }
  body.touch-ui #tarkify-btn { top: calc(150px + env(safe-area-inset-top)); }
  .hud-quest { display: none; }
  #toasts { top: calc(150px + env(safe-area-inset-top)); left: calc(10px + env(safe-area-inset-left)); right: auto; align-items: flex-start; max-width: calc(100vw - 80px); }
  .panel { width: 100vw; max-height: 100%; height: 100%; border-radius: 0; }
  .inv-wrap, .quest-wrap, .shop-wrap { grid-template-columns: 1fr; }
  .slot-grid { gap: 4px; }
  .recipe-list { grid-template-columns: 1fr; }
  .recipe { grid-template-columns: 40px 1fr; } .recipe .btn { grid-column: 1 / -1; }
  #dialog-box { padding: 10px; gap: 10px; } .dlg-portrait { width: 60px; height: 60px; }
  #tarkify-panel { right: 0; left: 0; bottom: 0; width: 100%; height: 78vh; border-radius: 20px 20px 0 0; }
}
@media (max-height: 520px) {
  .hud-quest { display: none; }
  #hud-energy small { display: none; }
  body.touch-ui #tarkify-btn { top: calc(130px + env(safe-area-inset-top)); }
}
