:root {
  --bg: #111827;
  --card: #1f2937;
  --text: #f9fafb;
  --muted: #9ca3af;
  --gold: #f5c542;
  --line: #374151;
  --danger: #ef4444;
  --green: #22c55e;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, Arial, sans-serif;
  background: radial-gradient(circle at top, #263248, var(--bg));
  color: var(--text);
}
.app { width: min(720px, 94%); margin: 28px auto; }
.card {
  background: rgba(31,41,55,.95);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.hero { margin-top: 8vh; }
.eyebrow { color: var(--gold); font-weight: 700; letter-spacing: 0; text-transform: uppercase; }
h1 { margin: 8px 0 12px; font-size: 32px; }
h2 { margin-top: 22px; font-size: 20px; }
.muted { color: var(--muted); }
.status {
  border-left: 4px solid var(--gold);
  color: var(--text);
  margin: 14px 0;
  padding: 10px 12px;
  background: rgba(245, 197, 66, .08);
}
label { display: block; margin-top: 16px; margin-bottom: 6px; font-weight: 700; }
input, select {
  width: 100%; padding: 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #111827; color: var(--text); font-size: 16px;
}
input[readonly] {
  color: var(--gold);
  font-weight: 800;
}
button, a.secondary {
  display: inline-block; text-decoration: none; text-align: center; border: 0; cursor: pointer;
  min-height: 48px; padding: 14px 18px; border-radius: 8px; font-weight: 800; margin-top: 18px;
}
.primary { width: 100%; background: var(--gold); color: #111827; }
.secondary { background: #374151; color: var(--text); }
.danger { background: var(--danger); color: white; }
.full { width: 100%; }
.actions { display: flex; gap: 12px; align-items: center; margin-top: 8px; }
.actions > * { flex: 1; }
.hidden { display: none; }
.scoreboard { display: grid; gap: 10px; margin: 16px 0; }
.player-row, .history-row {
  display: flex; justify-content: space-between; gap: 12px; padding: 14px;
  border: 1px solid var(--line); border-radius: 8px; background: #111827;
}
.player-row.leader {
  border-color: rgba(34, 197, 94, .65);
}
.player-row.leader strong::after {
  color: var(--green);
  content: " leading";
  font-size: 12px;
  font-weight: 700;
  margin-left: 8px;
}
.winner-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.winner-grid button { margin-top: 0; background: var(--gold); color: #111827; }
.calc-box { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #111827; position: relative; }
.calc-line { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.round-plus {
  display: none;
  width: 76px;
  min-height: 62px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #35f98b;
  cursor: pointer;
  font-size: 76px;
  font-weight: 800;
  line-height: .7;
  text-align: center;
  touch-action: manipulation;
}
.calc-result { color: var(--gold); font-weight: 800; margin-top: 8px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
@media (max-width: 520px) {
  .app { margin: 12px auto; width: min(100% - 20px, 720px); }
  .card { padding: 18px; }
  .actions { flex-direction: column; }
  .actions > * { width: 100%; }
  h1 { font-size: 26px; }
  .round-plus { display: block; margin: 4px 0 10px auto; }
  .calc-line { grid-template-columns: 1fr; }
  .calc-line input { min-width: 0; }
  .calc-line button.secondary { margin-top: 0; width: 100%; }
  .calc-line button.secondary { grid-column: 1 / -1; }
}
