:root {
  --bg: #07111f;
  --surface: #101f33;
  --surface-2: #172b45;
  --text: #ffffff;
  --muted: #d8e2f0;
  --accent: #ffd84d;
  --accent-text: #111111;
  --good: #137a3a;
  --bad: #b91c1c;
  --skip: #b45309;
  --border: #87a3c7;
  --focus: #fff36d;
  --font-size: 18px;
  --radius: 8px;
}

[data-contrast="zwart-geel"] {
  --bg: #000000;
  --surface: #000000;
  --surface-2: #111111;
  --text: #fff36d;
  --muted: #ffffff;
  --accent: #fff36d;
  --accent-text: #000000;
  --border: #fff36d;
  --focus: #ffffff;
}

[data-contrast="zwart-wit"], [data-contrast="hoog"] {
  --bg: #000000;
  --surface: #050505;
  --surface-2: #111111;
  --text: #ffffff;
  --muted: #ffffff;
  --accent: #fff36d;
  --accent-text: #000000;
  --border: #ffffff;
}

[data-text-size="groot"] { --font-size: 22px; }
[data-text-size="extra-groot"] { --font-size: 28px; }

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font-size: var(--font-size); }
body { margin: 0; font-family: Arial, Verdana, sans-serif; line-height: 1.5; background: var(--bg); color: var(--text); }
button, input, select { font: inherit; }
a { color: var(--accent); }
:focus-visible { outline: 4px solid var(--focus); outline-offset: 4px; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 20;
  background: var(--accent);
  color: var(--accent-text);
  padding: .75rem 1rem;
  border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

.app-shell { min-height: 100vh; }
.layout { width: min(1180px, 100%); margin: 0 auto; padding: 1rem; }
.topbar { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 1rem; }
.brand { font-size: clamp(1.7rem, 5vw, 3rem); font-weight: 800; line-height: 1.1; margin: .5rem 0; }
.subtitle { color: var(--muted); max-width: 70ch; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.panel, .card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.panel h2, .panel h3 { margin-top: 0; }
.statusbar { background: var(--surface-2); border: 3px solid var(--accent); padding: 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.button, button {
  min-height: 56px;
  min-width: 56px;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  padding: .75rem 1rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}
button.secondary, .button.secondary { background: transparent; color: var(--text); border-color: var(--border); }
button.danger { background: var(--bad); color: white; border-color: white; }
button.good { background: var(--good); color: white; border-color: white; }
button.skip { background: var(--skip); color: white; border-color: white; }
button:disabled { opacity: .55; cursor: not-allowed; }

label { display: block; font-weight: 800; margin: .75rem 0 .25rem; }
input, select {
  width: 100%;
  min-height: 56px;
  padding: .75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
}
input[type="checkbox"] { width: 1.4rem; min-height: 1.4rem; margin-right: .5rem; }
.checkline { display: flex; align-items: center; gap: .5rem; font-weight: 800; margin: .75rem 0; }
.room-code { font-size: clamp(2rem, 12vw, 5rem); font-weight: 900; letter-spacing: .08em; color: var(--accent); margin: .25rem 0; }
.timer { font-size: clamp(3rem, 18vw, 8rem); font-weight: 900; line-height: 1; color: var(--accent); }
.score-list, .player-list, .word-list, .history-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.score-item, .player-item, .word-item, .history-item { border: 2px solid var(--border); border-radius: var(--radius); padding: .75rem; background: var(--surface-2); }
.word-row { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.word-name { font-size: 1.35rem; font-weight: 900; }
.status-label { display: inline-block; padding: .2rem .55rem; border: 2px solid currentColor; border-radius: 999px; font-weight: 800; }
.notice { border-left: 8px solid var(--accent); padding: .75rem 1rem; background: var(--surface-2); margin: .75rem 0; }
.error { border-color: #ffb4b4; background: #4a1010; color: #ffffff; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; }
.kbd { border: 2px solid var(--border); padding: .1rem .4rem; border-radius: 4px; background: var(--bg); font-weight: 800; }

@media (min-width: 760px) {
  .word-row { grid-template-columns: minmax(180px, 1fr) auto; align-items: center; }
  .sticky-controls { position: sticky; bottom: 0; background: var(--bg); padding: .75rem 0; border-top: 2px solid var(--border); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
