/* Ingen eksterne skrifttyper eller netværksafhængigheder. */
:root {
  color-scheme: dark;
  --bg: #10171e;
  --bg2: #151f29;
  --panel: #1b2732;
  --line: rgba(230,238,243,.16);
  --muted: #9eabb5;
  --text: #f3f5f4;
  --lime: #d7f274;
  --lime-ink: #17210d;
  --amber: #f6b861;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { height: 100%; background: var(--bg); font-size: 16px; }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .35; cursor: not-allowed; }
a { color: var(--lime); }
[hidden], .screen[hidden], .stage-image[hidden], .answer-panel[hidden], .toast[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--lime); outline-offset: 4px; }
.screen { min-height: 100dvh; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .75rem; border: 1px solid transparent;
  border-radius: .8rem; padding: .85rem 1.2rem;
  font-weight: 750; line-height: 1.25;
  text-decoration: none; user-select: none;
  transition: background .15s ease, border-color .15s ease, transform .12s ease;
}
.button:active:not(:disabled) { transform: scale(.985); }
.button.primary { background: var(--lime); color: var(--lime-ink); }
.button.primary:hover { background: #e5ff8b; }
.button.subtle { background: #27333f; color: var(--text); }
.button.subtle:hover, .button.secondary:hover { background: #344350; }
.button.secondary { background: #283541; color: #f0f5f4; }
.button.outline { background: transparent; color: var(--text); border-color: var(--line); }
.button.outline:hover { border-color: #a4c270; background: #202c35; }
.button.large { min-height: 3.8rem; padding: 1rem 1.7rem; font-size:1.07rem; }
.button.small { padding: .68rem .86rem; font-size:1rem; }
.eyebrow { display: flex; align-items: center; gap: 1rem; color: var(--lime); letter-spacing: .17em; font-size:1rem; font-weight: 800; }
.eyebrow-line { display:inline-block; height: 1px; width: 2.6rem; background: var(--lime); }

/* Forside */
.landing { position: relative; overflow: hidden; display: flex; flex-direction: column; isolation: isolate; }
.landing-glow {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at 79% 35%, rgba(200,237,103,.13), transparent 42%),
              radial-gradient(ellipse at 12% 90%, rgba(66,135,127,.13), transparent 50%),
              repeating-linear-gradient(125deg, transparent, transparent 110px, rgba(255,255,255,.009) 111px, transparent 112px);
}
.site-header {
  width: 100%; display: flex; align-items: center; gap: .8rem;
  padding: 1.55rem clamp(1.25rem,5vw,5rem); border-bottom: 1px solid var(--line);
}
.brand-mark {
  display: grid; place-items: center; width: 2.25rem; height: 2.25rem; flex: 0 0 auto;
  border-radius: .52rem; background: var(--lime); color: var(--lime-ink);
  font-size:1.4rem; font-weight: 950; transform: rotate(-8deg);
}
.brand-text { font-size:1rem; letter-spacing: .07em; font-weight: 950; }
.brand-text span { color: var(--lime); }
.site-edition { margin-left: auto; color: var(--muted); letter-spacing: .16em; font-size:1rem; font-weight: 700; }
.landing-content { width: min(1100px, 100%); margin: auto; padding: 3rem clamp(1.5rem,6vw,5rem) 4rem; }
.landing h1, .finish h1 {
  max-width: 950px; margin: 1.4rem 0;
  font-size:clamp(3rem,7.8vw,7.4rem); line-height: .99; letter-spacing: -.065em; font-weight: 860;
}
.landing h1 em { color: var(--lime); font-style: normal; }
.landing-sub { max-width: 640px; color: #c3ced5; font-size:clamp(1.05rem,1.7vw,1.35rem); line-height: 1.55; }
.start-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.5rem; }
.landing-stats { display: flex; flex-wrap: wrap; gap: clamp(1.5rem,4vw,4rem); margin-top: clamp(2.5rem,6vw,6rem); padding-top: 1.7rem; border-top: 1px solid var(--line); }
.landing-stats>div { display: flex; flex-direction: column; gap: .3rem; }
.landing-stats strong { color: var(--text); font-size:clamp(1.4rem,2.3vw,2.25rem); font-weight: 850; }
.landing-stats span { color: var(--muted); font-size:1rem; }
.landing-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: 1rem clamp(1.25rem,5vw,5rem); border-top: 1px solid var(--line); color: var(--muted); font-size:1rem; }
.landing-foot .admin-entry { color: inherit; text-decoration: none; font: inherit; }
.landing-foot .admin-entry:hover { text-decoration: underline; }
.landing-foot .admin-entry:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

/* Live player; no image title is visible before final reveal */
.player {
  display: flex; flex-direction: column;
  min-height: 100dvh; height: 100dvh; overflow: hidden;
  background: #0d141b;
}
.player-header {
  display: flex; justify-content: space-between; align-items: center;
  gap: .8rem; padding: .75rem clamp(1rem,2vw,2.25rem);
  border-bottom: 1px solid var(--line); min-height: 3.9rem;
}
.player-counter { min-width: 11.5rem; font-size:clamp(1rem,1.15vw,1rem); color: #bec9cf; letter-spacing: .11em; font-weight: 800; white-space: nowrap; }
.stage-progress { display: flex; align-items: center; gap: .55rem; }
.stage-dot { width: clamp(1.2rem,4vw,2.6rem); height: .35rem; background: #344450; border-radius: 99px; }
.stage-dot.done { background: #81985b; }
.stage-dot.current { background: var(--lime); box-shadow: 0 0 13px #c1dc6f55; }
.player-top-actions { display: flex; align-items: center; gap: .5rem; justify-content: end; min-width: 11.5rem; }
.icon-button { color: #bac6cd; background: transparent; border: 1px solid var(--line); width: 2.4rem; height: 2.4rem; border-radius: .65rem; font-size:1.15rem; display: grid; place-items: center; }
.icon-button:hover { color: white; background: #2b3944; }
.slide { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: .7rem clamp(.7rem,2vw,1.8rem); gap: .7rem; }
.media-panel {
  position: relative; display: flex; align-items: center; justify-content: center;
  flex: 1 1 auto; min-height: 0; overflow: hidden;
  border: 1px solid #263440; border-radius: 1rem; background: #101b24;
}
.media-panel::before { content:""; pointer-events:none; position:absolute; inset:0; background: radial-gradient(circle at center, rgba(155,170,161,.05), transparent 70%); }
.stage-image { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; position: relative; }
.stage-crop { display:block; width:100%; height:100%; max-width:100%; max-height:100%; position:relative; }
.stage-crop[hidden] { display:none !important; }
.stage-placeholder { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; width: 100%; height: 100%; padding: 2rem; gap: .75rem; }
.placeholder-symbol { display: grid; place-items: center; width: 5rem; height: 5rem; border-radius: 1.1rem; background: #293a43; color: #9baeb5; font-size:3.2rem; margin-bottom: .6rem; }
.stage-placeholder strong { font-size:clamp(1.1rem,2.6vw,1.75rem); font-weight: 750; color: #e7eeee; }
.placeholder-caption { font-size:clamp(1rem,1.5vw,1.05rem); line-height: 1.5; color: var(--muted); max-width: 25rem; }
.answer-panel {
  flex: 0 0 auto; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .25rem 1.5rem;
  background: #1b2933; border: 1px solid #405052; border-radius: .9rem;
  padding: clamp(.85rem,1.6vh,1.2rem) clamp(1rem,2vw,1.5rem);
  max-height: min(44vh,30rem); overflow-y: auto;
}
.answer-kicker { grid-column: 1/-1; color: var(--lime); font-weight: 800; letter-spacing: .17em; font-size:1rem; }
.answer-panel h2 { grid-column: 1; font-size:clamp(1.65rem,2.7vw,2.9rem); line-height: 1.12; letter-spacing: -.02em; margin: .15rem 0; color: #fff; }
.answer-meta { grid-column: 1; font-size:clamp(1rem,1.35vw,1.4rem); color: #e4edf0; line-height: 1.35; }
.answer-anecdote { grid-column: 1; margin: .45rem 0 .3rem; line-height: 1.42; font-size:clamp(1.04rem,1.55vw,1.65rem); max-width: 75ch; color: #f4f8f8; }
.button.bonus { grid-row: 2/span 3; grid-column: 2; align-self: end; background: #2b3f46; color: var(--text); border-color: var(--line); font-size:1rem; padding: .75rem .85rem; }
.player-footer {
  flex: 0 0 auto; padding: .8rem clamp(.8rem,2vw,2.2rem) calc(.8rem + var(--safe-bottom));
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem;
  border-top: 1px solid var(--line);
}
.player-footer .button { min-height: 3.1rem; width: fit-content; }
.player-footer .button.next { justify-self: end; min-width: 11.5rem; }
.stage-label { display: flex; flex-direction: column; gap: .1rem; align-items: center; text-align: center; }
.stage-label span { font-size:1rem; letter-spacing: .2em; color: var(--muted); font-weight: 800; }
.stage-label strong { font-size:clamp(1.15rem,2.6vw,1.7rem); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.stage-label i { color: #5e7280; font-style: normal; font-size:1rem; }

/* Order editor / pre-show */
.setup { min-height: 100dvh; background: #121b24; padding: clamp(1.2rem,3vw,3rem) clamp(1rem,3vw,3rem) 5rem; }
.content-container { max-width: 1050px; margin: 0 auto; }
.setup-header { display: flex; align-items: start; justify-content: space-between; gap: 2rem; }
.setup h1 { font-size:clamp(2.1rem,4.8vw,3.7rem); letter-spacing: -.055em; line-height: 1.05; margin: .55rem 0 1rem; }
.setup-header p { max-width: 640px; color: #b4c2ca; line-height: 1.5; }
.setup-note { margin: 1.4rem 0; padding: 1rem 1.15rem; background: #20313a; border: 1px solid #324c4e; border-radius: .8rem; }
.setup-note strong { color: var(--lime); font-size:1rem; }
.setup-note p { color: #bfcdd3; margin: .4rem 0 0; line-height: 1.45; font-size:1rem; }
.setup-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 0; }
.setup-toolbar-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.playlist { list-style: none; display: grid; gap: .48rem; padding: 0; margin: 0; }
.playlist-item { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: .7rem; padding: .6rem .85rem; background: #1d2b36; border: 1px solid var(--line); border-radius: .75rem; }
.playlist-item.muted { opacity: .58; }
.playlist-index { width: 2rem; text-align: center; font-size:1rem; color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 700; }
.playlist-name { min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.playlist-name strong { font-size:clamp(1rem,1.4vw,1rem); overflow-wrap: anywhere; }
.playlist-name small { color: var(--muted); font-size:1rem; overflow-wrap: anywhere; }
.playlist-actions { display: flex; gap: .3rem; align-items: center; }
.playlist-actions button { border: 1px solid var(--line); border-radius: .5rem; background: #293945; color: var(--text); min-width: 2.3rem; min-height: 2.3rem; font-size:1rem; }
.playlist-actions button:hover:not(:disabled) { background: #405261; }
.include-label { display: inline-flex; align-items: center; gap: .4rem; margin-left: .5rem; font-size:1rem; color: #cdd6dc; cursor: pointer; }
.include-label input { accent-color: var(--lime); width: 1.15rem; height: 1.15rem; cursor: pointer; }
.setup-bottom { display: flex; align-items: center; gap: 1rem; justify-content: space-between; flex-wrap: wrap; margin-top: 1.5rem; padding-bottom: 2rem; }
.setup-bottom p { font-size:1rem; color: var(--muted); }
.import-label { cursor: pointer; }
.finish { display: grid; place-items: center; padding: 2rem; background: radial-gradient(ellipse at 50% 40%, #283a36, var(--bg) 70%); }
.finish-inner { max-width: 950px; }
.finish h1 { font-size:clamp(3rem,7vw,6rem); }
.finish p { color: #c2cdd2; font-size:1.15rem; }
.toast { position: fixed; z-index: 10; bottom: calc(1.2rem + var(--safe-bottom)); left: 50%; transform: translateX(-50%); max-width: min(90vw,35rem); padding: .85rem 1.2rem; color: var(--text); background: #2b4240; border: 1px solid #a0b872; box-shadow: 0 15px 40px #0008; border-radius: .6rem; font-size:1rem; }
.noscript { padding: 2rem; }

@media (max-width: 640px) {
  .site-edition { display: none; }
  .site-header { padding: 1rem 1.2rem; }
  .landing-content { padding: 2.5rem 1.2rem; }
  .landing h1 { font-size:clamp(2.9rem,11vw,4.8rem); }
  .start-actions .button { flex: 1 1 100%; }
  .landing-stats { gap: 1.5rem; }
  .landing-foot { padding: 1.2rem; }
  .player-header { min-height: 3.4rem; padding: .55rem .7rem; }
  .player-counter, .player-top-actions { min-width: 0; }
  .player-counter { font-size:1rem; letter-spacing: .04em; }
  .player-top-actions { gap: .23rem; }
  .icon-button { width: 2.1rem; height: 2.1rem; font-size:1rem; }
  .stage-dot { width: 1.1rem; height: .28rem; }
  .stage-progress { gap: .2rem; }
  /* Trinnet vises også i footeren; spar plads til mindst 16px tekst. */
  .player-header .stage-progress { display: none; }
  .slide { padding: .5rem; gap: .5rem; }
  .media-panel { border-radius: .65rem; }
  .answer-panel { padding: .75rem; max-height: 49vh; display: block; }
  .answer-panel h2 { margin: .35rem 0; }
  .answer-anecdote { margin: .45rem 0; }
  .button.bonus { margin-top: .65rem; }
  .player-footer { padding: .55rem .6rem calc(.55rem + var(--safe-bottom)); gap: .35rem; }
  .player-footer .button { min-height: 2.7rem; padding: .66rem .6rem; font-size:1rem; }
  .player-footer .button.next { min-width: 0; }
  .stage-label strong { font-size:1.15rem; }
  .stage-label span { font-size:1rem; }
  .setup-header { flex-direction: column-reverse; gap: .3rem; }
  .setup-header .button { align-self: flex-start; }
  .playlist-item { padding: .55rem; gap: .35rem; }
  .playlist-item { grid-template-columns: auto minmax(0,1fr); }
  .playlist-item .playlist-actions { grid-column: 2; flex-wrap: wrap; }
  .include-label { font-size: 1rem; }
  .playlist-index { width: 1.3rem; }
  .playlist-actions button { min-width: 2rem; min-height: 2.2rem; }
  .include-label { gap: .2rem; margin-left: .2rem; font-size:1rem; }
  .include-label input { width: 1.3rem; height: 1.3rem; }
}
@media (max-height: 600px) {
  .player-header { min-height: 2.9rem; padding-top: .35rem; padding-bottom: .35rem; }
  .slide { padding-top: .35rem; padding-bottom: .35rem; }
  .player-footer { padding-top: .4rem; padding-bottom: calc(.4rem + var(--safe-bottom)); }
  .player-footer .button { min-height: 2.45rem; }
  .answer-panel { max-height: 42vh; }
  .answer-anecdote { font-size:clamp(1rem,1.6vw,1.2rem); }
}
@media (prefers-reduced-motion: reduce) { .button { transition: none; } }
