/* Exposé Daily. Ein Design für alle Seiten: Off-White, eine Schrift (Lexend), blaues Logo, gelber Hauptbutton.
   Editionen (Nacht, Schnee, Miami) ändern nur die Farbvariablen der Startseite und die Pixel-Stadt,
   Logo, Layout und Button bleiben immer gleich. */

@font-face { font-family: 'Lexend'; src: url('../fonts/lexend-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #f6f4ec; --ink: #161a3a; --muted: #5f6382; --panel: #ffffff; --line: #dcd8c9; --soft: #ece9dd;
  --brand: #2742e8; --cta: #ffcf24; --cta-edge: #d6a100; --cta-ink: #161a3a;
  --good: #188a4a; --mid: #c97a00; --bad: #d63a25;
  --r: 14px;
}
body[data-view="home"][data-edition="night"] { --bg: #101737; --ink: #f2f3fb; --muted: #aab0d4; --panel: #1b2452; --line: #303a72; --soft: #1b2452; }
body[data-view="home"][data-edition="snow"]  { --bg: #e3ebf3; --line: #c9d5e1; --soft: #d5e0ea; }
body[data-view="home"][data-edition="miami"] { --bg: #fdf0e0; --line: #ecd6bb; --soft: #f6e2c9; }
body[data-view="home"][data-edition="vermont"] { --bg: #dff1fb; --line: #bfdcec; --soft: #cde8f6; }
body[data-view="home"][data-edition="norway"] { --bg: #e6eef3; --line: #c8d6df; --soft: #d7e3ea; }
body[data-view="home"][data-edition="germany"] { --bg: #eef3e8; --line: #d2dcc6; --soft: #e0e8d6; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 'Lexend', system-ui, sans-serif; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; transition: background .3s; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
b { font-weight: 600; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.sub { font-size: 14px; color: var(--muted); margin-top: 12px; }
.center { text-align: center; }

/* ---------- Kopf: auf jeder Seite gleich ---------- */
.top { position: relative; z-index: 700; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 14px 24px 10px; }
.logo { justify-self: start; display: inline-flex; align-items: flex-end; text-decoration: none; padding-bottom: 8px; }
.lg-x { background: var(--brand); color: #fff; font-weight: 800; font-size: 31px; line-height: 1; letter-spacing: -.02em; padding: 10px 16px 12px; border-radius: 14px 14px 14px 4px; }
.lg-d { background: var(--cta); color: var(--cta-ink); font-weight: 800; font-size: 15px; line-height: 1; letter-spacing: .09em; text-transform: uppercase; padding: 6px 10px; border-radius: 9px; border: 3px solid var(--bg); margin-left: -10px; transform: rotate(-6deg) translateY(9px); }
.top-right { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 10px; }
.chip { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-size: 14px; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; }
.chip:hover { border-color: var(--ink); }
.flame { width: 11px; height: 14px; background: var(--bad); clip-path: polygon(50% 0, 100% 45%, 85% 100%, 15% 100%, 0 55%, 30% 60%); }
.hud { font-size: 15px; color: var(--muted); white-space: nowrap; }
.hud b { color: var(--ink); font-variant-numeric: tabular-nums; }
/* Runden-Fortschritt: graue abgerundete Balken, erledigte und aktuelle blau */
.rbars { display: inline-flex; gap: 5px; align-items: center; }
.rbars i { width: 26px; height: 8px; border-radius: 4px; background: var(--line); transition: background .25s; }
.rbars i.done { background: var(--brand); }
.rbars i.now { background: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 25%, transparent); }
.timer { display: grid; justify-items: center; gap: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 6px 22px 8px; min-width: 132px; box-shadow: 0 2px 0 var(--line); }
.timer b { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.timer-bar { display: block; width: 100%; height: 5px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.timer-bar i { display: block; height: 100%; width: 100%; background: var(--brand); border-radius: 3px; }
.timer.low { border-color: var(--bad); box-shadow: 0 2px 0 var(--bad); }
.timer.low b { color: var(--bad); }
.timer.low .timer-bar i { background: var(--bad); }
/* was im Kopf steht, hängt von der Ansicht ab */
body:not([data-view="game"]) .top-mid, body:not([data-view="game"]) .hud { display: none; }
body[data-view="game"] .chip { display: none; }
body[data-view="game"] .top { position: sticky; top: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding-top: 8px; padding-bottom: 6px; }
body[data-view="game"] .lg-x { font-size: 22px; padding: 7px 12px 9px; border-radius: 11px 11px 11px 3px; }
body[data-view="game"] .lg-d { font-size: 11px; padding: 4px 7px; border-width: 2px; margin-left: -8px; transform: rotate(-6deg) translateY(7px); }

.view { width: 100%; flex: 1; }

/* ---------- Buttons ---------- */
.go, .play { background: var(--cta); color: var(--cta-ink); border: 0; border-radius: var(--r); font-weight: 700; box-shadow: 0 5px 0 var(--cta-edge); transition: transform .06s, box-shadow .06s, background .15s; }
.go { font-size: 18px; padding: 13px 26px; }
.go:hover, .play:hover { background: #ffd84a; }
.go:active, .play:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--cta-edge); }
.go:disabled { background: var(--soft); color: var(--muted); box-shadow: 0 5px 0 var(--line); cursor: not-allowed; }
.btn { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 20px; font-weight: 500; box-shadow: 0 3px 0 var(--line); }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.link { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
body[data-edition="night"][data-view="home"] .link { color: #9db0ff; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; align-items: center; margin-top: 20px; }

/* ---------- Startseite ---------- */
#view-home { position: relative; display: flex; flex-direction: column; }
.home-screen { position: relative; flex: 1; min-height: calc(100vh - 92px); min-height: calc(100svh - 92px); overflow: hidden; }
.city { position: absolute; left: 0; bottom: 0; width: 100%; height: 64vh; height: 64svh; image-rendering: pixelated; image-rendering: crisp-edges; pointer-events: none; z-index: 0; }
.city-tags { position: absolute; left: 0; bottom: 0; width: 100%; height: 64vh; height: 64svh; z-index: 1; pointer-events: none; }
.ctag { position: absolute; transform: translate(-50%, calc(-100% - 9px)); pointer-events: auto; background: #fff; color: #161a3a; border: 2px solid #161a3a; border-radius: 9px; padding: 3px 9px 4px; font-size: 14px; font-weight: 700; line-height: 1.2; white-space: nowrap; box-shadow: 0 3px 0 rgba(22,26,58,.35); transition: background .15s, transform .15s; }
.ctag::after { content: ''; position: absolute; left: 50%; bottom: -8px; width: 10px; height: 10px; margin-left: -5px; background: inherit; border: solid #161a3a; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ctag.open { background: var(--cta); transform: translate(-50%, calc(-100% - 9px)) scale(1.12); z-index: 2; }
.hero { position: relative; z-index: 2; width: min(600px, 100% - 48px); margin: 0 auto; padding-top: clamp(12px, calc(22vh - 70px), 170px); text-align: center; }   /* mittig im Himmel zwischen Kopf und Skyline */
.hero h1 { font-size: clamp(22px, 2.5vw, 30px); font-weight: 600; line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; }
.play { display: inline-grid; gap: 6px; margin-top: 26px; padding: 22px 46px 20px; border-radius: 22px; box-shadow: 0 8px 0 var(--cta-edge), 0 18px 30px -12px rgba(22, 26, 58, .45); font-size: clamp(26px, 3.1vw, 36px); font-weight: 800; line-height: 1.1; letter-spacing: -.01em; }
.play:active { transform: translateY(6px); box-shadow: 0 2px 0 var(--cta-edge); }
.play small { font-size: 14px; font-weight: 500; letter-spacing: 0; opacity: .8; }
.hero-sub { margin-top: 20px; font-size: 14px; color: var(--muted); display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.banner { display: inline-block; margin-top: 16px; background: var(--brand); color: #fff; padding: 9px 16px; border-radius: 999px; font-weight: 500; font-size: 15px; }

.rail { position: absolute; z-index: 3; top: 0; right: 24px; width: 268px; }
.rail h2 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 10px 4px; }
.rail-cards { display: grid; gap: 12px; }
.rcard { display: block; width: 100%; text-align: left; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 0; overflow: hidden; box-shadow: 0 3px 0 var(--line); position: relative; transition: transform .1s, border-color .1s; }
.rcard:not(:disabled):hover { transform: translateY(-2px); border-color: var(--ink); }
.rcard canvas { display: block; width: 100%; height: 92px; background: var(--rc-bg, #f6f4ec); image-rendering: pixelated; image-rendering: crisp-edges; }
.rcard .rc-txt { display: block; padding: 9px 13px 11px; border-top: 1px solid var(--line); }
.rcard b { display: block; font-size: 16px; font-weight: 700; line-height: 1.2; }
.rcard small { display: block; font-size: 13px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.rcard:disabled { cursor: default; color: inherit; }
.rcard:disabled canvas { filter: saturate(.55); opacity: .8; }
.rc-soon { position: absolute; top: 8px; right: 8px; background: var(--ink); color: var(--bg); font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.edition-switch { position: absolute; z-index: 4; left: 10px; bottom: 8px; display: flex; gap: 4px; align-items: center; font-size: 11px; background: rgba(255,255,255,.9); color: #161a3a; padding: 4px 6px; border-radius: 8px; }
.edition-switch button { border: 1px solid #c9c5b6; background: #fff; color: #161a3a; border-radius: 6px; font-size: 11px; padding: 2px 7px; }
.edition-switch button.on { background: #161a3a; color: #fff; }
.dev-bar { position: fixed; z-index: 99; left: 10px; bottom: 10px; display: flex; gap: 6px; align-items: center; font: 600 11px/1 system-ui, sans-serif; background: #161a3a; color: #ffd84d; padding: 6px 8px; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.25); opacity: .55; transition: opacity .15s; }
.dev-bar:hover { opacity: 1; }
.dev-bar button { border: 0; background: #fff; color: #161a3a; border-radius: 5px; font: inherit; padding: 5px 8px; cursor: pointer; }

/* ---------- Spielrunde: wie ein Exposé ---------- */
#view-game { max-width: 2200px; margin: 0 auto; padding: 14px 24px 0; }
.ex-head h1 { font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.ex-loc { color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pin-ico { width: 10px; height: 14px; background: var(--bad); clip-path: polygon(50% 100%, 0 40%, 0 0, 100% 0, 100% 40%); border-radius: 3px; flex: none; }
.badge-sponsored { background: var(--soft); border: 1px solid var(--line); font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 999px; color: var(--ink); }
/* Breite und Höhe der Galerie setzt layoutGame() in game.js passend zu Bildschirm und Fotoformat */
.badge-conv { font-size: 12.5px; padding: 1px 9px; border-radius: 999px; background: color-mix(in srgb, var(--cta) 30%, transparent); color: var(--ink); }
.expose { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: stretch; margin-top: 12px; }
.gallery { position: relative; background: #12142a; border-radius: var(--r); overflow: hidden; aspect-ratio: 3 / 2; min-height: 250px; width: 100%; isolation: isolate; }
.ph-bg { position: absolute; inset: -40px; background: center / cover no-repeat; filter: blur(28px) brightness(.72) saturate(1.1); z-index: -1; }
.gallery #photo { position: relative; width: 100%; height: 100%; object-fit: contain; display: block; cursor: zoom-in; }
/* Pfeile: sichtbar nur der Kreis, klickbar ist aber der ganze Randstreifen links/rechts */
.gallery .nav { z-index: 1; position: absolute; top: 0; bottom: 0; width: min(22%, 150px); padding: 0; border: 0; background: transparent; display: flex; align-items: center; -webkit-tap-highlight-color: transparent; }
.gallery .prev { left: 0; justify-content: flex-start; padding-left: 12px; }
.gallery .next { right: 0; justify-content: flex-end; padding-right: 12px; }
.gallery .nav i { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,.92); box-shadow: 0 2px 8px rgba(0,0,0,.25); transition: transform .12s, background .12s; }
.gallery .nav:hover i { transform: scale(1.1); background: #fff; }
.gallery .nav:active i { transform: scale(.95); }
.gallery .nav i::before { content: ''; width: 11px; height: 11px; border: solid #161a3a; border-width: 0 0 3px 3px; transform: translateX(2px) rotate(45deg); }
.gallery .next i::before { transform: translateX(-2px) rotate(-135deg); }
.gallery .nav:focus-visible { outline: 0; } .gallery .nav:focus-visible i { outline: 3px solid var(--brand); outline-offset: 2px; }
.gallery .count { z-index: 1; position: absolute; right: 12px; bottom: 12px; background: rgba(18,20,42,.8); color: #fff; font-size: 13px; padding: 3px 10px; border-radius: 999px; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding: 3px; }
.thumbs button { flex: 0 0 auto; width: 84px; height: 58px; padding: 0; border: 0; border-radius: 9px; overflow: hidden; background: #12142a; opacity: .55; }
.thumbs button:hover { opacity: .85; }
.thumbs button.on { opacity: 1; outline: 3px solid var(--brand); outline-offset: 0; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.disclaimer { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.col-info { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; min-width: 0; }
.card h2 { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
/* Eckdaten als Kacheln: sieht mit 4 genauso aufgeräumt aus wie mit 10 */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 4px 0 0; }
.facts > div { background: var(--bg); border: 1px solid var(--soft); border-radius: 10px; padding: 9px 12px 10px; min-width: 0; }
.facts > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.facts dt { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.facts dd { margin: 2px 0 0; font-size: 17px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.facts small { font-weight: 400; color: var(--muted); font-size: .78em; }
.map-card { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#map { flex: 1; min-height: 240px; border-radius: 10px; background: #e4e9ee; z-index: 0; margin-top: 4px; }
.map-note { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.pin { background: var(--bad); clip-path: polygon(50% 100%, 0 45%, 0 0, 100% 0, 100% 45%); }
.pin::after { content: ''; position: absolute; left: 7px; top: 5px; width: 8px; height: 8px; background: #fff; border-radius: 50%; }
.map-circle { stroke: var(--bad); stroke-width: 3; fill: var(--bad); fill-opacity: .16; stroke-dasharray: 6 6; }

/* Tipp-Leiste unten */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 650; background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -18px rgba(22,26,58,.4); padding: 14px 24px 16px; }
.dock-in { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: minmax(220px, auto) minmax(0, 1fr) auto; gap: 28px; align-items: center; }
.dock label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); }
.readout { display: flex; align-items: baseline; gap: 8px; }
.readout input { border: 0; background: transparent; outline: 0; padding: 0; width: 9.2ch; font-size: 34px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; font-variant-numeric: tabular-nums; border-bottom: 2px dashed transparent; }
.readout input:hover, .readout input:focus { border-bottom-color: var(--line); }
.readout input::placeholder { color: var(--muted); font-size: 22px; font-weight: 500; letter-spacing: 0; opacity: 1; }
.readout span { font-size: 14px; color: var(--muted); white-space: nowrap; }
.verdict { font-size: 15px; margin-top: 2px; }
.verdict b { font-weight: 700; }
.dock[data-level="0"] .verdict b { color: var(--bad); }
.dock[data-level="1"] .verdict b, .dock[data-level="2"] .verdict b { color: var(--mid); }
.dock[data-level="3"] .verdict b, .dock[data-level="4"] .verdict b { color: var(--good); }
.dock-go { display: flex; align-items: center; gap: 18px; }
.dock-go .go { min-width: 190px; font-size: 19px; padding: 16px 26px; }
.points { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.funfact { max-width: 1180px; margin: 12px auto 0; font-size: 15px; padding-top: 12px; border-top: 1px solid var(--soft); }
.sponsor-link { display: block; max-width: 1180px; margin: 6px auto 0; font-weight: 600; color: var(--brand); }

.slider { --tw: 38px; --f: 0; position: relative; padding: 26px 0 22px; }
.slider input[type=range] { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 38px; margin: 0; background: transparent; cursor: grab; }
.slider input[type=range]:active { cursor: grabbing; }
.slider input[type=range]::-webkit-slider-runnable-track { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--brand) calc(var(--tw) / 2 + var(--f) * (100% - var(--tw))), var(--soft) 0); }
.slider input[type=range]::-moz-range-track { height: 12px; border-radius: 6px; background: var(--soft); }
.slider input[type=range]::-moz-range-progress { height: 12px; border-radius: 6px; background: var(--brand); }
.slider input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 38px; height: 38px; margin-top: -13px; border-radius: 50%; background: var(--cta); border: 4px solid var(--ink); box-shadow: 0 3px 0 rgba(22,26,58,.35); }
.slider input[type=range]::-moz-range-thumb { width: 30px; height: 30px; border-radius: 50%; background: var(--cta); border: 4px solid var(--ink); }
.dock[data-state="idle"] .slider input[type=range]::-webkit-slider-thumb { animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { box-shadow: 0 3px 0 rgba(22,26,58,.35), 0 0 0 0 rgba(255,207,36,.9); } 50% { box-shadow: 0 3px 0 rgba(22,26,58,.35), 0 0 0 12px rgba(255,207,36,0); } }
.dock[data-state="done"] .slider input[type=range] { pointer-events: none; }
.dock[data-state="done"] .slider input[type=range]::-webkit-slider-thumb { visibility: hidden; }
.dock[data-state="done"] .slider input[type=range]::-moz-range-thumb { visibility: hidden; }
.dock[data-state="done"] .slider input[type=range]::-webkit-slider-runnable-track { background: var(--soft); }
.ticks { position: absolute; left: calc(var(--tw) / 2); right: calc(var(--tw) / 2); bottom: 0; height: 20px; font-size: 12px; color: var(--muted); }
.ticks span { position: absolute; top: 4px; transform: translateX(-50%); white-space: nowrap; }
.ticks span::before { content: ''; position: absolute; left: 50%; top: -9px; width: 1px; height: 6px; background: var(--line); }
.mark { position: absolute; left: calc(var(--tw) / 2 + var(--p) * (100% - var(--tw))); top: 26px; width: 0; height: 38px; z-index: 2; pointer-events: none; }
.mark::before { content: ''; position: absolute; left: -9px; top: 10px; width: 18px; height: 18px; border-radius: 50%; border: 4px solid var(--ink); background: var(--cta); }
.mark-ask::before { background: var(--good); border-color: #fff; outline: 3px solid var(--good); left: -8px; top: 11px; width: 16px; height: 16px; }
.mark span { position: absolute; left: 0; transform: translateX(-50%); white-space: nowrap; font-size: 13px; font-weight: 600; background: var(--ink); color: #fff; padding: 2px 9px; border-radius: 999px; }
.mark-ask span { bottom: 34px; background: var(--good); }
.mark-you span { top: 34px; z-index: 3; }
.mark.edge-l span { transform: translateX(-20%); } .mark.edge-r span { transform: translateX(-80%); }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- Success Screen ---------- */
#view-result { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
body[data-view="result"] { overflow-x: clip; }   /* Stadt unten geht über die volle Breite (100vw), ohne Querscrollen */
.res-layout { display: grid; grid-template-columns: minmax(0, 1fr) 316px; grid-template-rows: auto 1fr; grid-template-areas: "score side" "rounds side"; gap: 18px 22px; align-items: start; margin-top: 10px; }
.res-layout.no-share { grid-template-columns: minmax(0, 1fr); grid-template-areas: "score" "rounds" "side"; max-width: 760px; margin-left: auto; margin-right: auto; }
.res-score { grid-area: score; } .res-rounds { grid-area: rounds; }
.res-side { grid-area: side; display: grid; gap: 16px; align-self: start; }

/* Bestenliste rechts, oben die Verteilung */
.res-lb { padding: 16px; }
.dist { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--soft); }
.dist-head b { display: block; font-size: 19px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
.dist-plot { position: relative; margin-top: 12px; cursor: crosshair; }
.dist-plot svg { display: block; width: 100%; height: 84px; overflow: visible; }
.db { fill: var(--brand); opacity: .28; transition: opacity .1s; }
.db.hov { opacity: .55; }
.db.me { fill: var(--cta); opacity: 1; stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.dbase { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.dist-you { position: absolute; transform: translate(-50%, -6px); font-size: 11.5px; font-weight: 700; background: var(--ink); color: #fff; padding: 1px 8px; border-radius: 999px; pointer-events: none; white-space: nowrap; }
.dist-tip { position: absolute; bottom: calc(100% + 6px); transform: translateX(-50%); background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 18px -8px rgba(22,26,58,.35); border-radius: 8px; padding: 5px 9px; font-size: 12.5px; line-height: 1.35; white-space: nowrap; pointer-events: none; z-index: 2; }
.dist-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.dist-note { font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.res-lb .lb li { padding: 6px 8px; font-size: 14.5px; }

/* Score-Karte */
.res-score { text-align: center; padding: 22px 30px 24px; box-shadow: 0 4px 0 var(--line); }
.result-day { font-weight: 500; color: var(--muted); font-size: 15px; }
.res-total { font-size: clamp(58px, 8.5vw, 100px); font-weight: 800; line-height: 1.02; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.res-total small { font-size: .26em; font-weight: 500; color: var(--muted); letter-spacing: 0; }

/* Stufen-Regler: 5 Abschnitte, die oberen drei Bronze/Silber/Gold. --f = erreichter Anteil */
.tierbar { --f: 0; position: relative; max-width: 560px; margin: 18px auto 0; padding-bottom: 26px; }
.tb-track { position: relative; height: 16px; border-radius: 8px; overflow: hidden; background: var(--soft); }
.tb-base, .tb-lit { position: absolute; inset: 0; }
.tb-base .tb-seg { background: var(--soft); }
.tb-lit .tb-seg { background: var(--cta); }   /* eine Farbe: Akzent 2 (Gelb). Die Stufen trennt nur ein feiner Spalt */
.tb-lit { clip-path: inset(0 calc(100% - var(--f) * 100%) 0 0); }
.tb-seg { --m2: #c9c3b2; position: absolute; top: 0; bottom: 0; background: var(--m2); box-shadow: inset -2px 0 0 var(--panel); }
.tb-seg:last-child { box-shadow: none; }
.tb-knob { position: absolute; left: calc(var(--f) * 100%); top: -9px; width: 34px; height: 34px; margin-left: -17px; border-radius: 50%; background: var(--cta); border: 4px solid var(--ink); box-shadow: 0 3px 0 rgba(22,26,58,.35); }
.tb-marks { position: absolute; left: 0; right: 0; top: 26px; height: 18px; }
.tb-marks .medal { position: absolute; transform: translateX(-50%) scale(.85); opacity: .35; filter: grayscale(.6); transition: opacity .2s, filter .2s; }
.tb-marks .medal.on { opacity: 1; filter: none; animation: pop .45s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { 0% { transform: translateX(-50%) scale(.6); } 60% { transform: translateX(-50%) scale(1.5); } 100% { transform: translateX(-50%) scale(.85); } }

/* Medaille (CSS): data-t 0..4, 2 = Bronze, 3 = Silber, 4 = Gold */
.medal { --m1: #eeeae0; --m2: #c9c3b2; --m3: #a39d8b; position: relative; display: inline-block; width: 60px; height: 60px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 34% 28%, var(--m1), var(--m2) 72%); box-shadow: inset 0 0 0 4px rgba(255,255,255,.4), 0 4px 0 var(--m3); }
.medal::after { content: '★'; position: absolute; inset: 0; display: grid; place-items: center; line-height: 1; color: var(--m3); font-size: 30px; }
[data-t="1"] { --m1: #e6ebfd; --m2: #8fa0e6; --m3: #5f70bd; }
[data-t="2"] { --m1: #f6c49b; --m2: #c77a3c; --m3: #94562a; }
[data-t="3"] { --m1: #f7f9fb; --m2: #b4bfcd; --m3: #7f8b9c; }
[data-t="4"] { --m1: #fff0a8; --m2: #f2b600; --m3: #b98300; }
.medal[data-t="2"]::before, .medal[data-t="3"]::before, .medal[data-t="4"]::before { content: ''; position: absolute; z-index: -1; left: 50%; top: -20px; width: 34px; height: 34px; margin-left: -17px;
  background: linear-gradient(90deg, var(--brand) 38%, var(--cta) 38% 62%, var(--brand) 62%); clip-path: polygon(0 0, 100% 0, 78% 100%, 22% 100%); }
.medal.mini { width: 18px; height: 18px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.4), 0 2px 0 var(--m3); }
.medal.mini::after { font-size: 10px; }
.medal.mini::before { display: none; }
.medal.flying { position: fixed; z-index: 3000; margin: 0; pointer-events: none; animation: none !important; }
.medal.flying::before { display: none; }

.tier { display: inline-flex; align-items: center; gap: 16px; margin-top: 18px; text-align: left; isolation: isolate; padding-top: 14px; }
.tier-txt small { display: block; font-size: 13px; color: var(--muted); font-weight: 500; }
.tier-txt b { display: block; font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; line-height: 1.15; letter-spacing: -.01em; }
.tier-hint { margin-top: 12px; font-size: 15.5px; color: var(--muted); display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap; }
.record { background: var(--cta); color: var(--cta-ink); font-weight: 700; font-size: 13px; padding: 3px 11px; border-radius: 999px; }
/* vor dem Einrasten: Rang und Hinweis noch unsichtbar, dann kurz rein */
.res-score:not(.settled) .tier, .res-score:not(.settled) .tier-hint { opacity: 0; transform: translateY(8px) scale(.96); }
.res-score.settled .tier { animation: rise .5s cubic-bezier(.3,1.4,.5,1) both; }
.res-score.settled .tier .medal { animation: medal-in .7s cubic-bezier(.3,1.6,.5,1) both; }
.res-score.settled .tier-hint { animation: rise .45s .25s ease-out both; }
.res-score.settled .tb-knob { animation: knob .4s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes medal-in { 0% { transform: scale(.3) rotate(-30deg); } 60% { transform: scale(1.18) rotate(8deg); } 100% { transform: none; } }
@keyframes knob { 50% { transform: scale(1.25); } }

/* Teilen: groß, gelb, direkt neben dem Ergebnis */
.share-card { padding: 18px; display: grid; gap: 14px; justify-items: stretch; text-align: center; box-shadow: 0 4px 0 var(--line); }
.share-main { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 22px; font-weight: 800; padding: 19px 20px; border-radius: 16px; box-shadow: 0 6px 0 var(--cta-edge); }
.share-main svg { width: 26px; height: 26px; flex: none; }
.share-main.nudge { animation: ring 1.3s ease-out 3; }
@keyframes ring { 0% { box-shadow: 0 6px 0 var(--cta-edge), 0 0 0 0 rgba(255,207,36,.85); } 100% { box-shadow: 0 6px 0 var(--cta-edge), 0 0 0 16px rgba(255,207,36,0); } }
.share-icons { display: flex; justify-content: center; gap: 12px; }
.si { width: 50px; height: 50px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; padding: 0; text-decoration: none; transition: transform .1s; box-shadow: 0 3px 0 rgba(22,26,58,.25); }
.si:hover { transform: translateY(-2px); }
.si:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(22,26,58,.25); }
.si svg { width: 24px; height: 24px; }
.si-wa { background: #25d366; }
.si-x { background: #111; }
.si-ig { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.si-link { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.duel-link { justify-self: center; font-size: 15px; }
.res-bonus canvas { height: 88px; }
.ad-slot { border: 1px dashed var(--line); border-radius: var(--r); background: var(--panel); min-height: 250px; padding: 8px; text-align: center; }

/* Runden */
.rounds { width: 100%; border-collapse: collapse; }
.rounds td { padding: 9px 6px; border-bottom: 1px solid var(--soft); vertical-align: middle; }
.rounds tr:last-child td { border-bottom: 0; }
.rounds .th { width: 78px; padding-left: 0; }
.rounds .th img { width: 70px; height: 50px; object-fit: cover; display: block; border-radius: 8px; }
.rounds .th a { display: block; border-radius: 8px; transition: opacity .1s; } .rounds .th a:hover { opacity: .8; }
.r-title { font-weight: 600; }
a.r-title { color: var(--ink); text-decoration: underline; text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a.r-title:hover { color: var(--brand); }
a.r-title .ext { width: 12px; height: 12px; margin-left: 5px; vertical-align: 0; color: var(--brand); }
.rounds small { color: var(--muted); font-size: 13px; }
.rounds .diff { white-space: nowrap; }
.rounds .pts { text-align: right; font-size: 22px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rounds .pts small { display: block; font-size: 12px; font-weight: 400; }
.lv0 { color: var(--bad); } .lv1, .lv2 { color: var(--mid); } .lv3, .lv4 { color: var(--good); }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tab { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 15px; font-size: 14px; font-weight: 500; }
.tab.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.lb { list-style: none; margin: 0; padding: 0; }
.lb li { display: flex; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--soft); align-items: baseline; border-radius: 8px; }
.lb li:last-child { border-bottom: 0; }
.lb .pos { width: 2em; color: var(--muted); }
.lb .who { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb b { font-variant-numeric: tabular-nums; }
.lb .me { background: var(--cta); }
.lb .me .pos { color: inherit; }
.lb .empty { color: var(--muted); font-size: 14px; }

/* Abschluss "Bis morgen": dieselbe Stadt wie auf der Startseite, gleiche Höhe = gleiche Proportionen */
.city-end { --sky: var(--bg); position: relative; width: 100vw; margin: 40px 0 0 calc(50% - 50vw); background: linear-gradient(var(--bg), var(--sky) 140px); text-align: center; }
body[data-edition="snow"] .city-end { --sky: #e3ebf3; }
body[data-edition="miami"] .city-end { --sky: #fdf0e0; }
body[data-edition="vermont"] .city-end { --sky: #dff1fb; }
body[data-edition="norway"] .city-end { --sky: #e6eef3; }
body[data-edition="germany"] .city-end { --sky: #eef3e8; }
body[data-edition="night"] .city-end { --sky: #101737; color: #f2f3fb; }
body[data-edition="night"] .city-end .end-next, body[data-edition="night"] .city-end .end-streak { color: #aab0d4; }
.end-hero { position: relative; z-index: 1; padding: 36px 24px 0; }
.end-hero h2 { font-size: clamp(30px, 4vw, 44px); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.end-next { margin-top: 6px; font-size: 17px; color: var(--muted); font-variant-numeric: tabular-nums; }
.end-streak { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.end-hero .btn { display: block; margin: 18px auto 0; }
.city-foot { display: block; width: 100%; height: 64vh; height: 64svh; min-height: 380px; max-height: 720px; margin-top: -40px; image-rendering: pixelated; image-rendering: crisp-edges; }
.foot { font-size: 12.5px; color: var(--muted); text-align: center; padding: 12px 0 18px; }

/* Fuß: Impressum, Datenschutz, Versionszeile. Klein und grau, in der Spielrunde aus. */
.site-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 10px 16px 16px; }
.site-foot a { color: inherit; }
.site-foot .ver { margin-top: 4px; font-size: 11px; opacity: .8; font-variant-numeric: tabular-nums; }
.site-foot .ver:empty { display: none; }
body[data-view="game"] .site-foot { display: none; }
body[data-view="result"] .foot { padding-bottom: 4px; }

/* Vorschau-Modus (?day=): gut sichtbarer Streifen ganz oben */
.preview-bar { position: relative; z-index: 1000; display: flex; gap: 10px; justify-content: center; align-items: baseline; flex-wrap: wrap; background: var(--cta); color: var(--cta-ink); font-size: 14px; padding: 7px 16px; border-bottom: 2px solid var(--ink); text-align: center; }
.preview-bar span { font-size: 12.5px; }
.preview-reset { margin-top: 14px; text-align: center; }

/* Serie + Medaillen */
.chip.bump { animation: bump .6s cubic-bezier(.3,1.6,.5,1); border-color: var(--cta-edge); }
@keyframes bump { 40% { transform: scale(1.25); background: var(--cta); } }
.sk { min-width: min(400px, 88vw); }
.sk-head { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.sk-head .flame { width: 22px; height: 28px; }
.sk-head b { font-size: 44px; font-weight: 800; line-height: 1; }
.sk-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 6px; }
.sk-stats div { background: var(--bg); border-radius: 12px; padding: 10px; text-align: center; }
.sk-stats b { display: block; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sk-stats small { color: var(--muted); font-size: 12.5px; }
.sk h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 16px 0 10px; }
.sk-medals { display: flex; gap: 10px; }
.sk-medal { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 22px 6px 10px; background: var(--bg); border-radius: 12px; isolation: isolate; }
.sk-medal .medal { width: 44px; height: 44px; margin-bottom: 6px; }
.sk-medal .medal::after { font-size: 22px; }
.sk-medal .medal::before { top: -15px; width: 26px; height: 24px; margin-left: -13px; }
.sk-medal b { font-size: 18px; } .sk-medal small { font-size: 12px; color: var(--muted); }
.sk-medal.none { opacity: .45; }
.sk-days { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; }
.sk-day { aspect-ratio: 1; border-radius: 6px; border: 1.5px dashed var(--line); display: grid; place-items: center; }
.sk-day.played { border: 0; background: var(--bg); }
.sk-day.today { outline: 2px solid var(--brand); outline-offset: 1px; }
.sk-day .medal.mini { width: 70%; height: 70%; }
.sk-day .medal.mini::after { font-size: 8px; }

/* ---------- Dialoge ---------- */
dialog { border: 0; border-radius: 20px; background: var(--panel); color: var(--ink); padding: 0; max-width: min(460px, 92vw); box-shadow: 0 30px 60px -20px rgba(22,26,58,.5); }
dialog::backdrop { background: rgba(16, 20, 48, .55); }
.dlg { padding: 26px; }
.dlg h2 { font-size: 24px; font-weight: 700; line-height: 1.2; margin-bottom: 8px; }
.dlg p { margin: 0 0 14px; }
.dlg input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-size: 18px; background: var(--bg); }
.dlg .cta-row { justify-content: flex-start; margin-top: 16px; }
.group-code b { font-size: 22px; font-weight: 700; letter-spacing: 2px; background: var(--cta); padding: 1px 10px; border-radius: 8px; }
#dlg-photo { max-width: 96vw; max-height: 96vh; background: #000; cursor: zoom-out; border-radius: 12px; }
#dlg-photo img { max-width: 96vw; max-height: 94vh; display: block; }
.toast { position: fixed; left: 50%; top: 84px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 500; z-index: 2000; max-width: 92vw; text-align: center; }

/* ---------- schmal ---------- */
@media (max-width: 1099px) {
  .rail { position: static; width: auto; padding: 22px 24px 30px; }
  .rail-cards { grid-template-columns: repeat(3, minmax(220px, 1fr)); overflow-x: auto; padding-bottom: 6px; }
}
@media (max-width: 899px) {
  .top { padding: 10px 14px 6px; gap: 8px; }
  .lg-x { font-size: 24px; padding: 8px 12px 10px; border-radius: 12px 12px 12px 3px; }
  .lg-d { font-size: 12px; padding: 5px 8px; }
  .chip { padding: 6px 11px; font-size: 13px; } #btn-name { max-width: 30vw; }
  body[data-view="game"] .top { grid-template-columns: auto 1fr auto; }
  body[data-view="game"] .logo .lg-d { display: none; }
  body[data-view="game"] .lg-x { font-size: 17px; padding: 6px 9px 7px; }
  .timer { min-width: 104px; padding: 4px 14px 6px; } .timer b { font-size: 21px; }
  .top-right { gap: 8px; } .hud { font-size: 13px; } .rbars { gap: 3px; } .rbars i { width: 11px; height: 6px; border-radius: 3px; }
  body[data-view="game"] .timer { min-width: 0; padding: 4px 10px 6px; justify-self: center; }
  .hero { padding-top: 14px; }
  .play { width: 100%; padding: 20px 20px 18px; }
  .city, .city-tags { height: 56vh; height: 56svh; }
  .ctag { font-size: 12px; padding: 2px 7px 3px; }
  .rail { padding: 20px 14px 26px; }
  #view-game { padding: 12px 14px 0; }
  .expose { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  /* Success Screen schmal: Score, gleich danach Teilen, dann Runden, Bonus, Bestenliste, Werbung */
  .res-layout, .res-layout.no-share { grid-template-columns: minmax(0, 1fr); grid-template-areas: "score" "share" "lb" "rounds" "bonus" "ad"; gap: 14px; }
  .res-lb { grid-area: lb; }
  .res-layout { grid-template-rows: none; }
  .res-side { display: contents; }
  .share-card { grid-area: share; } .res-bonus { grid-area: bonus; } .ad-slot { grid-area: ad; }
  .res-score { padding: 18px 16px 20px; }
  .share-main { font-size: 20px; padding: 17px 16px; }
  .rounds .th { width: 62px; } .rounds .th img { width: 56px; height: 42px; }
  .rounds .pts { font-size: 18px; }
  .city-foot { height: 56vh; height: 56svh; min-height: 340px; }
  .end-hero { padding-top: 28px; }
  .gallery { max-height: 62svh; border-radius: 12px; }
  #map { flex: none; height: 300px; }
  .dock { padding: 10px 14px 12px; }
  .dock-in { grid-template-columns: 1fr auto; gap: 4px 12px; }
  .slider { grid-column: 1 / -1; grid-row: 2; padding: 22px 0 20px; }
  .mark { top: 22px; }
  .dock-read { min-width: 0; } .readout input { font-size: 24px; width: 100%; min-width: 0; } .readout input::placeholder { font-size: 17px; }
  .dock-go .go { white-space: nowrap; }
  .dock-go { gap: 10px; } .dock-go .go { min-width: 0; font-size: 16px; padding: 13px 16px; }
  .points { font-size: 22px; }
  .ticks span:nth-child(even) { display: none; }
  .funfact { font-size: 14px; }
  #view-result { padding: 0 14px; }
  .cta-row .go, .cta-row .btn { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
