/* Blokøen. Lys, blokket spilverden: himmel, græs og tykke kanter. */
:root {
  --sky: #5AA2E6;
  --sky-2: #85B7EB;
  --grass: #7DBA45;
  --grass-2: #639922;
  --sand: #F2D48A;
  --ink: #2C2C2A;
  --ink-2: #5F5E5A;
  --paper: #FFFDF6;
  --paper-2: #F1EFE8;
  --purple: #7F77DD;
  --purple-d: #534AB7;
  --gold: #FAC775;
  --gold-d: #BA7517;
  --red: #E24B4A;
  --good: #3B9C4A;
  --display: "Bungee", "Arial Black", Impact, system-ui, sans-serif;
  --read: "Andika", "Comic Sans MS", "Trebuchet MS", system-ui, sans-serif;
  --px: 5px;
  --r: 14px;
  --edge: 0 5px 0 rgba(44, 44, 42, .9);
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--sky); color: var(--ink); font-family: var(--read); font-size: 19px; line-height: 1.4;
  -webkit-user-select: none; user-select: none; touch-action: manipulation; overscroll-behavior: none; -webkit-touch-callout: none;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible { outline: 4px solid var(--purple); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; letter-spacing: .01em; text-wrap: balance; }
h2 { font-size: clamp(24px, 4vw, 34px); line-height: 1.15; }
h3 { font-size: 18px; color: var(--ink-2); }
p { margin: 0; }
.muted { color: var(--ink-2); font-size: 16px; }
.eyebrow { font-family: var(--display); font-size: 13px; letter-spacing: .1em; color: var(--purple-d); }
.ic { width: 22px; height: 22px; flex: none; }
.ic.big { width: 34px; height: 34px; }

#app { min-height: 100%; padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0); }
.screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.loading { position: fixed; inset: 0; display: grid; place-items: center; font-family: var(--display); color: #fff; background: var(--sky); font-size: 40px; text-shadow: 0 4px 0 var(--purple-d); }

/* ---------- Pixelfigurer ---------- */
.px { image-rendering: pixelated; image-rendering: crisp-edges; }
.sprite { width: calc(var(--w) * var(--px)); height: auto; display: block; }
.sprite.hero { --px: clamp(9px, 1.6vw, 15px); }
.sprite.preview { --px: 6px; }
.sprite.sil { opacity: .9; }
.sprite.glow { filter: drop-shadow(0 0 6px #5DF2E0) drop-shadow(0 0 14px #5DF2E0); animation: glow 2s ease-in-out infinite; }
@keyframes glow { 50% { filter: drop-shadow(0 0 2px #5DF2E0) drop-shadow(0 0 8px #5DF2E0); } }
.bob { animation: bob 1.8s ease-in-out infinite; animation-delay: var(--delay, 0s); }
@keyframes bob { 50% { transform: translateY(-6%); } }
.wiggle { animation: wiggle 1.2s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes wiggle { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-8deg); } 80% { transform: rotate(8deg); } 90% { transform: rotate(-5deg); } }
.shake { animation: shake .45s; }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.drop-ic { width: 21px; height: 27px; }

/* ---------- Knapper ---------- */
.big-btn {
  font-family: var(--display); font-size: clamp(22px, 3.4vw, 30px); padding: 18px 34px; border-radius: 18px;
  background: var(--gold); color: var(--ink); box-shadow: 0 6px 0 var(--gold-d), 0 6px 0 3px var(--ink); border: 3px solid var(--ink);
  transition: transform .08s, box-shadow .08s; min-height: 72px;
}
.big-btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--gold-d), 0 1px 0 3px var(--ink); }
.big-btn.alt { background: var(--sky-2); box-shadow: 0 6px 0 #185FA5, 0 6px 0 3px var(--ink); }
.big-btn.right { background: #9FE1A6; }
.big-btn.wrong { animation: shake .45s; }
.icon-btn { width: 56px; height: 56px; border-radius: 14px; background: var(--paper); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); display: grid; place-items: center; }
.icon-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.icon-btn .ic { width: 28px; height: 28px; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--paper); border: 3px solid var(--ink); font-family: var(--display); font-size: 18px; }
.pill.warn { background: #FCE4C4; }
.parent-link { color: rgba(255,255,255,.85); text-decoration: underline; font-size: 15px; padding: 10px; }

/* ---------- Topbar ---------- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.topbar .spacer { flex: 1; }
.logo { font-family: var(--display); color: #fff; text-shadow: 0 4px 0 var(--purple-d), 0 4px 0 var(--purple-d); }
.logo.small { font-size: clamp(22px, 3.2vw, 30px); text-shadow: 0 3px 0 var(--purple-d); }

/* ---------- Titel ---------- */
.title-screen { background: linear-gradient(var(--sky) 0 62%, var(--grass) 62% 100%); }
.title-wrap { flex: 1; display: grid; justify-items: center; align-content: center; gap: 22px; padding: 24px; text-align: center; }
.title-wrap .logo { font-size: clamp(56px, 13vw, 120px); line-height: 1; }
.title-hero .sprite { --px: clamp(12px, 2.4vw, 20px); }
.title-wrap .play { font-size: clamp(30px, 5vw, 44px); padding: 20px 70px; }

/* ---------- Basen ---------- */
.base { background: linear-gradient(var(--sky) 0 38%, var(--grass) 38% 100%); }
.base.dark { background: linear-gradient(#1E2D5A 0 38%, #3B5534 38% 100%); }
.base.snow { background: linear-gradient(#9CC3EA 0 38%, #EEF3F7 38% 100%); }
.base-main { flex: 1; display: grid; grid-template-columns: 1fr minmax(300px, 360px); gap: 16px; padding: 0 16px 16px; }
.yard { position: relative; min-height: 420px; overflow: hidden; }
.sun { position: absolute; top: 4%; left: 6%; width: 64px; height: 64px; background: #FFE27A; box-shadow: 0 0 0 8px rgba(255,226,122,.35); }
.moon { position: absolute; top: 4%; left: 6%; width: 56px; height: 56px; background: #F1EFE8; box-shadow: inset -14px 0 0 #C9C9D9; }
.house { position: absolute; top: 6%; right: 6%; width: clamp(120px, 22%, 200px); }
.px-svg { width: 100%; height: auto; display: block; }
.crew { position: absolute; inset: 40% 0 0 0; display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 8px 18px; padding: 8px; overflow-y: auto; }
.crew-member { display: grid; justify-items: center; gap: 2px; padding: 6px 8px; border-radius: 14px; }
.crew-member:active { background: rgba(255,255,255,.3); }
.crew-member .sprite { --px: clamp(6px, 1vw, 9px); }
.crew-name { font-family: var(--display); font-size: 14px; color: #fff; text-shadow: 0 2px 0 var(--ink); }
.base.snow .crew-name { color: var(--ink); text-shadow: none; }
.stars { display: inline-flex; gap: 2px; }
.star { width: 16px; height: 16px; color: rgba(0,0,0,.25); }
.star.on { color: #FFC83D; filter: drop-shadow(0 1px 0 var(--ink)); }

.base-side { display: grid; gap: 14px; align-content: start; padding-top: 4px; }
.card { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r); background: var(--paper); border: 3px solid var(--ink); box-shadow: var(--edge); text-align: left; min-height: 96px; }
.card:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.card b { font-family: var(--display); font-size: 20px; font-weight: 400; display: block; }
.card small { font-size: 16px; color: var(--ink-2); }
.card-img { width: 84px; display: grid; place-items: center; flex: none; }
.card-img .sprite { --px: 6px; }
.card.ready { background: #FFF4D6; }
.badge { position: absolute; top: -10px; right: -10px; min-width: 34px; height: 34px; border-radius: 17px; background: var(--red); color: #fff; font-family: var(--display); display: grid; place-items: center; border: 3px solid var(--ink); }
.map-ic canvas { width: 84px; image-rendering: pixelated; border-radius: 6px; border: 2px solid var(--ink); display: block; }
.cal-ic { font-family: var(--display); font-size: 28px; background: var(--red); color: #fff; border-radius: 8px; height: 64px; }
.card-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card.small { flex-direction: column; justify-content: center; gap: 6px; text-align: center; }
.card.small b { font-size: 16px; }

.snowfall, .fireworks { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.snowfall i { position: absolute; top: -10px; width: 6px; height: 6px; background: #fff; animation: snow linear infinite; }
@keyframes snow { to { transform: translateY(110vh) translateX(30px); } }
.fireworks i { position: absolute; width: 8px; height: 8px; background: var(--c); animation: boom 2.4s ease-out infinite; box-shadow: 0 -30px 0 var(--c), 0 30px 0 var(--c), 30px 0 0 var(--c), -30px 0 0 var(--c), 21px 21px 0 var(--c), -21px -21px 0 var(--c), 21px -21px 0 var(--c), -21px 21px 0 var(--c); }
@keyframes boom { 0% { transform: scale(.1); opacity: 1; } 70% { opacity: 1; } 100% { transform: scale(1.4); opacity: 0; } }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(30, 30, 50, .55); display: grid; place-items: center; padding: 16px; z-index: 20; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal-card { position: relative; background: var(--paper); border: 4px solid var(--ink); border-radius: 22px; box-shadow: 0 8px 0 var(--ink); padding: 28px 24px 24px; width: min(640px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; animation: pop .25s cubic-bezier(.3,1.6,.6,1); }
@keyframes pop { from { transform: scale(.85); } }
.modal-card > .x { position: absolute; top: 10px; right: 10px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; }
.modal-card > .x .ic { width: 26px; height: 26px; }
.celebrate, .news, .intro, .sheet, .pin, .calendar { display: grid; justify-items: center; text-align: center; gap: 14px; }
.cele-img { min-height: 140px; display: grid; place-items: center; }
.cele-img .sprite.preview { --px: 11px; }
.news ul { text-align: left; margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.next-up { margin-top: 4px; }
.bubble { background: #fff; border: 3px solid var(--ink); border-radius: 18px; padding: 14px 18px; font-size: 22px; position: relative; max-width: 460px; }
.big-drops { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 48px; }
.big-drops .drop-ic { width: 52px; height: 67px; }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 12px; height: 12px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

.float-drops { position: fixed; z-index: 25; transform: translate(-50%, 0); font-family: var(--display); font-size: 30px; color: #fff; text-shadow: 0 3px 0 var(--ink); display: flex; align-items: center; gap: 6px; animation: floatup 1.3s ease-out forwards; pointer-events: none; }
@keyframes floatup { to { transform: translate(-50%, -110px); opacity: 0; } }

/* Udvikling */
.cele-img.evo { position: relative; min-height: 220px; }
.evo-a, .evo-b { grid-area: 1 / 1; display: grid; place-items: center; }
.evo-a { animation: evoflash 2.6s steps(1) forwards; }
.evo-b { opacity: 0; animation: evoflash2 2.6s steps(1) forwards; }
@keyframes evoflash { 0%, 20%, 40%, 55%, 70%, 80%, 90% { opacity: 1; filter: brightness(1); } 10%, 30%, 48%, 62%, 75%, 85%, 95% { opacity: 1; filter: brightness(0) invert(1); } 100% { opacity: 0; } }
@keyframes evoflash2 { 0%, 99% { opacity: 0; } 100% { opacity: 1; } }
.cele-img.evo.done .evo-b .sprite { animation: hop .6s; }

/* Skabningens kort */
.sheet-hero { min-height: 170px; display: grid; place-items: center; }
.xp { width: min(360px, 100%); display: grid; gap: 4px; }
.xp-bar { height: 18px; border: 3px solid var(--ink); border-radius: 10px; background: var(--paper-2); overflow: hidden; }
.xp-bar i { display: block; height: 100%; background: var(--purple); }
.wardrobe { width: 100%; display: grid; gap: 10px; }
.ward-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ward-label { font-family: var(--display); font-size: 14px; width: 74px; text-align: left; }
.ward-item { display: grid; justify-items: center; gap: 2px; padding: 6px; border: 3px solid var(--paper-2); border-radius: 12px; background: #fff; min-width: 86px; }
.ward-item .sprite.preview { --px: 4px; }
.ward-item small { font-size: 13px; }
.ward-item.on { border-color: var(--purple); background: #EEEDFE; }

/* ---------- Opgaveløberen ---------- */
.runner { background: linear-gradient(var(--sky) 0 30%, #BFE0FA 30% 100%); }
.runner.catching { background: linear-gradient(#4E9A3A 0 30%, #CDEBB4 30% 100%); }
.run-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.dots { flex: 1; display: flex; justify-content: center; gap: 10px; }
.dots i { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--ink); background: rgba(255,255,255,.6); }
.dots i.on { background: var(--purple); animation: pop .3s; }
.run-stage { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 0 16px; flex-wrap: wrap; }
.run-who { min-height: 100px; display: grid; place-items: center; }
.run-who .sprite { --px: clamp(7px, 1.1vw, 10px); }
.run-who.hop .sprite { animation: hop .5s; }
.run-who.shake { animation: shake .45s; }
@keyframes hop { 40% { transform: translateY(-22%); } }
.run-who .egg-run { animation: wiggle 1.4s infinite; }
.run-who .crack { animation: crack .5s; }
@keyframes crack { 30% { transform: rotate(-12deg) scale(1.05); } 60% { transform: rotate(12deg) scale(1.05); } }
.run-who.caught-anim .sprite { animation: caught .9s forwards; }
@keyframes caught { 40% { transform: scale(1.15) rotate(-8deg); filter: brightness(1.4); } 100% { transform: scale(.05) rotate(360deg); opacity: 0; } }
.run-prompt { display: flex; align-items: center; gap: 12px; background: var(--paper); border: 3px solid var(--ink); border-radius: 18px; padding: 10px 18px 10px 10px; box-shadow: 0 4px 0 var(--ink); max-width: 640px; }
.run-prompt p { font-size: clamp(20px, 2.6vw, 26px); font-weight: 700; }
.hear { width: 56px; height: 56px; border-radius: 14px; background: var(--purple); color: #fff; display: grid; place-items: center; flex: none; border: 3px solid var(--ink); }
.hear .ic { width: 30px; height: 30px; }
.hear:active { transform: translateY(2px); }
.run-task { flex: 1; display: grid; place-items: center; padding: 16px; }
.task-body { display: grid; justify-items: center; gap: 22px; width: 100%; max-width: 980px; }

/* Valg */
.choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.choice { min-width: 112px; min-height: 112px; padding: 10px; border-radius: 20px; background: #fff; border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink); display: grid; place-items: center; transition: transform .08s, box-shadow .08s, opacity .2s; }
.choice:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }
.choice.right { background: #B8EFC0; border-color: #1f6f2c; animation: pop .3s; }
.choice.wrong { background: #FFD3CF; animation: shake .45s; }
.choice.dim { opacity: .35; }
.choice.speaking { outline: 6px solid var(--gold); }
.letter { font-family: var(--read); font-weight: 700; font-size: clamp(56px, 8vw, 84px); line-height: 1; }
.word { font-family: var(--read); font-weight: 700; font-size: clamp(36px, 5vw, 52px); padding: 0 14px; }
.num { font-family: var(--display); font-size: clamp(40px, 6vw, 60px); line-height: 1; }
.num.huge { font-size: clamp(64px, 10vw, 110px); padding: 0 20px; }
.emoji { font-size: clamp(64px, 9vw, 96px); line-height: 1.1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.emoji.small { font-size: 40px; }
.choices.pics .choice { width: clamp(130px, 18vw, 180px); height: clamp(130px, 18vw, 180px); }
.choices.letters .choice { width: clamp(110px, 14vw, 140px); height: clamp(120px, 15vw, 150px); }

.pic-card { background: #fff; border: 4px solid var(--ink); border-radius: 24px; padding: 10px 26px; box-shadow: 0 6px 0 var(--ink); display: grid; justify-items: center; }
.pic-card.big .emoji { font-size: clamp(90px, 13vw, 140px); }
.pic-word { font-family: var(--read); font-weight: 700; font-size: 34px; }

.read-word { display: flex; gap: 6px; background: #fff; border: 4px solid var(--ink); border-radius: 22px; padding: 10px 26px; box-shadow: 0 6px 0 var(--ink); }
.read-word .rl { font-family: var(--read); font-weight: 700; font-size: clamp(60px, 9vw, 96px); line-height: 1.1; color: var(--ink); transition: color .15s, transform .15s; }
.read-word .rl.lit { color: var(--purple-d); transform: translateY(-6px); }
.help-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 14px; background: var(--paper); border: 3px solid var(--ink); font-family: var(--display); font-size: 16px; }

/* Byg ordet */
.worm { display: flex; gap: 8px; padding: 10px; border-radius: 20px; background: #C0DD97; border: 4px solid var(--ink); }
.slot { width: clamp(60px, 8vw, 84px); height: clamp(72px, 9vw, 96px); border-radius: 14px; border: 3px dashed var(--grass-2); background: rgba(255,255,255,.5); display: grid; place-items: center; font-family: var(--read); font-weight: 700; font-size: clamp(44px, 6vw, 64px); }
.slot.filled { border-style: solid; border-color: var(--ink); background: #fff; animation: pop .25s; }
.worm.done { animation: hop .5s; }
.choices.tiles .choice { min-width: 96px; min-height: 104px; }
.choice.tile.used { visibility: hidden; }

/* Bær */
.berry-scene { display: grid; grid-template-columns: auto auto; grid-template-areas: "bear bowl" "bush bush"; gap: 18px; align-items: center; justify-items: center; }
.bear { grid-area: bear; }
.bear .px { width: calc(12 * 10px); }
.bowl { grid-area: bowl; min-width: 260px; min-height: 120px; padding: 14px; border-radius: 0 0 120px 120px; background: #B4E0F5; border: 4px solid var(--ink); display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-content: center; }
.bush { grid-area: bush; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 16px 20px; border-radius: 40px; background: #3E8F34; border: 4px solid var(--ink); max-width: 640px; }
.berry-btn { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; }
.berry-btn:active { transform: scale(.9); }
.berry { display: inline-block; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff9a9a 0 18%, #E24B4A 20% 100%); border: 3px solid #7a1f1f; }
.berry.new { background: radial-gradient(circle at 35% 30%, #c9b8ff 0 18%, #7F77DD 20% 100%); border-color: #3C3489; }
.big-btn.ok { padding: 14px 40px; }
.sum-pics { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.sum-pics .grp { display: flex; flex-wrap: wrap; gap: 6px; max-width: 260px; justify-content: center; background: #fff; border: 4px solid var(--ink); border-radius: 18px; padding: 14px; }
.op { font-family: var(--display); font-size: 54px; }
.equation { font-family: var(--display); font-size: clamp(56px, 9vw, 96px); background: #fff; border: 4px solid var(--ink); border-radius: 24px; padding: 6px 30px; box-shadow: 0 6px 0 var(--ink); }
.equation .q { color: var(--purple); }
.equation .op { font-size: inherit; }

/* Talstien */
.path { display: flex; gap: clamp(8px, 2vw, 22px); flex-wrap: wrap; justify-content: center; }
.stone { position: relative; width: clamp(80px, 11vw, 120px); height: clamp(70px, 9vw, 100px); border-radius: 50%; background: #B4B2A9; border: 4px solid var(--ink); box-shadow: 0 6px 0 #5F5E5A, 0 6px 0 4px var(--ink); display: grid; place-items: center; font-family: var(--display); font-size: clamp(30px, 4.6vw, 46px); }
.stone.missing { background: #fff; color: var(--purple); border-style: dashed; }
.stone .frog { position: absolute; bottom: 70%; left: 50%; transform: translateX(-50%); width: calc(12 * 6px); }

/* Fisk */
.choices.ponds .choice { padding: 12px; }
.pond { width: clamp(220px, 34vw, 380px); min-height: 200px; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-content: center; background: #85B7EB; border-radius: 40%; padding: 18px; }
.pond .fish { width: calc(12 * 5px); animation: swim 2s ease-in-out infinite; animation-delay: var(--d); }
@keyframes swim { 50% { transform: translateX(6px); } }

/* Former */
.shape { width: 100%; height: 100%; display: block; }
.choices.shapes .choice { width: clamp(110px, 14vw, 150px); height: clamp(110px, 14vw, 150px); padding: 16px; }
.choices.shapes.big .choice { width: clamp(140px, 18vw, 190px); height: clamp(140px, 18vw, 190px); }
.pattern { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 14px 18px; border-radius: 30px; background: #FDE7C8; border: 4px solid var(--ink); }
.pblock { width: clamp(64px, 8.5vw, 92px); height: clamp(64px, 8.5vw, 92px); display: grid; place-items: center; padding: 6px; }
.pblock.q { border: 4px dashed var(--purple); border-radius: 14px; font-family: var(--display); font-size: 40px; color: var(--purple); background: #fff; }
.shape-show { width: clamp(180px, 26vw, 260px); height: clamp(180px, 26vw, 260px); }
.shape-scene { display: grid; grid-template-columns: repeat(5, clamp(70px, 10vw, 110px)); gap: 10px; padding: 16px; background: #fff; border: 4px solid var(--ink); border-radius: 24px; }
.scatter { aspect-ratio: 1; }
.build { width: clamp(240px, 36vw, 360px); aspect-ratio: 1; background: #fff; border: 4px solid var(--ink); border-radius: 24px; box-shadow: 0 6px 0 var(--ink); padding: 10px; }
.build-svg { width: 100%; height: 100%; }
.pulse { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- Kortet ---------- */
.map-screen { background: #378ADD; }
.map-screen.dark { background: #1E2D5A; }
.map-wrap { flex: 1; display: grid; place-items: center; padding: 0 12px 12px; }
.map { position: relative; width: min(100%, calc((100dvh - 110px) * 1.5)); aspect-ratio: 3 / 2; }
.map canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.zone { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; padding: 10px 18px; border-radius: 16px; background: var(--paper); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); min-width: 150px; }
.zone b { font-family: var(--display); font-size: clamp(16px, 2.2vw, 22px); font-weight: 400; }
.zone small { font-size: 15px; color: var(--ink-2); }
.zone.locked { background: #D3D1C7; opacity: .95; }
.zone:active { transform: translate(-50%, calc(-50% + 4px)); box-shadow: 0 1px 0 var(--ink); }
.zone-lyd { left: 27%; top: 34%; }
.zone-tal { left: 75%; top: 50%; }
.zone-form { left: 50%; top: 84%; }
.zone-home { left: 50%; top: 61%; min-width: 0; padding: 6px 14px; }
.map-things { position: absolute; inset: 0; pointer-events: none; }
.thing { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; padding: 6px; }
.thing .sprite { --px: clamp(4px, .7vw, 7px); }
.thing.collect { animation: wiggle 1.6s infinite; }
.thing.event-creature .sprite, .thing.duck .sprite { --px: clamp(5px, .9vw, 8px); }
.snowfall-host { position: absolute; inset: 0; pointer-events: none; }

/* ---------- Område ---------- */
.area-screen { background: linear-gradient(#2F7A2A, #7DBA45); }
.area-tal { background: linear-gradient(#8C8B85, #CFCDC4); }
.area-form { background: linear-gradient(#5AA2E6 0 30%, #F2D48A 30%); }
.area-screen.dark { background: linear-gradient(#1C3A20, #3B5534); }
.area-main { flex: 1; padding: 12px 16px 24px; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; max-width: 1100px; margin: 0 auto; }
.ccard { display: grid; justify-items: center; align-content: end; gap: 6px; padding: 18px 12px 14px; border-radius: 20px; background: var(--paper); border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink); min-height: 250px; text-align: center; }
.ccard .sprite { --px: clamp(8px, 1.2vw, 11px); }
.ccard b { font-family: var(--display); font-size: 18px; font-weight: 400; }
.ccard small { font-size: 14px; color: var(--ink-2); }
.ccard .act { font-family: var(--display); font-size: 16px; padding: 6px 16px; border-radius: 12px; background: var(--sky-2); border: 3px solid var(--ink); }
.ccard .act.go { background: var(--gold); }
.ccard.open { background: #FFF4D6; }
.ccard.open.rare { background: #EEEDFE; }
.ccard.locked, .ccard.hidden-c { background: #E6E4DC; box-shadow: 0 6px 0 #888780; border-color: #888780; }
.ccard:is(button):active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }

/* ---------- Butik ---------- */
.shop-screen { background: linear-gradient(#7F77DD, #AFA9EC); }
.shop-main { flex: 1; padding: 8px 16px 24px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; max-width: 1100px; margin: 0 auto; }
.shop-card { position: relative; display: grid; justify-items: center; gap: 8px; padding: 14px 10px; border-radius: 18px; background: var(--paper); border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink); }
.shop-card.owned { background: #EAF6E1; }
.shop-img { min-height: 120px; display: grid; place-items: center; }
.shop-img .sprite.preview { --px: 7px; }
.shop-name { font-family: var(--display); font-weight: 400; font-size: 16px; text-align: center; }
.buy { display: inline-flex; align-items: center; gap: 6px; padding: 8px 18px; border-radius: 14px; background: var(--gold); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); font-family: var(--display); font-size: 20px; }
.buy.poor { background: #E6E4DC; }
.buy:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 10px; font-size: 14px; text-align: center; }
.tag .ic { width: 16px; height: 16px; }
.tag.own { background: #B8EFC0; font-family: var(--display); }
.tag.win { background: #FFF4D6; }
.tag.ev { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; font-family: var(--display); white-space: nowrap; border: 2px solid var(--ink); }
.shop-note { text-align: center; color: #fff; margin-top: 18px; }

/* ---------- Monsterbog ---------- */
.dex-screen { background: linear-gradient(#854F0B, #BA7517); }
.dex-main { flex: 1; padding: 8px 16px 24px; display: grid; gap: 10px; align-content: start; max-width: 1100px; margin: 0 auto; width: 100%; }
.dex-main h3 { color: #fff; margin-top: 10px; }
.dex-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.dex-card { display: grid; justify-items: center; gap: 4px; padding: 12px; min-width: 130px; border-radius: 16px; background: var(--paper); border: 3px solid var(--ink); }
.dex-card .sprite { --px: 6px; }
.dex-card b { font-family: var(--display); font-weight: 400; font-size: 14px; }
.dex-card.hidden, .dex-card.locked { background: #E6E4DC; }
.evo-arrow { color: #fff; }

/* ---------- Julekalender ---------- */
.doors { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; width: 100%; }
.door { aspect-ratio: 1; border-radius: 10px; background: #A32D2D; color: #fff; font-family: var(--display); font-size: 22px; border: 3px solid var(--ink); display: grid; place-items: center; }
.door.ready { background: var(--red); animation: wiggle 1.6s infinite; }
.door.open { background: #EAF6E1; }
.door:disabled:not(.open) { opacity: .5; }
.big-door { width: 110px; height: 110px; font-size: 44px; animation: wiggle 1.6s infinite; }

/* ---------- Forælder ---------- */
.parent-screen { background: var(--paper-2); }
.parent-screen .logo { color: var(--ink); text-shadow: none; }
.parent-main { padding: 8px 16px 40px; display: grid; gap: 16px; max-width: 900px; margin: 0 auto; width: 100%; }
.p-sec { background: #fff; border: 2px solid #D3D1C7; border-radius: 14px; padding: 16px; display: grid; gap: 10px; }
.p-sec.danger { border-color: #F09595; }
.p-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.p-table th, .p-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--paper-2); }
.p-table th { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.lvl { display: flex; align-items: center; gap: 10px; }
.lvl button, .p-btns button { padding: 8px 14px; border-radius: 10px; background: var(--paper-2); border: 2px solid #B4B2A9; font-size: 16px; }
.lvl b { font-family: var(--display); font-weight: 400; min-width: 20px; text-align: center; }
.p-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.p-check { display: flex; align-items: center; gap: 10px; }
.p-check input { width: 24px; height: 24px; }
input[type="date"] { font: inherit; padding: 8px 10px; border-radius: 10px; border: 2px solid #B4B2A9; max-width: 220px; }
.pin-dots { font-size: 40px; letter-spacing: 10px; min-height: 50px; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 10px; }
.pin-pad button { height: 64px; border-radius: 14px; background: var(--paper-2); border: 3px solid var(--ink); font-family: var(--display); font-size: 24px; }
.pin-pad button:disabled { visibility: hidden; }
.pin-err { color: var(--red); min-height: 24px; }

/* ---------- Mørk (Halloween) ---------- */
.dark .logo { text-shadow: 0 3px 0 #EF9F27; }

/* ---------- Højkant og små skærme ---------- */
@media (orientation: portrait), (max-width: 860px) {
  .base-main { grid-template-columns: 1fr; }
  .yard { min-height: 52vh; }
  .base-side { grid-template-columns: 1fr 1fr; }
  .base-side .map-card { grid-column: 1 / -1; order: -1; }
  .card-row { grid-column: 1 / -1; }
  .zone { min-width: 0; padding: 8px 12px; }
}
@media (max-width: 560px) {
  .base-side { grid-template-columns: 1fr; }
  .shape-scene { grid-template-columns: repeat(4, 64px); }
}
@media (prefers-reduced-motion: reduce) {
  .bob, .wiggle, .thing.collect, .door.ready, .pond .fish { animation: none; }
}
