/* ── Sommen Kampioen — UI styling (geometry-highscore stijl) ─────────── */

:root {
  --bg:         #0a0a18;
  --bg2:        #14143a;
  --neon-cyan:  #00e0ff;
  --accent:       #ffbf4d;
  --accent-soft:  #ffd36a;
  --accent-glow:  rgba(255, 191, 77, 0.4);
  --neon-lime:  #b9ff3d;
  --neon-amber: #ffb83d;
  --neon-red:   #ff4d6d;
  --paper:      #ffffff;
  --dark:       #08081a;
  --dark-soft:  #1c1c34;
  --shadow:     0 6px 0 rgba(0,0,0,0.35), 0 14px 28px rgba(0,224,255,0.20);
  --shadow-soft:0 3px 0 rgba(0,0,0,0.25);
  --scale: 1;
}

*,*::before,*::after { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  color: var(--paper);
  font-family: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  background:
    radial-gradient(1200px 800px at 50% 50%, #1c1c4a 0%, #0a0a18 60%, #000 100%);
}

button { font-family: inherit; cursor: pointer; }

.app  { position: fixed; inset: 0; overflow: hidden; }
.stage {
  position: absolute;
  left: 50%; top: 50%;
  width: 800px; height: 600px;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(var(--scale));
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,224,255,0.18), 0 0 60px rgba(255, 191, 77, 0.08);
  background:
    radial-gradient(700px 500px at 50% 30%, #14143a 0%, #06061a 70%, #000 100%);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  border: 2.5px solid var(--dark);
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 900;
  font-size: 16px;
  color: var(--dark);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  transition: transform 0.1s ease, filter 0.15s ease;
  min-height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
}
.btn:hover  { filter: brightness(1.1); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,0.4); }
.btn:focus-visible { outline: 3px solid var(--neon-amber); outline-offset: 3px; }
.btn--primary { background: linear-gradient(180deg, #5cf3ff, #00a8c4); color: var(--dark); box-shadow: var(--shadow); border-color: #002b3a; }
.btn--ghost   { background: rgba(255,255,255,0.92); }
.btn--accent  { background: linear-gradient(180deg, #ffe27a, #d99c00); color: var(--dark); box-shadow: var(--shadow); border-color: #4a3500; }
.btn--big     { padding: 14px 28px; font-size: 20px; min-height: 56px; border-radius: 22px; }

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.85);
  background: rgba(20,20,58,0.85);
  color: var(--paper);
  font-size: 17px;
  display: grid; place-items: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.1s ease, background 0.15s ease;
  padding: 0;
}
.icon-btn:hover  { background: rgba(40,40,90,0.95); }
.icon-btn:active { transform: scale(0.94); }

/* ── HUD ──────────────────────────────────────────────────────────────── */
.hud {
  position: absolute;
  top: 12px; left: 12px; right: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
  z-index: 5;
  gap: 10px;
}
.hud__right { display: flex; gap: 6px; align-items: center; }
.hud__right .icon-btn,
.hud__right .hud__pill,
.hud__pill { pointer-events: auto; }
.hud__pill {
  background: rgba(10,10,30,0.72);
  border: 2px solid rgba(255,255,255,0.85);
  border-radius: 12px;
  padding: 4px 12px;
  display: flex; flex-direction: column;
  align-items: center;
  line-height: 1;
  min-width: 86px;
  box-shadow: 0 3px 0 rgba(0,0,0,0.35), 0 0 14px rgba(0,224,255,0.18);
}
.hud__pill--score  { border-color: var(--neon-cyan); }
.hud__pill--record { border-color: var(--accent); }
.hud__label { font-size: 9px; letter-spacing: 0.5px; text-transform: uppercase; color: rgba(255,255,255,0.7); font-weight: 800; }
.hud__value { font-size: 18px; font-weight: 900; color: var(--paper); margin-top: 2px; font-variant-numeric: tabular-nums; }
.hud__pill--score .hud__value  { color: var(--neon-cyan);  text-shadow: 0 0 10px rgba(0,224,255,0.6); }
.hud__pill--record .hud__value { color: var(--accent);  text-shadow: 0 0 10px rgba(255, 191, 77, 0.6); }

/* ── Speelveld ────────────────────────────────────────────────────────── */
.play {
  position: absolute;
  inset: 70px 30px 24px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 18px;
}
.play[hidden] { display: none; }

.card {
  background: linear-gradient(180deg, rgba(20,20,60,0.92) 0%, rgba(10,10,30,0.92) 100%);
  border: 2.5px solid var(--neon-cyan);
  border-radius: 22px;
  box-shadow: 0 0 24px rgba(0,224,255,0.30), 0 10px 22px rgba(0,0,0,0.45), inset 0 0 16px rgba(0,224,255,0.10);
  padding: 18px 24px;
  display: grid; place-items: center;
  min-height: 130px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card.pop      { animation: cardPop 0.28s cubic-bezier(.34,1.56,.64,1); }
.card.shake    { animation: cardShake 0.36s ease; }
@keyframes cardPop {
  0%   { transform: scale(0.94); }
  60%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}
@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-10px); }
  40%      { transform: translateX(8px); }
  60%      { transform: translateX(-6px); }
  80%      { transform: translateX(4px); }
}
.card__sum {
  font-size: 56px;
  font-weight: 900;
  letter-spacing: -1.5px;
  color: var(--paper);
  text-shadow: 0 0 16px rgba(0,224,255,0.55), 0 3px 0 rgba(0,0,0,0.45);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* ── Timer ────────────────────────────────────────────────────────────── */
.timer {
  position: relative;
  height: 22px;
  background: rgba(10,10,30,0.75);
  border: 2px solid rgba(255,255,255,0.30);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 3px 0 rgba(0,0,0,0.35), inset 0 0 12px rgba(0,0,0,0.6);
}
.timer__bar {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #b9ff3d 0%, #ffe27a 60%, #ffb83d 100%);
  transform-origin: left center;
  transform: scaleX(1);
  box-shadow: inset 0 0 14px rgba(255,255,255,0.25);
  transition: background 0.2s ease;
}
.timer.low .timer__bar {
  background: linear-gradient(90deg, #ff8a3d 0%, #ff4d6d 100%);
  animation: timerPulse 0.45s ease-in-out infinite;
}
@keyframes timerPulse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.25); }
}
.timer__text {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  font-size: 13px;
  font-weight: 900;
  color: var(--dark);
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.4px;
}

/* ── Antwoord-knoppen ─────────────────────────────────────────────────── */
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 14px;
}
.choice {
  border: 2.5px solid var(--neon-cyan);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(30,30,70,0.92) 0%, rgba(10,10,30,0.92) 100%);
  color: var(--paper);
  font-family: inherit;
  font-weight: 900;
  font-size: 38px;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  padding: 6px 8px;
  box-shadow: 0 5px 0 #002b3a, 0 8px 16px rgba(0,224,255,0.18), inset 0 0 10px rgba(0,224,255,0.08);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease, border-color 0.15s ease;
  display: grid; place-items: center;
  min-height: 0;
  text-shadow: 0 0 10px rgba(0,224,255,0.45);
}
.choice:hover {
  filter: brightness(1.10);
  border-color: #5cf3ff;
}
.choice:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #002b3a, 0 4px 8px rgba(0,224,255,0.18);
}
.choice:disabled { cursor: default; }

.choice.correct {
  border-color: var(--neon-lime);
  background: linear-gradient(180deg, #6ce03d 0%, #2c9c1a 100%);
  color: var(--dark);
  text-shadow: none;
  box-shadow: 0 5px 0 #1a5a0c, 0 0 24px rgba(185,255,61,0.55);
  animation: cardPop 0.25s ease;
}
.choice.wrong {
  border-color: var(--neon-red);
  background: linear-gradient(180deg, #ff6b81 0%, #c41a3a 100%);
  color: var(--paper);
  text-shadow: none;
  box-shadow: 0 5px 0 #5a0a18, 0 0 24px rgba(255,77,109,0.55);
  animation: cardShake 0.35s ease;
}

/* ── Overlays ─────────────────────────────────────────────────────────── */
.overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 28px;
  z-index: 20;
  background: linear-gradient(180deg, rgba(10,10,30,0.65) 0%, rgba(20,20,58,0.65) 100%);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.18s ease;
}
.overlay[hidden] { display: none; }
@keyframes fadeIn { 0% { opacity: 0; } 100% { opacity: 1; } }

.panel {
  background: rgba(10,10,30,0.92);
  border: 2.5px solid var(--neon-cyan);
  border-radius: 22px;
  padding: 26px 32px 22px;
  text-align: center;
  max-width: 540px; width: 100%;
  box-shadow: 0 0 24px rgba(0,224,255,0.35), 0 14px 28px rgba(0,0,0,0.55);
  position: relative;
  animation: panelPop 0.32s cubic-bezier(.34,1.56,.64,1);
  color: var(--paper);
}
@keyframes panelPop {
  0%   { transform: scale(0.86); opacity: 0; }
  60%  { transform: scale(1.04); opacity: 1; }
  100% { transform: scale(1); }
}

/* ── Startscherm ──────────────────────────────────────────────────────── */
.overlay--start {
  background: linear-gradient(180deg, rgba(4,4,14,0.78) 0%, rgba(10,10,30,0.78) 100%);
  backdrop-filter: blur(4px);
}
.panel--start {
  width: 660px;
  max-width: 660px;
  min-height: 410px;
  padding: 62px 48px 28px;
  display: flex; flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(6, 6, 20, 0.94);
  border: 2px solid var(--neon-cyan);
  border-radius: 24px;
  box-shadow: 0 0 28px rgba(0,224,255,0.28), 0 18px 40px rgba(0,0,0,0.55);
  position: relative;
}
.panel__corner {
  position: absolute;
  top: 14px; right: 14px;
  display: flex; gap: 10px;
  z-index: 1;
}
.icon-btn--card {
  width: 44px; height: 44px;
  font-size: 16px;
  background: rgba(20, 22, 50, 0.65);
  border: 1.5px solid rgba(255,255,255,0.32);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  color: rgba(255,255,255,0.92);
}
.icon-btn--card:hover {
  background: rgba(36, 40, 80, 0.85);
  border-color: rgba(255,255,255,0.55);
}
.title-logo {
  display: block;
  width: auto;
  max-width: min(520px, 80%);
  max-height: 200px;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 10px 22px rgba(0,224,255,0.28)) drop-shadow(0 6px 0 rgba(0,0,0,0.35));
  user-select: none;
  -webkit-user-drag: none;
}
/* Screen-reader-only fallback voor de <h1> */
.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;
}
.title--start {
  margin: 0;
  font-size: 64px;
  font-weight: 900;
  letter-spacing: -2px;
  line-height: 1;
  text-shadow: none;
  display: inline-flex; gap: 14px;
  align-items: baseline; justify-content: center;
  flex-wrap: wrap;
}
.title__a {
  color: var(--neon-cyan);
  text-shadow: 0 0 22px rgba(0,224,255,0.55);
}
.title__b {
  color: var(--accent);
  text-shadow: 0 0 22px rgba(255, 191, 77, 0.55);
}
.lead {
  margin: 38px 0 6px;
  font-size: 22px;
  font-weight: 800;
  color: var(--paper);
  letter-spacing: 0.2px;
}
.lead strong { color: var(--neon-lime); }
.lead-sub {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.58);
  letter-spacing: 0.2px;
}
.lead-sub em {
  font-style: normal;
  color: rgba(0,224,255,0.85);
  font-weight: 700;
}
.lead-sub__hot {
  color: var(--neon-red) !important;
  text-shadow: 0 0 12px rgba(255, 77, 109, 0.55);
}
.action-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  gap: 24px;
  margin-top: auto;
  padding-top: 28px;
}
.action-row.action-row--center { justify-content: center; }
.record-pill--start {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  min-width: 220px;
  justify-content: center;
  background: rgba(255,184,61,0.08);
  border: 1.5px solid var(--neon-amber);
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 800;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
  margin: 0;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.record-pill__icon { font-size: 18px; line-height: 1; }
.record-pill__label { color: rgba(255,255,255,0.7); letter-spacing: 0.8px; }
.record-pill--start strong {
  color: var(--neon-amber);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
  margin-left: 2px;
  text-shadow: 0 0 10px rgba(255,184,61,0.45);
}
.btn--cta {
  width: 280px;
  min-height: 76px;
  font-size: 22px;
  padding: 0 28px;
  border-radius: 22px;
  letter-spacing: 0.4px;
  gap: 10px;
}
.btn--cta .btn__icon {
  font-size: 18px;
  display: inline-flex; align-items: center;
}

/* ── Game-over paneel ─────────────────────────────────────────────────── */
.panel--over { padding: 22px 28px; max-width: 460px; border-color: var(--accent); box-shadow: 0 0 24px rgba(255, 191, 77, 0.35), 0 14px 28px rgba(0,0,0,0.55); }
.over__title { margin: 0 0 8px; font-size: 30px; color: var(--accent); font-weight: 900; letter-spacing: -0.5px; text-shadow: 0 0 14px rgba(255, 191, 77, 0.6); }
.over__row   { margin: 4px 0; font-size: 16px; font-weight: 800; color: var(--paper); }
.over__row strong { color: var(--neon-cyan); font-variant-numeric: tabular-nums; }
.over__row--reason { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.75); margin: 6px 0 12px; }
.over__row--reason em { font-style: normal; color: var(--neon-amber); }
.over__submit { display: flex; justify-content: center; margin-top: 10px; }
.over__actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-top: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .panel, .overlay, .card.pop, .card.shake, .choice.correct, .choice.wrong, .timer.low .timer__bar {
    animation: none !important;
  }
}
