:root {
  --bg: #0f172a;
  --card: #1e293b;
  --card-light: #334155;
  --accent: #22c55e;
  --danger: #ef4444;
  --warn: #f59e0b;
  --info: #3b82f6;
  --text: #f8fafc;
  --muted: #94a3b8;
}
* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
body { background: var(--bg); color: var(--text); padding-bottom: 76px; }
header {
  background: #020617; padding: 14px 16px; display: flex;
  justify-content: space-between; align-items: center;
  border-bottom: 1px solid #1e293b; position: sticky; top: 0; z-index: 10;
}
header h1 { font-size: 1.15rem; font-weight: 800; color: var(--accent); }
.badge { font-size: 0.72rem; background: var(--card); padding: 4px 8px; border-radius: 99px; color: var(--muted); }
.container { padding: 12px; max-width: 540px; margin: 0 auto; }
.card { background: var(--card); border-radius: 14px; padding: 14px; margin-bottom: 10px; border: 1px solid #334155; }
.row { display: flex; gap: 8px; align-items: center; }
.col { flex: 1; }
label { display: block; font-size: 0.76rem; color: var(--muted); margin-bottom: 4px; }
input[type="text"], input[type="number"], select {
  width: 100%; padding: 9px 10px; border-radius: 8px; border: 1px solid #475569;
  background: var(--bg); color: var(--text); font-size: 0.92rem;
}
.toggle-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 0.86rem; }
.btn { width: 100%; padding: 11px; border: none; border-radius: 10px; font-weight: 700; font-size: 0.92rem; cursor: pointer; color: #fff; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--accent); color: #052e16; }
.btn-secondary { background: var(--card-light); }
.btn-warn { background: var(--warn); color: #1c1917; }
.btn-sm { width: auto; padding: 6px 12px; font-size: 0.8rem; border-radius: 8px; }
@keyframes coinSpin {
  0% { transform: rotateY(0deg) scale(1); }
  50% { transform: rotateY(540deg) scale(1.25); }
  100% { transform: rotateY(1080deg) scale(1); }
}
.coin-anim { display: inline-block; animation: coinSpin 0.6s ease-out; }
.scoreboard {
  background: linear-gradient(135deg, #064e3b, #0f172a);
  border: 1px solid #10b981; text-align: center; padding: 14px; position: relative;
}
.settings-icon {
  position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,0.4);
  border: 1px solid #10b981; color: #fff; border-radius: 8px; padding: 5px 8px; font-size: 0.8rem; cursor: pointer;
}
.team-title { font-size: 0.85rem; color: #a7f3d0; text-transform: uppercase; letter-spacing: 0.8px; }
.big-score { font-size: 2.5rem; font-weight: 900; margin: 2px 0; }
.sub-stats { display: flex; justify-content: space-around; font-size: 0.84rem; color: #d1fae5; margin-top: 6px; }
.target-banner { margin-top: 8px; padding: 6px 10px; background: rgba(0,0,0,0.35); border-radius: 8px; font-size: 0.82rem; color: #fde047; font-weight: 600; }
.player-row { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px solid #334155; font-size: 0.86rem; }
.player-row:last-child { border-bottom: none; }
.striker-dot { color: var(--accent); font-weight: 900; margin-right: 4px; }
.this-over { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; min-height: 32px; }
.ball-pill {
  min-width: 28px; height: 28px; padding: 0 6px; border-radius: 50%;
  background: var(--card-light); display: inline-flex; align-items: center;
  justify-content: center; font-size: 0.76rem; font-weight: 700;
}
.ball-4 { background: var(--info); }
.ball-6 { background: var(--accent); color: #052e16; }
.ball-w { background: var(--danger); }
.ball-ex { background: var(--warn); color: #1c1917; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.key-btn {
  padding: 15px 6px; border-radius: 12px; border: 1px solid #475569;
  background: var(--card-light); color: var(--text); font-size: 1.1rem; font-weight: 800; cursor: pointer;
}
.key-btn:active { background: #475569; }
.key-4 { border-color: var(--info); color: #93c5fd; }
.key-6 { border-color: var(--accent); color: #86efac; }
.key-out { background: var(--danger); border-color: var(--danger); color: #fff; }
.key-ex { background: #422006; border-color: var(--warn); color: #fde047; font-size: 0.9rem; }
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; background: #020617;
  border-top: 1px solid #1e293b; display: flex; height: 64px; z-index: 20;
}
.nav-btn {
  flex: 1; background: none; border: none; color: var(--muted);
  font-size: 0.82rem; font-weight: 700; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; cursor: pointer;
}
.nav-btn.active { color: var(--accent); }
.hidden { display: none !important; }
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.78);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50;
}
.modal-box { background: var(--card); border: 1px solid #475569; border-radius: 14px; padding: 16px; width: 100%; max-width: 400px; }
.match-card { border-left: 4px solid var(--accent); }
.live-dot { display: inline-block; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; margin-right: 5px; }
.history-item { padding: 8px 0; border-bottom: 1px solid #334155; font-size: 0.84rem; }
