/* styles.css — Vervang je volledige stylesheet. Gebruik je huidige index.html met het ingebouwde spel. */

:root {
  color-scheme: dark;
  --bg: #0a0a16;
  --surface: #121327;
  --panel: #151730;
  --line: #454569;
  --grid: #a3a4ed13;
  --text: #f0effb;
  --muted: #b6b9d1;
  --mint: #84ecd1;
  --violet: #c5b5ff;
  --amber: #ffcd8b;
  --error: #ffb1b8;
  --ink: #081e1b;
  --mono: "Lucida Console", "Courier New", monospace;
  --frame: min(1120px, calc(100% - 48px));
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 16px; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    repeating-linear-gradient(0deg, #0809132b 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at 50% 11%, #262343, transparent 39rem),
    linear-gradient(180deg, #101021, var(--bg) 78%);
}

a { color: inherit; text-underline-offset: .24em; }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
[hidden] { display: none !important; }
.wrap { width: var(--frame); margin-inline: auto; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2, h3 { line-height: 1.12; }

.skip {
  position: fixed;
  z-index: 20;
  top: 10px;
  left: 10px;
  padding: 8px 12px;
  background: var(--mint);
  color: var(--ink);
  transform: translateY(-180%);
}

.skip:focus { transform: translateY(0); }
.top { background: #0c0d19e8; border-bottom: 1px solid #353653; }

.bar, .navigation, .game-header, .question-meta, .game-actions, .dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bar { min-height: 61px; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font: 900 clamp(1.05rem, 3vw, 1.48rem)/1 var(--mono);
  letter-spacing: -.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-period { margin-left: -8px; color: var(--mint); }

.brand-mark {
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  background: var(--mint);
  clip-path: polygon(
    42% 0, 58% 0, 58% 29%, 71% 29%, 71% 42%, 100% 42%, 100% 58%,
    71% 58%, 71% 71%, 58% 71%, 58% 100%, 42% 100%, 42% 71%, 29% 71%,
    29% 58%, 0 58%, 0 42%, 29% 42%, 29% 29%, 42% 29%
  );
}

.navigation { gap: clamp(10px, 3vw, 25px); }
.navigation a { color: var(--muted); font: 700 .8rem/1.3 var(--mono); text-decoration: none; }
.navigation a:hover, .how-link:hover, .back-top:hover { color: var(--mint); }

.button, .outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font: 700 .84rem/1.3 var(--mono);
  text-align: center;
  text-decoration: none;
}

.button {
  border-color: var(--mint);
  color: var(--ink);
  background: var(--mint);
  box-shadow: inset 0 0 0 2px #194b4059;
}

.button:hover:not(:disabled) { background: #b3ffe9; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { border-color: #4a506c; color: #b5bbd1; background: #272d46; box-shadow: none; }
.outline { color: var(--text); background: #17192e; }
.outline:hover { border-color: var(--violet); background: #242642; }
.stats-button { min-height: 38px; padding-inline: 9px; }

.stats-icon {
  width: 13px;
  height: 12px;
  background:
    linear-gradient(var(--mint), var(--mint)) left bottom / 3px 4px no-repeat,
    linear-gradient(var(--mint), var(--mint)) center bottom / 3px 8px no-repeat,
    linear-gradient(var(--mint), var(--mint)) right bottom / 3px 12px no-repeat;
}

/* Observatory */

.masthead {
  position: relative;
  padding-bottom: 42px;
  background:
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 48px);
  border-inline: 1px solid var(--grid);
}

.intro {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(30px, 5vw, 55px) 12px clamp(23px, 4vw, 36px);
  text-align: center;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--violet);
  font: 700 .73rem/1.4 var(--mono);
  letter-spacing: .13em;
  text-transform: uppercase;
}

.eyebrow > span {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}

.intro .eyebrow { justify-content: center; }

.intro h1 {
  margin: 10px auto 12px;
  color: var(--text);
  font: 900 clamp(2.35rem, 7vw, 5.55rem)/.98 var(--mono);
  letter-spacing: -.1em;
  text-transform: uppercase;
  text-shadow: 3px 3px #4d3e80;
}

.intro h1 br { display: none; }
.intro h1 em { color: var(--mint); font-style: normal; text-shadow: 3px 3px #204436; }
.intro h1 em::before { content: " "; }
.lead { max-width: 46ch; margin-inline: auto; color: var(--muted); font-size: clamp(.9rem, 2vw, 1rem); }
.how-link { display: inline-block; margin-top: 9px; padding: 6px; color: var(--amber); font: 700 .75rem/1.4 var(--mono); }
.art { position: absolute; z-index: -1; inset: 0; overflow: hidden; pointer-events: none; }

.art-grid {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 8% 29%, #c5b5ff 1px, transparent 1.6px),
    radial-gradient(circle at 18% 68%, #84ecd1 1px, transparent 1.7px),
    radial-gradient(circle at 33% 18%, #d7cefb 1px, transparent 1.7px),
    radial-gradient(circle at 61% 83%, #c5b5ff 1px, transparent 1.7px),
    radial-gradient(circle at 72% 17%, #84ecd1 1px, transparent 1.7px),
    radial-gradient(circle at 87% 73%, #c5b5ff 1px, transparent 1.7px),
    radial-gradient(circle at 94% 24%, #ffcd8b 1px, transparent 1.7px);
}

.art-axis {
  position: absolute;
  top: 67%;
  left: 8%;
  width: 84%;
  height: 1px;
  background: repeating-linear-gradient(90deg, #b4a1dd69 0 3px, transparent 3px 10px);
  transform: rotate(-8deg);
}

.orbit {
  position: absolute;
  width: 37%;
  height: 61%;
  border: 1px solid #a48fe145;
  border-radius: 50%;
  transform: rotate(-25deg);
}

.orbit-wide { top: 25%; left: -12%; }
.orbit-narrow { top: 36%; left: -8%; width: 28%; height: 47%; border-style: dashed; }
.orbit-cross { top: 5%; right: -11%; border-color: #86decb53; transform: rotate(29deg); }
.planet { position: absolute; aspect-ratio: 1; }

.planet-purple {
  top: 43%;
  left: 8%;
  width: clamp(34px, 8.5vw, 94px);
  background:
    repeating-linear-gradient(0deg, #12132540 0 2px, transparent 2px 6px),
    radial-gradient(circle at 30% 23%, #c1a8ff, #826bbb 35%, #4a3c79 61%, #241d4d 85%);
  clip-path: polygon(
    28% 0, 72% 0, 72% 10%, 87% 10%, 87% 24%, 100% 24%, 100% 76%, 87% 76%,
    87% 90%, 72% 90%, 72% 100%, 28% 100%, 28% 90%, 13% 90%, 13% 76%, 0 76%,
    0 24%, 13% 24%, 13% 10%, 28% 10%
  );
}

.planet-lime {
  top: 27%;
  right: 9%;
  width: clamp(24px, 5.4vw, 60px);
  background: linear-gradient(135deg, #e5fff5 4%, #88e5d0 28%, #428687 58%, #315063 83%);
  clip-path: polygon(
    40% 0, 60% 0, 60% 20%, 80% 20%, 80% 40%, 100% 40%, 100% 60%,
    80% 60%, 80% 80%, 60% 80%, 60% 100%, 40% 100%, 40% 80%, 20% 80%,
    20% 60%, 0 60%, 0 40%, 20% 40%, 20% 20%, 40% 20%
  );
}

.art-spark { position: absolute; color: #c0adf6b3; font: normal 1rem var(--mono); }
.art-spark-one { top: 25%; left: 14%; }
.art-spark-two { top: 62%; right: 16%; }
.art-spark-three { top: 78%; left: 26%; }

/* Quiz console */

.play {
  width: min(720px, calc(100% - 28px));
  margin-inline: auto;
  padding: clamp(12px, 2.8vw, 23px);
  border: 1px solid var(--line);
  color: var(--text);
  background:
    repeating-linear-gradient(0deg, #00000011 0 1px, transparent 1px 4px),
    linear-gradient(135deg, #1d1b37, #111326 65%);
  box-shadow: 0 0 0 4px #0e1020, 7px 10px 0 #070813b8;
}

.game-header {
  align-items: end;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 10px;
}

.edition {
  margin-bottom: 4px;
  color: var(--violet);
  font: 700 .73rem/1.35 var(--mono);
  text-transform: uppercase;
}

.game-header h2, .guide h2, .faq h2 {
  font: 800 clamp(1.25rem, 3vw, 1.95rem)/1.12 var(--mono);
  letter-spacing: -.05em;
}

.timer {
  flex: 0 0 auto;
  min-width: 94px;
  padding: 4px 7px;
  border: 1px dashed #646888;
  color: var(--muted);
  background: #0d1020;
  text-align: center;
  font-size: .69rem;
}

.timer time {
  display: block;
  color: var(--mint);
  font: 700 .89rem/1.4 var(--mono);
  font-variant-numeric: tabular-nums;
}

.game-hud { display: flex; align-items: stretch; gap: 6px; margin-bottom: 9px; }

.rounds {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}

.round, .running-score {
  min-width: 0;
  min-height: 42px;
  padding: 4px;
  border: 1px solid #45496c;
  border-radius: 2px;
  color: var(--muted);
  background: #101227;
  text-align: center;
}

.round span { display: block; line-height: 1.2; }
.round span:first-child { font: 700 .77rem/1.35 var(--mono); }
.round .round-topic { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .65rem; }
.round[aria-current="step"] { border-color: var(--violet); color: var(--text); background: #2a2545; }
.round.done { color: var(--mint); }
.round:not(:disabled):hover { border-color: var(--mint); }
.running-score { display: grid; align-content: center; min-width: 84px; padding-inline: 6px; font-size: .66rem; }
.running-score strong { font: 700 .77rem/1.35 var(--mono); color: var(--mint); }

.panel {
  min-width: 0;
  padding: clamp(12px, 2.6vw, 21px);
  border: 1px solid var(--line);
  background: var(--panel);
}

.question { --topic-ink: var(--violet); }
.question-meta { color: var(--muted); font: .73rem/1.4 var(--mono); }

.topic {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--topic-ink);
  font-weight: 700;
  text-transform: uppercase;
}

.topic::before { content: ""; width: 6px; height: 6px; background: currentColor; }

.question h3 {
  margin-top: 9px;
  font: 800 clamp(1.13rem, 3vw, 1.75rem)/1.17 var(--mono);
  letter-spacing: -.045em;
}

.goal { margin-top: 4px; color: var(--amber); font-size: .94rem; font-weight: 700; }
.context { margin-top: 5px; color: var(--muted); font-size: .8rem; }

.choice-guide {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 13px;
  color: var(--muted);
  font-size: .73rem;
  font-weight: 700;
}

.shortcut { white-space: nowrap; }
kbd { border: 1px solid #656989; padding: 0 3px; font: .68rem var(--mono); }
.options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 6px 0 11px; }

.option {
  position: relative;
  min-width: 0;
  min-height: 43px;
  padding: 7px 21px 7px 30px;
  overflow-wrap: anywhere;
  border: 1px solid #515576;
  border-radius: 2px;
  color: var(--text);
  background: #0e1225;
  text-align: left;
  font-size: .85rem;
  font-weight: 650;
  line-height: 1.25;
}

.option[data-key]::before {
  content: attr(data-key);
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font: .7rem var(--mono);
}

.option:not(:disabled):hover { border-color: var(--violet); background: #222542; }
.option[aria-pressed="true"] { border-color: var(--mint); background: #173835; }
.option[aria-pressed="true"]::before { color: var(--mint); }

.option[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mint);
}

.option[aria-invalid="true"] { border-color: var(--error); background: #3b2338; }
.option[aria-invalid="true"]::after { content: "×"; color: var(--error); }
.option:disabled:not([aria-pressed="true"]) { color: var(--muted); }
.game-actions { flex-wrap: wrap; }
.game-actions .button { margin-left: auto; }
.muted, .feedback { font-size: .81rem; }
.muted { color: var(--muted); }
.feedback { color: var(--error); margin-top: 8px; }
.feedback:empty, #share-status:empty { margin: 0; }

/* Results and Gap Map */

.reveal { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }

.score, .total {
  color: var(--mint);
  font: 900 clamp(1.6rem, 4.5vw, 3rem)/1 var(--mono);
  letter-spacing: -.09em;
}

.reveal-copy { margin-top: 6px; color: var(--muted); font-size: .84rem; }
.reveal .game-actions { margin-top: 13px; }
.source { color: var(--muted); font-size: .78rem; }

.gap-map {
  margin-top: 11px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background:
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 26px),
    #0d1426;
}

.gap-heading {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
  font: 700 .81rem/1.35 var(--mono);
}

.gap-heading span, .gap-extremes, .gap-detail { color: var(--muted); font-size: .73rem; }

.scale {
  position: relative;
  height: 5px;
  margin: 16px 6px 9px;
  background: repeating-linear-gradient(90deg, #697495 0 5px, transparent 5px 8px);
}

.scale::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 var(--start, 0%);
  width: var(--span, 0%);
  background: linear-gradient(90deg, var(--violet), var(--mint));
  box-shadow: 0 0 10px #84ecd161;
}

.gap-mark {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: var(--position);
  width: 10px;
  height: 10px;
  border: 1px solid #101426;
  background: var(--violet);
  transform: translate(-50%, -50%) rotate(45deg);
}

.gap-mark.is-picked { z-index: 2; background: var(--mint); }
.gap-mark.is-active { z-index: 3; outline: 1px solid var(--amber); outline-offset: 2px; }
.gap-extremes { display: flex; justify-content: space-between; gap: 10px; }
.gap-extremes span { width: 46%; overflow-wrap: anywhere; }
.gap-extremes span:last-child { text-align: right; }
.gap-labels { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }

.gap-chip {
  min-height: 33px;
  padding: 3px 7px;
  border: 1px solid #5b6286;
  color: var(--text);
  background: #191d36;
  font-size: .74rem;
}

.gap-chip.is-picked { color: var(--mint); border-color: var(--mint); }
.gap-chip:hover, .gap-chip[aria-pressed="true"] { color: var(--ink); background: var(--mint); }
.gap-detail { min-height: 1.4em; margin-top: 7px; }
.summary h3 { margin-top: 7px; font: 800 clamp(1.35rem, 3.8vw, 2rem)/1.1 var(--mono); }
.total { margin: 8px 0 16px; }
.breakdown, .history { list-style: none; margin: 0 0 12px; padding: 0; }

.breakdown li, .history li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding: 7px 0;
}

.breakdown li {
  --round-points: 0%;
  background: linear-gradient(90deg, var(--violet), var(--mint)) left bottom / var(--round-points) 2px no-repeat;
}

.breakdown button {
  background: transparent;
  padding: 0;
  border: 0;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breakdown strong, .history strong { color: var(--mint); white-space: nowrap; }
#share-status { margin-top: 8px; }

textarea {
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  resize: vertical;
  border: 1px solid var(--line);
  color: var(--text);
  background: #0d1122;
}

/* Rules, FAQ and stats */

.guide, .faq { border-top: 1px solid #363955; padding-block: clamp(18px, 4vw, 34px); }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.steps article { min-width: 0; padding: 13px; border: 1px solid #3e4061; background: #121428; }
.steps h3 { font: 800 1rem/1.25 var(--mono); }
.steps p, details p { margin-top: 5px; color: var(--muted); font-size: .84rem; }
.step-icon { display: inline-block; position: relative; width: 25px; height: 15px; color: var(--mint); }

.step-pair::before, .step-pair::after {
  content: "";
  position: absolute;
  top: 3px;
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}

.step-pair::before { left: 3px; }
.step-pair::after { right: 4px; }

.step-span {
  color: var(--violet);
  background:
    linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat,
    linear-gradient(currentColor, currentColor) left center / 1px 10px no-repeat,
    linear-gradient(currentColor, currentColor) right center / 1px 10px no-repeat;
}

.step-track {
  background: repeating-linear-gradient(90deg, currentColor 0 3px, transparent 3px 6px) left center / 100% 6px no-repeat;
}

.faq { display: grid; grid-template-columns: .65fr 1.35fr; gap: 16px; }
details { border-bottom: 1px solid var(--line); padding: 8px 0; }
details:first-child { border-top: 1px solid var(--line); }
summary { cursor: pointer; font-weight: 650; }
summary::marker { color: var(--violet); }
.footer { border-top: 1px solid #363955; background: #0c0d19e8; }
.footer .brand { font-size: 1rem; }
.footer .brand-mark { width: 16px; height: 16px; }
.back-top { color: var(--muted); font: 700 .78rem/1.4 var(--mono); }

dialog {
  width: min(460px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 17px;
  border: 1px solid var(--line);
  outline: 3px solid #101125;
  color: var(--text);
  background: var(--surface);
}

dialog::backdrop { background: #070810d9; }
.dialog-top h2 { font: 800 1.5rem/1.1 var(--mono); letter-spacing: -.06em; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 13px 0; }
.stats-grid div { padding: 8px; border: 1px solid var(--line); background: #101227; }
.stats-grid dt { color: var(--muted); font-size: .76rem; }
.stats-grid dd { color: var(--mint); margin: 0; font: 800 1.24rem/1.4 var(--mono); }
.history { margin-top: 8px; font-size: .85rem; }

@media (max-width: 740px) {
  :root { --frame: calc(100% - 22px); }
  .intro h1 { font-size: clamp(2.05rem, 8.2vw, 4rem); }
  .planet { opacity: .53; }
  .play { width: calc(100% - 18px); }
  .faq { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 500px) {
  .navigation > a:nth-child(2) { display: none; }
  .intro h1 br { display: initial; }
  .intro h1 em::before { content: none; }
  .planet-purple { top: 25%; left: 5%; }
  .planet-lime { top: 41%; right: 7%; }
  .round .round-topic { display: none; }
  .steps { grid-template-columns: 1fr; }
  .game-actions .button { padding-inline: 10px; }
}

@media (max-width: 365px) {
  .stats-icon { display: none; }
  .brand { gap: 5px; }
  .brand-period { margin-left: -5px; }
  .brand-mark { width: 16px; height: 16px; }
}

@media (pointer: coarse) {
  .shortcut { display: none; }
  .option, .gap-chip { min-height: 44px; }
}
