/* Globuli – Gestaltung nach Vorbild des Schulatlas:
   kühles Kartenpapier, politische Pastellfarben, Textmarker-Gelb für Markierungen,
   kursive blaue Gewässernamen, Kapitälchen für Ländernamen. */

@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/alegreya-sans-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/alegreya-sans-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/alegreya-sans-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/alegreya-sans-latin-ext-500-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+1E00-1E9F; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/alegreya-sans-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Alegreya Sans'; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/alegreya-sans-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+1E00-1E9F; }
@font-face { font-family: 'Alegreya Sans'; font-style: italic; font-weight: 400; font-display: swap; src: url(../fonts/alegreya-sans-latin-400-italic.woff2) format('woff2'); }
@font-face { font-family: 'Alegreya'; font-style: normal; font-weight: 400 900; font-display: swap; src: url(../fonts/alegreya-latin-wght-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Alegreya'; font-style: normal; font-weight: 400 900; font-display: swap; src: url(../fonts/alegreya-latin-ext-wght-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+1E00-1E9F; }
@font-face { font-family: 'Alegreya'; font-style: italic; font-weight: 400 900; font-display: swap; src: url(../fonts/alegreya-latin-wght-italic.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; }
@font-face { font-family: 'Alegreya'; font-style: italic; font-weight: 400 900; font-display: swap; src: url(../fonts/alegreya-latin-ext-wght-italic.woff2) format('woff2'); unicode-range: U+0100-02BA, U+1E00-1E9F; }

/* ------------------------------------------------------------ Farben */
:root {
  --paper: #eef2ef;
  --paper-2: #e3e9e5;
  --card: #f9fbf9;
  --ink: #1c2a35;
  --ink-2: #455764;
  --ink-3: #74838d;
  --rule: #cfd8d4;
  --rule-strong: #a9b6b2;
  --accent: #1d5c88;
  --accent-ink: #ffffff;
  --accent-soft: #d6e6f1;

  --sea: #bcd8e7;
  --sea-deep: #94bdd5;
  --sea-tint: rgba(45, 108, 150, .10);
  --graticule: rgba(45, 108, 150, .22);
  --hydro: #2a6a95;
  --river: #4b8ec0;
  --lake: #c9e1ee;
  --coast: #6f8a96;
  --border: #8b8578;
  --halo: rgba(249, 251, 249, .88);

  --mc1: #f2e2a0; --mc2: #cfe2ae; --mc3: #f1c6b3; --mc4: #d9cbe7; --mc5: #bfdcd5; --mc6: #f4d29f; --mc7: #e2d1c1;
  --land-dep: #e6e2d6;
  --land-dim: #e3e6e1;
  --land-ice: #f6f9fa;
  --land-unknown: #f5f6f1;
  --range-ink: #8a6f4e;
  --cap: #c0392b;

  --mark: #f4c21f;
  --mark-ink: #7a5d00;
  --on-mark: #1c2a35;   /* Schrift auf --mark, in beiden Modi dunkel */
  --highlight: #f4c21f; /* Textmarker-Strich unter Wörtern in Quizfragen */
  --on-bad: #ffffff;
  --flame: #e0752d;
  --coin: #c99700;
  --ok: #23824f;
  --ok-fill: #9ad3a9;
  --ok-soft: #dcf0e2;
  --bad: #c0373a;
  --bad-fill: #efa7a2;
  --bad-soft: #f7dcda;

  --radius: 4px;
  --radius-sm: 2px;     /* nur für sehr kleine Elemente (Mini-Flaggen, Balken) */
  --shadow: 0 1px 0 rgba(28, 42, 53, .05), 0 6px 18px -10px rgba(28, 42, 53, .25);
  --font: 'Alegreya Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --serif: 'Alegreya', Georgia, 'Times New Roman', serif;
  --nav-h: 62px;
  --top-h: 54px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

/* Nachtkarte */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1a22; --paper-2: #15242f; --card: #182936; --ink: #e6edf1; --ink-2: #a8b9c4; --ink-3: #7a8d99;
    --rule: #2a3d4a; --rule-strong: #3e5464; --accent: #6fb3e0; --accent-ink: #0d1a24; --accent-soft: #1f3a50;
    --sea: #173247; --sea-deep: #0f2536; --sea-tint: rgba(127, 182, 218, .10); --graticule: rgba(127, 182, 218, .14);
    --hydro: #86bde0; --river: #5ea3d1; --lake: #1d3d55; --coast: #5c7787; --border: #8b9aa3; --halo: rgba(15, 26, 34, .85);
    --mc1: #5d5838; --mc2: #44573a; --mc3: #5c4441; --mc4: #4b4561; --mc5: #3a5552; --mc6: #5f4d35; --mc7: #50473f;
    --land-dep: #2b3236; --land-dim: #222d33; --land-ice: #2c3a42; --land-unknown: #233038; --range-ink: #c4a37c; --cap: #f07167;
    --mark: #ffd93b; --mark-ink: #ffe680; --highlight: #2f5f93; --ok: #4cc38a; --ok-fill: #2f7a54; --ok-soft: #173a2a; --bad: #f07373; --bad-fill: #8c3434; --bad-soft: #3d1d20;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 24px -14px rgba(0, 0, 0, .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1a22; --paper-2: #15242f; --card: #182936; --ink: #e6edf1; --ink-2: #a8b9c4; --ink-3: #7a8d99;
  --rule: #2a3d4a; --rule-strong: #3e5464; --accent: #6fb3e0; --accent-ink: #0d1a24; --accent-soft: #1f3a50;
  --sea: #173247; --sea-deep: #0f2536; --sea-tint: rgba(127, 182, 218, .10); --graticule: rgba(127, 182, 218, .14);
  --hydro: #86bde0; --river: #5ea3d1; --lake: #1d3d55; --coast: #5c7787; --border: #8b9aa3; --halo: rgba(15, 26, 34, .85);
  --mc1: #5d5838; --mc2: #44573a; --mc3: #5c4441; --mc4: #4b4561; --mc5: #3a5552; --mc6: #5f4d35; --mc7: #50473f;
  --land-dep: #2b3236; --land-dim: #222d33; --land-ice: #2c3a42; --land-unknown: #233038; --range-ink: #c4a37c; --cap: #f07167;
  --mark: #ffd93b; --mark-ink: #ffe680; --highlight: #2f5f93; --ok: #4cc38a; --ok-fill: #2f7a54; --ok-soft: #173a2a; --bad: #f07373; --bad-fill: #8c3434; --bad-soft: #3d1d20;
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 24px -14px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ------------------------------------------------------------ Grundlagen */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.45 var(--font); font-feature-settings: 'lnum' 1;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { margin: 0; line-height: 1.15; }
h1 { font-family: var(--serif); font-weight: 700; font-size: 2rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: var(--radius); }
[hidden] { display: none !important; }
.icon { display: inline-flex; width: 1.25em; height: 1.25em; flex: none; }
.icon svg { width: 100%; height: 100%; }
.icon.inline { width: 1em; height: 1em; vertical-align: -.15em; }
.hint { color: var(--ink-3); font-size: .9rem; }
.lead { color: var(--ink-2); font-size: 1.05rem; max-width: 60ch; }
.note { color: var(--ink-3); font-size: .9rem; }

/* ------------------------------------------------------------ Rahmen */
#app { min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--top-h);
  display: flex; align-items: center; gap: 10px; padding: 0 14px 0 16px;
  background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand-word { font-family: var(--serif); font-weight: 800; font-size: 1.35rem; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; flex: none; display: block; }
.topbar-streak { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--ink); font-weight: 700; padding: 6px 10px; border-radius: var(--radius); border: 1px solid var(--rule); }
.topbar-streak .icon { color: var(--flame); }
.topbar-coins { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; color: var(--ink); font-weight: 700; padding: 6px 10px; border-radius: var(--radius); border: 1px solid var(--rule); font-variant-numeric: tabular-nums; }
.topbar-coins .icon, .icon.coin-big, .wallet-coin, .factor-hint .icon { color: var(--coin); }
.icon.coin-big { width: 34px; height: 34px; }
.prog-item { color: var(--ink); text-decoration: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: var(--radius);
  border: 1px solid var(--rule); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { border-color: var(--rule-strong); }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--card); border-top: 1px solid var(--rule);
}
.nav .brand, .nav .nav-foot { display: none; }
.nav-list { list-style: none; margin: 0; padding: 0 4px; display: flex; height: 100%; }
.nav-list li { flex: 1; }
.nav-list li.wide-only { display: none; }
.nav-link {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 100%;
  text-decoration: none; color: var(--ink-3); font-size: .78rem; font-weight: 500;
}
.nav-link .icon { width: 24px; height: 24px; }
.nav-link.active { color: var(--ink); }
.nav-link.active .icon { color: var(--accent); }
.nav-link.active .nav-label { font-weight: 700; }
main { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 24px); outline: none; }

body.focus-mode .topbar, body.focus-mode .nav { display: none; }
/* Im Quiz kein Neuladen durch Wischen nach unten (Chrome/Android); die Runde übersteht es aber auch */
html:has(> body.focus-mode), body.focus-mode { overscroll-behavior-y: none; }
body.focus-mode main { padding: 0; }
body.map-full main { padding: 0; height: calc(100dvh - var(--top-h) - var(--nav-h) - var(--safe-b)); overflow: hidden; }

@media (min-width: 900px) {
  body { font-size: 17px; }
  #app { display: grid; grid-template-columns: 228px 1fr; }
  .topbar { display: none; }
  .nav {
    position: sticky; top: 0; height: 100dvh; padding: 22px 14px; border-top: 0; border-right: 1px solid var(--rule);
    display: flex; flex-direction: column; gap: 26px; background: var(--paper);
  }
  .nav .brand { display: inline-flex; padding: 0 10px; }
  .nav .nav-foot { display: block; margin-top: auto; }
  .nav-list { flex-direction: column; height: auto; gap: 2px; padding: 0; }
  .nav-list li.wide-only { display: block; }
  .nav-link { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: var(--radius); font-size: 1rem; height: auto; color: var(--ink-2); }
  .nav-link:hover { background: var(--paper-2); color: var(--ink); }
  .nav-link.active { background: var(--card); box-shadow: inset 0 0 0 1px var(--rule); }
  .nav-user { display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-decoration: none; color: var(--ink-2); border-radius: var(--radius); }
  .nav-user:hover { background: var(--paper-2); }
  main { padding-bottom: 48px; min-width: 0; }
  body.map-full main { height: 100dvh; }
  body.focus-mode #app { grid-template-columns: 1fr; }
  body.focus-mode .nav { display: none; }
}

.view { padding: 20px 16px 8px; max-width: 1180px; margin: 0 auto; }
.view.narrow, .narrow > .view { max-width: 640px; }
.view-head { margin: 8px 0 18px; display: grid; gap: 6px; }
@media (min-width: 900px) { .view { padding: 36px 40px 8px; } .view-head h1 { font-size: 2.6rem; } }

.loading { min-height: 50vh; display: grid; place-items: center; align-content: center; gap: 14px; color: var(--ink-3); }
.compass {
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--ink-3); position: relative;
}
.compass::before { content: ''; position: absolute; left: 50%; top: 50%; width: 4px; height: 36px; margin: -18px 0 0 -2px;
  background: linear-gradient(var(--cap) 50%, var(--ink-3) 50%); border-radius: 2px; animation: needle 1.6s ease-in-out infinite; }
@keyframes needle { 0%, 100% { transform: rotate(-30deg); } 50% { transform: rotate(40deg); } }

/* ------------------------------------------------------------ Bausteine */
.card {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 18px; display: grid; gap: 12px; align-content: start;
}
.card-title { font-size: 1.05rem; font-weight: 700; }
.card-sub { color: var(--ink-2); font-size: .95rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border: 1px solid var(--rule-strong); border-radius: var(--radius); background: var(--card); color: var(--ink);
  font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--paper-2); }
.btn.bad { color: var(--bad); border-color: var(--bad); }
.btn.big { min-height: 54px; font-size: 1.05rem; padding: 0 24px; }
.btn .icon { width: 1.15em; height: 1.15em; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: var(--radius);
  border: 1px solid var(--rule); background: var(--card); cursor: pointer; font-size: .95rem; text-decoration: none; color: var(--ink);
}
.chip:hover { border-color: var(--rule-strong); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip-extra { color: var(--ink-3); font-size: .85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-flag { width: 20px; height: 15px; object-fit: cover; border-radius: var(--radius-sm); box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); flex: none; }

.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: var(--radius);
  border: 1px solid var(--rule); background: var(--card); cursor: pointer; font-weight: 500;
}
.segmented label:hover { border-color: var(--rule-strong); }
.segmented input:checked + label { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 700; }
.segmented input:focus-visible + label { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Maßstabsleiste */
.scalebar { display: grid; gap: 6px; }
.scalebar-track { display: flex; height: 10px; border: 1.5px solid var(--ink); }
.sb-seg { flex: 1; position: relative; background: var(--card); }
.sb-seg + .sb-seg { border-left: 1.5px solid var(--ink); }
.sb-seg i { position: absolute; inset: 0 auto 0 0; background: var(--ink); }
.sb-seg.odd i { background: var(--accent); }
.scalebar-label { font-size: .88rem; color: var(--ink-2); }

/* Kartografische Legende */
.legend-sym { display: inline-flex; width: 28px; height: 28px; flex: none; }
.legend-sym svg { width: 100%; height: 100%; }
.legend-sym .f-mc1 { fill: var(--mc1); } .legend-sym .f-mc2 { fill: var(--mc2); } .legend-sym .f-mc3 { fill: var(--mc3); }
.legend-sym .f-mc4 { fill: var(--mc4); } .legend-sym .f-mc5 { fill: var(--mc5); } .legend-sym .f-mc6 { fill: var(--mc6); }
.legend-sym .f-cap { fill: var(--cap); } .legend-sym .f-paper { fill: var(--card); } .legend-sym .f-ink { fill: var(--ink); } .legend-sym .f-mark { fill: var(--mark); }
.legend-sym .s-ink { stroke: var(--ink); stroke-width: 1.5; } .legend-sym .s-ink-bold { stroke: var(--ink); stroke-width: 2.2; }
.legend-sym .s-ink-thin { stroke: var(--ink-3); stroke-width: 1; } .legend-sym .s-ink-dash { stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 3 2.2; }
.legend-sym .s-border { stroke: var(--border); stroke-width: 1.2; stroke-dasharray: 3 2; }
.legend-sym .s-river { stroke: var(--river); stroke-width: 2; } .legend-sym .s-hydro { stroke: var(--hydro); stroke-width: 1.6; }
.legend-sym rect.f-mc2 { stroke: var(--ink); stroke-width: 1.2; }

.legend-list { list-style: none; margin: 0; padding: 0; }
.legend-list li + li { border-top: 1px solid var(--rule); }
.legend-list a, .legend-list label {
  display: grid; grid-template-columns: 28px 1fr auto; grid-template-areas: 'sym name meter' 'sym desc meter'; column-gap: 14px; row-gap: 0;
  align-items: center; padding: 11px 4px; text-decoration: none; color: var(--ink); cursor: pointer; border-radius: var(--radius);
}
.legend-list a:hover, .legend-list label:hover { background: var(--paper-2); }
.legend-list .legend-sym { grid-area: sym; }
.l-name { grid-area: name; font-weight: 700; }
.l-desc { grid-area: desc; color: var(--ink-3); font-size: .9rem; line-height: 1.3; }
.l-meter { grid-area: meter; width: 56px; height: 6px; background: var(--paper-2); border-radius: var(--radius-sm); overflow: hidden; }
.l-meter i { display: block; height: 100%; background: var(--ok); }
.legend-list.selectable input { position: absolute; opacity: 0; pointer-events: none; }
.legend-list.selectable input:checked + label { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.legend-list.selectable input:focus-visible + label { outline: 3px solid var(--accent); }
.legend-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; text-decoration: none; }

/* ------------------------------------------------------------ Start */
.home { display: grid; gap: 22px; padding-top: 18px; }
.hero { display: grid; gap: 10px; justify-items: center; text-align: center; padding: 6px 0 4px; position: relative; }
.hero-text { display: grid; gap: 6px; justify-items: center; }
.hero-greet { color: var(--ink-2); font-size: 1.05rem; }
.hero-title { font-size: clamp(2.6rem, 11vw, 4.2rem); line-height: .95; font-weight: 800; letter-spacing: -.02em; }
.hero-sub { color: var(--ink-2); max-width: 34ch; }
.hero-sub2 { display: block; color: var(--ink-3); font-size: .92rem; }
.hero-globe { width: min(74vw, 360px); aspect-ratio: 1; margin: 6px auto 0; touch-action: none; cursor: grab; }
.hero-globe:active { cursor: grabbing; }
.globe-canvas { display: block; margin: 0 auto; filter: drop-shadow(0 18px 24px rgba(28, 42, 53, .18)); }
.globe-legend { display: flex; justify-content: center; gap: 16px; font-size: .88rem; color: var(--ink-2); flex-wrap: wrap; }
.globe-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 14px; border-radius: var(--radius-sm); display: inline-block; border: 1px solid var(--coast); }
.sw.m2 { background: linear-gradient(135deg, var(--mc2) 50%, var(--mc3) 50%); }
.sw.m1 { background: linear-gradient(135deg, color-mix(in srgb, var(--mc2) 55%, var(--land-unknown)) 50%, color-mix(in srgb, var(--mc3) 55%, var(--land-unknown)) 50%); }
.sw.m0 { background: var(--land-unknown); }
.home-cards { display: grid; gap: 14px; }
.daily { border-color: var(--ink); box-shadow: 4px 4px 0 var(--mark); }
.daily-head { display: flex; gap: 12px; align-items: center; }
.daily-head .legend-sym { width: 40px; height: 40px; }
.daily-text { color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.daily-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.countdown { color: var(--ink-3); font-size: .9rem; }
.progress-card .prog-row { display: flex; gap: 18px; flex-wrap: wrap; }
.prog-item { display: flex; align-items: center; gap: 10px; }
.prog-item .big { display: block; font-family: var(--serif); font-size: 1.45rem; font-weight: 700; line-height: 1.05; }
.prog-item .small { display: block; color: var(--ink-3); font-size: .85rem; }
.icon.flame { width: 34px; height: 34px; color: var(--flame); }
.level-badge {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  font-family: var(--serif); font-weight: 800; font-size: 1.2rem; color: var(--on-mark);
  background: var(--mark); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.level-badge.big { width: 64px; height: 64px; font-size: 2rem; }
.repeat-card { grid-template-columns: 28px 1fr auto; align-items: center; text-decoration: none; color: var(--ink); }
.repeat-card:hover { border-color: var(--rule-strong); }
.repeat-card.has-due { border-color: var(--accent); }
.repeat-card .chev { color: var(--ink-3); }
.guest-card { justify-items: start; }

@media (min-width: 900px) {
  .home { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; gap: 40px; }
  .hero { position: sticky; top: 24px; justify-items: start; text-align: left; padding-top: 20px; }
  .hero-text { justify-items: start; }
  .hero-title { font-size: 5rem; }
  .hero-globe { width: min(40vw, 500px); margin: 10px 0 0; }
  .globe-legend { justify-content: flex-start; }
}

/* ------------------------------------------------------------ Karte */
.map { position: relative; width: 100%; height: 100%; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; background: var(--paper-2); }
.map-svg { display: block; width: 100%; height: 100%; }
.map-bg { fill: var(--sea-deep); }
.map.is-globe .map-bg { fill: var(--paper); }
.ocean-stop-1 { stop-color: var(--sea); }
.ocean-stop-2 { stop-color: var(--sea-deep); }
.g-map path { vector-effect: non-scaling-stroke; }
.sphere { fill: url(#oceanGrad); }
.sphere-outline { fill: none; stroke: var(--coast); stroke-width: 1; pointer-events: none; }
.graticule { fill: none; stroke: var(--graticule); stroke-width: .6; pointer-events: none; }
.country { stroke: var(--coast); stroke-width: .5; stroke-linejoin: round; }
.country.mc1 { fill: var(--mc1); } .country.mc2 { fill: var(--mc2); } .country.mc3 { fill: var(--mc3); } .country.mc4 { fill: var(--mc4); }
.country.mc5 { fill: var(--mc5); } .country.mc6 { fill: var(--mc6); } .country.mc7 { fill: var(--mc7); }
.country.dep { fill: var(--land-dep); }
.country.antarctica { fill: var(--land-ice); }
.country.disputed { fill: url(#hatch); }
.hatch-line { stroke: var(--rule-strong); stroke-width: 1.4; }
.country.dim { fill: var(--land-dim); }
.borders { fill: none; stroke: var(--border); stroke-width: .9; stroke-linejoin: round; pointer-events: none; }
.mode-atlas .country, .map[data-clickable~="land"] .country { cursor: pointer; }
@media (hover: hover) {
  .mode-atlas .country:not(.dep):hover, .map[data-clickable~="land"] .country:not(.dim):hover { fill-opacity: .72; }
  .map[data-clickable~="land"] .country.dim:hover { fill-opacity: .85; }
}
.country.cc-m0 { fill: var(--land-unknown); }
.country.mc1.cc-m1 { fill: color-mix(in srgb, var(--mc1) 50%, var(--land-unknown)); }
.country.mc2.cc-m1 { fill: color-mix(in srgb, var(--mc2) 50%, var(--land-unknown)); }
.country.mc3.cc-m1 { fill: color-mix(in srgb, var(--mc3) 50%, var(--land-unknown)); }
.country.mc4.cc-m1 { fill: color-mix(in srgb, var(--mc4) 50%, var(--land-unknown)); }
.country.mc5.cc-m1 { fill: color-mix(in srgb, var(--mc5) 50%, var(--land-unknown)); }
.country.mc6.cc-m1 { fill: color-mix(in srgb, var(--mc6) 50%, var(--land-unknown)); }
.country.mc7.cc-m1 { fill: color-mix(in srgb, var(--mc7) 50%, var(--land-unknown)); }
.country[data-mark] { stroke-width: 1.6; }
.country[data-mark="target"], .country[data-mark="sel"] { fill: var(--mark); stroke: var(--ink); }
.country[data-mark="ok"] { fill: var(--ok-fill); stroke: var(--ok); }
.country[data-mark="bad"] { fill: var(--bad-fill); stroke: var(--bad); }
.country[data-mark="soft"] { stroke: var(--ink); stroke-width: 1.4; }

.sea { fill: transparent; stroke: none; }
.mode-atlas .sea:not(.ocean) { cursor: pointer; }
@media (hover: hover) { .mode-atlas .sea:hover, .sea-quiz .sea:hover { fill: var(--sea-tint); } }
.sea-quiz .sea { stroke: var(--hydro); stroke-width: .5; stroke-dasharray: 2 3; stroke-opacity: .55; cursor: pointer; }
.sea[data-mark="target"], .sea[data-mark="sel"] { fill: var(--mark); fill-opacity: .7; stroke: var(--mark-ink); stroke-width: 1.2; stroke-dasharray: none; }
.sea[data-mark="ok"] { fill: var(--ok-fill); fill-opacity: .8; stroke: var(--ok); stroke-dasharray: none; }
.sea[data-mark="bad"] { fill: var(--bad-fill); fill-opacity: .8; stroke: var(--bad); stroke-dasharray: none; }
.lake { fill: var(--lake); stroke: var(--hydro); stroke-width: .4; }
.lake[data-mark] { fill: var(--mark); }
.range { fill: url(#hatchRange); stroke: var(--range-ink); stroke-width: .5; stroke-opacity: .5; opacity: .8; }
.mode-atlas .range { cursor: pointer; }
.hatch-range-line { stroke: var(--range-ink); stroke-width: 1.3; }
.range:hover { opacity: 1; }
.river { fill: none; stroke: var(--river); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.mode-atlas .river { cursor: pointer; }
.mode-atlas .river:hover { stroke-width: 2.4; }
.mark-line-casing { fill: none; stroke: var(--ink); stroke-opacity: .55; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.mark-line { fill: none; stroke: var(--mark); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.mark-line.ok { stroke: var(--ok-fill); } .mark-line-casing.ok { stroke: var(--ok); stroke-opacity: .8; }
.mark-area { fill: var(--mark); fill-opacity: .6; stroke: var(--ink); stroke-width: 1.2; pointer-events: none; }
.mark-area.ok { fill: var(--ok-fill); stroke: var(--ok); }
.pin-line { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 5 4; }

.map.hide-seas .layer-seas { display: none; }
.map.hide-lakes .layer-lakes { display: none; }
.map.hide-ranges .layer-ranges { display: none; }
.map.hide-rivers .layer-rivers { display: none; }

/* Symbole */
.sym { cursor: pointer; }
.sym .hit { fill: transparent; }
.sym-tiny circle:first-child { fill: var(--mc4); stroke: var(--ink-2); stroke-width: 1; }
.sym-tiny.dim circle:first-child { fill: var(--land-dim); stroke: var(--rule-strong); }
.sym-tiny.cc-m0 circle:first-child { fill: var(--land-unknown); }
.sym-tiny[data-mark="target"] circle:first-child, .sym-tiny[data-mark="sel"] circle:first-child { fill: var(--mark); stroke: var(--ink); stroke-width: 2; }
.sym-tiny[data-mark="ok"] circle:first-child { fill: var(--ok-fill); stroke: var(--ok); stroke-width: 2; }
.sym-tiny[data-mark="bad"] circle:first-child { fill: var(--bad-fill); stroke: var(--bad); stroke-width: 2; }
.mode-stats .sym-tiny { pointer-events: none; }
.sym-cap rect:first-child { fill: var(--cap); stroke: var(--card); stroke-width: 1; }
.sym-cap .in { fill: var(--card); }
.sym-city circle:first-child { fill: var(--card); stroke: var(--ink); stroke-width: 1.4; }
.sym-peak path, .sym-volcano path { fill: var(--ink-2); stroke: var(--card); stroke-width: 1; }
.sym-volcano .in { fill: var(--cap); }
.sym-peak-mark path { fill: var(--mark); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.sym-peak-mark[data-mark="ok"] path { fill: var(--ok-fill); stroke: var(--ok); }
.sym-city-mark .halo { fill: var(--mark); fill-opacity: .35; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; }
.sym-city-mark circle:nth-child(2) { fill: var(--mark); stroke: var(--ink); stroke-width: 2; }
.sym-city-mark[data-mark="ok"] circle:nth-child(2) { fill: var(--ok-fill); stroke: var(--ok); }
.sym-city-mark[data-mark="ok"] .halo { fill: var(--ok-fill); }
.pin .pin-body { fill: var(--accent); stroke: var(--card); stroke-width: 1.5; }
.pin circle { fill: var(--card); }
.pin.target .pin-body { fill: var(--mark); stroke: var(--ink); }
.pin.target circle { fill: var(--ink); }
.pin .pin-pole { fill: #5b4a3a; }
.pin .pin-flag { fill: var(--accent); stroke: #1c2a35; stroke-width: 1; stroke-linejoin: round; }
.pin .pin-foot { fill: rgba(0, 0, 0, .28); }
:root[data-pin="gold"] .map .pin.guess .pin-body, .pv-pin[data-pin="gold"] .pin-body { fill: #e0a800; stroke: #7a5200; }
:root[data-pin="gold"] .map .pin.guess circle, .pv-pin[data-pin="gold"] circle { fill: #fff3c4; }
.pin.ok .pin-body, .pin.ok .pin-flag { fill: var(--ok); }
.pin.bad .pin-body, .pin.bad .pin-flag { fill: var(--bad); }

/* Beschriftung */
.lbl { font-family: var(--font); fill: var(--label-ink, var(--ink)); paint-order: stroke; stroke: var(--halo); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.lbl-country { font-size: 11.5px; font-weight: 700; letter-spacing: .09em; font-variant-caps: all-small-caps; fill: var(--label-ink-2, var(--ink-2)); }
.lbl-cap { font-size: 11.5px; font-weight: 700; }
.lbl-city { font-size: 11px; fill: var(--label-ink-2, var(--ink-2)); }
.lbl-sea { font-family: var(--serif); font-style: italic; font-size: 12.5px; fill: var(--hydro); letter-spacing: .03em; stroke-width: 2px; }
.lbl-ocean { font-size: 15px; letter-spacing: .3em; }
.lbl-river { font-family: var(--serif); font-style: italic; font-size: 11.5px; fill: var(--hydro); }
.lbl-lake { font-family: var(--serif); font-style: italic; font-size: 10.5px; fill: var(--hydro); }
.lbl-range { font-size: 11px; font-weight: 700; letter-spacing: .2em; font-variant-caps: all-small-caps; fill: var(--range-ink); }
.lbl-peak { font-size: 10.5px; fill: var(--label-ink-2, var(--ink-2)); }

.map-tip {
  position: absolute; left: 0; top: 0; z-index: 4; pointer-events: none; opacity: 0;
  background: var(--ink); color: var(--paper); font-size: .88rem; font-weight: 700; padding: 4px 9px; border-radius: var(--radius); white-space: nowrap;
  transition: opacity .12s;
}
.map-tip.show { opacity: 1; }
.map-controls { position: absolute; right: 10px; bottom: 10px; z-index: 3; display: grid; gap: 6px; }
.map-btn {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius); cursor: pointer;
  background: var(--card); border: 1px solid var(--rule-strong); color: var(--ink); box-shadow: var(--shadow);
}
.map-btn:hover { border-color: var(--ink-3); }
.map.pin-mode .map-svg { cursor: crosshair; }

/* ------------------------------------------------------------ Atlas */
.view.atlas { position: relative; height: 100%; max-width: none; padding: 0; }
.atlas-map { position: absolute; inset: 0; }
.atlas-top { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 6; display: flex; gap: 8px; max-width: 560px; }
.search-box { position: relative; flex: 1; }
.search-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-input {
  width: 100%; height: 46px; padding: 0 16px 0 42px; border-radius: var(--radius); border: 1px solid var(--rule-strong);
  background: var(--card); box-shadow: var(--shadow); font-size: 1rem;
}
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-results {
  position: absolute; left: 0; right: 0; top: 52px; margin: 0; padding: 6px; list-style: none;
  background: var(--card); border: 1px solid var(--rule-strong); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 60vh; overflow: auto;
}
.search-results li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius); cursor: pointer; }
.search-results li.active, .search-results li:hover { background: var(--paper-2); }
.sr-name { font-weight: 700; }
.sr-type { margin-left: auto; color: var(--ink-3); font-size: .85rem; text-align: right; }
.type-dot { width: 20px; height: 15px; display: grid; place-items: center; flex: none; }
.type-dot::before { content: ''; width: 9px; height: 9px; border-radius: 50%; border: 1.6px solid var(--ink); background: var(--card); }
.type-dot.t-fluss::before, .type-dot.t-meer::before, .type-dot.t-see::before { border-color: var(--hydro); background: var(--sea); border-radius: 2px; }
.type-dot.t-berg::before { border: 0; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid var(--ink-2); border-radius: 0; background: none; }
.type-dot.t-gebirge::before { border-color: var(--range-ink); border-radius: 2px; background: repeating-linear-gradient(45deg, var(--range-ink) 0 1px, transparent 1px 3px); }
.layer-btn { width: 46px; height: 46px; box-shadow: var(--shadow); flex: none; }
.layer-panel {
  position: absolute; right: 0; top: 54px; width: min(340px, calc(100vw - 20px)); padding: 14px; display: grid; gap: 10px;
  background: var(--card); border: 1px solid var(--rule-strong); border-radius: var(--radius); box-shadow: var(--shadow);
}
.lp-title { font-weight: 700; font-size: .95rem; }
.lp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; }
.lp-item { display: flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; }
.lp-item input { width: 18px; height: 18px; accent-color: var(--accent); }
.lp-sw { width: 16px; height: 12px; border-radius: var(--radius-sm); flex: none; }
.sw-capitals { background: var(--cap); width: 9px; height: 9px; outline: 1.5px solid var(--card); outline-offset: -3px; }
.sw-cities { width: 10px; height: 10px; border-radius: 50%; border: 1.6px solid var(--ink); }
.sw-rivers { height: 3px; background: var(--river); }
.sw-peaks { width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 10px solid var(--ink-2); border-radius: 0; }
.sw-seas { background: var(--sea); border: 1px dashed var(--hydro); }
.sw-ranges { background: repeating-linear-gradient(45deg, var(--range-ink) 0 1px, transparent 1px 3px); }
.sw-lakes { background: var(--lake); border: 1px solid var(--hydro); }
.sw-labels { background: none; font: italic 700 12px var(--serif); color: var(--hydro); width: auto; height: auto; }
.sw-labels::before { content: 'Aa'; }
.lp-regions { display: flex; flex-wrap: wrap; gap: 6px; }

.atlas-sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; max-height: 34%;
  background: var(--card); border-top: 1px solid var(--rule-strong); border-radius: var(--radius) var(--radius) 0 0; box-shadow: 0 -10px 30px -18px rgba(0, 0, 0, .35);
  display: flex; flex-direction: column; transition: max-height .28s ease;
}
.atlas-sheet.open { max-height: 52%; }
.atlas-sheet.expanded { max-height: 88%; }
.sheet-handle { flex: none; height: 22px; border: 0; background: none; cursor: pointer; position: relative; }
.sheet-handle::before { content: ''; position: absolute; left: 50%; top: 9px; width: 40px; height: 4px; margin-left: -20px; border-radius: var(--radius-sm); background: var(--rule-strong); }
.sheet-body { overflow: auto; padding: 0 18px 18px; overscroll-behavior: contain; }
.sheet-intro { display: grid; gap: 8px; }
.sheet-intro h2 { font-family: var(--serif); font-size: 1.5rem; }
.sheet-intro p { color: var(--ink-2); }
@media (min-width: 900px) {
  .atlas-top { left: 20px; top: 18px; }
  .atlas-sheet {
    left: auto; top: 18px; right: 18px; bottom: 18px; width: 390px; max-height: none !important;
    border: 1px solid var(--rule-strong); border-radius: var(--radius); box-shadow: var(--shadow);
  }
  .sheet-handle { display: none; }
  .sheet-body { padding: 20px 22px 22px; }
  .atlas-map { right: 426px; border-right: 1px solid var(--rule); }
  .atlas .map-controls { right: 14px; bottom: 18px; }
}

/* Steckbrief */
.fact { display: grid; gap: 14px; }
.fact-head { display: flex; align-items: center; gap: 14px; }
.fact-head h2 { font-family: var(--serif); font-size: 1.65rem; font-weight: 700; line-height: 1.1; }
.fact-sub { color: var(--ink-2); font-size: .95rem; }
.fact-flag { width: 64px; height: 48px; object-fit: cover; border-radius: var(--radius); box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); flex: none; }
.fact-sym { width: 44px; height: 44px; flex: none; border-radius: var(--radius); background: var(--paper-2); position: relative; }
.fact-sym::after { content: ''; position: absolute; inset: 0; margin: auto; }
.fact-sym.cap::after { width: 16px; height: 16px; background: var(--cap); box-shadow: inset 0 0 0 5px var(--cap), inset 0 0 0 16px var(--card); }
.fact-sym.city::after { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--card); }
.fact-sym.peak::after, .fact-sym.volcano::after { width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-bottom: 20px solid var(--ink-2); }
.fact-sym.volcano { background: radial-gradient(circle at 50% 30%, var(--cap) 0 4px, var(--paper-2) 5px); }
.fact-sym.river::after { width: 28px; height: 14px; background: radial-gradient(ellipse at 30% 0, transparent 7px, var(--river) 7px 9.5px, transparent 10px), radial-gradient(ellipse at 70% 100%, transparent 7px, var(--river) 7px 9.5px, transparent 10px); }
.fact-sym.sea { background: var(--sea); }
.fact-sym.sea::after { width: 26px; height: 10px; border-top: 2px solid var(--hydro); border-bottom: 2px solid var(--hydro); border-radius: 50%; }
.fact-sym.lake { background: var(--lake); }
.fact-sym.range { background: repeating-linear-gradient(45deg, var(--range-ink) 0 1.5px, var(--paper-2) 1.5px 5px); }
.fact-note { color: var(--ink-2); border-left: 3px solid var(--mark); padding: 2px 0 2px 12px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--ink-3); font-size: .92rem; }
.facts dd { margin: 0; font-weight: 500; }
.facts dd:has(> .note) { margin-top: -4px; }
.cur-code { color: var(--ink-3); font-weight: 400; font-size: .9rem; }
.fact-sec { display: grid; gap: 8px; }
.fact-sec h3 { font-size: .95rem; color: var(--ink-2); }
.fact-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------------------------------------------ Quiz-Auswahl */
.quizmenu-grid { display: grid; gap: 14px; }
.quiz-settings { gap: 10px; }
.quiz-settings .card-title { margin-top: 6px; }
.sticky-start {
  position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b)); z-index: 15; padding: 10px 16px;
  background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--rule);
}
.sticky-start .btn { width: 100%; }
.quizmenu { padding-bottom: 90px; }
@media (min-width: 900px) {
  .quizmenu-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .quiz-settings { position: sticky; top: 24px; }
  .sticky-start { position: static; padding: 8px 0 0; background: none; border: 0; backdrop-filter: none; }
  .quizmenu { padding-bottom: 8px; }
}

/* ------------------------------------------------------------ Quiz */
.view.play { max-width: none; padding: 0; }
.quiz { height: 100dvh; display: flex; flex-direction: column; background: var(--paper); }
.quiz-bar {
  flex: none; height: 58px; display: flex; align-items: center; gap: 12px; padding: 0 12px;
  border-bottom: 1px solid var(--rule); background: var(--card); padding-top: env(safe-area-inset-top, 0);
}
.quiz-progress { flex: 1; display: flex; gap: 3px; }
.seg { flex: 1; height: 7px; border-radius: var(--radius-sm); background: var(--rule); transition: background-color .2s; }
.seg.now { background: var(--ink-3); }
.seg.ok { background: var(--ok); }
.seg.near { background: var(--mark); }
.seg.bad { background: var(--bad); }
.quiz-score { font-family: var(--serif); font-weight: 800; font-size: 1.35rem; min-width: 74px; text-align: right; }
.quiz-score-unit { font-family: var(--font); font-size: .8rem; color: var(--ink-3); font-weight: 500; }
.quiz-score.bump { animation: bump .45s ease; }
@keyframes bump { 40% { transform: scale(1.15); color: var(--ok); } }

.quiz-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.quiz-map { flex: none; height: 50%; min-height: 200px; position: relative; border-bottom: 1px solid var(--rule); transition: height .3s ease; }
.quiz-body[data-layout="map"] .quiz-map { height: 56%; }
.quiz-body[data-kind="click"] .quiz-map, .quiz-body[data-kind="pin"] .quiz-map { height: 66%; }
.quiz-body[data-layout="card"] .quiz-map { height: 0; min-height: 0; border: 0; }
.quiz-body[data-layout="card"].answered .quiz-map { height: 34%; min-height: 180px; border-bottom: 1px solid var(--rule); }
.quiz-body[data-layout="summary"] .quiz-map { height: 30%; }
.quiz-panel { flex: 1; min-height: 0; overflow: auto; padding: 16px 16px calc(20px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px; }
.q-cat { color: var(--ink-3); font-size: .9rem; }
.q-prompt { font-family: var(--serif); font-size: 1.55rem; font-weight: 600; line-height: 1.2; }
.q-prompt b { font-weight: 800; background: linear-gradient(transparent 62%, var(--highlight) 62% 92%, transparent 92%); padding: 0 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.q-sub { color: var(--ink-2); }
.q-visual { display: grid; place-items: center; padding: 6px 0; }
.q-visual .flag { width: min(260px, 70vw); height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); box-shadow: 0 0 0 1px rgba(0, 0, 0, .14), 0 10px 22px -12px rgba(0, 0, 0, .5); }
.q-visual.small { place-items: start; padding: 0; }
.q-visual.small .flag { width: 72px; border-radius: var(--radius); }
.q-visual.sil svg { width: min(240px, 62vw); height: auto; }
.sil-shape { fill: var(--ink); stroke: var(--ink); stroke-width: 1; stroke-linejoin: round; }
.sil-shadow { fill: var(--mark); }
.q-options { display: grid; gap: 9px; }
.opt {
  display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 14px; text-align: left; cursor: pointer;
  border: 1.5px solid var(--rule-strong); border-radius: var(--radius); background: var(--card); font-size: 1.05rem; font-weight: 600;
  transition: border-color .12s, background-color .12s, transform .1s;
}
.opt:hover:not(:disabled) { border-color: var(--ink); }
.opt:active:not(:disabled) { transform: scale(.99); }
.opt-key { display: none; width: 24px; height: 24px; flex: none; place-items: center; border-radius: var(--radius-sm); border: 1px solid var(--rule-strong); color: var(--ink-3); font-size: .8rem; font-weight: 700; }
@media (hover: hover) and (pointer: fine) { .opt-key { display: inline-grid; } }
.opt .flag { width: 40px; height: 30px; object-fit: cover; border-radius: var(--radius-sm); box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); }
.opt:disabled { cursor: default; }
.opt:disabled:not(.is-correct):not(.is-wrong) { opacity: .5; }
.opt.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.is-correct .opt-key { border-color: var(--ok); color: var(--ok); }
.opt.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.q-options.flags { grid-template-columns: 1fr 1fr; }
.q-options.flags .opt { flex-direction: column; justify-content: center; padding: 12px; min-height: 0; position: relative; }
.q-options.flags .opt .flag { width: 100%; height: auto; aspect-ratio: 4 / 3; }
.q-options.flags .opt-key { position: absolute; left: 8px; top: 8px; background: var(--card); }
.q-options.duel { grid-template-columns: 1fr 1fr; }
.q-options.duel .opt { flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; min-height: 150px; padding: 16px 10px; }
.q-options.duel .opt .flag { width: 64px; height: 48px; }
.q-options.duel .opt-label { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; }
.opt-sub { color: var(--ink-3); font-size: .85rem; font-weight: 500; }
.opt-value { display: none; font-family: var(--serif); font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.answered .opt-value, .quiz-body:has(.q-feedback.show) .opt-value { display: block; }
.q-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.answered .q-actions { display: none; }
.q-feedback { display: none; gap: 8px; padding: 14px 0 0; border-top: 1px dashed var(--rule-strong); }
.q-feedback.show { display: grid; animation: rise .25s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.fb-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fb-title { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.15rem; }
.fb-title.ok { color: var(--ok); }
.fb-title.bad { color: var(--bad); }
.fb-points { font-family: var(--serif); font-weight: 800; font-size: 1.15rem; background: var(--ok-soft); color: var(--ok); padding: 2px 10px; border-radius: var(--radius); }
.fb-answer { color: var(--ink-2); }
.fb-fact { color: var(--ink-2); font-size: .95rem; }
/* Heute schon geübt bzw. Kontingent erreicht: nur wenige Punkte */
.fb-points.reduced { background: var(--paper-2); color: var(--ink-3); }
.fb-note { color: var(--ink-3); font-size: .9rem; }
.fb-actions { padding-top: 4px; }
.fb-actions .btn { width: 100%; }
@media (min-width: 900px) {
  .quiz-body { flex-direction: row; }
  .quiz-map, .quiz-body[data-layout] .quiz-map, .quiz-body[data-kind] .quiz-map { height: auto !important; min-height: 0; flex: 1; border-bottom: 0; border-right: 1px solid var(--rule); }
  .quiz-body[data-layout="card"] .quiz-map { border-right: 1px solid var(--rule); }
  .quiz-panel { flex: none; width: 440px; padding: 28px 26px; }
  .q-prompt { font-size: 1.8rem; }
  .fb-actions .btn { width: auto; }
}

/* Auswertung */
.sum-title { font-family: var(--serif); font-size: 2.2rem; font-weight: 800; }
.sum-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { display: grid; gap: 2px; padding: 10px 12px; border-left: 3px solid var(--mark); }
.stat-num { font-family: var(--serif); font-weight: 800; font-size: 1.55rem; line-height: 1.1; }
.stat-label { color: var(--ink-3); font-size: .85rem; }
.pattern { display: flex; gap: 4px; flex-wrap: wrap; }
.pattern span { width: 22px; height: 22px; border-radius: var(--radius); background: var(--rule); }
.pattern span.ok { background: var(--ok); } .pattern span.near { background: var(--mark); } .pattern span.bad { background: var(--bad); }
.pattern.inline span { width: 14px; height: 14px; border-radius: var(--radius-sm); }
.sum-save { color: var(--ink-2); font-size: .95rem; }
.sum-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sum-h { font-size: 1rem; margin-top: 8px; }
.sum-list { list-style: none; margin: 0; padding: 0; display: grid; }
.sum-list li { display: grid; grid-template-columns: 22px 1fr auto; grid-template-areas: 'm q p' 'm a a'; gap: 0 10px; padding: 9px 0; border-top: 1px solid var(--rule); font-size: .95rem; }
.sum-mark { grid-area: m; padding-top: 2px; }
.sum-list li.ok .sum-mark { color: var(--ok); } .sum-list li.bad .sum-mark { color: var(--bad); }
.sum-q { grid-area: q; }
.sum-a { grid-area: a; color: var(--ink-2); font-weight: 700; }
.sum-p { grid-area: p; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.daily-done .card { margin-top: 4px; }
.empty, .empty-state { display: grid; gap: 10px; justify-items: start; padding: 30px 0; }
.empty-state h2 { font-family: var(--serif); font-size: 1.7rem; }
.empty-state p { color: var(--ink-2); max-width: 46ch; }

/* ------------------------------------------------------------ Statistik */
.stats-grid { display: grid; gap: 14px; }
.level-row { display: flex; gap: 16px; align-items: center; }
.level-title { font-size: 2rem; }
.map-card { padding-bottom: 14px; }
.stats-map { height: 300px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule); }
.cat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.cat-list li { display: grid; grid-template-columns: 28px 7.5em 1fr auto; align-items: center; gap: 10px; min-height: 38px; }
.cat-name { font-weight: 700; }
.cat-bar { height: 10px; background: var(--paper-2); border-radius: var(--radius-sm); position: relative; overflow: hidden; }
.cat-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--radius-sm); }
.cat-bar .seen { background: var(--ok-fill); opacity: .6; }
.cat-bar .solid { background: var(--ok); }
.cat-num { color: var(--ink-3); font-size: .9rem; font-variant-numeric: tabular-nums; min-width: 4.5em; text-align: right; }
.calendar { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 3px; justify-content: start; overflow-x: auto; }
.cal-day { width: 13px; height: 13px; border-radius: var(--radius-sm); background: var(--paper-2); border: 1px solid var(--rule); }
.cal-day.l1 { background: color-mix(in srgb, var(--ok-fill) 45%, var(--paper-2)); border-color: transparent; }
.cal-day.l2 { background: var(--ok-fill); border-color: transparent; }
.cal-day.l3 { background: var(--ok); border-color: transparent; }
.badges { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.badges li { display: grid; grid-template-columns: 34px 1fr; grid-template-areas: 's n' 's d'; gap: 0 10px; align-items: center; padding: 8px; border-radius: var(--radius); opacity: .55; }
.badges li.got { opacity: 1; background: var(--paper-2); }
.badge-seal { grid-area: s; width: 34px; height: 34px; border-radius: var(--radius); display: grid; place-items: center; border: 2px dashed var(--rule-strong); color: var(--ink); font-size: 1.1rem; }
.got .badge-seal { background: var(--mark); border: 2px solid var(--ink); color: var(--on-mark); }
.badge-name { grid-area: n; font-weight: 700; font-size: .95rem; }
.badge-desc { grid-area: d; color: var(--ink-3); font-size: .8rem; line-height: 1.25; }
table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.data th { text-align: left; color: var(--ink-3); font-weight: 500; padding: 6px 4px; border-bottom: 1px solid var(--rule); }
table.data td { padding: 8px 4px; border-bottom: 1px solid var(--rule); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.recent { list-style: none; margin: 0; padding: 0; }
.recent li { display: grid; grid-template-columns: 1fr auto auto; grid-template-areas: 'm r p' 't t t'; gap: 0 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.r-mode { grid-area: m; font-weight: 700; }
.r-region { color: var(--ink-3); font-weight: 400; }
.r-res { grid-area: r; } .r-pts { grid-area: p; font-variant-numeric: tabular-nums; }
.r-time { grid-area: t; color: var(--ink-3); font-size: .85rem; }
@media (min-width: 900px) {
  .stats-grid { grid-template-columns: 1fr 1fr; align-items: start; }
  .stats-grid .map-card { grid-row: span 2; }
  .stats-map { height: 360px; }
}

/* ------------------------------------------------------------ Bestenliste & Konto */
.ranks { list-style: none; margin: 8px 0 0; padding: 0; }
.ranks li { display: grid; grid-template-columns: 2.2em 1fr auto auto; gap: 12px; align-items: center; padding: 10px 6px; border-bottom: 1px solid var(--rule); }
.ranks li.me { background: var(--accent-soft); border-radius: var(--radius); }
.rank { font-family: var(--serif); font-weight: 800; font-size: 1.2rem; color: var(--ink-3); text-align: center; }
.ranks li:nth-child(1) .rank { color: var(--on-mark); background: var(--mark); border-radius: var(--radius); width: 1.9em; height: 1.9em; display: grid; place-items: center; }
.who { font-weight: 700; }
.what { color: var(--ink-3); font-size: .9rem; }
.pts { font-family: var(--serif); font-weight: 800; font-variant-numeric: tabular-nums; }
.ranking .card, .account .card { margin-bottom: 14px; }
.auth-card { gap: 14px; }
.auth-form, .inline-form { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; font-weight: 700; font-size: .95rem; }
.field input { height: 48px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--rule-strong); background: var(--paper); font-weight: 400; font-size: 1rem; }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-error { color: var(--bad); font-weight: 700; min-height: 1em; }
.switch { color: var(--ink-2); }
.profile-head { display: flex; gap: 14px; align-items: center; }
.avatar { width: 54px; height: 54px; border-radius: var(--radius); display: grid; place-items: center; background: var(--av-bg, var(--mc5)); border: 2px solid var(--ink); font-family: var(--serif); font-weight: 800; font-size: 1.5rem; flex: none; color: var(--ink); overflow: hidden; }
.avatar.pic svg { width: 78%; height: 78%; }
.avatar.small { width: 30px; height: 30px; font-size: .95rem; border-width: 1.5px; }
.avatar.xl { width: 84px; height: 84px; font-size: 2.2rem; border-width: 2.5px; }
.setting-label { font-weight: 700; font-size: .95rem; }
.toggle { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle-ui { width: 44px; height: 26px; border-radius: var(--radius); background: var(--rule-strong); position: relative; flex: none; transition: background-color .15s; }
.toggle-ui::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: var(--radius-sm); background: var(--card); transition: transform .15s; }
.toggle input:checked + .toggle-ui { background: var(--accent); }
.toggle input:checked + .toggle-ui::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-ui { outline: 3px solid var(--accent); outline-offset: 2px; }
.toggle-text { display: grid; }
.toggle-text small { color: var(--ink-3); font-size: .85rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger { border-color: color-mix(in srgb, var(--bad) 35%, var(--rule)); }

/* ------------------------------------------------------------ Meldungen */
#toasts { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow); font-weight: 500; animation: rise .2s ease; transition: opacity .3s; }
.toast.bad { background: var(--bad); color: var(--on-bad); }
.toast.out { opacity: 0; }
body.focus-mode #toasts { bottom: 20px; }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 200; }

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

/* ------------------------------------------------------------ Kartenstile (Shop)
   Jeder Stil überschreibt nur die Kartenfarben – in Atlas, Quiz, Statistik-Karte und Globus.
   Neuer Stil: Block kopieren, Namen anpassen, in server/shop.js eintragen. */
:root[data-mapstyle="antik"] :is(.map, .hero-globe), .ms-antik {
  --sea: #d6d1b1; --sea-deep: #c2bb94; --sea-tint: rgba(110, 80, 40, .12); --graticule: rgba(110, 80, 40, .22);
  --hydro: #4f5b4e; --river: #6b7f8a; --lake: #cdd2b4; --coast: #6e5536; --border: #8a6a42; --halo: rgba(240, 230, 200, .85);
  --mc1: #ead9a8; --mc2: #dfcd9b; --mc3: #e8c9a1; --mc4: #d9c6a6; --mc5: #d3c89f; --mc6: #eed2a0; --mc7: #dcc29a;
  --land-dep: #e5d9b8; --land-dim: #e2d8bd; --land-ice: #f2ead3; --land-unknown: #f6efdc; --range-ink: #6e5536;
  --label-ink: #3d2b16; --label-ink-2: #5c4529;
}
:root[data-mapstyle="antik"] .map .map-svg { font-family: var(--serif); }
:root[data-mapstyle="tusche"] :is(.map, .hero-globe), .ms-tusche {
  --sea: #fbfaf6; --sea-deep: #f1efe7; --sea-tint: rgba(0, 0, 0, .05); --graticule: rgba(0, 0, 0, .09);
  --hydro: #222; --river: #3a3a3a; --lake: #ffffff; --coast: #151515; --border: #2b2b2b; --halo: rgba(251, 250, 246, .9);
  --mc1: #e7e5dd; --mc2: #e1ded4; --mc3: #eae7df; --mc4: #dcd9cf; --mc5: #e4e1d8; --mc6: #dfdcd2; --mc7: #e8e5dc;
  --land-dep: #efede6; --land-dim: #f4f2ec; --land-ice: #fbfaf6; --land-unknown: #ffffff; --range-ink: #222;
  --label-ink: #111; --label-ink-2: #333;
}
:root[data-mapstyle="blaupause"] :is(.map, .hero-globe), .ms-blaupause {
  --sea: #1f5b9a; --sea-deep: #184a80; --sea-tint: rgba(255, 255, 255, .08); --graticule: rgba(220, 235, 250, .22);
  --hydro: #d6e8fa; --river: #9fcaf0; --lake: #1f5b9a; --coast: #e6f1fc; --border: #cfe2f6; --halo: rgba(24, 74, 128, .85);
  --mc1: #2c6dae; --mc2: #2967a8; --mc3: #3072b4; --mc4: #2765a5; --mc5: #2d6fb1; --mc6: #2a6aab; --mc7: #2663a2;
  --land-dep: #2a62a0; --land-dim: #235790; --land-ice: #3a7cbd; --land-unknown: #1c4f85; --range-ink: #e6f1fc;
  --label-ink: #f3f8fe; --label-ink-2: #d3e5f8;
}
:root[data-mapstyle="satellit"] :is(.map, .hero-globe), .ms-satellit {
  --sea: #0f3d63; --sea-deep: #082640; --sea-tint: rgba(255, 255, 255, .07); --graticule: rgba(255, 255, 255, .07);
  --hydro: #a9d6f5; --river: #5fb0e6; --lake: #13507e; --coast: rgba(10, 20, 10, .55); --border: rgba(255, 255, 255, .5); --halo: rgba(8, 24, 40, .8);
  --mc1: #7f8f52; --mc2: #6c874a; --mc3: #9b8d5a; --mc4: #76885a; --mc5: #5f7c47; --mc6: #a69462; --mc7: #878b55;
  --land-dep: #7c8263; --land-dim: #56604a; --land-ice: #e9eef1; --land-unknown: #4c5146; --range-ink: #efe2c2;
  --label-ink: #f4f7f2; --label-ink-2: #dbe5d6;
}

/* ------------------------------------------------------------ Shop */
.wallet { margin-bottom: 18px; }
.wallet-row { display: flex; align-items: center; gap: 14px; }
.wallet-coin { width: 46px; height: 46px; }
.wallet-num { display: block; font-family: var(--serif); font-weight: 800; font-size: 2.2rem; line-height: 1; }
.wallet-label { display: block; color: var(--ink-3); font-size: .9rem; }
.shop-sec { margin: 22px 0 8px; display: grid; gap: 10px; }
.shop-sec-head { display: grid; gap: 2px; }
.shop-sec-head h2 { font-family: var(--serif); font-size: 1.45rem; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 10px; }
.shop-item { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.shop-item.is-active { border-color: var(--ink); box-shadow: 3px 3px 0 var(--mark); }
.shop-preview { height: 132px; display: grid; place-items: center; background: var(--paper-2); border-bottom: 1px solid var(--rule); }
.pv-canvas { width: 112px; height: 112px; }
.pv-canvas .globe-canvas { filter: none; }
.pv-pin { width: 92px; height: 70px; }
.shop-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.shop-body h3 { font-size: 1.02rem; }
.shop-body p { color: var(--ink-2); font-size: .88rem; line-height: 1.3; flex: 1; }
.shop-foot { padding-top: 6px; }
.shop-foot .btn { width: 100%; }
.btn.small { min-height: 38px; padding: 0 10px; font-size: .9rem; gap: 6px; }
.btn.small.active { opacity: 1; background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.shop-tag { display: inline-block; color: var(--ink-3); font-size: .88rem; }
.factor-hint { display: flex; gap: 6px; align-items: flex-start; }
.factor-hint .icon { margin-top: 1px; }
details.how { border-top: 1px solid var(--rule); padding-top: 10px; }
details.how summary { cursor: pointer; font-weight: 700; color: var(--accent); }
details.how p { color: var(--ink-2); font-size: .95rem; margin-top: 8px; }
.cat-x { color: var(--ink-3); font-weight: 500; font-size: .85rem; }
.sum-hint { display: block; color: var(--ink-3); font-size: .88rem; margin-top: 4px; }
.rank-note { margin: 8px 0 0; }
.ranks li { grid-template-columns: 2.2em auto 1fr auto auto; }
@media (min-width: 900px) { .shop-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); } }

/* ------------------------------------------------------------ Quiz kompakt auf dem Handy
   Ziel: vier Antworten ohne Scrollen auch auf ~410×780 (z. B. Pixel 9 im Browser). */
@media (max-width: 899px) {
  .quiz-bar { height: 50px; gap: 10px; }
  .quiz-bar .icon-btn { width: 38px; height: 38px; }
  .quiz-score { font-size: 1.2rem; min-width: 64px; }
  .quiz-panel { padding: 10px 14px calc(14px + var(--safe-b)); gap: 8px; }
  .q-cat { font-size: .82rem; }
  .q-prompt { font-size: 1.32rem; line-height: 1.18; }
  .q-sub { font-size: .92rem; }
  .q-options { gap: 6px; }
  .opt { min-height: 44px; padding: 6px 12px; font-size: 1rem; border-radius: var(--radius); }
  .q-visual { padding: 0; }
  .q-visual .flag { width: auto; height: min(150px, 19vh); max-width: 70vw; }
  .q-visual.sil svg { width: auto; height: min(170px, 21vh); }
  .q-visual.small .flag { width: 54px; height: auto; }
  .q-options.flags .opt { padding: 6px; }
  .q-options.flags .opt .flag { width: auto; height: min(84px, 11vh); max-width: 100%; }
  .q-options.duel .opt { min-height: 116px; padding: 10px 8px; }
  .quiz-body[data-layout="map"] .quiz-map { height: 42%; }
  .quiz-body[data-kind="click"] .quiz-map, .quiz-body[data-kind="pin"] .quiz-map { height: 64%; }
  .quiz-body[data-layout="card"].answered .quiz-map { height: 30%; min-height: 150px; }
  .q-feedback { padding-top: 10px; gap: 6px; }
  .fb-title { font-size: 1.05rem; }
}
@media (max-width: 899px) and (max-height: 700px) {
  .quiz-body[data-layout="map"] .quiz-map { height: 36%; }
  .q-prompt { font-size: 1.2rem; }
  .opt { min-height: 40px; }
}
