/* Teilmal – Gestaltung
   Wie Vokaboom: hell, freundlich, grosse runde Karten, weiche Farbverläufe im Hintergrund.
   Eigene Farben: Petrol/Türkis als Hauptfarbe, dazu Koralle und Sonnengelb. Jede Übung und jedes Spiel mit eigener Farbe. */
:root {
  --bg: #F2F8F7;
  --bg-glow-1: #CFF1E8;
  --bg-glow-2: #FFE3D6;
  --bg-glow-3: #D9E9FF;
  --paper: #FFFFFF;
  --paper-2: #F6FAF9;
  --sunken: #EAF2F1;
  --sunken-2: #DCE8E6;
  --ink: #12262A;
  --ink-2: #44606A;
  --ink-3: #74898F;
  --line: #DCE7E6;
  --line-2: #C3D4D3;
  --brand: #0F766E;
  --brand-2: #0E7490;
  --brand-ink: #0B5E58;
  --brand-wash: #E1F5F1;
  --on-brand: #FFFFFF;
  --coral: #FF6B4A;
  --coral-ink: #B8361C;
  --coral-wash: #FFE9E2;
  --sun: #FFC233;
  --sun-wash: #FFF4D2;
  --green: #16A34A;
  --green-ink: #126B34;
  --green-wash: #DCF7E5;
  --red: #E0393E;
  --red-ink: #B42328;
  --red-wash: #FFE3E4;
  --orange: #EA7A0C;
  --orange-wash: #FFEDD8;
  --lv-none: #EAF2F1; --lv-none-ink: #8AA0A6;
  --lv-weak: #FCA5A5; --lv-weak-ink: #7F1D1D;
  --lv-shaky: #FED7AA; --lv-shaky-ink: #7C2D12;
  --lv-ok: #BBF7D0; --lv-ok-ink: #14532D;
  --lv-top: #22C55E; --lv-top-ink: #FFFFFF;
  --shadow-card: 0 1px 2px rgba(18, 38, 42, .05), 0 18px 40px -22px rgba(15, 80, 90, .38);
  --shadow-soft: 0 1px 2px rgba(18, 38, 42, .05), 0 8px 22px -14px rgba(15, 80, 90, .34);
  --shadow-pop: 0 30px 70px -24px rgba(18, 38, 42, .45);
  --overlay: rgba(10, 30, 34, .42);
  --glass: rgba(255, 255, 255, .74);
  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Lexend", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-emoji: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --r-lg: 26px; --r-md: 18px; --r-sm: 13px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B1719; --bg-glow-1: #0F3B37; --bg-glow-2: #3A1D16; --bg-glow-3: #12274A;
    --paper: #142427; --paper-2: #182B2F; --sunken: #1D3236; --sunken-2: #263F44;
    --ink: #E8F4F2; --ink-2: #B4CBCB; --ink-3: #85A0A3; --line: #24393D; --line-2: #33504F;
    --brand: #2DD4BF; --brand-2: #38BDF8; --brand-ink: #7FE9DA; --brand-wash: #133A37; --on-brand: #06201D;
    --coral: #FF8A6B; --coral-ink: #FFB29E; --coral-wash: #3D1F17; --sun: #FFCE5C; --sun-wash: #3A3012;
    --green: #34D399; --green-ink: #8CF0C6; --green-wash: #10382C;
    --red: #FF6B75; --red-ink: #FFA0A6; --red-wash: #45191F; --orange-wash: #43290F;
    --lv-none: #1D3236; --lv-none-ink: #6E8A8E; --lv-weak: #7F2A2A; --lv-weak-ink: #FFD1D1; --lv-shaky: #6B3D12; --lv-shaky-ink: #FFE2C2;
    --lv-ok: #1F5B3A; --lv-ok-ink: #CFF7DD; --lv-top: #22C55E; --lv-top-ink: #04210F;
    --shadow-card: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -20px rgba(0, 0, 0, .75);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 22px -12px rgba(0, 0, 0, .7);
    --overlay: rgba(2, 10, 12, .62); --glass: rgba(20, 36, 39, .74);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0B1719; --bg-glow-1: #0F3B37; --bg-glow-2: #3A1D16; --bg-glow-3: #12274A;
  --paper: #142427; --paper-2: #182B2F; --sunken: #1D3236; --sunken-2: #263F44;
  --ink: #E8F4F2; --ink-2: #B4CBCB; --ink-3: #85A0A3; --line: #24393D; --line-2: #33504F;
  --brand: #2DD4BF; --brand-2: #38BDF8; --brand-ink: #7FE9DA; --brand-wash: #133A37; --on-brand: #06201D;
  --coral: #FF8A6B; --coral-ink: #FFB29E; --coral-wash: #3D1F17; --sun: #FFCE5C; --sun-wash: #3A3012;
  --green: #34D399; --green-ink: #8CF0C6; --green-wash: #10382C;
  --red: #FF6B75; --red-ink: #FFA0A6; --red-wash: #45191F; --orange-wash: #43290F;
  --lv-none: #1D3236; --lv-none-ink: #6E8A8E; --lv-weak: #7F2A2A; --lv-weak-ink: #FFD1D1; --lv-shaky: #6B3D12; --lv-shaky-ink: #FFE2C2;
  --lv-ok: #1F5B3A; --lv-ok-ink: #CFF7DD; --lv-top: #22C55E; --lv-top-ink: #04210F;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .3), 0 18px 40px -20px rgba(0, 0, 0, .75);
  --shadow-soft: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 22px -12px rgba(0, 0, 0, .7);
  --overlay: rgba(2, 10, 12, .62); --glass: rgba(20, 36, 39, .74);
  color-scheme: dark;
}

/* Farben der Übungen und Spiele */
.c-teal { --c: #0F766E; --cw: #E1F5F1; }
.c-coral { --c: #E8553A; --cw: #FFE9E2; }
.c-blue { --c: #2563EB; --cw: #E3ECFF; }
.c-purple { --c: #9333EA; --cw: #F3E8FF; }
.c-sun { --c: #C77700; --cw: #FFF3D4; }
.c-green { --c: #15803D; --cw: #DDF7E5; }
.c-night { --c: #4338CA; --cw: #E4E7FF; }
.c-lime { --c: #4D7C0F; --cw: #ECFCCB; }
.c-pink { --c: #DB2777; --cw: #FDE7F1; }
:root[data-theme="dark"] .c-teal, :root[data-theme="dark"] .c-coral, :root[data-theme="dark"] .c-blue, :root[data-theme="dark"] .c-purple, :root[data-theme="dark"] .c-sun, :root[data-theme="dark"] .c-green, :root[data-theme="dark"] .c-night, :root[data-theme="dark"] .c-lime, :root[data-theme="dark"] .c-pink { --cw: color-mix(in srgb, var(--c) 22%, var(--paper)); --c: color-mix(in srgb, var(--c) 55%, #fff); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.c-teal, .c-coral, .c-blue, .c-purple, .c-sun, .c-green, .c-night, .c-lime, .c-pink) { --cw: color-mix(in srgb, var(--c) 22%, var(--paper)); --c: color-mix(in srgb, var(--c) 55%, #fff); }
}

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 520px at 8% -8%, var(--bg-glow-1), transparent 62%),
    radial-gradient(760px 480px at 100% 4%, var(--bg-glow-2), transparent 60%),
    radial-gradient(820px 560px at 40% 110%, var(--bg-glow-3), transparent 60%);
  background-attachment: fixed;
  color: var(--ink); font-family: var(--font-body); font-size: 16.5px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--glass); }
body.has-modal { overflow: hidden; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: -.02em; }
h3 { font-size: 1.15rem; }
p { margin: 0; }
a { color: var(--brand-ink); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 12px; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .85em; background: var(--sunken); padding: .1em .45em; border-radius: 7px; }
mark { background: linear-gradient(100deg, var(--brand), var(--brand-2) 55%, var(--coral)); -webkit-background-clip: text; background-clip: text; color: transparent; padding: 0 .02em; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.muted { color: var(--ink-3); }
.small { font-size: .86rem; }
.center { text-align: center; }
.hint { color: var(--ink-2); font-size: .9rem; }
.warn-text { color: var(--red); }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.row.center { justify-content: center; }
.label { font-weight: 600; font-size: .78rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.eyebrow { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
hr { border: 0; border-top: 1px solid var(--line); margin: .4rem 0; }
.empty { color: var(--ink-3); }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
}
.topbar-inner { max-width: 1160px; margin: 0 auto; display: flex; align-items: center; gap: .75rem; min-height: 64px; }
.back-btn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); box-shadow: var(--shadow-soft); }
.back-btn:hover { background: var(--brand-wash); color: var(--brand-ink); }
@media (max-width: 560px) { .topbar.has-back .brand-name, .topbar.has-back .crumbs { display: none; } }
.brand { display: flex; align-items: center; gap: .55rem; background: none; border: 0; padding: .3rem .2rem; color: var(--ink); border-radius: 14px; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 1.38rem; letter-spacing: -.03em; }
/* Schriftzug «Teilmal»: «Teil» im selben Koralle wie der Doppelpunkt im Logo, «mal» in Petrol */
.brand-name .teil { color: #FF6B4A; }
.brand-name .mal { background: linear-gradient(100deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-mark { display: block; width: 42px; height: 42px; flex: none; }
.brand-mark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.brand:hover .brand-mark svg { animation: bm-hop .5s ease; transform-origin: 30% 90%; }
.brand:hover .bm-colon { animation: bm-colon .5s ease; transform-box: fill-box; transform-origin: center; }
@keyframes bm-hop { 40% { transform: rotate(-6deg) scale(1.06); } }
@keyframes bm-colon { 40% { transform: scale(1.25); } }
/* Startseite: Logo, Schriftzug und Unterzeile */
.home-brand { display: flex; align-items: center; gap: .8rem; }
.home-brand-mark { display: block; width: 62px; height: 62px; flex: none; }
.home-brand-mark svg { display: block; width: 100%; height: 100%; overflow: visible; }
.home-brand-text { display: grid; gap: .3rem; }
.home-brand .brand-name { font-size: 2.3rem; line-height: .95; }
.brand-claim { font-weight: 600; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.crumbs { display: flex; align-items: center; gap: .3rem; min-width: 0; flex: 1; overflow: hidden; }
.crumb { display: inline-flex; align-items: center; gap: .45rem; background: none; border: 0; padding: .35rem .6rem; border-radius: 10px; color: var(--ink-2); font-weight: 500; min-width: 0; }
.crumb span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
button.crumb:hover { background: var(--sunken); color: var(--ink); }
.crumb.current { color: var(--ink); white-space: nowrap; font-weight: 600; }
.crumb-sep { color: var(--line-2); }
.topbar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 14px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); }
.icon-btn:hover { color: var(--ink); background: var(--paper-2); }
.icon-btn.subtle { background: transparent; border-color: transparent; color: var(--ink-3); }
.icon-btn.subtle:hover { background: var(--red-wash); color: var(--red); }
.account-btn { position: relative; display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; max-width: 40vw; padding: .35rem .9rem .35rem .7rem; border-radius: 99px; border: 1px solid var(--line); background: var(--paper); font-weight: 600; color: var(--ink-2); }
.account-btn:hover { color: var(--ink); border-color: var(--line-2); }
.account-btn:not(.in) { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--on-brand); border-color: transparent; box-shadow: 0 8px 18px -10px var(--brand); }
.account-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.account-btn.kid .kid-av { width: 22px; height: 22px; }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--green); box-shadow: 0 0 0 3px var(--green-wash); }
.sync-dot.syncing { background: var(--sun); box-shadow: 0 0 0 3px var(--sun-wash); animation: blink 1s ease-in-out infinite; }
.sync-dot.error { background: var(--red); box-shadow: 0 0 0 3px var(--red-wash); }
@keyframes blink { 50% { opacity: .35; } }
.view { max-width: 1160px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); padding-block: 28px 72px; outline: none; }

/* ---------- Knöpfe ---------- */
.btn {
  --bg: var(--paper); --fg: var(--ink); --bd: var(--line-2); --sh: 0 1px 2px rgba(18, 38, 42, .06);
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 46px; padding: .55rem 1.15rem; border-radius: 14px; border: 1px solid var(--bd); background: var(--bg); color: var(--fg);
  font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none; box-shadow: var(--sh);
  transition: transform .1s ease, box-shadow .15s ease, filter .15s ease; touch-action: manipulation;
}
.btn:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { --bg: linear-gradient(135deg, var(--brand), var(--brand-2)); --fg: var(--on-brand); --bd: transparent; --sh: 0 10px 22px -12px var(--brand); }
.btn.secondary { --bg: var(--brand-wash); --fg: var(--brand-ink); --bd: transparent; --sh: none; }
.btn.ghost { --bg: var(--paper); --fg: var(--ink-2); --bd: var(--line); }
.btn.danger { --bg: var(--red); --fg: #fff; --bd: transparent; }
.btn.big { min-height: 56px; padding: .7rem 1.6rem; font-size: 1.06rem; border-radius: 18px; }
.btn.small { min-height: 38px; padding: .35rem .85rem; font-size: .88rem; border-radius: 12px; }
.link-btn { background: none; border: 0; padding: .3rem .5rem; color: var(--brand-ink); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; border-radius: 8px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 4px; background: var(--sunken); border-radius: 16px; }
.seg-btn { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: .4rem .95rem; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); font-weight: 500; }
.seg-btn:hover { color: var(--ink); }
.seg-btn[aria-pressed="true"] { background: var(--paper); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-soft); }
.seg.small .seg-btn { min-height: 34px; padding: .28rem .75rem; font-size: .9rem; }
.chip { min-height: 34px; padding: .3rem .8rem; border-radius: 99px; border: 1px solid var(--line); background: var(--paper); color: var(--ink-2); font-size: .86rem; font-weight: 500; }
.chip:hover { border-color: var(--brand); color: var(--brand-ink); }
input[type="text"], input[type="password"], input[type="email"], textarea, select {
  width: 100%; border: 1.5px solid var(--line-2); border-radius: 14px; background: var(--paper); padding: .6rem .85rem; min-height: 46px; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.field { display: grid; gap: .4rem; }
.switch { display: flex; align-items: center; gap: .7rem; font-weight: 500; cursor: pointer; }
.switch input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
.switch.small { font-size: .9rem; }
.spinner { display: inline-block; width: 1em; height: 1em; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--brand); animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.panel { background: var(--paper); border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); border-radius: var(--r-lg); padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow-card); min-width: 0; display: grid; gap: .9rem; align-content: start; }
.panel h2 { font-size: 1.45rem; display: flex; align-items: center; gap: .45rem; }
.pill { display: inline-block; font-size: .8rem; padding: .1rem .55rem; border-radius: 99px; background: var(--sunken); font-weight: 600; }
.pill.good { background: var(--green-wash); color: var(--green-ink); }
.pill.mid { background: var(--sun-wash); }
.pill.low { background: var(--red-wash); color: var(--red-ink); }
.banner { display: flex; align-items: flex-start; gap: .8rem; padding: .9rem 1.15rem; border-radius: 18px; }
.banner.bad { background: var(--red-wash); color: var(--red-ink); }
.stars { display: inline-flex; gap: 2px; vertical-align: middle; }
.star { width: 1.05em; height: 1.05em; fill: var(--sunken-2); stroke: none; }
.star.on { fill: var(--sun); }
.result .stars .star { width: 52px; height: 52px; filter: drop-shadow(0 6px 10px rgba(255, 194, 51, .35)); }

/* ---------- Startseite ---------- */
.home { display: grid; gap: 20px; }
.hero { display: grid; gap: 1.5rem; align-items: center; margin-bottom: .2rem; }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.hero-text { display: grid; gap: .8rem; }
.hero h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1.12; }
.lead { font-size: 1.1rem; color: var(--ink-2); max-width: 40rem; }
.hero-art { position: relative; height: 210px; display: none; }
@media (min-width: 900px) { .hero-art { display: block; } }
.flip-tile { position: absolute; width: 132px; height: 104px; perspective: 600px; }
.flip-tile.t0 { left: 4%; top: 18px; transform: rotate(-7deg); }
.flip-tile.t1 { left: 38%; top: 78px; transform: rotate(4deg); }
.flip-tile.t2 { left: 64%; top: 6px; transform: rotate(-3deg); }
.flip-in { position: relative; display: block; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.3, 1.4, .5, 1); transform-style: preserve-3d; }
.flip-tile.show .flip-in { transform: rotateY(180deg); }
.ft-front, .ft-back { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 22px; backface-visibility: hidden; font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; box-shadow: var(--shadow-card); }
.ft-front { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.ft-back { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; transform: rotateY(180deg); font-size: 2.8rem; }
.t1 .ft-back { background: linear-gradient(135deg, #FF6B4A, #F59E0B); }
.t2 .ft-back { background: linear-gradient(135deg, #2563EB, #0E7490); }
.hero-dots { position: absolute; right: 2%; bottom: 8px; display: grid; grid-template-columns: repeat(4, 12px); gap: 7px; }
.hero-dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--sun); opacity: .85; }
.hero-dots i:nth-child(3n) { background: var(--coral); }
.hero-dots i:nth-child(4n+1) { background: var(--brand); opacity: .55; }

.reihen-panel { gap: .8rem; }
.rp-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.rp-head h2 { font-size: 1.3rem; }
.quick-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.reihen { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 640px) { .reihen { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.reihe {
  --rc: var(--brand);
  display: flex; align-items: baseline; justify-content: center; gap: 1px; min-height: 58px; border-radius: 16px;
  border: 2px solid color-mix(in srgb, var(--rc) 35%, var(--line)); background: var(--paper); color: var(--ink-3);
  font-family: var(--font-display); transition: transform .12s, background-color .12s; padding: .4rem 0;
}
.reihe b { font-size: 1.6rem; font-weight: 800; line-height: 1.3; }
.reihe small { font-size: .78rem; font-weight: 600; }
.reihe[aria-pressed="true"] { background: var(--rc); border-color: var(--rc); color: #fff; box-shadow: 0 8px 16px -10px var(--rc); }
.reihe:hover:not(:disabled) { transform: translateY(-2px); }
.reihe:disabled { opacity: .35; cursor: not-allowed; }
.reihe[aria-pressed="true"]:disabled { opacity: 1; cursor: default; }
.op-chip[aria-pressed="true"]:disabled { opacity: 1; cursor: default; }
.reihe.r1 { --rc: #64748B; } .reihe.r2 { --rc: #0F766E; } .reihe.r3 { --rc: #0E7490; } .reihe.r4 { --rc: #2563EB; } .reihe.r5 { --rc: #7C3AED; }
.reihe.r6 { --rc: #C026D3; } .reihe.r7 { --rc: #E11D48; } .reihe.r8 { --rc: #EA580C; } .reihe.r9 { --rc: #CA8A04; } .reihe.r10 { --rc: #15803D; }
.size-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.size-btn { display: grid; gap: .1rem; text-align: left; padding: .75rem 1rem; border-radius: 18px; border: 2px solid var(--line); background: var(--paper-2); color: var(--ink-2); transition: border-color .15s, background-color .15s, transform .1s; }
.size-btn b { font-family: var(--font-display); font-size: 1.15rem; color: var(--ink); }
.size-btn small { font-size: .82rem; }
.size-btn:hover { transform: translateY(-1px); border-color: var(--line-2); }
.size-btn[aria-checked="true"] { border-color: var(--brand); background: var(--brand-wash); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.size-btn.big[aria-checked="true"] { border-color: var(--coral); background: var(--coral-wash); box-shadow: 0 0 0 3px color-mix(in srgb, var(--coral) 18%, transparent); }
.reihen.big .reihe { min-height: 50px; }
.reihen.big .reihe b { font-size: 1.35rem; }
.reihe.gross { border-style: dashed; }
.reihe.gross[aria-pressed="true"] { border-style: solid; background: linear-gradient(135deg, var(--rc), color-mix(in srgb, var(--rc) 70%, #000)); }
.op-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.op-btn { display: flex; align-items: center; gap: .6rem; min-height: 54px; padding: .4rem .8rem; border-radius: 16px; border: 2px solid var(--line); background: var(--paper); color: var(--ink-2); font-weight: 600; transition: border-color .15s, background-color .15s; }
.op-sym { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 11px; background: var(--sunken); color: var(--ink); font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; line-height: 1; }
.op-sym .icon { width: 22px; height: 22px; stroke-width: 2.6; }
.op-btn[aria-checked="true"] { border-color: var(--brand); background: var(--brand-wash); color: var(--brand-ink); }
.op-btn[aria-checked="true"] .op-sym { background: var(--brand); color: #fff; }
.op-btn:disabled { opacity: .55; cursor: default; }
.ops-row { display: flex; flex-wrap: wrap; gap: .5rem .7rem; align-items: center; }
.op-chip { display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: .3rem .9rem; border-radius: 99px; border: 1.5px solid var(--line-2); background: var(--paper); color: var(--ink-2); font-weight: 600; }
.op-chip code { background: var(--sunken); font-family: var(--font-display); font-weight: 800; font-size: .92rem; padding: .05rem .45rem; border-radius: 8px; color: var(--ink); }
.op-chip[aria-pressed="true"] code { background: var(--paper); }
.op-chip[aria-pressed="true"] { background: var(--brand-wash); border-color: var(--brand); color: var(--brand-ink); }
.op-chip:disabled { opacity: .5; cursor: not-allowed; }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; margin-top: .6rem; }
.section-head h2 { font-size: 1.7rem; }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 196px), 1fr)); }
.tiles.games { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.tile {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .3rem .9rem; align-items: center; align-content: start; text-align: left;
  padding: 16px; border-radius: 24px; border: 1px solid color-mix(in srgb, var(--line) 60%, transparent); background: var(--paper);
  box-shadow: var(--shadow-soft); color: var(--ink); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease;
}
.tiles:not(.games) .tile { grid-template-columns: minmax(0, 1fr); gap: .7rem; padding: 18px 16px 16px; }
@media (max-width: 560px) { .tiles:not(.games) .tile { grid-template-columns: auto minmax(0, 1fr); gap: .3rem .9rem; } }
.tile::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--c); }
.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.tiles.games .tile-art { width: 72px; height: 72px; }
.tiles.games .tile-art .emo { font-size: 2.5rem; }
.tile-art { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 20px; background: var(--cw); color: var(--c); }
.tile-art svg { width: 40px; height: 40px; }
.tile-art .emo { font-family: var(--font-emoji); font-size: 2.1rem; line-height: 1; }
.tile-text { display: grid; gap: .15rem; }
.tile-text strong { font-family: var(--font-display); font-size: 1.22rem; font-weight: 800; }
.tile-text small { color: var(--ink-2); font-size: .88rem; line-height: 1.35; }
.tile-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.tile-cost { display: inline-flex; align-items: center; gap: .25rem; font-family: var(--font-display); font-weight: 800; font-size: .95rem; color: #9A6400; background: #FFF4D2; padding: .1rem .55rem .1rem .25rem; border-radius: 99px; }
.tile-cost .coin-svg { width: 20px; height: 20px; }
.tile.locked .tile-art { filter: grayscale(.8); opacity: .6; }
.tile.locked::after { content: "🔒"; position: absolute; top: 12px; right: 14px; font-family: var(--font-emoji); font-size: 1.1rem; opacity: .8; }
.tile-best { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: .3rem; justify-self: start; font-size: .78rem; font-weight: 600; color: var(--c); background: var(--cw); padding: .1rem .55rem; border-radius: 99px; }
.tile-best .icon { width: 1em; height: 1em; }
.home-grid { display: grid; gap: 20px; align-items: start; margin-top: .6rem; }
@media (min-width: 940px) { .home-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.stats-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.stat-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat-tiles.small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 520px) { .stat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat-tile { display: grid; gap: .1rem; padding: .7rem .8rem; border-radius: 16px; background: var(--paper-2); border: 1px solid var(--line); }
.stat-tile b { font-family: var(--font-display); font-size: 1.55rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-tile .of { font-size: .9rem; color: var(--ink-3); font-weight: 600; }
.stat-tile small { color: var(--ink-2); font-size: .78rem; }
.focus-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.focus-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .2rem .8rem; padding: .5rem .8rem; border-radius: 14px; background: var(--coral-wash); }
.fl-task { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; }
.fl-task b { color: var(--coral-ink); }
.fl-info { font-size: .82rem; color: var(--ink-2); }

/* ---------- Einmaleins-Tafel ---------- */
.tafel-wrap { overflow-x: auto; padding-bottom: 4px; }
.tafel { border-collapse: separate; border-spacing: 3px; margin: 0 auto; }
.tafel th { font-size: .78rem; color: var(--ink-3); font-weight: 600; text-align: center; padding: 0 2px; }
.tafel tbody th { text-align: right; padding-right: 6px; }
.tafel-wrap.big .tf { width: clamp(26px, 6vw, 40px); }
.tafel-wrap.big.compact .tf { width: clamp(16px, 4.2vw, 24px); }
.tafel .corner { color: var(--ink-3); }
.tafel td { padding: 0; }
.tf { position: relative; display: grid; place-items: center; width: clamp(28px, 6.6vw, 46px); aspect-ratio: 1; padding: 0; border: 0; border-radius: 9px; font-family: var(--font-body); font-size: clamp(.68rem, 1.9vw, .88rem); font-weight: 600; font-variant-numeric: tabular-nums; }
button.tf { transition: transform .1s; }
button.tf:hover { transform: scale(1.12); z-index: 1; box-shadow: var(--shadow-soft); }
.compact .tf { width: clamp(18px, 4.6vw, 28px); border-radius: 6px; }
.lv-none { background: var(--lv-none); color: var(--lv-none-ink); }
.lv-weak { background: var(--lv-weak); color: var(--lv-weak-ink); }
.lv-shaky { background: var(--lv-shaky); color: var(--lv-shaky-ink); }
.lv-ok { background: var(--lv-ok); color: var(--lv-ok-ink); }
.lv-top { background: var(--lv-top); color: var(--lv-top-ink); }
.tf em { position: absolute; top: -5px; right: -5px; display: grid; place-items: center; min-width: 16px; height: 16px; padding: 0 3px; border-radius: 99px; background: var(--red-ink); color: #fff; font-style: normal; font-size: .62rem; font-weight: 700; box-shadow: 0 0 0 2px var(--paper); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem .9rem; font-size: .78rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.fact-level { display: inline-flex; align-items: center; gap: .4rem; justify-self: start; padding: .25rem .8rem; border-radius: 99px; font-weight: 600; font-size: .9rem; }
.hist { display: flex; gap: 4px; }
.hist i { width: 16px; height: 16px; border-radius: 5px; }
.hist i.ok { background: var(--green); }
.hist i.bad { background: var(--red); }
.reihen-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.reihen-bars li { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr) auto; gap: .6rem; align-items: center; }
.rb-name { font-family: var(--font-display); font-weight: 800; }
.rb-bar { display: flex; height: 12px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.rb-bar i { display: block; height: 100%; }
.rb-bar i.ok { background: var(--lv-top); }
.rb-bar i.weak { background: var(--lv-weak); }
.rb-num { font-size: .84rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.stand-view { display: grid; gap: 18px; }
.side-col { display: grid; gap: 20px; }
.day-bars { display: flex; align-items: flex-end; gap: 5px; height: 110px; }
.day-bars .db { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.day-bars i { display: block; width: 100%; border-radius: 6px 6px 3px 3px; background: linear-gradient(var(--brand-2), var(--brand)); }
.day-bars small { font-size: .62rem; color: var(--ink-3); }

/* ---------- Übungen ---------- */
.mode { display: grid; gap: 14px; }
.mode-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.2rem; }
.mode-title { font-size: clamp(1.8rem, 4.4vw, 2.5rem); }
.mode-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; }
.progress { height: 10px; border-radius: 99px; background: var(--sunken-2); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--c, var(--brand)), var(--brand-2)); transition: width .35s ease; min-width: 10px; }
.progress-label { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; color: var(--ink-2); font-weight: 500; font-size: .94rem; margin-top: -4px; }
.tally { display: inline-flex; gap: .8rem; }
.tally b { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; }
.tally .ok { color: var(--green); }
.tally .bad { color: var(--red); }
.mode-hint { text-align: center; color: var(--ink-3); font-size: .9rem; }
@media (hover: none) { .mode-hint.keys { display: none; } }
.timer { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; font-variant-numeric: tabular-nums; background: var(--paper); border: 1px solid var(--line); padding: .35rem .8rem; border-radius: 99px; }
.timer b { font-family: var(--font-display); font-size: 1.2rem; }
.stage { display: grid; gap: 16px; align-content: start; }
@media (min-width: 860px) {
  .ex-trainer .stage, .ex-inverse .stage, .ex-blitz .stage { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); grid-template-areas: "card pad" "card under"; align-items: start; }
  :is(.ex-trainer, .ex-inverse, .ex-blitz) .stage > .task-card { grid-area: card; }
  :is(.ex-trainer, .ex-inverse, .ex-blitz) .stage > .numpad { grid-area: pad; }
  :is(.ex-trainer, .ex-inverse, .ex-blitz) .stage > .under-pad { grid-area: under; }
}
.task-card {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 1rem; min-height: 230px;
  background: var(--paper); border-radius: 28px; box-shadow: var(--shadow-card); padding: clamp(20px, 4vw, 36px) clamp(14px, 3vw, 28px);
  border: 3px solid transparent; transition: border-color .15s, background-color .2s;
}
.task { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .3em; font-family: var(--font-display); font-weight: 800; font-size: clamp(2.6rem, 10vw, 4.6rem); line-height: 1; font-variant-numeric: tabular-nums; }
.task .op { color: var(--ink-3); font-weight: 600; }
.task.small { font-size: inherit; gap: .25em; display: inline-flex; }
.slot { display: inline-grid; place-items: center; min-width: 1.5em; height: 1.18em; padding: 0 .18em; border-radius: .22em; background: var(--sunken); border: 3px dashed var(--line-2); color: var(--c, var(--brand)); transition: all .15s; }
.slot.filled { border-style: solid; border-color: var(--c, var(--brand)); background: var(--cw, var(--brand-wash)); }
.slot-val:empty::before { content: "\00a0"; }
.task-card.good { border-color: var(--green); background: color-mix(in srgb, var(--green-wash) 60%, var(--paper)); }
.task-card.good .slot { border-style: solid; border-color: var(--green); background: var(--green-wash); color: var(--green-ink); }
.task-card.bad { border-color: var(--red); animation: shake .4s; }
.task-card.bad .slot { border-style: solid; border-color: var(--red); background: var(--red-wash); color: var(--red); }
.task-card.fixing .slot { border-color: var(--sun); background: var(--sun-wash); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.feedback { min-height: 1.6em; text-align: center; display: grid; justify-items: center; }
.fb-good { display: inline-flex; align-items: center; gap: .4rem; color: var(--green-ink); font-weight: 700; font-size: 1.2rem; animation: pop .25s ease; }
.fb-bad { color: var(--red); font-weight: 700; font-size: 1.3rem; font-family: var(--font-display); }
.fb-wrong { display: grid; gap: .7rem; justify-items: center; animation: pop .25s ease; }
.fb-sol { font-size: 1.15rem; }
.fb-sol strong { font-family: var(--font-display); font-size: 1.4rem; color: var(--ink); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.help-box { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .6rem 1rem; padding: .8rem 1rem; border-radius: 18px; background: var(--sun-wash); max-width: 34rem; text-align: left; }
.help-box p { flex: 1 1 14rem; color: var(--ink); font-weight: 500; }
.dot-field { max-width: min(100%, 210px); height: auto; flex: none; }
.dot-field .d { fill: var(--brand); }
.dot-field .d.m { fill: var(--coral); }

.numpad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; max-width: 380px; margin: 0 auto; user-select: none; -webkit-user-select: none; }
.pad-key {
  min-height: 64px; border-radius: 18px; border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; box-shadow: 0 4px 0 var(--line-2);
  touch-action: manipulation; display: grid; place-items: center; transition: transform .06s, box-shadow .06s, background-color .1s;
}
.pad-key:active, .pad-key.pressed { transform: translateY(3px); box-shadow: 0 1px 0 var(--line-2); background: var(--cw, var(--brand-wash)); }
.pad-key.ok { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--on-brand); border-color: transparent; box-shadow: 0 4px 0 color-mix(in srgb, var(--brand) 60%, #000); font-size: 1.4rem; }
.pad-key.del { color: var(--ink-2); }
.pad-key.del .icon { width: 1.6rem; height: 1.6rem; }
.under-pad { margin-top: -4px; }

.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 600px; margin: 0 auto; }
.choice {
  position: relative; min-height: 86px; border-radius: 22px; border: 2px solid var(--line); background: var(--paper); color: var(--ink);
  font-family: var(--font-display); font-weight: 800; font-size: clamp(1.9rem, 6vw, 2.5rem); box-shadow: 0 4px 0 var(--line-2);
  touch-action: manipulation; transition: transform .08s, background-color .12s;
}
.choice:hover:not(:disabled) { border-color: var(--c, var(--brand)); }
.choice:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--line-2); }
.choice small { position: absolute; top: 7px; left: 11px; font-family: var(--font-body); font-size: .72rem; color: var(--ink-3); font-weight: 500; }
.choice.right { background: var(--green); border-color: var(--green); color: #fff; }
.choice.right small { color: #fff; }
.choice.wrong { background: var(--red); border-color: var(--red); color: #fff; animation: shake .35s; }
.choice:disabled { cursor: default; }
@media (hover: none) { .choice small { display: none; } }

.result { display: grid; justify-items: center; gap: .9rem; text-align: center; background: var(--paper); border-radius: 28px; padding: clamp(24px, 5vw, 46px) clamp(16px, 4vw, 34px); box-shadow: var(--shadow-card); grid-column: 1 / -1; }
.result h2 { font-size: clamp(1.7rem, 4.2vw, 2.3rem); }
.result-line { color: var(--ink-2); font-size: 1.1rem; }
.result-big { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-display); font-weight: 800; font-size: 1.7rem; }
.mistakes { width: 100%; max-width: 30rem; display: grid; gap: .5rem; }
.mistakes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mistakes li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .45rem .85rem; border-radius: 12px; background: var(--coral-wash); }
.m-task { font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; }
.m-given { font-size: .85rem; color: var(--ink-2); text-decoration: line-through; }

/* Reihen-Treppe */
.reihen-start { max-width: 640px; }
.stage-pill { padding: .3rem .9rem; border-radius: 99px; background: var(--cw); color: var(--c); font-weight: 700; }
.reihe-layout { display: grid; gap: 18px; }
@media (min-width: 860px) { .reihe-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.reihe-input .stage { gap: 12px; }
.reihe-input .task-card { min-height: 170px; }
.stairs { --step: 32px; position: relative; height: calc(var(--step) * 10 + 120px); border-radius: 24px; box-shadow: var(--shadow-card); overflow: hidden;
  background: linear-gradient(#BDE7FF, #E8F7FF 55%, #F4FBEF); }
:root[data-theme="dark"] .stairs { background: linear-gradient(#16325A, #1E3A5C 55%, #1B3324); }
.st-sun { position: absolute; left: 18px; top: 14px; width: 44px; height: 44px; border-radius: 50%; background: radial-gradient(circle, #FFE68A, #FFC233 60%, rgba(255, 194, 51, 0) 72%); animation: sun 6s ease-in-out infinite; }
@keyframes sun { 50% { transform: scale(1.08); } }
.st-hill { position: absolute; bottom: -40px; border-radius: 50%; background: #A6DB8E; }
.st-hill.h1 { left: -10%; width: 70%; height: 120px; }
.st-hill.h2 { right: -15%; width: 80%; height: 90px; background: #8FCF77; }
.stair {
  position: absolute; bottom: 12px; left: calc(12px + (var(--a) - 1) * ((100% - 24px) / 10)); width: calc((100% - 24px) / 10 - 3px);
  height: calc(var(--a) * var(--step)); border-radius: 8px 8px 3px 3px; color: rgba(255, 255, 255, .85);
  background: repeating-linear-gradient(180deg, transparent 0 13px, rgba(0, 0, 0, .06) 13px 14px), linear-gradient(90deg, #C88A52, #B5743E 60%, #A5652F);
  box-shadow: inset 0 7px 0 #6CC05A, inset 0 9px 0 #4E9E3E, 0 4px 10px -6px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding-top: 12px; font-size: .64rem; font-weight: 600; transition: filter .25s, transform .25s; z-index: 1;
}
.stair.cur { box-shadow: inset 0 7px 0 #FFD54A, inset 0 9px 0 #E0A800, 0 0 0 3px var(--c), 0 4px 10px -6px rgba(0, 0, 0, .5); }
.stair.done { filter: saturate(1.25) brightness(1.06); }
.stair.done .st-v { animation: pop .3s ease; }
.stair.was-bad { background: linear-gradient(90deg, #D9675E, #B9473F); }
.st-v { font-family: var(--font-display); font-weight: 800; font-size: clamp(.8rem, 2.2vw, 1.15rem); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.climber { position: absolute; left: 0; bottom: 12px; z-index: 3; width: clamp(46px, 9vw, 64px); aspect-ratio: 120 / 100; pointer-events: none; transition: none; }
.climber svg { display: block; width: 100%; height: 100%; overflow: visible; transform-origin: 60% 90%; }
.climber.flip svg { transform: scaleX(-1); }
.sq-tail { transform-origin: 48px 70px; animation: sq-tail 2.6s ease-in-out infinite; }
@keyframes sq-tail { 50% { transform: rotate(-7deg); } }
.sq-head { transform-origin: 85px 55px; animation: sq-head 3.2s ease-in-out infinite; }
@keyframes sq-head { 0%, 70%, 100% { transform: none; } 78% { transform: rotate(-8deg); } 88% { transform: rotate(4deg); } }
.climber.jumping svg { animation: sq-body .62s ease-in-out; }
@keyframes sq-body { 0% { transform: none; } 12% { transform: scale(1.08, .86); } 35% { transform: rotate(-16deg) scale(.96, 1.06); } 75% { transform: rotate(12deg); } 100% { transform: none; } }
.climber.flip.jumping svg { animation: sq-body-flip .62s ease-in-out; }
@keyframes sq-body-flip { 0% { transform: scaleX(-1); } 12% { transform: scaleX(-1) scale(1.08, .86); } 35% { transform: scaleX(-1) rotate(-16deg); } 75% { transform: scaleX(-1) rotate(12deg); } 100% { transform: scaleX(-1); } }
.climber.jumping .sq-leg-back { transform-origin: 58px 74px; animation: sq-back .62s ease-in-out; }
@keyframes sq-back { 0% { transform: none; } 15% { transform: rotate(-12deg); } 35% { transform: rotate(48deg) translateX(-4px); } 70% { transform: rotate(-28deg); } 100% { transform: none; } }
.climber.jumping .sq-leg-front { transform-origin: 83px 75px; animation: sq-front .62s ease-in-out; }
@keyframes sq-front { 0% { transform: none; } 25% { transform: rotate(-30deg); } 55% { transform: rotate(-58deg) translateY(-3px); } 85% { transform: rotate(12deg); } 100% { transform: none; } }
.climber.jumping .sq-tail { animation: sq-tail-jump .62s ease-in-out; }
@keyframes sq-tail-jump { 0% { transform: none; } 30% { transform: rotate(22deg); } 70% { transform: rotate(-18deg); } 100% { transform: none; } }
.climber.landing svg { animation: sq-land .26s ease-out; }
@keyframes sq-land { 0% { transform: scale(1.14, .82); } 60% { transform: scale(.96, 1.05); } 100% { transform: none; } }
.climber.flip.landing svg { animation: sq-land-flip .26s ease-out; }
@keyframes sq-land-flip { 0% { transform: scaleX(-1) scale(1.14, .82); } 100% { transform: scaleX(-1); } }
@media (max-width: 859px) { .stairs { --step: 24px; } }
@media (max-width: 560px) { .stair .st-q { display: none; } .stairs { --step: 22px; } }

/* ---------- Spiele ---------- */
.game .mode-hint { margin-top: -2px; }
.scoreboard { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 1rem; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow-soft); }
.shots { display: flex; gap: 6px; flex-wrap: wrap; }
.shots i { width: 16px; height: 16px; border-radius: 50%; background: var(--sunken-2); }
.shots i.hit { background: var(--green); }
.shots i.miss { background: var(--red); }
.score { display: flex; align-items: baseline; gap: .5rem; font-weight: 600; color: var(--ink-2); }
.score b { font-family: var(--font-display); font-size: 1.8rem; color: var(--ink); }

/* Elfmeter */
.pitch { position: relative; height: min(64vh, 540px); min-height: 400px; border-radius: 28px; overflow: hidden; background: repeating-linear-gradient(180deg, #3FA34D 0 46px, #389745 46px 92px); box-shadow: var(--shadow-card); user-select: none; -webkit-user-select: none; }
.pitch::before { content: ""; position: absolute; left: 6%; right: 6%; top: 56%; bottom: -4px; border: 3px solid rgba(255, 255, 255, .75); border-bottom: 0; }
.pitch::after { content: ""; position: absolute; left: 50%; bottom: -60px; width: 220px; height: 120px; transform: translateX(-50%); border: 3px solid rgba(255, 255, 255, .55); border-radius: 50%; }
.task-board { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 6; padding: .35rem 1.2rem; border-radius: 16px; background: #10282C; color: #fff; font-size: clamp(1.6rem, 5vw, 2.3rem); box-shadow: 0 10px 22px -12px #000; white-space: nowrap; }
.task-board .op { color: #9FD8D0; }
.task-board .slot { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .5); color: var(--sun); }
.goal { position: absolute; left: 50%; top: 21%; width: min(88%, 640px); height: 35%; transform: translateX(-50%); border: 9px solid #fff; border-bottom: 0; border-radius: 8px 8px 0 0; box-shadow: 0 6px 0 rgba(0, 0, 0, .12); }
.net { position: absolute; inset: 0; background-color: rgba(10, 40, 30, .2); background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, .38) 0 2px, transparent 2px 15px), repeating-linear-gradient(-45deg, rgba(255, 255, 255, .38) 0 2px, transparent 2px 15px); }
.goal.shake .net { animation: net 0.5s ease; }
@keyframes net { 30% { transform: scale(1.04, 1.06); } 60% { transform: scale(.98); } }
.targets { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); align-items: start; justify-items: center; padding-top: 6%; z-index: 3; }
.goal.four .targets { grid-template-columns: repeat(4, 1fr); }
.goal.four .target:nth-child(odd) { margin-top: 20%; }
.target { width: clamp(62px, 12vw, 92px); aspect-ratio: 1; border-radius: 50%; border: 4px solid #fff; background: rgba(255, 255, 255, .92); color: #10282C; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.25rem, 4vw, 1.9rem); box-shadow: 0 8px 16px -8px rgba(0, 0, 0, .5); touch-action: manipulation; transition: transform .1s; }
.target:hover { transform: scale(1.08); }
.target.right { background: #22C55E; color: #fff; }
.target.wrong { background: #EF4444; color: #fff; }
.spot { position: absolute; left: 50%; bottom: calc(7% - 4px); width: 16px; height: 7px; border-radius: 50%; background: #fff; transform: translateX(-50%); }
.ball { position: absolute; left: 50%; bottom: 7%; width: clamp(44px, 8vw, 58px); transform: translateX(-50%); z-index: 4; filter: drop-shadow(0 6px 4px rgba(0, 0, 0, .3)); pointer-events: none; }
.ball svg { display: block; width: 100%; height: auto; }
.ball.caught { opacity: 0; transition: opacity .2s .1s; }
.shot-clock { position: absolute; left: 12%; right: 12%; bottom: 2.5%; height: 9px; border-radius: 99px; background: rgba(255, 255, 255, .35); overflow: hidden; z-index: 4; }
.shot-clock i { display: block; height: 100%; background: var(--sun); transform-origin: left; }
.pitch-msg { position: absolute; inset: 0; z-index: 7; display: grid; place-content: center; justify-items: center; gap: .3rem; font-family: var(--font-display); font-weight: 800; font-size: clamp(3rem, 12vw, 6rem); color: #fff; text-shadow: 0 6px 22px rgba(0, 0, 0, .35); opacity: 0; pointer-events: none; }
.pitch-msg small { font-size: clamp(1.4rem, 4vw, 2rem); background: rgba(16, 40, 44, .85); padding: .2rem 1rem; border-radius: 14px; text-shadow: none; }
.pitch-msg.show { animation: msg .5s cubic-bezier(.3, 1.5, .5, 1) forwards; }
.pitch-msg.bad { font-size: clamp(2.2rem, 8vw, 4rem); }
@keyframes msg { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }

/* Meteoriten */
.space { position: relative; height: min(70vh, 620px); min-height: 440px; border-radius: 28px; overflow: hidden; background: radial-gradient(ellipse at 50% 125%, #4C2C8C, #151A45 55%, #070A1F); box-shadow: var(--shadow-card); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.stars-bg { position: absolute; inset: -200px 0 0; background-image: radial-gradient(1.6px 1.6px at 20px 40px, #fff, transparent), radial-gradient(1.2px 1.2px at 120px 90px, #fff, transparent), radial-gradient(1.8px 1.8px at 170px 20px, #CFE8FF, transparent), radial-gradient(1px 1px at 60px 150px, #fff, transparent), radial-gradient(1.4px 1.4px at 90px 190px, #FFE9B0, transparent); background-size: 200px 200px; opacity: .8; animation: stars 18s linear infinite; }
@keyframes stars { to { transform: translateY(200px); } }
.hud { position: absolute; top: 10px; left: 14px; right: 14px; z-index: 5; display: flex; justify-content: space-between; align-items: center; color: #fff; font-weight: 600; }
.lives i { font-style: normal; font-family: var(--font-emoji); font-size: 1.5rem; opacity: .25; filter: grayscale(1); transition: all .3s; }
.lives i.on { opacity: 1; filter: none; }
.m-score b { font-family: var(--font-display); font-size: 1.6rem; margin-left: .3rem; }
.meteor { position: absolute; left: 0; top: 0; z-index: 3; width: 78px; height: 78px; padding: 0; border: 0; border-radius: 47% 53% 50% 50% / 52% 46% 54% 48%; background: radial-gradient(circle at 34% 30%, #C79A73, #7A5636 58%, #42301F); box-shadow: inset -6px -8px 0 rgba(0, 0, 0, .22), 0 0 22px rgba(255, 140, 60, .55); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.55rem; will-change: transform; touch-action: manipulation; }
.meteor::before { content: ""; position: absolute; left: 50%; bottom: 86%; width: 30px; height: 90px; transform: translateX(-50%); border-radius: 50%; background: linear-gradient(to top, rgba(255, 166, 60, .75), rgba(255, 90, 40, .25) 60%, transparent); z-index: -1; filter: blur(2px); }
.meteor span { position: relative; text-shadow: 0 2px 6px rgba(0, 0, 0, .6); }
.meteor.hint { box-shadow: 0 0 0 4px var(--sun), 0 0 30px var(--sun); }
.meteor.wrong { background: radial-gradient(circle at 34% 30%, #F87171, #B91C1C); animation: shake .35s; }
.meteor.boom { animation: boom .45s ease-out forwards; pointer-events: none; }
@keyframes boom { 40% { transform-origin: center; filter: brightness(2); } to { opacity: 0; filter: brightness(3) blur(4px); } }
.meteor.gone { opacity: 0; transition: opacity .35s; pointer-events: none; }
.meteor.landed { background: radial-gradient(circle at 34% 30%, #FCA5A5, #DC2626); }
.ship-wrap { position: absolute; left: 50%; bottom: 18px; z-index: 4; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.ship-task { padding: .25rem 1rem; border-radius: 16px; background: rgba(255, 255, 255, .95); color: #10282C; font-size: clamp(1.4rem, 4.4vw, 2.1rem); box-shadow: 0 8px 20px -10px #000; white-space: nowrap; }
.ship { width: 58px; transform: rotate(var(--tilt, 0deg)); transition: transform .2s; }
.ship svg { display: block; width: 100%; height: auto; }
.ship .flame { animation: flame .15s ease-in-out infinite alternate; transform-origin: 32px 56px; }
@keyframes flame { to { transform: scaleY(.7); } }
.ground { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; background: linear-gradient(#6D43C4, #2A1B55); }
.laser { position: absolute; z-index: 3; height: 5px; margin-top: -2px; border-radius: 3px; background: linear-gradient(90deg, #39FF6A, #EAFFEA); box-shadow: 0 0 10px #39FF6A, 0 0 22px #22C55E; transform-origin: 0 50%; animation: laser .26s ease-out forwards; pointer-events: none; }
@keyframes laser { to { opacity: 0; } }
.space.hit { animation: hit .5s; }
@keyframes hit { 30% { box-shadow: inset 0 0 0 6px #EF4444, var(--shadow-card); } }
.meteor-note { position: absolute; top: 38%; left: 50%; transform: translateX(-50%); z-index: 6; padding: .4rem 1.1rem; border-radius: 16px; background: #fff; color: #10282C; font-family: var(--font-display); font-weight: 800; font-size: 1.8rem; animation: pop .25s ease; white-space: nowrap; }

/* Frosch */
.frog-top { padding: .7rem 1rem; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow-soft); }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .8rem; }
.chain-title { font-weight: 700; color: var(--c); }
.chain-nums { display: flex; flex-wrap: wrap; gap: 5px; }
.chain-nums b { min-width: 2.2rem; text-align: center; padding: .1rem .45rem; border-radius: 10px; background: var(--cw); font-family: var(--font-display); font-size: 1.1rem; }
.chain-nums b.q { background: var(--sun); }
.pond { position: relative; height: min(58vh, 480px); min-height: 380px; border-radius: 28px; overflow: hidden; background: radial-gradient(ellipse at 30% 20%, #7DD3EA, #2B93BC 58%, #1D6F94); box-shadow: var(--shadow-card); user-select: none; -webkit-user-select: none; }
.ripples { position: absolute; inset: 0; background-image: radial-gradient(ellipse 60px 14px at 20% 60%, rgba(255, 255, 255, .22), transparent 70%), radial-gradient(ellipse 80px 16px at 80% 75%, rgba(255, 255, 255, .18), transparent 70%), radial-gradient(ellipse 50px 10px at 60% 40%, rgba(255, 255, 255, .2), transparent 70%); }
.pads { position: absolute; left: 0; right: 0; top: 8%; display: flex; justify-content: space-around; align-items: flex-start; padding: 0 3%; }
.lily { position: relative; width: clamp(92px, 22vw, 140px); aspect-ratio: 1; border: 0; border-radius: 50%; padding: 0; background: conic-gradient(from 160deg, transparent 0 22deg, #4CAF3A 22deg); color: #12331A; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.5rem, 5vw, 2.2rem); box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .12); touch-action: manipulation; transition: transform .15s; }
.lily::before { content: ""; position: absolute; inset: 9%; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #8BE36C, #54B83F 70%); z-index: 0; }
.lily span { position: relative; z-index: 1; display: inline-block; padding: 0 .3em; border-radius: 12px; background: rgba(255, 255, 255, .78); }
.lily.p1 { margin-top: 70px; }
.lily.p2 { margin-top: 18px; }
.lily:hover:not(:disabled) { transform: scale(1.06); }
.lily.right::before { background: radial-gradient(circle at 40% 35%, #C6F6B0, #6BD24E 70%); }
.lily.sink { animation: sink .7s ease-in forwards; }
@keyframes sink { 30% { transform: translateY(6px) rotate(-6deg); } to { transform: translateY(18px) scale(.6); opacity: 0; } }
.home-pad { position: absolute; left: 50%; bottom: 6%; width: 140px; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: conic-gradient(from 200deg, transparent 0 22deg, #3F9A2F 22deg); display: grid; place-items: center; }
.home-pad::before { content: ""; position: absolute; inset: 9%; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #7BD65E, #47A535 70%); }
.frog { position: relative; z-index: 2; font-family: var(--font-emoji); font-size: 3.6rem; line-height: 1; margin-top: -14px; }
.pad-num { position: absolute; z-index: 3; bottom: 10px; padding: 0 .55rem; border-radius: 10px; background: rgba(255, 255, 255, .9); font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; color: #12331A; }
.frog-done { display: grid; justify-items: center; gap: .6rem; margin: 0 auto; max-width: 440px; padding: 1.2rem 1.4rem; border-radius: 24px; background: rgba(255, 255, 255, .96); color: #12262A; text-align: center; box-shadow: var(--shadow-pop); animation: pop .3s ease; }
.frog-done h2 { font-size: 1.5rem; }

/* Memory */
.mem-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem; font-weight: 600; color: var(--ink-2); }
.mem-bar b { font-family: var(--font-display); color: var(--ink); font-size: 1.2rem; }
.mem-bar .icon { vertical-align: -3px; }
.mem-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: 100%; max-width: 720px; margin: 0 auto; }
@media (max-width: 520px) { .mem-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } }
.mem-card { aspect-ratio: 5 / 4; padding: 0; border: 0; background: none; perspective: 800px; touch-action: manipulation; }
.mc-in { position: relative; display: block; width: 100%; height: 100%; transition: transform .35s ease; transform-style: preserve-3d; }
.mc-back, .mc-face { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.mc-back { background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #7C3AED)); box-shadow: var(--shadow-soft); }
.mc-back svg { width: 46%; height: auto; opacity: .95; }
.mc-face { display: flex; align-items: center; justify-content: center; transform: rotateY(180deg); background: var(--paper); border: 2px solid var(--line); box-shadow: var(--shadow-soft); font-family: var(--font-display); font-weight: 800; font-size: clamp(1.4rem, 4.6vw, 2.1rem); color: var(--ink); }
.mc-face em { font-style: normal; color: var(--ink-3); margin: 0 .15em; }
.mem-card.res .mc-face { background: var(--sun-wash); }
.mem-card.up .mc-in, .mem-grid.open .mc-in { transform: rotateY(180deg); }
.mem-card.sel .mc-face { border-color: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 30%, transparent); }
.mem-card.done { pointer-events: none; }
.mem-card.done .mc-face { background: var(--green-wash); border-color: var(--green); color: var(--green-ink); opacity: .5; transition: opacity .4s .2s; }
.mem-card.nope .mc-face { border-color: var(--red); background: var(--red-wash); animation: shake .35s; }

/* Stimmt das? */
.tf-top { display: flex; align-items: center; gap: 1rem; }
.tf-time { flex: 1; height: 14px; border-radius: 99px; background: var(--sunken-2); overflow: hidden; }
.tf-time i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--sun)); transform-origin: left; }
.tf-time i.low { background: var(--red); }
.tf-score { font-weight: 600; color: var(--ink-2); }
.tf-score b { font-family: var(--font-display); font-size: 1.6rem; color: var(--ink); }
.tf-card { min-height: 200px; }
.tf-card .num.shown { color: var(--c); }
.tf-sol { font-family: var(--font-display); font-size: clamp(2rem, 7vw, 3.2rem); color: var(--green-ink); }
.tf-bonus { position: absolute; top: 12px; right: 16px; font-weight: 800; color: var(--green); opacity: 0; }
.tf-bonus.show { animation: bonus 1s ease; }
@keyframes bonus { 20% { opacity: 1; transform: translateY(-6px) scale(1.2); } 80% { opacity: 1; } to { opacity: 0; transform: translateY(-16px); } }
.tf-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tf-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; min-height: 116px; border-radius: 26px; border: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; box-shadow: 0 5px 0 rgba(0, 0, 0, .12); touch-action: manipulation; transition: transform .08s; }
.tf-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, .12); }
.tf-btn .icon { width: 2.6rem; height: 2.6rem; stroke-width: 3; }
.tf-btn.no { background: var(--red-wash); color: var(--red-ink); }
.tf-btn.yes { background: var(--green-wash); color: var(--green-ink); }

/* Duell */
.duel { display: grid; grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr); gap: 8px; height: calc(100dvh - 190px); min-height: 440px; max-height: 820px; }
@media (max-width: 560px) { .game-duel .mode-hint { display: none; } .game-duel .mode-title { font-size: 1.5rem; } .dh-opts .choice { min-height: 54px; font-size: 1.7rem; } .duel-half { padding: 10px; gap: 6px; } }
.duel-half { display: grid; grid-template-rows: auto 1fr auto; gap: 10px; padding: 14px; border-radius: 26px; transition: box-shadow .2s, opacity .2s, filter .2s; }
.duel-half.p0 { background: var(--coral-wash); transform: rotate(180deg); --c: #E8553A; }
.duel-half.p1 { background: #E3ECFF; --c: #2563EB; }
:root[data-theme="dark"] .duel-half.p1 { background: #16264A; }
.dh-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; color: var(--c); }
.dh-pts b { font-family: var(--font-display); font-size: 1.8rem; }
.dh-task { display: grid; place-items: center; font-size: clamp(2rem, 7vw, 3.2rem); }
.dh-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dh-opts .choice { min-height: 70px; }
.duel-half.win { box-shadow: 0 0 0 5px var(--green); }
.duel-half.locked { opacity: .5; filter: grayscale(.7); }
.duel-mid { display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; color: var(--ink-3); }
@media (orientation: landscape) and (min-width: 820px) {
  .duel { grid-template-rows: none; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); height: auto; min-height: 0; }
  .duel-half.p0 { transform: none; }
}

/* ---------- Dialoge ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: var(--overlay); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); padding: max(16px, env(safe-area-inset-top, 0px)) var(--gutter-r) max(16px, env(safe-area-inset-bottom, 0px)) var(--gutter-l); animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(100%, 520px); max-height: 100%; overflow: auto; display: grid; gap: 1rem; background: var(--paper); border-radius: 28px; padding: clamp(18px, 3vw, 28px); box-shadow: var(--shadow-pop); animation: rise .2s ease; }
@keyframes rise { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.modal.wide { width: min(100%, 980px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.modal-head h2 { font-size: 1.55rem; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .6rem; padding-top: .3rem; }
.settings { display: grid; gap: 1rem; }
.pw-change summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.pw-change[open] { display: grid; gap: .6rem; }
.auth-modal { width: min(100%, 440px); }
.auth-form { display: grid; gap: .9rem; }
.form-error { color: var(--red); font-size: .9rem; font-weight: 500; }
.form-error:empty, .form-info:empty { display: none; }
.form-info { color: var(--green-ink); background: var(--green-wash); font-size: .9rem; padding: .6rem .85rem; border-radius: 12px; }
.account-card { display: flex; align-items: center; gap: .9rem; padding: .9rem; border-radius: 18px; background: var(--paper-2); border: 1px solid var(--line); }
.account-card strong { font-size: 1.15rem; }
.account-avatar { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; flex: none; }
.kid-avatar { background: var(--sun-wash); }
.kid-avatar img { width: 70%; height: 70%; }
.role-pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: .4rem 0 .4rem; }
.role-tile { min-width: 0; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; padding: 1rem; border-radius: 24px; border: 2px solid var(--line); background: var(--paper-2); color: var(--ink); text-align: center; transition: transform .15s, border-color .15s, box-shadow .15s; }
.role-tile:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow-card); }
.role-tile.kid { background: var(--sun-wash); border-color: color-mix(in srgb, var(--sun) 55%, transparent); }
.role-tile.teacher { background: var(--brand-wash); }
.role-tile strong { font-family: var(--font-display); font-size: clamp(1.05rem, 3.6vw, 1.3rem); }
.role-tile small { color: var(--ink-2); }
.role-art { display: flex; justify-content: center; margin-bottom: .3rem; }
.role-art img { width: clamp(34px, 9vw, 46px); height: clamp(34px, 9vw, 46px); margin: 0 -5px; background: var(--paper); border-radius: 12px; padding: 4px; box-shadow: var(--shadow-soft); }
.role-icon { width: clamp(56px, 15vw, 72px); height: clamp(56px, 15vw, 72px); border-radius: 20px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--on-brand); }
.role-icon .icon { width: 55%; height: 55%; }
.role-foot { margin: 0; }
.kid-form .label { margin: 0; }
.kid-slots { display: flex; align-items: center; gap: .55rem; }
.kid-slot { position: relative; width: 58px; height: 58px; border-radius: 16px; border: 2px dashed var(--line-2); display: grid; place-items: center; background: var(--paper-2); }
.kid-slot.full { border-style: solid; border-color: var(--brand); background: var(--paper); }
.kid-slot b { position: absolute; top: -8px; left: -8px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .78rem; background: var(--brand); color: var(--on-brand); }
.kid-slot img { width: 40px; height: 40px; }
.kid-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.kid-pic { aspect-ratio: 1; border-radius: 18px; border: 2px solid var(--line); background: var(--paper-2); display: grid; place-items: center; padding: 10%; transition: transform .12s, border-color .12s; }
.kid-pic:hover { border-color: var(--brand); }
.kid-pic:active { transform: scale(.93); }
.kid-pic img { width: 100%; height: 100%; }
.help-box svg + p { min-width: 12rem; }
.sheet-dialog { display: grid; gap: 1.2rem; align-items: start; }
@media (min-width: 760px) { .sheet-dialog { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); } }
.sheet-form { display: grid; gap: 1rem; align-content: start; }
.sheet-opts { display: grid; gap: .7rem; }
.sheet-opts .seg { justify-self: start; }
.sheet-prev { display: grid; gap: .8rem; justify-items: center; }
.sheet-svg { width: 100%; max-width: 520px; height: auto; border-radius: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 14px 34px -16px rgba(0, 0, 0, .4); background: #fff; }

/* ---------- Kinder-Login, Klassen ---------- */
.kid-hello { display: flex; align-items: center; gap: 1.1rem; }
.kid-hello-pic { width: clamp(72px, 14vw, 104px); aspect-ratio: 1; display: grid; place-items: center; background: var(--paper); border-radius: 28px; box-shadow: var(--shadow-card); flex: none; }
.kid-hello-pic img { width: 72%; height: 72%; }
.kid-hello h1 { font-size: clamp(2rem, 6vw, 3rem); }
.classes-view, .class-view { display: grid; gap: 1.2rem; }
.classes-grid, .class-grid { display: grid; gap: 22px; align-items: start; }
@media (min-width: 860px) { .classes-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); } .class-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); } }
.lib-item { display: flex; align-items: center; gap: .3rem; border-radius: 18px; background: var(--paper-2); border: 1px solid var(--line); padding: 4px; }
.lib-item.confirm { padding: .65rem .85rem; flex-wrap: wrap; background: var(--red-wash); border-color: transparent; }
.lib-confirm { display: flex; gap: .4rem; margin-left: auto; }
.lib-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: .85rem; background: none; border: 0; text-align: left; padding: .5rem .55rem; border-radius: 14px; }
.lib-text { display: grid; min-width: 0; }
.lib-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.lib-text small { color: var(--ink-3); }
.class-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.class-badge { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--on-brand); }
.privacy-note { display: flex; gap: .4rem; align-items: center; }
.class-tabs { width: 100%; }
.class-tabs .seg-btn { flex: 1; justify-content: center; }
.classes-view form.panel, .add-kid { display: grid; gap: .8rem; }
.add-kid { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.add-kid button { grid-column: 1 / -1; }
.initial-field { width: 5.2rem; }
.initial-box { text-align: center; font-weight: 700; text-transform: uppercase; }
.kid-import summary { cursor: pointer; font-weight: 600; color: var(--brand-ink); }
.kid-import[open] { display: grid; gap: .6rem; }
.vb-import { border-top: 1px solid var(--line); padding-top: .9rem; display: grid; gap: .6rem; justify-items: start; }
.vb-tag { display: inline-block; padding: 0 .45rem; border-radius: 99px; background: #EEF0FF; color: #3730A3; font-size: .72rem; font-weight: 600; vertical-align: 1px; }
:root[data-theme="dark"] .vb-tag { background: #2A2A5C; color: #C4C0FF; }
.class-badge.vb { background: linear-gradient(135deg, #4F46E5, #7C3AED); }
.vb-panel .lib-item { padding-right: 8px; }
.other-tool { margin-top: .6rem; }
.ot-tag { display: inline-grid; place-items: center; padding: 0 .4rem; min-height: 1.4em; border-radius: 6px; background: linear-gradient(135deg, #4F46E5, #7C3AED); color: #fff; font-family: var(--font-display); font-weight: 800; font-size: .78rem; }
.lib-open.static { cursor: default; }
.lib-open:disabled { opacity: .55; cursor: default; }
.kid-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.kid-row { display: flex; align-items: center; gap: .7rem; padding: .45rem .6rem; border-radius: 16px; background: var(--paper-2); border: 1px solid var(--line); }
.kid-row.confirm { background: var(--red-wash); border-color: transparent; flex-wrap: wrap; justify-content: space-between; }
.kid-av-big { width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--paper); display: grid; place-items: center; }
.kid-av-big img { width: 30px; height: 30px; }
.kid-who { flex: 1; min-width: 0; display: grid; }
.kid-who small { color: var(--ink-3); }
.kid-pw { display: flex; gap: 4px; }
.kid-pw span { width: 30px; height: 30px; border-radius: 9px; background: var(--paper); border: 1px solid var(--line); display: grid; place-items: center; }
.kid-pw img { width: 22px; height: 22px; }
.kid-actions { display: flex; }
@media (max-width: 460px) { .kid-pw { display: none; } }
.cls-settings { max-width: 860px; }
.cls-settings h3 { margin-top: .4rem; }
.cards-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.cards-head h2 { margin: 0 0 .3rem; }
.card-previews { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.card-prev { margin: 0; aspect-ratio: 85 / 54; display: grid; place-items: center; border-radius: 14px; background: var(--paper-2); }
.card-prev img { width: 100%; height: 100%; border-radius: 14px; box-shadow: var(--shadow-card); }
.kid-mini { width: 22px; height: 22px; vertical-align: -5px; }
.kid-link { display: inline-flex; align-items: center; gap: .35rem; text-decoration: none; color: var(--ink); font-weight: 600; padding: .2rem .3rem; text-align: left; }

/* Übersicht */
.ov-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 620px) { .ov-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ov-sum .stat-tile { background: var(--paper); box-shadow: var(--shadow-soft); }
.stat-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px 6px; }
.ov-table { border-collapse: collapse; min-width: 100%; font-size: .92rem; }
.ov-table th, .ov-table td { padding: .5rem .55rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
.ov-table thead th { font-size: .74rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.ov-table tbody th { position: sticky; left: 0; background: var(--paper); z-index: 1; }
.ov-table tr.sel th, .ov-table tr.sel td { background: var(--brand-wash); }
.ov-table td.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.ov-table td small { display: block; font-size: .72rem; color: var(--ink-3); font-weight: 400; }
.mini-bar { display: block; width: 80px; height: 8px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--lv-top); }
.hard-chips { display: flex; gap: 4px; }
td.hard-chips { display: table-cell; }
.hchip { display: inline-block; margin-right: 4px; padding: .1rem .5rem; border-radius: 99px; background: var(--coral-wash); color: var(--coral-ink); font-weight: 700; font-size: .84rem; }
.kid-detail { scroll-margin-top: 80px; }
.kd-grid { display: grid; gap: 1.4rem; }
@media (min-width: 900px) { .kd-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.kd-grid > div { display: grid; gap: .8rem; align-content: start; }
.ov-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 940px) { .ov-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.diff-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.diff-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "word num" "bar bar"; gap: 4px .8rem; padding: .5rem .75rem; border-radius: 14px; background: var(--paper-2); border: 1px solid var(--line); }
.diff-word { grid-area: word; }
.diff-word strong { font-family: var(--font-display); font-size: 1.1rem; }
.diff-num { grid-area: num; font-size: .85rem; color: var(--ink-2); text-align: right; }
.diff-bar { grid-area: bar; height: 8px; border-radius: 99px; background: var(--sunken); overflow: hidden; }
.diff-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--coral), var(--red)); border-radius: 99px; }
.sheets-panel { scroll-margin-top: 80px; }
.sheets-panel h2 .icon { color: var(--brand); }
.kd-coins { display: flex; align-items: center; gap: .4rem; color: var(--ink-2); }
.kd-coins .coin-svg { width: 22px; height: 22px; }

/* ---------- Meldungen & Konfetti ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: max(18px, env(safe-area-inset-bottom, 0px)); z-index: 60; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.toast { max-width: 32rem; background: #10282C; color: #fff; padding: .75rem 1.2rem; border-radius: 16px; font-weight: 500; box-shadow: var(--shadow-pop); animation: toast-in .2s ease; }
.toast.bad { background: var(--red); }
.toast.out { opacity: 0; transform: translateY(8px); transition: all .3s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .brand-name { font-size: 1.15rem; }
  .crumb.current, .crumb-sep.sep-current { display: none; }
  .account-btn span { display: none; }
  .account-btn { padding: .35rem .7rem; }
  .tile { padding: 14px; }
  .tile-art { width: 54px; height: 54px; border-radius: 17px; }
  .pad-key { min-height: 58px; }
  .task-card { min-height: 180px; }
  .hide-sm { display: none; }
}
@media (max-width: 380px) { .brand-name { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Münzen ---------- */
.coin-svg { width: 24px; height: 24px; flex: none; display: block; }
.coin-pill { position: relative; display: inline-flex; align-items: center; gap: .35rem; min-height: 44px; padding: .3rem .8rem .3rem .45rem; border-radius: 99px; border: 1px solid #F3D27A; background: linear-gradient(180deg, #FFF8DE, #FFEFB8); color: #7A4F00; font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; box-shadow: 0 6px 14px -10px #C98A00; }
:root[data-theme="dark"] .coin-pill { background: linear-gradient(180deg, #3A2F12, #2E2510); border-color: #6B5419; color: #FFD66B; }
.coin-pill .coin-svg { width: 28px; height: 28px; }
.coin-prog { position: relative; display: inline-block; width: 34px; height: 6px; border-radius: 99px; background: rgba(160, 110, 0, .2); overflow: hidden; }
.coin-prog > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, #F4B400, #FF8A00); transition: width .4s ease; }
.coin-prog.big { width: 100%; height: 12px; }
.coin-pill.bump, .ex-coin.bump { animation: coin-bump .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes coin-bump { 40% { transform: scale(1.25); } }
.coin-fly { position: fixed; left: 0; top: 0; z-index: 80; width: 44px; height: 44px; pointer-events: none; filter: drop-shadow(0 6px 10px rgba(201, 138, 0, .45)); }
.coin-fly .coin-svg { width: 100%; height: 100%; }
.ex-coin { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem .25rem .3rem; border-radius: 99px; background: #FFF4D2; color: #7A4F00; font-family: var(--font-display); font-weight: 800; }
:root[data-theme="dark"] .ex-coin { background: #3A2F12; color: #FFD66B; }
.coins-modal { width: min(100%, 460px); }
.coins-hero { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: 1rem; border-radius: 22px; background: radial-gradient(circle at 50% 30%, #FFF7D6, #FFE9A6); color: #7A4F00; }
.coins-hero .coin-svg { width: 64px; height: 64px; animation: coin-spin 3s ease-in-out infinite; }
@keyframes coin-spin { 50% { transform: rotateY(180deg); } }
.coins-hero b { font-family: var(--font-display); font-size: 3rem; line-height: 1; }
.coins-hero span { font-weight: 600; }
.coin-next { display: grid; gap: .3rem; }
.coin-next span { font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.coin-next small { color: var(--ink-3); }
.coin-rules { margin: 0; padding-left: 1.1rem; display: grid; gap: .35rem; color: var(--ink-2); font-size: .92rem; }
.bonus-pill { display: inline-flex; align-items: center; gap: .35rem; }
.bonus-pill .coin-svg { width: 20px; height: 20px; }
@media (max-width: 560px) { .coin-prog { display: none; } .coin-pill { padding-right: .6rem; } .size-btn { padding: .6rem .7rem; } .size-btn b { font-size: 1rem; } }

/* ---------- Startkarte der Spiele ---------- */
.gate { min-height: 60vh; display: grid; place-items: center; }
.gate-card { display: grid; justify-items: center; gap: 1rem; text-align: center; width: min(100%, 560px); padding: clamp(22px, 5vw, 40px); border-radius: 32px; background: var(--paper); box-shadow: var(--shadow-card); position: relative; overflow: hidden; }
.gate-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 6px; background: var(--c, var(--brand)); }
.gate-art { display: grid; place-items: center; width: 108px; height: 108px; border-radius: 32px; background: var(--cw, var(--brand-wash)); animation: gate-bob 2.4s ease-in-out infinite; }
.gate-art .emo { font-family: var(--font-emoji); font-size: 3.8rem; }
@keyframes gate-bob { 50% { transform: translateY(-6px) rotate(-4deg); } }
.gate-card h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); }
.gate-how { color: var(--ink-2); max-width: 30rem; }
.gate-opts { display: grid; justify-items: center; gap: .5rem; }
.gate-reihen { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 30rem; }
.gate-reihen .reihe { min-width: 54px; min-height: 48px; }
.gate-go { gap: .45rem; }
.gate-go .coin-svg { width: 24px; height: 24px; }
.gate-need { display: flex; align-items: center; gap: .8rem; text-align: left; padding: .8rem 1rem; border-radius: 18px; background: #FFF4D2; color: #6B4600; max-width: 30rem; }
:root[data-theme="dark"] .gate-need { background: #3A2F12; color: #FFE2A0; }
.gate-need .coin-svg { width: 46px; height: 46px; filter: grayscale(.4); }
.spinner.big { width: 46px; height: 46px; border-width: 5px; }

/* ---------- 3D-Spiele ---------- */
.g3 { position: relative; height: min(72vh, 640px); min-height: 420px; border-radius: 28px; overflow: hidden; background: #0b1220; box-shadow: var(--shadow-card); user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.g3-canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.g3-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.g3-tag { position: absolute; left: 0; top: 0; pointer-events: auto; will-change: transform; border: 0; cursor: pointer; font-family: var(--font-display); font-weight: 800; color: #10282C; touch-action: manipulation; transition: opacity .25s, filter .25s; }
.g3-tag.fade { opacity: .25; pointer-events: none; }
.g3-tag.wrong { background: #EF4444 !important; color: #fff !important; animation: shake .35s; }
.g3-tag.right { background: #22C55E !important; color: #fff !important; box-shadow: 0 0 0 6px rgba(34, 197, 94, .35), 0 0 30px rgba(34, 197, 94, .8) !important; }
.g3-hud { position: absolute; z-index: 3; pointer-events: none; }
.g3-hud.top { left: 50%; top: 12px; transform: translateX(-50%); }
.g3-hud.bottom { left: 50%; bottom: 14px; transform: translateX(-50%); }
.g3-word { position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; justify-items: center; gap: .4rem; pointer-events: none; font-family: var(--font-display); font-weight: 800; font-size: clamp(3rem, 13vw, 7rem); color: #fff; text-shadow: 0 6px 28px rgba(0, 0, 0, .45); animation: g3-word 1.6s cubic-bezier(.2, 1.4, .4, 1) forwards; }
.g3-word.small { font-size: clamp(2rem, 7vw, 3.4rem); align-content: start; padding-top: 18%; }
.g3-word.bad { font-size: clamp(2.2rem, 9vw, 4.6rem); }
.g3-word small { font-size: clamp(1.3rem, 4vw, 2rem); background: rgba(16, 40, 44, .82); padding: .2rem 1rem; border-radius: 14px; text-shadow: none; }
@keyframes g3-word { 0% { opacity: 0; transform: scale(.3) rotate(-8deg); } 18% { opacity: 1; transform: scale(1.12) rotate(2deg); } 30% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: scale(1.05) translateY(-20px); } }
.g3-card { position: absolute; left: 50%; top: 50%; z-index: 5; transform: translate(-50%, -50%); }

/* Elfmeter */
.elf-board { display: flex; align-items: center; gap: .9rem; padding: .35rem .5rem .35rem .9rem; border-radius: 18px; background: rgba(10, 20, 30, .82); color: #fff; box-shadow: 0 10px 24px -12px #000; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); white-space: nowrap; }
.eb-label { font-size: .78rem; font-weight: 600; color: #A7F3D0; letter-spacing: .04em; text-transform: uppercase; }
.eb-label b { font-family: var(--font-display); font-size: 1.3rem; color: #fff; }
.eb-task { display: inline-flex; gap: .25em; align-items: center; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.5rem, 4.6vw, 2.2rem); padding: .1rem .7rem; border-radius: 12px; background: rgba(255, 255, 255, .08); }
.eb-task .op { color: #9FD8D0; }
.eb-task .slot { min-width: 1.3em; height: 1.1em; border: 2px dashed rgba(255, 255, 255, .5); background: transparent; color: var(--sun); border-radius: 8px; }
.g3-hud.shots { left: 14px; bottom: 14px; display: flex; gap: 6px; padding: .35rem .5rem; border-radius: 99px; background: rgba(10, 20, 30, .55); }
.g3-hud.shots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(255, 255, 255, .35); }
.g3-hud.shots i.hit { background: #22C55E; box-shadow: 0 0 10px #22C55E; }
.g3-hud.shots i.miss { background: #EF4444; }
.g3-clock { position: absolute; left: 20%; right: 20%; bottom: 18px; height: 10px; z-index: 3; border-radius: 99px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.g3-clock i { display: block; height: 100%; background: linear-gradient(90deg, #FFC233, #FF6B4A); transform-origin: left; }
.elf-tag { display: grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; font-size: 2rem; background: radial-gradient(circle at 35% 30%, #fff, #E8F1EC); box-shadow: 0 0 0 5px rgba(255, 255, 255, .55), 0 12px 24px -8px rgba(0, 0, 0, .55); animation: tag-in .45s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes tag-in { from { opacity: 0; } }

/* Meteoriten: Cockpit */
.g3-space { background: #03040c; }
.cockpit { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.ck-frame { position: absolute; inset: 0; width: 100%; height: 100%; }
.ck-gun { position: absolute; bottom: 25.5%; width: 9%; min-width: 54px; height: 22px; }
.ck-gun.l { left: 1.5%; transform: rotate(-14deg); }
.ck-gun.r { right: 1.5%; transform: scaleX(-1) rotate(-14deg); }
.ck-gun::before { content: ""; position: absolute; left: -8px; top: -2px; width: 34%; height: 26px; border-radius: 6px; background: linear-gradient(#4a5a80, #1d2541); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .2); }
.ck-gun i { position: absolute; inset: 4px 0 4px 0; border-radius: 4px 10px 10px 4px; background: linear-gradient(#6b7a9c, #2a3452 60%, #1a2138); box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25); }
.ck-gun i::after { content: ""; position: absolute; right: -6px; top: 50%; width: 14px; height: 14px; border-radius: 50%; transform: translateY(-50%) scale(.3); background: radial-gradient(circle, #fff, #6dff8f 40%, rgba(57, 255, 106, 0) 70%); opacity: 0; }
.ck-gun.fire i::after { animation: muzzle .28s ease-out; }
@keyframes muzzle { 0% { opacity: 1; transform: translateY(-50%) scale(2.6); } 100% { opacity: 0; transform: translateY(-50%) scale(.6); } }
.ck-dash { position: absolute; left: 0; right: 0; bottom: 0; height: 26%; min-height: 96px; z-index: 3; pointer-events: none;
  display: grid; grid-template-columns: 1fr minmax(200px, 1.5fr) 1fr; align-items: center; gap: 12px; padding: 16px 16px 12px; color: #CFF4FF;
  background: linear-gradient(#323f62, #1a2238 45%, #10162a); border-radius: 50% 50% 0 0 / 30px 30px 0 0; border-top: 2px solid #5a6c96;
  box-shadow: 0 -14px 30px rgba(0, 0, 0, .55), inset 0 3px 0 rgba(255, 255, 255, .07); }
.ck-dash::before { content: ""; position: absolute; left: 30%; right: 30%; top: 6px; height: 3px; border-radius: 3px; background: rgba(125, 211, 252, .3); }
.ck-panel { display: flex; align-items: center; justify-content: space-between; gap: .6rem; height: 74%; padding: .35rem .7rem; border-radius: 14px; background: linear-gradient(#0d1324, #1a2342); box-shadow: inset 0 2px 10px rgba(0, 0, 0, .7), 0 1px 0 rgba(255, 255, 255, .07); }
.ck-col { display: flex; flex-direction: column; gap: 3px; }
.ck-right .ck-col { align-items: flex-end; }
.ck-label { font-size: .64rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #7DD3FC; opacity: .85; }
.ck-leds { display: grid; grid-template-columns: repeat(2, 9px); gap: 6px; }
.ck-leds i { width: 9px; height: 9px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 8px #22C55E; animation: led 1.8s steps(2) infinite; }
.ck-leds i:nth-child(2) { background: #FACC15; box-shadow: 0 0 8px #FACC15; animation-delay: .4s; }
.ck-leds i:nth-child(3) { animation-delay: .9s; animation-duration: 2.4s; }
.ck-leds i:nth-child(4) { background: #38BDF8; box-shadow: 0 0 8px #38BDF8; animation-delay: 1.3s; }
@keyframes led { 50% { opacity: .25; } }
.ck-screen { position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; height: 86%; padding: .2rem .8rem .3rem; border-radius: 16px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 0, rgba(56, 189, 248, .28), rgba(8, 40, 64, .95) 70%); border: 2px solid #38BDF8; box-shadow: 0 0 26px rgba(56, 189, 248, .45), inset 0 0 22px rgba(56, 189, 248, .35); }
.ck-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .045) 0 2px, transparent 2px 4px); }
.dash-task { display: inline-flex; gap: .25em; align-items: center; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.4rem, 4.2vw, 2.2rem); line-height: 1.1; color: #F0FBFF; text-shadow: 0 0 12px rgba(125, 211, 252, .8); }
.dash-task .op { color: #7DD3FC; }
.dash-task .slot { min-width: 1.3em; height: 1.1em; background: transparent; border: 2px dashed rgba(125, 211, 252, .7); color: #FDE68A; border-radius: 8px; }
.g3-space .lives { display: flex; gap: 5px; }
.g3-space .lives i { width: 22px; height: 26px; clip-path: polygon(50% 0, 100% 18%, 92% 70%, 50% 100%, 8% 70%, 0 18%); background: rgba(125, 211, 252, .18); transition: all .3s; }
.g3-space .lives i.on { background: linear-gradient(#7DD3FC, #0EA5E9); box-shadow: 0 0 12px #38BDF8; }
.g3-space .lives i.lost { animation: life-lost .7s ease-out; }
.g3-space .lives i.gain { animation: life-gain .9s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes life-lost { 0% { background: #EF4444; transform: scale(1.5); } 60% { transform: scale(.8); } }
@keyframes life-gain { 0% { transform: scale(.2); background: #6DFF8F; } 50% { transform: scale(1.6); background: #6DFF8F; } }
.lives:has(i.on:first-child):not(:has(i.on:nth-child(2))) i.on { animation: life-last 1s ease-in-out infinite; }
@keyframes life-last { 50% { background: #FCA5A5; box-shadow: 0 0 14px #EF4444; } }
.ck-alert { position: absolute; left: 50%; top: 14px; z-index: 4; transform: translateX(-50%); padding: .45rem 1rem; border-radius: 99px; background: rgba(6, 40, 20, .85); border: 2px solid #39FF6A; color: #DFFFE6; font-weight: 600; white-space: nowrap; box-shadow: 0 0 22px rgba(57, 255, 106, .5); opacity: 0; pointer-events: none; }
.ck-alert b { color: #6DFF8F; }
.ck-alert.show { animation: ck-alert 3.2s ease forwards; }
@keyframes ck-alert { 0% { opacity: 0; transform: translate(-50%, -10px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }
/* 2D-Version: Ufo */
.space .alien { position: absolute; left: 0; top: 0; z-index: 4; width: 46px; height: 46px; padding: 0; border: 0; background: none; font-family: var(--font-emoji); font-size: 2.1rem; line-height: 1; cursor: pointer; filter: drop-shadow(0 0 10px #39FF6A); touch-action: manipulation; }
.space .alien.boom { animation: alien-boom .5s ease-out forwards; }
@keyframes alien-boom { to { scale: 2.4; opacity: 0; } }
.meteor-note.good { background: #DCFCE7; color: #14532D; }
.g3-space .m-score b { font-family: var(--font-display); font-size: 1.7rem; line-height: 1; color: #fff; }
.ck-gauge { display: grid; justify-items: center; gap: 1px; }
.ck-gauge svg { width: 60px; height: 36px; }
.ck-gauge .needle { transform-origin: 32px 34px; transform: rotate(calc(-72deg + var(--spd, 0) * 144deg)); transition: transform .8s cubic-bezier(.3, 1.5, .5, 1); }
@media (max-width: 640px) { .ck-dash { grid-template-columns: auto 1fr auto; gap: 8px; padding: 14px 8px 8px; } .ck-leds, .ck-gauge { display: none; } .ck-panel { padding: .3rem .45rem; } }
.g3-space.hit::after { content: ""; position: absolute; inset: 0; z-index: 3; background: radial-gradient(circle, rgba(239, 68, 68, .1), rgba(239, 68, 68, .55)); animation: hitflash .9s ease forwards; pointer-events: none; }
@keyframes hitflash { to { opacity: 0; } }
.crack { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity .3s; }
.crack svg { width: 70%; height: 70%; }
.crack.show { opacity: 1; transition: none; }

/* Frosch: Teich */
.g3-pond { background: #bfe3f2; }
.pond-board { display: flex; align-items: center; gap: .9rem; padding: .35rem .6rem .35rem 1rem; border-radius: 18px; background: rgba(255, 255, 255, .9); color: #12331A; box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .55); white-space: nowrap; }
.pb-task { display: inline-flex; gap: .25em; align-items: center; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.5rem, 4.6vw, 2.2rem); }
.pb-task .op { color: #4F8F37; }
.pb-task .slot { min-width: 1.3em; height: 1.1em; border: 2px dashed #6CB04F; background: #F0FBE8; color: #2F6B1E; border-radius: 8px; }
.pb-goal { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; color: #2F6B1E; }
.g3-pond .frog-way i { background: rgba(18, 51, 26, .18); }
.g3-pond .frog-way i.on { background: #4CAF3A; }
.g3-card.frog-done { display: grid; justify-items: center; gap: .6rem; width: min(92%, 440px); padding: 1.2rem 1.4rem; border-radius: 24px; background: rgba(255, 255, 255, .97); color: #12262A; text-align: center; box-shadow: var(--shadow-pop); animation: g3-card-in .4s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes g3-card-in { from { opacity: 0; transform: translate(-50%, -50%) scale(.8); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.frog-done h2 { font-size: 1.5rem; }
@media (max-width: 560px) { .pond-board { gap: .5rem; padding: .3rem .5rem; } .g3-pond .frog-way i { width: 9px; height: 9px; } .g3-pond .frog-way { gap: 3px; } .g3-pond .fw-shore { width: 22px; height: 22px; } }

/* ---------- Stimmt das? (neu) ---------- */
.tf-streak { position: relative; display: flex; justify-content: center; gap: 8px; }
.tf-streak i { width: 34px; height: 10px; border-radius: 99px; background: var(--sunken-2); transition: background-color .2s, box-shadow .2s; }
.tf-streak i.on { background: linear-gradient(90deg, #FFC233, #FF6B4A); box-shadow: 0 0 12px rgba(255, 140, 60, .6); }
.tf-streak .tf-bonus { position: absolute; right: 0; top: -10px; font-weight: 800; color: var(--green); opacity: 0; }
.tf-deck { position: relative; height: 230px; perspective: 900px; }
.tf-deck .tf-card { position: absolute; inset: 0; margin: 0 auto; max-width: 640px; min-height: 0; cursor: grab; touch-action: pan-y; transition: transform .2s ease, background-color .2s, border-color .2s; }
.tf-card.in { animation: tf-in .38s cubic-bezier(.2, 1.2, .4, 1); }
@keyframes tf-in { from { transform: translateX(60%) rotate(8deg) scale(.9); opacity: 0; } }
.tf-card.drag { transition: none; cursor: grabbing; }
.tf-card.lean-yes { border-color: var(--green); }
.tf-card.lean-no { border-color: var(--red); }
.tf-card.out-yes { animation: tf-out-r .45s ease-in forwards; }
.tf-card.out-no { animation: tf-out-l .45s ease-in forwards; }
@keyframes tf-out-r { to { transform: translateX(120%) rotate(18deg); opacity: 0; } }
@keyframes tf-out-l { to { transform: translateX(-120%) rotate(-18deg); opacity: 0; } }
.tf-note { min-height: 1.6em; text-align: center; }
.tf-note .tf-sol { font-family: var(--font-body); font-size: 1.05rem; color: var(--ink-2); animation: pop .25s ease; }
.tf-note .tf-sol b { font-family: var(--font-display); font-size: 1.5rem; color: var(--green-ink); }
.num.shown.strike { text-decoration: line-through; text-decoration-thickness: 6px; text-decoration-color: var(--red); color: var(--ink-3) !important; }
.num.shown.is-true { color: var(--green) !important; }
.tf-float { position: absolute; left: 50%; top: 40%; z-index: 3; font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; color: var(--green); pointer-events: none; animation: tf-float .9s ease-out forwards; }
@keyframes tf-float { from { transform: translate(-50%, 0) scale(.6); opacity: 1; } to { transform: translate(-50%, -90px) scale(1.2); opacity: 0; } }
@media (max-width: 560px) { .tf-deck { height: 200px; } .elf-tag { width: 64px; height: 64px; font-size: 1.5rem; } .g3 { height: min(68vh, 560px); } }
.g3-tag.wrong { animation: g3shake .35s; }
@keyframes g3shake { 20%, 60% { translate: -7px 0; } 40%, 80% { translate: 7px 0; } }
.g3-elf.flash::after { content: ""; position: absolute; inset: 0; z-index: 3; background: #fff; pointer-events: none; animation: g3flash .45s ease-out forwards; }
@keyframes g3flash { from { opacity: .7; } to { opacity: 0; } }
.climber { width: clamp(54px, 10.5vw, 74px); }

/* Memory: austeilen, Funken, Kombo */
.mem-card.deal { animation: deal .45s cubic-bezier(.2, 1.3, .4, 1) both; animation-delay: var(--d, 0ms); }
@keyframes deal { from { opacity: 0; transform: translateY(40px) rotate(-12deg) scale(.6); } }
.mem-card:hover:not(.done) .mc-face, .mem-card:hover:not(.done) .mc-back { filter: brightness(1.05); }
.mem-card.done .mc-in { animation: mem-done .5s ease; }
@keyframes mem-done { 40% { transform: rotateY(180deg) scale(1.12); } }
.mem-grid.open .mem-card.done .mc-in, .mem-card.up.done .mc-in { transform: rotateY(180deg); }
.mem-combo { color: var(--coral); font-family: var(--font-display); font-weight: 800; opacity: 0; }
.mem-combo.show { animation: combo 1.2s ease forwards; }
@keyframes combo { 15% { opacity: 1; transform: scale(1.3); } 30% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.spark { position: fixed; left: 0; top: 0; z-index: 90; width: 9px; height: 9px; border-radius: 50%; pointer-events: none; }

/* Duell: Seilziehen, Countdown */
.duel { position: relative; }
.duel-mid { position: relative; display: grid; place-items: center; gap: .3rem; }
.duel-mid .vs { font-family: var(--font-display); font-weight: 800; color: var(--ink-3); }
.rope { position: relative; display: block; width: min(80vw, 520px); height: 8px; border-radius: 99px; background: repeating-linear-gradient(90deg, #C69C6D 0 10px, #A97C4F 10px 20px); }
.rope i { --pos: 50%; position: absolute; top: 50%; left: var(--pos); width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFE08A, #F59E0B); box-shadow: 0 0 0 4px rgba(245, 158, 11, .25); transform: translate(-50%, -50%); transition: left .5s cubic-bezier(.3, 1.4, .5, 1); }
.dh-pts b.pop { display: inline-block; animation: coin-bump .5s cubic-bezier(.3, 1.6, .5, 1); }
.duel-count { position: absolute; left: 50%; top: 50%; z-index: 5; transform: translate(-50%, -50%); font-family: var(--font-display); font-weight: 800; font-size: clamp(3rem, 14vw, 7rem); color: var(--coral); text-shadow: 0 6px 20px rgba(0, 0, 0, .2); pointer-events: none; }
.duel-count.show { animation: g3-word .64s ease forwards; }
.rope::before, .rope::after { content: ""; position: absolute; top: 50%; width: 14px; height: 14px; border-radius: 50%; transform: translateY(-50%); }
.rope::before { left: -8px; background: #E8553A; }
.rope::after { right: -8px; background: #2563EB; }
@media (orientation: landscape) and (min-width: 820px) { .rope { width: 130px; } }

/* Reihen-Treppe: 3 Versuche, rot aufleuchten und verblassen */
.tries { display: inline-flex; gap: 6px; vertical-align: middle; margin-right: .5rem; }
.tries i { width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .15); transition: background .3s, transform .3s; }
.tries i.used { background: var(--red); transform: scale(.8); opacity: .7; }
.fb-retry { color: var(--red); font-weight: 700; }
.task-card.flash-bad { animation: flash-bad-card 1s ease-out, shake .4s; }
@keyframes flash-bad-card {
  0%, 18% { border-color: var(--red); background: color-mix(in srgb, var(--red) 28%, var(--paper)); box-shadow: 0 0 0 6px color-mix(in srgb, var(--red) 25%, transparent); }
  100% { background: var(--paper); box-shadow: 0 0 0 0 transparent; }
}
.stair.flash-bad::after { content: ''; position: absolute; inset: 0; border-radius: inherit; background: #EF4444; pointer-events: none; animation: flash-fade 1s ease-out forwards; }
@keyframes flash-fade { 0%, 18% { opacity: .95; } 100% { opacity: 0; } }
.slot.solved { border-style: solid; border-color: var(--red); background: var(--red-wash); color: var(--red); }
.mc-face.long { font-size: clamp(1rem, 3vw, 1.45rem); }
.mc-face .mc-gap { font-style: normal; color: var(--c); font-weight: 700; }
/* Startkarte der Spiele: Aufgabenart */
.gate-card .op-pick.gate-ops { margin: .2rem auto 0; width: 100%; max-width: 560px; }
.gate-card .gate-reihen-text { margin: .1rem 0 0; }
/* Frosch 2D: Aufgabe und Weg über den Teich */
.frog-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; }
.frog-task .task.small { font-size: clamp(1.6rem, 5vw, 2.3rem); }
.frog-way { display: flex; align-items: center; gap: 5px; }
.frog-way i { width: 14px; height: 14px; border-radius: 50%; background: var(--line); transition: background .3s, transform .3s; }
.frog-way i.on { background: #4CAF3A; }
.frog-way i.cur { background: var(--sun); transform: scale(1.25); }
.frog-way .fw-shore { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-left: 4px; border-radius: 50%; background: var(--sun-wash); color: #B7791F; }
.frog-way .fw-shore svg { width: 16px; height: 16px; }
.lily.grow { animation: lily-grow .45s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: var(--d, 0ms); }
@keyframes lily-grow { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.lily.right { animation: none; }
@media (max-aspect-ratio: 1/1) { .ck-strut { display: none; } }
.gate-card .op-pick.gate-ops { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
.gate-ops .op-btn { min-height: 46px; padding: .3rem .55rem; gap: .45rem; font-size: .95rem; }
.gate-ops .op-sym { width: 30px; height: 30px; }
.gate { grid-template-columns: minmax(0, 1fr); }
.gate-card { grid-template-columns: minmax(0, 1fr); }
.gate-card > * { min-width: 0; max-width: 100%; }
@media (max-width: 480px) { .gate-card .op-pick.gate-ops { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Spielmodi: Wahl auf der Startkarte ---------- */
.mode-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 560px; margin: 0 auto; }
.mode-btn { display: grid; justify-items: center; gap: 2px; padding: .55rem .4rem .5rem; border-radius: 16px; border: 2px solid var(--line); background: var(--paper); color: var(--ink-2); transition: border-color .15s, background-color .15s, transform .15s; }
.mode-btn b { font-family: var(--font-display); font-size: 1.05rem; color: var(--ink); }
.mode-btn small { font-size: .78rem; color: var(--ink-3); }
.mode-btn .mode-ic, .mode-one .mode-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--sunken); color: var(--ink-2); }
.mode-ic svg { width: 20px; height: 20px; }
.mode-ic .heart { fill: currentColor; }
.mode-btn[aria-checked="true"] { border-color: var(--c, var(--brand)); background: color-mix(in srgb, var(--c, var(--brand)) 10%, var(--paper)); transform: translateY(-1px); }
.mode-btn[aria-checked="true"] .mode-ic { background: var(--c, var(--brand)); color: #fff; }
.mode-btn.m-survive .mode-ic { color: #E0393E; }
.mode-btn.m-survive[aria-checked="true"] .mode-ic { color: #fff; }
.mode-one { display: inline-flex; align-items: center; gap: .5rem; margin: 0; font-size: 1.1rem; }
.mode-desc { margin: -.2rem 0 0; max-width: 32rem; color: var(--ink-2); font-size: .95rem; }
.mode-best { display: inline-flex; align-items: center; gap: .3rem; margin-left: .3rem; padding: .05rem .55rem; border-radius: 99px; background: var(--sun-wash); color: #8A5A00; font-weight: 600; font-size: .85rem; white-space: nowrap; }
.mode-best .icon { width: 14px; height: 14px; }

/* ---------- Spielmodi: Anzeige Leben / Zeit / richtige ---------- */
.run-hud { display: inline-flex; align-items: center; gap: .8rem; font-weight: 600; color: var(--ink-2); }
.run-hud b { font-family: var(--font-display); font-size: 1.35rem; color: var(--ink); line-height: 1; }
.run-hud small { font-size: .8rem; color: var(--ink-3); margin-left: 1px; }
.run-hud .icon { width: 18px; height: 18px; }
.run-lives { display: inline-flex; gap: 3px; }
.run-lives .heart { width: 24px; height: 24px; fill: #EF4444; filter: drop-shadow(0 2px 3px rgba(239, 68, 68, .35)); transition: opacity .3s, transform .3s, fill .3s; }
.run-lives .heart.off { fill: #CBD5E1; filter: none; opacity: .55; transform: scale(.85); }
.run-lives .heart.lost { animation: heart-lost .7s ease-out; }
.run-lives .heart.gain { animation: heart-gain .9s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes heart-lost { 0% { transform: scale(1.6); fill: #EF4444; } 40% { transform: scale(.7) rotate(-12deg); } }
@keyframes heart-gain { 0% { transform: scale(.2); } 50% { transform: scale(1.6); } }
.run-hud.m-survive .run-lives:has(.heart:first-child:not(.off)):not(:has(.heart:nth-child(2):not(.off))) .heart:first-child { animation: heart-beat .8s ease-in-out infinite; }
@keyframes heart-beat { 50% { transform: scale(1.2); } }
.run-clock { display: inline-flex; align-items: center; gap: .35rem; }
.run-bar { position: relative; display: inline-block; width: 90px; height: 10px; border-radius: 99px; background: var(--sunken-2, #E2E8F0); overflow: hidden; }
.run-bar i { position: absolute; inset: 0; background: linear-gradient(90deg, var(--green), var(--sun)); transform-origin: left; transition: transform .1s linear; }
.run-bar.low i { background: var(--red); }
.run-ok { display: inline-flex; align-items: center; gap: .25rem; color: var(--green-ink, #15803D); }
.run-ok.pop { animation: pop .3s ease; }
.run-ok.miss { animation: shake .35s; color: var(--red); }
.run-hud.bar-hud { display: flex; justify-content: space-between; padding: .55rem 1rem; border-radius: 18px; background: var(--paper); box-shadow: var(--shadow-soft); }
.run-hud.bar-hud .run-bar { width: min(260px, 40vw); }
.run-hud.in-board { color: #DDEBEA; gap: .6rem; }
.run-hud.in-board b { color: #fff; font-size: 1.2rem; }
.run-hud.in-board small { color: #A7C4C0; }
.g3-pond .run-hud.in-board { color: #2F6B1E; }
.g3-pond .run-hud.in-board b { color: #12331A; }
.g3-pond .run-hud.in-board small { color: #4F8F37; }
.run-hud.dark { color: #E2E8F0; }
.run-hud.dark b { color: #fff; }
.elf-board .run-hud { padding-right: .4rem; border-right: 1px solid rgba(255, 255, 255, .18); }
.pond-board .run-hud { padding-left: .6rem; border-left: 1px solid rgba(18, 51, 26, .15); }
.ck-time { display: inline-flex; align-items: baseline; gap: 2px; color: #CFF4FF; font-weight: 600; }
.ck-time b { font-family: var(--font-display); font-size: 1.5rem; color: #fff; }
.run-bar.ck-bar { width: 100%; max-width: 110px; height: 6px; background: rgba(125, 211, 252, .2); }
.ck-goal { font-size: .85rem; color: #7DD3FC; }
.g3-space .m-score.pop { animation: pop .3s ease; }
.g3-space .m-score.miss b { color: #FCA5A5; }
.tf-clock { position: relative; left: auto; right: auto; bottom: auto; margin: 0 auto; width: min(560px, 90%); background: var(--sunken-2, #E2E8F0); }
.frog-clock { position: relative; left: auto; right: auto; bottom: auto; margin: .2rem auto; width: min(560px, 90%); background: var(--sunken-2, #E2E8F0); }

/* Memory: 16 Karten */
.mem-grid.n16 { max-width: 760px; }
.mem-grid.n16 .mem-card { aspect-ratio: 3 / 2; }
@media (max-width: 520px) { .mem-grid.n16 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; } .mem-grid.n16 .mc-face { font-size: 1.05rem; } .mem-grid.n16 .mc-face.long { font-size: .78rem; } }
.mem-pen { color: var(--red); font-family: var(--font-display); font-weight: 800; opacity: 0; }
.mem-pen.show { animation: mem-pen 1s ease forwards; }
@keyframes mem-pen { 0% { opacity: 0; transform: translateY(6px); } 20%, 70% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------- Ergebnis mit Bestenliste ---------- */
.run-result { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .run-result { grid-template-columns: minmax(0, 1fr); } }
.run-result .result { grid-column: auto; }
.run-mode-tag { display: inline-flex; align-items: center; gap: .4rem; margin: 0; padding: .25rem .8rem; border-radius: 99px; background: var(--sunken); color: var(--ink-2); font-weight: 600; font-size: .9rem; }
.run-mode-tag svg { width: 18px; height: 18px; }
.run-mode-tag .heart { fill: #EF4444; }
.board-card { display: grid; gap: .7rem; padding: clamp(18px, 3vw, 26px); border-radius: 28px; background: var(--paper); box-shadow: var(--shadow-card); }
.board-head { display: grid; gap: 2px; }
.board-head h3 { display: flex; align-items: center; gap: .45rem; margin: 0; font-size: 1.35rem; }
.board-head h3 .icon { color: #E0A800; }
.board-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.board-list li { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) auto; align-items: center; gap: .6rem; padding: .45rem .7rem; border-radius: 12px; background: var(--paper-2, #F6FAF9); }
.board-list li.me { background: color-mix(in srgb, var(--brand) 14%, var(--paper)); outline: 2px solid var(--brand); }
.board-list li.sep { margin-top: 10px; position: relative; }
.board-list li.sep::before { content: "⋯"; position: absolute; top: -17px; left: 50%; transform: translateX(-50%); color: var(--ink-3); }
.b-rank, .b-medal { display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; font-family: var(--font-display); font-weight: 800; color: var(--ink-2); background: var(--sunken); }
.b-medal.m1 { background: linear-gradient(#FFE27A, #F2B705); color: #6B4A00; }
.b-medal.m2 { background: linear-gradient(#F1F5F9, #B8C2CC); color: #3B4652; }
.b-medal.m3 { background: linear-gradient(#F6C79B, #C9844A); color: #5A2E0C; }
.b-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.b-name em { font-style: normal; color: var(--brand-ink, var(--brand)); font-weight: 500; }
.b-score { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.board-me { margin: 0; font-weight: 600; }
.board-me b { font-family: var(--font-display); font-size: 1.3rem; color: var(--brand-ink, var(--brand)); }
.gate-card .op-pick.gate-ops { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.gate-ops .op-btn { min-height: 44px; padding: .25rem .4rem; gap: .35rem; font-size: .88rem; }
.gate-ops .op-sym { width: 26px; height: 26px; font-size: 1.2rem; border-radius: 9px; }
.gate-ops .op-sym .icon { width: 17px; height: 17px; }
@media (max-width: 480px) { .gate-card .op-pick.gate-ops { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mode-btn small { display: none; } }
/* Lehrperson: Bestenlisten der Spiele */
.cb-pick { display: flex; flex-wrap: wrap; gap: .6rem 1rem; margin-bottom: .6rem; }
.cb-field { display: grid; gap: 3px; font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.cb-field select { min-width: 150px; padding: .45rem .6rem; border-radius: 12px; border: 2px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-weight: 600; }
.cboard { max-width: 560px; }
/* Survive: Level */
.run-level { position: relative; display: inline-flex; align-items: baseline; gap: .25rem; padding: .1rem .55rem; border-radius: 99px; background: var(--sun-wash, #FFF4D2); color: #8A5A00; font-weight: 700; font-size: .85rem; }
.run-level b { font-size: 1.15rem; color: #6B4600; }
.run-hud.in-board .run-level { background: rgba(255, 194, 51, .2); color: #FFE2A0; }
.run-hud.in-board .run-level b { color: #FFD166; }
.g3-pond .run-hud.in-board .run-level { background: #FFF4D2; color: #8A5A00; }
.g3-pond .run-hud.in-board .run-level b { color: #6B4600; }
.run-hud.dark .run-level { background: rgba(255, 194, 51, .2); color: #FFE2A0; }
.run-levelup { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 4px; padding: .1rem .5rem; border-radius: 8px; background: #F59E0B; color: #fff; font-style: normal; font-size: .75rem; font-weight: 700; white-space: nowrap; opacity: 0; pointer-events: none; }
.up > .run-levelup, .up .run-levelup { animation: levelup 1.6s ease forwards; }
.run-level.up, .ck-lvl.up { animation: pop .35s ease; }
@keyframes levelup { 0% { opacity: 0; transform: translate(-50%, -6px); } 15%, 75% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 4px); } }
.ck-lvl { position: relative; align-items: center; }
.ck-lvl b { font-family: var(--font-display); font-size: 1.5rem; line-height: 1; color: #FFD166; }

/* ---------- 🎯 Zielscheibe ---------- */
.c-wood { --c: #8B5A2B; --cw: #F6EBDD; }
.tg-stage { position: relative; container-type: size; overflow: clip; height: min(72vh, 640px); min-height: 440px; border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-card); user-select: none; -webkit-user-select: none; touch-action: none; cursor: crosshair; background: #6FAF4F; }
.tg-sky { position: absolute; inset: 0 0 30% 0; background: linear-gradient(#7CC4EC, #CFEFFC 85%); }
.tg-sun { position: absolute; right: 9%; top: 8%; width: 11cqmin; height: 11cqmin; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFF6D8, #FFD873 70%); box-shadow: 0 0 8cqmin 1cqmin rgba(255, 216, 115, .45); }
.tg-cloud { position: absolute; height: auto; opacity: .9; animation: tg-drift var(--d, 90s) linear infinite alternate; }
@keyframes tg-drift { to { transform: translateX(18cqw); } }
.tg-hills { position: absolute; left: 0; width: 100%; top: 58%; height: 13%; }
.tg-meadow { position: absolute; left: 0; right: 0; top: 70%; bottom: 0; background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .06) 0 6cqh, transparent 6cqh 12cqh), linear-gradient(#6FAF4F, #3E7A2E); }
.tg-fence { position: absolute; left: 0; right: 0; top: -3.4cqh; height: 4.6cqh; background: linear-gradient(transparent 22%, #A8773F 22% 36%, transparent 36% 62%, #A8773F 62% 76%, transparent 76%), repeating-linear-gradient(90deg, #8B5A2B 0 1.1cqw, transparent 1.1cqw 9cqw); opacity: .85; }
.tg-hud { position: absolute; left: 12px; top: 12px; z-index: 6; }
.run-hud.wood { padding: .4rem .8rem; border-radius: 14px; background: linear-gradient(#A86F3A, #8B5A2B); border: 3px solid #5B3A22; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); color: #F3E4C2; }
.run-hud.wood b { color: #FFF6E2; }
.run-hud.wood small, .run-hud.wood .icon { color: #F3E4C2; }
.run-hud.wood .run-bar { background: rgba(0, 0, 0, .25); }
.run-hud.wood .run-ok { color: #D9F7C9; }
.run-hud.wood .run-level { background: rgba(255, 255, 255, .18); color: #FFE2A0; }
.tg-sign { position: absolute; left: 50%; top: 3cqh; z-index: 5; transform: translateX(-50%); padding: 1.2cqh 4.5cqmin; border-radius: 16px; background: linear-gradient(#F7EAC9, #EBD6A6); border: 4px solid #5B3A22; box-shadow: 0 6px 0 rgba(0, 0, 0, .22); white-space: nowrap; }
.tg-sign::before, .tg-sign::after { content: ""; position: absolute; top: -3cqh; width: 5px; height: 3cqh; background: #5B3A22; }
.tg-sign::before { left: 22%; } .tg-sign::after { right: 22%; }
.tg-sign.drop { animation: tg-sign .5s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes tg-sign { from { transform: translate(-50%, -30%) rotate(-4deg); opacity: 0; } }
.tg-sign .task { display: inline-flex; gap: .2em; align-items: center; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.6rem, 8cqmin, 3.4rem); color: #3B2415; line-height: 1.05; }
.tg-sign .task .op { color: #8B5A2B; }
.tg-sign .task .slot { min-width: 1.2em; height: 1em; border: 3px dashed #A86F3A; background: rgba(255, 255, 255, .5); color: #C77700; border-radius: 10px; }
.tg-clock { position: absolute; left: 50%; top: calc(3cqh + 12cqmin); z-index: 5; width: min(40cqw, 320px); height: 9px; transform: translateX(-50%); border-radius: 99px; background: rgba(59, 36, 21, .3); overflow: hidden; }
.tg-clock i { display: block; height: 100%; background: linear-gradient(90deg, #F2C14E, #E8553A); transform-origin: left; }
.tg-target { position: absolute; left: 50%; top: 46%; z-index: 3; width: min(56cqh, 74cqw); aspect-ratio: 1; transform: translate(-50%, -50%); filter: drop-shadow(0 1.6cqh 1.2cqh rgba(0, 0, 0, .3)); }
.tg-target svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tg-stand { position: absolute; left: 50%; top: calc(46% + min(56cqh, 74cqw) * .4); z-index: 2; width: min(24cqh, 32cqw); transform: translateX(-50%); }
.tg-stand svg { display: block; width: 100%; }
.tg-q .fill { transition: fill .2s; }
.tg-q.q-tl .fill, .tg-q.q-br .fill { fill: #F2C14E; }
.tg-q.q-tr .fill, .tg-q.q-bl .fill { fill: #E98B3A; }
.tg-q .badge { fill: rgba(255, 249, 235, .93); stroke: rgba(91, 58, 34, .35); stroke-width: 1.5; }
.tg-num { font-family: var(--font-display); font-weight: 800; font-size: 27px; fill: #3B2415; dominant-baseline: central; }
.tg-q.correct .fill { fill: #3FA34D !important; }
.tg-q.wrong .fill { fill: #D9453B !important; }
.tg-q.correct, .tg-q.wrong { transform-box: fill-box; transform-origin: center; animation: tg-q-pop .45s ease; }
@keyframes tg-q-pop { 40% { transform: scale(1.06); } }
.tg-arrows { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.tg-stuck { position: absolute; width: 8cqmin; height: 8cqmin; transform: translate(-10%, -10%); transform-origin: 10% 10%; animation: tg-wobble .5s ease-out; transition: opacity .35s; }
.tg-stuck svg { display: block; width: 100%; height: 100%; }
.tg-stuck.miss { opacity: .75; }
.tg-stuck.gone { opacity: 0; }
@keyframes tg-wobble { 0% { transform: translate(-10%, -10%) rotate(8deg); } 25% { transform: translate(-10%, -10%) rotate(-6deg); } 50% { transform: translate(-10%, -10%) rotate(4deg); } 75% { transform: translate(-10%, -10%) rotate(-2deg); } }
.tg-reticle { position: absolute; z-index: 7; width: 9cqmin; height: 9cqmin; transform: translate(-50%, -50%); opacity: 0; pointer-events: none; transition: opacity .12s; }
.tg-reticle.on { opacity: 1; }
.tg-reticle svg { display: block; width: 100%; height: 100%; }
.tg-bow { position: absolute; left: 50%; bottom: -16cqh; z-index: 6; width: min(58cqh, 92cqw); height: 40cqh; transform: translateX(-50%); transition: transform .1s ease-out; pointer-events: none; }
.tg-bow svg { width: 100%; height: 100%; overflow: visible; }
.tg-flight { position: absolute; left: 0; top: 0; z-index: 8; width: 3cqmin; height: 20cqmin; transform-origin: 50% 0; opacity: 0; pointer-events: none; }
.tg-flight svg { display: block; width: 100%; height: 100%; }
.tg-toast { position: absolute; left: 50%; top: calc(3cqh + 14cqmin); z-index: 9; transform: translate(-50%, 6px); padding: .45rem 1.1rem; border-radius: 14px; background: #5B3A22; color: #F3E4C2; font-family: var(--font-display); font-weight: 800; font-size: clamp(1rem, 3.4cqmin, 1.4rem); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.tg-toast.show { opacity: 1; transform: translate(-50%, 0); }
.tg-toast.good { background: #3FA34D; color: #fff; }
.tg-toast.bad { background: #D9453B; color: #fff; }
.tg-help { position: absolute; left: 50%; bottom: 3cqh; z-index: 7; transform: translateX(-50%); margin: 0; padding: .35rem .9rem; border-radius: 99px; background: rgba(36, 22, 10, .55); color: #fff; font-weight: 600; font-size: .9rem; white-space: nowrap; pointer-events: none; transition: opacity .4s; }
.tg-help.hide { opacity: 0; }
@media (max-width: 560px) { .tg-stage { height: min(70vh, 560px); } .tg-hud { left: 8px; top: auto; bottom: 8px; z-index: 9; } .tg-hud .run-bar { display: none; } .tg-hud .run-hud { gap: .45rem; padding: .3rem .55rem; } .tg-sign { top: 2cqh; } .tg-help { display: none; } }
/* Zielscheibe: gespannte Armbrust zittert leicht, beim Abdrücken ruckt sie */
.tg-bow svg { transform-origin: 50% 80%; }
.tg-bow.drawn svg { animation: tg-tense .14s ease-in-out infinite alternate; }
.tg-bow.kick svg { animation: tg-kick .28s ease-out; }
@keyframes tg-tense { from { transform: translate(-.6px, 0); } to { transform: translate(.6px, -.4px); } }
@keyframes tg-kick { 0% { transform: translateY(14px) scale(1.02); } 60% { transform: translateY(-3px); } 100% { transform: none; } }
/* Meteoriten: Lob und Serie oben im leeren Bereich der Frontscheibe, über den Meteoriten */
.g3-word.sky { padding-top: 4.5%; gap: .2rem; font-size: clamp(1.6rem, 5vw, 2.6rem); flex-direction: row; }
.g3-word.sky small { font-size: clamp(1rem, 2.8vw, 1.4rem); background: rgba(6, 40, 20, .78); border: 1.5px solid rgba(57, 255, 106, .6); color: #DFFFE6; }
