/* Layout: Straßenschild-Werkstatt – ruhige, kühle Kartenflächen; Schildergrün trägt Navigation und Aktionen,
   Signalgelb die Vorgaben (Telefonschild), Weiß/Schwarz/Blau die Kennzeichen. Display: Barlow Condensed (Verkehrsschild-Duktus). */
:root {
  --bg: #eef1ec;
  --surface: #f9faf7;
  --surface-2: #e3e8e2;
  --ink: #121c17;
  --muted: #5b6b63;
  --line: #d0d8d1;
  --accent: #146c43;
  --accent-ink: #ffffff;
  --accent-soft: #d9ebe0;
  --yellow: #f2b705;
  --yellow-strong: #d89e00;
  --yellow-ink: #1b1600;
  --blue: #1d4ea6;
  --ok: #1d8a5a;
  --ok-soft: #d6efe1;
  --bad: #cf4436;
  --bad-soft: #f8dcd8;
  --warn-soft: #fbeccb;
  --warn-ink: #7a5300;
  --land: #d5ddd6;
  --land-hover: #bfcbc1;
  --land-dim: #e0e6df;
  --ocean: #e2e8e1;
  --map-edge: #f9faf7;
  --left: #7c3aed;
  --left-soft: #ebe1fb;
  --shadow: 0 1px 2px rgb(18 28 23 / .06), 0 10px 28px -14px rgb(18 28 23 / .22);

  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --r: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1310; --surface: #131c17; --surface-2: #1b2620; --ink: #e7ede8; --muted: #8fa097; --line: #26332c;
    --accent: #3cc083; --accent-ink: #06140c; --accent-soft: #16342a;
    --yellow: #f5c12b; --yellow-strong: #ffd257; --yellow-ink: #1b1600; --blue: #4f86e0;
    --ok: #3cc187; --ok-soft: #173a2b; --bad: #f2695c; --bad-soft: #43201d; --warn-soft: #3d3214; --warn-ink: #f5c12b;
    --land: #27352e; --land-hover: #37493f; --land-dim: #1b2822; --ocean: #101916; --map-edge: #0c1310;
    --left: #a78bfa; --left-soft: #2a2140;
    --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 12px 30px -14px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1310; --surface: #131c17; --surface-2: #1b2620; --ink: #e7ede8; --muted: #8fa097; --line: #26332c;
  --accent: #3cc083; --accent-ink: #06140c; --accent-soft: #16342a;
  --yellow: #f5c12b; --yellow-strong: #ffd257; --yellow-ink: #1b1600; --blue: #4f86e0;
  --ok: #3cc187; --ok-soft: #173a2b; --bad: #f2695c; --bad-soft: #43201d; --warn-soft: #3d3214; --warn-ink: #f5c12b;
  --land: #27352e; --land-hover: #37493f; --land-dim: #1b2822; --ocean: #101916; --map-edge: #0c1310;
  --left: #a78bfa; --left-soft: #2a2140;
  --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 12px 30px -14px rgb(0 0 0 / .7);
  color-scheme: dark;
}

/* ---------- Basis ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 1rem/1.5 var(--font-body); }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.01em; text-wrap: balance; margin: 0; }
.eyebrow { margin: 0; font: 600 .74rem/1.2 var(--font-body); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.muted { color: var(--muted); }
.lede { margin: 0; font-size: 1.08rem; color: var(--muted); max-width: 44rem; }
.empty, .loading { color: var(--muted); padding: 40px 0; text-align: center; }

.shell { max-width: 1200px; margin: 0 auto; padding-inline: clamp(16px, 4vw, 40px); padding-block: 0 24px; min-height: 100vh; display: flex; flex-direction: column; }
.app { flex: 1; }

/* ---------- Kopf & Fuß ---------- */
.site-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); }
.brand-mark svg { width: 20px; height: 20px; }
.brand-name { font: 800 1.3rem/1 var(--font-display); letter-spacing: -.01em; }
.brand-tag { font: 600 .7rem/1 var(--font-body); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding-left: 12px; border-left: 1px solid var(--line); }
.site-nav { display: flex; gap: 4px; }
.site-nav a { text-decoration: none; font-weight: 600; font-size: .92rem; padding: 8px 12px; border-radius: 999px; color: var(--muted); }
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }
.site-nav a.is-current { background: var(--ink); color: var(--surface); }
.sync-pill { font: 600 .72rem/1 var(--font-body); color: var(--muted); padding: 6px 10px; border-radius: 999px; border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 6px; }
.sync-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.sync-pill[data-status="cloud"]::before { background: var(--ok); }
.sync-pill[data-status="pending"]::before { background: var(--yellow); animation: blink 1s infinite; }
.sync-pill[data-status="error"]::before { background: var(--bad); }
@keyframes blink { 50% { opacity: .3; } }
.site-foot { margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--line); font-size: .84rem; color: var(--muted); }
.site-foot a { color: inherit; text-decoration: none; }
.site-foot a:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.foot-top { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 28px 32px; }
.foot-brand p { margin: 0 0 8px; max-width: 34ch; line-height: 1.45; }
.foot-name { font: 800 1.35rem/1 var(--font-display); letter-spacing: .01em; color: var(--ink); }
.foot-author { color: var(--ink); }
.foot-author a { color: var(--accent); font-weight: 600; }
.foot-col h4 { margin: 2px 0 10px; font: 700 .74rem/1 var(--font-body); text-transform: uppercase; letter-spacing: .1em; color: var(--ink); }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.foot-bottom { margin-top: 26px; padding-top: 16px; border-top: 1px dashed var(--line); font-size: .76rem; display: grid; gap: 6px; }
.foot-bottom p { margin: 0; }
.foot-legal { display: flex; flex-wrap: wrap; gap: 4px 18px; }
#foot-links { display: inline-flex; gap: 18px; }
#foot-contact a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px) { .foot-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot-brand { grid-column: 1 / -1; } }

/* ---------- Bausteine ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; padding: 10px 16px; font: 700 .98rem/1 var(--font-display); letter-spacing: .01em; }
.btn:hover { border-color: var(--ink); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn-danger { color: var(--bad); border-color: var(--bad); background: transparent; }
.btn kbd { font: 600 .68rem/1 var(--font-mono); opacity: .7; border: 1px solid currentColor; border-radius: 4px; padding: 3px 4px 2px; }
.btn .ico svg { width: 18px; height: 18px; }
.ico { display: inline-grid; place-items: center; width: 1.2em; height: 1.2em; vertical-align: -.2em; }
.ico svg { width: 100%; height: 100%; }
.badge { display: inline-block; vertical-align: middle; font: 700 .66rem/1 var(--font-body); text-transform: uppercase; letter-spacing: .08em; padding: 4px 7px 3px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge-left { background: var(--left-soft); color: var(--left); }
.badge-right { background: var(--surface-2); color: var(--muted); }
.meter { height: 6px; border-radius: 999px; background: var(--land-dim); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--ok); border-radius: inherit; transition: width .3s; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); cursor: pointer; border-radius: 999px; padding: 3px 11px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.chip-btn[aria-pressed="true"] { border-color: var(--ink); color: var(--ink); }
.code-chip { display: inline-block; font: 600 .84rem/1 var(--font-mono); font-variant-numeric: tabular-nums; padding: 5px 7px 4px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); white-space: nowrap; }
.chip-link { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: .8rem; font-weight: 600; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.chip-link:hover { border-color: var(--accent); color: var(--accent); }
.chip-ext { color: var(--muted); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.seg-btn { border: 0; background: transparent; cursor: pointer; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: .88rem; color: var(--muted); }
.seg-btn[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .88rem; color: var(--muted); }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.ring { display: inline-block; width: var(--size, 56px); height: var(--size, 56px); flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--land-dim); stroke-width: 6; }
.ring-fg { fill: none; stroke: var(--ok); stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset .5s; }

.page-head { display: grid; gap: 12px; padding-block: 8px 24px; }
.page-title { display: flex; align-items: center; gap: 14px; }
.page-title h1 { font-size: clamp(2rem, 4.5vw, 2.9rem); font-weight: 800; line-height: 1; }
.page-ico { width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); padding: 10px; }
.back { justify-self: start; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-weight: 600; font-size: .92rem; color: var(--muted); padding: 6px 10px 6px 0; }
.back:hover { color: var(--ink); }
.section-head { display: grid; gap: 4px; margin-bottom: 14px; }
.section-head h2 { font-size: 1.6rem; font-weight: 700; }
.section-head p { margin: 0; color: var(--muted); }
.continent { margin-top: 28px; display: grid; gap: 14px; }
.continent-title { display: flex; align-items: baseline; gap: 10px; font-size: 1.45rem; font-weight: 700; }
.continent-title span { font: 600 .8rem/1 var(--font-mono); color: var(--muted); }

/* ---------- Vorgaben (Schilder) ---------- */
.number { font-family: var(--font-display); font-weight: 800; letter-spacing: .01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.num-rest { opacity: .5; }
.num-code { text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .12em; }

.clue { position: relative; display: flex; flex-direction: column; gap: 6px; border-radius: var(--r); padding: 14px 22px 12px; min-width: 0; box-shadow: var(--shadow); }
.clue-label { font: 600 .68rem/1 var(--font-body); text-transform: uppercase; letter-spacing: .12em; opacity: .7; }
.clue .number, .clue-big, .clue-sample { font-size: clamp(1.9rem, 4.8vw, 3.2rem); line-height: 1.05; }
.clue-sign { background: var(--yellow); color: var(--yellow-ink); box-shadow: inset 0 0 0 3px var(--yellow-ink), inset 0 0 0 6px var(--yellow), var(--shadow); }
.clue-address { background: #fff; color: #10181a; box-shadow: inset 0 0 0 2px #10181a, var(--shadow); }
.clue-address .num-rest { opacity: .45; }
.clue-plate { background: var(--surface-2); color: var(--ink); align-items: flex-start; box-shadow: none; border: 1px solid var(--line); }
.clue-text { background: var(--accent); color: #fff; box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px var(--accent), var(--shadow); }
.clue-text .clue-label { opacity: .85; }
.clue-sample { font-family: var(--font-display); font-weight: 700; letter-spacing: .01em; white-space: normal; text-wrap: balance; }
.clue-chars { font: 600 1rem/1.2 var(--font-mono); opacity: .85; letter-spacing: .06em; }
.clue-billboard { background: #fff; color: #10181a; box-shadow: inset 0 0 0 2px #10181a, var(--shadow); }
.clue-billboard .number { font-weight: 700; }
.clue-name { background: var(--surface); border: 1px solid var(--line); box-shadow: none; }
.clue-big { font-family: var(--font-display); font-weight: 800; white-space: normal; text-wrap: balance; }
.clue-muted .clue-big { font-size: clamp(1.4rem, 3vw, 2rem); }
.clue-shape { background: var(--surface); border: 1px solid var(--line); box-shadow: none; align-items: center; }
.shape { width: min(220px, 60vw); height: auto; }
.shape-path { fill: var(--accent); stroke: var(--ink); stroke-width: 1; stroke-linejoin: round; }

/* Kennzeichen */
.plate { display: inline-flex; align-items: stretch; border-radius: 7px; overflow: hidden; background: #fff; color: #111; border: 2.5px solid #222; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.8rem, 4.5vw, 2.9rem); line-height: 1; letter-spacing: .04em; white-space: nowrap; }
.plate-text { display: inline-block; padding: 9px 14px 7px; }
.plate-text .num-rest { opacity: 1; }
.plate-text .num-code { text-decoration-color: var(--yellow-strong); text-decoration-thickness: .12em; }
.plate-band { display: flex; flex-direction: column; justify-content: space-between; align-items: center; width: 1.05em; padding: 5px 0 4px; background: var(--blue); color: #fff; }
.plate-stars { width: .5em; height: .5em; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cg fill='%23ffd700'%3E%3Ccircle cx='12' cy='7' r='.9'/%3E%3Ccircle cx='11.33' cy='9.5' r='.9'/%3E%3Ccircle cx='9.5' cy='11.33' r='.9'/%3E%3Ccircle cx='7' cy='12' r='.9'/%3E%3Ccircle cx='4.5' cy='11.33' r='.9'/%3E%3Ccircle cx='2.67' cy='9.5' r='.9'/%3E%3Ccircle cx='2' cy='7' r='.9'/%3E%3Ccircle cx='2.67' cy='4.5' r='.9'/%3E%3Ccircle cx='4.5' cy='2.67' r='.9'/%3E%3Ccircle cx='7' cy='2' r='.9'/%3E%3Ccircle cx='9.5' cy='2.67' r='.9'/%3E%3Ccircle cx='11.33' cy='4.5' r='.9'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat; }
.plate-cc { font: 700 .34em/1 var(--font-body); letter-spacing: .02em; }
.plate-black { background: #15171a; color: #f5f5f5; border-color: #555; }
.plate-black .plate-text .num-code { text-decoration-color: var(--yellow); }
.plate-at { border-color: #222; box-shadow: inset 0 4px 0 #c8102e, inset 0 -4px 0 #c8102e; }
.plate-at .plate-text { padding-block: 12px 10px; }
.plate-at .plate-band { margin-block: 4px; }
.plate-plain { border-color: #333; }

/* ---------- Startseite ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 28px; align-items: center; padding-block: clamp(16px, 4vw, 40px) 28px; }
.hero-text { display: grid; gap: 12px; }
.hero h1 { font-size: clamp(2.3rem, 5.5vw, 4rem); font-weight: 800; line-height: .98; letter-spacing: -.02em; }
.today { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.today-main { display: flex; align-items: center; gap: 14px; }
.today-num { margin: 0; font: 800 2.4rem/1 var(--font-display); }
.today-num span { font-size: 1.2rem; color: var(--muted); font-weight: 600; }
.today-label { margin: 2px 0 0; font-size: .85rem; color: var(--muted); }
.today-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kpi { display: grid; gap: 2px; background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.kpi strong { font: 800 1.4rem/1 var(--font-display); }
.kpi span { font-size: .78rem; color: var(--muted); }
.today-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cat-card { position: relative; display: grid; gap: 8px; align-content: start; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
.cat-head { display: flex; justify-content: space-between; align-items: center; }
.cat-ico { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); padding: 9px; }
.cat-card h3 { font-size: 1.45rem; font-weight: 700; }
.cat-blurb { margin: 0; font-size: .9rem; color: var(--muted); }
.cat-meta { margin: 0; font-size: .8rem; color: var(--muted); }
.cat-card .badge { justify-self: start; }

.world-section { margin-top: 8px; }
.cats-section { margin-top: 32px; }
.world-map .region.is-coverage { fill: color-mix(in srgb, var(--accent) 38%, var(--land-dim)); cursor: default; }
.legend-dot.legend-dot-dim { background: color-mix(in srgb, var(--accent) 38%, var(--land-dim)); margin-left: 10px; }
.world-card { position: relative; background: var(--ocean); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.world-map .map { display: block; width: 100%; height: auto; }
.world-map .region { fill: var(--land-dim); stroke: var(--map-edge); stroke-width: .6; }
.world-map .region.is-trainable { fill: var(--accent); cursor: pointer; transition: fill .15s; }
.world-map .region.is-trainable:hover { fill: var(--yellow); }
.world-legend { position: absolute; left: 16px; bottom: 14px; display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); background: var(--surface); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); }
.home-note { color: var(--muted); font-size: .85rem; margin-top: 20px; }

/* ---------- Kategorie / Land ---------- */
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.deck-card { display: grid; grid-template-rows: auto 1fr auto; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-width: 0; }
.deck-sample { pointer-events: none; }
.deck-sample .clue { padding: 10px 14px 8px; box-shadow: none; }
.deck-sample .clue-sign { box-shadow: inset 0 0 0 2px var(--yellow-ink), inset 0 0 0 4px var(--yellow); }
.deck-sample .clue .number, .deck-sample .clue-big, .deck-sample .clue-sample { font-size: 1.5rem; }
.deck-sample .clue-label { display: none; }
.deck-sample .plate { font-size: 1.4rem; border-width: 2px; }
.deck-sample .shape { width: 70px; }
.deck-sample .clue-shape { padding: 6px; }
.deck-body { display: grid; gap: 6px; min-width: 0; align-content: start; }
.deck-body h3 { font-size: 1.5rem; font-weight: 700; }
.deck-body h3 .badge { margin-left: 8px; }
.deck-desc, .deck-meta, .deck-progress { margin: 0; font-size: .86rem; color: var(--muted); }
.deck-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; }
.facts div { display: grid; }
.facts dt { font: 600 .68rem/1.2 var(--font-body); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }

/* ---------- Trainer ---------- */
.quiz-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding-block: 4px 16px; }
.quiz-heading { text-align: center; }
.quiz-heading h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 800; line-height: 1; }
.quiz-bar .seg { justify-self: end; }
.stage { display: grid; gap: 14px; }
.prompt-panel { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 20px; align-items: center; }
.prompt-side { display: grid; gap: 10px; min-width: 0; justify-items: start; }
.prompt-side > .round-progress, .prompt-side > .learn-list, .prompt-side > .choices { justify-self: stretch; width: 100%; }
.prompt-text { margin: 0; font: 700 1.2rem/1.3 var(--font-display); text-wrap: balance; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-choice { font-size: 1.1rem; padding: 12px 18px; }
.round-progress { display: flex; align-items: center; gap: 12px; }
.round-progress .meter { flex: 1; }
.round-count { font: 600 .85rem/1 var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.round-picker { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); }
.round-picker > span { margin-right: 4px; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; font-size: .7rem; }

.map-wrap { position: relative; }
.map-frame { position: relative; background: var(--ocean); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; touch-action: none; min-height: 280px; }
.map-slot .map { display: block; width: 100%; height: auto; max-height: calc(100vh - 280px); min-height: 280px; cursor: grab; }
.map-slot .map:active { cursor: grabbing; }
.map-loading { position: absolute; inset: 0; display: none; place-items: center; color: var(--muted); font-weight: 600; background: color-mix(in srgb, var(--ocean) 70%, transparent); }
.map-frame.is-loading .map-loading { display: grid; }
.map-slot .region { fill: var(--land); stroke: var(--map-edge); stroke-width: 1.2; transition: fill .15s; }
.map-slot .region.is-active { cursor: pointer; }
.map-slot .region.is-active:hover { fill: var(--land-hover); }
.region:focus { outline: none; }
.region:focus-visible { stroke: var(--ink); stroke-width: 2.5; }
.map-slot .region.is-selected { fill: var(--yellow); }
.map-slot .region.is-correct { fill: var(--ok); }
.map-slot .region.is-wrong { fill: var(--bad); }
.map-slot .region.is-reveal { fill: var(--ok); animation: reveal 1s ease-in-out 3; }
.map-slot .region.is-opt-L { fill: var(--left); }
.map-slot .region.is-opt-R { fill: var(--accent); }
@keyframes reveal { 50% { fill: var(--yellow); } }
.map-tip { position: absolute; pointer-events: none; z-index: 3; transform: translate(-50%, calc(-100% - 12px)); background: var(--ink); color: var(--surface); font: 600 .82rem/1 var(--font-body); padding: 7px 10px; border-radius: 8px; white-space: nowrap; }
.map-tools { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; gap: 6px; z-index: 2; }
.tool { width: 36px; height: 36px; border-radius: 10px; cursor: pointer; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; box-shadow: var(--shadow); padding: 0; }
.tool .ico { width: 20px; height: 20px; }
.tool:hover { border-color: var(--ink); }

.feedback { display: flex; align-items: flex-start; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; min-width: 0; animation: rise .2s ease-out; }
.feedback.is-ok { border-color: var(--ok); }
.feedback.is-bad { border-color: var(--bad); }
.fb-icon { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.fb-icon .ico { width: 22px; height: 22px; }
.fb-icon svg { stroke-width: 3; }
.is-ok .fb-icon { background: var(--ok); }
.is-bad .fb-icon { background: var(--bad); }
.fb-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.fb-title { margin: 0; font: 700 1.1rem/1.3 var(--font-display); }
.fb-code { font-family: var(--font-mono); font-size: .9em; background: var(--yellow); color: var(--yellow-ink); padding: 1px 6px; border-radius: 5px; }
.fb-sub { margin: 0; font-size: .9rem; color: var(--muted); }
.fb-codes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; font-size: .82rem; color: var(--muted); }
.fb-next { flex: none; align-self: center; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }

.scoreline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: .88rem; color: var(--muted); }
.score strong { font: 700 1rem/1 var(--font-mono); color: var(--ink); margin-left: 4px; font-variant-numeric: tabular-nums; }
.score-ok strong { color: var(--ok); }
.score-bad strong { color: var(--bad); }
.ctx-label { font-size: .8rem; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); }
.scoreline .toggle { margin-left: auto; }
.is-learn .scoreline .score { visibility: hidden; }

.round-end { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 16px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(3px); border-radius: 18px; }
.round-card { width: min(100%, 480px); max-height: 100%; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 24px; display: grid; gap: 10px; text-align: center; }
.big-score { margin: 0; font: 800 4rem/1 var(--font-display); letter-spacing: -.03em; }
.round-summary { margin: 0; color: var(--muted); font-size: .92rem; }
.mistake-list { text-align: left; border-top: 1px solid var(--line); padding-top: 12px; }
.list-title { margin: 0 0 8px; font-weight: 700; font-size: .85rem; }
.mistake-list ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 12px; font-size: .88rem; }
.mistake-list li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.round-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.empty-box { grid-column: 1 / -1; display: grid; gap: 10px; justify-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.empty-box h2 { font-size: 1.6rem; }
.empty-box p { margin: 0; color: var(--muted); }

.learn-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 260px; overflow: auto; padding-right: 4px; }
.learn-row { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; width: 100%; text-align: left; cursor: pointer; border: 1px solid transparent; background: transparent; border-radius: 10px; padding: 6px 8px; }
.learn-row:hover { background: var(--surface); border-color: var(--line); }
.learn-answer { font-weight: 600; min-width: 0; }
.learn-note { grid-column: 2; font-size: .82rem; color: var(--muted); }

/* ---------- Länder-Steckbriefe ---------- */
.ref-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-bottom: 18px; }
.ref-controls input[type="search"] { font: inherit; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); min-width: min(100%, 260px); }
.ref-count { margin: 0; margin-left: auto; font-size: .85rem; color: var(--muted); }
.ref-grid { display: grid; gap: 14px; }
.ref-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.ref-card { display: grid; gap: 10px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; min-width: 0; }
.ref-card.is-dim { opacity: .7; }
.ref-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ref-head h3 { font-size: 1.3rem; font-weight: 700; }
.ref-iso { font: 600 .72rem/1 var(--font-mono); color: var(--muted); padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; }
.ref-head .badge { margin-left: auto; }
.ref-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.ref-facts div { display: grid; min-width: 0; }
.ref-facts .wide { grid-column: 1 / -1; }
.ref-facts dt { font: 600 .66rem/1.2 var(--font-body); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.ref-facts dd { margin: 0; font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; }
.ref-links { display: flex; flex-wrap: wrap; gap: 6px; }
.ref-none { font-size: .8rem; color: var(--muted); align-self: center; }

/* ---------- Statistik ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi-card { display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.kpi-card strong { font: 800 2rem/1 var(--font-display); }
.kpi-card span { font-size: .82rem; color: var(--muted); }
.stats-block { margin-top: 28px; display: grid; gap: 10px; justify-items: start; }
.stats-block h2 { font-size: 1.6rem; font-weight: 700; }
.stats-block p { margin: 0; }
.heat { display: grid; grid-template-rows: repeat(7, 14px); grid-auto-flow: column; grid-auto-columns: 14px; gap: 3px; }
.heat-cell { width: 14px; height: 14px; border-radius: 3px; background: color-mix(in srgb, var(--ok) calc(var(--v) * 100%), var(--land-dim)); }
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.table th { font: 600 .7rem/1.2 var(--font-body); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.table tr:last-child td { border-bottom: 0; }
.num-ok { color: var(--ok); font-weight: 700; }
.num-bad { color: var(--bad); font-weight: 700; }
.weak-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; width: 100%; }
.weak-list li { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.weak-answer { font-weight: 600; }
.weak-meta { grid-column: 2; font-size: .8rem; color: var(--muted); }
.transfer { display: grid; gap: 10px; width: min(100%, 560px); justify-items: start; }
.transfer textarea { width: 100%; font: 500 .8rem/1.4 var(--font-mono); padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); resize: vertical; }
.settings { display: grid; grid-template-columns: auto auto; gap: 10px 14px; align-items: center; }
.settings input { font: inherit; width: 90px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.settings .btn { grid-column: 1 / -1; justify-self: start; }

/* ---------- Mobil ---------- */
@media (max-width: 960px) {
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .site-bar { gap: 8px; }
  .brand-tag { display: none; }
  .site-nav { width: 100%; overflow-x: auto; }
  .quiz-bar { grid-template-columns: 1fr auto; }
  .quiz-heading { grid-column: 1 / -1; grid-row: 2; text-align: left; }
  .prompt-panel { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .clue .number, .clue-big, .clue-sample { font-size: clamp(1.6rem, 8vw, 2.4rem); }
  .plate { font-size: clamp(1.5rem, 7vw, 2.2rem); }
  .feedback { flex-wrap: wrap; }
  .fb-next { width: 100%; justify-content: center; }
  .scoreline .toggle { margin-left: 0; }
  .world-legend { position: static; margin: 0 12px 12px; width: fit-content; }
  .ref-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .cat-grid { grid-template-columns: minmax(0, 1fr); }
  .today-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Bewegung ---------- */
/* Karten zeichnen sich selbst: Umrisse laufen nach, Flächen blenden ein */
.map.is-drawing .region { stroke-dasharray: 1; stroke-dashoffset: 1; fill-opacity: 0; animation: draw 1.1s ease-out forwards; animation-delay: calc(var(--i, 0) * 4ms); }
@keyframes draw { 0% { stroke-dashoffset: 1; fill-opacity: 0; } 55% { stroke-dashoffset: 0; fill-opacity: 0; } 100% { stroke-dashoffset: 0; fill-opacity: 1; } }

/* Pins fallen auf die Region */
.pin { pointer-events: none; }
.pin-inner { transform-box: fill-box; transform-origin: 50% 100%; }
.pin-body { animation: pin-drop .55s cubic-bezier(.22, 1.4, .36, 1) both; transform-box: fill-box; transform-origin: 50% 100%; }
.pin-shape { fill: var(--ok); stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }
.pin-hole { fill: #fff; }
.pin-ripple { fill: none; stroke: var(--ok); stroke-width: 1.2; transform-box: fill-box; transform-origin: center; animation: ripple .9s ease-out .1s both; }
.pin-bad .pin-ripple { stroke: var(--bad); }
.pin-dot { fill: var(--bad); stroke: #fff; stroke-width: 1.4; animation: pin-pop .4s cubic-bezier(.22, 1.4, .36, 1) both; transform-box: fill-box; transform-origin: center; }
.pin-x { stroke: #fff; stroke-width: 1.8; stroke-linecap: round; animation: pin-pop .4s cubic-bezier(.22, 1.4, .36, 1) both; transform-box: fill-box; transform-origin: center; }
@keyframes pin-drop { 0% { transform: translateY(-28px) scale(.6); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; opacity: 1; } }
@keyframes pin-pop { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes ripple { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }

/* Falsch angeklickte Fläche zuckt kurz */
.map-slot .region.is-wrong { animation: shake .4s ease-in-out; transform-box: fill-box; transform-origin: center; }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }

/* Schilder schwingen herein */
.prompt-panel > .clue { animation: sign-in .5s cubic-bezier(.2, .8, .2, 1) both; transform-origin: 50% 0; }
@keyframes sign-in { 0% { opacity: 0; transform: perspective(700px) rotateX(-22deg) translateY(10px); } 100% { opacity: 1; transform: none; } }
.round-card { animation: card-in .35s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes card-in { 0% { opacity: 0; transform: scale(.94) translateY(8px); } 100% { opacity: 1; transform: none; } }

/* Zähler springen */
.score strong.pop { animation: pop .35s cubic-bezier(.22, 1.4, .36, 1); display: inline-block; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }

/* Startseite: Wörter und Kacheln kommen gestaffelt */
.hero h1 .w { display: inline-block; animation: word-in .6s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes word-in { 0% { opacity: 0; transform: translateY(.5em); } 100% { opacity: 1; transform: none; } }
.cat-card { animation: rise-in .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(120ms + var(--i, 0) * 55ms); }
.today { animation: rise-in .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: .2s; }
@keyframes rise-in { 0% { opacity: 0; transform: translateY(14px); } 100% { opacity: 1; transform: none; } }
.ring-fg { animation: ring-in 1s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes ring-in { from { stroke-dashoffset: var(--c, 300); } }
.cat-card:hover .cat-sample .clue { transform: rotate(-1.5deg) scale(1.03); }
.cat-sample .clue { transition: transform .25s cubic-bezier(.2, .8, .2, 1); }

/* Kategorie-Kacheln: Mini-Schilder */
.cat-sample { display: flex; align-items: center; min-height: 64px; pointer-events: none; }
.cat-sample .clue { padding: 8px 12px 6px; box-shadow: none; gap: 2px; }
.cat-sample .clue-label { display: none; }
.cat-sample .clue .number, .cat-sample .clue-big, .cat-sample .clue-sample { font-size: 1.35rem; }
.cat-sample .clue-sign { box-shadow: inset 0 0 0 2px var(--yellow-ink), inset 0 0 0 4px var(--yellow); }
.cat-sample .clue-address, .cat-sample .clue-billboard { box-shadow: inset 0 0 0 2px #10181a; }
.cat-sample .clue-text { box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px var(--accent); }
.cat-sample .clue-chars { display: none; }
.cat-sample .plate { font-size: 1.3rem; border-width: 2px; }
.cat-sample .clue-plate { background: transparent; border: 0; padding: 0; }
.cat-sample .shape { width: 56px; }
.cat-sample .clue-shape { padding: 4px 8px; }
.cat-sample .clue-name { background: var(--accent); color: #fff; border: 0; box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 4px var(--accent); }
.cat-sample .clue-name .clue-big { font-size: 1.2rem; }
.clue-roundsign { padding: 0; box-shadow: none; background: transparent; }
.roundsign { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--blue); color: #fff; font: 800 1.6rem/1 var(--font-display); box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px var(--blue), 0 0 0 2px #10181a; }
.roundsign.is-left { background: var(--left); box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px var(--left), 0 0 0 2px #10181a; }

/* Empfehlungen */
.recs { margin-top: 32px; }
.rec-tag { display: inline-flex; align-items: baseline; gap: 8px; justify-self: start; font: 700 .68rem/1 var(--font-body); text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.rec-tag em { font: 500 .78rem/1 var(--font-body); text-transform: none; letter-spacing: 0; color: var(--muted); }
.recs .deck-card { grid-template-rows: auto auto 1fr auto; }

@media (prefers-reduced-motion: reduce) {
  .map.is-drawing .region { animation: none; stroke-dashoffset: 0; fill-opacity: 1; }
}

/* ---------- Konto ---------- */
.nav-account { border: 1px solid var(--line); }
.nav-account.is-signed-in { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 16px; align-items: start; }
.auth-card { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; }
.auth-card h2 { font-size: 1.6rem; font-weight: 700; }
.auth-card p { margin: 0; }
.auth-aside { display: grid; gap: 8px; background: var(--surface-2); border-radius: 16px; padding: 20px; }
.auth-aside h3 { font-size: 1.2rem; font-weight: 700; }
.auth-aside ul { margin: 0; padding-left: 18px; font-size: .92rem; }
.auth-aside p { margin: 0; font-size: .85rem; }
.auth-form { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; }
.field label { font: 600 .74rem/1.2 var(--font-body); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.field input { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.field input:focus { border-color: var(--accent); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.link-btn { background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); font-size: .85rem; text-decoration: underline; justify-self: start; }
.form-msg { margin: 0; font-size: .9rem; color: var(--muted); min-height: 1.3em; }
.form-msg.ok { color: var(--ok); }
.form-msg.bad { color: var(--bad); }
.account-page .stats-block { margin-top: 24px; }
@media (max-width: 760px) { .auth-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Merkhilfen ---------- */
.tips { display: grid; gap: 8px; background: var(--accent-soft); color: var(--ink); border-radius: 14px; padding: 14px 16px; }
.tips-title { margin: 0; display: flex; align-items: center; gap: 8px; font: 700 .95rem/1.2 var(--font-display); color: var(--accent); }
.tips ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: .92rem; }
.tips-box { animation: rise-in .3s cubic-bezier(.2, .8, .2, 1) both; }
.chip-tips { display: inline-flex; align-items: center; gap: 5px; }
.chip-tips .ico { width: 1em; height: 1em; }
.deck-tips { font-size: .86rem; }
.deck-tips summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent); list-style: none; }
.deck-tips summary::-webkit-details-marker { display: none; }
.deck-tips ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 3px; color: var(--muted); }

/* ---------- Schwierigkeit & Kennzeichen-Designs ---------- */
.level { display: inline-flex; align-items: center; gap: 8px; }
.level-label { font: 600 .7rem/1 var(--font-body); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.seg-sm { padding: 5px 10px; font-size: .8rem; }
.scoreline .level { margin-left: auto; }
.clue-design { background: var(--surface-2); border: 1px solid var(--line); box-shadow: none; }
.plate-design { display: block; width: min(300px, 70vw); }
.plate-design svg { display: block; width: 100%; height: auto; border-radius: 12px; }
/* Street-View-Unschärfe: Mittel macht Schriftzüge unlesbar, Schwer lässt nur noch Farben und Aufteilung erkennen */
.trainer[data-level="mittel"] .clue-design .plate-design svg { filter: blur(4.5px); }
.trainer[data-level="schwer"] .clue-design .plate-design svg { filter: blur(7.5px) saturate(.85); }
.trainer[data-level="leicht"] .clue-design .plate-design svg { filter: none; }
.trainer.is-learn .clue-design .plate-design svg { filter: none; }
.cat-sample .plate-design, .deck-sample .plate-design { width: 120px; }
.cat-sample .clue-design, .deck-sample .clue-design { padding: 4px 8px; }
.learn-list .plate-design { width: 90px; }
.learn-row-design { grid-template-columns: 90px 1fr; }
.learn-row-design .plate-design svg { border-radius: 6px; }

/* Sprachumschalter */
.lang-switch { border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; border-radius: 999px; padding: 7px 12px; font: 600 .82rem/1 var(--font-body); }
.lang-switch:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- Datenschutz ---------- */
.privacy-body { display: grid; gap: 26px; max-width: 72ch; padding-bottom: 12px; }
.privacy-sec { animation: rise .5s both; animation-delay: calc(var(--i) * 40ms); }
.privacy-sec h2 { font: 700 1.35rem/1.1 var(--font-display); margin: 0 0 8px; }
.privacy-sec p { margin: 0 0 10px; line-height: 1.6; }
.privacy-sec a { color: var(--accent); text-underline-offset: 3px; }
.privacy-missing { color: var(--bad); }
@media (prefers-reduced-motion: reduce) { .privacy-sec { animation: none; } }
