/* ==========================================================================
   Groot Rotterdam SportBingo
   Energetic, inclusive, mobile-first — dark cosmic base + sport accents.
   ========================================================================== */

:root {
  --bg-0: #061018;
  --bg-1: #0b1c28;
  --bg-2: #102838;
  --ink: #f4fbff;
  --muted: #b7c9d4;
  --lime: #7cff6b;
  --lime-dim: rgba(124, 255, 107, 0.16);
  --orange: #ff7a18;
  --gold: #f5c14a;
  --cyan: #3ee0ff;
  --blue: #3b82f6;
  --rose: #ff5d8f;
  --card: rgba(10, 28, 38, 0.72);
  --stroke: rgba(255, 255, 255, 0.12);
  --ok: #7cff6b;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --touch: 48px;
  --font: "Manrope", system-ui, sans-serif;
  --display: "Sora", "Manrope", system-ui, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
}

button, input { font: inherit; color: inherit; }

a { color: var(--cyan); }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus {
  left: 8px;
  top: 8px;
  z-index: 80;
  background: #fff;
  color: #000;
  padding: 8px 12px;
}

/* Atmosphere */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(255, 122, 24, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(62, 224, 255, 0.16), transparent 50%),
    radial-gradient(700px 500px at 50% 110%, rgba(124, 255, 107, 0.12), transparent 55%),
    linear-gradient(180deg, #07141d 0%, #061018 55%, #0a1f18 100%);
}

.hex-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='84' height='73' viewBox='0 0 84 73'><path d='M21 1.5 L42 13.5 L42 37.5 L21 49.5 L0 37.5 L0 13.5 Z' fill='none' stroke='%237cff6b' stroke-width='1'/><path d='M63 25.5 L84 37.5 L84 61.5 L63 73.5 L42 61.5 L42 37.5 Z' fill='none' stroke='%233ee0ff' stroke-width='1'/></svg>");
  mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 75%);
}

.app {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100% - 24px));
  margin: 0 auto;
  padding: 16px 0 80px;
}

/* Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}
.hex-mark {
  width: 34px;
  height: 38px;
  flex: none;
  filter: drop-shadow(0 0 10px rgba(124, 255, 107, 0.45));
}
.brand-kicker {
  display: block;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.brand-name {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(7, 20, 29, 0.7);
  backdrop-filter: blur(10px);
  font-size: 13px;
  color: var(--muted);
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 0 rgba(124, 255, 107, 0.7);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(124, 255, 107, 0); }
}

/* Views */
.view[hidden] { display: none !important; }

.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2rem, 7vw, 3.4rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin: 18px 0 12px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(110deg, var(--lime), var(--cyan) 45%, var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.lede {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 46ch;
  margin: 0 0 22px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

label.field {
  display: block;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
input[type="text"],
input[type="password"],
input[type="search"] {
  width: 100%;
  min-height: var(--touch);
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 14px;
  outline: none;
}
input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(62, 224, 255, 0.18);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  min-height: var(--touch);
  padding: 12px 18px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--lime), #3ad66a);
  color: #06210c;
  box-shadow: 0 8px 24px rgba(124, 255, 107, 0.28);
}
.btn-orange {
  background: linear-gradient(135deg, var(--orange), var(--gold));
  color: #2a1400;
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--stroke);
}
.btn-cyan {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: #04202a;
}

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
}
.err {
  color: #ffb4c4;
  font-size: 14px;
  min-height: 1.2em;
  margin: 8px 0 0;
}

.howto {
  margin-top: 22px;
  padding: 16px 18px;
  border-left: 3px solid var(--orange);
  background: rgba(255, 122, 24, 0.06);
  border-radius: 0 14px 14px 0;
}
.howto h2 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-family: var(--display);
}
.howto ol {
  margin: 0;
  padding-left: 1.15em;
  color: var(--muted);
}
.howto li { margin: 4px 0; }

/* Code reveal */
.code-box {
  text-align: center;
  padding: 26px 12px;
}
.code-box p { color: var(--muted); margin-top: 0; }
.code-value {
  font-family: var(--display);
  font-size: clamp(2rem, 8vw, 3.2rem);
  letter-spacing: 0.16em;
  font-weight: 800;
  color: var(--lime);
  text-shadow: 0 0 24px rgba(124, 255, 107, 0.35);
  margin: 8px 0 16px;
}

/* Game chrome */
.game-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 12px;
}
.who { font-family: var(--display); font-weight: 700; font-size: 1.25rem; }
.who small {
  display: block;
  font-family: var(--font);
  font-weight: 500;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
}
.code-chip {
  font-family: var(--display);
  letter-spacing: 0.14em;
  font-weight: 700;
  color: var(--gold);
  background: rgba(245, 193, 74, 0.1);
  border: 1px solid rgba(245, 193, 74, 0.28);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
}

.progress-wrap { margin: 8px 0 14px; }
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.bar > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--lime) 60%, var(--orange));
  transition: width 0.45s cubic-bezier(.2,.8,.2,1);
}

/* Bingo grid */
.board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 8px 0 16px;
}
.cell {
  position: relative;
  aspect-ratio: 1;
  border: 0;
  padding: 6px 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--stroke);
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 0;
  transition: transform 0.18s ease, background 0.25s ease, border-color 0.25s ease;
}
.cell:hover { transform: translateY(-1px); border-color: rgba(62, 224, 255, 0.4); }
.cell:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.cell-title {
  font-size: clamp(9px, 2.4vw, 12.5px);
  font-weight: 700;
  line-height: 1.2;
  z-index: 2;
}
.cell-alt {
  font-size: clamp(8px, 1.9vw, 10px);
  color: var(--muted);
  line-height: 1.2;
  margin-top: 3px;
  z-index: 2;
  display: none;
}
@media (min-width: 640px) {
  .cell-alt { display: block; }
  .board { gap: 8px; }
  .cell { padding: 8px; border-radius: 14px; }
}
.cell.is-on {
  background:
    radial-gradient(circle at 50% 120%, rgba(124, 255, 107, 0.35), transparent 55%),
    linear-gradient(160deg, rgba(255, 122, 24, 0.28), rgba(11, 40, 28, 0.92));
  border-color: rgba(124, 255, 107, 0.55);
  box-shadow: inset 0 0 0 1px rgba(124, 255, 107, 0.2), 0 8px 20px rgba(124, 255, 107, 0.12);
}
.cell.is-free {
  background: linear-gradient(160deg, rgba(62, 224, 255, 0.2), rgba(245, 193, 74, 0.16));
  border-color: rgba(245, 193, 74, 0.45);
}
.cell.is-winline {
  box-shadow: 0 0 0 2px var(--gold), 0 0 22px rgba(245, 193, 74, 0.45);
  animation: glowline 1.2s ease-in-out 2;
}
@keyframes glowline {
  50% { filter: brightness(1.25); }
}

.ball {
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, #fff, var(--orange) 42%, #b94a00);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  z-index: 3;
  pointer-events: none;
  opacity: 0;
}
.cell.is-on .ball {
  opacity: 1;
  animation: dropball 0.55s cubic-bezier(.18,1.4,.32,1) both;
}
@keyframes dropball {
  0% { transform: translateY(-140%) scale(0.4); opacity: 0; }
  70% { transform: translateY(8%) scale(1.08); opacity: 1; }
  100% { transform: translateY(-28%) scale(1); opacity: 1; }
}
.cell .tick {
  position: absolute;
  right: 5px;
  bottom: 4px;
  font-size: 12px;
  color: var(--lime);
  opacity: 0;
  z-index: 3;
}
.cell.is-on .tick { opacity: 1; }

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.badge {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  color: var(--muted);
}
.badge.on {
  color: #06210c;
  background: var(--lime);
  border-color: transparent;
  font-weight: 800;
}

.sync {
  font-size: 12px;
  color: var(--muted);
  min-height: 1.2em;
}
.sync.warn { color: var(--gold); }
.sync.err { color: #ffb4c4; }

/* Overlays */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(4, 10, 14, 0.55);
  backdrop-filter: blur(6px);
  padding: 20px;
}
.overlay[hidden] { display: none !important; }
.boom {
  text-align: center;
  animation: pop 0.55s cubic-bezier(.18,1.5,.32,1);
}
.boom h2 {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.2rem, 16vw, 7rem);
  letter-spacing: -0.05em;
  line-height: 0.85;
  background: linear-gradient(120deg, var(--lime), var(--gold), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transform: rotate(-6deg);
  text-shadow: none;
  filter: drop-shadow(0 10px 0 rgba(0,0,0,0.25));
}
.boom p {
  margin: 14px 0 0;
  font-size: 1.1rem;
  color: #fff;
}
@keyframes pop {
  0% { transform: scale(0.3) rotate(-18deg); opacity: 0; }
  70% { transform: scale(1.08) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}

#fx {
  position: fixed;
  inset: 0;
  z-index: 35;
  pointer-events: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(20px);
  background: #fff;
  color: #102018;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  opacity: 0;
  z-index: 50;
  transition: 0.25s ease;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Admin */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 16px;
}
.stat {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
}
.stat b {
  display: block;
  font-family: var(--display);
  font-size: 1.6rem;
}
.stat span { color: var(--muted); font-size: 12px; }

.table-wrap { overflow: auto; border-radius: 12px; border: 1px solid var(--stroke); }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 640px;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke);
}
th { color: var(--gold); font-weight: 700; letter-spacing: 0.04em; font-size: 11px; text-transform: uppercase; }
tr:hover td { background: rgba(255,255,255,0.03); }
.pct { font-variant-numeric: tabular-nums; }

.site-foot {
  margin-top: 28px;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.site-foot a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
