/* V-skole — håndskrevet CSS, ingen build-proces.

   Farver og skrifter er en midlertidig, neutral palette, indtil V-skole får
   sit eget brand: skift tokens herunder (--brand-ink, --accent, --skrift,
   --skrift-overskrift), ikke reglerne længere nede. --green og --mint betyder
   «rigtigt» og «valgt» og er ikke brandfarver.

   Skrifter må aldrig hentes fra et CDN (GDPR: ingen besøgendes IP-adresser
   til Google). Får brandet egne skrifter, ligger de i /public/fonts. */

:root {
    --brand-ink: #1e1b4b;
    --green: #56a308;
    --mint: #edffe1;

    --skrift: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --skrift-overskrift: var(--skrift);

    --bg: #f7f9fa;
    --surface: #ffffff;
    --surface-2: #f0f3f7;
    --ink: var(--brand-ink);
    --ink-2: #2d3748;
    --muted: #5a6a82;
    --line: #e2e7ee;
    --accent: #4338ca;
    --on-accent: #ffffff;

    --ok-bg: #edffe1;
    --ok-ink: #33630a;
    --err-bg: #fdeaed;
    --err-ink: #a3243c;
    --warn-bg: #fdf3e0;
    --warn-ink: #8a5c12;

    /* Fingerfarver til Tastatur Helten — én pr. finger, samme paa begge haender. */
    --finger-lille: #d9e6ff;
    --finger-ring: #d7f0e2;
    --finger-lang: #fdeccd;
    --finger-peg: #f8d9e4;

    --shadow: 0 1px 2px rgba(30, 27, 75, 0.06);
    color-scheme: light;
}

/* Mørk palette. Tre tilstande: brugerens valg gemmes i localStorage og
   sættes som data-theme på <html>; uden valg følger siden systemet.
   OBS: de to mørke blokke herunder skal holdes ens — samme tokens begge
   steder (CSS kan ikke dele en blok på tværs af en media query). */

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #12111f;
        --surface: #1b1a2e;
        --surface-2: #25233d;
        --ink: #ecebf7;
        --ink-2: #d4d3e8;
        --muted: #a3a1c2;
        --line: #2f2c4a;
        --accent: #a5b4fc;
        --on-accent: #12111f;
        --mint: #14301a;

        --ok-bg: #14301a;
        --ok-ink: #a5dd78;
        --err-bg: #3a1620;
        --err-ink: #f0a2b2;
        --warn-bg: #382a15;
        --warn-ink: #e8c07f;

        --finger-lille: #233d6b;
        --finger-ring: #1d4a37;
        --finger-lang: #4d3d1b;
        --finger-peg: #4d2334;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --bg: #12111f;
    --surface: #1b1a2e;
    --surface-2: #25233d;
    --ink: #ecebf7;
    --ink-2: #d4d3e8;
    --muted: #a3a1c2;
    --line: #2f2c4a;
    --accent: #a5b4fc;
    --on-accent: #12111f;
    --mint: #14301a;

    --ok-bg: #14301a;
    --ok-ink: #a5dd78;
    --err-bg: #3a1620;
    --err-ink: #f0a2b2;
    --warn-bg: #382a15;
    --warn-ink: #e8c07f;

    --finger-lille: #233d6b;
    --finger-ring: #1d4a37;
    --finger-lang: #4d3d1b;
    --finger-peg: #4d2334;

    color-scheme: dark;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--skrift);
    font-size: 16px;
    line-height: 1.55;
}

h1, h2, h3 { font-family: var(--skrift-overskrift); color: var(--ink); }
h1 { font-size: 1.7rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.3rem; }

a { color: var(--accent); }
.daempet { color: var(--muted); }
.lille { font-size: 0.85rem; }

/* ── Header ─────────────────────────────────────────────── */

.top {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.top-inderside {
    max-width: 960px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.logo { font-family: var(--skrift-overskrift); font-weight: 800; font-size: 1.35rem; letter-spacing: -0.02em; color: var(--ink); }
.logo span { color: var(--accent); }
.logo-link { display: flex; align-items: center; text-decoration: none; }


.top-bruger { display: flex; align-items: center; gap: 10px; }
.brugernavn { color: var(--muted); font-size: 0.9rem; }

/* Temavælger — Lys/Mørk/Auto. Skubber sig selv (og alt efter sig) til højre. */
.temavalg {
    margin-left: auto;
    display: flex;
    gap: 2px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 2px;
}

.temavalg button {
    border: none;
    background: none;
    color: var(--muted);
    font-family: var(--skrift-overskrift);
    font-size: 0.78rem;
    padding: 4px 9px;
    border-radius: 7px;
    cursor: pointer;
}

.temavalg button.aktiv {
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow);
}

.knap-diskret {
    background: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 5px 11px;
    color: var(--ink-2);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}
.knap-diskret:hover { background: var(--surface-2); }

/* ── Indhold og fod ─────────────────────────────────────── */

.indhold {
    flex: 1;
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

.bund {
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.8rem;
    text-align: center;
    padding: 14px;
}

/* ── Beskeder ───────────────────────────────────────────── */

.besked { border-radius: 10px; padding: 10px 14px; margin: 0 0 16px; }
.besked p { margin: 0; }
.besked-ok { background: var(--ok-bg); color: var(--ok-ink); }
.besked-fejl { background: var(--err-bg); color: var(--err-ink); }
.besked-advarsel { background: var(--warn-bg); color: var(--warn-ink); }

/* ── Knapper ────────────────────────────────────────────── */

.knap {
    display: inline-block;
    background: var(--accent);
    color: var(--on-accent);
    border: none;
    border-radius: 10px;
    padding: 11px 22px;
    font-family: var(--skrift-overskrift);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
}
.knap:hover { filter: brightness(1.07); }

.knap-sekundaer {
    background: var(--surface-2);
    color: var(--ink);
    border: 1px solid var(--line);
}

.knap-bred { display: block; width: 100%; margin-top: 18px; }

/* ── Login ──────────────────────────────────────────────── */

.login-kort {
    max-width: 420px;
    margin: 8vh auto 0;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.login-kort form { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.login-kort label { font-family: var(--skrift-overskrift); font-weight: 600; font-size: 0.9rem; }

.login-kort input {
    background: var(--surface-2);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 13px;
    font: inherit;
}
.login-kort input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.kodefelt {
    font-size: 1.6rem !important;
    letter-spacing: 10px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ── Kort på forside og emneoversigt ───────────────────── */

.kort-raekke {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.kort {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kort p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.kort-ikon { font-size: 1.6rem; }
.kort-link { text-decoration: none; }
.kort-link:hover { border-color: var(--accent); }
.kort-passiv { opacity: 0.75; }

.emne-kort form { margin-top: auto; padding-top: 10px; }
.emne-kort .knap-sekundaer { width: 100%; }

.score-linje { color: var(--ink-2) !important; font-size: 0.9rem !important; margin-top: 6px !important; }

.blandet-kort {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--mint);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px;
    margin-top: 18px;
}
.blandet-kort h2 { margin: 0; }
.blandet-kort p { margin: 2px 0 0; color: var(--muted); font-size: 0.92rem; }
.blandet-tekst { flex: 1; }
.blandet-kort .score-linje { color: var(--ok-ink) !important; }

/* ── Quiz ───────────────────────────────────────────────── */

.quiz-ramme { max-width: 640px; margin: 0 auto; }

.quiz-top { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 6px; }

.fremdrift {
    height: 8px;
    background: var(--surface-2);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 22px;
}
.fremdrift-fyld { height: 100%; background: var(--green); border-radius: 99px; }

.quiz-sporgsmaal { font-size: 1.35rem; line-height: 1.4; margin-bottom: 20px; }

.figur {
    display: flex;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 10px 6px;
    margin-bottom: 16px;
}
.figur svg { max-width: 100%; height: auto; }

.quiz-muligheder {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2×2-grid; én kolonne på smal mobil */
    gap: 10px;
}

.mulighed {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    text-align: left;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px 16px;
    font: inherit;
    cursor: pointer;
    box-shadow: var(--shadow);
}

button.mulighed:hover { border-color: var(--accent); background: var(--surface-2); }

.mulighed-bogstav {
    flex: none;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface-2);
    font-family: var(--skrift-overskrift);
    font-weight: 600;
    font-size: 0.9rem;
}

.mulighed-laast { cursor: default; }
.mulighed-rigtig { background: var(--ok-bg); border-color: var(--green); }
.mulighed-rigtig .mulighed-bogstav { background: var(--green); color: #fff; }
.mulighed-valgt-forkert { background: var(--err-bg); border-color: var(--err-ink); }
.mulighed-valgt-forkert .mulighed-bogstav { background: var(--err-ink); color: #fff; }

.mulighed-tag {
    margin-left: auto;
    flex: none;
    font-size: 0.75rem;
    font-family: var(--skrift-overskrift);
    font-weight: 600;
    color: var(--muted);
}

.facit-banner {
    font-family: var(--skrift-overskrift);
    font-weight: 700;
    font-size: 1.2rem;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 18px;
}
.facit-rigtigt { background: var(--ok-bg); color: var(--ok-ink); }
.facit-forkert { background: var(--err-bg); color: var(--err-ink); }

.forklaring {
    background: var(--surface-2);
    border-left: 4px solid var(--green);
    border-radius: 0 10px 10px 0;
    padding: 12px 16px;
    margin-top: 18px;
    font-size: 0.95rem;
}

.quiz-afbryd { text-align: center; margin-top: 22px; }
.quiz-afbryd a { color: var(--muted); }

/* ── Resultat ───────────────────────────────────────────── */

.resultat { text-align: center; padding-top: 4vh; }

.resultat-score {
    font-family: var(--skrift-overskrift);
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
}
.resultat-score span { font-size: 2rem; color: var(--muted); font-weight: 400; }

.resultat-procent { color: var(--muted); margin: 6px 0 18px; }

.resultat-prikker { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 18px 0; }
.prik { width: 14px; height: 14px; border-radius: 50%; }
.prik-rigtig { background: var(--green); }
.prik-forkert { background: var(--err-ink); opacity: 0.6; }

.resultat-knapper { display: flex; justify-content: center; gap: 10px; margin-top: 10px; }

/* ── Mobil ──────────────────────────────────────────────── */

@media (max-width: 560px) {
    h1 { font-size: 1.4rem; }
    .quiz-muligheder { grid-template-columns: 1fr; }
    .top-inderside { gap: 10px; }
    .brugernavn { display: none; }
    .blandet-kort { flex-direction: column; align-items: stretch; text-align: center; }
    .login-kort { margin-top: 3vh; }
    .resultat-knapper { flex-direction: column; }
    .resultat-knapper .knap, .resultat-knapper form { width: 100%; }
    .resultat-knapper form .knap { width: 100%; }
}

/* ── Tabelspil (fælles) ─────────────────────────────────── */

.spil-ramme { max-width: 560px; margin: 0 auto; }
.spil-bred { max-width: 720px; }
.skjult { display: none !important; }
/* I V-skole-appen (klassen sættes af appen og af layoutet) giver browser-råd ingen mening. */
.i-app .kun-browser { display: none !important; }
html:not(.i-app) .kun-app { display: none !important; }
.spil-etiket { font-size: 0.95rem; margin: 18px 0 8px; }
.spil-tilbage { text-align: center; margin-top: 20px; }
.spil-tilbage a { color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }

.chip {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    border-radius: 99px;
    padding: 7px 13px;
    font: inherit;
    font-size: 0.9rem;
    cursor: pointer;
}
.chip.valgt { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 600; }

#duelnavne { margin-top: 10px; }
.spil-ramme input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface-2);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 13px;
    font: inherit;
    margin-bottom: 10px;
}

.spil-ramme .knap-bred { margin-top: 18px; }

/* Runde-UI */
.lyn-top { display: flex; justify-content: space-between; gap: 10px; font-size: 0.95rem; color: var(--muted); min-height: 1.4em; }
.tidbar { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 8px 0 4px; }
.tidbar-fyld { height: 100%; width: 100%; background: var(--green); border-radius: 99px; transition: width 0.1s linear; }
.tidbar-fyld.tid-lav { background: var(--err-ink); }

.lyn-spm {
    font-family: var(--skrift-overskrift);
    font-size: 3.2rem;
    font-weight: 700;
    text-align: center;
    margin: 18px 0 4px;
}
.lyn-spm-lille { font-size: 2rem; margin: 6px 0 2px; }

.lyn-indtast {
    text-align: center;
    font-family: var(--skrift-overskrift);
    font-size: 2rem;
    min-height: 1.3em;
    color: var(--accent);
    margin-bottom: 12px;
    font-variant-numeric: tabular-nums;
}
.lyn-indtast.rigtig { color: var(--ok-ink); }
.lyn-indtast.forkert { color: var(--err-ink); font-size: 1.5rem; }

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 320px;
    margin: 0 auto;
}
.keypad-lille { max-width: 260px; }

.tast {
    font-family: var(--skrift-overskrift);
    font-size: 1.5rem;
    font-weight: 600;
    padding: 13px 0;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    box-shadow: var(--shadow);
}
.tast:active { background: var(--surface-2); transform: scale(0.97); }
.tast-ok { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.keypad-lille .tast { font-size: 1.2rem; padding: 9px 0; }

/* Duel-resultat (lynet) */
.duel-resultat { display: flex; gap: 12px; justify-content: center; margin: 14px 0; }
.duel-resultat > div {
    flex: 1;
    max-width: 200px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: center;
}
.duel-resultat span { font-family: var(--skrift-overskrift); font-size: 1.7rem; font-weight: 700; color: var(--accent); }
.duel-resultat small { color: var(--muted); }
.duel-resultat .vinder { border-color: var(--green); background: var(--ok-bg); }

/* ── Trappen ────────────────────────────────────────────── */

.trinliste { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; }

.trin {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    border-radius: 10px;
    padding: 10px 14px;
    font: inherit;
    cursor: pointer;
    box-shadow: var(--shadow);
}
.trin-navn { font-family: var(--skrift-overskrift); font-weight: 600; }
.trin-status { color: var(--muted); font-size: 0.9rem; }
.trin-diplom { background: var(--ok-bg); border-color: var(--green); }
.trin-diplom .trin-status { color: var(--ok-ink); }
.trin-aktiv { border-color: var(--accent); border-width: 2px; }
.trin-aktiv .trin-status { color: var(--accent); font-weight: 600; }
.trin-laast { opacity: 0.55; cursor: default; }
.trin-top { background: var(--mint); border-color: var(--green); justify-content: center; cursor: default; }

/* ── Pladekampen ────────────────────────────────────────── */

.tur-banner {
    text-align: center;
    font-family: var(--skrift-overskrift);
    font-weight: 600;
    border-radius: 10px;
    padding: 9px 12px;
    margin-bottom: 10px;
}
.tur-p1 { background: var(--ok-bg); color: var(--ok-ink); }
.tur-p2 { background: var(--surface-2); color: var(--ink-2); }

.plade-rul { overflow-x: auto; padding-bottom: 6px; }

.plade {
    display: grid;
    grid-template-columns: repeat(12, minmax(34px, 1fr));
    gap: 3px;
    min-width: 460px;
}

.plade-hoved, .plade-felt {
    font: inherit;
    font-size: 0.85rem;
    padding: 0;
    height: 34px;
    border-radius: 7px;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
}
.plade-hoved { background: none; border: none; color: var(--muted); font-weight: 600; }
.plade-hoved.hoved-lys { color: var(--accent); font-weight: 700; transform: scale(1.15); }
.plade-felt { background: var(--surface); color: var(--ink-2); cursor: pointer; }
.plade-felt:not(:disabled):hover { border-color: var(--accent); }
.felt-valgt { outline: 2px solid var(--accent); }
.felt-p1 { background: var(--green); color: #fff; border-color: var(--green); font-weight: 700; }
.felt-p2 { background: #3b82f6; color: #fff; border-color: #3b82f6; font-weight: 700; }
.felt-stribe { outline: 3px solid var(--warn-ink); z-index: 1; }

.opgavepanel {
    margin-top: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px;
    box-shadow: var(--shadow);
}

/* ── Topliste ───────────────────────────────────────────── */

.klassevalg { display: flex; align-items: center; gap: 8px; margin: 10px 0 16px; }
.klassevalg select {
    font: inherit;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 7px 10px;
}

.liste-raekke { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 14px; }

.liste-linje {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 0.95rem;
}
.liste-linje:last-child { border-bottom: none; }
.liste-linje > span:nth-child(2) { flex: 1; min-width: 0; }
.placering {
    flex: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--skrift-overskrift);
    font-size: 0.8rem;
    font-weight: 700;
}
.liste-linje:first-of-type .placering { background: var(--warn-bg); color: var(--warn-ink); }

/* Konfetti */
.konfetti {
    position: fixed;
    top: -30px;
    z-index: 99;
    pointer-events: none;
    animation: konfetti-fald 2.4s ease-in forwards;
}
@keyframes konfetti-fald {
    to { transform: translateY(105vh) rotate(340deg); opacity: 0.7; }
}

@media (max-width: 560px) {
    .lyn-spm { font-size: 2.4rem; }
    .duel-resultat { flex-direction: column; align-items: stretch; }
    .duel-resultat > div { max-width: none; }
}

/* ---------- Say the Word! (/sig-ordet) ---------- */

.ord-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.ord-frem {
    justify-self: start;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 12px;
    font-weight: 700;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}
.ord-ur {
    font-family: var(--skrift-overskrift);
    font-size: 1.9rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.ord-mik { justify-self: end; display: flex; align-items: center; gap: 7px; font-size: 0.85rem; color: var(--muted); }
.ord-mik .prik { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.ord-mik.taendt { color: var(--accent); font-weight: 600; }
.ord-mik.taendt .prik { background: var(--accent); animation: ord-puls 1.4s infinite; }
@keyframes ord-puls {
    0% { box-shadow: 0 0 0 0 rgba(86, 163, 8, 0.4); }
    70% { box-shadow: 0 0 0 9px rgba(86, 163, 8, 0); }
    100% { box-shadow: 0 0 0 0 rgba(86, 163, 8, 0); }
}

.ord-kort {
    background: var(--surface);
    border: 2px solid var(--line);
    border-radius: 16px;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    margin: 14px 0 8px;
    box-shadow: var(--shadow);
    transition: background 0.18s, border-color 0.18s;
}
.ord-kort.god { background: var(--ok-bg); border-color: var(--ok-ink); }
.ord-kort.gal { background: var(--err-bg); border-color: var(--err-ink); }
.ord-ord {
    font-family: var(--skrift-overskrift);
    font-weight: 800;
    font-size: clamp(3rem, 15vw, 6.5rem);
    line-height: 1;
    animation: ord-pop 0.22s ease-out;
}
@keyframes ord-pop {
    from { transform: scale(0.85); opacity: 0.3; }
    to { transform: scale(1); opacity: 1; }
}

.ord-hoert { text-align: center; min-height: 1.4em; font-size: 0.9rem; color: var(--muted); }
.ord-hoert.ok { color: var(--ok-ink); font-weight: 700; }
.ord-knapper { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.puls { animation: ord-nik 0.8s infinite; }
@keyframes ord-nik { 50% { transform: scale(1.06); } }

.ord-tid {
    text-align: center;
    font-family: var(--skrift-overskrift);
    font-size: 3rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.rekord {
    display: inline-block;
    background: var(--warn-bg);
    color: var(--warn-ink);
    border: 1.5px solid var(--warn-ink);
    border-radius: 999px;
    padding: 7px 16px;
    font-weight: 700;
}
.ord-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 14px 0; }
.ord-stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
}
.ord-stat .tal { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ord-stat .tekst { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }

.ord-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    margin: 10px 0;
}
.ord-panel h2 { font-size: 0.95rem; margin: 0 0 8px; }
.ord-tabel { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.ord-tabel th {
    text-align: left;
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 6px 8px;
    border-bottom: 1.5px solid var(--line);
}
.ord-tabel td { padding: 7px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
#sigordet .chip:disabled { opacity: 0.45; cursor: not-allowed; }

/* Mærkat ved siden af overskriften, når sproget er låst af forsidekortet. */
.sprogmaerkat {
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
    background: var(--mint);
    color: var(--ok-ink);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 11px;
    font-family: var(--skrift);
    font-size: 0.8rem;
    font-weight: 600;
}

/* ---------- Forsidens spilkatalog ---------- */

.trinvaelger { margin: 18px 0 6px; }
.trin-etiket {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 7px;
}
.trin-chip { min-width: 44px; text-align: center; }

.spilgitter {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin: 16px 0 26px;
}
.spilkort {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    position: relative;
}
.spilkort:hover,
.spilkort:focus-visible {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 8px 22px rgba(10, 31, 65, 0.14);
}
.spilkort img {
    display: block;
    width: 100%;
    height: 150px;
    object-fit: cover;
    background: var(--surface-2);
}
/* Navnet ligger som overlay på billedet, med en mørk bund så teksten kan
   læses uanset hvor lyst billedet er. */
.spilkort-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 10px 14px;
    background: linear-gradient(to bottom, rgba(10, 31, 65, 0) 22%, rgba(10, 31, 65, 0.55) 55%, rgba(10, 31, 65, 0.92) 100%);
    color: #fff;
}
/* color skal stå eksplicit: h1-h3 får var(--ink) globalt, og det ville
   gøre titlen mørk oven på et mørkt billede. */
.spilkort-overlay h2 {
    margin: 0;
    color: #fff;
    font-size: 1.3rem;
    line-height: 1.15;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
}
.spilkort-mærkat {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.92);
    color: var(--brand-ink);
    border-radius: 999px;
    padding: 2px 9px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 5px;
}
.spilkort-trin {
    margin: 2px 0 0;
    color: #fff;
    font-size: 0.78rem;
    opacity: 0.94;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.75);
}
.spilkort-tekst {
    margin: 0;
    padding: 11px 14px 13px;
    font-size: 0.88rem;
    color: var(--muted);
}
.forside-ekstra { margin-top: 4px; }

@media (max-width: 420px) {
    .spilgitter { grid-template-columns: 1fr; }
    .spilkort img, .spilkort-overlay { height: 132px; }
}

/* Sig tallet: gangestykket fylder kortet, med luft om gangetegnet. */
.tal-stykke { letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }

/* Kig-skærmen: hele tabellen inden runden går i gang. */
.tabel-liste {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 14px;
    margin: 14px 0 4px;
}
.tabel-linje {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: baseline;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 7px 12px;
    font-variant-numeric: tabular-nums;
}
.tabel-linje .stykke { text-align: right; font-size: 1.05rem; }
.tabel-linje .lig { color: var(--muted); }
.tabel-linje .facit {
    font-family: var(--skrift-overskrift);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent);
}
@media (max-width: 460px) {
    .tabel-liste { grid-template-columns: 1fr; gap: 5px; }
    .tabel-linje { padding: 6px 12px; }
}

/* Sætningstilstand: sætningen vises ord for ord; hørte ord markeres. */
.ord-ord.saet {
    font-size: clamp(1.5rem, 5.5vw, 2.6rem);
    line-height: 1.45;
    text-align: center;
    max-width: 100%;
}
.saet-ord { opacity: 0.9; }
.saet-ord.hoert {
    color: var(--ok-ink);
    opacity: 1;
    text-decoration: underline;
    text-decoration-thickness: 3px;
    text-underline-offset: 5px;
}

/* ================= Tastatur Helten =================
   Skrivespillet. Ordene falder med ren CSS — @keyframes th-fald herunder er
   hele animationen, der er ingen tegneloekke i JavaScript. Farten kommer fra
   --faldtid, som serveren saetter for hvert hold.

   Fingerfarverne gaar igen paa tastaturet under banen, saa eleven kan se,
   hvilken finger der skal bruges. De er valgt, saa de kan skelnes ogsaa af
   den, der ser farver anderledes — men de staar aldrig alene: hjaelpeteksten
   under tastaturet siger ordene ("højre pegefinger"). */

.th { max-width: 900px; margin: 0 auto; }

.spil-hoved { margin-bottom: 1rem; }
.spil-hoved h1 { margin-bottom: 0.3rem; }

/* ---- niveaumenu ---- */

.th-niveauer {
    list-style: none;
    margin: 0 0 24px;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
    counter-reset: none;
}

.th-niveau {
    display: grid;
    grid-template-columns: 2rem 1fr auto;
    grid-template-areas: "nr navn status" "nr bjaelke status";
    align-items: center;
    gap: 2px 10px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.th-niveau:hover:not(:disabled),
.th-niveau:focus-visible:not(:disabled) { border-color: var(--accent); }

.th-niveau.th-ivaerk { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.th-niveau.th-laast { opacity: 0.5; cursor: not-allowed; }

.th-nummer {
    grid-area: nr;
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--surface-2);
    font-weight: 700;
}

.th-navn { grid-area: navn; font-weight: 600; }
.th-status { grid-area: status; color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }

.th-bjaelke {
    grid-area: bjaelke;
    display: block;
    height: 5px;
    border-radius: 3px;
    background: var(--surface-2);
    overflow: hidden;
}
.th-bjaelke > span { display: block; height: 100%; background: var(--accent); }
.th-bjaelke-hud { flex: 1 1 80px; max-width: 220px; }

/* ---- bogstavtavlen paa niveau 1 ---- */

.th-alfabet {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.th-alfabet li {
    display: grid;
    place-items: center;
    min-width: 46px;
    padding: 6px 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    font-size: 1.1rem;
    font-weight: 600;
}
.th-alfabet .th-traef { color: var(--muted); font-size: 0.7rem; font-weight: 400; }
.th-alfabet .th-mestret { background: var(--ok-bg); border-color: var(--ok-ink); color: var(--ok-ink); }
.th-alfabet .th-lukket { opacity: 0.35; }

/* ---- spillepladen ---- */

.th-plade { position: relative; }

.th-hud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    margin-bottom: 8px;
}
.th-hud .knap-diskret { margin-left: auto; }
.th-point b { font-variant-numeric: tabular-nums; }
.th-liv { color: #d24b63; letter-spacing: 3px; font-size: 1.2rem; }

.th-bane {
    --th-hoejde: 380px;
    position: relative;
    height: var(--th-hoejde);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
}

/* Bundlinjen: her mister man et liv. */
.th-bane::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: repeating-linear-gradient(90deg, var(--err-ink) 0 12px, transparent 12px 24px);
    opacity: 0.5;
}

.th-ord {
    position: absolute;
    top: 0;
    left: var(--spor);
    padding: 6px 12px;
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow), 0 0 0 1px var(--line);
    font-size: 1.5rem;
    font-weight: 600;
    white-space: nowrap;
    /* Ingen forsinkelse: ordene saettes i luften ét ad gangen af
       public/js/tastatur.js, saa faldet skal begynde med det samme.
       NB: en var(), der ikke er sat, goer HELE animation-linjen ugyldig —
       saa falder ordet slet ikke, og animationend kommer aldrig. */
    animation: th-fald var(--faldtid) linear 1 both;
}

@keyframes th-fald {
    from { transform: translate(-50%, -2.4em); }
    to   { transform: translate(-50%, var(--th-hoejde)); }
}

.th-frossen .th-ord { animation-play-state: paused; }

.th-ord.th-aktiv { box-shadow: var(--shadow), 0 0 0 2px var(--accent); }
.th-ord .th-skrevet { color: var(--accent); }
.th-ord .th-mellemrum { display: inline-block; min-width: 0.5em; border-bottom: 2px solid var(--line); }
.th-ord .th-skrevet.th-mellemrum { border-bottom-color: var(--accent); }

.th-ord.th-klaret,
.th-ord.th-mistet {
    animation-play-state: paused;
    opacity: 0;
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}
.th-ord.th-klaret { background: var(--ok-bg); color: var(--ok-ink); }
.th-ord.th-mistet { background: var(--err-bg); color: var(--err-ink); }
.th-ord.th-fejl { animation-play-state: running; background: var(--err-bg); }

.th-nedtaelling {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    margin: 0;
    font-size: 5rem;
    font-weight: 700;
    color: var(--accent);
}

/* Feltet findes kun for at kalde det bløde tastatur frem på tablet. */
.th-fanger {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

/* ---- tastaturet under banen ---- */

.th-tastatur {
    margin: 14px auto 0;
    display: grid;
    gap: 5px;
    max-width: 620px;
}

.th-raekke { display: flex; justify-content: center; gap: 5px; }
.th-raekke-midt { padding-left: 1.2rem; }
.th-raekke-bund { padding-left: 2.6rem; }

.th-tast {
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 6px;
    border-bottom: 3px solid color-mix(in srgb, var(--ink) 18%, transparent);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
}
.th-tast-bred { width: 12rem; font-size: 0.8rem; font-weight: 400; }

/* Én farve pr. finger — samme farve på venstre og højre hånd. Farverne er
   variabler, så de følger temaet ligesom resten af siden; skrives de direkte
   her, bliver bogstaverne usynlige, når systemet står på mørkt. */
.th-f-lille  { background: var(--finger-lille); }
.th-f-ring   { background: var(--finger-ring); }
.th-f-lang   { background: var(--finger-lang); }
.th-f-peg    { background: var(--finger-peg); }
.th-f-tommel { background: var(--surface-2); }

.th-tast.th-naeste {
    outline: 3px solid var(--accent);
    outline-offset: 1px;
    transform: translateY(1px);
}

.th-fingerhjaelp { text-align: center; color: var(--muted); margin-top: 10px; }

/* ---- mellem- og slutskærme ---- */

.th-mellemskaerm { max-width: 460px; margin: 6vh auto 0; text-align: center; }
.th-mellemskaerm h1 { margin-bottom: 0.4rem; }
.th-tal { font-size: 1.25rem; font-weight: 600; margin: 0 0 0.3rem; }
.th-fejring h1 { color: var(--accent); }

@media (max-width: 640px) {
    .th-bane { --th-hoejde: 300px; }
    .th-ord { font-size: 1.2rem; }
    .th-tast { width: 1.9rem; height: 2.1rem; font-size: 0.8rem; }
    .th-tast-bred { width: 9rem; }
    .th-raekke-midt { padding-left: 0.9rem; }
    .th-raekke-bund { padding-left: 2rem; }
    .th-niveauer { grid-template-columns: 1fr; }
}

/* Nogle elever bliver utilpasse af bevægelse. Spillet kan ikke undvære
   faldet, men alt det andet holder op med at røre på sig. */
@media (prefers-reduced-motion: reduce) {
    .th-ord.th-klaret, .th-ord.th-mistet { transition: none; }
    .th-tast.th-naeste { transform: none; }
}

#oversprungne .chip small { color: var(--muted); font-weight: 400; }

/* ── Placering i klassen («du er nr. 2») — Sig tallet ───── */

.placering-linje { margin: 6px 0 0; font-size: 0.92rem; font-weight: 600; color: var(--ink-2); }
.placering-linje:empty { display: none; }
.placering-runde { text-align: center; margin: 10px 0 0; }
.placering-badge {
    display: inline-block;
    background: var(--ok-bg);
    color: var(--ok-ink);
    border: 1.5px solid var(--ok-ink);
    border-radius: 999px;
    padding: 7px 16px;
    font-weight: 700;
}

/* ── Klassekonkurrencen: ugens point og klassemålet — Sig tallet ── */

.ugekort {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    margin: 14px 0 4px;
}
.ugekort-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.ugebar { height: 8px; border-radius: 99px; background: var(--surface-2); margin: 8px 0 10px; overflow: hidden; }
.ugebar-fyld { height: 100%; width: 0; border-radius: 99px; background: var(--accent); transition: width 0.4s ease; }
.ugeveje { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.ugeveje li { display: grid; grid-template-columns: 7.2em 1fr auto; gap: 8px; padding: 3px 0; align-items: baseline; }
.ugeveje .vej { font-weight: 600; }
.ugeveje .hvad { color: var(--muted); }
.ugeveje li.tom strong { color: var(--muted); font-weight: 400; }
.ugetrin { margin: 6px 0 0; color: var(--ink-2); font-weight: 600; }
.ugemaal { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line); color: var(--ink-2); }
.chip.klaret:not(.valgt) { border-color: var(--accent); }

@media (max-width: 480px) {
    .ugeveje li { grid-template-columns: 1fr auto; }
    .ugeveje .hvad { grid-column: 1 / -1; grid-row: 2; font-size: 0.82rem; }
}

/* ── Sig tallet: 15 sekunders straf pr. stykke sprunget over ── */

.straf-blink {
    text-align: center;
    margin: 6px 0 0;
    min-height: 1.3em;
    font-weight: 700;
    color: var(--err-ink);
    opacity: 0;
}
.straf-blink.vis { animation: straf-blink 1.8s ease-out forwards; }
@keyframes straf-blink {
    0% { opacity: 0; transform: scale(0.9); }
    15% { opacity: 1; transform: scale(1.1); }
    70% { opacity: 1; transform: none; }
    100% { opacity: 0.6; transform: none; }
}

/* ── Guiden til mikrofonen (/mikrofon) ───────────────────── */

.mikrofon-guide { max-width: 720px; margin: 0 auto; }
.guide-kort { margin: 14px 0; }
.guide-kort h2 { margin-top: 0; font-size: 1.1rem; }
.mikrofon-guide .enhed { font-weight: 600; margin: 4px 0 8px; }
.tjekliste { list-style: none; margin: 0 0 8px; padding: 0; font-size: 0.92rem; }
.tjekliste li { padding: 2px 0; }
.tjekliste li.ok { color: var(--ok-ink); }
.tjekliste li.fejl { color: var(--err-ink); font-weight: 600; }
.tjekliste li.maaske { color: var(--muted); }
.guide-valg summary { cursor: pointer; color: var(--muted); font-size: 0.9rem; }
.guide-valg label { display: inline-flex; flex-direction: column; gap: 4px; margin: 8px 12px 0 0; font-size: 0.85rem; }
.guide-valg select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: inherit; font: inherit; }
.guide-test { margin: 10px 0 14px; }
.niveaubar { height: 10px; border-radius: 99px; background: var(--surface-2); margin: 10px 0 6px; overflow: hidden; }
.niveaubar div { height: 100%; width: 0; background: var(--accent); transition: width 0.08s linear; }
.testsvar { margin: 6px 0 0; font-weight: 600; }
.guide-trin { margin: 0; padding-left: 22px; }
.guide-trin > li { margin: 0 0 12px; line-height: 1.5; }
.guide-trin > li > span { display: block; margin-top: 4px; }
.guide-trin > li > span.skjult, .guide-tips li.skjult { display: none; }
.guide-tips { margin: 0; padding-left: 20px; line-height: 1.5; }
.guide-tips li { margin-bottom: 6px; }
.mikrofon-guide .fremhaevet { background: var(--warn-bg); border-left: 4px solid var(--warn-ink); padding: 6px 10px; border-radius: 6px; }
.mikrofon-guide .kopi { margin-top: 8px; }
.lille-knap { padding: 6px 12px; font-size: 0.88rem; }

/* Et fremhaevet trin inde i et fremhaevet trin: kun den ydre ramme. */
.mikrofon-guide .fremhaevet .fremhaevet { background: none; border-left: 0; padding: 0; }


/* ── Regnespillene: Restjagten, Talmaskinen, Mønsterjagten ─────────── */

.niveau-chip small { color: inherit; opacity: 0.8; font-weight: 400; }
#niveautekst { min-height: 1.3em; margin: 8px 0 0; }
.regnespil-opgave { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.regnespil-opgave .keypad { margin-top: 4px; }

/* Svarfelter: «hver får» og «tilovers» side om side. */
.svarfelter { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.svarfelt {
    min-width: 128px;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    background: var(--surface-2);
    border: 2px solid var(--line);
    border-radius: 12px;
    padding: 8px 14px;
    cursor: pointer;
}
.svarfelt.aktivt { border-color: var(--accent); }
.svarfelt-etiket { font-size: 0.8rem; color: var(--muted); }
.svarfelt-tal { font-family: var(--skrift-overskrift); font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; min-height: 1.2em; }

.rj-feedback { text-align: center; font-weight: 600; min-height: 0; }
.rj-feedback:empty { display: none; }
.rj-feedback.rigtig { color: var(--ok-ink); background: var(--ok-bg); border-radius: 10px; padding: 8px 12px; }
.rj-feedback.forkert { color: var(--err-ink); background: var(--err-bg); border-radius: 10px; padding: 8px 12px; }

/* Restjagten */
.rj-mission { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 8px 12px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.rj-mission strong { font-family: var(--skrift-overskrift); font-size: 1.15rem; }
.rj-total { text-align: center; display: flex; flex-direction: column; align-items: center; }
.rj-tal { font-family: var(--skrift-overskrift); font-size: 3rem; font-weight: 700; line-height: 1.05; font-variant-numeric: tabular-nums; }
.rj-kort { display: flex; justify-content: center; gap: 10px; }
.rj-kortet {
    width: 84px; height: 84px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: 14px;
    background: var(--surface); color: var(--ink);
    font: inherit; cursor: pointer; box-shadow: var(--shadow);
}
.rj-kortet:disabled { cursor: default; }
.rj-kortet.valgt { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.rj-kortet-tal { font-family: var(--skrift-overskrift); font-size: 1.9rem; font-weight: 700; line-height: 1.1; }
.rj-stykke, .rj-spm { text-align: center; font-family: var(--skrift-overskrift); font-weight: 600; font-size: 1.15rem; margin: 2px 0 0; }
.rj-historie { text-align: center; font-size: 1.05rem; margin: 6px 0 0; }
.rj-bunkeknap { align-self: center; }
.rj-alle { text-align: center; color: var(--ink-2); margin: 0; }
.rj-bunker { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.rj-plader { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.rj-plade {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: var(--surface-2); border-radius: 10px; padding: 6px 6px 4px; min-width: 34px;
}
.rj-plade small { font-size: 0.68rem; }
.rj-bolle {
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--green); display: inline-block;
    animation: rj-bolle-ind 0.25s ease-out both;
}
.rj-rest { background: var(--warn-ink); }
.rj-kurv {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px;
    background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 6px 12px;
}
.rj-kurv small { width: 100%; text-align: center; font-size: 0.75rem; }
@keyframes rj-bolle-ind { from { transform: translateY(-8px) scale(0.6); opacity: 0; } }

/* Talmaskinen */
.tm-maskine { display: flex; flex-direction: column; align-items: center; gap: 0; }
.tm-ind, .tm-ud {
    background: var(--accent); color: var(--on-accent);
    font-family: var(--skrift-overskrift); font-weight: 600; font-size: 0.8rem;
    padding: 3px 14px; border-radius: 6px; position: relative; z-index: 1;
}
.tm-krop {
    width: min(260px, 100%); height: 120px; margin: -6px 0;
    background: var(--surface-2); border: 2px solid var(--line); border-radius: 18px;
    display: grid; grid-template-columns: 1fr auto 1fr; grid-template-rows: 1fr 1fr; align-items: center; justify-items: center;
}
.tm-skrue { width: 14px; height: 14px; border-radius: 50%; background: var(--green); opacity: 0.55; }
.tm-krop .tm-skrue:nth-child(1) { grid-area: 1 / 1; }
.tm-krop .tm-skrue:nth-child(2) { grid-area: 1 / 3; }
.tm-krop .tm-skrue:nth-child(4) { grid-area: 2 / 1; }
.tm-krop .tm-skrue:nth-child(5) { grid-area: 2 / 3; }
.tm-vindue {
    grid-area: 1 / 2 / 3 / 3;
    min-width: 76px; height: 76px; padding: 0 10px; border-radius: 38px;
    background: var(--surface); border: 2px solid var(--accent);
    display: flex; align-items: center; justify-content: center;
}
.tm-regel { font-family: var(--skrift-overskrift); font-size: 1.6rem; font-weight: 700; white-space: nowrap; }
.tm-maskine.baglaens .tm-regel, .tm-maskine.knaekket .tm-regel, .tm-maskine.opgivet .tm-regel { font-size: 1.15rem; }
.tm-maskine.knaekket .tm-vindue { background: var(--ok-bg); border-color: var(--green); }
.tm-udtal {
    margin-top: 6px; min-width: 64px; min-height: 1.6em; padding: 2px 12px; border-radius: 8px;
    background: var(--mint); color: var(--ok-ink); text-align: center;
    font-family: var(--skrift-overskrift); font-size: 1.4rem; font-weight: 700;
}
.tm-udtal:empty { visibility: hidden; }
.tm-udtal.tm-klonk { background: var(--warn-bg); color: var(--warn-ink); font-size: 1.05rem; }
.tm-maskine.tygger .tm-krop { animation: tm-tyg 0.45s ease; }
@keyframes tm-tyg { 25% { transform: translateX(-3px) rotate(-1deg); } 50% { transform: translateX(3px) rotate(1deg); } 75% { transform: translateX(-2px); } }
.tm-tabel { display: flex; flex-wrap: wrap; gap: 6px; }
.tm-par {
    display: inline-flex; align-items: baseline; gap: 6px;
    background: var(--surface-2); border-radius: 8px; padding: 5px 10px;
    font-variant-numeric: tabular-nums;
}
.tm-par-ind, .tm-par-ud { font-family: var(--skrift-overskrift); font-weight: 700; font-size: 1.05rem; }
.tm-par-ud.tm-klonk { color: var(--warn-ink); font-weight: 600; font-size: 0.9rem; }
.tm-gratis { outline: 1px dashed var(--accent); }
.tm-par.blink { animation: tm-blink 0.6s ease; }
@keyframes tm-blink { 50% { background: var(--mint); } }
.tm-ok { color: var(--ok-ink); font-weight: 700; }
.tm-nej { color: var(--err-ink); font-size: 0.85rem; }
.tm-status { margin: 0; text-align: center; }
.tm-gaet { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.tm-trin .spil-etiket { margin-top: 0; }
.tm-ops .chip { font-size: 1.25rem; min-width: 52px; font-weight: 700; }
.tm-tal .chip { min-width: 40px; }
.tm-opgiv { align-self: center; }

/* Mønsterjagten */
.mj-spm { text-align: center; font-family: var(--skrift-overskrift); font-size: 1.2rem; font-weight: 600; margin: 4px 0 0; }
.mj-foelge { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.mj-tal {
    min-width: 56px; padding: 10px 8px; border-radius: 12px;
    background: var(--surface-2); text-align: center;
    font-family: var(--skrift-overskrift); font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.mj-skjult { background: var(--surface); border: 2px dashed var(--accent); color: var(--accent); }
.mj-ramt { background: var(--ok-bg); color: var(--ok-ink); }
.mj-vist { background: var(--err-bg); color: var(--err-ink); }
.mj-hop { display: flex; justify-content: center; gap: 38px; color: var(--muted); font-size: 0.85rem; margin-top: -4px; }
.mj-figurer { display: flex; justify-content: center; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.mj-figur { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mj-figur svg { max-width: 100%; height: auto; }
.mj-antal { font-family: var(--skrift-overskrift); font-size: 1.05rem; }
.mj-klods { fill: var(--green); stroke: var(--surface); stroke-width: 1.5; }
.mj-ny { fill: #f2c94c; }
.mj-hint { text-align: center; margin: 0; }
.mj-trin { display: flex; flex-direction: column; gap: 10px; }
.mj-regel .chips { justify-content: center; }
.mj-regel p { text-align: center; margin: 4px 0; }
.mj-valg:disabled { cursor: default; opacity: 1; }
.mj-valg.mj-rigtig { background: var(--ok-bg); border-color: var(--green); color: var(--ok-ink); font-weight: 600; }
.mj-valg.mj-forkert { background: var(--err-bg); border-color: var(--err-ink); color: var(--err-ink); }
.mj-ok { color: var(--ok-ink); font-weight: 600; }
.mj-nej { color: var(--err-ink); }
.mj-spring {
    display: flex; flex-direction: column; gap: 8px;
    border: 2px solid var(--accent); border-radius: 14px; padding: 12px; background: var(--surface);
}
.mj-spring-etiket { margin: 0; font-family: var(--skrift-overskrift); font-weight: 600; font-size: 0.8rem; letter-spacing: 0.06em; color: var(--accent); text-align: center; }
.mj-spring .knap-diskret { align-self: center; }

/* Slutskærmen */
.slut-stat { list-style: none; padding: 0; margin: 10px 0 14px; text-align: center; color: var(--ink-2); }
.slut-stat li { padding: 2px 0; }
.slut-linje { text-align: center; }
.duel-resultat .kort-navn { font-family: var(--skrift-overskrift); }

/* ── Udfordringer ───────────────────────────────────────── */

.udf-online { margin-top: 22px; padding-top: 4px; border-top: 1px solid var(--line); }
.onlineliste { display: flex; flex-direction: column; gap: 6px; }
.online-raekke {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface-2); border-radius: 10px; padding: 7px 10px;
}
.online-navn { flex: 1; min-width: 0; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.online-navn::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--green); flex: none; }
.online-raekke.egen-klasse { background: var(--mint); }
.online-knap { flex: none; }

.kampstilling {
    background: var(--surface-2); border-radius: 12px; padding: 10px 12px; margin: 6px 0 4px;
    display: flex; flex-direction: column; gap: 6px;
}
.kamp-raekke { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "navn point" "spor spor" "hvor hvor"; gap: 2px 8px; }
.kamp-navn { grid-area: navn; font-weight: 600; }
.kamp-point { grid-area: point; font-family: var(--skrift-overskrift); font-variant-numeric: tabular-nums; }
.kamp-spor { grid-area: spor; height: 8px; border-radius: 99px; background: var(--surface); overflow: hidden; }
.kamp-fyld { height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.4s ease; }
.kamp-anden .kamp-fyld { background: #3b82f6; }
.kamp-hvor { grid-area: hvor; }
.kamp-linje { margin: 0; color: var(--ink-2); font-weight: 600; }
.kamp-linje:empty { display: none; }

.udf-boks {
    position: fixed; inset: 0; z-index: 90;
    background: rgba(7, 22, 48, 0.55);
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
}
.udf-kort {
    width: min(380px, 100%);
    background: var(--surface); color: var(--ink);
    border: 2px solid var(--accent); border-radius: 18px;
    padding: 22px 20px 16px; text-align: center;
    box-shadow: 0 12px 40px rgba(7, 22, 48, 0.35);
    animation: udf-ind 0.25s ease-out;
}
.udf-etiket { margin: 0 0 6px; font-family: var(--skrift-overskrift); font-weight: 600; font-size: 0.82rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.udf-kort h2 { margin: 0 0 6px; font-size: 1.3rem; text-wrap: balance; }
.udf-kort p { margin: 0 0 12px; }
.udf-knapper { display: flex; gap: 10px; justify-content: center; }
.udf-knapper .knap { flex: 1; }
.udf-tid { margin-top: 12px; }
.udf-tidspor { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
#udf-tidfyld { height: 100%; width: 100%; background: var(--accent); border-radius: 99px; transition: width 0.25s linear; }
.udf-tid p { margin: 6px 0 0; }
@keyframes udf-ind { from { transform: translateY(12px) scale(0.97); opacity: 0; } }

.udf-banner {
    position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 80;
    background: var(--accent); color: var(--on-accent);
    border-radius: 99px; padding: 9px 18px; font-weight: 600; box-shadow: var(--shadow);
    max-width: calc(100% - 32px);
}
.udf-banner a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
    .rj-bolle, .udf-kort, .tm-maskine.tygger .tm-krop, .tm-par.blink { animation: none; }
}
@media (max-width: 560px) {
    .rj-kortet { width: 74px; height: 74px; }
    .rj-tal { font-size: 2.5rem; }
    .svarfelt { min-width: 110px; }
    .mj-tal { min-width: 46px; font-size: 1.3rem; }
    .mj-hop { gap: 28px; }
}
.topliste-under { margin: 10px 0 2px; }

/* ── Retskrivningsspillene (/dansk, 22.10.2026) ─────────────────────────
   Opgavetypen vises som et mærkat i prøvens egne farver (diktat gul, komma
   blå osv.), så eleverne kender dem igen fra testogprøver.dk. Mærkatet har
   både baggrund og tekstfarve sat, så det kan læses i begge temaer. */
.rs-opgave {
    display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase; padding: 3px 9px; border-radius: 4px; color: #17213a;
    background: var(--rs-farve, #dfe5ee); border: 1px solid rgba(23, 33, 58, 0.35); margin-bottom: 6px;
    align-self: flex-start; width: fit-content;
}
.rs-t-diktat { --rs-farve: #ffd97a; }
.rs-t-komma { --rs-farve: #bfd9f0; }
.rs-t-ord { --rs-farve: #c8e08a; }
.rs-t-ret { --rs-farve: #d4a8f5; }
.rs-t-klasse { --rs-farve: #fff4a3; }
.rs-t-gram { --rs-farve: #aeeed4; }
.rs-t-form { --rs-farve: #f6c3d8; }
.rs-kort { border-left: 6px solid var(--rs-farve, var(--line)); }

.rs-opgavefelt { display: grid; gap: 12px; margin-top: 6px; }
.rs-saetning { font-size: 1.3rem; line-height: 2.2; margin: 6px 0; }
.rs-titel { margin: 0; }
.rs-svar { display: grid; gap: 8px; }
.rs-svar .besked { margin: 0; }
.rs-kilde { margin-top: 14px; }
.rs-kilde a { color: inherit; }

/* Kommajagten: mellemrummene mellem ordene er knapper. */
.rs-hul {
    display: inline-block; min-width: 18px; height: 1.7em; padding: 0 2px; margin: 0 1px;
    vertical-align: -0.35em; border: 0; border-bottom: 2px dotted var(--muted); background: transparent;
    color: var(--accent); font-size: 1.5rem; font-weight: 800; line-height: 1; cursor: pointer; border-radius: 4px;
}
.rs-hul:hover:not(:disabled) { background: var(--surface-2); }
.rs-hul:focus-visible { outline: 2px solid var(--accent); }
.rs-hul.komma { border-bottom-color: transparent; }
.rs-hul:disabled { cursor: default; border-bottom-color: transparent; }
.rs-hul.ok { color: var(--ok-ink); }
.rs-hul.mangler { color: var(--err-ink); background: var(--err-bg); }
.rs-hul.forkert { color: var(--err-ink); text-decoration: line-through; background: var(--err-bg); }
.rs-startkomma { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 14px 0 4px; display: grid; gap: 6px; }
.rs-startkomma legend { padding: 0 4px; }
.rs-startkomma label { display: flex; gap: 8px; align-items: center; cursor: pointer; }

/* Fejljægeren: hvert ord kan trykkes på; rettelsen står over det overstregede ord. */
.rs-tekst { font-size: 1.15rem; line-height: 2.6; letter-spacing: 0.01em; }
.rs-tekstord {
    font: inherit; color: inherit; background: none; border: 0; padding: 0 1px; margin: 0;
    border-radius: 4px; cursor: pointer; line-height: inherit;
}
.rs-tekstord:hover { background: var(--surface-2); }
.rs-tekstord:focus-visible { outline: 2px solid var(--accent); }
.rs-tekstord.rettet s, .rs-facit s { color: var(--muted); text-decoration-thickness: 2px; }
.rs-tekstord.rettet b, .rs-facit b { color: #2450b8; margin-left: 3px; }
:root[data-theme="dark"] .rs-tekstord.rettet b { color: #8fb0ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rs-tekstord.rettet b { color: #8fb0ff; } }
.spil-ramme input.rs-retfelt { display: inline-block; width: auto; min-width: 0; margin: 0; line-height: 1.4; font: inherit; padding: 0 4px; border: 2px solid var(--accent); border-radius: 6px; background: var(--surface); color: var(--ink); }
.rs-facit { border-radius: 4px; padding: 0 3px; }
.rs-facit.ok { background: var(--ok-bg); }
.rs-facit.mangler { background: var(--err-bg); }
.rs-facit.falsk { background: var(--warn-bg); }
.rs-facit.ok b, .rs-facit.mangler b, .rs-facit.falsk b { color: var(--ink); }
.rs-bagfra { margin: 0 0 4px; }
.rs-status { min-height: 1.2em; margin: 0; color: var(--muted); }

/* Hvem er udenfor? og Formfælden */
.rs-firord { font-family: var(--skrift-overskrift); font-weight: 700; font-size: 1.5rem; margin: 4px 0; }
.rs-valg .chip.rs-stor { font-size: 1.1rem; padding: 8px 16px; }
.chip.ok, .rs-grund.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: var(--ok-ink); }
.chip.forkert, .rs-grund.forkert { background: var(--err-bg); color: var(--err-ink); border-color: var(--err-ink); }
.rs-grunde { display: grid; gap: 8px; }
.rs-grund { text-align: left; white-space: normal; }
.rs-formhul { display: inline-block; min-width: 4em; text-align: center; border-bottom: 2px solid var(--muted); font-weight: 700; }
.rs-formhul.ok { color: var(--ok-ink); border-color: var(--ok-ink); }
.rs-formhul.forkert { color: var(--err-ink); border-color: var(--err-ink); }

/* Ordklassedetektiven */
.rs-understreg { text-decoration-thickness: 3px; text-underline-offset: 5px; font-weight: 700; }
.rs-ordklassevalg { display: flex; flex-wrap: wrap; gap: 8px; }
.rs-test { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.rs-test summary { cursor: pointer; font-weight: 600; }
.rs-test ul { margin: 8px 0 2px; padding-left: 18px; display: grid; gap: 4px; font-size: 0.95rem; }

/* Lim eller saks */
.rs-limtop { display: grid; gap: 2px; }
.rs-limtal { margin: 0; text-align: right; color: var(--muted); }
.rs-par {
    display: flex; justify-content: center; align-items: center; gap: 14px; min-height: 92px;
    font-family: var(--skrift-overskrift); font-weight: 800; font-size: clamp(1.8rem, 7vw, 2.8rem); transition: gap 0.2s ease;
}
.rs-parmellem { color: var(--muted); font-size: 0.7em; }
.rs-par.limet { gap: 0; }
.rs-par.limet .rs-parmellem { display: none; }
.rs-par.klippet { gap: 34px; }
.rs-par.ok { color: var(--ok-ink); }
.rs-par.forkert { color: var(--err-ink); }
.rs-limknapper { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rs-limknapper .knap { font-size: 1.1rem; padding: 14px 10px; }
.rs-limbesked { text-align: center; min-height: 1.4em; margin: 0; font-weight: 600; }
.rs-limbesked.ok { color: var(--ok-ink); }
.rs-limbesked.forkert { color: var(--err-ink); }

/* Diktat på øret */
.rs-lyd { display: flex; justify-content: center; }
.rs-afspil { font-size: 1.1rem; }
.rs-diktatlinje { line-height: 2.4; }
.spil-ramme input.rs-diktatfelt {
    display: inline-block; width: auto; min-width: 0; line-height: 1.4; vertical-align: baseline;
    font: inherit; font-size: 1.15rem; padding: 2px 6px; margin: 0 3px; border: 2px solid var(--line);
    border-radius: 6px; background: var(--surface); color: var(--ink); max-width: 100%;
}
.rs-diktatfelt:focus { border-color: var(--accent); outline: none; }
.rs-diktatfelt.ok { border-color: var(--ok-ink); background: var(--ok-bg); color: var(--ok-ink); }
.rs-diktatfelt.forkert { border-color: var(--err-ink); background: var(--err-bg); color: var(--err-ink); }

/* Resultatet */
.rs-resultat { text-align: center; margin: 4px 0 14px; }
.rs-resultat strong { font-family: var(--skrift-overskrift); font-size: 3rem; }
.rs-resultat span { color: var(--muted); font-size: 1.1rem; }
.rs-fejlliste { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.rs-fejlliste li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.rs-fejlliste span { font-size: 0.95rem; color: var(--muted); }
.rs-kildeliste .liste-linje { grid-template-columns: minmax(130px, 220px) 1fr; }

/* ── Mini-prøven (/dansk/miniproeve) — opbygget som retskrivningsprøven ── */
.rs-t-intro { --rs-farve: #efc6dc; }
.rs-t-resultat { --rs-farve: #e3e8ef; }
.mp-tekstvalg { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 12px 0; }
.mp-tekstvalg p { margin: 0; }
.mp-skift { display: flex; align-items: center; gap: 8px; }
.mp-skift select { font: inherit; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.mp-delliste { list-style: none; padding: 0; margin: 10px 0 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.mp-delliste .rs-opgave { margin: 0; }
.mp-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.mp-ur { font-family: var(--skrift-overskrift); font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.mp-ur.lav { color: var(--err-ink); }
.mp-bar { display: flex; flex-wrap: wrap; border: 1px solid var(--ink); border-radius: 4px; overflow: hidden; margin-bottom: 18px; }
.mp-fane {
    flex: 1 1 96px; min-width: 0; display: grid; gap: 2px; text-align: left; padding: 8px 10px; border: 0;
    border-right: 1px solid rgba(23, 33, 58, 0.5); background: var(--rs-farve); color: #17213a; font: inherit; cursor: pointer;
}
.mp-fane:last-child { border-right: 0; }
.mp-fanenavn { font-size: 0.82rem; font-weight: 700; line-height: 1.2; }
.mp-fane small { font-size: 0.8rem; font-variant-numeric: tabular-nums; min-height: 1em; }
.mp-fane.aktiv { box-shadow: inset 0 -4px 0 #17213a; }
.mp-fane:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.mp-delnavn { margin: 0 0 4px; }
.mp-del { display: grid; gap: 12px; }
.mp-opgave { display: grid; grid-template-columns: auto auto 1fr; gap: 4px 10px; align-items: start; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.mp-opgave .rs-saetning { margin: 0; font-size: 1.15rem; line-height: 2.1; }
.mp-nr { color: var(--muted); font-variant-numeric: tabular-nums; padding-top: 0.55em; }
.mp-afspil { margin-top: 0.35em; }
.mp-lim { align-items: center; }
.mp-lim .mp-nr { padding-top: 0; }
.mp-afspil { padding: 4px 10px; }
.mp-lim { grid-template-columns: auto minmax(120px, 1fr) auto; }
.mp-limord { font-family: var(--skrift-overskrift); font-size: 1.15rem; }
.mp-facit { color: var(--ok-ink); font-weight: 700; margin-left: 6px; }
.mp-felt { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.mp-felt > * + * { margin-top: 8px; }
.mp-felt legend { padding: 0 4px; font-size: 1.05rem; }
.mp-felt p { margin: 0; }
.mp-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.mp-nav .knap:disabled { opacity: 0.4; cursor: default; }
.mp-laesetekst { font-size: 1.1rem; line-height: 1.75; max-width: 66ch; margin: 0; }
.mp-tabel { border-collapse: collapse; width: 100%; max-width: 460px; margin: 6px 0 14px; }
.mp-tabel td { padding: 6px 4px; border-bottom: 1px dashed var(--line); }
.mp-tabel .rs-opgave { margin: 0; }
.mp-tal { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
@media (max-width: 560px) {
    .mp-fane { flex-basis: 30%; }
    .mp-opgave { grid-template-columns: auto 1fr; }
    .mp-opgave .rs-saetning { grid-column: 1 / -1; }
    .mp-lim { grid-template-columns: auto 1fr; }
    .mp-lim .chips { grid-column: 1 / -1; }
}
.mp-kort { margin-bottom: 16px; display: block; }

/* ── Regnestien (rn-*) ─────────────────────────────────────────────
   Roligt og uden ur: én opgave, et stort felt, hjælp i stedet for straf. */
.regnestien h1 { margin-bottom: 4px; }
.rn-kort { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; margin-top: 18px; }
.rn-kort h2 { margin: 0 0 8px; font-size: 1.15rem; }
.rn-kort p + p { margin-top: 8px; }
.rn-tal { margin: 14px 0 0; color: var(--muted); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.rn-strenge { display: grid; gap: 18px; margin: 22px 0 14px; }
.rn-strengnavn { font-size: 0.85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 8px; }
.rn-fliste { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.rn-f { border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; background: var(--surface); display: grid; gap: 3px; align-content: start; min-height: 58px; }
.rn-fnavn { font-weight: 600; font-size: 0.92rem; line-height: 1.25; }
.rn-fstatus { font-size: 0.8rem; color: var(--muted); }
.rn-fspor { display: block; height: 5px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 3px; }
.rn-fspor i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.rn-laast { opacity: .45; background: transparent; border-style: dashed; }
.rn-klar { border-color: var(--accent); }
.rn-oever { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.rn-mestret { background: var(--ok-bg); border-color: transparent; }
.rn-sikker { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.rn-sikker .rn-fstatus { color: var(--on-accent); opacity: .85; }
.rn-sikker .rn-fstatus::before { content: "✓ "; }
.rn-begreb .rn-fnavn { font-style: italic; }

.rn-personale-raekke { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rn-personale-raekke select { font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); }
.rn-personale .knap { margin: 0; }

.rn-top { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font-size: 0.92rem; color: var(--muted); font-weight: 600; }
.rn-top a { color: var(--muted); font-weight: 400; white-space: nowrap; }
.rn-spor { height: 7px; border-radius: 5px; background: var(--surface-2); overflow: hidden; margin: 8px 0 6px; }
.rn-spor i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 5px; transition: width .4s ease; }
@media (prefers-reduced-motion: reduce) { .rn-spor i { transition: none; } }

.rn-opgave { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 26px 20px 20px; margin-top: 12px; text-align: center; }
.rn-stime { display: flex; align-items: center; gap: 14px; margin: 14px 0 18px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.rn-stime-flamme { flex: none; display: grid; place-items: center; min-width: 64px; height: 64px; padding: 0 8px; border-radius: 16px; background: color-mix(in srgb, #f59e0b 16%, var(--surface)); font: 800 1.6rem/1 var(--font-overskrift, inherit); white-space: nowrap; }
.rn-stime.rn-stime-nul .rn-stime-flamme { filter: grayscale(1); opacity: .6; }
.rn-stime-tekst { display: grid; gap: 6px; min-width: 0; flex: 1; }
.rn-stime-tekst strong { font-size: 1.05rem; }
.rn-stime-bar { display: block; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.rn-stime-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: #f59e0b; transition: width .4s ease; }
.rn-stime.rn-stime-klaret .rn-stime-bar i { background: var(--accent); }
.rn-stime-under { font-size: .9rem; color: var(--muted); }
.rn-stime-chip { margin-left: auto; margin-right: 12px; font-size: .9rem; font-weight: 700; white-space: nowrap; color: var(--ink); }
.rn-stime-chip:empty { display: none; }
.rn-nyt li.rn-nyt-stime { background: color-mix(in srgb, #f59e0b 18%, var(--surface)); font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .rn-stime-bar i { transition: none; } }
.rn-opgave { position: relative; }
.rn-hjaelpere { display: flex; justify-content: flex-end; gap: 8px; margin: -4px 0 6px; }
.rn-hjaelpere:not(:has(.rn-hjknap:not(.skjult))) { display: none; }
.rn-hjknap { font: inherit; font-size: .95rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.rn-hjknap:hover { background: var(--surface-2, var(--surface)); }
.rn-hjknap:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.rn-hjknap.rn-taler, .rn-hjknap.rn-lytter { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.rn-hjknap.rn-lytter { animation: rn-puls 1.2s ease-in-out infinite; }
@keyframes rn-puls { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 12%, transparent); } }
@media (prefers-reduced-motion: reduce) { .rn-hjknap.rn-lytter { animation: none; } }
.rn-hoert { text-align: center; color: var(--muted); margin: 10px 0 0; }
.rn-hoert b { color: var(--ink); }
.rn-feedback { position: relative; }
.rn-lyt-svar { float: right; margin: -4px 0 8px 10px; }
.rn-feedback .rn-hjaelp, .rn-feedback .rn-nyt { clear: right; }
.rn-indstillinger { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; margin-top: 14px; font-size: .9rem; color: var(--muted); }
.rn-indstillinger label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.rn-tast { display: inline-grid; place-items: center; min-width: 1.5em; height: 1.5em; margin-right: 10px; border-radius: 6px; border: 1px solid var(--line); font-size: .8em; font-weight: 700; color: var(--muted); vertical-align: middle; }
@media (hover: none) { .rn-tast, .rn-tastehint { display: none !important; } }
.rn-figur { display: flex; justify-content: center; color: var(--ink); }
.rn-figur:not(:empty) { margin-bottom: 14px; }
.rn-figur svg { max-width: 100%; height: auto; }
.rn-tekst { font-size: clamp(1.15rem, 3.4vw, 1.4rem); line-height: 1.4; margin: 0 auto 18px; max-width: 30ch; text-wrap: balance; }
.rn-tekst.rn-stykke { font-size: clamp(2.2rem, 9vw, 3.2rem); font-weight: 800; letter-spacing: .02em; max-width: none; }
.rn-felter { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.spil-ramme input.rn-input { width: 9ch; max-width: 100%; margin: 0; text-align: center; font-size: 1.6rem; font-weight: 700; padding: 10px 8px; border: 2px solid var(--accent); background: var(--surface); }
.spil-ramme input.rn-input:disabled { opacity: .7; }
.rn-rest, .rn-enhed { font-size: 1.1rem; color: var(--muted); }
.rn-valg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.rn-valg:empty { display: none; }
.rn-mulighed { font: inherit; font-weight: 600; text-align: left; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; line-height: 1.3; }
.rn-mulighed:hover:not(:disabled) { border-color: var(--accent); }
.rn-mulighed.rn-rigtig { border-color: var(--accent); background: var(--ok-bg); color: var(--ok-ink); }
.rn-mulighed.rn-galt { border-color: var(--err-ink); background: var(--err-bg); color: var(--err-ink); }
.rn-mulighed:disabled { cursor: default; }
.rn-knapper { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 18px; }
.rn-knapper .knap { min-width: 10em; }

.rn-feedback { margin-top: 14px; }
.rn-dom { font-weight: 700; font-size: 1.15rem; margin: 0 0 6px; }
.rn-dom-ok { color: var(--ok-ink); }
.rn-dom-galt { color: var(--err-ink); }
.rn-dom-vedikke { color: var(--ink); }
.rn-hjaelp:empty { display: none; }
.rn-hjaelp { background: var(--mint); border-radius: 12px; padding: 10px 14px; margin: 0; line-height: 1.5; }
.rn-nyt { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.rn-nyt li { border-radius: 10px; padding: 8px 12px; background: var(--surface-2); font-weight: 600; }
.rn-nyt-mestret, .rn-nyt-sikker, .rn-nyt-placeret { background: var(--ok-bg) !important; color: var(--ok-ink); }
.rn-nyt-mestret::before { content: "🌱 "; }
.rn-nyt-sikker::before { content: "✓ "; }
.rn-nyt-aaben::before { content: "→ "; }
@media (max-width: 420px) { .rn-valg { grid-template-columns: minmax(0, 1fr); } }

/* Regnestien fase 3: brøker skrives som tæller over nævner — i tekst, svarmuligheder og svarfelt. */
.rn-brok { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.05; margin: 0 .12em; font-size: .9em; }
.rn-brok-t { border-bottom: .09em solid currentColor; padding: 0 .18em .04em; }
.rn-brok-n { padding: .04em .18em 0; }
.rn-tekst.rn-stykke .rn-brok { font-size: .78em; }
.rn-broekfelt { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; }
.rn-broekfelt::before { content: ""; order: 1; width: 7ch; height: 3px; border-radius: 2px; background: var(--ink); }
.rn-broekfelt input:last-child { order: 2; }
.spil-ramme .rn-broekfelt input.rn-input { width: 6ch; font-size: 1.35rem; padding: 6px; }
.spil-ramme input#rn-helt.rn-input { width: 4ch; }
.rn-plusminus { font: inherit; font-size: 1.4rem; font-weight: 700; width: 2.4em; height: 2.4em; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.rn-plusminus:hover { border-color: var(--accent); }

/* ── Sprogstien (sp-*) — bygger på Regnestiens rn-* ────────────────
   Fagord med dansk ved hover/tryk, brikker til «byg sætningen», ordlisten. */
.sp-flag { font-size: .7em; vertical-align: middle; margin-left: 6px; }
.sp-fag { position: relative; border-bottom: 2px dotted var(--accent); cursor: help; font-style: italic; }
.sp-fag::after { content: attr(data-da); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap; font-style: normal; font-size: .8rem; font-weight: 600; background: var(--ink); color: var(--surface); border-radius: 8px; padding: 4px 9px; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 2; }
.sp-fag:hover::after, .sp-fag:focus-visible::after, .sp-fag.aaben::after { opacity: 1; }
.sp-fagordhint { margin-top: 10px; }
.sp-lydknap { font: inherit; font-size: 2rem; width: 3em; height: 3em; border-radius: 50%; border: 2px solid var(--accent); background: var(--surface); cursor: pointer; margin: 0 auto 14px; display: block; }
.sp-lydknap:hover { background: var(--mint); }
.spil-ramme input.sp-input { width: min(100%, 18ch); font-size: 1.4rem; text-align: center; }
.sp-byg { display: grid; gap: 12px; }
.sp-svarlinje { min-height: 56px; border: 2px dashed var(--line); border-radius: 12px; padding: 8px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; transition: border-color .2s; }
.sp-svarlinje.sp-mangler { border-color: var(--err-ink); }
.sp-tom { color: var(--muted); font-size: .9rem; }
.sp-brikker { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sp-brik { font: inherit; font-size: 1.15rem; font-weight: 600; padding: 8px 14px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.sp-brik:hover:not(:disabled) { border-color: var(--accent); }
.sp-brik-valgt { border-color: var(--accent); background: var(--mint); }
.sp-brik-brugt { opacity: .25; }
.sp-ord { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.sp-ordet { display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; align-items: center; font-size: .95rem; }
.sp-ordlyd { font: inherit; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 2px 8px; cursor: pointer; }
.sp-huskespor { display: block; width: 70px; height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.sp-husker { display: block; height: 100%; background: var(--accent); }
@media (max-width: 420px) { .sp-ordet { grid-template-columns: auto auto 1fr; } .sp-huskespor { display: none; } }

/* ── Butikken (bt-*) — penge, byttepenge og afrunding (30.10.2026) ── */
.bt-varer { display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: 8px; }
.bt-vare { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px 6px; display: grid; justify-items: center; align-content: start; gap: 2px; min-width: 86px; }
.bt-vare svg { width: 44px; height: 44px; display: block; }
.bt-vare .bt-navn { font-weight: 600; font-size: .85rem; line-height: 1.1; text-align: center; }
.bt-vare .bt-pris { background: var(--ink); color: var(--surface); font-family: var(--skrift-overskrift); font-size: .82rem; padding: 1px 7px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.bt-vare .bt-antal { font-size: .78rem; color: var(--muted); }
.bt-tilbud { background: var(--warn-bg); color: var(--warn-ink); font-size: .75rem; font-weight: 700; border-radius: 6px; padding: 1px 6px; }
.bt-spm { text-align: center; font-family: var(--skrift-overskrift); font-weight: 600; font-size: 1.15rem; margin: 4px 0 0; }
.bt-historie { text-align: center; font-size: 1.05rem; margin: 0; }
.bt-historie b { font-family: var(--skrift-overskrift); font-variant-numeric: tabular-nums; }
.bt-penge { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.bt-moent, .bt-seddel { border: 0; background: none; padding: 0; display: grid; justify-items: center; gap: 1px; font-size: .72rem; font-weight: 700; color: var(--muted); cursor: pointer; }
.bt-moent svg { width: 48px; height: 48px; }
.bt-seddel svg { width: 76px; height: 42px; }
.bt-moent:disabled, .bt-seddel:disabled { opacity: .35; cursor: default; }
.bt-disk { min-height: 58px; border: 2px dashed var(--line); border-radius: 12px; padding: 6px 8px; display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; align-items: center; }
.bt-disk .bt-tomt { color: var(--muted); font-size: .9rem; }
.bt-disk button { border: 0; background: none; padding: 0; cursor: pointer; }
.bt-disk svg { width: 34px; height: 34px; }
.bt-disk .bt-seddel-lille svg { width: 54px; height: 30px; }
.bt-disk span.bt-seddel-lille svg { width: 54px; height: 30px; }
.bt-disksum { text-align: center; font-family: var(--skrift-overskrift); font-weight: 700; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.bt-knapper { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.bt-jaNej { display: flex; justify-content: center; gap: 10px; }
.bt-jaNej .chip { font-size: 1.05rem; padding: 10px 22px; }
.bt-regl { text-align: center; color: var(--ink-2); font-size: .95rem; margin: 0; }
.bt-byttepenge { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; align-items: center; }
.bt-byttepenge svg { width: 30px; height: 30px; }
.bt-byttepenge .bt-seddel-lille svg { width: 50px; height: 28px; }
@media (max-width: 420px) { .bt-vare { min-width: 74px; padding: 6px 6px 4px; } .bt-vare svg { width: 36px; height: 36px; } }

/* Butikken ser ud som en butik (30.10.2026, Tomas): markise, træhylde, tavle-prisskilte,
   trædisk og et kasseapparat med grønt display. Træ og tavle er faste farver, der
   virker i begge temaer; teksten på dem sættes eksplicit. */
#butikken { --bt-wood: #b57f4a; --bt-wood-dark: #8a5a2b; --bt-tag: #22332a; --bt-tag-ink: #fff6d6; --bt-awning: #457f06; --bt-paper: color-mix(in srgb, var(--surface) 86%, #e9c88a); }
#butikken #start h1 { display: inline-block; background: var(--bt-tag); color: var(--bt-tag-ink); padding: 6px 22px 10px; border-radius: 14px; box-shadow: 0 5px 0 var(--bt-wood-dark); margin-bottom: 14px; }
#butikken .regnespil-opgave { position: relative; background: var(--bt-paper); border: 1px solid var(--line); border-radius: 16px; padding: 30px 14px 16px; overflow: hidden; }
#butikken .regnespil-opgave::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 14px; background: repeating-linear-gradient(90deg, var(--bt-awning) 0 22px, #ffffff 22px 44px); }
#butikken .regnespil-opgave::after { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 8px; background: radial-gradient(circle at 11px 0, var(--bt-awning) 0 8px, transparent 9px) 0 0 / 22px 8px repeat-x; }
#butikken .bt-varer { background: linear-gradient(var(--bt-wood), var(--bt-wood-dark)); border-radius: 10px; padding: 12px 10px 10px; box-shadow: inset 0 -6px 0 var(--bt-wood-dark); }
#butikken .bt-vare { border: 0; box-shadow: 0 2px 0 rgba(0,0,0,.18); }
#butikken .bt-pris { background: var(--bt-tag); color: var(--bt-tag-ink); box-shadow: 0 2px 0 var(--bt-wood-dark); }
#butikken .bt-disk { background: linear-gradient(var(--bt-wood), var(--bt-wood-dark)); border: 0; border-radius: 10px; padding: 12px 10px; box-shadow: inset 0 3px 0 rgba(255,255,255,.18), inset 0 -4px 0 rgba(0,0,0,.2); min-height: 66px; }
#butikken .bt-disk .bt-tomt { color: #fff6d6; opacity: .85; }
#butikken .bt-disksum { display: inline-block; align-self: center; background: var(--bt-tag); color: #8cd44b; border-radius: 10px; padding: 8px 18px; font-size: 1.25rem; letter-spacing: .03em; box-shadow: inset 0 0 0 3px rgba(255,255,255,.08), 0 3px 0 var(--bt-wood-dark); }
#butikken .bt-historie { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; position: relative; }
#butikken .bt-historie::after { content: ""; position: absolute; left: 28px; bottom: -8px; width: 14px; height: 14px; background: var(--surface); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: rotate(45deg); }
#butikken .bt-spm { font-size: 1.2rem; }
#butikken .svarfelt { background: var(--surface); }
#butikken .keypad { background: var(--surface); border-radius: 12px; padding: 6px; }

/* Sprogstien · dansk (30.10.2026): komma-opgaven — ordene som brikker med et trykfelt imellem. */
.sp-komma { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 0; font-size: 1.2rem; line-height: 1.5; margin-bottom: 14px; }
.sp-kommaord { padding: 4px 2px; }
.sp-kommafelt { font: inherit; width: 1.6em; height: 1.9em; margin: 0 1px; border-radius: 8px; border: 2px dashed var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 800; font-size: 1.2em; line-height: 1; }
.sp-kommafelt:hover:not(:disabled) { border-color: var(--accent); }
.sp-kommafelt.sat { border-style: solid; border-color: var(--accent); background: var(--mint); }
.sp-kommafelt:disabled { cursor: default; }
.sp-indstilling .sp-valg { display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }

/* Lærerens emne på stien (sti_emner): det, klassen arbejder med lige nu. */
.rn-emner { margin: 14px 0 0; }
.rn-emne { margin: 0 0 6px; padding: 8px 12px; border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card, transparent)); border-radius: 6px; font-size: 0.95rem; }
.rn-emne strong { font-weight: 650; }

/* ── Mig, figuren og Klinkeboden (31.10.2026) ─────────────────────────── */
.elevfigur { display: inline-block; vertical-align: middle; border-radius: 12px; }
.elevfigur-mini { border-radius: 8px; }
.top-mig { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; padding: 2px 8px 2px 2px; border-radius: 999px; }
.top-mig:hover { background: var(--surface-2, var(--surface)); }
.klinker-badge { font-size: 0.85rem; font-weight: 600; color: var(--ink); background: color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.klinker-stor { font-size: 1.6rem; font-weight: 700; }
.klinker-plus { color: var(--accent); font-weight: 700; }
.klinker-minus { color: var(--muted); font-weight: 700; }
.mig { max-width: 880px; margin: 0 auto; }
.mig-hoved { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; }
.mig-figur { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.mig-tekst h1 { margin: 0 0 4px; }
.mig-klinker { margin: 10px 0 6px; }
.mig-to { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mig-raekke { display: flex; gap: 12px; align-items: baseline; margin: 6px 0; flex-wrap: wrap; }
.mig-raekke > :first-child { min-width: 9em; }
.figur-topbar { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; position: sticky; top: 0; background: var(--bg); padding: 10px 0; z-index: 2; }
.figur-preview svg { border: 1px solid var(--line); }
.figur-gruppe { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; margin: 14px 0; }
.figur-gruppe legend { font-weight: 650; padding: 0 6px; }
.figur-valg { display: flex; flex-wrap: wrap; gap: 8px; }
.figur-mulighed { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 0.75rem; color: var(--muted); width: 84px; text-align: center; text-decoration: none; background: var(--surface); }
.figur-mulighed input { position: absolute; opacity: 0; width: 0; height: 0; }
.figur-mulighed.valgt { border-color: var(--accent); color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.figur-mulighed.laast { opacity: .55; filter: grayscale(.6); }
.figur-mulighed.laast:hover { opacity: .9; }
.figur-mulighed:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.boden-hoved { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.boden-gruppe h2 { margin: 18px 0 8px; font-size: 1.1rem; }
.boden-varer { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.boden-vare { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: center; font-size: 0.85rem; }
.boden-vare.ejet { border-color: var(--accent); }
.boden-vare.for-dyr { opacity: .7; }
.knap-lille { padding: 4px 12px; font-size: 0.9rem; }
.online-figur { width: 26px; height: 26px; border-radius: 6px; vertical-align: middle; margin-right: 6px; }
.udf-figur { display: block; margin: 0 auto 8px; }
.kamp-figur { width: 28px; height: 28px; border-radius: 6px; vertical-align: middle; margin-right: 6px; }
@media (max-width: 640px) {
    .mig-hoved, .mig-to, .figur-topbar { grid-template-columns: 1fr; }
    .top-mig .brugernavn { display: none; }
}

.start-valg { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 16px; }
.start-kort { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.figur-mulighed svg { width: 56px; height: 56px; }

/* ── Hold og admin (2.11.2026) ────────────────────────────── */

.top-links { display: flex; gap: 4px; }
.top-links a {
    text-decoration: none;
    color: var(--ink-2);
    font-weight: 600;
    font-size: 0.92rem;
    padding: 6px 10px;
    border-radius: 8px;
}
.top-links a:hover, .top-links a.aktiv { background: var(--surface-2); color: var(--accent); }

.side-hoved { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.side-hoved h1 { margin: 0; }
.tilbage { display: inline-block; margin-bottom: 8px; font-size: 0.9rem; }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 18px 20px;
    margin-bottom: 18px;
}
.panel h2 { margin-bottom: 10px; }
.panel-to { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.panel-to .panel { margin-bottom: 0; }

.formular { display: flex; flex-direction: column; gap: 8px; }
.formular label, .rollevalg legend { font-family: var(--skrift-overskrift); font-weight: 600; font-size: 0.9rem; }
.formular input[type="text"], .formular input[type="search"], .formular input[type="date"], .formular input[type="number"],
.formular select, .formular textarea,
.linjeform input[type="text"], .linjeform input[type="search"], .linjeform input[type="number"], .linjeform select {
    font: inherit;
    color: var(--ink);
    background: var(--bg);
    border: 1.5px solid var(--line);
    border-radius: 9px;
    padding: 8px 11px;
}
.formular textarea { min-height: 150px; resize: vertical; }
.formular input:focus, .formular select:focus, .formular textarea:focus,
.linjeform input:focus, .linjeform select:focus { outline: 2px solid var(--accent); border-color: transparent; }
.formular .knap { align-self: flex-start; }
.linjeform { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.linjeform input[type="text"], .linjeform input[type="search"] { flex: 1 1 180px; min-width: 0; }

.rollevalg { border: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 6px; }
.rollevalg-mulighed { display: flex; align-items: center; gap: 8px; font-weight: 400; }

.holdkode {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: var(--accent);
}

.tabel-ramme { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.data-tabel { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-tabel th, .data-tabel td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.data-tabel th { font-family: var(--skrift-overskrift); font-size: 0.8rem; color: var(--muted); font-weight: 600; white-space: nowrap; background: var(--surface-2); }
.data-tabel tr:last-child td { border-bottom: none; }
.data-tabel td.tal, .data-tabel th.tal { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-tabel td.tid { white-space: nowrap; }
.data-tabel .navn-celle { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.data-tabel .navn-celle svg { width: 30px; height: 30px; flex: 0 0 auto; }
.data-tabel .handlinger { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.data-tabel form { margin: 0; }
.ingen { color: var(--muted); }

.maerke { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 0.75rem; font-weight: 700; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.maerke-admin { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.maerke-fast { background: var(--err-bg); color: var(--err-ink); border-color: transparent; }
.maerke-hurtig { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }
.maerke-rykker { background: var(--ok-bg); color: var(--ok-ink); border-color: transparent; }

.tal-kort { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.tal-kort div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.tal-kort strong { display: block; font-family: var(--skrift-overskrift); font-size: 1.7rem; line-height: 1.1; }
.tal-kort span { color: var(--muted); font-size: 0.85rem; }

.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.admin-nav a { text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: 0.9rem; background: var(--surface); }
.admin-nav a.aktiv { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.sideskift { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.knap-fare { background: var(--err-bg); color: var(--err-ink); border: 1px solid var(--err-ink); }
.detaljer-form summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 0.9rem; }
.detaljer-form[open] summary { margin-bottom: 10px; }

/* Lektier (2.11.2026): fremdriftsbjælke og elevens lektiekort. */
.linjeform input[type="number"] { width: 90px; flex: 0 0 auto; }
.bjaelke { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bjaelke > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bjaelke.faerdig > span { background: var(--green); }
.lektier { display: grid; gap: 10px; margin-bottom: 22px; }
.lektie-kort { display: grid; gap: 6px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.lektie-kort.faerdig { border-color: var(--green); }
.lektie-kort h3 { margin: 0; font-size: 1.05rem; }
.lektie-kort p { margin: 0; }
.lektie-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lektie-bund { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.9rem; }
/* .formular sætter display: flex, som ellers ville vinde over hidden-attributten. */
#lektie-emne-felt[hidden] { display: none; }

