:root { --bg: #0f1c2e; --card: #ffffff; --ink: #12202f; --muted: #5b6b7c; --accent: #0b6bcb; --ok: #1d7a3a; --warn: #a15c00; --bad: #b3261e; --line: #d8dee6; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #eef2f6; color: var(--ink); font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-text-size-adjust: 100%; }
body { overflow-x: hidden; }
a { color: var(--accent); }
.top { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; padding: 8px 12px; background: var(--bg); color: #fff; }
.top a { color: #fff; }
.brand { font-weight: 700; text-decoration: none; font-size: 17px; min-height: 44px; display: inline-flex; align-items: center; }
nav { display: flex; flex-wrap: wrap; gap: 6px; }
nav a, nav button { min-height: 44px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 8px; background: rgba(255,255,255,.12); color: #fff; text-decoration: none; border: 0; font-size: 15px; }
main { max-width: 1100px; margin: 0 auto; padding: 12px; outline: none; }
h1 { font-size: 22px; margin: 8px 0 12px; } h2 { font-size: 19px; margin: 16px 0 8px; } h3 { font-size: 17px; margin: 12px 0 6px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.row > * { flex: 1 1 140px; min-width: 0; }
label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 4px; }
input, select, textarea { width: 100%; font-size: 16px; min-height: 44px; padding: 8px 10px; border: 1px solid #aab6c3; border-radius: 8px; background: #fff; color: var(--ink); }
input[type=checkbox], input[type=radio] { width: 22px; min-height: 22px; height: 22px; margin: 0 8px 0 0; vertical-align: middle; }
.check { display: flex; align-items: center; min-height: 44px; font-weight: 400; }
textarea { min-height: 80px; }
button, .btn { touch-action: manipulation; min-height: 44px; min-width: 44px; padding: 8px 14px; font-size: 16px; font-weight: 600; border-radius: 10px; border: 1px solid #8fa3b8; background: #f7f9fb; color: var(--ink); cursor: pointer; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
button:disabled { opacity: .45; cursor: not-allowed; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.tabs button[aria-selected=true] { background: var(--bg); color: #fff; border-color: var(--bg); }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; white-space: nowrap; }
th { font-size: 13px; color: var(--muted); }
td.num, th.num { text-align: right; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #e7edf3; }
.pill.in_progress { background: #fff1d6; color: var(--warn); } .pill.completed { background: #dff3e5; color: var(--ok); } .pill.cancelled, .pill.postponed { background: #f6dedd; color: var(--bad); }
.warn { color: var(--warn); } .bad { color: var(--bad); } .ok { color: var(--ok); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.game { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; align-items: center; }
.game .teams { font-weight: 600; }
.pad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pad button { min-height: 52px; font-size: 16px; }
.pad .wide { grid-column: span 3; }
.pad .two { grid-column: span 2; }
@media (min-width: 700px) { .pad { grid-template-columns: repeat(6, minmax(0, 1fr)); } .pad .wide { grid-column: span 6; } .split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } }
.status { font-weight: 700; padding: 8px 10px; border-radius: 8px; margin: 8px 0; }
.status.saved { background: #dff3e5; color: var(--ok); } .status.saving { background: #e6f0fb; color: var(--accent); }
.status.failed, .status.stale, .status.rejected { background: #fbe4e2; color: var(--bad); }
.diamond { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 8px 0; }
.base { border: 2px solid var(--line); border-radius: 8px; padding: 6px; min-height: 48px; text-align: center; font-size: 14px; background: #fafcfe; overflow-wrap: anywhere; }
.base.on { border-color: var(--accent); background: #e6f0fb; font-weight: 700; }
.big { font-size: 18px; font-weight: 700; }
.sheet { border: 2px solid var(--accent); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; }
#toast { position: fixed; left: 12px; right: 12px; top: 8px; z-index: 10; pointer-events: none; text-align: center; }
#toast span { display: inline-block; background: #12202f; color: #fff; padding: 8px 12px; border-radius: 10px; pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.25); } /* never blocks taps on the scoring pad */
.token { font-family: ui-monospace, Menlo, monospace; font-size: 14px; overflow-wrap: anywhere; background: #f4f6f8; padding: 8px; border-radius: 8px; }
.sr { position: absolute; left: -9999px; }
@media (max-height: 700px) and (max-width: 480px) {
  .top { padding: 4px 10px; } .brand { font-size: 15px; } nav a, nav button { min-height: 44px; padding: 0 8px; font-size: 14px; }
  main { padding: 8px; } h1 { font-size: 18px; margin: 4px 0 6px; } .card { padding: 8px; margin-bottom: 8px; }
  .base { min-height: 44px; padding: 4px; } .status { padding: 6px 8px; margin: 4px 0; } p { margin: 4px 0; }
}

.cell { width: 60px; min-width: 56px; padding: 6px; }
