/* Gambit Akademie – Gestaltung
 * Königsblau als Leitfarbe, Messing für Erfolge, kühles Papier als Grund. */
:root {
  --bg: #EDF1F7;
  --surface: #FFFFFF;
  --surface-2: #F5F7FB;
  --ink: #131D33;
  --muted: #56647C;
  --line: #D8DFEA;
  --primary: #1D3FAF;
  --primary-ink: #FFFFFF;
  --primary-soft: #DCE4FB;
  --brass: #E3A72F;
  --brass-soft: #FBEFD3;
  --good: #1E8F5E;
  --good-soft: #D8F1E5;
  --bad: #C8423A;
  --bad-soft: #F8DEDB;
  --sq-light: #E4E9F1;
  --sq-dark: #8197BA;
  --sq-last: rgba(227, 167, 47, .45);
  --sq-sel: rgba(29, 63, 175, .38);
  --sq-hint: rgba(30, 143, 94, .55);
  --piece-w: #FBFBF8;
  --piece-w-line: #18213A;
  --piece-b: #1F2740;
  --piece-b-line: #0B0F1C;
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 1px 2px rgba(19, 29, 51, .06), 0 6px 20px rgba(19, 29, 51, .07);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tabbar-h: 64px;
  /* Felder der Puzzle Karte */
  --node-light: #EEF1F6; --node-dark: #6E84A8; --node-light-locked: #D3D9E3; --node-dark-locked: #56698B; --node-edge: rgba(19, 29, 51, .12);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1424; --surface: #172036; --surface-2: #1D2843; --ink: #EAF0FA; --muted: #9AA8C2; --line: #2A3756;
    --primary: #6F8EFF; --primary-ink: #0B1020; --primary-soft: #23305A; --brass-soft: #3A2F18; --good-soft: #16382A; --bad-soft: #3D1E1E;
    --sq-light: #C9D3E3; --sq-dark: #5E769C; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --node-light: #E2E7EF; --node-dark: #5A6F93; --node-light-locked: #A9B3C4; --node-dark-locked: #3E4E6B; --node-edge: rgba(255, 255, 255, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1424; --surface: #172036; --surface-2: #1D2843; --ink: #EAF0FA; --muted: #9AA8C2; --line: #2A3756;
  --primary: #6F8EFF; --primary-ink: #0B1020; --primary-soft: #23305A; --brass-soft: #3A2F18; --good-soft: #16382A; --bad-soft: #3D1E1E;
  --sq-light: #C9D3E3; --sq-dark: #5E769C; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --node-light: #E2E7EF; --node-dark: #5A6F93; --node-light-locked: #A9B3C4; --node-dark-locked: #3E4E6B; --node-edge: rgba(255, 255, 255, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
body.no-tabbar { padding-bottom: 0; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .4em; }
h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
a { color: var(--primary); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .35em; }

/* Kopfzeile und Navigation */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 800; letter-spacing: -.02em; }
.brand svg { width: 28px; height: 28px; fill: var(--primary); }
.chips { display: flex; gap: 6px; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 650; }
.tabbar .ti { font-size: 1.3rem; line-height: 1; }
.tabbar a[aria-current="page"] { color: var(--primary); }
.tabbar a[aria-current="page"] .ti { transform: translateY(-1px); }

main { max-width: 1080px; margin: 0 auto; padding: 8px 16px 32px; outline: none; }
.view { animation: viewIn .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Bausteine */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer;
  text-decoration: none; color: var(--ink); transition: transform .12s ease, background .15s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-brass { background: var(--brass); border-color: var(--brass); color: #2B1D00; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.icon-btn { min-width: 46px; padding: 0 12px; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.grid { display: grid; gap: 12px; }
.stack > * + * { margin-top: 12px; }

/* Onboarding */
.onboard { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; max-width: 560px; margin: 0 auto; padding: 32px 0; }
.onboard-hero { position: relative; margin-bottom: 28px; }
.onboard-hero .mini-board { width: 132px; aspect-ratio: 1; display: grid; grid-template-columns: repeat(4, 1fr); border-radius: 14px; overflow: hidden; transform: rotate(-6deg); box-shadow: var(--shadow); margin-bottom: 20px; }
.onboard-hero .mini-board span:nth-child(odd) { background: var(--sq-light); }
.onboard-hero .mini-board span:nth-child(even) { background: var(--sq-dark); }
.onboard-hero .mini-board span:nth-child(4n+1), .onboard-hero .mini-board span:nth-child(4n+3) { }
.level-choice { display: grid; gap: 10px; }
.level-choice button {
  display: grid; grid-template-columns: 52px 1fr; gap: 14px; align-items: center; text-align: left; cursor: pointer;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 16px; transition: border-color .15s, transform .12s;
}
.level-choice button:hover { border-color: var(--primary); }
.level-choice button:active { transform: scale(.985); }
.level-choice svg { width: 52px; height: 52px; }
.level-choice strong { display: block; font-size: 1.05rem; }
.level-choice span { color: var(--muted); font-size: .92rem; }

/* Startseite */
.home-hero { display: grid; gap: 14px; margin: 8px 0 18px; }
.continue {
  position: relative; overflow: hidden; background: var(--primary); color: var(--primary-ink); border-radius: 22px; padding: 22px; text-decoration: none; display: block;
}
.continue h2 { font-size: 1.6rem; margin-bottom: .2em; }
.continue .eyebrow { color: color-mix(in srgb, var(--primary-ink) 75%, transparent); }
.continue .go { display: inline-flex; margin-top: 14px; background: var(--brass); color: #2B1D00; font-weight: 800; padding: 10px 16px; border-radius: 12px; }
.continue .ghost-piece { position: absolute; right: -14px; bottom: -22px; width: 150px; height: 150px; fill: color-mix(in srgb, var(--primary-ink) 14%, transparent); }
.progress { height: 8px; background: color-mix(in srgb, var(--primary-ink) 20%, transparent); border-radius: 99px; overflow: hidden; margin-top: 10px; max-width: 260px; }
.progress i { display: block; height: 100%; background: var(--brass); border-radius: 99px; }
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 4px; min-height: 120px; }
.tile .tile-ico { font-size: 1.6rem; }
.tile strong { font-size: 1.02rem; }
.tile span { color: var(--muted); font-size: .86rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }
.stat { background: var(--surface); border-radius: 14px; padding: 12px; text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .78rem; color: var(--muted); }

/* Werbung */
.ad-banner { margin: 18px 0 0; min-height: 70px; border: 1px dashed var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; background: var(--surface-2); overflow: hidden; }
.ad-label { font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ad-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(8, 12, 24, .82); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ad-box { background: var(--surface); border-radius: 20px; width: min(420px, 100%); padding: 16px; text-align: center; }
.ad-slot { min-height: 280px; border-radius: 12px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; margin: 10px 0 14px; color: var(--muted); overflow: hidden; }

/* Brett */
.play { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) { .play { grid-template-columns: minmax(0, 560px) 1fr; } }
.board-wrap { width: 100%; max-width: 560px; margin: 0 auto; position: relative; }
@media (min-width: 900px) { .board-wrap { max-width: max(300px, min(560px, calc(100svh - 110px))); } }
.board {
  position: relative; width: 100%; aspect-ratio: 1; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); touch-action: none; user-select: none; -webkit-user-select: none;
}
.sq { position: relative; display: flex; align-items: center; justify-content: center; }
.sq.l { background: var(--sq-light); }
.sq.d { background: var(--sq-dark); }
.sq.last::before, .sq.sel::before, .sq.hint::before, .sq.check::before, .sq.good::before, .sq.bad::before { content: ""; position: absolute; inset: 0; }
.sq.last::before { background: var(--sq-last); }
.sq.sel::before { background: var(--sq-sel); }
.sq.hint::before { background: var(--sq-hint); animation: pulse 1.2s ease-in-out infinite; }
.sq.check::before { background: radial-gradient(circle, rgba(200, 66, 58, .85) 0%, rgba(200, 66, 58, .35) 55%, transparent 75%); }
.sq.good::before { background: rgba(30, 143, 94, .5); }
.sq.bad::before { background: rgba(200, 66, 58, .5); }
@keyframes pulse { 50% { opacity: .45; } }
/* Matt Erklärung: Grün = Schachlinie, Rot = angegriffene Fluchtfelder, Grau = von eigenen Figuren versperrt */
.sq.x-line::before, .sq.x-block::before, .sq.x-own::before { content: ""; position: absolute; inset: 0; animation: xIn .35s ease-out both; }
.sq.x-line::before { background: rgba(34, 197, 94, .62); box-shadow: inset 0 0 0 2px rgba(21, 128, 61, .55); }
.sq.x-block::before { background: rgba(229, 72, 77, .6); box-shadow: inset 0 0 0 2px rgba(160, 30, 40, .5); animation-delay: .35s; }
.sq.x-own::before { background: repeating-linear-gradient(45deg, rgba(90, 100, 120, .55) 0 5px, rgba(90, 100, 120, .2) 5px 10px); animation-delay: .5s; }
.sq.x-king::after { content: ""; position: absolute; inset: 6%; border-radius: 50%; box-shadow: 0 0 0 3px #E5484D, 0 0 14px 4px rgba(229, 72, 77, .7); z-index: 2; pointer-events: none; }
@keyframes xIn { from { opacity: 0; transform: scale(.6); } }
/* Während der Erklärung stören die übrigen Markierungen (letzter Zug, Schachglühen) */
.board.explain .sq.last:not(.x-line):not(.x-block):not(.x-own)::before,
.board.explain .sq.check::before { display: none; }
.legend { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: grid; gap: 8px; }
.legend h3 { margin: 0 0 2px; }
.legend p { margin: 0; display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; }
.legend .sw { width: 22px; height: 22px; border-radius: 6px; margin-top: 1px; }
.legend .sw.g { background: rgba(34, 197, 94, .8); }
.legend .sw.r { background: rgba(229, 72, 77, .8); }
.legend .sw.o { background: repeating-linear-gradient(45deg, rgba(90, 100, 120, .7) 0 4px, rgba(90, 100, 120, .25) 4px 8px); }
.legend .sw.k { border-radius: 50%; box-shadow: inset 0 0 0 3px #E5484D; }
.legend .sum { grid-template-columns: 1fr; padding-top: 6px; border-top: 1px solid var(--line); font-weight: 650; }
.sq .dot { position: absolute; width: 30%; height: 30%; border-radius: 50%; background: rgba(19, 29, 51, .24); pointer-events: none; z-index: 2; }
.sq .ring { position: absolute; inset: 4%; border-radius: 50%; border: 5px solid rgba(19, 29, 51, .24); pointer-events: none; z-index: 2; }
.coord { position: absolute; font-size: clamp(8px, 2.2vw, 11px); font-weight: 700; pointer-events: none; z-index: 1; }
.coord.f { right: 3px; bottom: 1px; }
.coord.r { left: 3px; top: 1px; }
.sq.l .coord { color: var(--sq-dark); }
.sq.d .coord { color: var(--sq-light); }
.pc { width: 92%; height: 92%; position: relative; z-index: 3; cursor: grab; transition: transform .12s ease; pointer-events: none; }
.pc.pc-hidden { visibility: hidden; }
/* Gleitende Figur beim Zug: liegt über dem Brett, Grösse eines Feldes */
.anim-pc { position: absolute; width: 12.5%; height: 12.5%; display: flex; align-items: center; justify-content: center; pointer-events: none; z-index: 6; will-change: transform; }
.anim-pc .pc { width: 92%; height: 92%; }
.pc.w { fill: var(--piece-w); stroke: var(--piece-w-line); stroke-width: 1.4; stroke-linejoin: round; }
.pc.b { fill: var(--piece-b); stroke: var(--piece-b-line); stroke-width: 1.4; stroke-linejoin: round; }
.pc .cut { fill: none; stroke-width: 1.6; stroke-linecap: round; }
.pc.w .cut { stroke: var(--piece-w-line); }
.pc.b .cut { stroke: #8D9BBC; }
.pc .eye { stroke: none; }
.pc.w .eye { fill: var(--piece-w-line); }
.pc.b .eye { fill: #8D9BBC; }
.drag-ghost { position: fixed; z-index: 80; pointer-events: none; transform: translate(-50%, -58%) scale(1.15); filter: drop-shadow(0 6px 8px rgba(0,0,0,.3)); }
.board.flash-bad { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.promo { position: absolute; inset: 0; z-index: 10; background: rgba(8, 12, 24, .55); display: flex; align-items: center; justify-content: center; }
.promo-box { display: flex; gap: 6px; background: var(--surface); padding: 8px; border-radius: 14px; }
.promo-box button { width: 64px; height: 64px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); cursor: pointer; padding: 4px; }
.promo-box svg { width: 100%; height: 100%; }

/* Seitenleiste neben dem Brett */
.panel { display: grid; gap: 12px; }
.status { border-radius: var(--radius); padding: 14px 16px; background: var(--surface); box-shadow: var(--shadow); }
.status.good { background: var(--good-soft); }
.status.bad { background: var(--bad-soft); }
.status.info { background: var(--primary-soft); }
.status h3 { margin: 0 0 4px; }
.status p { margin: 0; }
.turn-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); vertical-align: -1px; margin-right: 6px; }
.turn-dot.w { background: #fff; }
.turn-dot.b { background: #1F2740; }
.movelist { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px 12px; max-height: 220px; overflow: auto; font-variant-numeric: tabular-nums; display: grid; grid-template-columns: 2.2em 1fr 1fr; gap: 2px 8px; font-size: .92rem; }
.movelist .n { color: var(--muted); }
.movelist .cur { background: var(--brass-soft); border-radius: 4px; padding: 0 4px; margin: 0 -4px; }
.comment { background: var(--brass-soft); border-radius: var(--radius); padding: 14px 16px; min-height: 76px; }

/* Puzzle Pfad */
.world { margin: 22px 0 8px; }
.world-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.world-head h2 { margin: 0; }
.path { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; max-width: 520px; }
.node {
  position: relative; aspect-ratio: 1; border-radius: 14px; border: 0; cursor: pointer; font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center; flex-direction: column; line-height: 1.1; color: var(--ink);
}
/* Fünf Spalten ergeben mit abwechselnden Farben automatisch ein Schachbrettmuster.
   Eigene, kontrastreiche Farben, damit das graue Feld auch gesperrt gut sichtbar bleibt. */
.path .node:nth-child(odd) { background: var(--node-light); color: #131D33; box-shadow: inset 0 0 0 1px var(--node-edge); }
.path .node:nth-child(even) { background: var(--node-dark); color: #fff; }
.node.solved::after { content: "★"; position: absolute; top: 3px; right: 6px; font-size: .8rem; color: var(--brass); text-shadow: 0 1px 0 rgba(0,0,0,.25); }
.node.locked { cursor: not-allowed; }
.path .node.locked:nth-child(odd) { background: var(--node-light-locked); }
.path .node.locked:nth-child(even) { background: var(--node-dark-locked); }
.node.current { outline: 3px solid var(--brass); outline-offset: 2px; animation: bob 1.6s ease-in-out infinite; }
.node .num { position: relative; z-index: 1; }
.node.current .lock.mini { position: absolute; left: 4px; top: 3px; width: 26%; }
.node.ad-mark.locked .lock { margin-bottom: 9px; width: 50%; }

/* Goldenes Schloss */
.lock { width: 58%; height: auto; overflow: visible; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); }
.lock .shackle { transform-box: view-box; transform-origin: 19px 46px; transition: transform .35s cubic-bezier(.3, 1.6, .5, 1); }
.lock.open .shackle { transform: translateY(-8px) rotate(-12deg); }
.node.locked:hover .lock .shackle { transform: translateY(-2px); }
.node.wiggle .lock { animation: lockWiggle .45s; }
@keyframes lockWiggle { 20% { transform: rotate(-12deg); } 45% { transform: rotate(10deg); } 70% { transform: rotate(-6deg); } }
/* Frisch freigeschaltet: Bügel springt auf, Schloss verschwindet, Nummer erscheint.
   Endzustand ohne Animation = nur Nummer sichtbar (wichtig für reduzierte Bewegung). */
.node.unlocking { animation: none; }
.node.unlocking .lock { position: absolute; opacity: 0; transform: scale(.3); animation: lockOut 1.6s ease-in both; }
.node.unlocking .lock .shackle { animation: shackleOpen 1.6s both; }
.node.unlocking .num { animation: numIn 1.6s both; }
@keyframes shackleOpen { 0%, 25% { transform: none; } 45%, 100% { transform: translateY(-8px) rotate(-12deg); } }
@keyframes lockOut { 0% { opacity: 1; transform: scale(1); } 15% { transform: scale(1.12); } 65% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(.3) translateY(-10px); } }
@keyframes numIn { 0%, 70% { opacity: 0; transform: scale(.4); } 100% { opacity: 1; transform: scale(1); } }
.unlock-note { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-weight: 700; }
.unlock-note .lock { width: 30px; flex: none; }
.unlock-note .lock .shackle { animation: shackleOpen 1.2s both; }
.node.ad-mark::before { content: "AD"; position: absolute; bottom: 3px; font-size: .55rem; letter-spacing: .06em; opacity: .7; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.node small { font-size: .6rem; font-weight: 600; opacity: .8; }

/* Gambit Liste */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 16px; }
.gambit-list { display: grid; gap: 10px; }
@media (min-width: 700px) { .gambit-list { grid-template-columns: repeat(2, 1fr); } }
.gcard { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; text-decoration: none; color: var(--ink); }
.gcard .side { width: 56px; height: 56px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.gcard .side.w { background: var(--sq-light); }
.gcard .side.b { background: var(--sq-dark); }
.gcard .side svg { width: 44px; height: 44px; }
.gcard p { margin: 0; color: var(--muted); font-size: .86rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lvl { display: inline-flex; gap: 3px; }
.lvl i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.lvl i.on { background: var(--brass); }
.badge { font-size: .72rem; font-weight: 800; padding: 3px 8px; border-radius: 99px; background: var(--good-soft); color: var(--good); }
.ideas { margin: 0; padding-left: 1.1em; }
.ideas li { margin-bottom: 4px; }

/* Sprachwahl im Onboarding */
.onb-lang { display: flex; justify-content: flex-end; margin-bottom: 12px; }

/* Gambit Kurse: Linien, Trainer Gustav, Modi */
.gmeta { display: grid; gap: 6px; justify-items: end; }
.gprog { width: 64px; height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.gprog i { display: block; height: 100%; background: var(--good); border-radius: 99px; }
.pill { font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; vertical-align: 1px; }
.pill.seen { background: var(--good-soft); color: var(--good); }
.pill.due { background: var(--brass-soft); color: var(--ink); }
.review-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0 4px; padding: 14px 16px; border-radius: var(--radius); background: var(--primary); color: var(--primary-ink); text-decoration: none; box-shadow: var(--shadow); }
.review-card b { display: block; font-size: 1.05rem; }
.review-card span span { font-size: .9rem; opacity: .9; }
.review-card .go { background: var(--brass); color: #2B1D00; font-weight: 800; padding: 8px 14px; border-radius: 12px; white-space: nowrap; }
.coach { display: flex; gap: 14px; align-items: flex-start; }
.coach .stage.small { width: 60px; border-radius: 14px; }
.coach .bubble { flex: 1; min-width: 0; font-weight: 500; padding: 12px 14px; min-height: 60px; transition: background-color .2s; }
.coach .bubble::before { top: 30px; }
.coach .bubble p { margin: 0; }
.coach .bubble p + p { margin-top: 6px; }
.coach .say { font-weight: 750; }
.coach.good .bubble { background: var(--good-soft); border-color: var(--good-soft); }
.coach.bad .bubble { background: var(--bad-soft); border-color: var(--bad-soft); }
.line-head { display: flex; justify-content: space-between; gap: 10px; font-size: .86rem; color: var(--muted); font-weight: 700; }
.line-head span:last-child { text-align: right; min-width: 0; }
.linepath { font-size: .92rem; color: var(--muted); line-height: 1.7; font-variant-numeric: tabular-nums; }
.linepath .n { margin-right: 3px; }
.linepath b { color: var(--ink); font-weight: 650; }
.timebar { height: 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.timebar i { display: block; height: 100%; width: 100%; background: var(--brass); transition: width .9s linear; }
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.modes.one { grid-template-columns: 1fr; }
.mode { position: relative; display: grid; gap: 2px; align-content: start; text-align: left; min-height: 74px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; text-decoration: none; cursor: pointer; transition: transform .12s ease; }
.mode:active { transform: scale(.98); }
.mode strong { font-size: 1.02rem; }
.mode span { font-size: .84rem; color: var(--muted); }
.mode.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.mode.primary span { color: inherit; opacity: .85; }
.mode.locked { background: var(--surface-2); color: var(--muted); cursor: not-allowed; padding-right: 44px; }
.mode .lock { position: absolute; right: 10px; top: 10px; width: 24px; }
.mode .lock.wiggle { animation: lockWiggle .45s; }
.mode:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.linelist { list-style: none; margin: 10px 0 0; padding: 0; }
.linelist li { display: grid; grid-template-columns: 1.4em minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.linelist li.off { opacity: .6; }
.linelist .no { color: var(--muted); font-variant-numeric: tabular-nums; }
.linelist .nm { font-weight: 650; }
.linelist .acts { display: flex; gap: 6px; }
@media (max-width: 420px) { .linelist li { grid-template-columns: 1.4em minmax(0, 1fr); } .linelist .acts { grid-column: 2; } }
.btn.sm { min-height: 36px; padding: 0 10px; font-size: .85rem; border-radius: 10px; }
.row-between { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.select { display: block; width: 100%; min-height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 650; }

/* Bots */
.bot-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .bot-grid { grid-template-columns: repeat(3, 1fr); } }
.bot { border: 2px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 8px 8px 12px; cursor: pointer; text-align: left; display: grid; gap: 2px; transition: border-color .15s, transform .12s; }
.bot b, .bot > span:not(.stage) { padding: 0 6px; }
.bot .stage { margin-bottom: 8px; }
.bot:active { transform: scale(.98); }
.bot[aria-pressed="true"] { border-color: var(--glow-sel, var(--primary)); background: var(--primary-soft); }
.bot[aria-pressed="true"] .avatar-svg { transform: scale(1.06); }
.avatar-svg { transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); transform-origin: 50% 100%; }

/* Bühne der Bot Figuren: jede Figur hat ihre eigene, flache Hintergrundfarbe (Avatars.bg), das Brustbild sitzt unten */
.stage {
  position: relative; display: flex; align-items: flex-end; justify-content: center; height: 128px; border-radius: 12px; overflow: hidden;
  background: var(--bot-bg, #8FD98C);
}
.stage .avatar-svg { display: block; flex: none; }
.stage.small { height: auto; width: 88px; aspect-ratio: 1; flex: none; border-radius: 16px; }
.stage.small .avatar-svg { width: 100%; height: 100%; }
.end-head .stage.small { width: 108px; }
.board-col { width: 100%; max-width: 560px; margin: 0 auto; }
@media (min-width: 900px) { .board-col { max-width: max(300px, min(560px, calc(100svh - 190px))); } }
.opponent { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.opponent .stage.small { width: 64px; border-radius: 14px; }
.opponent h1 { margin: 0; font-size: 1.35rem; }
.opponent .eyebrow { margin: 0; }
.end-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.bubble { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; font-weight: 650; }
.bubble::before { content: ""; position: absolute; left: -7px; top: 50%; width: 12px; height: 12px; background: inherit; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: translateY(-50%) rotate(45deg); }
.bot b { font-size: 1rem; }
.bot span { color: var(--muted); font-size: .84rem; }
.slider { width: 100%; accent-color: var(--primary); }
.elo-out { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.thinking::after { content: ""; display: inline-block; width: 1em; animation: dots 1s steps(4) infinite; overflow: hidden; vertical-align: bottom; }
@keyframes dots { from { width: 0; } to { width: 1.2em; } }

/* Lektionen */
.lesson-steps { display: flex; gap: 4px; margin: 6px 0 12px; }
.lesson-steps i { flex: 1; height: 5px; border-radius: 9px; background: var(--line); }
.lesson-steps i.on { background: var(--primary); }
.lesson-steps i.done { background: var(--brass); }

/* Dialoge und Hinweise */
.modal { position: fixed; inset: 0; z-index: 70; background: rgba(8, 12, 24, .6); display: flex; align-items: flex-end; justify-content: center; padding: 12px; animation: fade .2s; }
@media (min-width: 600px) { .modal { align-items: center; } }
.modal-box { background: var(--surface); border-radius: 22px; width: min(440px, 100%); padding: 22px; animation: rise .28s cubic-bezier(.2, .8, .2, 1); }
.modal-box .big { font-size: 3rem; line-height: 1; margin-bottom: 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 650; z-index: 95; pointer-events: none; transition: .25s; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.settings-list { display: grid; gap: 8px; }
.settings-list .row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); }
.legal { font-size: .78rem; color: var(--muted); margin-top: 24px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
