/* Topptur – utseende. Se DESIGN.md for valgene bak. */
@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}

:root {
  --natt: #0c2340;      /* blekk: flaggblå */
  --natt-2: #46607c;    /* dempet tekst */
  --merke: #d4281c;     /* hytterødt: deg, treffet, hastverk */
  --sno: #ffffff;
  --strek: #d5dfe7;
  --kol: min(100vw, 480px);
  --k: 1;               /* skjermbredde / 390. Settes fra app.js, så figurene følger fjellet. */
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--natt);
  background: var(--natt);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
p, h1, h2, h3, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Rammen fyller hele skjermen og endrer ikke størrelse når tastaturet kommer opp.
   Fjellet ligger bak tastaturet; app.js flytter bare turgåeren over det. */
#app {
  position: fixed;
  top: 0;
  left: 50%;
  width: var(--kol);
  margin-left: calc(var(--kol) / -2);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #17479a;
}

/* ---------- turen: sidevisning ---------- */
#stage { position: absolute; inset: 0; overflow: hidden; background: #17479a; touch-action: none; }
#stage, #top, #sheet, #intro, .btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
#top input { -webkit-user-select: text; user-select: text; }
#sky, #sun, .strip, #world { position: absolute; left: 0; top: 0; will-change: transform; }
#sky { width: 100%; background: linear-gradient(to top, #ffe6c2 0%, #f3ead6 6%, #c9e6f1 16%, #9bd0ec 34%, #5fa8df 58%, #2b70c4 82%, #163f96 100%); }
#sun { border-radius: 50%; background: radial-gradient(circle, rgba(255, 250, 225, .98) 0 9%, rgba(255, 240, 190, .5) 10%, rgba(255, 236, 180, .16) 34%, rgba(255, 236, 180, 0) 62%); }
/* Utsikten ligger i lange remser som gjentar seg, og flyttes saktere enn stien. */
.strip svg { display: block; width: 100%; height: auto; }
/* Skyene driver sakte. Flisa er to like halvdeler, så den kan gå i ring uten skjøt. */
#skyer svg { animation: driv 260s linear infinite; }
@keyframes driv { to { transform: translateX(-50%); } }
/* Forgrunnen: tre utgaver oppå hverandre (skog, fjell, is). Høyden bestemmer hvilken som synes. */
#fore { z-index: 2; height: 0; }
.fz { position: absolute; left: 0; top: 0; width: 100%; opacity: 0; }
/* Dagen går: sola flytter seg for hvert spørsmål, og lyset blir varmere mot kveld. Resultatet er kveldsbildet. */
#sun { transition: margin-left 1.4s ease, margin-top 1.4s ease; }
#stage[data-tid="2"] #sun { margin-left: 18%; }
#stage[data-tid="3"] #sun { margin-left: 36%; margin-top: -2%; }
#stage[data-tid="4"] #sun { margin-left: 54%; margin-top: 3%; }
#stage[data-tid="5"] #sun { margin-left: 68%; margin-top: 16%; }
#lys { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 1.4s ease; background: linear-gradient(to top, rgba(255, 150, 70, .5), rgba(255, 190, 110, .26) 40%, rgba(255, 214, 150, .08) 75%, rgba(255, 220, 160, 0)); }
#stage[data-tid="1"] #lys { opacity: .28; background: linear-gradient(to top, rgba(255, 190, 170, .5), rgba(255, 214, 190, .24) 45%, rgba(255, 226, 200, 0)); }
#stage[data-tid="4"] #lys { opacity: .22; }
#stage[data-tid="5"] #lys { opacity: .5; }
/* Gullregn og konfetti. */
.gullregn { position: absolute; z-index: 4; width: 0; height: 0; pointer-events: none; }
.gullregn i { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 2px; opacity: 0; animation: dryss 1.1s cubic-bezier(.1, .7, .3, 1) both; }
@keyframes dryss { 0% { opacity: 1; transform: translate(0, 0) rotate(0); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 46px)) rotate(300deg); } }
#world { width: 0; height: 0; }
#back, #ground, #front, #signs { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.bit { position: absolute; }
.bit svg { display: block; width: 100%; height: 100%; overflow: visible; }
.bit text { font-family: "Schibsted Grotesk", system-ui, sans-serif; }
#haze { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to bottom, rgba(238, 246, 251, .3) 0, rgba(238, 246, 251, 0) 22%); }

/* Hytta med grunnmur kommer til syne der du stopper: den reiser seg fra bakken, og så heises vimpelen. */
.hut, .tre { position: absolute; }
.hut svg, .tre svg { display: block; width: 100%; height: 100%; overflow: visible; }
.hut text, .tre text { font-family: "Schibsted Grotesk", system-ui, sans-serif; }
.hut { transform-origin: 46% 62%; transition: transform .38s cubic-bezier(.2, 1.5, .4, 1), opacity .16s ease; }
.hut.arriving { transform: scale(.6) translateY(14%); opacity: 0; }
.hut .vimpel { transform-box: fill-box; transform-origin: 0 50%; transition: transform .3s cubic-bezier(.2, 1.6, .4, 1) .3s; }
.hut.arriving .vimpel { transform: scaleX(0); }
.smoke { position: absolute; width: 0; height: 0; }
.smoke i { position: absolute; left: calc(-4px * var(--k)); top: calc(-4px * var(--k)); width: calc(8px * var(--k)); height: calc(8px * var(--k)); border-radius: 50%; background: #fff; opacity: 0; animation: royk 3.2s ease-out infinite; }
.smoke i:nth-child(2) { animation-delay: 1.05s; }
.smoke i:nth-child(3) { animation-delay: 2.1s; }
@keyframes royk { 0% { opacity: 0; transform: translate(0, 2px) scale(.5); } 18% { opacity: .85; } 100% { opacity: 0; transform: translate(14px, -30px) scale(1.9); } }

/* Skiltene langs stien under turen: ett for hvert nivå. Annenhvert står på høy stolpe, så de ikke dekker hverandre. */
.skilt { position: absolute; width: 0; height: 0; transition: opacity .25s ease; }
.skilt i { position: absolute; left: -2px; bottom: -3px; width: 4px; height: 50px; border-radius: 2px; background: #6b4a31; }
.skilt.hoy i { height: 88px; }
.skilt b { position: absolute; left: 0; bottom: 34px; transform: translateX(-50%); display: block; background: #f3e2ba; color: #3d2a1a; border: 1.5px solid #6b4a31; border-radius: 5px; padding: 2px 9px 3px; font-size: 12.5px; line-height: 1.15; font-weight: 800; white-space: nowrap; text-align: center; transition: background-color .15s ease, color .15s ease, border-color .15s ease; }
.skilt.hoy b { bottom: 72px; }
.skilt em { display: block; font-style: normal; font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }
/* Passerte skilt er værbitte og dekkende (ikke gjennomsiktige), og de gir et lite hakk idet han går forbi. */
.skilt.passed b { background: #ddd3b8; border-color: #9c8c74; color: #8a7a66; animation: hakk .26s ease-out; }
.skilt.passed i { background: #8c7a66; }
@keyframes hakk { 0% { background: #ffd45e; color: #3d2a1a; } 35% { transform: translateX(-50%) scale(1.14); background: #ffd45e; color: #3d2a1a; } 100% { transform: translateX(-50%); } }
/* Skiltet han stopper ved, blir rødt og løftes på høy stolpe, så det står klart av lua hans. */
.skilt i { transition: height .22s ease; }
.skilt b { transition: bottom .22s ease, background-color .15s ease, color .15s ease, border-color .15s ease; }
.skilt.hit i { height: 88px; }
.skilt.hit b { bottom: 72px; background: var(--merke); border-color: #7d1a13; color: #fff; }
.skilt.gone { opacity: 0; }

/* Turgåeren. Ankeret er føttene. Én tegning med ledd: lår og legg hver for seg, så han går med knær. */
#me { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 3; will-change: transform; }
.fig { position: absolute; left: -20px; top: -54px; width: 40px; height: 56px; transform: scale(calc(var(--k) * 1.3)); transform-origin: 20px 54px; }
.lean { position: absolute; inset: 0; transform-origin: 20px 54px; }
.mann { position: absolute; inset: 0; width: 40px; height: 56px; overflow: visible; }
.skygge { position: absolute; left: 6px; top: 51px; width: 28px; height: 6px; border-radius: 50%; background: rgba(12, 35, 64, .28); }
.mann .legF { transform-origin: 19px 33px; transform: rotate(7deg); }
.mann .legN { transform-origin: 21px 33px; transform: rotate(-6deg); }
.mann .legF .shin { transform-origin: 19px 41.5px; }
.mann .legN .shin { transform-origin: 21px 41.5px; }
.mann .armF, .mann .armN { transform-origin: 20.5px 21.5px; }
.mann .stav { transform-origin: 21.6px 31.6px; transition: transform .25s ease; }
.mann .kropp { transform-origin: 20px 44px; }
.mann .pack { transform-origin: 11px 20px; }
.mann .dusk { transform-origin: 16.9px 6px; }
.mann .oye { transform-origin: 23.9px 11.3px; animation: blunk 4.6s steps(1) infinite; }
@keyframes blunk { 0%, 96% { transform: none; } 97%, 100% { transform: scaleY(.12); } }
/* Gange. Én syklus er to steg (.84 s i normal takt). Minus er framover. Det fjerne beinet går et halvt steg etter. */
#me.walking .legN { animation: laar .84s linear infinite; }
#me.walking .legF { animation: laar .84s linear infinite -.42s; }
#me.walking .legN .shin { animation: legg .84s linear infinite; }
#me.walking .legF .shin { animation: legg .84s linear infinite -.42s; }
#me.walking .armN { animation: arm .84s ease-in-out infinite; }
#me.walking .armF { animation: arm .84s ease-in-out infinite -.42s; }
#me.walking .kropp { animation: vugg .42s ease-in-out infinite alternate; }
#me.walking .pack { animation: sekk .42s ease-in-out infinite alternate; }
#me.walking .dusk { animation: dusk .42s ease-in-out infinite alternate; }
@keyframes laar { 0% { transform: rotate(-30deg); } 50% { transform: rotate(26deg); } 64% { transform: rotate(16deg); } 82% { transform: rotate(-22deg); } 100% { transform: rotate(-30deg); } }
@keyframes legg { 0% { transform: rotate(4deg); } 8% { transform: rotate(0); } 50% { transform: rotate(6deg); } 66% { transform: rotate(62deg); } 82% { transform: rotate(48deg); } 100% { transform: rotate(4deg); } }
@keyframes arm { 0%, 100% { transform: rotate(20deg); } 50% { transform: rotate(-18deg); } }
@keyframes vugg { from { transform: translateY(0); } to { transform: translateY(-1.7px); } }
@keyframes sekk { from { transform: rotate(-2deg); } to { transform: rotate(3deg); } }
@keyframes dusk { from { transform: rotate(-10deg); } to { transform: rotate(12deg); } }
/* Løp når farten er høy: større steg, legg helt opp, kroppen framover, staven løftet. */
#me.walking.run .legN { animation-name: laarL; animation-duration: .6s; }
#me.walking.run .legF { animation-name: laarL; animation-duration: .6s; animation-delay: -.3s; }
#me.walking.run .legN .shin { animation-name: leggL; animation-duration: .6s; }
#me.walking.run .legF .shin { animation-name: leggL; animation-duration: .6s; animation-delay: -.3s; }
#me.walking.run .armN { animation-name: armL; animation-duration: .6s; }
#me.walking.run .armF { animation-name: armL; animation-duration: .6s; animation-delay: -.3s; }
#me.walking.run .kropp { animation-name: vuggL; animation-duration: .3s; }
#me.walking.run .stav { transform: rotate(-62deg); }
@keyframes laarL { 0% { transform: rotate(-46deg); } 50% { transform: rotate(38deg); } 66% { transform: rotate(18deg); } 84% { transform: rotate(-34deg); } 100% { transform: rotate(-46deg); } }
@keyframes leggL { 0% { transform: rotate(6deg); } 10% { transform: rotate(0); } 50% { transform: rotate(18deg); } 68% { transform: rotate(96deg); } 84% { transform: rotate(60deg); } 100% { transform: rotate(6deg); } }
@keyframes armL { 0%, 100% { transform: rotate(38deg); } 50% { transform: rotate(-40deg); } }
@keyframes vuggL { from { transform: rotate(11deg) translateY(0); } to { transform: rotate(11deg) translateY(-3.2px); } }
#chip { position: absolute; right: calc(-24px * var(--k)); bottom: calc(66px * var(--k)); visibility: hidden; opacity: 0; transition: opacity .18s ease; background: var(--natt); color: #fff; line-height: 1.1; padding: 7px 12px 8px; border-radius: 9px; white-space: nowrap; max-width: 86vw; overflow: hidden; text-align: center; }
#chip b { display: block; font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; }
#chip span { display: block; margin-top: 2px; font-size: 14px; font-weight: 800; color: #ffd45e; font-variant-numeric: tabular-nums; animation: tikk .24s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes tikk { from { transform: scale(1.5); } }
#chip.long b { font-size: 13.5px; }
#me.has-chip #chip { visibility: visible; opacity: 1; }

/* Rypene som letter når du går over tregrensa. */
#birds { position: absolute; left: 0; top: 0; z-index: 3; width: calc(120px * var(--k)); height: calc(70px * var(--k)); opacity: 0; pointer-events: none; }
#birds.fly { animation: letter 1.1s ease-out both; }
@keyframes letter { 0% { opacity: 0; transform: translate(0, 0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translate(150px, -150px); } }

#stage.peak { animation: topp .4s ease-out; }
@keyframes topp { 40% { transform: scale(1.05); } }

#glow { position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; box-shadow: inset 0 0 70px 20px rgba(212, 40, 28, .6); transition: opacity .3s ease; }
.hot #glow { opacity: 1; animation: puls 1s ease-in-out infinite; }
@keyframes puls { 50% { opacity: .4; } }

/* Varslene står i himmelen, ikke som systemmeldinger: sonene stort, kjentmerkene i lavlandet mindre. */
#toast { position: absolute; z-index: 5; top: calc(92px + env(safe-area-inset-top)); left: 0; right: 0; margin: 0; padding: 0 16px; text-align: center; transform: translateY(8px) scale(.94); opacity: 0; pointer-events: none; color: #fff; font-size: 19px; line-height: 1.1; font-weight: 800; letter-spacing: -.01em; text-shadow: 0 1px 0 rgba(12, 35, 64, .55), 0 0 14px rgba(12, 35, 64, .45); transition: opacity .3s ease, transform .35s cubic-bezier(.2, 1.4, .4, 1); }
#toast.stor { font-size: 30px; font-weight: 900; letter-spacing: -.025em; }
#toast.on { opacity: 1; transform: none; }
/* Værfast: tåka legger seg over hele bildet. */
#haze { transition: opacity .6s ease; }
#taake { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .7s ease; background: linear-gradient(to bottom, rgba(226, 232, 238, .93), rgba(226, 232, 238, .8) 55%, rgba(226, 232, 238, .55)); }
#stage.taake #taake { opacity: 1; }

/* ---------- knapper ---------- */
.btn { appearance: none; border: 2px solid var(--natt); background: var(--sno); color: var(--natt); font-weight: 800; font-size: 17px; height: 52px; padding: 0 18px; border-radius: 10px; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; white-space: nowrap; }
.btn-main { background: var(--natt); color: #fff; }
.btn-wide { width: 100%; height: 54px; font-size: 18px; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn:focus-visible, summary:focus-visible, .stars button:focus-visible { outline: 3px solid var(--merke); outline-offset: 2px; }

/* ---------- øverst: høyden og dagens fem ---------- */
#top { position: absolute; z-index: 5; top: calc(8px + env(safe-area-inset-top)); left: 10px; right: 10px; pointer-events: none; }
#top > * { pointer-events: auto; }
#hud { height: 46px; display: flex; align-items: center; justify-content: space-between; background: var(--sno); border-radius: 14px; padding: 0 10px 0 14px; box-shadow: 0 1px 0 rgba(12, 35, 64, .18); }
.hud-alt { white-space: nowrap; }
.hud-alt output { font-weight: 900; font-size: 24px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hud-alt span { font-size: 12.5px; font-weight: 600; color: var(--natt-2); margin-left: 4px; }
#pips { display: flex; gap: 4px; }
#pips i { width: 26px; height: 26px; border-radius: 7px; background: #eef2f6; display: grid; place-items: center; font-style: normal; font-size: 16px; line-height: 1; }
#pips i.now { background: var(--sno); box-shadow: inset 0 0 0 2px var(--natt); } /* mørk ramme: rødt ville lignet merket for Rødmerka sti */
#pips i.done { background: transparent; }

/* ---------- spørsmålet ---------- */
#card { margin-top: 6px; background: var(--sno); border-radius: 14px; padding: 14px 14px 9px; box-shadow: 0 1px 0 rgba(12, 35, 64, .18); transition: transform .22s cubic-bezier(.2, .8, .2, 1), opacity .16s ease; }
#app[data-card="off"] #card { transform: translateY(-12px); opacity: 0; pointer-events: none; }
.q-text { font-size: clamp(22px, 6.6vw, 28px); line-height: 1.1; font-weight: 800; letter-spacing: -.018em; text-wrap: balance; }
.q-note { margin-top: 5px; font-size: 15px; font-weight: 500; color: var(--natt-2); }
.row { display: flex; gap: 8px; margin-top: 12px; }
.row input { flex: 1; min-width: 0; height: 52px; border: 2px solid var(--natt); border-radius: 10px; padding: 0 12px; font-size: 19px; font-weight: 600; background: var(--sno); }
.row input::placeholder { color: #8698ab; font-weight: 500; }
#go { min-width: 86px; }
.row input:focus { outline: 3px solid rgba(12, 35, 64, .22); outline-offset: 1px; }
.row input.nope { animation: rist .32s ease; border-color: var(--merke); }
@keyframes rist { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.clock { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.track { flex: 1; height: 8px; background: var(--strek); border-radius: 4px; overflow: hidden; }
#bar { height: 100%; background: var(--natt); transform-origin: left center; will-change: transform; }
#secs { min-width: 2ch; text-align: right; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.hot #bar { background: var(--merke); }
.hot #secs { color: var(--merke); }
.msg { height: 22px; margin-top: 6px; font-size: 14px; line-height: 22px; font-weight: 600; color: var(--natt-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg.bad { color: var(--merke); }
.msg.ask { color: var(--natt); }
.msg.rule { text-align: center; font-size: 12.5px; font-weight: 700; letter-spacing: .01em; color: #6c8299; }
.msg s { margin-left: 6px; color: var(--natt-2); font-weight: 600; }

/* ---------- arket nederst etter hvert svar ---------- */
#sheet { position: absolute; z-index: 6; left: 0; right: 0; bottom: 0; background: var(--sno); border-radius: 18px 18px 0 0; padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); transform: translateY(106%); transition: transform .3s cubic-bezier(.2, .9, .25, 1); }
#sheet.open { transform: none; }
.sheet-top { display: flex; align-items: center; gap: 12px; }
.sheet-emoji { line-height: 0; }
.sheet-hut { margin: -4px 0 8px; font-size: 13px; font-weight: 800; color: var(--natt-2); letter-spacing: .01em; }
#sheet.gull { box-shadow: inset 0 5px 0 #ffd45e; }
#sheet.gull .sheet-stat { animation: sprett .5s cubic-bezier(.2, 1.6, .4, 1) .35s both; }
@keyframes sprett { from { transform: scale(.7); } to { transform: none; } }
/* Nivåmerkene: tegnet merke på farget rute. Samme merke i toppskiltet, på arket og i svarlista. */
.merke { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; flex: none; vertical-align: middle; }
.merke svg { width: 32px; height: 32px; display: block; }
.merke.liten { width: 24px; height: 24px; border-radius: 7px; }
.merke.liten svg { width: 18px; height: 18px; }
#pips .merke { width: 26px; height: 26px; border-radius: 7px; }
#pips .merke svg { width: 20px; height: 20px; }
.res-emoji .merke { width: 38px; height: 38px; border-radius: 10px; margin-right: 6px; }
.res-emoji .merke svg { width: 28px; height: 28px; }
.ke .merke { width: 30px; height: 30px; border-radius: 8px; }
.ke .merke svg { width: 22px; height: 22px; }
.sheet-head { flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
#sheet h2 { font-size: 31px; font-weight: 900; letter-spacing: -.025em; line-height: 1; }
.sheet-stat { font-size: 21px; font-weight: 900; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sheet-say { margin-top: 10px; font-size: 16.5px; line-height: 1.35; font-weight: 500; color: var(--natt-2); }
.sheet-say b { color: var(--natt); font-weight: 800; }
.sheet-up { margin-top: 3px; font-size: 15px; line-height: 1.35; font-weight: 500; color: var(--natt-2); }
.sheet-up b { color: var(--natt); font-weight: 700; }
#next { margin-top: 14px; }

/* ---------- forsiden: et ark nederst over fjorden ---------- */
#intro { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; }
.intro-sheet { background: var(--sno); border-radius: 18px 18px 0 0; padding: 18px 18px calc(14px + env(safe-area-inset-bottom)); }
.logo { display: flex; align-items: baseline; font-size: clamp(52px, 16.5vw, 76px); font-weight: 900; letter-spacing: -.05em; line-height: .86; }
.logo svg { width: .59em; height: .59em; margin: 0 .02em 0 .01em; flex: none; }
.intro-day { margin-top: 10px; font-size: 14.5px; font-weight: 700; }
.intro-lead { margin-top: 4px; font-size: 17px; line-height: 1.3; font-weight: 500; color: var(--natt-2); }
.intro-ex { margin: 2px 0 14px; font-size: 15px; line-height: 1.3; font-weight: 500; color: var(--natt-2); }
.intro-ex b { color: var(--natt); font-weight: 800; }
.intro-log { margin-top: 10px; font-size: 14.5px; font-weight: 700; }
.howto { margin-top: 8px; }
.howto summary { list-style: none; cursor: pointer; padding: 6px 0; font-size: 14.5px; font-weight: 700; color: var(--natt-2); text-decoration: underline; text-underline-offset: 3px; }
.howto summary::-webkit-details-marker { display: none; }
.howto ul { list-style: none; padding: 4px 0 6px; display: grid; gap: 6px; font-size: 14.5px; line-height: 1.3; font-weight: 500; }

/* ---------- hvilke deler som vises ---------- */
#top, #sheet, #results, #intro, #toast { visibility: hidden; }
#app[data-view="intro"] #intro,
#app[data-view="play"] #top,
#app[data-view="play"] #toast,
#app[data-view="play"] #sheet,
#app[data-view="results"] #results { visibility: visible; }
#app[data-view="results"] #stage { display: none; }
#intro { transition: transform .3s cubic-bezier(.2, .9, .25, 1); }
#app:not([data-view="intro"]) #intro { transform: translateY(104%); }

/* ---------- resultatet ---------- */
#results { position: absolute; inset: 0; z-index: 7; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: var(--sno); padding: env(safe-area-inset-top) 0 calc(28px + env(safe-area-inset-bottom)); outline: none; }
#app[data-view="results"] #results { animation: inn .45s ease both; }
@keyframes inn { from { opacity: 0; } }
.res-bar { display: flex; align-items: baseline; justify-content: space-between; padding: 12px 18px 10px; font-size: 14px; font-weight: 700; }
.logo-small { font-size: 24px; letter-spacing: -.045em; line-height: 1; }
.res-fig { position: relative; background: linear-gradient(to bottom, #0a1a36 0%, #14305c 30%, #35508a 56%, #8d7aa4 74%, #f0a57c 86%, #ffd9a8 92%); }
.res-fig svg { display: block; width: 100%; height: auto; }
.res-fig text { font-family: "Schibsted Grotesk", system-ui, sans-serif; }
.res-fig figcaption { position: absolute; left: 18px; right: 18px; top: 12px; color: #fff; }
.res-moh { display: flex; align-items: baseline; gap: 8px; line-height: .86; }
.res-moh output { font-size: clamp(64px, 21vw, 92px); font-weight: 900; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.res-moh span { font-size: 21px; font-weight: 800; }
.lys { animation: tenn 1.3s ease-out .35s both; }
.lys.mine { animation-delay: .1s; }
@keyframes tenn { from { opacity: 0; } }
.res-first { padding: 14px 18px 4px; }
.res-text { font-size: 16.5px; line-height: 1.35; font-weight: 500; color: var(--natt-2); }
.res-emoji { margin-top: 12px; line-height: 0; }
.res-pers { margin-top: 6px; font-size: 15.5px; font-weight: 800; color: var(--merke); }
.res-text b { color: var(--natt); font-weight: 800; }
.res-actions { display: flex; gap: 8px; margin-top: 14px; }
.res-actions .btn-main { flex: 1; }
.res-keep { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; margin-top: 12px; font-size: 15px; font-weight: 600; color: var(--natt-2); }
.res-keep b { color: var(--natt); font-weight: 800; }
/* Bare sifrene i nedtellingen står i faste bredder. Kolon og komma blir ellers like brede som et siffer. */
#res-next { font-variant-numeric: tabular-nums; }
#res-next i { font-style: normal; font-variant-numeric: normal; padding: 0 1px; }
.res-again { margin-top: 12px; }
.res-inapp { margin-top: 10px; padding: 9px 12px 10px; border-radius: 10px; background: #fff4d6; font-size: 14.5px; line-height: 1.35; font-weight: 600; }
.res-sec { padding: 20px 18px 2px; border-top: 1.5px solid var(--strek); margin-top: 20px; }
.res-sec h2 { font-size: 21px; font-weight: 900; letter-spacing: -.02em; line-height: 1.1; margin-bottom: 12px; }
.hint { font-size: 14.5px; color: var(--natt-2); font-weight: 500; margin: -6px 0 10px; }
.res-route { display: flex; flex-wrap: wrap; gap: 6px; font-size: 14.5px; font-weight: 700; }
.res-route i { font-style: normal; border: 1.5px solid var(--strek); border-radius: 999px; padding: 3px 10px 4px; }
.res-route i small { color: var(--natt-2); font-weight: 600; margin-left: 5px; font-variant-numeric: tabular-nums; }
.res-route p { font-size: 15px; font-weight: 500; color: var(--natt-2); }

details.key { border-top: 1.5px solid var(--strek); }
details.key:first-child { border-top: 0; }
details.key summary { list-style: none; cursor: pointer; padding: 12px 26px 12px 38px; position: relative; }
details.key summary::-webkit-details-marker { display: none; }
details.key summary::after { content: ""; position: absolute; right: 4px; top: 20px; width: 9px; height: 9px; border-right: 2.5px solid var(--natt); border-bottom: 2.5px solid var(--natt); transform: rotate(45deg); transition: transform .2s ease; }
details.key[open] summary::after { transform: rotate(-135deg); top: 24px; }
.key .ke { position: absolute; left: 0; top: 12px; font-size: 24px; line-height: 1; }
.key .kq { display: block; font-size: 16.5px; font-weight: 800; line-height: 1.2; }
.key .ka { display: block; margin-top: 3px; font-size: 14.5px; font-weight: 500; color: var(--natt-2); line-height: 1.35; }
.key .ka b { color: var(--natt); font-weight: 700; }
.key .body { padding: 0 0 14px; }
.key .find { width: 100%; height: 44px; border: 2px solid var(--natt); border-radius: 10px; padding: 0 12px; font-size: 16px; font-weight: 500; margin-bottom: 12px; }
.key h3 { margin: 14px 0 7px; font-size: 14.5px; font-weight: 800; display: flex; align-items: baseline; gap: 6px; }
.key h3:first-of-type { margin-top: 2px; }
.key h3 small { font-size: 13px; font-weight: 600; color: var(--natt-2); }
.key ul { list-style: none; display: flex; flex-wrap: wrap; gap: 5px; padding: 0; margin: 0; }
.key li { border: 1.5px solid var(--strek); border-radius: 999px; padding: 3px 10px 4px; font-size: 14.5px; font-weight: 600; line-height: 1.2; }
.key li small { font-size: 12.5px; font-weight: 700; color: var(--natt-2); margin-left: 4px; font-variant-numeric: tabular-nums; }
.key li.mine { background: var(--natt); border-color: var(--natt); color: #fff; }
.key li.mine small { color: #c9d7e6; }
.key .gem { margin-top: 6px; font-size: 14.5px; font-weight: 500; color: var(--natt-2); line-height: 1.35; }

.book { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.book dd { font-size: 21px; font-weight: 900; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.book dt { margin-top: 5px; font-size: 12.5px; font-weight: 600; color: var(--natt-2); line-height: 1.2; }
.stars { display: flex; gap: 6px; }
.stars button { appearance: none; width: 48px; height: 48px; border: 2px solid var(--natt); border-radius: 10px; background: var(--sno); font-size: 19px; font-weight: 900; cursor: pointer; touch-action: manipulation; }
.stars button[aria-pressed="true"] { background: var(--natt); color: #fff; }
.idea { margin-top: 18px; }
.idea label { display: block; font-size: 15.5px; font-weight: 700; }
.idea .row { margin-top: 8px; }
.idea .msg { white-space: normal; height: auto; min-height: 22px; }

@media (min-width: 520px) {
  #app { box-shadow: 0 0 0 2px #06162b; }
}
/* Lave skjermer (og nettlesere inne i andre apper): kortet strammes inn, så det blir plass til turgåeren over tastaturet. */
@media (max-height: 700px) {
  #hud { height: 42px; }
  #card { padding: 11px 12px 7px; }
  .q-text { font-size: clamp(21px, 6vw, 25px); }
  .q-note { margin-top: 3px; font-size: 14.5px; }
  .row { margin-top: 9px; }
  #card .row input, #card .btn { height: 48px; }
  .clock { margin-top: 8px; }
  .msg { margin-top: 3px; }
}
@media (max-height: 600px) {
  .intro-ex { display: none; }
  .intro-lead { margin-bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .hot #glow, #stage.peak, #birds.fly, .lys, .smoke i, .row input.nope, #app[data-view="results"] #results { animation: none; }
  #card, #sheet, #intro, .skilt, .skilt b, .skilt i, .hut, .hut .vimpel { transition: none; }
  #me.walking .bob { animation: none; }
}
