/* Desemberglede 2026 – Magisk vinterkveld */
:root {
  --natt: #0E1A33;
  --dyp: #16264A;
  --dyp2: #1E3260;
  --frost: #9FB6D9;
  --gull: #E3B95C;
  --gull-mork: #B98D35;
  --kubbelys: #FFE7B3;
  --sno: #F3F6FB;
  --rod: #C8545A;
  --gran: #3F7A63;
  --serif: "Cormorant Garamond", "Georgia", "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); }
body {
  margin: 0; min-height: 100dvh;
  background: radial-gradient(120% 70% at 50% 0%, #22396B 0%, var(--dyp) 38%, var(--natt) 78%) fixed, var(--natt);
  color: var(--sno); font-family: var(--sans); font-size: 17px; line-height: 1.55;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
#app { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 0 18px 80px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.12; margin: 0 0 .4em; letter-spacing: .005em; }
h1 { font-size: clamp(2.4rem, 9vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 6vw, 2.3rem); }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1em; max-width: 62ch; }
a { color: var(--kubbelys); }
.muted { color: var(--frost); }
.small { font-size: .9rem; }
:focus-visible { outline: 3px solid var(--gull); outline-offset: 3px; border-radius: 6px; }

/* Knapper og skjema */
.btn {
  appearance: none; border: 0; cursor: pointer; font: 600 1rem/1 var(--sans);
  min-height: 52px; padding: 0 24px; border-radius: 999px;
  background: linear-gradient(180deg, #F0CB78, var(--gull)); color: #2A1E05;
  box-shadow: 0 0 0 1px #FFE7B355 inset, 0 8px 28px -10px #E3B95Caa;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--sno); box-shadow: 0 0 0 1px #9FB6D966 inset; }
.btn.small { min-height: 42px; padding: 0 18px; font-size: .92rem; }
.btn.block { width: 100%; }
.link { background: none; border: 0; color: var(--frost); font: inherit; text-decoration: underline; cursor: pointer; padding: 8px 0; min-height: 44px; }
label { display: block; font-weight: 500; margin: 0 0 8px; }
input[type=text], input[type=email], input[type=tel], textarea, select {
  width: 100%; min-height: 54px; padding: 12px 16px; font: 500 1.05rem var(--sans);
  color: var(--sno); background: #0B1529cc; border: 1px solid #9FB6D955; border-radius: 12px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gull); box-shadow: 0 0 0 3px #E3B95C33; }
.code-input { letter-spacing: .5em; text-align: center; font-size: 1.6rem !important; font-variant-numeric: tabular-nums; }
.field { margin-bottom: 18px; }
.error { color: #FFB4A8; min-height: 1.4em; font-size: .95rem; }

.choices { display: grid; gap: 10px; }
.choice {
  display: flex; gap: 14px; align-items: flex-start; text-align: left; cursor: pointer;
  min-height: 56px; padding: 14px 16px; border-radius: 12px; width: 100%;
  background: #0B1529aa; border: 1px solid #9FB6D944; color: var(--sno); font: 500 1.02rem var(--sans);
}
.choice small { display: block; color: var(--frost); font-weight: 400; margin-top: 2px; font-size: .9rem; }
.choice[aria-pressed=true] { border-color: var(--gull); background: #2A2410cc; box-shadow: 0 0 0 1px var(--gull) inset; }
.choice .dot { flex: none; width: 20px; height: 20px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--frost); }
.choice[aria-pressed=true] .dot { border-color: var(--gull); background: radial-gradient(circle, var(--gull) 45%, transparent 50%); }

/* Toppfelt */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 6px; }
.brand { font-family: var(--serif); font-style: italic; font-size: 1.35rem; color: var(--kubbelys); text-decoration: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #0B1529aa; border: 1px solid #E3B95C55; color: var(--kubbelys); font-weight: 600; font-size: .92rem; text-decoration: none; min-height: 40px; }

/* Landsbyen */
.village { position: relative; margin: 4px -18px 0; }
.village svg { display: block; width: 100%; height: auto; }
.village .moon, .village .star, .village .gift, .village .nisse { cursor: pointer; }
.win { transition: fill .6s ease; }
.greeting { font-family: var(--serif); font-size: clamp(1.35rem, 5vw, 1.7rem); line-height: 1.3; margin: 12px 0 4px; color: var(--sno); }
.greeting em { color: var(--kubbelys); font-style: italic; }

/* Kalendervinduer */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 22px; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(6, 1fr); gap: 14px; } }
.door {
  position: relative; aspect-ratio: 3 / 4; border: 0; cursor: pointer; padding: 0; color: var(--sno);
  border-radius: 999px 999px 10px 10px; overflow: hidden; font-family: var(--serif);
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), #0E1A33 calc(50% - 1px), #0E1A33 calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(0deg, transparent calc(55% - 1px), #0E1A33 calc(55% - 1px), #0E1A33 calc(55% + 1px), transparent calc(55% + 1px)),
    linear-gradient(180deg, #2A4377, #182A52);
  box-shadow: 0 0 0 2px #3B5488 inset, 0 0 0 5px #0E1A33, 0 0 0 6px #6E5A2F;
}
.door .num { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(1.6rem, 7vw, 2.2rem); font-weight: 600; text-shadow: 0 1px 0 #0008; }
.door.locked { color: #9FB6D9aa; }
.door.locked::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, #ffffff18, transparent 40%), repeating-linear-gradient(115deg, #ffffff07 0 6px, transparent 6px 14px); }
.door.open, .door.opened {
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), #5A3A12 calc(50% - 1px), #5A3A12 calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(0deg, transparent calc(55% - 1px), #5A3A12 calc(55% - 1px), #5A3A12 calc(55% + 1px), transparent calc(55% + 1px)),
    radial-gradient(circle at 50% 60%, #FFF3D1, #FFD27A 45%, #E39B3A 100%);
  color: #4A2C08; box-shadow: 0 0 0 2px #FFE7B3 inset, 0 0 0 5px #0E1A33, 0 0 0 6px var(--gull), 0 0 28px -4px #FFD27Aaa;
}
.door.open:not(.opened) { background:
    linear-gradient(90deg, transparent calc(50% - 1px), #0E1A33 calc(50% - 1px), #0E1A33 calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(0deg, transparent calc(55% - 1px), #0E1A33 calc(55% - 1px), #0E1A33 calc(55% + 1px), transparent calc(55% + 1px)),
    linear-gradient(180deg, #31508C, #1D3363);
  color: var(--kubbelys); box-shadow: 0 0 0 2px #E3B95C99 inset, 0 0 0 5px #0E1A33, 0 0 0 6px var(--gull); }
.door.today { box-shadow: 0 0 0 2px var(--kubbelys) inset, 0 0 0 5px #0E1A33, 0 0 0 7px var(--gull), 0 0 34px 2px #E3B95Ccc; }
.door.today:not(.opened) { animation: glow 2.6s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 2px var(--kubbelys) inset, 0 0 0 5px #0E1A33, 0 0 0 7px var(--gull), 0 0 46px 8px #E3B95Cee; } }
.door .mark { position: absolute; bottom: 8px; left: 0; right: 0; text-align: center; font: 600 .7rem var(--sans); letter-spacing: .02em; }
.door.shake { animation: shake .45s; }
@keyframes shake { 20%,60% { transform: translateX(-5px) } 40%,80% { transform: translateX(5px) } }

.stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 0; }
.nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 26px; }

/* Panel / luke */
.panel { background: linear-gradient(180deg, #172A52ee, #0F1D3Bee); border: 1px solid #E3B95C33; border-radius: 20px; padding: 24px 20px; margin-top: 16px; box-shadow: 0 30px 60px -30px #000c; }
@media (min-width: 620px) { .panel { padding: 34px 36px; } }
.door-head { text-align: center; padding: 18px 0 4px; }
.door-head .daynum { font-family: var(--serif); font-size: 4.6rem; line-height: 1; color: var(--gull); }
.door-head .kind { color: var(--frost); font-size: .95rem; }
.door-head h1 { font-size: clamp(1.9rem, 7vw, 2.6rem); margin-top: 6px; }
.remark { font-family: var(--serif); font-style: italic; font-size: 1.25rem; color: var(--kubbelys); text-align: center; margin: 4px auto 10px; max-width: 34ch; }
.block { margin: 26px 0; }
.block p { font-size: 1.06rem; }
.lead { font-family: var(--serif); font-size: 1.4rem; line-height: 1.4; }
.contract { background: #F3EBD6; color: #2B2112; border-radius: 6px; padding: 24px 22px; font-family: var(--serif); font-size: 1.12rem; line-height: 1.45; box-shadow: 0 18px 40px -18px #000; }
.contract h3 { text-align: center; color: #5A3A12; }
.contract ol { list-style: none; padding: 0; margin: 0; }
.contract li { margin: 0 0 .75em; }
.facts { display: grid; gap: 14px; }
.fact { border-left: 3px solid var(--gull); padding: 4px 0 4px 16px; }
.fact h3 { font-size: 1.3rem; color: var(--kubbelys); margin-bottom: 4px; }
.fact p { margin: 0; }
.task { border: 1px solid #E3B95C55; border-radius: 16px; padding: 20px; background: #0B1529aa; }
.task h3 { color: var(--kubbelys); }
.task .pts { color: var(--gull); font-weight: 600; font-size: .9rem; margin-bottom: 10px; display: block; }
.task.done { border-color: #3F7A63; }
.done-note { color: #9EE0BF; font-weight: 600; }
.q { margin: 0 0 22px; }
.q-title { font-weight: 600; margin-bottom: 10px; }
.opt.correct { border-color: #5FBF8F; background: #183A2Daa; }
.opt.wrong { border-color: #E07A72; background: #3A1A1Aaa; }
.explain { color: var(--frost); font-size: .95rem; margin-top: 6px; }
.bars { display: grid; gap: 8px; margin-top: 10px; }
.bar { position: relative; height: 40px; border-radius: 10px; background: #0B1529; overflow: hidden; display: flex; align-items: center; padding: 0 12px; font-weight: 500; }
.bar span.fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #E3B95C55, #E3B95C22); }
.bar.me span.fill { background: linear-gradient(90deg, #E3B95Ccc, #E3B95C55); }
.bar b { position: relative; margin-left: auto; }
.bar em { position: relative; font-style: normal; }

/* Spill */
.game { border-radius: 18px; padding: 20px; background: #0B1529; border: 1px solid #9FB6D944; text-align: center; }
.arena { margin: 14px 0; height: 220px; border-radius: 16px; display: grid; place-items: center; font: 600 1.3rem var(--sans); user-select: none; -webkit-user-select: none; touch-action: manipulation; cursor: pointer; background: #14244A; color: var(--frost); }
.arena.wait { background: #2A1426; color: #F2B7C6; }
.arena.go { background: radial-gradient(circle, #FFF6D8, #FFD27A 60%, #E39B3A); color: #3B2406; }
.result-big { font-family: var(--serif); font-size: 2.6rem; color: var(--kubbelys); }

/* Medaljer */
.medals { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 16px; }
.medal { text-align: center; font-size: .85rem; }
.medal .m { width: 68px; height: 68px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; position: relative;
  background: radial-gradient(circle at 35% 30%, #fff8, transparent 45%), var(--mc, #E3B95C); box-shadow: 0 0 0 3px #0E1A33, 0 0 0 5px var(--mr, #B98D35), 0 10px 20px -8px #000; color: #2A1E05; }
.medal.locked .m { --mc: #22345E; --mr: #3B5488; color: #6F86B5; }
.medal .n { font-weight: 600; }
.medal .d { color: var(--frost); font-size: .78rem; line-height: 1.3; }
.hue-gold { --mc: #E3B95C; --mr: #B98D35; }
.hue-ice { --mc: #BFD7F2; --mr: #6E8DB8; }
.hue-night { --mc: #8C8FE0; --mr: #4F52A8; }
.hue-red { --mc: #E98A86; --mr: #A8443F; }
.hue-rose { --mc: #F1B2C4; --mr: #B06C82; }
.hue-green { --mc: #8ED1AE; --mr: #3F7A63; }

/* Resultatliste */
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: end; gap: 8px; margin: 24px 0 18px; text-align: center; }
.podium .p { border-radius: 12px 12px 0 0; padding: 12px 6px; background: linear-gradient(180deg, #2A4377, #182A52); }
.podium .p1 { height: 150px; background: linear-gradient(180deg, #F0CB78, #B98D35); color: #2A1E05; }
.podium .p2 { height: 120px; background: linear-gradient(180deg, #DDE6F3, #8EA2BF); color: #1A2235; }
.podium .p3 { height: 100px; background: linear-gradient(180deg, #E7B48A, #9C6236); color: #2A1406; }
.podium .nick { font-weight: 600; font-size: .95rem; word-break: break-word; }
.podium .r { font-family: var(--serif); font-size: 2rem; line-height: 1; }
.rows { display: grid; gap: 6px; }
.row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: #0B1529aa; }
.row.me { background: #2A2410; box-shadow: 0 0 0 1px var(--gull) inset; }
.row .r { font-family: var(--serif); font-size: 1.4rem; color: var(--gull); text-align: center; }
.mini { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-size: .7rem; margin-left: 4px; background: var(--mc); color: #2A1E05; vertical-align: middle; }
.tabs { display: flex; gap: 8px; }
.tabs .btn[aria-pressed=false] { background: transparent; color: var(--sno); box-shadow: 0 0 0 1px #9FB6D966 inset; }

/* Fremdrift */
.progress { height: 12px; border-radius: 999px; background: #0B1529; overflow: hidden; margin: 10px 0 6px; box-shadow: 0 0 0 1px #9FB6D933 inset; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, #B98D35, #FFE7B3); border-radius: 999px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv div { background: #0B1529aa; border-radius: 14px; padding: 14px; }
.kv b { display: block; font-family: var(--serif); font-size: 2rem; color: var(--kubbelys); line-height: 1.1; }

/* Toast og modal */
#toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(140%); z-index: 50; max-width: min(92vw, 460px);
  background: #F3EBD6; color: #2B2112; padding: 14px 18px; border-radius: 14px; font-weight: 500; box-shadow: 0 20px 40px -12px #000c; transition: transform .35s ease; }
#toast.show { transform: translateX(-50%) translateY(0); }
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; background: #050B18cc; backdrop-filter: blur(4px); }
.modal .card { max-width: 420px; width: 100%; text-align: center; background: linear-gradient(180deg, #1E3260, #101E3D); border: 1px solid #E3B95C66; border-radius: 22px; padding: 30px 24px; }
.modal .medal .m { width: 108px; height: 108px; font-size: 2.8rem; animation: pop .7s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(.3) rotate(-25deg); opacity: 0; } }

.countdown { display: flex; gap: 10px; justify-content: center; margin: 18px 0; }
.countdown div { min-width: 72px; padding: 12px 8px; border-radius: 14px; background: #0B1529aa; text-align: center; }
.countdown b { display: block; font-family: var(--serif); font-size: 2.3rem; color: var(--kubbelys); line-height: 1; }
.countdown span { font-size: .8rem; color: var(--frost); }

.hero { text-align: center; padding: 28px 0 8px; }
.hero .sub { font-family: var(--serif); font-style: italic; font-size: 1.45rem; color: var(--kubbelys); }
.steps { color: var(--frost); font-size: .95rem; text-align: center; margin-bottom: 8px; }
.danger { color: #FFB4A8; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid #9FB6D922; }
.switch input { width: 26px; height: 26px; accent-color: var(--gull); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body.calm *, body.calm *::before, body.calm *::after { animation: none !important; transition: none !important; }

/* Hukommelse */
.memo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 420px; margin: 0 auto; }
.card { aspect-ratio: 3 / 4; border: 0; border-radius: 12px; cursor: pointer; font-size: 2rem; color: transparent;
  background: repeating-linear-gradient(45deg, #2A4377 0 8px, #22396B 8px 16px); box-shadow: 0 0 0 2px #E3B95C66 inset; transition: transform .25s; }
.card span { opacity: 0; }
.card.up { background: #F3EBD6; color: #2B2112; transform: rotateY(180deg); }
.card.up span { opacity: 1; display: inline-block; transform: rotateY(180deg); }
.card.match { background: radial-gradient(circle, #FFF3D1, #FFD27A); box-shadow: 0 0 0 2px var(--gull) inset, 0 0 18px -4px #FFD27A; }
/* Pakke */
.parcel { width: 110px; height: 96px; margin: 6px auto 16px; border-radius: 8px; position: relative;
  background: linear-gradient(90deg, transparent 44%, #E3B95C 44% 56%, transparent 56%), linear-gradient(0deg, transparent 44%, #E3B95C 44% 56%, transparent 56%), #C8545A;
  box-shadow: 0 14px 30px -12px #000; }
.parcel::before, .parcel::after { content: ""; position: absolute; top: -22px; width: 34px; height: 26px; border: 6px solid #E3B95C; border-radius: 50% 50% 0 50%; }
.parcel::before { left: 20px; transform: rotate(-20deg); } .parcel::after { right: 20px; transform: scaleX(-1) rotate(-20deg); }
.finale { text-align: center; }
.finale p { margin-left: auto; margin-right: auto; }
.modal[hidden], [hidden] { display: none !important; }

#toast:not(.show) { visibility: hidden; }
.nav .btn { padding: 0 12px; text-align: center; }
.nav .btn { white-space: nowrap; font-size: .92rem; }
