:root {
  color-scheme: dark;
  --bg: #0b1020;
  --panel: #121a2d;
  --panel-2: #17213a;
  --text: #f5f7fb;
  --muted: #9ca9bf;
  --accent: #61dafb;
  --current: #3f7d20;
  --danger: #ef4444;
  --warning: #f59e0b;
  --ok: #22c55e;
  --border: #26324c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }

.app-shell { width: min(1180px, 100%); margin: 0 auto; padding: 20px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.topbar h1 { font-size: clamp(1.35rem, 4vw, 2rem); margin: 0; }
.status-chip { border: 1px solid var(--border); border-radius: 999px; padding: 7px 10px; color: var(--muted); font-size: .85rem; }
.status-chip.online { color: var(--ok); }
.status-chip.offline { color: var(--danger); }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 16px; margin-bottom: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 1.08rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.row { display: flex; align-items: end; gap: 10px; flex-wrap: wrap; }
.field { display: grid; gap: 6px; flex: 1; min-width: 180px; }
.field label { color: var(--muted); font-size: .85rem; }
input, select { width: 100%; border: 1px solid var(--border); color: var(--text); background: var(--panel-2); padding: 11px 12px; border-radius: 10px; }

.btn { border: 0; border-radius: 12px; padding: 12px 16px; color: #061019; background: var(--accent); font-weight: 800; }
.btn.secondary { color: var(--text); background: var(--panel-2); border: 1px solid var(--border); }
.btn.danger { color: white; background: var(--danger); }
.btn.call { width: 100%; min-height: 72px; font-size: 1.4rem; background: var(--warning); color: #1c1300; }
.btn.next { min-width: 180px; min-height: 64px; font-size: 1.2rem; }

.current-card { display: grid; gap: 6px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(145deg, var(--panel-2), var(--panel)); margin-bottom: 16px; }
.current-card .eyebrow { text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-size: .75rem; }
.current-card .player-name { font-size: clamp(1.7rem, 6vw, 3.3rem); font-weight: 900; line-height: 1; }
.current-card .player-meta { color: var(--muted); font-size: 1rem; }
.current-card .counter { margin-top: 6px; font-weight: 700; }

.message { min-height: 24px; color: var(--muted); margin-top: 8px; }
.message.error { color: #fca5a5; }
.message.success { color: #86efac; }

.table-wrap { overflow: auto; max-height: min(62vh, 720px); border: 1px solid var(--border); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { position: sticky; top: 0; background: #111a2d; z-index: 2; color: var(--muted); font-size: .78rem; text-transform: uppercase; }
tr.current-player td { background: var(--current); color: white; font-weight: 800; }
tr:last-child td { border-bottom: 0; }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.controls { position: sticky; bottom: 8px; display: flex; justify-content: flex-end; gap: 10px; padding-top: 12px; }
.call-alert { animation: flash .55s ease-in-out 2; }
@keyframes flash { 50% { outline: 5px solid var(--warning); outline-offset: 3px; } }

@media (max-width: 720px) {
  .app-shell { padding: 12px; }
  .grid { grid-template-columns: 1fr; }
  th, td { padding: 10px 8px; }
  .table-wrap { max-height: 55vh; }
  .controls { bottom: 4px; }
  .btn.next { width: 100%; }
}
