/* ═══════════════════════════════════════════════════════════
   BINGO NUMMER TREKKER — STYLESHEET
   Aesthetic: Retro-futuristic control panel / arcade cabinet
   Fonts: Oswald (display) + Source Code Pro (mono accents)
   ═══════════════════════════════════════════════════════════ */

/* ─── GOOGLE FONTS ─── */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;600;700&family=Source+Code+Pro:wght@400;600&display=swap');

/* ─── CSS VARIABLES (dark theme default) ─── */
:root {
  --bg-base:       #0f1117;
  --bg-surface:    #1a1d26;
  --bg-elevated:   #232838;
  --text-primary:  #f0f2f5;
  --text-secondary:#8a8fa3;
  --text-muted:    #555a6e;
  --accent:        #e94560;       /* punchy red */
  --accent-soft:   rgba(233, 69, 96, 0.15);
  --accent-glow:   rgba(233, 69, 96, 0.4);
  --accent2:       #00d4aa;       /* teal highlight */
  --accent2-soft:  rgba(0, 212, 170, 0.12);
  --border:        rgba(255,255,255,0.07);
  --ring-track:    rgba(255,255,255,0.06);
  --ring-fill:     #e94560;
  --shadow-lg:     0 8px 40px rgba(0,0,0,0.4);
  --radius:        14px;
  --radius-sm:     8px;
  --transition:    0.25s cubic-bezier(.4,0,.2,1);
}

/* ─── LIGHT THEME ─── */
body.light {
  --bg-base:       #f4f5f7;
  --bg-surface:    #ffffff;
  --bg-elevated:   #eceef2;
  --text-primary:  #1a1d26;
  --text-secondary:#555a6e;
  --text-muted:    #8a8fa3;
  --accent:        #d63755;
  --accent-soft:   rgba(214, 55, 85, 0.1);
  --accent-glow:   rgba(214, 55, 85, 0.35);
  --accent2:       #00a882;
  --accent2-soft:  rgba(0, 168, 130, 0.1);
  --border:        rgba(0,0,0,0.08);
  --ring-track:    rgba(0,0,0,0.06);
  --ring-fill:     #d63755;
  --shadow-lg:     0 6px 30px rgba(0,0,0,0.1);
}

/* ─── RESET & BASE ─── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Source Code Pro', monospace;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background 0.4s ease, color 0.4s ease;
}

/* ─── NOISE CANVAS OVERLAY ─── */
#noiseCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.025;
  pointer-events: none;
  z-index: 999;
}

/* ─── APP CONTAINER ─── */
.app {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
}

/* ═══════════════════════════════════════════════════════════
   HEADER
   ═══════════════════════════════════════════════════════════ */
.header {
  text-align: center;
  letter-spacing: 0.18em;
  padding-top: 8px;
}

.logo {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(2.6rem, 8vw, 4rem);
  color: var(--text-primary);
  line-height: 1;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--accent) 30%, var(--accent2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.32em;
  margin-top: 4px;
  text-transform: uppercase;
}

/* ═══════════════════════════════════════════════════════════
   CONTROL BAR
   ═══════════════════════════════════════════════════════════ */
.control-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  transition: background 0.4s, border-color 0.4s;
}

.toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.88rem;
  padding: 10px 14px;
  cursor: pointer;
  transition: all var(--transition);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

.toggle-btn:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.toggle-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
}

.toggle-btn .toggle-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.toggle-btn .toggle-label {
  font-weight: 600;
}

/* Auto-interval selector */
.auto-interval {
  display: none; /* shown via JS when auto is active */
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.auto-interval.visible { display: flex; }

.auto-interval label {
  font-weight: 600;
  color: var(--text-muted);
}

.auto-interval select {
  appearance: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 8px 28px 8px 12px;
  cursor: pointer;
  min-height: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238a8fa3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: border-color var(--transition);
}

.auto-interval select:focus {
  outline: none;
  border-color: var(--accent);
}

/* Reset button */
.reset-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 18px;
  cursor: pointer;
  transition: all var(--transition);
  margin-left: 4px;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

.reset-btn:hover {
  border-color: var(--accent2);
  color: var(--accent2);
}

/* ═══════════════════════════════════════════════════════════
   NUMBER STAGE — central hero area
   ═══════════════════════════════════════════════════════════ */
.number-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 100%;
}

/* ─── Ring + Number ─── */
.ring-wrap {
  position: relative;
  width: clamp(220px, 52vw, 280px);
  height: clamp(220px, 52vw, 280px);
}

.ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: var(--ring-track);
  stroke-width: 9;
}

.ring-progress {
  fill: none;
  stroke: var(--ring-fill);
  stroke-width: 9;
  stroke-linecap: round;
  stroke-dasharray: 565.5; /* 2π×90 ≈ 565.49 */
  stroke-dashoffset: 565.5;
  transition: stroke-dashoffset 0.15s linear;
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

/* Number display overlay */
.number-display {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border-radius: 50%;
  box-shadow: inset 0 2px 12px rgba(0,0,0,0.2);
  transition: background 0.4s;
}

.number-value {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: clamp(4rem, 15vw, 6.5rem);
  color: var(--text-primary);
  letter-spacing: -0.02em;
  transition: color 0.3s;
}

/* ─── Reveal animation (pop-in) ─── */
@keyframes revealPop {
  0%   { transform: scale(0.4); opacity: 0; }
  60%  { transform: scale(1.12); }
  100% { transform: scale(1);   opacity: 1; }
}

.number-value.reveal {
  animation: revealPop 0.45s cubic-bezier(.34,1.56,.64,1) both;
  color: var(--accent);
}

/* ─── Spin animation while drawing ─── */
@keyframes spinPulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50%      { transform: scale(1.08); opacity: 1; }
}

.number-value.spinning {
  animation: spinPulse 0.6s ease-in-out infinite;
  color: var(--text-muted);
}

/* ─── Draw Button ─── */
.draw-btn {
  position: relative;
  overflow: hidden;
  background: var(--accent);
  border: none;
  border-radius: 50px;
  color: #fff;
  font-family: 'Oswald', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 18px 56px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s;
  box-shadow: 0 4px 20px var(--accent-glow);
  min-height: 58px;
  -webkit-tap-highlight-color: transparent;
}

.draw-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px var(--accent-glow);
}

.draw-btn:active:not(:disabled) {
  transform: translateY(0);
}

.draw-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  box-shadow: none;
}

/* Pulse ring behind button */
.draw-btn-pulse {
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  background: var(--accent);
  opacity: 0;
  z-index: -1;
  animation: btnPulse 2s ease-out infinite;
}

@keyframes btnPulse {
  0%   { transform: scale(1);    opacity: 0.4; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* ─── Status line ─── */
.status-line {
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  height: 1.2em;
  transition: color 0.3s;
}

.status-line.drawing { color: var(--accent); }
.status-line.done    { color: var(--accent2); }

/* ─── Stats row ─── */
.stats-row {
  display: flex;
  gap: 40px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.stat-value {
  font-family: 'Oswald', sans-serif;
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════
   SECTION TITLES
   ═══════════════════════════════════════════════════════════ */
.section-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════════════════
   LAST 5 NUMBERS
   ═══════════════════════════════════════════════════════════ */
.last-five-section {
  width: 100%;
  text-align: center;
  transition: opacity 0.3s;
}

.last-five {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.last-five .chip {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* newest chip highlight */
.last-five .chip:first-child {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 2px 12px var(--accent-glow);
}

/* slide-in animation for new chip */
@keyframes chipSlideIn {
  from { transform: translateX(-28px) scale(0.8); opacity: 0; }
  to   { transform: translateX(0) scale(1);       opacity: 1; }
}

.last-five .chip.new {
  animation: chipSlideIn 0.35s cubic-bezier(.34,1.56,.64,1) both;
}

/* ═══════════════════════════════════════════════════════════
   ALL DRAWN NUMBERS (grid)
   ═══════════════════════════════════════════════════════════ */
.all-numbers-section {
  width: 100%;
  transition: opacity 0.3s;
}

.all-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.all-numbers .chip {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Oswald', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: transform 0.2s, box-shadow 0.2s;
}

.all-numbers .chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

/* markering: nummer is in de laatste 5 getrokken */
.all-numbers .chip.last5-mark {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 2px 10px var(--accent-glow);
}

/* markering: het meest recent getrokken nummer (vet accent2) */
.all-numbers .chip.newest {
  border-color: var(--accent2);
  color: var(--accent2);
  background: var(--accent2-soft);
  box-shadow: 0 2px 10px rgba(0, 212, 170, 0.3);
}

@keyframes chipPop {
  0%   { transform: scale(0); opacity: 0; }
  70%  { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.all-numbers .chip.pop {
  animation: chipPop 0.3s cubic-bezier(.34,1.56,.64,1) both;
}

/* ═══════════════════════════════════════════════════════════
   BLIND MODE — hide sections
   ═══════════════════════════════════════════════════════════ */
body.blind .last-five-section,
body.blind .all-numbers-section {
  visibility: hidden;
  pointer-events: none;
}

/* In blind mode, shrink gap so it doesn't leave huge empty space */
body.blind .app {
  gap: 16px;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .app { padding: 18px 16px 44px; gap: 22px; }
  .control-bar { padding: 12px; gap: 8px; }
  .toggle-btn { padding: 9px 12px; font-size: 0.82rem; min-height: 44px; }
  .draw-btn { padding: 16px 44px; font-size: 1.15rem; }
  .last-five .chip { width: 56px; height: 56px; font-size: 1.35rem; }
  .all-numbers .chip { width: 42px; height: 42px; font-size: 0.95rem; }
}

@media (min-width: 900px) {
  .app { padding-top: 40px; }
  .ring-wrap {
    width: 300px;
    height: 300px;
  }
}

/* ═══════════════════════════════════════════════════════════
   RESET BEVESTIGING MODAL
   ═══════════════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  max-width: 400px;
  width: 100%;
  padding: 36px 32px 32px;
  text-align: center;
  transform: translateY(16px) scale(0.96);
  transition: transform 0.28s cubic-bezier(.34,1.56,.64,1);
}

.modal-backdrop.visible .modal {
  transform: translateY(0) scale(1);
}

.modal-icon {
  font-size: 2.6rem;
  line-height: 1;
  margin-bottom: 16px;
}

.modal-title {
  font-family: 'Oswald', sans-serif;
  font-weight: 700;
  font-size: 1.45rem;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
}

.modal-body {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 28px;
}

.modal-body strong {
  color: var(--accent);
  font-weight: 600;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.modal-btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 12px 28px;
  min-height: 48px;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.03em;
}

.modal-btn--cancel {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.modal-btn--cancel:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.modal-btn--confirm {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
}

.modal-btn--confirm:hover {
  box-shadow: 0 6px 24px var(--accent-glow);
  transform: translateY(-1px);
}

.modal-btn--confirm:active {
  transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════════
   SCROLLBAR STYLING (dark)
   ═══════════════════════════════════════════════════════════ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}