[hidden] { display: none !important; }
:root {
  --ink: #1a1430;
  --panel: rgba(28, 22, 48, 0.92);
  --panel2: rgba(44, 36, 72, 0.95);
  --line: rgba(255, 236, 200, 0.18);
  --text: #fff6e8;
  --mute: #c8bede;
  --gold: #ffd84a;
  --hp: #4ad86a;
  --accent: #ffb84a;
  font-family: 'Fredoka', 'Trebuchet MS', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--text); user-select: none; }
#stage, #stage canvas { position: fixed; inset: 0; display: block; }
button { font: inherit; color: var(--text); background: var(--panel2); border: 2px solid var(--line); border-radius: 12px; padding: 8px 14px; cursor: pointer; transition: transform .08s, background .15s; }
button:hover:not(:disabled) { background: #4a3c7a; transform: translateY(-1px); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: default; }
button.pri { background: linear-gradient(#ffc45a, #e8902a); color: #3a2208; border-color: #ffe0a0; font-weight: 600; }
button.pri:hover:not(:disabled) { background: linear-gradient(#ffd27a, #f0a03a); }
button.big { font-size: 1.2rem; padding: 12px 28px; }
input { font: inherit; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); background: rgba(10, 8, 20, .6); color: var(--text); width: 100%; }
input:focus { outline: none; border-color: var(--accent); }
.err { color: #ff8a7a; min-height: 1.2em; margin-top: 8px; }
.sub { color: var(--mute); font-size: .92rem; }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Menüs */
.screen { position: fixed; inset: 0; display: flex; align-items: safe center; justify-content: center; padding: 16px; background: radial-gradient(ellipse at center, rgba(26,20,48,.25), rgba(26,20,48,.75)); z-index: 20; overflow: auto; }
.panel { background: var(--panel); border: 2px solid var(--line); border-radius: 22px; padding: 26px 30px; box-shadow: 0 20px 60px rgba(0,0,0,.45); text-align: center; max-width: 1100px; }
.panel.small { min-width: 300px; display: flex; flex-direction: column; gap: 10px; }
.panel h1 { font-size: clamp(2rem, 6vw, 3.4rem); margin: 0; letter-spacing: .5px; text-shadow: 0 4px 0 #0006; }
.panel h1 span, .panel h2 span { color: #9fe3ff; }
.login { width: min(420px, 100%); }
.login form { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.tag { color: var(--mute); margin: 6px 0 0; }
.badge { display: inline-block; margin-top: 14px; padding: 4px 12px; border-radius: 99px; background: #ffd84a22; border: 1px solid #ffd84a88; color: var(--gold); font-size: .85rem; }
.by { position: fixed; bottom: 14px; right: 18px; display: flex; align-items: center; gap: 8px; color: var(--mute); text-decoration: none; font-size: .85rem; opacity: .85; }
.by img { height: 22px; }
.select { width: min(520px, 100%); }
#char-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.chr { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 14px; border-left: 6px solid var(--fc); }
.chr .big { font-size: 2rem; }
.chr .nm2 { flex: 1; }
.chr .nm2 b { font-size: 1.1rem; }
.chr .nm2 small { display: block; color: var(--mute); }
.chr .del { padding: 4px 9px; font-size: .85rem; opacity: .6; }
.chr .del:hover { opacity: 1; background: #8a2a2a; }
.create input { margin: 6px 0 2px; }
.screen.right { justify-content: flex-end; background: linear-gradient(90deg, transparent 35%, rgba(26,20,48,.55)); }
.create { width: min(560px, 100%); text-align: left; padding: 22px 24px; }
.create h2 { margin: 0 0 6px; }
.step { margin: 14px 0 6px; color: var(--accent); font-weight: 600; letter-spacing: .5px; }
.tabs { display: grid; gap: 6px; }
.tabs.five { grid-template-columns: repeat(5, 1fr); }
.tabs.three { grid-template-columns: repeat(3, 1fr); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 14px; font-size: .82rem; }
.tab .big { font-size: 1.7rem; }
.tab.on { border-color: var(--gold); background: #4a3c7a; box-shadow: 0 0 0 3px #ffd84a44; }
.tab.faction.on { border-color: var(--fc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fc) 45%, transparent); }
.tab.faction b { color: var(--fc); }
.infobox { background: #0003; border-radius: 14px; padding: 10px 12px; margin-top: 8px; }
.infobox .role { color: var(--gold); font-size: .85rem; }
.infobox p { margin: 4px 0 8px; color: #e8def8; font-size: .9rem; }
.kitrow { display: grid; grid-template-columns: 34px 30px 1fr; gap: 6px; align-items: center; font-size: .84rem; padding: 3px 0; border-top: 1px solid #ffffff10; }
.kitrow .k { background: #0006; border-radius: 6px; text-align: center; color: var(--gold); font-weight: 600; font-size: .72rem; padding: 2px 0; }
.kitrow .i { font-size: 1.2rem; text-align: center; }
.kitrow small { color: var(--mute); }
.create .row { justify-content: flex-start; }
@media (max-width: 900px) { .screen.right { justify-content: center; } .tabs.five { grid-template-columns: repeat(3, 1fr); } }

/* ---------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud button, #hud .ab { pointer-events: auto; }
#pframe { position: absolute; top: 14px; left: 14px; display: flex; gap: 10px; align-items: center; background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 8px 12px 8px 8px; }
#p-portrait { width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(#5a4a8a, #2a2050); display: grid; place-items: center; font-size: 30px; border: 3px solid var(--gold); }
.info { width: 220px; }
.nm { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.nm b { font-weight: 600; }
.fac { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff8; }
.lv { background: #0006; border-radius: 8px; padding: 0 7px; font-size: .85rem; color: var(--gold); }
.bar { position: relative; height: 16px; background: #0008; border-radius: 8px; overflow: hidden; margin-top: 3px; }
.bar > div { height: 100%; transition: width .15s; }
.bar span { position: absolute; inset: 0; font-size: .72rem; line-height: 16px; text-align: center; text-shadow: 0 1px 2px #000; }
.bar.hp > div { background: linear-gradient(#7af08a, #2ab84a); }
.bar.res > div { background: linear-gradient(#7ab8ff, #3a6ad8); }
#p-buffs { display: flex; gap: 4px; margin-top: 4px; min-height: 0; }
.buff { position: relative; font-size: 18px; background: #0006; border-radius: 8px; padding: 1px 4px; }
.buff i { position: absolute; right: -2px; bottom: -4px; font-size: .62rem; font-style: normal; color: #fff; text-shadow: 0 1px 2px #000; }
.buff.bad { background: #8a2a2a88; }
#target { position: absolute; top: 14px; left: 380px; width: 280px; background: var(--panel); border: 2px solid var(--line); border-radius: 16px; padding: 8px 12px; text-align: center; }
#target .nm { justify-content: center; }
#t-name.elite { color: #ffd84a; }
#t-name.boss { color: #ff7aff; }
#t-info { font-size: .75rem; color: var(--mute); margin-top: 4px; min-height: 0; }
#mm-wrap { position: absolute; top: 14px; right: 14px; width: 180px; text-align: center; }
#minimap { border-radius: 50%; border: 4px solid #e8d8b0; box-shadow: 0 6px 20px #0008; background: #2a3a2a; }
#mm-zone { margin-top: -6px; background: var(--panel); border: 2px solid var(--line); border-radius: 10px; display: inline-block; padding: 2px 10px; font-size: .85rem; position: relative; }
.mm-gold { color: var(--gold); font-size: .9rem; margin-top: 4px; text-shadow: 0 1px 2px #000; }
#tracker { position: absolute; top: 250px; right: 14px; width: 240px; text-shadow: 0 1px 3px #000, 0 0 2px #000; }
#tracker .h { color: var(--gold); font-weight: 600; margin-bottom: 4px; }
#tracker .h small { color: var(--mute); font-weight: 400; }
#tracker .q { margin-bottom: 8px; }
#tracker .t { font-weight: 600; }
#tracker .q.done .t { color: var(--gold); }
#tracker .g { font-size: .85rem; color: var(--mute); padding-left: 8px; }
#tracker .g.ok { color: #8af08a; }
#log { position: absolute; left: 14px; bottom: 120px; width: 360px; display: flex; flex-direction: column; gap: 2px; text-shadow: 0 1px 3px #000, 0 0 2px #000; font-size: .9rem; }
#log .m { transition: opacity 1s; }
#log .m.quest { color: #ffe27a; }
#log .m.gold { color: var(--gold); }
#log .m.loot { color: #8af0ff; }
.m.fade { opacity: 0; }
#center-msg { position: absolute; top: 26%; left: 50%; transform: translateX(-50%); text-align: center; font-weight: 600; font-size: 1.1rem; text-shadow: 0 2px 4px #000; }
#center-msg .m { color: #ff9a8a; transition: opacity .8s; }
#center-msg .m.warn { color: #ffd84a; font-size: 1.25rem; }
#banner { position: absolute; top: 18%; left: 50%; transform: translateX(-50%); text-align: center; opacity: 0; pointer-events: none; }
#banner .t { font-size: 2.6rem; font-weight: 700; text-shadow: 0 4px 0 #0008, 0 0 20px #0006; color: #fff6d8; }
#banner .s { font-size: 1.1rem; color: var(--mute); text-shadow: 0 2px 3px #000; }
#banner.level .t { color: #ffc040; font-size: 3.4rem; text-shadow: 0 0 30px #ff7a1a, 0 4px 0 #6a2a00; }
#banner.show { animation: banner 3.4s ease-out forwards; }
@keyframes banner { 0% { opacity: 0; transform: translateX(-50%) scale(.6); } 10% { opacity: 1; transform: translateX(-50%) scale(1.08); } 18% { transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
#safe { position: absolute; top: 210px; right: 14px; width: 180px; text-align: center; font-size: .8rem; background: #cfe3ee33; border: 1px solid #cfe3ee88; border-radius: 10px; padding: 3px; }
#hint { position: absolute; bottom: 150px; left: 50%; transform: translateX(-50%); background: var(--panel); border: 2px solid var(--line); border-radius: 12px; padding: 6px 14px; }
#hint b { background: var(--gold); color: #3a2208; border-radius: 6px; padding: 0 7px; margin-right: 4px; }
#castbar { position: absolute; bottom: 180px; left: 50%; transform: translateX(-50%); width: 260px; height: 18px; background: #0009; border: 2px solid var(--line); border-radius: 10px; overflow: hidden; }
#cast-fill { height: 100%; background: linear-gradient(90deg, #ffd84a, #ff9a2a); }
#cast-name { position: absolute; inset: 0; text-align: center; font-size: .78rem; line-height: 14px; text-shadow: 0 1px 2px #000; }
#bottom { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
#bar { display: flex; gap: 6px; align-items: flex-end; background: var(--panel); border: 2px solid var(--line); border-radius: 18px; padding: 8px; }
.ab { position: relative; width: 58px; height: 58px; border-radius: 14px; background: linear-gradient(#4a3c7a, #2a2050); border: 2px solid #ffecc855; display: grid; place-items: center; overflow: hidden; }
.ab.small { width: 46px; height: 46px; }
.ab .ic { font-size: 28px; filter: drop-shadow(0 2px 2px #0008); }
.ab.small .ic { font-size: 22px; }
.ab .key { position: absolute; left: 4px; top: 2px; font-size: .65rem; font-weight: 600; color: var(--gold); text-shadow: 0 1px 2px #000; }
.ab .cnt { position: absolute; right: 4px; bottom: 2px; font-size: .72rem; text-shadow: 0 1px 2px #000; }
.ab .cd { position: absolute; inset: 0; }
.ab .lock { position: absolute; inset: 0; display: grid; place-items: center; font-size: .66rem; font-weight: 600; text-shadow: 0 1px 2px #000; }
.ab.locked { filter: grayscale(1) brightness(.6); }
.ab.nores .ic { opacity: .45; }
.ab.empty { opacity: .5; }
.ab.amu { background: linear-gradient(#6a5020, #3a2a10); }
.sep { width: 2px; align-self: stretch; background: var(--line); margin: 0 4px; }
#xp { position: relative; width: 520px; max-width: 90vw; height: 12px; background: #0009; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
#xp-fill { height: 100%; background: linear-gradient(90deg, #b46cff, #ff7ad8); transition: width .3s; }
#xp-t { position: absolute; inset: 0; font-size: .66rem; line-height: 11px; text-align: center; text-shadow: 0 1px 2px #000; }
#menu-btns { position: absolute; bottom: 16px; right: 14px; display: flex; gap: 6px; }
#menu-btns button { padding: 6px 9px; font-size: 1.2rem; }
#loot-toasts { position: absolute; right: 270px; bottom: 120px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.loot-toast { display: flex; gap: 10px; align-items: center; background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 6px 12px 6px 6px; animation: pop .35s ease-out; transition: opacity .7s, transform .7s; }
.loot-toast.fade { opacity: 0; transform: translateX(30px); }
.loot-toast .ic { width: 44px; height: 44px; border-radius: 10px; border: 2px solid; display: grid; place-items: center; font-size: 24px; }
.loot-toast .sub { font-size: .78rem; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#vignette { position: fixed; inset: 0; pointer-events: none; z-index: 4; box-shadow: inset 0 0 120px 30px #ff2a2a; opacity: 0; }
#vignette.on { animation: hurt .45s ease-out; }
@keyframes hurt { 0% { opacity: .55; } 100% { opacity: 0; } }

/* Schwebende Zahlen & Namensschilder */
#floats, #plates { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
#plates .plate { padding: 4px 6px; }
.fl { position: absolute; left: 0; top: 0; font-weight: 700; font-size: 1.15rem; color: #fff; text-shadow: 0 2px 0 #000a, 0 0 4px #000; white-space: nowrap; }
.fl.crit { color: #ffd84a; font-size: 1.6rem; }
.fl.hurt { color: #ff5a5a; }
.fl.heal { color: #7af08a; }
.fl.xp { color: #d8a0ff; font-size: 1rem; }
.fl.cc { color: #9fe3ff; font-size: .95rem; }
.fl.miss { color: #c8c8d8; font-size: .95rem; }
.plate { position: absolute; left: 0; top: 0; text-align: center; }
.plate .n { font-size: .78rem; font-weight: 600; text-shadow: 0 1px 2px #000, 0 0 2px #000; white-space: nowrap; }
.plate .b { width: 70px; height: 7px; background: #000a; border-radius: 4px; margin: 2px auto 0; overflow: hidden; border: 1px solid #0008; }
.plate .b div { height: 100%; background: linear-gradient(#ff7a6a, #d83a2a); }
.plate.boss .b { width: 130px; height: 10px; }

/* ---------- Fenster */
#win { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(560px, 94vw); max-height: 86vh; display: flex; flex-direction: column; background: var(--panel); border: 2px solid var(--line); border-radius: 20px; box-shadow: 0 20px 60px #000a; z-index: 10; }
#win.char-win { width: min(640px, 94vw); }
#win.map-win { width: auto; }
.wh { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 2px solid var(--line); font-weight: 600; font-size: 1.1rem; }
.wh .x { padding: 2px 10px; }
.wb { padding: 14px 18px; overflow: auto; }
.wb h3 { margin: 0 0 6px; color: var(--gold); }
.wb h4 { margin: 14px 0 6px; color: var(--accent); }
.qt, .greet { line-height: 1.45; }
.greet { font-style: italic; color: #f0e6ff; }
.goals { margin: 8px 0; color: var(--mute); }
.rew { margin: 10px 0; color: var(--gold); font-size: .92rem; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.qlist { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.qi { text-align: left; display: flex; gap: 8px; align-items: center; }
.qi .mk { font-weight: 700; color: var(--gold); width: 14px; text-align: center; }
.qi.progress .mk { color: #aaa; }
.learn { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; gap: 10px; align-items: center; background: #0003; border-radius: 12px; padding: 8px; }
.li .ic { font-size: 26px; }
.li > div { flex: 1; }
.li .d { font-size: .82rem; color: var(--mute); }
.li .ok { color: #8af08a; font-size: 1.3rem; }
.li.got { opacity: .7; }
.shop { display: flex; flex-wrap: wrap; gap: 6px; }
.gold { color: var(--gold); }
.char { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.eqs { display: flex; flex-direction: column; gap: 6px; }
.eq { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.eq .lbl { font-size: .8rem; color: var(--mute); }
.tile { width: 46px; height: 46px; border-radius: 10px; border: 2px solid #ffecc833; background: #0004; display: grid; place-items: center; font-size: 24px; position: relative; flex-shrink: 0; }
.tile .ph { opacity: .3; }
.tile .n { position: absolute; right: 2px; bottom: 0; font-size: .7rem; text-shadow: 0 1px 2px #000; }
.tile.amu { box-shadow: 0 0 10px #ffd84a88; }
.stats { display: flex; flex-direction: column; gap: 4px; background: #0003; border-radius: 12px; padding: 10px; }
.st { display: flex; justify-content: space-between; font-size: .9rem; }
.bagh { margin: 14px 0 6px; display: flex; gap: 10px; align-items: center; font-weight: 600; }
.bagh button { margin-left: auto; padding: 4px 10px; font-size: .85rem; }
.bag { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; }
.slot { aspect-ratio: 1; border-radius: 10px; background: #0004; border: 2px solid #ffecc81a; cursor: pointer; display: grid; place-items: center; }
.slot .tile { width: 100%; height: 100%; }
.note { font-size: .78rem; color: var(--mute); margin-top: 8px; }
.ql { margin-bottom: 16px; }
.ql p { color: #e8def8; line-height: 1.4; }
.ql .g { color: var(--mute); }
.ql .g.ok, .goals .ok { color: #8af08a; }
.help p { margin: 4px 0; font-size: .92rem; }
.help .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
#bigmap { display: block; border-radius: 12px; max-width: 86vw; max-height: 74vh; }
#tip { position: fixed; display: none; z-index: 30; max-width: 280px; background: rgba(16, 12, 30, .96); border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: .88rem; pointer-events: none; line-height: 1.4; }
#tip .tsub { color: var(--mute); font-size: .78rem; margin-top: 4px; }
.overlay { position: fixed; inset: 0; display: grid; place-items: center; background: #0008; z-index: 15; }
#finale .panel { max-width: 560px; }
#finale p { line-height: 1.5; }

/* ---------- Arena */
#arena-hud { position: absolute; top: 90px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; }
#arena-hud .team { display: flex; flex-direction: column; gap: 4px; }
#arena-hud .vs { font-weight: 700; color: var(--gold); text-shadow: 0 2px 3px #000; }
.ah { display: flex; gap: 6px; align-items: center; background: var(--panel); border: 2px solid #6aff6a66; border-radius: 10px; padding: 3px 8px; width: 190px; font-size: .78rem; }
.ah.foe { border-color: #ff5a5a88; }
.ah.dead { opacity: .4; }
.ah > div { flex: 1; }
.ah .bar { height: 8px; }
.lo-row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.lo-slot { width: 120px; font-size: .9rem; }
.lo-opts { display: flex; gap: 5px; flex-wrap: wrap; }
.lo-opt { width: 46px; height: 46px; padding: 0; border-radius: 10px; font-size: .66rem; font-weight: 600; line-height: 1.25; text-shadow: 0 1px 2px #000; }
.lo-opt.amu { font-size: 1.3rem; background: #3a2a10; }
.lo-opt.on { outline: 3px solid var(--gold); outline-offset: 1px; }
.lo-sum { margin-top: 10px; font-weight: 600; }
#win.loadout-win { width: min(600px, 94vw); }
#t-name.friend { color: #7af08a; }
.diff button.on { border-color: var(--gold); background: #4a3c7a; }
#arena-hud .damp { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); white-space: nowrap; color: #ff9a8a; font-weight: 600; text-shadow: 0 1px 3px #000; }
.fl.spell { font-size: 1.05rem; font-weight: 700; letter-spacing: .3px; text-shadow: 0 2px 0 #000c, 0 0 6px #000a; }
.bar.cast > div { background: linear-gradient(90deg, #ffd84a, #ff6a3a); }

/* ---------- Touch / Handy */
#touch { display: none; }
body.touch #touch { display: block; }
body.touch #stage canvas, body.touch #touch { touch-action: none; }
body.touch #bar, body.touch #menu-btns button[title^="Hilfe"] { display: none; }
#stick { position: absolute; left: calc(18px + env(safe-area-inset-left)); bottom: calc(26px + env(safe-area-inset-bottom)); width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, #ffffff22, #ffffff0a); border: 2px solid #ffffff44; pointer-events: auto; }
#stick .knob { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: radial-gradient(#fff8e0, #d8b070); box-shadow: 0 4px 12px #0008; }
#tbtns { position: absolute; right: calc(14px + env(safe-area-inset-right)); bottom: calc(22px + env(safe-area-inset-bottom)); width: 230px; height: 230px; pointer-events: none; }
.tb { position: absolute; width: 58px; height: 58px; border-radius: 50%; padding: 0; font-size: 1.4rem; display: grid; place-items: center; pointer-events: auto; background: radial-gradient(#5a4a8a, #2a2050); border: 2px solid #ffecc877; overflow: hidden; }
.tb i { position: absolute; bottom: 3px; right: 9px; font-size: .62rem; font-style: normal; color: var(--gold); }
.tb .cd { position: absolute; inset: 0; border-radius: 50%; }
.tb.on { transform: scale(.92); background: #6a5aa0; }
.tb.locked { filter: grayscale(1) brightness(.55); }
.tb.big { width: 86px; height: 86px; right: 0; bottom: 0; font-size: 2rem; background: radial-gradient(#ffc45a, #b8601a); }
.tb[data-act=rmb] { right: 96px; bottom: 2px; }
.tb[data-act=q] { right: 86px; bottom: 74px; }
.tb[data-act=e] { right: 34px; bottom: 120px; }
.tb[data-act=r] { right: -6px; bottom: 98px; }
.tb.small { width: 44px; height: 44px; font-size: 1.05rem; }
.tb[data-act=jump] { right: 160px; bottom: 0; }
.tb[data-act=pot] { right: 160px; bottom: 56px; }
.tb[data-act=a1] { right: 142px; bottom: 136px; }
.tb[data-act=a2] { right: 92px; bottom: 170px; }
.tb[data-act=tab] { right: 30px; bottom: 186px; }
.tb.talk { width: auto; height: 46px; border-radius: 23px; padding: 0 16px; font-size: .95rem; left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom)); position: absolute; background: linear-gradient(#ffc45a, #e8902a); color: #3a2208; font-weight: 600; }
body.touch #bottom { bottom: auto; top: calc(6px + env(safe-area-inset-top)); }
body.touch #bottom #xp { width: 200px; }
body.touch #hint { display: none; }
@media (max-width: 900px), (max-height: 520px) {
  #pframe { transform: scale(.78); transform-origin: top left; top: 6px; left: 6px; }
  #mm-wrap { transform: scale(.66); transform-origin: top right; top: 6px; right: 6px; }
  #tracker { top: 140px; right: 8px; width: 170px; font-size: .78rem; }
  #log { display: none; }
  #target { transform: scale(.72); transform-origin: top left; top: 82px; left: 6px; width: 300px; }
  #arena-hud { transform: translateX(-50%) scale(.7); transform-origin: top center; top: 96px; }
  #safe { display: none; }
  #menu-btns { top: calc(6px + env(safe-area-inset-top)); bottom: auto; right: 130px; }
  #menu-btns button { padding: 3px 6px; font-size: 1rem; }
  #banner .t { font-size: 1.8rem; } #banner.level .t { font-size: 2.4rem; }
  #win { max-height: 92vh; }
  .panel { padding: 16px; }
  #loot-toasts { right: 10px; bottom: 260px; }
  .bag { grid-template-columns: repeat(6, 1fr); }
  .char { grid-template-columns: 1fr; }
}
@media (max-height: 520px) and (orientation: landscape) {
  #tracker { display: none; }
  #stick { width: 120px; height: 120px; }
  #tbtns { transform: scale(.85); transform-origin: bottom right; }
}

.screen > .panel { margin: auto 0; }
.tabs.five { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px), (max-height: 600px) {
  .create { width: 100%; max-width: 640px; padding: 12px 14px; }
  .create h2 { font-size: 1.1rem; }
  .tabs.five { grid-template-columns: repeat(7, 1fr); gap: 4px; }
  .tab { padding: 5px 2px; font-size: .62rem; border-radius: 10px; }
  .tab .big { font-size: 1.3rem; }
  .infobox { padding: 6px 8px; }
  .infobox p { font-size: .78rem; margin: 2px 0 4px; }
  .kitrow { font-size: .72rem; grid-template-columns: 26px 22px 1fr; padding: 2px 0; }
  .step { margin: 8px 0 4px; font-size: .85rem; }
  .screen.right { justify-content: center; background: rgba(26,20,48,.55); }
  .create .row { margin-top: 8px; }
  .login { padding: 16px; }
  .panel h1 { font-size: 1.8rem; }
}

/* Zielrahmen sitzt rechts neben dem Spielerrahmen (Handy: darunter) */
#target .nm { justify-content: flex-start; }
#target { text-align: left; }
@media (max-width: 760px) { #target { top: 82px; left: 6px; } }
/* Langes Drücken auf Touch-Knöpfe: Erklärung der Fähigkeit */
#ttip { position: fixed; z-index: 40; max-width: 260px; background: rgba(16,12,30,.96); border: 2px solid var(--gold); border-radius: 12px; padding: 8px 12px; font-size: .85rem; line-height: 1.35; pointer-events: none; }
#ttip .tsub { color: var(--mute); font-size: .75rem; margin-top: 4px; }
body.touch #menu-btns button[title^="Hilfe"] { display: inline-block; }
.help .kitrow2 { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; }
.help .kitrow2 .ic { font-size: 1.4rem; }
#online { margin-left: 6px; color: #cfe3ee; }
#queue-badge { position: absolute; top: 250px; left: 14px; background: var(--panel); border: 2px solid var(--gold); border-radius: 10px; padding: 4px 10px; font-size: .85rem; }
#t-info .duel { pointer-events: auto; padding: 2px 8px; font-size: .75rem; margin-left: 6px; }
.plate.pl .b { width: 80px; }
.plate.pl .b div { background: linear-gradient(#7af08a, #2ab84a); }
.plate.pl.foe .b div { background: linear-gradient(#ff7a6a, #d83a2a); }
/* Klassenwahl darf auf schmalen Handys nie über den Rand ragen */
.tabs > * { min-width: 0; }
.tab { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screen { padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
.screen > .panel { max-width: 100%; }
@media (max-width: 560px) {
  .tabs.five { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
  .tabs.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .create { padding: 12px 10px; }
  .kitrow small { display: block; }
}

/* Wertigkeit: Gold (6) glänzt und schimmert, Blau (5) leuchtet leicht */
.tile, .loot-toast .ic, .lo-opt { position: relative; overflow: hidden; }
.rare { box-shadow: 0 0 6px #4aa8ff88, inset 0 0 6px #4aa8ff44; }
.legend { box-shadow: 0 0 10px #ffb43aaa, inset 0 0 8px #ffb43a55; animation: legendPulse 2.4s ease-in-out infinite; }
.legend::after { content: ''; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 40%, #fff6d8aa 50%, transparent 60%); animation: legendShine 2.8s ease-in-out infinite; pointer-events: none; }
@keyframes legendShine { 0% { transform: translateX(-60%); } 55%, 100% { transform: translateX(60%); } }
@keyframes legendPulse { 0%, 100% { box-shadow: 0 0 8px #ffb43a88, inset 0 0 6px #ffb43a44; } 50% { box-shadow: 0 0 16px #ffb43acc, inset 0 0 10px #ffb43a77; } }

/* Touch-Knöpfe: innerer Bogen (2, Q, E, R) und äußerer Bogen (Trank, Sprung, Amulette, Ziel) um den großen Angriff */
#tbtns { width: 250px; height: 250px; }
.tb.big { right: 0; bottom: 0; }
.tb[data-act=rmb] { right: 114px; bottom: 14px; }
.tb[data-act=q] { right: 101px; bottom: 64px; }
.tb[data-act=e] { right: 64px; bottom: 101px; }
.tb[data-act=r] { right: 14px; bottom: 114px; }
.tb[data-act=pot] { right: 186px; bottom: 21px; }
.tb[data-act=jump] { right: 170px; bottom: 91px; }
.tb[data-act=a1] { right: 127px; bottom: 147px; }
.tb[data-act=a2] { right: 64px; bottom: 180px; }
.tb[data-act=tab] { right: 7px; bottom: 185px; }
@media (max-height: 520px) and (orientation: landscape) { #tbtns { transform: scale(.8); transform-origin: bottom right; } }
.plate { pointer-events: auto; cursor: pointer; }
/* Bögen mit genug Abstand: innen Radius 118 (58er-Knöpfe), außen Radius 185 (44er-Knöpfe) */
#tbtns { width: 260px; height: 260px; }
.tb[data-act=rmb] { right: 132px; bottom: 14px; }
.tb[data-act=q] { right: 116px; bottom: 73px; }
.tb[data-act=e] { right: 73px; bottom: 116px; }
.tb[data-act=r] { right: 14px; bottom: 132px; }
.tb[data-act=pot] { right: 205px; bottom: 5px; }
.tb[data-act=jump] { right: 195px; bottom: 84px; }
.tb[data-act=a1] { right: 152px; bottom: 152px; }
.tb[data-act=a2] { right: 84px; bottom: 195px; }
.tb[data-act=tab] { right: 14px; bottom: 206px; }
@media (max-height: 520px) and (orientation: landscape) { #tbtns { transform: scale(.74); } }

/* Halbes Gold: nur die goldene Hälfte (a = oben links, b = unten rechts) glänzt */
.gold-a::after, .gold-b::after { content: ''; position: absolute; inset: -40%; background: linear-gradient(115deg, transparent 40%, #fff6d8aa 50%, transparent 60%); animation: legendShine 2.8s ease-in-out infinite; pointer-events: none; }
.gold-a::after { clip-path: polygon(0 0, 100% 0, 0 100%); }
.gold-b::after { clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.gold-a, .gold-b { box-shadow: 0 0 7px #ffb43a77; }

#bar2 { display: flex; gap: 5px; background: var(--panel); border: 2px solid var(--line); border-radius: 14px; padding: 5px; }
#bar2 .ab.small { width: 40px; height: 40px; }
#bar2 .ab.empty { opacity: .35; }
body.touch #bar2 { display: none; }

/* Handy: Seite 1 = 2–5, Seite 2 = 6–8 (+5 bleibt), Umschalter ⇄ */
.tb[data-act=s6] { right: 132px; bottom: 14px; }
.tb[data-act=s7] { right: 116px; bottom: 73px; }
.tb[data-act=s8] { right: 73px; bottom: 116px; }
.tb.pb { display: none; }
#touch.page2 .tb.pb { display: grid; }
#touch.page2 .tb.pa:not([data-act=r]) { display: none; }
.tb[data-act=page] { right: 205px; bottom: 150px; background: radial-gradient(#ffc45a, #b8601a); }

/* Gruppe */
#party { position: absolute; top: 160px; left: 14px; display: flex; flex-direction: column; gap: 4px; pointer-events: auto; }
#party .pm { display: flex; gap: 6px; align-items: center; background: var(--panel); border: 2px solid var(--line); border-radius: 10px; padding: 3px 8px; width: 190px; font-size: .78rem; }
#party .pm > div { flex: 1; }
#party .pm .bar { height: 7px; }
#party .pm.dead { opacity: .45; }
#party .pl { font-size: .72rem; padding: 2px 8px; align-self: flex-start; }
/* Untertitel der Geschichte */
#say { position: absolute; bottom: 210px; left: 50%; transform: translateX(-50%); max-width: min(720px, 92vw); text-align: center; background: rgba(12, 8, 24, .82); border: 2px solid #ffecc844; border-radius: 14px; padding: 10px 18px; }
#say b { display: block; color: var(--gold); font-size: .85rem; letter-spacing: .5px; margin-bottom: 2px; }
#say span { font-size: 1.05rem; line-height: 1.4; }
#say.in { animation: sayIn .35s ease-out; }
@keyframes sayIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (max-width: 900px), (max-height: 520px) { #party { top: 120px; transform: scale(.8); transform-origin: top left; } #say { bottom: 150px; } }

/* Talente */
#win.talent-win { width: min(860px, 96vw); }
.tsum { margin-bottom: 8px; color: var(--mute); }
.tsum b { color: var(--gold); font-size: 1.1rem; }
.tree { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tcol h4 { margin: 0 0 6px; text-align: center; }
.tcol h4 small { color: var(--gold); }
.tal { display: flex; gap: 8px; align-items: center; background: #0003; border: 2px solid #ffecc822; border-radius: 12px; padding: 6px 8px; margin-bottom: 6px; font-size: .8rem; }
.tal .ic { font-size: 1.4rem; }
.tal > div { flex: 1; }
.tal small { display: block; color: var(--mute); font-size: .7rem; line-height: 1.2; }
.tal .rk { font-weight: 700; color: var(--mute); }
.tal.has { border-color: #ffd84a88; background: #ffd84a14; }
.tal.has .rk { color: var(--gold); }
.tal.can { cursor: pointer; border-color: #8af08a88; }
.tal.can:hover { background: #8af08a18; }
.tal.locked { opacity: .45; }
.tal.cap { border-style: dashed; }
.gm { background: #ffd84a; color: #3a2208; border-radius: 6px; padding: 0 6px; font-size: .75rem; }
@media (max-width: 760px) { .tree { grid-template-columns: 1fr; } }
