/* Zoo'en – designsystem
   Fredoka (overskrifter, tal, knapper) + Nunito (brødtekst). Blød, naturlig palet – ikke babyagtig. */

:root {
  --bg: #f6f3ec;
  --bg-tint: #edf6f0;
  --card: #ffffff;
  --card-2: #fbf9f5;
  --ink: #1f3346;
  --ink-2: #5a6b7b;
  --ink-3: #8c99a5;
  --line: #e8e2d7;
  --line-2: #f0ebe2;

  --primary: #2e9e78;
  --primary-ink: #1d7457;
  --primary-soft: #e0f3ea;
  --coral: #ff8a65;
  --coral-soft: #ffede6;
  --sun: #ffc94d;
  --sun-soft: #fff5d9;
  --sky: #8fd3f4;
  --sky-soft: #e6f5fc;
  --lav: #a998e6;
  --lav-soft: #efebfb;
  --good: #2e9e78;
  --good-soft: #e3f5ec;
  --warm: #d97a3a;
  --warm-soft: #fff2e7;
  --rp-good: #2e9e78; --rp-warn: #d99a00; --rp-bad: #c8503a; /* Øvebanen i tal: sidder godt / næsten / øv mere */
  --ic-base: var(--card); /* bunden i ikonfelterne – lys i mørkt tema, så sorte tegn (➕ ✖️ ➗) kan ses */
  /* Sedlen på Øvebanen: tyndt glas, så scenen ses tydeligt bagved – teksten får en lys glorie og tegningerne en lys plade */
  --note-glass: 26%; --note-blur: 4px; --note-plate: color-mix(in srgb, var(--card) 80%, transparent);
  --note-halo: 0 0 2px #fff, 0 0 9px rgba(255, 255, 255, .95), 0 0 18px rgba(255, 255, 255, .75);

  --c-tal: #6b8cf2;
  --c-gange: #eea23c;
  --c-div: #ef7d57;
  --c-brok: #3ea6d6;
  --c-dec: #e0679a;
  --c-geo: #4fb37a;
  --c-maal: #8b73e0;
  --c-data: #22a597;
  --c-alg: #c48f37;

  --ball-red: #e25555; --ball-blue: #4a7fe0; --ball-green: #45a862; --ball-yellow: #f2c230;

  --r-lg: 28px;
  --r: 20px;
  --r-sm: 14px;
  --shadow-sm: 0 1px 2px rgba(31, 51, 70, .06);
  --shadow: 0 1px 2px rgba(31, 51, 70, .05), 0 6px 20px rgba(31, 51, 70, .07);
  --shadow-lg: 0 2px 4px rgba(31, 51, 70, .05), 0 18px 40px rgba(31, 51, 70, .10);
  --gutter: 16px;
  --font-head: Fredoka, "Nunito", ui-rounded, system-ui, sans-serif;
  --font-body: Nunito, ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14212b; --bg-tint: #172a2a; --card: #1d2c38; --card-2: #203242;
    --ink: #eaf1f5; --ink-2: #aebcc8; --ink-3: #7f8f9c; --line: #2e4150; --line-2: #26394a;
    --primary: #45c296; --primary-ink: #7fdcb9; --primary-soft: #1d3d34;
    --coral-soft: #3b2a25; --sun-soft: #3a3322; --sky-soft: #1d3444; --lav-soft: #2a2842;
    --good-soft: #1b3a2f; --warm: #f0a45a; --warm-soft: #3a2b1d;
    --rp-good: #45c296; --rp-warn: #ffc94d; --rp-bad: #f2885c; --ic-base: #dfe8ee;
    --note-glass: 46%; --note-blur: 5px; --note-halo: 0 0 2px #0e1820, 0 0 9px rgba(14, 24, 32, .95), 0 0 18px rgba(14, 24, 32, .75);
    --shadow: 0 1px 2px rgba(0,0,0,.2), 0 6px 20px rgba(0,0,0,.25);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.2), 0 18px 40px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14212b; --bg-tint: #172a2a; --card: #1d2c38; --card-2: #203242;
  --ink: #eaf1f5; --ink-2: #aebcc8; --ink-3: #7f8f9c; --line: #2e4150; --line-2: #26394a;
  --primary: #45c296; --primary-ink: #7fdcb9; --primary-soft: #1d3d34;
  --coral-soft: #3b2a25; --sun-soft: #3a3322; --sky-soft: #1d3444; --lav-soft: #2a2842;
  --good-soft: #1b3a2f; --warm: #f0a45a; --warm-soft: #3a2b1d;
  --rp-good: #45c296; --rp-warn: #ffc94d; --rp-bad: #f2885c; --ic-base: #dfe8ee;
  --note-glass: 46%; --note-blur: 5px; --note-halo: 0 0 2px #0e1820, 0 0 9px rgba(14, 24, 32, .95), 0 0 18px rgba(14, 24, 32, .75);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font: 500 18px/1.5 var(--font-body);
  -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased;
}
#app { max-width: 1080px; margin: 0 auto; padding: max(var(--gutter), env(safe-area-inset-top)) var(--gutter) 48px; }
#app > * { animation: enter .32s cubic-bezier(.2, .8, .2, 1) both; }
#app > *:nth-child(2) { animation-delay: .04s; }
#app > *:nth-child(3) { animation-delay: .08s; }
#app > *:nth-child(4) { animation-delay: .12s; }
#app > *:nth-child(5) { animation-delay: .16s; }
@keyframes enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

h1, h2, h3, .head { font-family: var(--font-head); font-weight: 600; line-height: 1.15; margin: 0 0 .35em; letter-spacing: .1px; }
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 .8em; }
b, strong { font-weight: 800; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: .86rem; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
.section-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 30px 2px 12px; }
.section-title h2 { margin: 0; }

/* ---------- Knapper ---------- */
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 54px; padding: 0 1.4em; border-radius: 16px;
  background: var(--primary); color: #fff; font: 600 1.08rem var(--font-head); letter-spacing: .2px;
  box-shadow: 0 4px 0 var(--primary-ink), var(--shadow-sm);
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--primary-ink); }
.btn.big { min-height: 64px; font-size: 1.25rem; padding: 0 2em; border-radius: 18px; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: 0 3px 0 var(--line), var(--shadow-sm); border: 2px solid var(--line); }
.btn.ghost:active { box-shadow: 0 1px 0 var(--line); }
.btn:disabled { opacity: .45; pointer-events: none; }
.link { color: var(--primary-ink); font-weight: 700; padding: .5em .25em; min-height: 44px; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.icon-btn { width: 48px; height: 48px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); font-size: 1.25rem; display: grid; place-items: center; color: var(--ink-2); flex: none; }
.icon-btn:active { transform: scale(.96); }

.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 22px; border: 1px solid var(--line-2); }
.field { width: 100%; min-height: 56px; border-radius: 14px; border: 2px solid var(--line); background: var(--card-2); color: var(--ink); font: 600 1.15rem var(--font-body); padding: 0 16px; }
.field:focus { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 1px; border-color: var(--primary); }
label.lbl { font: 600 1rem var(--font-head); display: block; margin-bottom: 6px; }

/* ---------- Figurer & talebobler ---------- */
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; background: var(--sun-soft); flex: none; box-shadow: inset 0 0 0 3px var(--card), 0 0 0 2px var(--line); }
.avatar.sm { width: 36px; height: 36px; font-size: 20px; }
.avatar.lg { width: 72px; height: 72px; font-size: 42px; }
.avatar.who-kaj { background: var(--primary-soft); }
.avatar.who-nora { background: var(--coral-soft); }
.avatar.who-liv { background: var(--lav-soft); }
.avatar.who-yasmin { background: var(--sky-soft); }
.say { display: flex; gap: 12px; align-items: flex-start; }
.bubble { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 12px 16px; box-shadow: var(--shadow-sm); flex: 1; }
.bubble::before { content: ''; position: absolute; left: -8px; top: 18px; width: 14px; height: 14px; background: inherit; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
.bubble .who { font: 600 .82rem var(--font-head); color: var(--ink-2); display: block; margin-bottom: 2px; }
.bubble .txt { font-weight: 700; }

/* ---------- Forside ---------- */
.hero { position: relative; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); background: #cfeaf3; }
.scene { display: block; width: 100%; height: clamp(190px, 30vw, 290px); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.me-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 99px; background: rgba(255, 255, 255, .88); backdrop-filter: blur(6px); box-shadow: var(--shadow-sm); font: 600 1rem var(--font-head); color: #1f3346; }
.me-chip .avatar { width: 34px; height: 34px; font-size: 20px; box-shadow: none; }


/* Baby-badge: størrelse og ring følger stadiet (0–5) */
.baby { --st: 0; position: relative; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--primary) calc(var(--st) * 20%), var(--line) 0); }
.baby::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--card-2); }
.baby.gold { background: conic-gradient(#ffc94d, #ffe39a, #ffc94d, #f5b52e, #ffc94d); }
.baby.gold::before { background: var(--sun-soft); }
.baby.new { background: var(--line); }
.baby.lg { width: 76px; height: 76px; }
.baby .zz { position: absolute; top: -4px; right: -4px; font-size: .85rem; background: var(--card); border-radius: 99px; padding: 0 5px; box-shadow: var(--shadow-sm); }

.zoo-map { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* ---------- Sidehoved (Om appen og Øvebanen) ---------- */
.area-hero { border-radius: var(--r-lg); padding: 22px; background: color-mix(in srgb, var(--ac) 16%, var(--card)); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.area-hero .big { font-size: 3.4rem; }
.skill-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; border-left: 6px solid var(--ac); }
.st { font: 600 .74rem var(--font-head); padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.st.ny { background: var(--line-2); color: var(--ink-3); }
.st.øver { background: var(--warm-soft); color: var(--warm); }
.st.sikker { background: var(--primary-soft); color: var(--primary-ink); }
.st.mestret { background: var(--sun-soft); color: #9a6a00; }

/* ---------- Start / overgang / slut ---------- */
.sheet { max-width: 760px; margin: 5vh auto 0; }
.kicker { font: 600 .8rem var(--font-head); color: var(--primary-ink); text-transform: uppercase; letter-spacing: 1px; }
.plan { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.plan li { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line-2); }
.plan .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); font: 600 .95rem var(--font-head); flex: none; }
.plan .t { font: 600 1.02rem var(--font-head); }
.plan .d { font-size: .85rem; color: var(--ink-2); font-weight: 700; }
.plan .ico { font-size: 1.6rem; margin-left: auto; }
.wins { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; text-align: left; }
.wins li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--card-2); border: 1px solid var(--line-2); font-weight: 700; }
.wins li .e { font-size: 1.5rem; }

/* ---------- Opgave ---------- */
.session-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.progress { flex: 1; height: 12px; border-radius: 99px; background: var(--card); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #5cc59d); border-radius: 99px; transition: width .45s cubic-bezier(.2, .8, .2, 1); }

.baby-banner { display: flex; align-items: center; gap: 12px; margin: -4px 0 14px; padding: 8px 14px 8px 8px; border-radius: 16px; background: var(--sun-soft); }
.baby-banner .baby { width: 46px; height: 46px; }
.baby-banner .t { font: 600 1rem var(--font-head); }
.baby-banner .s { font-size: .8rem; color: var(--ink-2); font-weight: 700; }

.task { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .task.has-input { grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); align-items: start; }
}
.prompt { font-size: 1.3rem; font-weight: 700; line-height: 1.45; }
.prompt .big-expr { display: block; font: 600 2.8rem/1.15 var(--font-head); letter-spacing: .5px; margin: .15em 0; font-variant-numeric: tabular-nums; }
.visual { margin-top: 14px; display: flex; justify-content: center; }
.vis { width: 100%; max-width: 620px; max-height: 320px; height: auto; }
.vis.vis-sm { max-width: 300px; }
.explain-visual .vis { max-height: 260px; }

.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.05; margin: 0 .15em; font-weight: 800; }
.frac > span:first-child { border-bottom: 3px solid currentColor; padding: 0 .2em; }
.frac > span { padding: 0 .2em; }
.big-expr .frac { font-size: .8em; }
.box { display: inline-block; min-width: 1.4em; padding: 0 .2em; border: 3px dashed var(--primary); border-radius: 10px; color: var(--primary); text-align: center; line-height: 1.2; }
.fo-label { font: 800 20px var(--font-body); color: var(--ink); display: flex; align-items: center; height: 100%; }

/* SVG-klasser til matematik-illustrationer */
.v-line { stroke: var(--ink); stroke-width: 2.5; }
.v-line-thin { stroke: var(--line); stroke-width: 1.5; }
.v-fill { fill: var(--primary); }
.v-empty { fill: var(--card); }
.v-soft { fill: var(--primary-soft); }
.v-mark { fill: var(--coral); }
.v-mark-line { stroke: var(--coral); }
.v-hand { stroke: var(--ink); }
.v-text { fill: var(--ink); font: 700 20px var(--font-body); }
.v-text.v-small, .v-small { font-size: 16px; }
.v-text.v-big { font: 600 34px var(--font-head); }
.v-strong { font-weight: 900; fill: var(--primary-ink); }
.ball-red { fill: var(--ball-red); } .ball-blue { fill: var(--ball-blue); }
.ball-green { fill: var(--ball-green); } .ball-yellow { fill: var(--ball-yellow); }

.answer-area { display: flex; flex-direction: column; gap: 14px; }
.inputs { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.slot {
  min-width: 150px; min-height: 72px; padding: 0 16px; border-radius: 18px; background: var(--card-2);
  border: 3px solid var(--line); font: 600 2.3rem var(--font-head); display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums; transition: border-color .15s, box-shadow .15s;
}
.slot.active { border-color: var(--primary); box-shadow: 0 0 0 5px var(--primary-soft); }
.slot.empty::after { content: ''; width: 3px; height: 1.05em; background: var(--primary); border-radius: 2px; animation: blink 1s steps(1) infinite; }
.slot:not(.active).empty::after { display: none; }
.slot.shake { animation: shake .32s; }
@keyframes blink { 50% { opacity: 0; } }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.frac-input { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.frac-input .bar { width: 170px; height: 5px; background: var(--ink); border-radius: 3px; }
.frac-input .slot { min-width: 130px; min-height: 62px; font-size: 1.9rem; }
.unit { font: 600 1.3rem var(--font-head); color: var(--ink-2); }
.qr-word { font: 600 1.4rem var(--font-head); color: var(--ink-2); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.key {
  min-height: 62px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  box-shadow: 0 3px 0 var(--line), var(--shadow-sm); font: 600 1.7rem var(--font-head);
  transition: transform .06s, box-shadow .06s;
}
.key:active { transform: translateY(3px); box-shadow: 0 0 0 var(--line); background: var(--card-2); }
.key.fn { font-size: 1.3rem; color: var(--ink-2); background: var(--card-2); }
.check { width: 100%; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.choice {
  min-height: 70px; border-radius: 16px; background: var(--card); border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--line); font: 600 1.45rem var(--font-head); padding: 8px 12px; transition: transform .06s;
}
.choice:active { transform: translateY(3px); box-shadow: none; }
.choice.sym { font-size: 2.4rem; }
.choice.right { border-color: var(--good); background: var(--good-soft); animation: pop .3s; }
.choice.wrong { border-color: var(--warm); background: var(--warm-soft); }

.feedback { border-radius: 18px; padding: 16px 18px; font-size: 1.08rem; animation: pop .25s cubic-bezier(.2, .9, .3, 1.3); }
.feedback.good { background: var(--good-soft); border: 2px solid color-mix(in srgb, var(--good) 45%, transparent); }
.feedback.retry { background: var(--warm-soft); border: 2px solid color-mix(in srgb, var(--warm) 40%, transparent); }
.feedback .fh { font: 600 1.3rem var(--font-head); margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.feedback .tick { width: 34px; height: 34px; border-radius: 50%; background: var(--good); color: #fff; display: grid; place-items: center; font-size: 1.1rem; flex: none; }
.feedback .kaj { display: flex; gap: 8px; align-items: center; margin-top: 10px; font-weight: 700; color: var(--ink-2); font-size: .92rem; }
.feedback .explain-visual { margin-top: 12px; display: flex; justify-content: center; background: var(--card); border-radius: 14px; padding: 10px; }
@keyframes pop { from { transform: scale(.96); opacity: .3; } to { transform: none; opacity: 1; } }

.intro-card .body { font-size: 1.2rem; }

/* ---------- Dyrebogen ---------- */
.book { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.book-item { background: var(--card); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow-sm); padding: 14px 10px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.book-item.locked { background: var(--card-2); box-shadow: none; }
.book-item .nm { font: 600 1rem var(--font-head); }
.book-item .kind { font-size: .75rem; color: var(--ink-2); font-weight: 700; margin-top: -4px; }
.book-item .fact { font: 600 .82rem var(--font-head); color: var(--ink-3); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; font-size: .85rem; color: var(--ink-2); font-weight: 700; margin-top: 16px; }
.timer { font: 600 2.6rem var(--font-head); font-variant-numeric: tabular-nums; }

/* ---------- Profiler ---------- */
/* ---------- Velkomsten (profilvalget, forslag A "Ved porten"): den malede indgang, træskiltet og et glaspanel ---------- */
#app:has(> .welcome-bg) { min-height: 100dvh; display: flex; flex-direction: column; gap: 14px; }
#app > .welcome-bg { animation: none; }
.welcome-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #3d6b3a; }
.welcome-bg picture, .welcome-bg img { display: block; width: 100%; height: 100%; }
.welcome-bg img { object-fit: cover; object-position: 30% 40%; }
.welcome-sign { position: relative; z-index: 2; align-self: flex-start; display: flex; align-items: center; gap: 12px; padding: 9px 20px 9px 10px; border-radius: 18px;
  background: linear-gradient(#a8743f, #8a5a2b); border: 3px solid #6d4420; box-shadow: 0 6px 0 #5a3618, 0 14px 30px rgba(0, 0, 0, .25); color: #fff7e6; }
.ws-paw { width: 44px; height: 44px; border-radius: 50%; background: #fff3d6; display: grid; place-items: center; box-shadow: inset 0 0 0 3px #e6c48c; flex: none; }
.ws-paw svg { width: 26px; height: 26px; fill: #8a5a2b; }
.welcome-sign b { display: block; font: 600 clamp(1.45rem, 3.6vw, 2.1rem)/1.1 var(--font-head); letter-spacing: .3px; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.welcome-sign small { display: block; font: 800 .8rem var(--font-body); opacity: .9; }
.welcome-panel { position: relative; z-index: 2; margin-top: auto; align-self: flex-end; width: min(100%, 540px); padding: 18px 18px 14px; border-radius: 26px;
  background: color-mix(in srgb, var(--card) 80%, transparent); box-shadow: 0 20px 50px rgba(20, 40, 20, .35); }
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .welcome-panel { background: color-mix(in srgb, var(--card) 70%, transparent); backdrop-filter: blur(12px) saturate(1.2); -webkit-backdrop-filter: blur(12px) saturate(1.2); }
}
@media (orientation: portrait) { .welcome-panel { align-self: center; } }
.wp-hello { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.wp-hello .avatar { width: 62px; height: 62px; box-shadow: 0 0 0 3px #fff; }
.wp-hello h1 { margin: 0; font-size: 1.55rem; line-height: 1.15; text-wrap: balance; }
.wp-hello p { margin: 2px 0 0; font-weight: 700; color: var(--ink-2); }
.profiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; padding: 0 10px; }
/* En dyrepassers adgangsbillet: papir med takker i siderne – ser ens ud i lyst og mørkt tema */
.ticket { position: relative; display: flex; align-items: center; gap: 12px; padding: 11px 16px 11px 12px; border-radius: 16px; text-align: left;
  background: #fffaf0; border: 2px solid #e8d3a8; box-shadow: 0 4px 0 #e2c793; color: #2a3a2a; transition: transform .12s; }
.ticket:hover { transform: translateY(-2px); }
.ticket::before, .ticket::after { content: ''; position: absolute; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%;
  background: color-mix(in srgb, var(--card) 85%, #c9b98f); border: 2px solid #e8d3a8; }
.ticket::before { left: -11px; } .ticket::after { right: -11px; }
.ticket .avatar { width: 56px; height: 56px; background: #d9f0e6; box-shadow: inset 0 0 0 3px #fff; }
.ticket.new { background: rgba(255, 250, 240, .72); border-style: dashed; box-shadow: none; }
.ticket.new .avatar { background: #fff; color: var(--primary); font: 600 1.8rem var(--font-head); }
.tk-txt { display: grid; gap: 1px; min-width: 0; }
.tk-txt b { font: 600 1.25rem var(--font-head); }
.tk-txt span { font-size: .86rem; font-weight: 800; color: #5d6b5a; }
.tk-txt .tk-prog { color: #8a6a12; }
#newform { margin-top: 14px; padding: 14px; border-radius: 18px; background: var(--card); }
/* Copyright nede i hjørnet af skærmen – uden for panelet (Troels) */
#app:has(> .welcome-bg) { padding-bottom: max(40px, calc(env(safe-area-inset-bottom) + 30px)); }
.welcome-copy { position: fixed; z-index: 2; left: 14px; bottom: max(10px, env(safe-area-inset-bottom)); font: 700 .74rem var(--font-body); color: #fff; opacity: .9; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); pointer-events: none; }
#app > .welcome-copy { animation: none; }
.wp-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 14px; margin-top: 14px; font-size: .8rem; font-weight: 700; color: var(--ink-2); }

/* ---------- Forælder ---------- */
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { color: var(--ink-2); font: 600 .74rem var(--font-head); text-transform: uppercase; letter-spacing: .5px; }
.table-wrap { overflow-x: auto; }
.heat { display: grid; grid-template-columns: 34px repeat(8, 1fr); gap: 3px; max-width: 460px; }
.heat .h { font: 600 .8rem var(--font-head); text-align: center; color: var(--ink-2); align-self: center; }
.heat .c { aspect-ratio: 1; border-radius: 6px; font-size: .7rem; display: grid; place-items: center; font-weight: 800; color: #fff; }
.heat .b-1 { background: var(--line); color: var(--ink-2); }
.heat .b0 { background: #e0705a; } .heat .b1 { background: #eda05a; } .heat .b2 { background: #e8c95a; color: #333; }
.heat .b3 { background: #9ccf6a; color: #233; } .heat .b4 { background: #4fb07a; } .heat .b5 { background: #2f8a5a; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.bar-mini { height: 8px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.bar-mini > i { display: block; height: 100%; background: var(--ac, var(--primary)); }
.seg { display: inline-flex; border-radius: 14px; border: 2px solid var(--line); overflow: hidden; background: var(--card); }
.seg button { padding: 10px 16px; font: 600 .95rem var(--font-head); min-height: 46px; }
.seg button.on { background: var(--primary); color: #fff; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }

/* ---------- Overlays ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--card); padding: 12px 20px; border-radius: 14px; font-weight: 800; z-index: 30; animation: pop .2s; }
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: var(--gutter); background: rgba(16, 32, 42, .45); animation: fade .15s; }
.modal .card { max-width: 440px; width: 100%; animation: pop .2s; }
@keyframes fade { from { opacity: 0; } }
.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 40; }

/* ---------- Tilpasning til skærmstørrelse ---------- */
@media (max-width: 900px) {
  .zoo-map { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  h1 { font-size: 1.6rem; }
  .prompt .big-expr { font-size: 2.2rem; }
  .key { min-height: 54px; }
  .slot { min-width: 120px; min-height: 62px; font-size: 1.9rem; }
  .card { padding: 16px; }
}
@media (max-width: 480px) {
  .zoo-map { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Intro: Sådan spiller du ---------- */
.tour { max-width: 640px; }
.tour-visual { min-height: 150px; display: grid; place-items: center; padding: 10px 0; }
.tour-icons { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.tour-icons span { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; font-size: 1.9rem; background: color-mix(in srgb, var(--ac) 18%, var(--card)); }
.tour-babies { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.tour .plan { width: 100%; }
.tour-dots { display: flex; gap: 8px; justify-content: center; }
.tour-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); transition: width .2s; }
.tour-dots i.on { width: 26px; border-radius: 99px; background: var(--primary); }

.goal-bar { height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin-top: 10px; }
.goal-bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), #ffc94d); }

/* ---------- Øvebanen og trin-for-trin ---------- */
/* Øvebanens forside: et banner med stien (samme scene som i øvelserne) og titlen på en glasplade */
.oeve-hero { min-height: 250px; border-radius: var(--r-lg); overflow: hidden; display: flex; align-items: center; justify-content: flex-end; padding: 20px;
  background: #cfe9f5 url(../img/bg/oevebane-l.webp) 30% 22% / cover no-repeat; box-shadow: var(--shadow); }
.oeve-glass { width: min(100%, 450px); padding: 16px 20px; border-radius: 18px; background: color-mix(in srgb, var(--card) 88%, transparent); box-shadow: 0 10px 30px rgba(31, 51, 70, .2); }
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .oeve-glass { background: color-mix(in srgb, var(--card) 72%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4); }
}
.oeve-glass h1 { margin: 0 0 4px; }
.oeve-glass p { margin: 0; color: var(--ink-2); font-weight: 700; line-height: 1.45; }
@media (max-width: 640px) { .oeve-hero { min-height: 0; padding: 140px 10px 10px; background-position: 16% 36%; } }
.area-hero .disc-art { width: 150px; height: 112px; object-fit: contain; margin: -12px 0; flex: none; filter: drop-shadow(0 6px 8px rgba(31, 51, 70, .14)); }
/* Gangetabellen: én knap pr. tabel – grøn, når tabellen sidder sikkert */
.tbl-picks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tbl-pick { min-width: 46px; height: 46px; padding: 0 10px; border-radius: 14px; background: var(--card); border: 2px solid var(--line); font: 600 1.15rem var(--font-head); color: var(--ink); }
.tbl-pick.øver { border-color: color-mix(in srgb, var(--sun) 70%, var(--line)); }
.tbl-pick.sikker, .tbl-pick.mestret { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.wn { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); font: 600 .95rem var(--font-head); flex: none; }
.wn.big-n { width: 40px; height: 40px; font-size: 1.15rem; background: color-mix(in srgb, var(--ac) 16%, var(--card)); color: var(--ink); }

.walk { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.walk li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line-2); }
.walk li.new { background: var(--sun-soft); border-color: color-mix(in srgb, #ffc94d 50%, transparent); animation: pop .3s; }
.walk .body { font-size: 1.12rem; }
.walk .visual { margin-top: 8px; justify-content: flex-start; }
.walk .visual .vis { max-width: 520px; }
.steps { margin: 6px 0 0; padding-left: 1.3em; display: grid; gap: 4px; }
.steps li { padding-left: 2px; }
.check-line { color: var(--primary-ink); font-weight: 800; }
.xvar { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-weight: 700; color: var(--c-maal); padding: 0 .05em; }

.parts { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; font: 600 1.8rem var(--font-head); }
.parts .pt { white-space: nowrap; }
.slot.sm { min-width: 84px; min-height: 60px; font-size: 1.7rem; padding: 0 10px; }
.lab-slot { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lab-slot .lab { font: 600 .72rem var(--font-head); color: var(--ink-2); text-transform: uppercase; letter-spacing: .5px; }
.frac-input.mini { gap: 4px; }
.frac-input.mini .bar { width: 90px; height: 4px; }
.frac-input.mini .slot { min-width: 84px; min-height: 56px; font-size: 1.6rem; }
.frac-input .den { font: 600 1.5rem var(--font-head); }
.choice-grid.wide { grid-template-columns: 1fr; }
.choice-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice.long { font-size: 1.2rem; padding-inline: 8px; }
@media (max-width: 420px) { .choice.long { font-size: 1.05rem; } }
.choice.xlong { font-size: 1rem; padding-inline: 6px; } /* "Parallelogram", "Stumpvinklet" – skal kunne stå i en smal knap på sedlen */
.choice-grid.wide .choice { font-size: 1.6rem; letter-spacing: .5px; }
.task:not(.has-input) .answer-area { width: 100%; max-width: 620px; margin: 0 auto; }

/* Tegnede unger: billedet vokser med stadiet */
.baby > img { position: relative; width: calc(56% + var(--st) * 6%); height: auto; aspect-ratio: 1; object-fit: contain; transition: width .3s; user-select: none; -webkit-user-drag: none; }
.baby.has-img::before { background: var(--sun-soft); }
.baby.new > img { filter: brightness(0) opacity(.16); } /* ikke født endnu: kun skyggen – tegningen er en overraskelse (som på områdesiderne) */
.avatar.has-img { overflow: hidden; background: var(--primary-soft); }
.avatar > img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; user-select: none; -webkit-user-drag: none; }
.tour-portrait { width: min(220px, 60vw); height: auto; filter: drop-shadow(0 8px 18px rgba(31, 51, 70, .12)); }

/* ---------- Unge-animationer ---------- */
.baby > img { transform-origin: 50% 85%; }
.baby.idle > img { animation: breathe 3.4s ease-in-out infinite; }
.baby.react-happy > img { animation: hop .7s cubic-bezier(.3, .7, .4, 1); }
.baby.react-think > img { animation: tilt .9s ease-in-out; }
.baby.react-grow > img { animation: grow-pop .65s cubic-bezier(.3, 1.6, .5, 1); }
.baby .fx { position: absolute; left: 50%; top: 20%; font-size: 16px; pointer-events: none; animation: float-up 1.1s ease-out forwards; z-index: 2; }
@keyframes breathe { 50% { transform: scale(1.025, .985); } }
@keyframes hop {
  0% { transform: translateY(0) scale(1); }
  20% { transform: translateY(2px) scale(1.08, .9); }
  45% { transform: translateY(-16%) scale(.95, 1.06); }
  70% { transform: translateY(0) scale(1.05, .94); }
  85% { transform: translateY(-4%) scale(1); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes tilt {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-12deg); }
  55% { transform: rotate(8deg); }
  80% { transform: rotate(-3deg); }
}
@keyframes grow-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.32); }
  70% { transform: scale(.94); }
  100% { transform: scale(1); }
}
@keyframes float-up {
  0% { opacity: 0; transform: translate(var(--dx, -50%), 0) scale(.6); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, -50%), -46px) scale(1.1); }
}
.baby-banner .baby { width: 62px; height: 62px; }
.baby-banner .baby > img { width: calc(62% + var(--st) * 6%); }

/* ---------- Større billeder (tegnede unger og figurer) ---------- */
.baby { width: 78px; height: 78px; }
.baby::before { inset: 5px; }
.baby > img { width: calc(64% + var(--st) * 5%); }
.baby.lg { width: 112px; height: 112px; }
.baby.lg::before { inset: 6px; }
.baby-banner { gap: 16px; padding: 10px 18px 10px 10px; }
.baby-banner .baby { width: 88px; height: 88px; }
.baby-banner .baby > img { width: calc(66% + var(--st) * 5%); }
.baby-banner .t { font-size: 1.12rem; }
.baby .zz { font-size: 1rem; top: -2px; right: -2px; }
.book { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
@media (max-width: 420px) { .book { grid-template-columns: repeat(2, minmax(0, 1fr)); } } /* telefon: to unger pr. række */
.avatar { width: 62px; height: 62px; font-size: 34px; }
.avatar.sm { width: 46px; height: 46px; font-size: 24px; }
.avatar.lg { width: 84px; height: 84px; font-size: 46px; }
.bubble::before { top: 22px; }
.tour-babies .baby { width: 96px; height: 96px; }
@media (max-width: 760px) {
  .baby { width: 66px; height: 66px; }
  .baby-banner .baby { width: 74px; height: 74px; }
  .avatar { width: 54px; height: 54px; }
}
.icon-btn.pill { width: auto; padding: 0 14px; gap: 6px; display: inline-flex; align-items: center; font: 600 .95rem var(--font-head); color: var(--ink); }
@media (max-width: 520px) { .icon-btn.pill span { display: none; } .icon-btn.pill { padding: 0; width: 48px; justify-content: center; } }

/* ---------- Om appen ---------- */
/* Som reglerne: den malede forside (zoo'en set fra oven) med formålet i glas, pensum som zoo'ens steder og principperne
   som regel-kort med tegnede ikoner */
.about { display: grid; gap: 0; margin-top: 10px; }
.about-hero { background-image: url(../img/map/zoo-map-base.webp); background-position: 50% 62%; }
.about-hero .oeve-glass { width: min(100%, 520px); }
.about-lead { margin: 0 2px 14px; max-width: 72ch; color: var(--ink-2); line-height: 1.55; }
.about-note { margin: 12px 2px 0; max-width: 72ch; }
.pensum-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 1000px) { .pensum-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.pensum-tile { display: flex; flex-direction: column; gap: 2px; padding: 0 14px 14px; overflow: hidden; border-radius: var(--r); background: var(--card);
  border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.pn-art { display: grid; place-items: center; height: 108px; margin: 0 -14px 10px;
  background: radial-gradient(ellipse 72% 64% at 50% 60%, color-mix(in srgb, var(--ac) 34%, var(--card)), color-mix(in srgb, var(--ac) 10%, var(--card))); }
.pn-art img { width: 116px; height: 92px; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(31, 51, 70, .14)); }
.pn-topic { font: 600 .74rem var(--font-head); text-transform: uppercase; letter-spacing: .8px; color: color-mix(in srgb, var(--ac) 62%, var(--ink)); }
.pensum-tile h3 { margin: 0; font-size: 1.08rem; text-wrap: balance; hyphens: auto; overflow-wrap: anywhere; }
.pensum-tile p { margin: 4px 0 0; font-size: .86rem; line-height: 1.45; color: var(--ink-2); }
.principle .rule-ic { width: 56px; height: 56px; border-radius: 16px; }
.principle .rule-ic .ui-ic { width: 48px; height: 48px; }
.principle .rule-ic .ui-ic.face { width: 50px; height: 50px; }
.principle .pr-src { margin-top: 2px; font-size: .82rem; color: var(--ink-2); font-style: italic; }
.about .copyright { margin-top: 22px; }
#about-p { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; }
@media (max-width: 480px) { #about-p .about-lbl { display: none; } } /* telefon: kun ikonet, så titlen kan stå */

/* ---------- Zoo-kortet (forsiden) ---------- */
/* Grundkortet er landskabet; områderne ligger ovenpå som knapper med procent-placering.
   cqw = procent af kortets bredde, så skilte og figurer skalerer med kortet. */
.map-wrap { position: relative; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-lg); background: #9fcf8f; }
.map-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.zoo-map { position: relative; width: 100%; min-width: 700px; aspect-ratio: 1672 / 941; container-type: inline-size; overflow: hidden; -webkit-user-select: none; user-select: none; }
.zm-base { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; }
.zoo-map img { -webkit-user-drag: none; }
/* :where giver nulstillingen ingen vægt, så skilte og figurer beholder deres egen stil */
:where(.zoo-map button) { position: absolute; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.zoo-map button:focus { outline: none; }
.zoo-map button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; border-radius: 18px; box-shadow: 0 0 0 6px rgba(31, 51, 70, .55); }
.m-tap { cursor: pointer; }
@keyframes m-bang { 50% { transform: translateY(-6px); } }

/* Områderne: hele billedets felt er klikbart, ikke kun selve tegningen */
.zm-area { display: block; }
.zm-ov { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; transform-origin: 50% 75%; transition: transform .2s ease, filter .2s ease, opacity .2s ease; }
/* Mus eller tastatur over tegningen eller navneskiltet: begge fremhæves (.hl sættes af app.js) */
.zm-area.hl .zm-ov { transform: scale(1.035); filter: brightness(1.07) drop-shadow(0 0 2px #fff) drop-shadow(0 8px 12px rgba(31, 51, 70, .28)); }
.zm-area:active .zm-ov { transform: scale(.97); filter: brightness(.93); transition-duration: .06s; }
/* Under opbygning: dæmpede farver (ingen gennemsigtighed, så grundkortet ikke skinner igennem) */
.zm-area.lv-0 .zm-ov { filter: saturate(.3) brightness(1.04) contrast(.92); }
.zm-area.lv-0.hl .zm-ov { filter: saturate(.6) brightness(1.08) drop-shadow(0 0 2px #fff) drop-shadow(0 8px 12px rgba(31, 51, 70, .2)); }
.zm-area.lv-0:active .zm-ov { filter: grayscale(.6) brightness(.98); }
/* Populær, stjerne og guld: varmt lys bag tegningen og små stjerner */
.zm-glow { position: absolute; inset: -4% -2% 2%; border-radius: 50%; pointer-events: none; background: radial-gradient(closest-side, rgba(255, 236, 160, .55), rgba(255, 236, 160, 0)); }
.lv-3 .zm-glow { background: radial-gradient(closest-side, rgba(255, 214, 90, .7), rgba(255, 214, 90, 0)); }
.lv-4 .zm-glow { background: radial-gradient(closest-side, rgba(255, 196, 40, .85), rgba(255, 196, 40, 0)); animation: zm-pulse 3.2s ease-in-out infinite; }
.zm-spark { position: absolute; z-index: 1; width: 4.5%; aspect-ratio: 1; background: #ffd75e; pointer-events: none;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: twinkle 2s ease-in-out infinite; }
.zm-spark.s1 { top: 8%; left: 18%; }
.zm-spark.s2 { top: 3%; left: 70%; width: 3.5%; animation-delay: .6s; }
.zm-spark.s3 { top: 30%; left: 88%; animation-delay: 1.2s; }
.zm-spark.s4 { top: 26%; left: 5%; width: 3.5%; animation-delay: .3s; }
.zm-spark.s5 { top: 1%; left: 45%; animation-delay: .9s; }
@keyframes zm-pulse { 50% { opacity: .6; } }

/* Navneskilte: kort navn og evt. et lille statustegn */
.zm-label { z-index: 3; transform: translate(-50%, -50%); white-space: nowrap; padding: .2em .75em; border-radius: 99px;
  background: rgba(255, 251, 242, .95); border: 2px solid #d4b07a; color: #4a3220; font: 600 clamp(10px, 1.3cqw, 15px)/1.25 var(--font-head);
  box-shadow: 0 2px 6px rgba(31, 51, 70, .2); transition: scale .15s ease; }
.zm-label .sym { font-size: .9em; }
.zm-label.lv-0 { background: rgba(244, 239, 230, .94); color: #6d5c4a; border-color: #cbbba3; }
.zm-label.lv-4 { border-color: #f2b632; box-shadow: 0 0 0 2px rgba(255, 210, 90, .6), 0 2px 6px rgba(31, 51, 70, .2); }
.zm-label.hl { scale: 1.08; background: #fff; border-color: var(--primary); color: #2d2014;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent), 0 4px 10px rgba(31, 51, 70, .25); }
.zm-label:active { scale: .95; }

/* Porten: zoo'ens navn med en flagguirlande – et flag pr. område med en stjerne */
.zm-gate { position: absolute; z-index: 2; transform: translate(-50%, -50%); display: grid; justify-items: center; pointer-events: none; }
.zm-flags { display: flex; gap: .3cqw; margin-bottom: .2cqw; }
.zm-flags i { display: block; width: 1.1cqw; height: 1.3cqw; background: #ff8a65; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.zm-flags i.b { background: #ffc94d; }
.zm-zooname { max-width: 16cqw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .15em .9em; border-radius: 10px;
  background: #fffaf0; border: 2px solid #8a6640; color: #2c4a3c; font: 600 clamp(11px, 1.5cqw, 17px)/1.25 var(--font-head); box-shadow: 0 3px 8px rgba(31, 51, 70, .25); }

/* Babyhuset og Bodil ved indgangen */
.zm-baby { z-index: 2; width: 8.5cqw; transform: translate(-50%, -50%); display: grid; justify-items: center; }
.zm-baby img { width: 100%; height: auto; filter: drop-shadow(0 4px 6px rgba(31, 51, 70, .25)); transition: scale .2s ease; }
.zm-badge { position: absolute; top: -2%; right: -16%; padding: .1em .5em; border-radius: 99px; border: 2px solid #fff; background: #8fa3b5; color: #fff;
  font: 600 clamp(10px, 1.1cqw, 13px)/1.3 var(--font-head); white-space: nowrap; animation: m-bang 2.6s ease-in-out infinite; }
.zm-badge.due { background: #ff8a65; }
.zm-name { margin-top: -8%; padding: .12em .7em; border-radius: 99px; background: rgba(255, 251, 242, .95); border: 2px solid #d4b07a; color: #4a3220;
  font: 600 clamp(10px, 1.2cqw, 14px)/1.25 var(--font-head); white-space: nowrap; }
.zm-bodil { z-index: 2; width: 7cqw; transform: translate(-50%, -50%); }
.zm-bodil img { display: block; width: 100%; height: auto; filter: drop-shadow(0 4px 6px rgba(31, 51, 70, .25)); animation: bob 3s ease-in-out infinite; transition: scale .2s ease; }
@media (hover: hover) { .zm-baby:hover img, .zm-bodil:hover img { scale: 1.06; } }
.zm-baby:active img, .zm-bodil:active img { scale: .94; }

/* Missionens figur med "!" */
.zm-who { z-index: 4; width: 5.2cqw; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: #ffede6;
  box-shadow: 0 0 0 .35cqw #fff, 0 4px 10px rgba(31, 51, 70, .35); transition: scale .15s ease; }
.zm-who img, .zm-who .emo { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; font-size: 3cqw; }
.zm-bang { position: absolute; top: -36%; right: -30%; display: grid; place-items: center; width: 2.6cqw; aspect-ratio: 1; border-radius: 50%; border: 2px solid #fff;
  background: #ff8a65; color: #fff; font: 700 clamp(11px, 1.5cqw, 17px)/1 var(--font-head); animation: m-bang 2.6s ease-in-out infinite; }
@media (hover: hover) { .zm-who:hover { scale: 1.08; } }
.zm-who:active { scale: .92; }

/* Gæster og ugens dage */
.zm-info { position: absolute; z-index: 2; transform: translate(-50%, -50%); display: flex; align-items: center; gap: .6em; white-space: nowrap; padding: .25em .9em;
  border-radius: 99px; background: rgba(31, 51, 70, .74); color: #fff; font: 600 clamp(10px, 1.15cqw, 14px)/1.3 var(--font-head); pointer-events: none; }
.zm-sep { width: 1px; height: 1em; background: rgba(255, 255, 255, .45); }
.zm-dots { display: inline-flex; gap: .3em; }
.zm-dots i { width: .6em; height: .6em; border-radius: 50%; border: 2px solid #ffc94d; }
.zm-dots i.on { background: #ffc94d; }

/* Blade eller sne efter årstiden */
.zm-fall { position: absolute; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
.zm-fall i { position: absolute; top: -3%; width: 1cqw; height: .6cqw; border-radius: 0 100% 0 100%; opacity: 0; animation: zm-fall 12s linear infinite; }
.zm-fall i.snow { width: .6cqw; height: .6cqw; border-radius: 50%; }
@keyframes zm-fall { 0% { transform: translate(0, 0) rotate(0); opacity: 0; } 10% { opacity: .9; } 100% { transform: translate(8cqw, 60cqw) rotate(540deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .zm-fall { display: none; }
  .zm-spark, .lv-4 .zm-glow, .zm-bang, .zm-badge, .zm-bodil img { animation: none; }
}

/* ---------- Ark nedefra ---------- */
.bsheet { position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 110%); width: min(680px, calc(100% - 24px)); max-height: 82vh; overflow-y: auto;
  background: var(--card); color: var(--ink); border-radius: 26px 26px 0 0; padding: 18px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .18); transition: transform .32s cubic-bezier(.2, .8, .2, 1); z-index: 25; display: grid; gap: 14px; }
.bsheet.open { transform: translate(-50%, 0); }
.bsheet .grab { width: 44px; height: 5px; border-radius: 99px; background: var(--line); justify-self: center; margin-top: -6px; }
.sheet-x { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 12px; background: var(--card-2); color: var(--ink-2); font-size: 1rem; }
.sheet-head { display: flex; align-items: center; gap: 14px; padding-right: 44px; }
.sheet-ic { width: 54px; height: 54px; border-radius: 16px; background: var(--sun-soft); display: grid; place-items: center; font-size: 1.8rem; flex: none; }
.sheet-plan { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font: 600 .92rem var(--font-head); color: var(--ink-2); }
.sheet-plan span:not(:nth-child(even)) { background: var(--card-2); border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; }
.btn.sm { min-height: 44px; padding: 0 16px; font-size: .98rem; border-radius: 13px; }
.cribs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.cribs > p { grid-column: 1 / -1; margin: 0; }
.crib { display: grid; justify-items: center; gap: 4px; font: 600 .82rem var(--font-head); color: var(--ink-2); text-align: center; }
.crib.sleep .baby > img { filter: saturate(.7); opacity: .8; }
.goal-line { display: grid; gap: 8px; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .bsheet { transition: none; } }

/* ---------- Dagens mission (forsidens hovedfokus) ---------- */
.home-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.home-top .me-chip { background: var(--card); box-shadow: var(--shadow); color: var(--ink); border: 0; cursor: pointer; transition: background .15s ease, transform .1s ease; }
/* Navnet er også knappen til at skifte profil */
.me-swap { width: 16px; height: 16px; margin-left: 2px; color: var(--ink-3); flex: none; }
@media (hover: hover) { .home-top .me-chip:hover { background: var(--card-2); } .home-top .me-chip:hover .me-swap { color: var(--primary-ink); } }
.home-top .me-chip:active { transform: scale(.96); }
.home-top .me-chip { min-width: 0; }
.me-chip .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-ic { width: 24px; height: 24px; }
/* Fem knapper øverst til højre: mindre på smalle telefoner, så navnet stadig kan være der */
@media (max-width: 420px) {
  .home-top { gap: 8px; }
  .home-top .row { gap: 5px !important; flex: none; }
  .home-top .icon-btn, .home-top .icon-btn.pill { width: 38px; height: 38px; border-radius: 11px; font-size: 1.1rem; }
  .home-top .icon-btn .ui-ic { width: 30px; height: 30px; }
  .home-top .info-ic { width: 21px; height: 21px; }
  .home-top .me-chip { padding-right: 10px; gap: 6px; }
}
/* --art styrer billedets størrelse: figuren i cirklen og dyret, der kigger frem */
.mission { --art: clamp(260px, 32vw, 340px); display: grid; grid-template-columns: var(--art) minmax(0, 1fr); gap: 32px; align-items: center; padding: 26px 28px;
  background: linear-gradient(135deg, var(--sun-soft), var(--card) 60%); border: 2px solid color-mix(in srgb, var(--sun) 45%, transparent); }
.mission-body { display: grid; gap: 12px; min-width: 0; }
.mission-body h1 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); margin: 0; }
.mission-need { font-size: 1.15rem; margin: 0; }
.mission-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.mission-steps li { display: flex; gap: 12px; align-items: center; font-weight: 700; }
.mission-steps .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-ink); font: 600 .95rem var(--font-head); flex: none; }
.mission-go { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.mission-go .btn.big { min-width: 240px; }
.mission.done { background: linear-gradient(135deg, var(--primary-soft), var(--card) 60%); border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.mission.done .kicker { color: var(--primary-ink); }
@media (max-width: 760px) {
  .mission { --art: min(230px, 60vw); grid-template-columns: 1fr; justify-items: center; text-align: left; padding: 20px; gap: 22px; }
  .mission-body { justify-self: stretch; }
  .mission-go .btn.big { width: 100%; min-width: 0; }
}
.mission-steps .topic { display: inline-block; margin-left: 6px; font: 600 .74rem var(--font-head); color: var(--ink-2); background: var(--card-2); border: 1px solid var(--line); border-radius: 99px; padding: 1px 9px; vertical-align: 2px; }

/* ---------- Missionslinje i træningen ---------- */
.session-top { align-items: center; }
.mission-track { flex: 1; min-width: 0; display: grid; gap: 6px; background: var(--card); border: 1px solid var(--line-2); border-radius: 18px; padding: 8px 14px; box-shadow: var(--shadow-sm); }
.mt-title { font-size: .92rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-title b { color: var(--ink); font-family: var(--font-head); font-weight: 600; }
.mt-steps { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 0; }
.mt-steps li { display: inline-flex; align-items: center; gap: 6px; font: 600 .92rem var(--font-head); color: var(--ink-2); white-space: nowrap; padding: 3px 10px; border-radius: 99px; }
.mt-steps li.done { color: var(--primary-ink); }
.mt-steps li.current { background: var(--primary-soft); color: var(--ink); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--primary) 45%, transparent); }
.mt-steps li.todo { opacity: .6; }
.mt-steps li.mt-arrow { padding: 0; opacity: .45; }
.mt-check { color: var(--primary); font-weight: 900; }
.mt-count { font-variant-numeric: tabular-nums; color: var(--primary-ink); }
@media (max-width: 640px) {
  .mt-steps li:not(.current) .mt-lbl { display: none; }
  .mt-steps li { padding: 3px 8px; font-size: .86rem; }
  .mission-track { padding: 6px 10px; }
}
@media (max-width: 640px) {
  .mt-steps { gap: 4px; }
  .mt-steps li.mt-arrow { display: none; }
}
.feedback.nudge { background: var(--sun-soft); border: 2px solid color-mix(in srgb, var(--sun) 55%, transparent); padding: 12px 16px; }
.feedback.nudge .fh { font-size: 1.15rem; margin: 0; }
.feedback.nudge #hinttext { margin-top: 6px; font-weight: 700; }

/* ---------- Tegnede UI-ikoner (img/ui) ---------- */
.ui-ic { display: block; width: 32px; height: 32px; object-fit: contain; flex: none; -webkit-user-drag: none; user-select: none; }
.icon-btn .ui-ic { width: 36px; height: 36px; }
.icon-btn.pill { padding: 0 14px 0 8px; }
@media (max-width: 520px) { .icon-btn.pill { padding: 0; } }
.icon-btn.snd { position: relative; }
.icon-btn.snd.off .ui-ic { filter: grayscale(1); opacity: .45; }
.icon-btn.snd.off::after { content: ''; position: absolute; width: 34px; height: 4px; border-radius: 2px; background: var(--ink-2); transform: rotate(-45deg); box-shadow: 0 0 0 2px var(--card); }
.kicker.with-ic { display: inline-flex; align-items: center; gap: 8px; }
.mission-steps .si { position: relative; width: 54px; height: 54px; flex: none; }
.mission-steps .si .ui-ic { width: 54px; height: 54px; }
@media (max-width: 760px) { .mission-steps .si, .mission-steps .si .ui-ic { width: 46px; height: 46px; } }
.mission-steps .si i { position: absolute; right: -4px; bottom: -3px; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary-ink); color: var(--card); font: 600 .72rem var(--font-head); box-shadow: 0 0 0 2px var(--card); }
.sheet-plan span { display: inline-flex; align-items: center; gap: 6px; }
.sheet-plan .ui-ic { width: 26px; height: 26px; margin: -3px 0 -3px -6px; }
.sheet-ic.art { background: none; }
.sheet-ic.art .ui-ic { width: 54px; height: 54px; }
.area-hero .big .ui-ic { width: 84px; height: 84px; }
.plan .ico .ui-ic { width: 40px; height: 40px; }
.mt-ic .ui-ic { width: 28px; height: 28px; margin: -3px 0; }
.mt-steps li.todo .ui-ic { filter: saturate(.5); }
.mt-title .ui-ic { display: inline-block; width: 22px; height: 22px; vertical-align: -6px; margin-right: 6px; }
.block-art { display: grid; place-items: center; }
.block-art .ui-ic { width: 120px; height: 120px; filter: drop-shadow(0 8px 14px rgba(31, 51, 70, .14)); animation: pop .4s ease-out; }
@media (prefers-reduced-motion: reduce) { .block-art .ui-ic { animation: none; } }
/* Lukket ark: skjul det helt (ingen skygge i bunden, knapperne kan ikke fokuseres) */
.bsheet { visibility: hidden; transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility 0s .32s; }
.bsheet.open { visibility: visible; transition: transform .32s cubic-bezier(.2, .8, .2, 1); }
@media (prefers-reduced-motion: reduce) { .bsheet, .bsheet.open { transition: none; } }
@media (max-width: 640px) {
  .mt-ic .ui-ic { width: 22px; height: 22px; margin: -2px 0; }
  .mt-steps li { flex: none; }
  .mt-steps li:not(.current) { padding: 2px 3px; }
  .mt-steps li.current { flex: 0 1 auto; min-width: 0; }
  .mt-steps li.current .mt-lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- MissionScene: én fælles scene for alle 9 missioner (SCENES i zoo.js) ---------- */
/* Tekst og knap til venstre på en rolig, lys baggrund; til højre et lille udsnit af zoo'en:
   områdets tegning bagest, dyret til højre og missionens figur forrest. */
.mission.has-scene { grid-template-columns: minmax(0, 1fr) minmax(250px, 48%); grid-template-areas: "body scene"; justify-items: stretch;
  gap: 12px; padding: 26px 0 26px 30px; margin-top: 40px;
  background: radial-gradient(ellipse 52% 70% at 84% 100%, color-mix(in srgb, var(--good) 20%, transparent), transparent 72%),
    linear-gradient(135deg, var(--sun-soft), var(--card) 58%); }
.mission.has-scene .mission-body { grid-area: body; }
/* Fast forhold, så kompositionen er den samme i alle bredder */
.mission-scene { position: relative; aspect-ratio: 20 / 19; }
.mission.has-scene .mission-scene { grid-area: scene; align-self: end; margin: -26px 0; } /* står på kortets bundkant */
.mission-scene img { position: absolute; user-select: none; -webkit-user-drag: none; pointer-events: none; }
/* Områdets tegning holdes inden for en fast ramme, så både brede og høje tegninger passer */
.ms-bg { right: 0; bottom: 18%; width: 82%; height: 76%; object-fit: contain; object-position: right bottom; }
.ms-animal { filter: drop-shadow(0 8px 10px rgba(31, 51, 70, .12)); }
.ms-animal.full { right: 4%; bottom: 3%; height: 104%; width: auto; } /* helfigur, fx giraffen – kigger op over kanten */
.ms-animal.cub { right: 1%; bottom: -3%; width: 40%; height: auto; } /* en unge, der kigger frem forrest */
.ms-who { left: -4%; bottom: -3%; height: 70%; width: auto; filter: drop-shadow(0 8px 12px rgba(31, 51, 70, .14)); }
/* Overgangen i træningen: samme scene i et mindre kort */
.mission-scene.ms-card { width: min(300px, 76vw); margin: 2px auto 0; }
@media (max-width: 640px) {
  .mission.has-scene { grid-template-columns: 1fr; grid-template-areas: "scene" "body"; padding: 0 18px 20px; margin-top: 44px; gap: 12px;
    background: radial-gradient(ellipse 85% 34% at 50% 26%, color-mix(in srgb, var(--good) 18%, transparent), transparent 75%),
      linear-gradient(180deg, var(--sun-soft), var(--card) 50%); }
  .mission.has-scene .mission-scene { aspect-ratio: auto; align-self: auto; height: 192px; margin: 0 -18px; }
  .mission.has-scene .ms-bg { right: auto; left: calc(50% - 40px); bottom: 8%; width: 46%; height: 84%; object-position: center bottom; }
  .mission.has-scene .ms-animal.full { right: auto; left: calc(50% - 44px); bottom: 0; height: 116%; }
  .mission.has-scene .ms-animal.cub { right: auto; left: calc(50% + 52px); bottom: -2%; width: auto; height: 56%; }
  .mission.has-scene .ms-who { left: auto; right: calc(50% + 2px); bottom: -4%; height: 92%; }
}
/* Missionslinjen i træningen: lille udgave af scenen ved siden af titel og trin */
.mission-track.has-scene { grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 12px; }
.mt-main { display: grid; gap: 6px; min-width: 0; }
.mt-scene { position: relative; width: 84px; height: 58px; border-radius: 12px; overflow: hidden; flex: none;
  background: color-mix(in srgb, var(--good) 16%, var(--card)); box-shadow: inset 0 0 0 1px var(--line-2); }
.mts-bg { position: absolute; inset: -6% -8% auto auto; width: 92%; height: auto; }
.mts-ani { position: absolute; left: -4%; bottom: -10%; height: 86%; width: auto; filter: drop-shadow(0 2px 3px rgba(31, 51, 70, .2)); }
@media (max-width: 640px) {
  .mt-scene { display: none; }
  .mission-track.has-scene { grid-template-columns: minmax(0, 1fr); column-gap: 0; }
}

/* ---------- Mission klaret: samme scene som ved starten, nu i "efter"-tilstand ---------- */
.mission.payoff { margin-top: max(40px, 9vh); }
.kicker .ok { color: var(--primary); font-weight: 900; }
/* Varmt lys bag figurerne; på slutskærmen hopper de af glæde et par gange */
.mission-scene.ms-success::before { content: ''; position: absolute; inset: 4% -2% 0 2%; border-radius: 50%;
  background: radial-gradient(circle at 52% 58%, color-mix(in srgb, var(--sun) 46%, transparent), transparent 64%); }
.payoff .mission-scene.ms-success .ms-animal { animation: cheer 1s cubic-bezier(.3, .7, .4, 1) .3s 2 both; }
.payoff .mission-scene.ms-success .ms-who { animation: cheer .9s cubic-bezier(.3, .7, .4, 1) .5s 2 both; }
@keyframes cheer { 0%, 100% { transform: translateY(0); } 35% { transform: translateY(-6%); } 65% { transform: translateY(1.5%); } }
.ms-say { position: absolute; z-index: 2; left: 0; top: 9%; padding: 8px 14px; border-radius: 16px; background: var(--card); color: var(--ink);
  font: 600 .95rem var(--font-head); white-space: nowrap; box-shadow: var(--shadow); animation: pop .35s ease-out .8s both; }
.ms-say::after { content: ''; position: absolute; left: 30px; bottom: -8px; border: 8px solid transparent; border-top-color: var(--card); border-bottom: 0; }
/* Stjerner, blade og konfetti – små og diskrete */
.party { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.party i { position: absolute; display: block; width: 22px; height: 22px; }
.party i:nth-child(3n+1) { background: var(--sun); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: twinkle 1.8s ease-in-out infinite; }
.party i:nth-child(3n+2) { width: 15px; height: 10px; border-radius: 0 100% 0 100%; background: var(--primary); animation: leaf-drift 4.5s ease-in-out infinite alternate; }
.party i:nth-child(3n) { width: 9px; height: 9px; border-radius: 50%; background: var(--coral); animation: twinkle 2.4s ease-in-out infinite; }
.party i:nth-child(1) { top: 3%; left: 50%; animation-delay: .2s; }
.party i:nth-child(2) { top: 15%; left: 24%; }
.party i:nth-child(3) { top: 9%; left: 86%; background: var(--sky); }
.party i:nth-child(4) { top: 32%; left: 93%; width: 13px; height: 13px; animation-delay: .7s; }
.party i:nth-child(5) { top: 46%; left: 5%; animation-delay: -1.5s; }
.party i:nth-child(6) { top: 1%; left: 30%; background: var(--lav); }
.party i:nth-child(7) { top: 25%; left: 38%; width: 12px; height: 12px; animation-delay: 1.1s; }
.party i:nth-child(8) { top: 21%; left: 72%; animation-delay: -3s; }
.party i:nth-child(9) { top: 55%; left: 96%; }
@keyframes twinkle { 0%, 100% { transform: scale(.55) rotate(0); opacity: .45; } 50% { transform: scale(1.1) rotate(20deg); opacity: 1; } }
@keyframes leaf-drift { from { transform: translateY(0) rotate(-15deg); } to { transform: translateY(14px) rotate(25deg); } }
/* Hovedresultatet og de små ekstra */
.payoff-main { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 18px; background: var(--card);
  border: 2px solid color-mix(in srgb, var(--sun) 55%, transparent); box-shadow: var(--shadow-sm); }
.pm-art { width: 64px; height: 64px; flex: none; display: grid; place-items: center; font-size: 2.4rem; line-height: 1; }
.pm-art img { width: 100%; height: 100%; object-fit: contain; }
.pm-animal .pm-art { width: 76px; height: 76px; }
.pm-animal .pm-art img { animation: grow-pop .7s cubic-bezier(.3, 1.6, .5, 1) .6s both; }
.pm-txt { display: grid; gap: 2px; min-width: 0; }
.pm-kicker { font: 600 .74rem var(--font-head); text-transform: uppercase; letter-spacing: 1px; color: var(--warm); }
.pm-title { font: 600 1.2rem/1.25 var(--font-head); color: var(--ink); }
.pm-sub { font-size: .9rem; font-weight: 700; color: var(--ink-2); }
.pm-bar { display: block; height: 8px; margin-top: 4px; border-radius: 99px; background: var(--line); overflow: hidden; }
.pm-bar i { display: block; height: 100%; border-radius: inherit; background: var(--primary); }
.payoff-extras { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.payoff-extras li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 9px; border-radius: 99px; background: var(--card);
  border: 1px solid var(--line); font: 600 .88rem var(--font-head); color: var(--ink); }
.payoff-extras .e { font-size: 1.05rem; line-height: 1; }
@media (max-width: 640px) {
  .ms-say { display: none; }
  .pm-art { width: 54px; height: 54px; font-size: 2rem; }
  .pm-animal .pm-art { width: 64px; height: 64px; }
  .pm-title { font-size: 1.08rem; }
}
@media (prefers-reduced-motion: reduce) {
  .mission-scene.ms-success img, .party i, .ms-say, .pm-art img { animation: none !important; }
}

/* ---------- Figurerne: hver har sin egen farve bag tegningen ---------- */
.avatar.has-img.who-bodil { background: var(--sun-soft); }
.avatar.has-img.who-nora { background: var(--coral-soft); }
.avatar.has-img.who-liv { background: var(--lav-soft); }
.avatar.has-img.who-yasmin { background: var(--sky-soft); }
.avatar.has-img.who-kaj { background: var(--primary-soft); }

/* ---------- Bonus-unger (én pr. hel uge) ---------- */
.bonus-sec { display: grid; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--sun-soft); }
.bonus-sec .cribs { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }

/* ---------- Områdesiden: scene, fremgang og aktiviteter ---------- */
.mission-scene.ms-locked .ms-bg { filter: saturate(.3) brightness(1.04) contrast(.92); } /* under opbygning: dæmpet som på kortet */
.place-hero .mission-body { gap: 10px; }
/* Fremgangen samlet i ét roligt felt: niveauvej, dyrene og næste mål */
.place-prog { display: grid; gap: 10px; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--card) 85%, transparent); border: 1px solid var(--line-2); }
.pp-path { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pp-path li { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 99px; background: var(--card-2); color: var(--ink-3); font: 600 .85rem var(--font-head); opacity: .65; }
.pp-path li.done { opacity: 1; color: var(--primary-ink); }
.pp-path li.now { opacity: 1; background: var(--sun-soft); color: var(--ink); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--sun) 60%, transparent); }
.pp-animals { list-style: none; margin: 0; padding: 0; display: flex; gap: 14px; }
.pp-animals li { display: grid; justify-items: center; gap: 3px; font: 600 .74rem var(--font-head); color: var(--ink-2); }
.pa-img { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--card); box-shadow: inset 0 0 0 2px var(--line); }
.pa-img img { width: 92%; height: 92%; object-fit: contain; }
.pp-animals li:not(.open) .pa-img img { filter: brightness(0) opacity(.16); } /* ikke flyttet ind endnu: skygge */
.pp-animals li.open .pa-img { background: var(--good-soft); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--good) 45%, transparent); }
.pp-animals li.next .pa-img { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--sun) 70%, transparent); }
.pp-next { margin: 0; font-size: .95rem; font-weight: 700; color: var(--ink); }
/* Aktiviteterne: matematikken som opgaver i zoo'en */
.acts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.act { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--shadow-sm); }
.act-n { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--sun-soft); color: var(--ink); font: 600 1.05rem var(--font-head); }
.act.done .act-n { background: var(--primary-ink); color: var(--card); }
.act.locked { background: var(--card-2); box-shadow: none; }
.act.locked .act-n { background: var(--line-2); font-size: .85rem; }
.act-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.act-name { font: 600 1.12rem/1.3 var(--font-head); color: var(--ink); }
.act.locked .act-name { color: var(--ink-2); }
.act-desc { font-size: .92rem; font-weight: 700; color: var(--ink-2); }
.act-skill { justify-self: start; margin-top: 4px; padding: 1px 9px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line); color: var(--ink-3); font: 600 .72rem var(--font-head); }
.act-go { display: flex; align-items: center; gap: 12px; flex: none; }
.act-lock { color: var(--ink-3); font-size: .92rem; font-weight: 700; }
@media (max-width: 640px) {
  .act { flex-wrap: wrap; }
  .act-go { width: 100%; justify-content: flex-end; }
  .pp-animals { gap: 10px; }
}

/* ---------- Introens første side: zoo'ens indgang som scene (samme kortstil som missionerne) ---------- */
/* Computer og iPad: tegningen fylder kortet, Bodil står på bundkanten til højre, og teksten ligger i en lys
   boks nederst til venstre lidt ind over tegningen. Mobil: scenen øverst og teksten under. Ingen animation. */
#app > .tour-hero { animation: none; }
.tour-hero { position: relative; max-width: 900px; margin: 4vh auto 0; padding: 0; overflow: hidden; height: clamp(440px, 54vw, 500px);
  border: 2px solid color-mix(in srgb, var(--sun) 45%, transparent);
  background: radial-gradient(ellipse 46% 52% at 52% 62%, color-mix(in srgb, var(--good) 20%, transparent), transparent 72%),
    linear-gradient(165deg, var(--sky-soft), var(--sun-soft) 58%, var(--card)); }
.th-scene img { position: absolute; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.th-bg { left: 27%; top: 4%; width: 51%; height: auto; filter: drop-shadow(0 10px 16px rgba(31, 51, 70, .12)); }
.th-bodil { right: 0; bottom: 0; width: 31%; height: auto; filter: drop-shadow(0 8px 12px rgba(31, 51, 70, .14)); }
.th-top { position: absolute; z-index: 2; top: 18px; left: 26px; right: 22px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.th-box { position: absolute; z-index: 2; left: 26px; bottom: 26px; width: min(400px, 44%); display: grid; gap: 12px; padding: 22px 24px;
  border-radius: var(--r); background: color-mix(in srgb, var(--card) 94%, transparent); box-shadow: var(--shadow-lg); }
.th-box h1 { margin: 0; font-size: clamp(1.6rem, 3.2vw, 2.1rem); text-wrap: balance; }
.th-box p { margin: 0; font-size: 1.15rem; }
.th-go { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.th-go .btn.big { min-width: 200px; }
/* iPad stående: højere kort, så tegningen kan blive stor */
@media (min-width: 641px) and (max-width: 1000px) and (orientation: portrait) {
  .tour-hero { height: min(640px, 82vw); }
  .th-bg { left: 9%; top: 8%; width: 66%; }
  .th-bodil { width: 31%; }
  .th-box { width: min(390px, 52%); }
}
@media (max-width: 640px) {
  .tour-hero { height: auto; margin-top: 2vh;
    background: linear-gradient(180deg, var(--sky-soft), var(--sun-soft) 46%, var(--card) 62%); }
  .th-scene { position: relative; height: min(76vw, 300px); }
  .th-bg { left: 4%; top: 15%; width: 72%; }
  .th-bodil { right: -3%; width: 44%; }
  .th-top { left: 18px; right: 16px; top: 14px; }
  .th-box { position: static; width: auto; padding: 18px 18px 22px; border-radius: 0; background: var(--card); box-shadow: none; }
  .th-go .btn.big { width: 100%; min-width: 0; }
  .th-go .tour-dots { width: 100%; }
}

/* ---------- Forklaringer som små kort ("Se hvordan" og Hjælp i opgaverne) ---------- */
.ex-lead { margin: 6px 0 0; font-size: 1.15rem; font-weight: 600; color: var(--ink); }
.ex-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.ex-card { display: grid; align-content: start; gap: 8px; padding: 12px 14px 14px; border-radius: 18px; background: var(--card-2); border: 1px solid var(--line-2); min-width: 0; }
.ex-card h3 { margin: 0; font-size: 1.15rem; }
.ex-vis { display: grid; place-items: center; padding: 6px; border-radius: 14px; background: var(--card); }
.ex-vis .vis { max-width: 220px; max-height: 124px; }
.ex-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ex-rules li { max-width: 100%; padding: 2px 10px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-ink); font: 600 1rem/1.5 var(--font-head); font-variant-numeric: tabular-nums; }
.ex-note { margin: 0; font-size: .98rem; font-weight: 700; color: var(--ink-2); }
.ex-tip { display: grid; gap: 8px; padding: 14px 16px; border-radius: 18px; background: var(--sun-soft); border: 1px solid color-mix(in srgb, var(--sun) 40%, transparent); }
.ex-tip h3 { margin: 0; font-size: 1.1rem; }
.ex-tip ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ex-tip li { display: flex; align-items: baseline; gap: 6px 10px; flex-wrap: wrap; font-weight: 700; font-variant-numeric: tabular-nums; }
.ex-tip .k { min-width: 7.2em; font: 600 .8rem var(--font-head); text-transform: uppercase; letter-spacing: .6px; color: var(--ink-2); }
.ex-tip .op { padding: 0 9px; border-radius: 99px; background: var(--card); font: 600 .9rem/1.6 var(--font-head); color: var(--primary-ink); }
.ex-help { display: grid; gap: 10px; margin-top: 14px; }
/* Kaj læser forklaringen op (Jeppes stemme, speak.js): båndet øverst og det kort eller trin, han taler om */
.speak-bar { display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%; padding: 5px 6px 5px 5px; border-radius: 99px; background: var(--primary-soft); }
.speak-bar .avatar { width: 38px; height: 38px; }
.sb-txt { font-weight: 800; color: var(--primary-ink); }
.sb-wave { display: inline-flex; align-items: center; gap: 3px; height: 18px; }
.sb-wave i { width: 4px; height: 30%; border-radius: 2px; background: var(--primary); opacity: .45; }
.speak-bar.playing .sb-wave i { opacity: 1; animation: sb-wave 1s ease-in-out infinite; }
.sb-wave i:nth-child(2) { animation-delay: -.3s; }
.sb-wave i:nth-child(3) { animation-delay: -.6s; }
.sb-wave i:nth-child(4) { animation-delay: -.15s; }
@keyframes sb-wave { 50% { height: 100%; } }
.sb-btn { display: inline-flex; align-items: center; gap: 6px; }
.sb-btn svg { width: 16px; height: 16px; fill: currentColor; }
.ex-card, .ex-tip, .walk li, .ex-lead { transition: box-shadow .25s, background-color .25s; }
.ex-card.speaking, .ex-tip.speaking, .walk li.speaking { box-shadow: 0 0 0 3px var(--primary); }
.ex-lead.speaking { border-radius: 10px; background: color-mix(in srgb, var(--primary) 12%, transparent); box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 12%, transparent); }
@media (prefers-reduced-motion: reduce) { .speak-bar.playing .sb-wave i { animation: none; height: 70%; } }
.ex-help .ex-cards { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
/* Forklaringernes zoo-billeder (Batch 2): det konkrete billede mellem symbolet (indledningen) og reglen (kortene) */
.ex-lead-row { display: flex; align-items: center; gap: 16px; }
.ex-lead-row .ex-lead { flex: 1; min-width: 0; }
.ex-lead-pic { display: block; flex: none; width: min(250px, 42%); height: auto; }
.ex-lead-row.solo { justify-content: center; margin-bottom: 6px; }
.ex-lead-row.solo .ex-lead-pic { width: min(220px, 70%); }
/* fast højde, så overskrifterne står på linje; billedet holder sig inden for (også i brede kort på telefon) */
.ex-pic { display: flex; align-items: flex-end; justify-content: center; height: 136px; }
.ex-pic-img { display: block; max-width: 100%; max-height: 136px; width: auto; height: auto; }
.hint-row { display: flex; align-items: center; gap: 12px; }
.hint-pic { display: block; flex: none; width: 112px; height: auto; }
.explain-pic { display: block; width: min(220px, 100%); height: auto; }
@media (max-width: 560px) {
  .ex-lead-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .ex-lead-pic, .ex-lead-row.solo .ex-lead-pic { width: min(280px, 86%); align-self: center; }
  .ex-lead-pic.env { width: min(220px, 70%); } /* miljøet er sekundært: mindre end de konkrete billeder */
  .hint-pic { width: 92px; }
}

/* ---------- Zoo'ens miljøer (Batch 3): små felter med stemning og lokal kontekst – aldrig i stedet for UI ---------- */
/* Billederne har bløde kanter og vises i deres egne proportioner (aldrig beskåret eller zoomet ind) */
.env-pic { display: block; width: 100%; height: auto; }
.pd-env { width: min(300px, 80%); margin: 0 auto; }      /* "Øvelse klaret!" */
.block-env { width: min(320px, 86%); margin: 0 auto; }   /* overgangen til runden i zoo'en */
.book-top { display: flex; align-items: center; gap: 16px; }
.book-top .say { flex: 1; min-width: 0; }
.book-env { flex: none; width: 170px; }
@media (max-width: 560px) { .book-env { display: none; } }
/* Minitegningerne: felter, fremhævet felt (orange), stiplet tom plads, dæmpet og lille tekst */
.v-box { fill: var(--card); stroke: var(--ink); stroke-width: 2; }
.v-hi { fill: var(--coral-soft); stroke: var(--coral); stroke-width: 2.5; }
.v-dash { stroke-dasharray: 5 4; }
.v-col { fill: var(--line-2); }
.v-fill-line { stroke: var(--primary); }
.v-muted-line { stroke: var(--ink-3); }
.v-muted { fill: var(--ink-3); }
.v-label { fill: var(--card); opacity: .92; }
.v-text.v-tiny { font-size: 14px; }
.v-text.v-muted { fill: var(--ink-2); }
.v-text.v-added { fill: var(--coral); }
/* Form og tegning (Øvebanen, kapitel 3): ternet papir, figurer og koordinatsystem */
.vis.vis-geo { max-width: 360px; max-height: 260px; }
.walk .visual .vis.vis-geo { max-width: 300px; }
.v-grid { stroke: var(--line); stroke-width: 1; }
/* Prisskiltet ved indgangen (Tabeller og diagrammer): et skilt af træ – ser ens ud i lyst og mørkt tema */
.price-board { margin: 0 auto; min-width: min(100%, 300px); border-collapse: separate; border-spacing: 0; border: 4px solid #8a5a2b; border-radius: 14px; background: #fff7e6; color: #3b2f1a; font-variant-numeric: tabular-nums; box-shadow: 0 3px 0 #6d4420; }
.price-board caption { padding: 4px 12px; font: 600 1.05rem var(--font-head); color: var(--ink); }
.price-board th, .price-board td { padding: 7px 14px; border-top: 1px dashed #d9bf8f; font-size: 1.02rem; }
.price-board tr:first-child th, .price-board tr:first-child td { border-top: 0; }
.price-board th { text-align: left; font: 700 1.02rem var(--font-body); text-transform: none; letter-spacing: 0; color: #3b2f1a; }
.price-board th small { display: block; font-weight: 600; color: #7a6544; font-size: .8rem; }
.price-board td { text-align: right; font-weight: 800; white-space: nowrap; }
.ex-vis .price-board { min-width: 0; font-size: .9rem; }
.ex-vis .price-board th, .ex-vis .price-board td { padding: 4px 9px; font-size: .9rem; }
/* En flok dyreunger (brøkdel af en flok) */
.herd { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 6px; max-width: 380px; margin: 0 auto; padding: 8px; border-radius: 16px; background: color-mix(in srgb, #9fd27f 30%, var(--card)); }
.herd img { width: 62px; height: 62px; object-fit: contain; }
.herd.many img { width: 52px; height: 52px; }
/* Kortet over zoo'en (koordinatsystemet): græs, sti, dam, tern og hvide nåle med dyrene */
.vis.vis-map { max-width: 440px; max-height: 380px; }
.walk .visual .vis.vis-map { max-width: 340px; }
.zm-grass { fill: color-mix(in srgb, #9fd27f 42%, var(--card)); }
.zm-path { fill: none; stroke: color-mix(in srgb, #f2d79e 75%, var(--card)); stroke-linecap: round; }
.zm-pond { fill: color-mix(in srgb, #8ccfe8 60%, var(--card)); }
.zm-grid { stroke: color-mix(in srgb, var(--ink) 20%, transparent); stroke-width: 1; }
.zm-pin { fill: #fff; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; }
.zm-pin.hi { stroke: var(--coral); stroke-width: 3.5; }
.v-ink { fill: var(--ink); }
.v-soft-a { fill: var(--primary-soft); fill-opacity: .6; }
@media (max-width: 560px) {
  .ex-tip .k { min-width: 0; width: 100%; }
}

/* ---------- Tilbage-knap på forklaringer og afslutning på en øvelse ---------- */
.back-link { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 4px; padding: 0; font: 700 1.02rem var(--font-body); color: var(--ink-2); }
.back-link .icon-btn { pointer-events: none; }
.back-link:hover { color: var(--ink); }
.pd-count { margin: 0; font-size: 1.2rem; font-weight: 700; color: var(--ink-2); }

/* ---------- Områdesiden: næste opgave for dig (én tydelig start) ---------- */
.rec-act { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 14px 24px; margin-top: 18px; padding: 20px 24px;
  background: linear-gradient(135deg, var(--primary-soft), var(--card) 70%); border: 2px solid color-mix(in srgb, var(--primary) 35%, transparent); }
.rec-body { display: grid; gap: 6px; min-width: 0; }
.rec-act h2 { margin: 0; font-size: clamp(1.4rem, 2.8vw, 1.8rem); }
.rec-act h2 .st { vertical-align: 4px; }
.rec-desc { margin: 0; font-size: 1.08rem; font-weight: 700; color: var(--ink-2); }
.rec-go { display: grid; justify-items: center; gap: 10px; }
.rec-go .btn.big { min-width: 220px; }
.act-go .link { font-size: .95rem; }
@media (max-width: 640px) {
  .rec-act { grid-template-columns: 1fr; padding: 18px; }
  .rec-go .btn.big { width: 100%; min-width: 0; }
}
/* Batch 3: et glimt af området mellem "Næste opgave for dig" og knapperne – kun når der er plads */
.rec-env { display: none; }
@media (min-width: 900px) {
  .rec-act { grid-template-columns: minmax(0, 1fr) auto auto; }
  .rec-env { display: block; width: 190px; }
}

/* "Mission klaret": en ny mission venter i morgen – og der kan øves frit på kortet */
.free-open { margin: 0; font-weight: 700; color: var(--primary-ink); }

/* ---------- Opgavens scene: områdets miljø over opgaven (aldrig tekst oven på billedet) ---------- */
/* Ét samlet billede, der altid fylder båndets bredde (object-fit: cover i et bredt bånd zoomer aldrig længere ind
   end det) og kun beskæres lodret efter områdets udsnit (--y). Båndet har fast form (3:1), så intet hopper, mens
   billedet hentes, og samme udsnit ses på telefon og computer. Det toner blødt ud i kortet nederst. */
.task > :first-child { container-type: inline-size; } /* båndets form følger kolonnens bredde */
.task-scene { position: relative; aspect-ratio: 3; min-height: 80px; max-width: 760px; margin: -4px auto 12px;
  border-radius: 18px; overflow: hidden; background: linear-gradient(180deg, #a6d6f0, #cdebf7); /* billedets himmel, mens det hentes */
  -webkit-mask-image: linear-gradient(180deg, #000 80%, transparent); mask-image: linear-gradient(180deg, #000 80%, transparent); }
.task-scene img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% var(--y); }
/* Kompakt bånd (18:5) med områdets eget udsnit (--yk): når opgaven har sin egen tegning (den skal have hovedrollen),
   i brede kolonner (iPad på højkant, valgopgaver på computeren) og når pladsen ikke rækker (sættes i renderTask).
   Et område uden kompakt udsnit (.fixed) beholder det normale bånd. */
.task.has-visual .task-scene:not(.fixed), .task-scene.compact { aspect-ratio: 18 / 5; }
.task.has-visual .task-scene:not(.fixed) img, .task-scene.compact img { object-position: 50% var(--yk); }
@container (min-width: 640px) {
  .task-scene:not(.fixed) { aspect-ratio: 18 / 5; }
  .task-scene:not(.fixed) img { object-position: 50% var(--yk); }
}
/* Én kolonne (telefon og iPad stående): ingen scene, når opgaven har sin egen tegning, så tastaturet ikke
   skubbes ned. Valgopgaver med tegning står altid i én kolonne. */
@media (max-width: 899px), (max-aspect-ratio: 1/1) { .task.has-visual .task-scene { display: none; } }
.task:not(.has-input).has-visual .task-scene { display: none; }
@media (max-width: 560px) { .task-scene { margin-bottom: 8px; border-radius: 14px; } }

/* ---------- Forældredelen: Øvebanen i tal ---------- */
.rp-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 2px 16px; }
/* ---------- Forældredelen: tre faner (Overblik, Fremskridt, Indstillinger) ---------- */
.parent-tabs { display: flex; width: fit-content; max-width: 100%; margin: 0 0 18px; }
.parent-tabs button { flex: 1 1 auto; }
.parent-body { display: grid; gap: 16px; }
.parent-body > .section-title { margin: 14px 2px 0; }
.parent-body > .rp-tiles { margin: 0; }
.pt-week { display: grid; gap: 10px; }
.pt-week h3 { margin: 0; }
.pt-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 420px; }
.pt-day { display: grid; justify-items: center; gap: 4px; font: 600 .85rem var(--font-head); color: var(--ink-2); }
.pt-day i { width: 30px; height: 30px; border-radius: 50%; border: 2px dashed var(--line); }
.pt-day.on i { border: 0; background: var(--primary); box-shadow: inset 0 0 0 4px color-mix(in srgb, #fff 35%, var(--primary)); }
.pt-day.today { color: var(--ink); }
.pt-day.today i { outline: 2px solid var(--sun); outline-offset: 2px; }
details.card > summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; cursor: pointer; list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: '›'; font: 600 1.4rem/1 var(--font-head); color: var(--ink-3); transition: transform .2s; }
details.card[open] > summary::after { transform: rotate(90deg); }
details.card[open] > summary { margin-bottom: 12px; }
.pt-recent summary h3 { margin: 0; flex: 1; }
.area-det summary .ad-name { flex: 1 1 260px; min-width: 0; }
.area-det summary .ad-prog { display: flex; align-items: center; gap: 10px; flex: 0 1 260px; }
.area-det summary .bar-mini { flex: 1; min-width: 80px; }
.pt-name { flex-wrap: nowrap; }
.pt-name .field { flex: 1; min-width: 0; max-width: 320px; min-height: 48px; }
.pt-danger { border-color: color-mix(in srgb, var(--coral) 45%, var(--line)); }
.pt-danger h3 { color: color-mix(in srgb, var(--coral) 75%, var(--ink)); }
.rp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; margin-bottom: 16px; }
.rp-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; gap: 2px; }
.rp-tl { font: 700 .85rem var(--font-body); color: var(--ink-2); }
.rp-tv { font: 600 2rem/1.15 var(--font-head); color: var(--ink); }
.rp-tn { font-size: .8rem; color: var(--ink-3); }
.rp-flags { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rp-flag { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.rp-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 1.1rem; background: color-mix(in srgb, var(--ac, var(--primary)) 14%, var(--ic-base)); flex: none; }
.rp-fname { font-weight: 800; }
.rp-sub { margin: 6px 0 0; font: 700 .95rem var(--font-head); color: var(--ink-2); }
.rp-v { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font: 700 .78rem var(--font-body); color: var(--ink); padding: 3px 10px 3px 4px; border-radius: 99px; background: var(--card-2); border: 1px solid var(--line); }
.rp-v b { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; color: #fff; background: var(--ink-3); }
.rp-v.godt b { background: var(--rp-good); }
.rp-v.naesten b { background: var(--rp-warn); color: #3a2a00; }
.rp-v.oev b { background: var(--rp-bad); }
.rp-v.langsom b { background: var(--card-2); color: var(--ink); font-size: .8rem; }
.rp-v.faa { color: var(--ink-3); }
.rp-discs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 14px; align-items: start; }
.rp-disc { display: grid; gap: 10px; border-left: 5px solid var(--ac); }
.rp-disc.idle { opacity: .75; padding-block: 12px; }
.rp-head { display: flex; align-items: center; gap: 10px; }
.rp-title { flex: 1; min-width: 0; }
.rp-title h3 { margin: 0; }
.rp-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.rp-meter { flex: 1 1 140px; height: 10px; border-radius: 99px; background: var(--line-2); overflow: hidden; }
.rp-meter i { display: block; height: 100%; border-radius: 0 4px 4px 0; background: var(--ink-3); }
.rp-meter.godt i { background: var(--rp-good); }
.rp-meter.naesten i { background: var(--rp-warn); }
.rp-meter.oev i { background: var(--rp-bad); }
.rp-disc details summary { cursor: pointer; font: 700 .9rem var(--font-body); color: var(--primary-ink); padding: 4px 0; }
.rp-rows { display: grid; gap: 2px; margin-top: 6px; }
.rp-row { display: grid; gap: 4px; padding: 9px 0; border-top: 1px solid var(--line-2); }
.rp-r1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rp-r2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: .92rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rp-r2 b { color: var(--ink); }
.rp-name { font-weight: 700; min-width: 0; }
.rp-dots { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.rp-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--rp-good); }
.rp-dots i.no { background: transparent; box-shadow: inset 0 0 0 2px var(--rp-bad); }
.rp-none { margin: 0; }
.rp-how { line-height: 1.55; }

/* ---------- Reglerne ("? Regler" øverst på forsiden) og reglerne undervejs ---------- */
.icon-btn.pill .q { font: 700 1.15rem var(--font-head); }
.rules-head h1 { margin: 6px 0 2px; }
.rules-head p { margin: 0 0 14px; }
.rules { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; align-items: start; }
.rule { display: grid; gap: 8px; }
.rule h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.25rem; }
.rule-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.35rem; background: color-mix(in srgb, var(--primary) 14%, var(--ic-base)); flex: none; }
.rule-ic .ui-ic { width: 32px; height: 32px; object-fit: contain; }
.rule p, .rule ul, .rule ol { margin: 0; }
.rule ul, .rule ol { padding-left: 1.2em; display: grid; gap: 4px; }
.rule .rule-levels { list-style: none; padding-left: 0; }
.rule-levels li { display: flex; gap: 10px; align-items: flex-start; }
.rule-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rule-status { margin-top: 2px; padding: 9px 12px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--line-2); font-weight: 700; font-size: .92rem; display: grid; gap: 8px; }
.rules-go { justify-content: center; margin-top: 18px; gap: 10px; flex-wrap: wrap; }
.mission-goal { margin: 10px 0 0; font-weight: 700; color: var(--primary-ink); }
.block-rule { margin: 0; text-align: left; padding: 10px 14px; border-radius: 14px; background: var(--sun-soft); font-size: .98rem; display: flex; gap: 10px; align-items: center; }
.lv-dots { display: inline-flex; gap: 3px; flex: none; }
.lv-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.lv-dots i.on { background: var(--primary); }
.lvl-note { margin-top: 8px; font-weight: 800; }

/* ---------- Øvebanen som en sti (forslag 3): scenen bag, opgaven på en seddel, de 10 opgaver som trædesten ---------- */
/* Baggrund og sten er direkte børn af #app uden indgangsanimation – en transform ville flytte position: fixed */
#app > .trail-bg, #app > .trail-stones { animation: none; }
.trail-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #cfe9f5; }
.trail-bg picture, .trail-bg img { display: block; width: 100%; height: 100%; }
.trail-bg img { object-fit: cover; object-position: 25% 50%; }
.trail-top, .trail-note { position: relative; z-index: 2; }
/* Sedlen står nederst til højre (Troels: "rykke ned så det står i nederste højre hjørne") – er den højere end skærmen, ruller siden som før */
#app:has(> .trail-note) { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
#app > .trail-note { margin-top: auto; }
.trail-top { display: flex; align-items: center; gap: 10px 16px; margin-bottom: 18px; }
.trail-sign { display: inline-flex; align-items: center; gap: 12px; min-width: 0; background: #8a5a32; color: #fff7e8; font: 600 1.05rem/1.25 var(--font-head);
  padding: 6px 18px 6px 6px; border-radius: 14px; box-shadow: 0 4px 0 #6a4224, 0 10px 22px rgba(0, 0, 0, .2); }
.trail-sign .icon-btn { flex: none; background: #fff7e8; color: #6a4224; box-shadow: none; }
.trail-sign b { font-weight: 600; }
.trail-note { width: clamp(520px, 56vw, 680px); margin-left: auto; border: 0; border-radius: 10px; padding-top: 30px; container-type: inline-size;
  box-shadow: 0 2px 0 color-mix(in srgb, var(--line) 70%, transparent), 0 24px 50px rgba(31, 51, 70, .28); }
/* Sedlen er af frostet glas, så scenen anes bagved – kun hvor browseren kan sløre baggrunden, ellers forbliver den hvid og let at læse */
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .trail-note { background: color-mix(in srgb, var(--card) var(--note-glass), transparent);
    -webkit-backdrop-filter: blur(var(--note-blur)) saturate(1.15); backdrop-filter: blur(var(--note-blur)) saturate(1.15); }
  .trail-note .prompt, .trail-note .link { text-shadow: var(--note-halo); }
  .trail-note .visual { background: var(--note-plate); border-radius: 16px; padding: 10px; }
}
/* Er sedlen bred nok, står en tegning ved siden af svaret – så tastatur og "Tjek" kan ses uden at scrolle */
@container (min-width: 470px) {
  .trail-note .task.has-visual, .trail-note .task.has-input { grid-template-columns: minmax(0, 1fr) minmax(270px, .85fr); align-items: start; }
}
.trail-note .parts { gap: 6px; }
.trail-note .slot.sm { min-width: 66px; }
.trail-note::before, .trail-note::after { content: ''; position: absolute; top: -12px; width: 92px; height: 28px; background: rgba(255, 214, 120, .88);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.trail-note::before { left: 32px; transform: rotate(-6deg); }
.trail-note::after { right: 32px; transform: rotate(5deg); }
.trail-stones { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: flex; align-items: flex-end; gap: 8px; }
.trail-stones li { width: 46px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #d8d1c3; color: #5d5546;
  font: 600 .9rem var(--font-head); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .13), 0 3px 6px rgba(0, 0, 0, .2); }
.trail-stones li.ok { background: #7fcfa6; color: #1d5d43; }
.trail-stones li.miss { background: #f3b38b; color: #7a3b14; }
.trail-stones li.now { width: 60px; height: 38px; background: #ffd66b; color: #6b4e00; transform: translateY(-4px); }
/* Stor skærm på langs: sedlen til højre, en tegning ved siden af svaret, og stenene som en sti nederst i scenen */
@media (min-width: 900px) and (min-aspect-ratio: 1/1) {
  .trail-stones { position: fixed; left: max(24px, calc(50vw - 520px)); bottom: 22px; }
  #app:has(> .trail-note) { padding-bottom: calc(84px + env(safe-area-inset-bottom)); } /* sedlen står lige over stien af sten */
}
/* Smal eller på højkant: den stående scene, små sten under skiltet og sedlen under figurerne */
@media (max-width: 899px), (max-aspect-ratio: 1/1) {
  .trail-bg img { object-position: 50% 0; }
  .trail-note { width: min(100%, 600px); margin-left: auto; }
  .trail-stones { gap: 5px; margin: -6px 0 24vh 4px; } /* mindst så meget luft, at figurerne kan ses */
  .trail-stones li { width: 18px; height: 12px; font-size: 0; }
  .trail-stones li.now { width: 24px; height: 16px; transform: none; }
}
@media (max-width: 560px) { .trail-sign { font-size: .92rem; } .trail-stones { margin-bottom: 20vh; } }

/* ---------- Ranger-skjorten: et mærke for hver disciplin på Øvebanen ---------- */
/* Skærmen tegnes igen uden indgangsanimation, når et mærke flyttes (view(…, { calm: true })) */
#app.calm > * { animation: none; }
/* Et syet mærke i disciplinens egen form (rund, oval, skjold, sekskant, firkant eller takket – Z.PATCH_SHAPES):
   en kant i bronze-, sølv- eller guldtråd, stofbund, stikkesting og disciplinens tegning (SVG i patchArt).
   Mærket er en ting af stof – det ser ens ud i lyst og mørkt tema */
.patch { --s: 76px; position: relative; display: inline-grid; place-items: center; flex: none; width: var(--s); height: var(--s); border-radius: 50%;
  filter: drop-shadow(0 calc(var(--s) * .045) calc(var(--s) * .05) rgba(30, 40, 30, .32)); }
.patch .pt { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pt-thread { fill: var(--thread); stroke: var(--thread-dk); stroke-width: 3; stroke-linejoin: round; }
.pt-fabric { fill: color-mix(in srgb, var(--ac, #8fbf7a) 24%, #fff8ea); }
.pt-core { fill: #fffdf6; }
.pt-stitch { fill: none; stroke: var(--thread-hi); stroke-width: 2.4; stroke-dasharray: 4.5 3.6; stroke-linecap: round; }
.patch img { position: relative; width: var(--iw, 82%); height: var(--iw, 82%); transform: translateY(var(--iy, 0%)); object-fit: contain; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.patch-star { position: absolute; right: -6%; top: -6%; width: 32%; height: 32%; fill: #ffd34d; stroke: #a07406; stroke-width: 1.4; }
.t-bronze { --thread: #bd7a3f; --thread-dk: #8a5226; --thread-hi: #f1c193; }
.t-silver { --thread: #a7b2bb; --thread-dk: #6f7b85; --thread-hi: #f7fafc; }
.t-gold { --thread: #e0a915; --thread-dk: #a07406; --thread-hi: #fff2b0; }
.patch.ghost { filter: none; }
.patch.ghost .pt-thread { fill: none; stroke: var(--ink-3); stroke-width: 2.5; stroke-dasharray: 7 5; }
.patch.ghost .pt-fabric, .patch.ghost .pt-core, .patch.ghost .pt-stitch { display: none; }
.patch.ghost img { filter: grayscale(1); opacity: .35; }
.patch.sm { --s: 52px; }
.patch.lg { --s: 112px; }
.patch.xl { --s: 150px; margin: 8px auto 6px; }
.patch.fresh { animation: patch-glint 1.4s ease-out 2; }
@keyframes patch-glint { 40% { filter: brightness(1.2) drop-shadow(0 0 12px #ffe39a); } }

/* Skjorten: billedet og mærkerne ovenpå i % af billedet; et mærke er 11 % af skjortens bredde (Z.PATCH_SIZE), så alle 18 kan sidde på én side */
.shirt-stage { position: relative; width: 100%; aspect-ratio: 1000 / 915; container-type: inline-size; }
.shirt-img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.shirt-stage .on-shirt { --s: 11cqw; position: absolute; transform: translate(-50%, -50%) rotate(var(--r, 0deg)); touch-action: none; cursor: grab; }
.shirt-stage.mini .on-shirt { cursor: default; }
.shirt-stage .on-shirt.selected, .basket-item.selected .patch { outline: 3px solid var(--primary); outline-offset: 6px; }
.shirt-stage.drop-ready::after { content: ''; position: absolute; inset: 1%; border-radius: 30px; border: 3px dashed color-mix(in srgb, var(--primary) 50%, transparent); pointer-events: none; }
.shirt-stage.drop-ok::after { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, transparent); }
.on-shirt.lifting, .basket-item.lifting { opacity: .3; }
.patch-ghost { position: fixed; z-index: 60; left: -200px; top: -200px; transform: translate(-50%, -50%) rotate(-6deg) scale(1.06); pointer-events: none;
  filter: drop-shadow(0 14px 12px rgba(30, 40, 30, .35)); }

/* Skærmen "Min ranger-skjorte": skjorten til venstre (står fast, mens man ruller), sykurven og alle mærker til højre */
.shirt-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; margin: 6px 2px 14px; }
.shirt-head h1 { margin: 0; }
.shirt-count { font: 600 1.1rem var(--font-head); color: var(--ink-2); }
.shirt-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.shirt-col { display: grid; gap: 10px; justify-items: center; min-width: 0; }
.shirt-card { width: 100%; max-width: 640px; padding: 16px; border-radius: var(--r-lg); box-shadow: var(--shadow);
  background: radial-gradient(ellipse 72% 62% at 50% 46%, color-mix(in srgb, #f3d58f 34%, var(--card)), color-mix(in srgb, #7fb46e 26%, var(--card))); }
.shirt-hint { margin: 0; min-height: 1.45em; max-width: 52ch; text-align: center; color: var(--ink-2); font-weight: 700; }
.shirt-aside { display: grid; gap: 14px; align-content: start; min-width: 0; }
.shirt-aside h2 { margin: 0 0 10px; font-size: 1.2rem; }
@media (min-width: 1000px) {
  .shirt-layout { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .shirt-col { position: sticky; top: 12px; }
}
.basket-items { display: flex; flex-wrap: wrap; gap: 16px 20px; }
.basket-item { position: relative; display: grid; justify-items: center; gap: 8px; padding: 10px 8px 4px; border-radius: 16px; touch-action: none; cursor: grab; }
.bi-nm { font: 800 .8rem/1.2 var(--font-body); color: var(--ink-2); max-width: 96px; text-align: center; }
.new-tag { position: absolute; top: -2px; right: -8px; padding: 2px 8px; border-radius: 99px; background: var(--coral); color: #fff; font: 800 .7rem var(--font-body); transform: rotate(8deg); }
.basket-empty { margin: 0; }
.ap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 14px 6px; }
.ap-item { display: grid; justify-items: center; align-content: start; gap: 5px; padding: 8px 2px; border-radius: 14px; text-align: center; }
.ap-item:hover { background: var(--card-2); }
.ap-nm { font: 800 .74rem/1.2 var(--font-body); color: var(--ink); }
.ap-st { padding: 1px 8px; border-radius: 99px; background: var(--line-2); color: var(--ink-2); font: 800 .68rem var(--font-body); }
.ap-st.t-bronze { background: #f6dcc6; color: #7a3f12; }
.ap-st.t-silver { background: #e9eef2; color: #46535e; }
.ap-st.t-gold { background: #fff0b8; color: #7a5600; }
.tier-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 14px; }
.tier-list li { display: flex; gap: 16px; align-items: center; }
.tier-list b { display: block; font: 600 1rem var(--font-head); }
.tier-list span { color: var(--ink-2); font-size: .9rem; font-weight: 700; line-height: 1.35; }
.patch-sheet { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.patch-sheet .patch { margin: 10px; }
.ps-txt { flex: 1; min-width: 220px; }
.ps-txt h2 { margin: 2px 0 8px; }
.ps-txt p { margin: 0 0 10px; line-height: 1.45; }

/* Skjorten i lille format (forældredelen), og mærket øverst på et mærkes øvelser */
.st-mini { flex: none; width: 150px; padding: 6px; border-radius: 16px;
  background: radial-gradient(ellipse 72% 62% at 50% 46%, color-mix(in srgb, #f3d58f 34%, var(--card)), color-mix(in srgb, #7fb46e 26%, var(--card))); }
@media (max-width: 480px) { .st-mini { width: 104px; } }
.patch-card { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; margin-top: 14px; padding: 14px 18px; }
.pc-patch { flex: none; border-radius: 50%; padding: 8px; }
.pc-txt { flex: 1; min-width: 220px; display: grid; gap: 4px; }
.pc-txt b { font: 600 1.08rem var(--font-head); }
.pc-txt > span { color: var(--ink-2); font-weight: 700; line-height: 1.4; }
/* Bronze, sølv og guld som tre trin (tierLadder): ✓ klaret · næste med hvor langt hun er · resten venter */
.tier-ladder { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 7px; }
.tier-ladder li { display: flex; align-items: flex-start; gap: 10px; }
.tl-dot { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--thread); box-shadow: inset 0 0 0 2px var(--thread-dk); color: #fff; font: 800 .82rem var(--font-body); }
.tl-next .tl-dot, .tl-later .tl-dot { background: transparent; box-shadow: inset 0 0 0 2.5px var(--thread); }
.tl-txt { font-size: .93rem; line-height: 1.35; font-weight: 700; color: var(--ink-2); }
.tl-txt b { color: var(--ink); margin-right: 3px; }
.tl-now { display: block; margin-top: 2px; color: var(--primary-ink); font-weight: 800; }
.tl-later { opacity: .55; }
.tl-done .tl-txt { color: var(--ink-3); }
.patch-sheet .tier-ladder { margin: 4px 0 12px; }
.pc-txt .bar-mini { max-width: 220px; margin-top: 4px; }
#skjorte { position: relative; }
#skjorte .ui-ic { width: 26px; height: 26px; object-fit: contain; }
.pill-dot { position: absolute; top: 3px; right: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px var(--card); }
.mixed-done .md-can { background: var(--primary-soft); border-radius: 16px; padding: 12px 16px; text-align: left; line-height: 1.45; }
.mixed-done .md-can b { display: block; font: 600 1.05rem var(--font-head); color: var(--primary-ink); }
.shirt-parent { display: flex; gap: 16px; align-items: center; margin-top: 12px; }
.shirt-parent .st-mini { width: 110px; }

/* ---------- Tegnede ikoner i stedet for emoji (Batch 7): steder, niveauer, reglerne og profilernes dyr ---------- */
.place-ic { display: inline-block; width: 1.7em; height: 1.4em; object-fit: contain; vertical-align: -.35em; margin-right: .12em; -webkit-user-drag: none; user-select: none; }
.kicker .place-ic { width: 28px; height: 24px; margin: -6px 0; }
.mt-title .place-ic { width: 28px; height: 24px; vertical-align: -7px; margin-right: 4px; }
.trail-sign .place-ic { width: 36px; height: 30px; vertical-align: -9px; margin-right: 2px; }
.rp-ic .place-ic { width: 32px; height: 28px; margin: 0; vertical-align: 0; }
.tour-icons span .place-ic { width: 50px; height: 46px; margin: 0; vertical-align: 0; }
.lv-ic { display: block; width: 26px; height: 26px; object-fit: contain; flex: none; -webkit-user-drag: none; user-select: none; }
.pp-path .lv-ic { width: 32px; height: 32px; margin: -7px -4px; }
.rule-levels .lv-ic { width: 38px; height: 38px; margin-top: -8px; }
.ui-ic.face { border-radius: 50%; object-fit: cover; }
.basket h2.with-ic { display: flex; align-items: center; gap: 8px; }
.basket h2 .ui-ic { width: 42px; height: 42px; margin: -8px 0; }

/* ---------- Åbningsfesten: målet, når alle områder har fået en stjerne ---------- */
.party-card { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; padding: 18px 22px; margin-bottom: 18px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--sun) 28%, var(--card)), color-mix(in srgb, var(--coral) 18%, var(--card)));
  border: 2px solid color-mix(in srgb, var(--sun) 60%, transparent); }
.pty-art { width: 84px; height: 84px; flex: none; object-fit: contain; animation: pty-bob 2.4s ease-in-out infinite; }
.pty-body { flex: 1; min-width: 220px; }
.pty-body h2 { margin: 2px 0 4px; }
.pty-body p { margin: 0; color: var(--ink-2); font-weight: 700; line-height: 1.45; }
@keyframes pty-bob { 50% { transform: translateY(-5px) rotate(-3deg); } }

/* Porten med snoren: tegningen (Batch 8) i sit eget format, og snoren tegnet ovenpå mellem stolperne (Z.PARTY_ART.ribbon) */
.party-scene { position: relative; width: 100%; max-width: 980px; margin: 4px auto 0; border-radius: var(--r-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); background: #cfe9f5; container-type: inline-size; }
.party-scene > img { display: block; width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; user-select: none; }
.ribbon { position: absolute; height: 3.4cqw; min-height: 14px; padding: 0; background: none; transform: translateY(-50%); cursor: pointer; }
.rb-half { position: absolute; top: 0; bottom: 0; width: 50%; background: linear-gradient(#ff6b6b, #d32f2f 55%, #a81f1f);
  box-shadow: 0 .4cqw .9cqw rgba(0, 0, 0, .28); transition: transform .9s cubic-bezier(.3, .7, .4, 1), opacity .9s ease-in; }
.rb-l { left: 0; transform-origin: 0 50%; border-radius: .6cqw 0 0 .6cqw; }
.rb-r { right: 0; transform-origin: 100% 50%; border-radius: 0 .6cqw .6cqw 0; }
.rb-bow { position: absolute; left: 50%; top: 50%; width: 9.5cqw; height: 8cqw; transform: translate(-50%, -42%);
  filter: drop-shadow(0 .4cqw .5cqw rgba(0, 0, 0, .3)); transition: transform 1s ease-in, opacity 1s ease-in; }
.rb-snip { position: absolute; left: 50%; bottom: 120%; font-size: 4.2cqw; line-height: 1; transform: translateX(-50%); pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .35)); animation: rb-snip 1.6s ease-in-out infinite; }
@keyframes rb-snip { 50% { transform: translateX(-50%) translateY(-.8cqw) rotate(-14deg); } }
.ribbon:hover .rb-half { filter: brightness(1.08); }
.ribbon:focus-visible { outline: 3px solid #fff; outline-offset: 4px; border-radius: 6px; }
.party-stage.cut .ribbon { pointer-events: none; }
.party-stage.cut .rb-l { transform: rotate(80deg) scaleX(.85); opacity: 0; }
.party-stage.cut .rb-r { transform: rotate(-80deg) scaleX(.85); opacity: 0; }
.party-stage.cut .rb-bow { transform: translate(-50%, 180%) rotate(35deg); opacity: 0; }
.party-stage.cut .rb-snip { display: none; }
.party-text { max-width: 760px; margin: 18px auto 0; text-align: center; display: grid; gap: 12px; justify-items: center; }
.party-text h1 { margin: 0; }
.party-say { width: 100%; text-align: left; }
.party-after { max-width: 980px; margin: 22px auto 0; display: grid; gap: 14px; }
.party-after[hidden] { display: none; }
.party-sum h2 { margin: 0 0 14px; }
.party-places { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 14px 8px; }
.party-places li { display: grid; justify-items: center; align-content: start; gap: 4px; text-align: center; font: 700 .8rem/1.2 var(--font-body); color: var(--ink-2); }
.pp-art { position: relative; display: block; }
.pp-art .place-ic { width: 76px; height: 64px; margin: 0; vertical-align: 0; }
.pp-art b { position: absolute; right: -8px; top: -6px; font-size: 1.25rem; }
.party-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 10px; }
.pp-nm { max-width: 100%; overflow-wrap: break-word; hyphens: manual; }
.party-stats div { background: var(--card-2); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: grid; gap: 2px; }
.party-stats b { font: 600 1.6rem/1.2 var(--font-head); font-variant-numeric: tabular-nums; color: var(--ink); }
.party-stats span { color: var(--ink-2); font-weight: 700; font-size: .9rem; }
.party-go { justify-content: center; }
.rule-status .link { justify-self: start; padding: 0; min-height: 0; }
/* Efter festen er zoo'en pyntet: en flagranke langs kortets top */
.map-wrap.festive::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 34px; pointer-events: none; z-index: 6;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='40' viewBox='0 0 200 40'%3E%3Cpath d='M0 3 Q100 25 200 3' fill='none' stroke='%237a5a3a' stroke-width='2'/%3E%3Cpath d='M10 6 L30 9 L19 31Z' fill='%23ff8a65'/%3E%3Cpath d='M50 10 L70 13 L59 35Z' fill='%23ffc94d'/%3E%3Cpath d='M90 13 L110 13 L100 36Z' fill='%232e9e78'/%3E%3Cpath d='M130 13 L150 10 L141 35Z' fill='%238fd3f4'/%3E%3Cpath d='M170 9 L190 6 L181 31Z' fill='%23b7a6e8'/%3E%3C/svg%3E") repeat-x 0 0 / 160px 32px; }
@media (prefers-reduced-motion: reduce) { .pty-art, .rb-snip { animation: none; } .rb-half, .rb-bow { transition: none; } }

.copyright { margin: 10px 0 0; text-align: center; opacity: .75; }

/* ---------- Valgkortene: "Vælg selv" før missionen og "Vil du mere?" bagefter – højst tre, ét tryk starter dem ---------- */
.offers { display: grid; gap: 10px; }
.offer { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center; width: 100%; padding: 10px 14px 10px 10px;
  text-align: left; border-radius: var(--r); background: var(--card); border: 2px solid var(--line-2); box-shadow: var(--shadow-sm);
  transition: transform .15s, border-color .15s, box-shadow .15s; }
.offer:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 45%, var(--line-2)); box-shadow: var(--shadow); }
.offer:active { transform: scale(.98); }
.of-art { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: var(--card-2); }
.of-art .place-ic, .of-art .ui-ic { width: 46px; height: 46px; margin: 0; vertical-align: 0; object-fit: contain; }
.of-art .patch { --s: 54px; }
.of-txt { display: grid; gap: 2px; min-width: 0; }
.of-tag { justify-self: start; padding: 2px 8px; border-radius: 99px; font: 600 .7rem var(--font-head); text-transform: uppercase; letter-spacing: .8px;
  background: var(--primary-soft); color: var(--primary-ink); }
.of-hw .of-tag { background: var(--sun-soft); color: var(--ink); }
.of-patch .of-tag { background: var(--lav-soft); color: var(--ink); }
.of-fast .of-tag { background: var(--coral-soft); color: var(--ink); }
.of-area .of-tag { background: var(--sky-soft); color: var(--ink); }
.of-title { font: 600 1.06rem/1.25 var(--font-head); color: var(--ink); }
.of-sub { font-size: .88rem; font-weight: 700; color: var(--ink-2); }
.of-go { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font: 600 1.05rem var(--font-head); }
.more { display: grid; gap: 10px; }
.more h2 { margin: 2px 0 0; font-size: 1.25rem; }
.choose-toggle { justify-self: start; }
.choose-box { display: grid; gap: 10px; }
.choose-box p { margin: 0; }
.rec-note { margin: 8px 0 0; font-size: .92rem; font-weight: 700; color: var(--primary-ink); }
.practice-done .pd-more { width: 100%; text-align: left; }
/* Forældredelen: ugens lektie */
.hw-pick { width: auto; min-width: min(100%, 300px); max-width: 100%; min-height: 48px; font-size: 1rem; }
/* Missionens første trin: Babyhuset og hvorfor gangestykkerne er unger i zoo'en */
.baby-intro .tour-babies .baby { width: 64px; height: 64px; }
.why { text-align: left; padding: 12px 16px; border-radius: var(--r-sm); background: var(--sun-soft); border: 1px solid var(--line-2); }
.why summary { cursor: pointer; font: 600 1.02rem var(--font-head); color: var(--ink); }
.why p { margin: 8px 0 0; line-height: 1.5; color: var(--ink-2); font-weight: 700; }
/* Idéer og feedback til Troels */
.fb-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 18px; padding: 14px 18px; }
.fb-card > span { flex: 1 1 260px; color: var(--ink-2); font-weight: 700; }
.fb { display: grid; gap: 10px; }
.fb-kind { flex-wrap: wrap; }
.fb-text { min-height: 120px; padding: 12px 16px; resize: vertical; font: 600 1.05rem/1.45 var(--font-body); }
.fb-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fb-msg { margin: 0; min-height: 1.3em; color: var(--warm); font-weight: 700; }
