/* WortArena – ein bewusst einziger Look: dunkle Arena außen (Gaming-Gefühl),
   ruhige, helle Übungskarte innen (Lesbarkeit für LRS: große, klare Schrift,
   etwas mehr Buchstabenabstand, kein Reinweiß, keine Rot/Grün-Paare als einzige Info). */
:root {
  color-scheme: dark;
  --night: #120d33;
  --night2: #1c1550;
  --violet: #34258a;
  --violet2: #5a3fd6;
  --ink: #0d0a22;
  --paper: #f5f4fc;
  --paper2: #e9e6fb;
  --paper-ink: #1a1446;
  --paper-mute: #6b66a3;
  --muted: #a7a3d6;
  --text: #f4f2ff;
  --gold: #ffc629;
  --gold-d: #d99a00;
  --lime: #7ee03b;
  --lime-d: #3f9a12;
  --cyan: #22d3ee;
  --pink: #ff4fa3;
  --amber: #ff9f1c;
  --amber-bg: #fff1d6;
  --blue: #2f8cff;
  --purple: #b44dff;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --shadow: 0 6px 0 var(--ink);
  --font-display: 'Lilita One', 'Arial Black', 'Helvetica Neue', system-ui, sans-serif;
  --font-body: 'Lexend', 'Atkinson Hyperlegible', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --word-size: clamp(2.2rem, 7vw, 3.4rem);
  --fs: 1;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--night);
  background-image:
    radial-gradient(1200px 600px at 50% -10%, #3a2a9a 0%, transparent 60%),
    radial-gradient(800px 500px at 110% 110%, #5b1d7a 0%, transparent 55%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.025) 0 18px, transparent 18px 36px);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: calc(16px * var(--fs));
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
svg.ic { width: 1.5em; height: 1.5em; flex: none; vertical-align: middle; }
.feedback .head svg.ic { width: 30px; height: 30px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

#app { max-width: 780px; margin: 0 auto; min-height: 100%; padding: 0 16px calc(96px + env(safe-area-inset-bottom, 0px)); position: relative; }
.screen { padding-block: 14px 24px; animation: screenIn .28s ease-out; }
@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Typo ---------- */
.display { font-family: var(--font-display); font-weight: 400; letter-spacing: .01em; line-height: 1.05; text-wrap: balance; }
.outlined { color: #fff; text-shadow: 0 3px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink), 2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink); }
h1.display { font-size: clamp(2rem, 7vw, 3rem); margin: 0; }
h2.display { font-size: clamp(1.4rem, 4.5vw, 1.9rem); margin: 0; }
h3.display { font-size: 1.2rem; margin: 0; }
.label { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Buttons (chunky, mit „Druck“) ---------- */
.btn {
  --b: var(--gold); --bd: var(--gold-d); --t: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 52px; padding: 10px 22px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--b) 100%, #fff 18%) 0%, var(--b) 55%, var(--bd) 100%);
  color: var(--t); border: 3px solid var(--ink); border-radius: var(--r);
  box-shadow: 0 5px 0 var(--ink), inset 0 2px 0 rgba(255,255,255,.45);
  font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .02em; text-transform: uppercase;
  cursor: pointer; user-select: none; transition: transform .06s, box-shadow .06s, filter .15s;
  touch-action: manipulation;
}
.btn:hover { filter: brightness(1.06); }
.btn:active, .btn.pressed { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink), inset 0 2px 0 rgba(255,255,255,.35); }
.btn[disabled] { filter: grayscale(.8) brightness(.8); cursor: default; }
.btn.big { min-height: 72px; font-size: 1.7rem; padding: 12px 30px; border-radius: 20px; }
.btn.wide { width: 100%; }
.btn.lime { --b: var(--lime); --bd: var(--lime-d); }
.btn.cyan { --b: #3ee0f5; --bd: #0aa5c2; }
.btn.pink { --b: var(--pink); --bd: #c21f72; --t: #fff; }
.btn.ghost { --b: #3a2f86; --bd: #261d63; --t: #fff; }
.btn.white { --b: #ffffff; --bd: #d6d3f0; --t: var(--paper-ink); }
.btn.small { min-height: 40px; font-size: .95rem; padding: 6px 14px; border-radius: 12px; box-shadow: 0 3px 0 var(--ink); }
.btn.icon { min-width: 48px; padding: 6px; }
.btn svg { width: 1.3em; height: 1.3em; flex: none; }
.btn .t { text-shadow: 0 1px 0 rgba(255,255,255,.4); }
.btn.pink .t, .btn.ghost .t { text-shadow: 0 2px 0 rgba(0,0,0,.35); }

.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 6px; font-size: .9rem; }

/* ---------- Panels ---------- */
.panel {
  background: linear-gradient(180deg, #2b2175 0%, #221a5e 100%);
  border: 3px solid var(--ink); border-radius: var(--r-lg);
  box-shadow: 0 6px 0 var(--ink), inset 0 2px 0 rgba(255,255,255,.08);
  padding: 16px;
}
.panel.flat { box-shadow: inset 0 2px 0 rgba(255,255,255,.06); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 520px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.bar { height: 14px; background: #120d33; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; position: relative; }
.bar > i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--lime), #b6ff6a); border-radius: 999px; transition: width .6s cubic-bezier(.2,.8,.2,1); box-shadow: inset 0 2px 0 rgba(255,255,255,.4); }
.bar.gold > i { background: linear-gradient(90deg, #ffb300, var(--gold)); }
.bar.cyan > i { background: linear-gradient(90deg, #0ea5e9, var(--cyan)); }
.bar.boost > i { background: linear-gradient(90deg, #ff6b00, #ffb347); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: #120d33; border: 2px solid var(--ink); font-weight: 600; font-size: .85rem; white-space: nowrap; }
.chip svg { width: 18px; height: 18px; }

/* ---------- Top-Bar ---------- */
.topbar { display: flex; align-items: center; gap: 10px; padding-block: 12px 4px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: linear-gradient(180deg, var(--night) 70%, transparent); }
.topbar .grow { flex: 1; min-width: 0; }
.stat { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-size: 1.1rem; background: #0f0b2b; border: 2.5px solid var(--ink); border-radius: 12px; padding: 3px 10px 3px 6px; box-shadow: 0 3px 0 var(--ink); }
.stat svg { width: 22px; height: 22px; }

/* ---------- Bottom-Navigation ---------- */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(0deg, #0b0826 60%, rgba(11,8,38,0)); }
.nav-inner { display: flex; gap: 6px; max-width: 560px; width: 100%; background: #1a1349; border: 3px solid var(--ink); border-radius: 20px; padding: 6px; box-shadow: 0 5px 0 var(--ink); }
.nav button { flex: 1; min-width: 0; background: none; border: 0; border-radius: 14px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; color: var(--muted); font-family: var(--font-display); font-size: .82rem; letter-spacing: .02em; }
.nav button svg { width: 28px; height: 28px; }
.nav button.on { background: #34268c; color: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,.25); }
.nav .dot { position: absolute; }

/* ---------- Lobby ---------- */
.lobby { display: grid; gap: 16px; }
.lobby-side { margin-top: 2px; }
.hero { position: relative; display: grid; grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 8px 0 0; }
.hero .avatar-wrap { width: min(62vw, 260px); aspect-ratio: 1; position: relative; }
.hero .avatar-wrap::before { content: ''; position: absolute; inset: 12% 8% 0; background: radial-gradient(closest-side, rgba(255,198,41,.35), transparent); filter: blur(6px); }
.hero .pedestal { position: absolute; left: 12%; right: 12%; bottom: 2%; height: 16%; border-radius: 50%; background: radial-gradient(closest-side, #5a3fd6, #2a1f73 70%, transparent 72%); }
.avatar { width: 100%; height: 100%; position: relative; display: block; }
.idle { animation: idle 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes idle { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-5px) scale(1.015); } }
.nameplate { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; margin-top: -6px; }
.nameplate .title { font-size: .8rem; color: var(--gold); font-weight: 600; letter-spacing: .04em; }
.play-btn { width: 100%; max-width: 440px; margin-top: 10px; }
.play-meta { display: flex; justify-content: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.focus-card { display: grid; grid-template-columns: 64px 1fr; gap: 12px; align-items: center; }
.focus-card .mini { width: 64px; height: 64px; }

.quest { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 10px 12px; border-radius: 14px; background: #1a1349; border: 2px solid var(--ink); }
.quest.done { background: #173d1a; }
.quest .q { font-weight: 600; font-size: .92rem; }
.quest .x { font-family: var(--font-display); color: var(--gold); }
.quest .bar { grid-column: 1 / -1; height: 10px; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week .d { height: 46px; border-radius: 10px; background: #120d33; border: 2px solid var(--ink); display: grid; place-items: center; font-size: .72rem; font-weight: 700; color: var(--muted); position: relative; }
.week .d.on { background: radial-gradient(circle at 50% 35%, #ffd66b, #ff8a00); color: var(--ink); }
.week .d.today { outline: 2px dashed var(--gold); outline-offset: 2px; }
.week .d svg { width: 30px; height: 30px; }

/* ---------- Match-HUD ---------- */
.hud { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding-block: 10px 6px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: linear-gradient(180deg, var(--night) 75%, transparent); }
.track { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.track .seg { height: 14px; border-radius: 7px; background: #3a2f86; border: 2px solid var(--ink); position: relative; overflow: hidden; box-shadow: inset 0 2px 0 rgba(0,0,0,.25); }
.track .seg i { position: absolute; inset: 0 auto 0 0; background: var(--gold); transition: width .4s; }
.track .seg.done i { width: 100% !important; background: var(--lime); }
.phase-name { font-family: var(--font-display); font-size: 1rem; text-align: center; margin-top: 5px; color: #fff; letter-spacing: .03em; text-shadow: 0 2px 0 var(--ink); }
.combo { font-family: var(--font-display); font-size: 1.1rem; display: inline-flex; align-items: center; gap: 4px; min-width: 64px; justify-content: flex-end; }
.combo svg { width: 26px; height: 26px; }
.combo.hot { color: #ffb347; animation: pulse .6s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }

/* ---------- Übungskarte (ruhig, hell) ---------- */
.card {
  background: var(--paper); color: var(--paper-ink);
  border: 3px solid var(--ink); border-radius: var(--r-lg);
  box-shadow: 0 6px 0 var(--ink);
  padding: 20px 18px 22px; position: relative;
}
.card .instr { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: calc(1.08rem * var(--fs)); line-height: 1.4; }
.card .instr .say { flex: none; }
.card .strat-tag { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--violet2); background: var(--paper2); border-radius: 999px; padding: 3px 10px 3px 6px; }
.card .strat-tag svg { width: 20px; height: 20px; }
.word {
  font-family: var(--font-body); font-weight: 600; font-size: calc(var(--word-size) * var(--fs));
  letter-spacing: .07em; line-height: 1.25; text-align: center; color: var(--paper-ink);
  overflow-wrap: anywhere;
}
.word .spot { color: var(--violet2); background: #e2dcff; border-radius: 8px; padding: 0 .08em; }
.word .bad { color: #b45309; background: #ffe2b0; border-radius: 6px; box-shadow: inset 0 -4px 0 var(--amber); }
.word .gap { display: inline-block; min-width: 1.4em; border-bottom: 5px solid var(--violet2); margin: 0 .05em; text-align: center; color: var(--violet2); }
.word .gap.filled { border-bottom-color: transparent; background: #e2dcff; border-radius: 8px; }
.sentence { font-size: calc(1.35rem * var(--fs)); line-height: 1.65; text-align: center; font-weight: 500; letter-spacing: .03em; word-spacing: .12em; }
.sentence .blank { display: inline-block; min-width: 3.2em; border-bottom: 3px solid var(--paper-mute); }
.syl-a { color: #1d4ed8; } .syl-b { color: #c2410c; }
.arcs { display: block; margin: -4px auto 0; }

.opts { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.opt {
  min-width: 96px; min-height: 64px; padding: 8px 18px;
  background: #fff; color: var(--paper-ink); border: 3px solid var(--ink); border-radius: 16px;
  box-shadow: 0 5px 0 var(--ink); font-family: var(--font-body); font-weight: 700; font-size: calc(1.7rem * var(--fs)); letter-spacing: .05em;
  cursor: pointer; transition: transform .06s, box-shadow .06s, background .2s;
}
.opt:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.opt.small { font-size: 1.05rem; min-height: 54px; font-weight: 600; letter-spacing: 0; }
.opt.right { background: #d9f99d; }
.opt.wrong { background: var(--amber-bg); opacity: .75; }
.opt.dim { opacity: .45; }
.opt .sub { display: block; font-size: .8rem; font-weight: 500; letter-spacing: 0; color: var(--paper-mute); }

.tools { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.tool { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; min-height: 44px; border-radius: 12px; border: 2.5px solid var(--ink); background: #fff; color: var(--paper-ink); font-weight: 600; font-size: .92rem; cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.tool:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.tool svg { width: 22px; height: 22px; }
.tool.gadget { background: #efeaff; }
.tool.used { background: #e2dcff; }

/* Eingabe */
.entry { margin: 18px auto 4px; min-height: 76px; max-width: 100%; display: flex; align-items: center; justify-content: center; padding: 8px 14px; background: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: inset 0 3px 0 rgba(0,0,0,.06); font-family: var(--font-body); font-weight: 600; font-size: calc(var(--word-size) * var(--fs)); letter-spacing: .07em; color: var(--paper-ink); overflow-x: auto; white-space: nowrap; }
.entry.multi { white-space: normal; font-size: calc(1.45rem * var(--fs)); letter-spacing: .03em; line-height: 1.6; justify-content: flex-start; min-height: 110px; align-items: flex-start; }
.entry .caret { display: inline-block; width: 3px; height: 1em; background: var(--violet2); margin-left: 2px; animation: blink 1s steps(1) infinite; vertical-align: -0.12em; }
@keyframes blink { 50% { opacity: 0; } }
.entry .ph { color: #b9b4dc; font-weight: 500; letter-spacing: 0; font-size: 1.1rem; }

/* Bildschirmtastatur */
.kbd { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; user-select: none; -webkit-user-select: none; }
.kbd .r { display: flex; gap: 5px; justify-content: center; }
.kbd button { flex: 1 1 0; min-width: 0; max-width: 58px; height: 52px; border-radius: 10px; border: 2px solid var(--ink); background: var(--k-b, #fff); color: var(--k-t, var(--paper-ink)); font-family: var(--font-body); font-weight: 600; font-size: 1.3rem; box-shadow: 0 3px 0 var(--ink); cursor: pointer; padding: 0; touch-action: manipulation; }
.kbd button:active, .kbd button.hit { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); background: var(--k-c, #ffe28a); }
.kbd button.wide { max-width: 92px; flex-grow: 1.6; font-size: .95rem; }
.kbd button.space { max-width: 300px; flex-grow: 5; }
.kbd button.ok { background: var(--lime); max-width: 120px; flex-grow: 2; font-family: var(--font-display); font-size: 1.1rem; }
.kbd button.shift.on { background: var(--k-c, var(--gold)); }
.kbd-mini { display: grid; gap: 8px; justify-items: center; margin-top: 10px; }
.kbd-mini-keys { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.kbd-mini-keys[hidden] { display: none; }
.kbd-mini .ctl { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.kbd-mini .linkbtn { color: #6b66a3; }
.kbd-mini-keys button { width: 48px; height: 44px; border-radius: 10px; border: 2px solid var(--ink); background: #fff; color: var(--paper-ink); font-weight: 700; font-size: 1.2rem; box-shadow: 0 3px 0 var(--ink); cursor: pointer; }
@media (max-width: 420px) { .kbd button { height: 46px; font-size: 1.12rem; } .kbd .r { gap: 3px; } }

/* Rückmeldung */
.feedback { margin-top: 16px; border-radius: 18px; border: 3px solid var(--ink); padding: 14px 16px; display: grid; gap: 10px; animation: fbIn .25s ease-out; color: var(--paper-ink); }
@keyframes fbIn { from { transform: translateY(10px); opacity: 0; } }
.feedback.good { background: #dcfce7; }
.feedback.almost { background: var(--amber-bg); }
.feedback .head { font-family: var(--font-display); font-size: 1.5rem; display: flex; align-items: center; gap: 8px; }
.feedback.good .head { color: #166534; }
.feedback.almost .head { color: #9a3412; }
.feedback .why { font-size: calc(1.05rem * var(--fs)); line-height: 1.45; font-weight: 500; }
.feedback .why b { color: var(--violet2); }
.feedback .xp { font-family: var(--font-display); color: #a16207; }

/* Regelkarte */
.rulecard { background: var(--paper); color: var(--paper-ink); border: 3px solid var(--ink); border-radius: var(--r-lg); box-shadow: 0 6px 0 var(--ink); overflow: hidden; }
.rulecard .top { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; padding: 14px 16px; background: linear-gradient(135deg, var(--c1, #5a3fd6), var(--c2, #2a1f73)); color: #fff; border-bottom: 3px solid var(--ink); }
.rulecard .top .avatar { width: 96px; height: 96px; }
.rulecard .body { padding: 16px 18px 18px; display: grid; gap: 14px; }
.rulecard .text { font-size: calc(1.1rem * var(--fs)); line-height: 1.6; }
.rulecard .ex { font-size: calc(1.6rem * var(--fs)); font-weight: 600; letter-spacing: .06em; text-align: center; padding: 12px; background: var(--paper2); border-radius: 14px; }

/* Ergebnis / Sieg */
.victory { text-align: center; padding-top: 18px; }
.victory h1 { font-size: clamp(3rem, 14vw, 5.2rem); color: var(--gold); }
.victory .sub { font-family: var(--font-display); font-size: 1.3rem; }
.stars { display: flex; justify-content: center; gap: 6px; margin: 6px 0; }
.stars svg { width: 54px; height: 54px; }
.stars svg.off { opacity: .25; filter: grayscale(1); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.kpi { background: #1a1349; border: 2.5px solid var(--ink); border-radius: 16px; padding: 10px 6px; text-align: center; }
.kpi b { display: block; font-family: var(--font-display); font-size: 1.7rem; line-height: 1.1; }
.kpi span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }

/* Karten-Drop */
.drop-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; perspective: 900px; max-width: 460px; width: 100%; margin: 0 auto; }
.dcard { aspect-ratio: 3 / 4; border-radius: 18px; border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink); cursor: pointer; position: relative; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.2,.8,.2,1); background: none; padding: 0; }
.dcard .f, .dcard .b { position: absolute; inset: 0; border-radius: 15px; backface-visibility: hidden; display: grid; place-items: center; padding: 8px; text-align: center; }
.dcard .b { background: repeating-linear-gradient(45deg, #3b2a8f 0 10px, #2c2070 10px 20px); }
.dcard .b svg { width: 46%; height: auto; }
.dcard .f { transform: rotateY(180deg); background: var(--rc, #3fd46b); color: var(--ink); font-weight: 700; font-size: .85rem; line-height: 1.25; }
.dcard.open { transform: rotateY(180deg); }
.dcard.picked { outline: 4px solid #fff; outline-offset: 3px; }
.dcard:not(.open):hover { transform: translateY(-4px); }

/* Crew */
.champ-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.champ { position: relative; border: 3px solid var(--ink); border-radius: 18px; background: linear-gradient(180deg, var(--rc) -40%, #231a63 55%); box-shadow: 0 5px 0 var(--ink); padding: 8px 8px 10px; text-align: center; cursor: pointer; color: #fff; }
.champ .avatar { width: 100%; aspect-ratio: 1; height: auto; }
.champ .nm { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: .03em; }
.champ .rk { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.champ.locked { filter: grayscale(1) brightness(.55); }
.champ.locked::after { content: ''; position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; background: center / contain no-repeat var(--lock); }
.champ.sel { outline: 4px solid var(--gold); outline-offset: 2px; }
.rankpill { display: inline-block; padding: 2px 10px; border-radius: 999px; border: 2px solid var(--ink); font-weight: 800; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }

/* Pass */
.pass { display: grid; grid-auto-flow: column; grid-auto-columns: 128px; gap: 10px; overflow-x: auto; padding: 6px 4px 14px; scroll-snap-type: x proximity; }
.tier { scroll-snap-align: center; border: 3px solid var(--ink); border-radius: 16px; background: #1a1349; padding: 8px; display: grid; gap: 6px; text-align: center; position: relative; min-height: 170px; box-shadow: 0 4px 0 var(--ink); }
.tier .n { font-family: var(--font-display); font-size: 1.1rem; }
.tier .rw { font-size: .78rem; font-weight: 600; line-height: 1.25; display: grid; place-items: center; }
.tier .ic { height: 56px; display: grid; place-items: center; }
.tier .ic svg { width: 48px; height: 48px; }
.tier.reached { background: linear-gradient(180deg, #3b2a8f, #221a5e); }
.tier.claimed { background: #173d1a; }
.tier.cur { outline: 3px solid var(--gold); outline-offset: 2px; }

/* Trophäenstraße */
.road { display: grid; gap: 8px; }
.road .m { display: grid; grid-template-columns: 70px 1fr auto; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 14px; background: #1a1349; border: 2px solid var(--ink); }
.road .m.got { background: #173d1a; }
.road .m b { font-family: var(--font-display); font-size: 1.1rem; }

/* Modal & Toast */
.modal-bg { position: fixed; inset: 0; background: rgba(8,5,26,.72); z-index: 50; display: grid; place-items: center; padding: 16px; animation: fadeIn .2s; backdrop-filter: blur(3px); }
@keyframes fadeIn { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; animation: pop .3s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.toasts { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); pointer-events: none; }
.toast { background: #1a1349; border: 3px solid var(--ink); border-radius: 14px; padding: 10px 14px; box-shadow: 0 4px 0 var(--ink); font-weight: 600; animation: toastIn .35s cubic-bezier(.2,1.4,.4,1); display: flex; gap: 10px; align-items: center; }
.toast.reward { background: linear-gradient(90deg, #4c1d95, #6d28d9); }
.toast svg { width: 26px; height: 26px; flex: none; }
@keyframes toastIn { from { transform: translateY(-16px) scale(.9); opacity: 0; } }

/* Effekte */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 70; }
.pop-xp { position: absolute; font-family: var(--font-display); font-size: 1.6rem; color: var(--gold); animation: floatUp 1s ease-out forwards; text-shadow: 0 3px 0 var(--ink); }
@keyframes floatUp { to { transform: translateY(-70px); opacity: 0; } }
.shake { animation: shake .35s; }
@keyframes shake { 20%,60% { transform: translateX(-5px); } 40%,80% { transform: translateX(5px); } }
.bounce { animation: bounce .45s cubic-bezier(.2,1.6,.4,1); }
@keyframes bounce { from { transform: scale(.7); } }
.boss-hp { height: 22px; border: 3px solid var(--ink); border-radius: 12px; background: #120d33; overflow: hidden; position: relative; }
.boss-hp i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ff3d6e, #ff8a00); transition: width .5s; }
.boss-hp span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: .85rem; color: #fff; text-shadow: 0 2px 0 var(--ink); }
.boss { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; margin-bottom: 12px; }
.boss .avatar { width: 84px; height: 84px; }
.boss .hurt { animation: shake .35s, flash .35s; }
@keyframes flash { 50% { filter: brightness(2.2) saturate(0); } }

/* Diagramme nicht zu hoch werden lassen */
.panel svg[role=img] { display: block; max-height: 240px; margin: 0 auto; }

/* Eltern */
.parent { color: var(--text); }
.parent .card { color: var(--paper-ink); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.tabs button { flex: none; padding: 8px 14px; border-radius: 12px; border: 2px solid var(--ink); background: #1a1349; color: var(--muted); font-weight: 700; cursor: pointer; }
.tabs button.on { background: var(--gold); color: var(--ink); }
.prose { line-height: 1.65; }
.prose h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.25rem; margin: 18px 0 6px; color: var(--paper-ink); }
.prose p, .prose li { max-width: 66ch; }
.prose ul { padding-left: 1.2em; }
.prose a { color: var(--violet2); }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th, table.t td { text-align: left; padding: 7px 8px; border-bottom: 1px solid #d9d5f3; vertical-align: top; }
table.t th { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--paper-mute); }
.scroll-x { overflow-x: auto; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 700; font-size: .9rem; }
.field input[type=text], .field input[type=password], .field textarea, .field select { font: inherit; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--ink); background: #fff; color: var(--paper-ink); width: 100%; }
.field textarea { min-height: 110px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid #e3dff8; }
.switch:last-child { border-bottom: 0; }
.switch input[type=checkbox] { width: 26px; height: 26px; accent-color: var(--violet2); }
.switch input[type=range] { width: 160px; accent-color: var(--violet2); }
.cat-row { display: grid; grid-template-columns: minmax(120px, 1.2fr) 2fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.cat-row .bar { height: 12px; }
.meter { height: 12px; border-radius: 99px; background: #e5e1fa; overflow: hidden; position: relative; }
.meter i { position: absolute; inset: 0 auto 0 0; border-radius: 99px; }
.note { font-size: .9rem; color: var(--paper-mute); }
.callout { background: #efeaff; border-radius: 14px; padding: 12px 14px; }
.callout.warn { background: var(--amber-bg); }


/* ---------- Desktop (ab 1024 px): Navigation als Leiste links, Lobby zweispaltig ---------- */
@media (min-width: 1024px) {
  body { padding-left: 112px; }
  #app { max-width: 1180px; padding-bottom: 40px; }
  .nav { top: 0; bottom: 0; left: 0; right: auto; width: 112px; padding: 20px 12px; align-items: center; background: linear-gradient(90deg, #0b0826 75%, rgba(11,8,38,0)); }
  .nav-inner { flex-direction: column; width: 88px; max-width: none; gap: 8px; padding: 8px; }
  .nav button { padding: 12px 2px; font-size: .85rem; }
  .nav button svg { width: 32px; height: 32px; }
  .lobby { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; align-items: start; }
  .lobby-main { position: sticky; top: 72px; }
  .hero .avatar-wrap { width: min(34vw, 340px); }
  .play-btn { max-width: none; }
  .champ-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .hud + div > .card, .hud + div > .rulecard, .hud + div > .panel, .hud + div > div > .card, .victory { max-width: 880px; margin-left: auto; margin-right: auto; }
  .hud { max-width: 880px; margin: 0 auto; }
  .victory { max-width: 720px; }
  .parent .stack > .card { max-width: none; }
  .parent-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
  .modal { width: min(640px, 100%); }
}
@media (min-width: 1440px) {
  #app { max-width: 1280px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
