/* Weltquiz – politischer Schulatlas: Pastell-Länder, hellblaues Meer, Legendenkästen mit Doppelrahmen. */

:root {
  --sea: #a9d3ea;
  --sea-deep: #86bddc;
  --coast: #5f9ec4;
  --water-ink: #1d5f8a;

  --land-0: #f3d29b;   /* Aprikose */
  --land-1: #f2c0c7;   /* Rosé */
  --land-2: #cfe1a9;   /* Salbei */
  --land-3: #f5e79b;   /* Butter */
  --land-4: #d8cbea;   /* Lavendel */
  --land-5: #bfe1d1;   /* Minze */
  --land-out: #ece8e1;
  --border: #85766a;

  --ink: #2a2833;
  --muted: #5d6270;
  --paper: #ffffff;
  --paper-tint: #f1f7fb;
  --line: #d9dde3;

  --target: #d6246e;
  --right: #1f9d57;
  --right-ink: #11683a;
  --wrong: #e0442a;
  --wrong-ink: #a3290f;
  --focus: #1b5fd1;

  --frame: 0 0 0 1.5px var(--ink), 0 0 0 5px var(--paper), 0 0 0 6.5px var(--ink);
  --lift: 0 14px 34px rgba(24, 55, 80, 0.22);

  --font: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-cond: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;
  --font-serif: 'Spectral', Georgia, 'Times New Roman', serif;

  --pa: #7c5cf0;      /* Emilia */
  --pa-soft: #cbbffb;
  --pb: #d9660f;      /* Lars */
  --pb-soft: #fbc690;

  --kb: 0px;          /* Höhe der Bildschirmtastatur (per JS) */
  --top: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--sea);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.noscript { position: fixed; inset: auto 16px 16px; background: #fff; padding: 16px; }

/* ---------- Karte ---------- */
.map { position: fixed; inset: 0; touch-action: none; cursor: grab; }
.map:active { cursor: grabbing; }
.map-svg { display: block; }
.map.pickable .map-svg { cursor: pointer; }
.sea { fill: var(--sea); }
.graticule { fill: none; stroke: #96c8e2; stroke-width: 0.7; vector-effect: non-scaling-stroke; }
.land path { stroke: none; transition: fill 0.35s ease; }
.land .c0 { fill: var(--land-0); }
.land .c1 { fill: var(--land-1); }
.land .c2 { fill: var(--land-2); }
.land .c3 { fill: var(--land-3); }
.land .c4 { fill: var(--land-4); }
.land .c5 { fill: var(--land-5); }
.land .ice { fill: #f6f8fa; }
.land path.is-out { fill: var(--land-out); }
.land path.is-target, .land path.is-pick { fill: var(--target); stroke: var(--target); }
.land path.is-right { fill: var(--right); stroke: var(--right); }
.land path.is-wrong { fill: var(--wrong); stroke: var(--wrong); }
.land path.is-target, .land path.is-pick, .land path.is-right, .land path.is-wrong { stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.compare .land path { fill: #e9e5de; }
.compare .land path.cmp-a { fill: var(--cmp-a, var(--pa-soft)); }
.compare .land path.cmp-b { fill: var(--cmp-b, var(--pb-soft)); }
.compare .land path.cmp-ab { fill: #86c895; }
.water-hl path.cmp-a, .lakes path.cmp-a { fill: var(--cmp-a, var(--pa-soft)); }
.water-hl path.cmp-b, .lakes path.cmp-b { fill: var(--cmp-b, var(--pb-soft)); }
.water-hl path.cmp-ab, .lakes path.cmp-ab { fill: #86c895; }
.mastery .land path { fill: #e9e5de; }
.mastery .land path.m1 { fill: #f3b3a1; }
.mastery .land path.m2 { fill: #b9e3a8; }
.mastery .land path.m3 { fill: #4fae68; }
.borders { fill: none; stroke: var(--border); stroke-width: 0.75; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.coast { fill: none; stroke: var(--coast); stroke-width: 0.8; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.lakes path { fill: var(--sea); stroke: var(--coast); stroke-width: 0.6; vector-effect: non-scaling-stroke; transition: fill 0.35s ease; }
.water-hl path { fill: transparent; stroke: none; transition: fill 0.35s ease; }
.water-hl path.is-target, .lakes path.is-target, .water-hl path.is-pick, .lakes path.is-pick { fill: var(--target); }
.water-hl path.is-right, .lakes path.is-right { fill: var(--right); }
.water-hl path.is-wrong, .lakes path.is-wrong { fill: var(--wrong); }
.water-hl path.is-target, .water-hl path.is-pick, .water-hl path.is-right, .water-hl path.is-wrong { fill-opacity: 0.82; }

.ring-line { fill: none; stroke: var(--target); stroke-width: 2.5; }
.ring-pulse { fill: none; stroke: var(--target); stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: pulse 1.8s ease-out infinite; }
.ring.right .ring-line, .ring.right .ring-pulse { stroke: var(--right); }
@keyframes pulse { from { transform: scale(1); opacity: 0.9; } to { transform: scale(2.3); opacity: 0; } }

.maplabel text { font-family: var(--font-cond); font-weight: 700; font-size: 17px; fill: var(--ink); letter-spacing: 0.01em; pointer-events: none; }
.maplabel text.halo { fill: none; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }
.maplabel.right text:not(.halo) { fill: var(--right-ink); }
.maplabel.wrong text:not(.halo) { fill: var(--wrong-ink); }
.maplabel.water text { font-family: var(--font-serif); font-style: italic; font-weight: 500; font-size: 18px; letter-spacing: 0.02em; }
.maplabel.water text:not(.halo) { fill: var(--water-ink); }
.maplabel.water.wrong text:not(.halo) { fill: var(--wrong-ink); }
.maplabel.small text { font-size: 11.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; }
.maplabel.small text.halo { stroke-width: 3.5px; stroke: rgba(255, 255, 255, 0.9); }
.pin-star { fill: var(--target); stroke: #fff; stroke-width: 1.6; }
.pin.right .pin-star { fill: #fff; stroke: var(--right-ink); stroke-width: 2.2; }
.pin.wrong .pin-star { fill: #fff; stroke: var(--wrong-ink); stroke-width: 2.2; }
.pin-label { font-family: var(--font-cond); font-weight: 700; font-size: 16px; fill: var(--ink); }
.pin-label.halo { fill: none; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }
.pin.right .pin-label:not(.halo) { fill: var(--right-ink); }
.pin.wrong .pin-label:not(.halo) { fill: var(--wrong-ink); }
.overlay, .labels { pointer-events: none; }

/* ---------- Kopfzeile ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
body[data-view="home"] .brand, body[data-view="player"] .brand { visibility: hidden; }
.brand {
  font-family: var(--font-cond); font-weight: 700; font-size: 22px; line-height: 1;
  padding: 8px 12px 7px; border: 0; background: var(--paper); box-shadow: var(--frame);
  margin: 6.5px; letter-spacing: 0.01em;
}
.hud { display: flex; align-items: center; gap: 10px; background: var(--paper); padding: 8px 12px; box-shadow: var(--frame); margin: 6.5px 6.5px 6.5px 0; }
.hud-text { font-family: var(--font-cond); font-weight: 600; font-size: 17px; white-space: nowrap; font-variant-numeric: tabular-nums; display: flex; gap: 10px; }
.hud-text .short { display: none; }
.hud-text .streak { color: var(--right-ink); }
.scalebar { display: flex; height: 10px; border: 1.5px solid var(--ink); min-width: 80px; max-width: 240px; }
.scalebar i { flex: 1; min-width: 5px; background: var(--paper); }
.scalebar i:nth-child(even) { background: #e6e3de; }
.scalebar i + i { border-left: 1px solid var(--ink); }
.scalebar i.r { background: var(--right); }
.scalebar i.w { background: var(--wrong); }
.scalebar i.now { background: var(--target); }
.top-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.icon-btn, .text-btn { border: 0; background: var(--paper); box-shadow: var(--frame); margin: 6.5px; height: 38px; }
.icon-btn { width: 38px; display: grid; place-items: center; }
.icon-btn .mute { display: none; }
.icon-btn[aria-pressed="false"] .wave { display: none; }
.icon-btn[aria-pressed="false"] .mute { display: inline; }
.text-btn { padding: 0 14px; font-weight: 600; }

/* ---------- Panels (Legendenkasten) ---------- */
.panel, .card {
  position: fixed; z-index: 10;
  background: var(--paper);
  box-shadow: var(--frame), var(--lift);
}
.panel {
  --dock: left;
  left: calc(20px + env(safe-area-inset-left)); top: calc(var(--top) + 26px); bottom: 24px;
  width: 390px; max-height: calc(100% - var(--top) - 50px); height: max-content;
  overflow: auto; padding: 22px 22px 20px;
  overscroll-behavior: contain;
}
.card {
  --dock: bottom;
  left: 50%; transform: translateX(-50%);
  bottom: calc(24px + env(safe-area-inset-bottom));
  width: min(580px, calc(100% - 40px));
  padding: 16px 18px 16px;
  /* niedrige Bildschirme (Handy quer): nie unter die Kopfleiste ragen, lieber scrollen */
  max-height: calc(100% - var(--top) - 40px - env(safe-area-inset-bottom)); overflow: auto;
}
/* solange gefragt wird, darf die Vorschlagsliste über die Karte hinausragen */
.card.asking { overflow: visible; }

h1, h2, h3 { margin: 0; font-weight: 700; }
.title { font-family: var(--font-cond); font-size: 46px; line-height: 0.95; letter-spacing: -0.01em; }
.subtitle { font-family: var(--font-serif); font-style: italic; font-size: 19px; color: var(--muted); margin: 6px 0 18px; line-height: 1.35; }
.h2 { font-family: var(--font-cond); font-size: 32px; line-height: 1; }
.lead { color: var(--muted); margin: 6px 0 0; }

.legend-list { list-style: none; margin: 0; padding: 0; border-top: 1.5px solid var(--ink); }
.legend-list li { border-bottom: 1px solid var(--line); }
.legend-row {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px;
  width: 100%; padding: 12px 4px; background: none; border: 0; text-align: left;
}
.legend-row:hover { background: var(--paper-tint); }
.legend-row .name { font-weight: 600; font-size: 18px; line-height: 1.2; display: block; }
.legend-row .desc { color: var(--muted); font-size: 14.5px; line-height: 1.3; display: block; margin-top: 2px; }
.resume-row { background: #fdf0f5; }
.resume-row .name { color: var(--target); }
.legend-row .count { font-family: var(--font-cond); font-weight: 600; font-size: 16px; color: var(--muted); font-variant-numeric: tabular-nums; }
.swatch { width: 34px; height: 24px; border: 1.5px solid var(--ink); display: block; overflow: hidden; }
.swatch svg { display: block; width: 100%; height: 100%; }

.daily { margin-top: 18px; padding-top: 14px; border-top: 1.5px solid var(--ink); }
.daily-head { font-weight: 600; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.daily-head img { height: 14px; border: 1px solid rgba(0,0,0,.15); }
.fact-text { font-family: var(--font-serif); font-style: italic; font-size: 18px; line-height: 1.5; margin: 6px 0 0; }
.linkish { background: none; border: 0; padding: 0; color: var(--focus); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; margin-top: 8px; }

/* Update-Hinweis */
.update-bar {
  position: fixed; z-index: 25; right: calc(20px + env(safe-area-inset-right)); top: calc(var(--top) + 18px);
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 14px;
  background: var(--paper); box-shadow: var(--frame), var(--lift); font-weight: 600;
}
.update-bar .btn { height: 38px; padding: 0 14px; font-size: 15px; }

/* Spieler */
.player-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  border: 0; background: var(--paper); box-shadow: var(--frame); margin: 6.5px 0; font-weight: 700; font-size: 15px;
}
.player-chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); display: block; }
.player-chip.p-emilia i { background: var(--pa); }
.player-chip.p-lars i { background: var(--pb); }
.who { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }
.who-btn {
  height: 92px; border: 2px solid var(--ink); background: var(--paper); border-radius: 4px;
  font-family: var(--font-cond); font-weight: 700; font-size: 30px; position: relative;
}
.who-btn::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; }
.who-btn.p-emilia::before { background: var(--pa); }
.who-btn.p-lars::before { background: var(--pb); }
.who-btn:hover { background: var(--paper-tint); }
.who-btn[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--ink); }
p.who-note { margin: 14px 0 0; }
/* „+ Neu“: eigenes Konto mit dem eigenen Namen */
.who-btn.who-new { border-style: dashed; color: var(--muted); font-size: 24px; }
.who-btn.who-new[aria-expanded="true"] { color: var(--ink); border-style: solid; }
.who-form { margin-top: 12px; }
p.who-msg { margin: 8px 0 0; color: var(--wrong-ink); }
.who-tabs .opt.p-emilia[aria-pressed="true"] { background: var(--pa); border-color: var(--pa); }
.who-tabs .opt.p-lars[aria-pressed="true"] { background: var(--pb); border-color: var(--pb); }

/* Duell */
.duel-strip {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  width: 100%; margin: 0 0 16px; padding: 10px 12px; background: var(--paper-tint); border: 1.5px solid var(--line); border-radius: 3px;
}
.duel-strip:hover { border-color: var(--ink); }
.ds-name { font-weight: 600; font-size: 15px; white-space: nowrap; }
.ds-name b { font-family: var(--font-cond); font-size: 20px; }
.ds-name.p-emilia b { color: var(--pa); }
.ds-name.p-lars b { color: var(--pb); }
.ds-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #e6e3de; }
.ds-bar i.p-emilia { background: var(--pa); }
.ds-bar i.p-lars { background: var(--pb); }
.duel-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 10px; margin: 18px 0 6px; }
.duel-side { display: flex; flex-direction: column; align-items: center; padding: 12px 6px 10px; border-top: 6px solid var(--line); }
.duel-side.p-emilia { border-color: var(--pa); }
.duel-side.p-lars { border-color: var(--pb); }
.duel-side.lead { background: #fbfaf5; }
.duel-name { font-weight: 700; font-size: 17px; }
.duel-name small { font-weight: 400; color: var(--muted); }
.duel-total { font-family: var(--font-cond); font-weight: 700; font-size: 58px; line-height: 1; font-variant-numeric: tabular-nums; }
.duel-side.p-emilia .duel-total { color: var(--pa); }
.duel-side.p-lars .duel-total { color: var(--pb); }
.duel-sub { color: var(--muted); font-size: 14px; }
.duel-vs { font-family: var(--font-serif); font-style: italic; color: var(--muted); padding-bottom: 30px; }
.duel-verdict { text-align: center; font-weight: 600; margin: 4px 0 12px; }
.duel-rows { border-top: 1.5px solid var(--ink); }
.duel-row { display: grid; grid-template-columns: 96px 34px 1fr 34px; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.duel-mode { font-weight: 600; font-size: 15px; }
.duel-num { font-family: var(--font-cond); font-weight: 700; font-size: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.duel-num.p-emilia { color: var(--pa); }
.duel-num.p-lars { color: var(--pb); }
.duel-bars { display: grid; gap: 3px; }
.duel-bars i { display: block; height: 7px; min-width: 2px; border-radius: 4px; }
.duel-bars i.p-emilia { background: var(--pa); }
.duel-bars i.p-lars { background: var(--pb); }
.duel-stats { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 18px; margin: 12px 0 0; font-size: 15px; }
.duel-stats dt { color: var(--muted); }
.duel-stats dd { margin: 0; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.key i.k-a { background: var(--cmp-a, var(--pa-soft)); }
.key i.k-b { background: var(--cmp-b, var(--pb-soft)); }

/* Einstellungen */
.back { background: none; border: 0; padding: 4px 0; font-weight: 600; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; margin: -4px 0 10px; }
.back:hover { color: var(--ink); }
.field { margin-top: 20px; }
.field-label { font-weight: 600; font-size: 15px; margin: 0 0 8px; }
.options { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  border: 1.5px solid var(--ink); background: var(--paper); padding: 8px 12px; min-height: 42px;
  font-weight: 600; font-size: 15.5px; line-height: 1.2; border-radius: 3px;
}
.opt[aria-pressed="true"] { background: var(--ink); color: #fff; }
.opt .n { font-family: var(--font-cond); font-weight: 600; opacity: 0.75; margin-left: 4px; }
.variant { display: grid; gap: 8px; }
.variant .opt { text-align: left; padding: 10px 12px; }
.variant .opt small { display: block; font-weight: 400; font-size: 14px; opacity: 0.8; margin-top: 2px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
.btn {
  height: 46px; padding: 0 18px; border-radius: 3px; font-weight: 700; font-size: 16.5px;
  border: 1.5px solid var(--ink); background: var(--paper); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:disabled { background: #b9bcc4; border-color: #b9bcc4; cursor: not-allowed; }
.btn.wide { flex: 1; }

/* ---------- Quizkarte ---------- */
.q-head { display: flex; align-items: flex-start; gap: 12px; }
.q-prompt { font-family: var(--font-cond); font-weight: 700; font-size: 25px; line-height: 1.1; flex: 1; margin: 2px 0 12px; }
.q-prompt em { font-style: normal; color: var(--target); }
.q-tools { display: flex; gap: 6px; }
.chip-btn { border: 1.5px solid var(--line); background: var(--paper); padding: 4px 10px; font-size: 14px; font-weight: 600; border-radius: 3px; color: var(--muted); white-space: nowrap; }
.chip-btn:hover { border-color: var(--ink); color: var(--ink); }
.hint { font-size: 15px; color: var(--muted); margin: -6px 0 10px; }
.flag-big { display: block; margin: 0 auto 14px; max-width: 100%; height: 132px; border: 1px solid rgba(0,0,0,0.18); background: #fff; }
.flag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.flag-opt { border: 1.5px solid var(--line); background: #fff; padding: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 104px; border-radius: 3px; }
.flag-opt img { max-width: 100%; max-height: 84px; border: 1px solid rgba(0,0,0,0.15); display: block; }
.flag-grid.answered .flag-opt { min-height: 0; padding: 6px; }
.flag-grid.answered .flag-opt img { max-height: 46px; }
.flag-opt:hover:not(:disabled) { border-color: var(--ink); }
.flag-opt.is-right { border: 3px solid var(--right); }
.flag-opt.is-wrong { border: 3px solid var(--wrong); }
.flag-opt:disabled { cursor: default; }
.flag-opt .cap { font-size: 13.5px; font-weight: 600; line-height: 1.2; }

.answer { position: relative; display: flex; gap: 8px; }
.answer input {
  flex: 1; min-width: 0; height: 50px; padding: 0 14px; font-size: 18px;
  border: 1.5px solid var(--ink); border-radius: 3px; background: #fff; outline: none;
}
.answer input:focus { box-shadow: 0 0 0 3px rgba(27, 95, 209, 0.25); border-color: var(--focus); }
.answer input.chosen { font-weight: 600; background: var(--paper-tint); }
.answer .ok { width: 72px; height: 50px; }
.suggest {
  position: absolute; left: 0; right: 80px; bottom: calc(100% + 6px); z-index: 5;
  list-style: none; margin: 0; padding: 4px 0; background: #fff;
  border: 1.5px solid var(--ink); box-shadow: var(--lift); max-height: min(330px, 46vh); overflow: auto;
}
.suggest li { padding: 10px 14px; cursor: pointer; display: flex; align-items: baseline; gap: 8px; min-height: 44px; }
.suggest li[aria-selected="true"] { background: #e6f2fa; }
.suggest li .via { color: var(--muted); font-size: 14px; }
.suggest li b { font-weight: 700; }
.suggest .empty { color: var(--muted); cursor: default; }
.below { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 10px; }
.below .chip-btn { border-color: transparent; padding-left: 0; }

.result { display: flex; align-items: center; gap: 10px; font-family: var(--font-cond); font-weight: 700; font-size: 28px; line-height: 1; margin: 2px 0 6px; }
.result svg { flex: none; }
.result.right { color: var(--right-ink); }
.result.wrong { color: var(--wrong-ink); }
.result-detail { font-size: 17px; margin: 0; }
.result-detail b { font-weight: 700; }
.note { font-size: 15px; color: var(--muted); margin: 6px 0 0; }
.fact { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.fact-head { font-weight: 600; font-size: 14px; color: var(--muted); }
.card .fact-text { font-size: 17.5px; }
.next-row { display: flex; justify-content: flex-end; margin-top: 14px; gap: 10px; }

/* Auswertung */
.big-score { font-family: var(--font-cond); font-weight: 700; font-size: 64px; line-height: 1; margin: 14px 0 4px; font-variant-numeric: tabular-nums; }
.big-score small { font-size: 26px; color: var(--muted); font-weight: 600; }
.summary-bar { height: 14px; margin: 12px 0 16px; max-width: none; }
.miss-list { list-style: none; padding: 0; margin: 6px 0 0; border-top: 1.5px solid var(--ink); }
.miss-list li { padding: 8px 2px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.miss-list .yours { color: var(--wrong-ink); text-decoration: line-through; font-size: 15px; }

/* Entdecken & Fakten */
.info-head { display: flex; align-items: center; gap: 14px; }
.info-head img { height: 44px; border: 1px solid rgba(0,0,0,0.15); }
.info-grid { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 12px 0 0; font-size: 16px; }
.info-grid dt { color: var(--muted); }
.info-grid dd { margin: 0; font-weight: 600; }
.kind { font-family: var(--font-serif); font-style: italic; color: var(--water-ink); font-size: 17px; }
.explore-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; user-select: none; }
.toggle input { width: 18px; height: 18px; accent-color: var(--ink); }
.facts-list { margin: 8px 0 0; padding-left: 18px; }
.facts-list li { font-family: var(--font-serif); font-style: italic; font-size: 16.5px; margin: 4px 0; line-height: 1.45; }
.card-scroll { max-height: min(46vh, 420px); overflow: auto; overscroll-behavior: contain; }

/* Fortschritt */
.progress-rows { margin-top: 14px; border-top: 1.5px solid var(--ink); }
.progress-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.progress-row .top { display: flex; justify-content: space-between; font-weight: 600; }
.progress-row .top span:last-child { font-family: var(--font-cond); color: var(--muted); font-variant-numeric: tabular-nums; }
.meter { height: 10px; border: 1.5px solid var(--ink); margin-top: 6px; display: flex; background: #fff; }
.meter i { display: block; height: 100%; }
.meter .m3 { background: #4fae68; }
.meter .m2 { background: #b9e3a8; }
.meter .m1 { background: #f3b3a1; }
.key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 14px; color: var(--muted); }
.key span { display: inline-flex; align-items: center; gap: 6px; }
.key i { width: 16px; height: 11px; border: 1px solid var(--ink); display: inline-block; }
.danger { color: var(--wrong-ink); border-color: var(--wrong-ink); }

/* ---------- Minispiele ---------- */
.map { transition: opacity 0.35s ease; }
.map.veiled { opacity: 0.07; pointer-events: none; }

/* Kartenzeichen: dein Tipp, Strecke, Entfernung */
.guess-halo { fill: rgba(42, 40, 51, 0.16); }
.guess-dot { fill: var(--ink); stroke: #fff; stroke-width: 2.5; }
.mapline line { stroke: var(--ink); stroke-width: 2.2; stroke-dasharray: 7 5; stroke-linecap: round; }
.maplabel.dist text { font-size: 15px; }
.maplabel.dist text:not(.halo) { fill: var(--ink); }

/* Kopfzeile während eines Spiels */
.scalebar i.time { flex: none; background: var(--target); transition: width 0.1s linear; }
.scalebar i.time.low { background: var(--wrong); }
.scalebar i.m { background: #f5c542; }
.hud-text .clock { min-width: 3.2ch; text-align: right; }

/* Spielkarte */
.g-row { display: flex; align-items: center; gap: 12px; }
.g-row .q-prompt { margin: 0; }
.countdown { font-family: var(--font-cond); font-weight: 700; font-size: 72px; line-height: 1; text-align: center; padding: 6px 0; color: var(--target); animation: pop 0.6s ease-out; }
@keyframes pop { from { transform: scale(1.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.tag { font-size: 13px; font-weight: 700; color: #fff; background: var(--target); padding: 3px 8px; border-radius: 3px; white-space: nowrap; margin-top: 4px; }
.result .pts { margin-left: auto; font-size: 22px; color: var(--ink); font-variant-numeric: tabular-nums; }
.result.mid { color: #8a6a00; }
.miss-dots { display: inline-flex; gap: 6px; }
.miss-dots i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--wrong-ink); display: block; }
.miss-dots i.on { background: var(--wrong); border-color: var(--wrong); }

/* Entweder-oder */
.duo { display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 8px; }
.duo-or { align-self: center; font-family: var(--font-serif); font-style: italic; color: var(--muted); }
.duo-opt {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 12px 8px; border: 1.5px solid var(--ink); border-radius: 3px; background: #fff; min-height: 128px;
}
.duo-opt:hover:not(:disabled) { background: var(--paper-tint); }
.duo-opt img { height: 40px; max-width: 100%; border: 1px solid rgba(0,0,0,0.15); }
.duo-name { font-family: var(--font-cond); font-weight: 700; font-size: 22px; line-height: 1.05; text-align: center; }
.duo-sub { font-size: 14px; color: var(--muted); line-height: 1.2; text-align: center; }
.duo-val { font-family: var(--font-cond); font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums; }
.duo-opt:disabled { cursor: default; }
.duo-opt.is-right { border: 3px solid var(--right); background: #eef8f1; }
.duo-opt.is-wrong { border: 3px solid var(--wrong); background: #fdf0ed; }
.duo-opt.is-right .duo-val { color: var(--right-ink); }

/* Umrisse */
.shape-wrap { display: grid; place-items: center; padding: 6px 0 12px; }
.shape { width: min(100%, 300px); height: auto; max-height: 190px; display: block; }
.shape path { fill: var(--ink); }
.shape path.lake { fill: var(--paper); }   /* Seen ausgespart wie auf der Karte */
.opts4 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.opts4 .opt { min-height: 48px; }
.opts4 .opt:disabled, .opts6 .opt:disabled { cursor: default; }
.opts4 .opt.is-right, .opts6 .opt.is-right { background: var(--right); border-color: var(--right); color: #fff; }
.opts4 .opt.is-wrong, .opts6 .opt.is-wrong { background: var(--wrong); border-color: var(--wrong); color: #fff; }
/* Flagge → Land: sechs Namen zur Auswahl */
.opts6 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.opts6 .opt { min-height: 52px; padding: 8px 10px; overflow-wrap: anywhere; hyphens: auto; }
.opts6 .opt:hover:not(:disabled) { background: var(--paper-tint); }
.opts6 .opt.is-out { opacity: 0.35; text-decoration: line-through; }
.opts6.answered .opt:not(.is-right):not(.is-wrong) { opacity: 0.55; }
.opts6 + .fb { margin-top: 12px; }

/* Übersicht, Vorstellung, Ergebnis */
.game-list .legend-row { grid-template-columns: 34px 1fr; }
.tag.mini { display: inline-block; vertical-align: 2px; margin: 0 0 0 6px; padding: 1px 5px 2px; font-size: 11px; line-height: 1.2; letter-spacing: 0.04em; text-transform: uppercase; }   /* „neu“ neben dem Spielnamen */
.rec { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; font-size: 14px; color: var(--muted); }
.rec b { font-family: var(--font-cond); font-size: 17px; font-variant-numeric: tabular-nums; }
.rec .p-emilia b { color: var(--pa); }
.rec .p-lars b { color: var(--pb); }
.rec .lead { color: var(--ink); }
.rec.muted { font-style: italic; }
.daily-game { border: 1.5px solid var(--ink); border-radius: 3px; padding: 12px; margin: 16px 0; background: #fdf0f5; }
.dg-head { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center; }
.dg-head .name { font-weight: 700; font-size: 18px; display: block; }
.dg-sub { color: var(--muted); font-size: 14.5px; line-height: 1.3; display: block; }
.dg-scores { display: flex; justify-content: space-between; gap: 10px; margin: 10px 0; font-weight: 600; }
.dg-scores b { font-family: var(--font-cond); font-size: 20px; }
.dg-scores .p-emilia b { color: var(--pa); }
.dg-scores .p-lars b { color: var(--pb); }
.daily-game .btn { width: 100%; }
.daily-row { background: #fdf0f5; }
.how { margin: 12px 0 0; padding-left: 20px; }
.how li { margin: 4px 0; }
.rec-board { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 0; }
.rb { display: flex; flex-direction: column; align-items: center; padding: 10px 6px 8px; border-top: 6px solid var(--line); }
.rb.p-emilia { border-color: var(--pa); }
.rb.p-lars { border-color: var(--pb); }
.rb.lead { background: #fbfaf5; }
.rb-name { font-weight: 700; }
.rb-name small { font-weight: 400; color: var(--muted); }
.rb-val { font-family: var(--font-cond); font-weight: 700; font-size: 42px; line-height: 1; font-variant-numeric: tabular-nums; }
.rb.p-emilia .rb-val { color: var(--pa); }
.rb.p-lars .rb-val { color: var(--pb); }
.rb-unit { color: var(--muted); font-size: 14px; }
.record-badge { display: inline-block; margin: 6px 0 4px; padding: 6px 12px; background: var(--target); color: #fff; font-weight: 700; border-radius: 3px; animation: pop 0.5s ease-out; }
.p-emilia-ink { color: var(--pa); }
.p-lars-ink { color: var(--pb); }
.res-list { list-style: none; padding: 0; margin: 12px 0 0; border-top: 1.5px solid var(--ink); }
.res-list li { display: grid; grid-template-columns: 1fr auto 52px; gap: 10px; align-items: baseline; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.res-list .res-km { color: var(--muted); font-size: 14.5px; text-align: right; }
.res-list b { font-family: var(--font-cond); font-size: 18px; text-align: right; font-variant-numeric: tabular-nums; }
.name-list { margin: 4px 0 0; line-height: 1.5; }

/* Rekorde im Duell */
.rec-rows { border-top: 1.5px solid var(--ink); }
.rec-row { display: grid; grid-template-columns: 1fr 78px 78px; gap: 8px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); }
.rec-row.head { font-weight: 700; font-size: 14px; }
.rec-name { font-weight: 600; font-size: 15px; }
.rec-val { text-align: right; font-family: var(--font-cond); font-weight: 600; font-size: 18px; font-variant-numeric: tabular-nums; color: var(--muted); }
.rec-row.head .rec-val { font-family: var(--font); font-size: 14px; }
.rec-val.p-emilia.lead, .rec-row.head .rec-val.p-emilia { color: var(--pa); }
.rec-val.p-lars.lead, .rec-row.head .rec-val.p-lars { color: var(--pb); }
.rec-val.lead { font-weight: 700; }

/* ---------- Schmal (Handy) ---------- */
@media (max-width: 700px) {
  :root { --top: 58px; }
  body[data-view="quiz"] .brand { display: none; }
  .update-bar { left: 10px; right: 10px; top: calc(var(--top) + 8px); justify-content: space-between; }
  body[data-view="quiz"] .player-chip { display: none; }
  .player-chip { height: 34px; padding: 0 10px; font-size: 14px; }
  .who-btn { height: 76px; font-size: 26px; }
  .duel-total { font-size: 46px; }
  .duel-row { grid-template-columns: 84px 30px 1fr 30px; }
  .hud-text .long { display: none; }
  .hud-text .short { display: inline; }
  .topbar { gap: 4px; }
  .brand { font-size: 19px; padding: 7px 10px 6px; }
  .hud { padding: 6px 10px; }
  .hud-text { font-size: 15.5px; }
  .scalebar { min-width: 48px; max-width: 90px; }
  .panel {
    --dock: bottom;
    left: 10px; right: 10px; width: auto; top: auto;
    bottom: calc(10px + env(safe-area-inset-bottom));
    max-height: 62%; padding: 18px 16px 16px;
  }
  .card {
    --dock: top;
    left: 10px; right: 10px; width: auto; transform: none;
    top: calc(var(--top) + 12px + env(safe-area-inset-top)); bottom: auto;
    padding: 12px 14px 12px;
    max-height: calc(100% - var(--top) - 24px - var(--kb)); overflow: auto;
  }
  .title { font-size: 38px; }
  .subtitle { font-size: 17px; margin-bottom: 12px; }
  .legend-row { padding: 10px 2px; }
  .legend-row .desc { display: none; }
  .resume-row .desc { display: block; }
  .q-prompt { font-size: 21px; margin-bottom: 10px; }
  .suggest { top: calc(100% + 6px); bottom: auto; right: 0; max-height: max(140px, min(40vh, calc(100vh - var(--kb) - 260px))); }
  .flag-big { height: 96px; margin-bottom: 10px; }
  .opts6 { grid-template-columns: 1fr 1fr; gap: 6px; }
  .opts6 .opt { min-height: 46px; }
  .flag-opt { height: 84px; }
  .flag-opt img { max-height: 64px; }
  .result { font-size: 24px; }
  .card .fact-text { font-size: 16.5px; }
  .big-score { font-size: 52px; }
  body[data-view="game"] .brand, body[data-view="game"] .player-chip { display: none; }
  .duo-opt { min-height: 104px; padding: 10px 6px; }
  .duo-opt img { height: 30px; }
  .duo-name { font-size: 19px; }
  .shape { max-height: 130px; }
  .shape-wrap { padding: 2px 0 8px; }
  .countdown { font-size: 56px; }
  .rb-val { font-size: 34px; }
  .rec-row { grid-template-columns: 1fr 64px 64px; }
}

/* ---------- Flach (Handy quer) ---------- */
@media (max-height: 500px) {
  .q-prompt { font-size: 21px; margin-bottom: 6px; }
  .shape { max-height: 86px; }
  .shape-wrap { padding: 0 0 6px; }
  .opts4 { grid-template-columns: repeat(4, 1fr); }
  .opts4 .opt { min-height: 42px; }
  .opts6 { grid-template-columns: repeat(3, 1fr); }
  .opts6 .opt { min-height: 40px; }
  .flag-big { height: 64px; margin-bottom: 8px; }
  .duo-opt { min-height: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  .ring-pulse { animation: none; opacity: 0; }
  .countdown, .record-badge { animation: none; }
  .map, .scalebar i.time { transition: none; }
  .land path, .lakes path, .water-hl path { transition: none; }
}
