/* =========================================================
   Modern Bingo Platform — Design System
   ========================================================= */
:root{
  --bg: #f4f6fb;
  --bg-soft: #eef0f7;
  --card: #ffffff;
  --card-2: #f0f2f9;
  --primary: #7c5cff;
  --primary-2: #ff5ca8;
  --accent: #0faa6e;
  --warn: #e08800;
  --text: #1a1a2e;
  --text-dim: #5a5f80;
  --border: rgba(0,0,0,0.09);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --font-head: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;
}

*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height:100vh;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,h4{ font-family: var(--font-head); margin:0 0 8px; letter-spacing:-0.02em; }
p{ margin:0 0 8px; color: var(--text-dim); }
a{ color: inherit; }

.container{ max-width:1100px; margin:0 auto; padding:0 20px; }
.narrow{ max-width:460px; margin:0 auto; padding:0 20px; }

/* ---------- Buttons ---------- */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-family: var(--font-head); font-weight:600; font-size:15px;
  padding:12px 22px; border-radius: 999px; border:none; cursor:pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
  text-decoration:none;
}
.btn:active{ transform: scale(0.97); }
.btn-primary{ background: linear-gradient(135deg, var(--primary), var(--primary-2)); color:#fff; box-shadow: 0 8px 20px rgba(124,92,255,0.35); }
.btn-primary:hover{ box-shadow: 0 10px 26px rgba(124,92,255,0.5); }
.btn-accent{ background: var(--accent); color:#08331f; box-shadow: 0 8px 18px rgba(52,224,161,0.3); }
.btn-outline{ background: transparent; border:1px solid var(--border); color: var(--text); }
.btn-outline:hover{ border-color: var(--primary); }
.btn-danger{ background: #ff5c6a; color:#fff; }
.btn-sm{ padding:8px 16px; font-size:13px; }
.btn-block{ width:100%; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

/* ---------- Inputs ---------- */
.field{ margin-bottom:16px; }
.field label{ display:block; font-size:13px; font-weight:600; color: var(--text-dim); margin-bottom:6px; }
.field input, .field select{
  width:100%; padding:13px 14px; border-radius: var(--radius-sm);
  border:1px solid var(--border); background: var(--card-2); color: var(--text);
  font-family: var(--font-body); font-size:15px; outline:none;
  transition: border-color .15s ease;
}
.field input:focus, .field select:focus{ border-color: var(--primary); }

/* ---------- Cards / panels ---------- */
.panel{
  background: var(--card); border:1px solid var(--border); border-radius: var(--radius);
  padding:28px; box-shadow: var(--shadow);
}
.top-nav{
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 0; border-bottom:1px solid var(--border); margin-bottom:28px;
}
.brand{ display:flex; align-items:center; gap:10px; font-family:var(--font-head); font-weight:800; font-size:20px; }
.brand .dot{ width:10px; height:10px; border-radius:50%; background: var(--accent); box-shadow:0 0 12px var(--accent); }
.badge{ display:inline-block; padding:4px 12px; border-radius:999px; font-size:12px; font-weight:700; letter-spacing:.03em; text-transform:uppercase; }
.badge-waiting{ background: rgba(255,182,72,0.15); color: var(--warn); }
.badge-active{ background: rgba(52,224,161,0.15); color: var(--accent); }
.badge-paused{ background: rgba(168,171,207,0.15); color: var(--text-dim); }
.badge-finished{ background: rgba(255,92,106,0.15); color:#ff5c6a; }

/* ---------- Landing / Join ---------- */
.hero{ text-align:center; padding: 60px 0 30px; }
.hero h1{ font-size: clamp(30px,6vw,48px); }
.hero p{ font-size:16px; max-width:520px; margin: 0 auto 28px; }

/* ---------- Game list / grid (admin) ---------- */
.grid-cards{ display:grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap:18px; }
.game-card{ background: var(--card); border:1px solid var(--border); border-radius: var(--radius); padding:20px; }
.game-card .code{ font-family: var(--font-head); font-weight:700; font-size:22px; letter-spacing:.06em; color: var(--primary-2); }
.game-card .meta{ display:flex; justify-content:space-between; align-items:center; margin: 10px 0 16px; }

/* ---------- Bingo board (called numbers grid, 1-75) ---------- */
.board{
  display:grid; grid-template-columns: repeat(10, 1fr); gap:6px;
  background: var(--card); border:1px solid var(--border); border-radius: var(--radius);
  padding:16px;
}
.board .num{
  aspect-ratio:1; display:flex; align-items:center; justify-content:center;
  border-radius:8px; background: var(--card-2); color: var(--text-dim);
  font-weight:600; font-size:13px; transition: all .2s ease;
}
.board .num.called{ background: linear-gradient(135deg, var(--primary), var(--primary-2)); color:#fff; box-shadow:0 4px 12px rgba(124,92,255,0.4); }

/* ---------- Current call display ---------- */
.current-call{ text-align:center; padding: 20px 0; }
.current-call .ball{
  width:120px; height:120px; border-radius:50%; margin:0 auto 10px;
  background: radial-gradient(circle at 35% 30%, #fff, var(--primary-2) 45%, var(--primary) 100%);
  display:flex; align-items:center; justify-content:center;
  font-family: var(--font-head); font-weight:800; font-size:40px; color:#fff;
  box-shadow: 0 12px 30px rgba(255,92,168,0.4);
}
.current-call .letter{ font-size:18px; color: var(--text-dim); letter-spacing:.2em; text-transform:uppercase; margin-bottom:4px; }
.recent-calls{ display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin-top:14px; }
.recent-calls .chip{ background: var(--card-2); border-radius:999px; padding:6px 12px; font-size:13px; font-weight:600; color: var(--text-dim); }

/* ---------- Player bingo card (5x5) ---------- */
.bingo-card{ background: var(--card); border:1px solid var(--border); border-radius: var(--radius); padding:14px; box-shadow: var(--shadow); }
.bingo-header{ display:grid; grid-template-columns: repeat(5,1fr); gap:6px; margin-bottom:6px; }
.bingo-header span{ text-align:center; font-family: var(--font-head); font-weight:800; font-size:20px; color: var(--primary-2); }
.bingo-grid{ display:grid; grid-template-columns: repeat(5,1fr); gap:6px; }
.cell{
  aspect-ratio:1; display:flex; align-items:center; justify-content:center;
  background: var(--card-2); border-radius:10px; font-weight:700; font-size: clamp(14px,4vw,20px);
  cursor:pointer; user-select:none; transition: all .15s ease; border:2px solid transparent;
}
.cell.free{ background: rgba(52,224,161,0.18); color: var(--accent); font-size:12px; }
.cell.marked{ background: linear-gradient(135deg, var(--primary), var(--primary-2)); color:#fff; transform: scale(0.95); }
.cell.win{ border-color: var(--accent); box-shadow: 0 0 0 3px rgba(52,224,161,0.3); }

/* ---------- Table (admin lists) ---------- */
table{ width:100%; border-collapse: collapse; }
th, td{ text-align:left; padding:12px 10px; border-bottom:1px solid var(--border); font-size:14px; }
th{ color: var(--text-dim); font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.05em; }

/* ---------- Toast / alerts ---------- */
.alert{ padding:12px 16px; border-radius: var(--radius-sm); margin-bottom:16px; font-size:14px; }
.alert-error{ background: rgba(255,92,106,0.12); color:#ff8f98; border:1px solid rgba(255,92,106,0.3); }
.alert-success{ background: rgba(52,224,161,0.12); color: var(--accent); border:1px solid rgba(52,224,161,0.3); }

.win-banner{
  position:fixed; inset:0; background: rgba(10,10,25,0.85); display:flex; align-items:center; justify-content:center;
  flex-direction:column; z-index:999; text-align:center; padding:20px;
}
.win-banner h1{ font-size: clamp(36px,10vw,64px); background: linear-gradient(135deg, var(--accent), var(--primary-2)); -webkit-background-clip:text; background-clip:text; color:transparent; }

.footer-note{ text-align:center; color: var(--text-dim); font-size:12px; padding: 30px 0; }

/* ---------- Layout helpers ---------- */
.flex{ display:flex; align-items:center; gap:10px; }
.flex-between{ display:flex; align-items:center; justify-content:space-between; }
.mt{ margin-top:20px; }
.mb{ margin-bottom:20px; }
.status-dot{ width:8px; height:8px; border-radius:50%; display:inline-block; margin-right:6px; }
.status-dot.live{ background: var(--accent); box-shadow:0 0 8px var(--accent); animation: pulse 1.5s infinite; }
@keyframes pulse{ 0%,100%{ opacity:1; } 50%{ opacity:.4; } }

/* ---------- Responsive ---------- */
@media (max-width: 640px){
  .panel{ padding:18px; border-radius:12px; }
  .board{ grid-template-columns: repeat(8,1fr); gap:5px; }
  .board .num{ font-size:11px; }
  .top-nav{ flex-wrap:wrap; gap:10px; }
  .current-call .ball{ width:96px; height:96px; font-size:32px; }
  .hero{ padding:36px 0 20px; }
}
@media (max-width: 400px){
  .board{ grid-template-columns: repeat(6,1fr); }
}
