/* Layout: én smal kolonne; et grønt topbånd og en scorekortstrimmel som fast navigation */
:root {
  --bg: #f4f6f1;
  --surface: #ffffff;
  --fg: #17241c;
  --muted: #5a6a5f;
  --line: #d6ddd3;
  --green: #1d5a38;
  --green-ink: #ffffff;
  --band: #1d5a38;
  --band-fg: #f1f5ef;
  --flag: #e2b22b;
  --ok: #1f7a46;
  --ok-bg: #e5f2e9;
  --bad: #b3261e;
  --bad-bg: #fbe9e7;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1611;
    --surface: #152019;
    --fg: #e5ede6;
    --muted: #9aae9f;
    --line: #2a3a30;
    --green: #5fb784;
    --green-ink: #0e1611;
    --band: #133a25;
    --band-fg: #e5ede6;
    --flag: #e8c35a;
    --ok: #6cc893;
    --ok-bg: #173023;
    --bad: #f08074;
    --bad-bg: #3a1c19;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 var(--font-body);
}
[hidden] { display: none !important; }

.wrap {
  max-width: 44rem;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* Topbånd */
.band { background: var(--band); color: var(--band-fg); border-bottom: 4px solid var(--flag); }
.band-inner { padding-block: 2.25rem 2rem; }
.eyebrow {
  margin: 0 0 .35rem;
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: .85;
}
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; line-height: 1.2; }
h1 { margin: 0; font-size: clamp(2rem, 6vw, 2.75rem); font-weight: 600; }
h2 { margin: 0 0 1rem; font-size: 1.45rem; font-weight: 600; }
.lede { margin: .6rem 0 0; max-width: 34rem; opacity: .92; }

main { padding-block: 1.75rem 2rem; display: grid; gap: 1.5rem; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.5rem;
}

/* Formular */
form { display: grid; gap: 1.1rem; }
.field { display: grid; gap: .35rem; }
label { font-weight: 600; }
input[type="text"] {
  font: inherit;
  padding: .7rem .8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--fg);
  width: 100%;
}
input[type="text"]:focus-visible { outline: 3px solid var(--flag); outline-offset: 1px; border-color: var(--green); }
.hint { margin: 0; font-size: .88rem; color: var(--muted); }
.privacy { margin: 1.25rem 0 0; font-size: .85rem; color: var(--muted); }
.error { margin: 0; color: var(--bad); font-weight: 600; }

.btn {
  font: inherit;
  font-weight: 600;
  padding: .75rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
  justify-self: start;
}
.btn.primary { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.btn:hover { filter: brightness(1.06); }
.btn:focus-visible { outline: 3px solid var(--flag); outline-offset: 2px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Scorekortstrimmel */
#quiz { display: grid; gap: 1.25rem; }
.card-strip {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  padding-block: .75rem;
  border-bottom: 1px solid var(--line);
}
.strip-head { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; margin-bottom: .5rem; }
.player { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.count { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}
.strip li { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.strip li:nth-child(10n) { border-right: 0; }
.strip li:nth-last-child(-n+10) { border-bottom: 0; }
.strip a {
  display: block;
  text-align: center;
  padding: .3rem 0;
  font: 600 .82rem/1.4 var(--font-num);
  color: var(--muted);
  text-decoration: none;
}
.strip a:focus-visible { outline: 2px solid var(--flag); outline-offset: -2px; }
.strip .answered a { background: var(--green); color: var(--green-ink); }
.strip .wrong a { background: var(--bad); color: #fff; }
.strip .right a { background: var(--ok-bg); color: var(--ok); }

/* Spørgsmål */
#questions { display: grid; gap: 1rem; }
.q {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.1rem 1.25rem 1.25rem;
  scroll-margin-top: 6.5rem;
  min-width: 0;
}
.q legend { padding: 0; display: contents; }
.q-num {
  display: block;
  font: 600 .78rem/1 var(--font-num);
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: .45rem;
}
.q-text { display: block; font-weight: 600; font-size: 1.05rem; margin-bottom: .8rem; }
.opts { display: grid; gap: .45rem; }
.opt {
  display: flex;
  gap: .7rem;
  align-items: flex-start;
  padding: .6rem .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 400;
}
.opt:hover { border-color: var(--green); }
.opt input { margin: .3rem 0 0; accent-color: var(--green); flex: none; width: 1.05rem; height: 1.05rem; }
.opt:has(input:checked) { border-color: var(--green); background: color-mix(in srgb, var(--green) 9%, transparent); }
.opt:has(input:focus-visible) { outline: 3px solid var(--flag); outline-offset: 1px; }

.q.is-wrong { border-color: var(--bad); box-shadow: inset 4px 0 0 var(--bad); }
.q.is-right { opacity: .7; }
.q.is-right .opt { cursor: default; }
.q-flag { margin: .8rem 0 0; font-size: .9rem; color: var(--bad); font-weight: 600; }

.submit-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .5rem; }

.feedback {
  scroll-margin-top: 7rem;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  background: var(--bad-bg);
  border: 1px solid var(--bad);
}
.feedback strong { display: block; font-size: 1.05rem; }

/* Bestået */
#done { display: grid; gap: 1.25rem; }
.success { border-color: var(--ok); background: var(--ok-bg); }
.success .eyebrow { color: var(--ok); }
.success p:last-child { margin-bottom: 0; }
.sub { margin: .5rem 0 0; font-size: 1.2rem; }
.review { margin: 0; padding-left: 1.6rem; display: grid; gap: .9rem; }
.review li { padding-left: .25rem; }
.review li::marker { font-family: var(--font-num); color: var(--muted); }
.review .rq { font-weight: 600; display: block; }
.review .ra { color: var(--ok); font-weight: 600; display: block; }
.review .rx { color: var(--muted); display: block; font-size: .93rem; }

.foot { padding-block: 0 2rem; font-size: .82rem; color: var(--muted); }

@media (max-width: 30rem) {
  .panel { padding: 1.15rem; }
  .q { padding: 1rem; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
