/* Turf Cricket Pro — mobile-first styles (light theme, royal-blue header band) */
:root {
  --brand: #0d47c5;
  --brand-2: #0a3aa3;
  --brand-tint: #eaf0fc;
  --bg: #eef1f7;
  --card: #ffffff;
  --row: #f6f8fc;
  --line: #e6eaf2;
  --text: #1b2236;
  --muted: #7b8499;
  --dim: #a3abbd;
  --accent: #ffad0d;
  --accent-ink: #3a2700;
  --four: #0d47c5;
  --six: #ff9500;
  --danger: #e5383b;
  --ok: #1f9d55;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 24px rgba(17, 38, 92, .07), 0 1px 2px rgba(17, 38, 92, .05);
  --shadow-sm: 0 2px 8px rgba(17, 38, 92, .07);
  --band: 168px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 var(--font);
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
/* the blue header band that the first card overlaps */
body::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: var(--band); background: linear-gradient(180deg, var(--brand) 0%, #1152d6 100%); z-index: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0; line-height: 1.2; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 99; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

#view { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding: 12px 16px 16px; outline: none; }

/* ---------- top bar (sits on the blue band) ---------- */
.topbar { display: flex; align-items: center; gap: 12px; padding: 6px 0 16px; color: #fff; min-height: 64px; }
.topbar h1 { font-size: 21px; flex: 1; font-weight: 700; }
.topbar .sub { color: rgba(255, 255, 255, .72); font-size: 13px; font-weight: 400; display: block; margin-top: 2px; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; }
.brand-logo { width: 42px; height: 42px; flex: none; filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .18)); }
.brand h1 b { color: var(--accent); }

/* ---------- cards & layout ---------- */
.card { background: var(--card); border: 0; border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card h2 { font-size: 18px; margin-bottom: 10px; font-weight: 600; }
.card h3 { font-size: 16px; margin-bottom: 8px; font-weight: 600; }
.section-title { font-size: 22px; font-weight: 700; color: var(--text); margin: 22px 2px 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > .grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.err { color: var(--danger); font-size: 14px; margin: 8px 0 0; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty b { color: var(--text); display: block; font-size: 18px; margin-bottom: 6px; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--row); color: var(--muted); white-space: nowrap; letter-spacing: .3px; }
.pill.live { background: #fdeeee; color: var(--text); text-transform: uppercase; }
.pill.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); animation: pulse 1.4s infinite; }
.pill.hot { background: var(--accent); color: #fff; text-transform: uppercase; font-weight: 700; }
.pill.win { background: #e7f6ee; color: var(--ok); }
.pill.warn { background: #fff4de; color: #b26b00; }
@keyframes pulse { 50% { opacity: .35; } }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
/* round team badge (like a flag) */
.flag { width: 36px; height: 36px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; letter-spacing: .3px; background: var(--c, var(--brand)); color: var(--fc, #fff); box-shadow: 0 3px 8px rgba(17, 38, 92, .18); }
.flag.sm { width: 28px; height: 28px; font-size: 11px; }
.vs { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 18px; border-radius: 5px; background: var(--row); color: var(--dim); font-size: 10px; font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 6px 16px rgba(13, 71, 197, .28); }
.btn.turf, .btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(255, 173, 13, .3); }
.btn.light { background: #fff; color: var(--brand); border-color: #fff; box-shadow: var(--shadow); }
.btn.danger { background: #fff; border-color: #f6c7c8; color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.lg { min-height: 56px; font-size: 17px; }
.btn.sm { min-height: 40px; padding: 6px 12px; font-size: 14px; }
.icon-btn { width: 48px; height: 48px; border-radius: 14px; border: 0; background: var(--row); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; font-size: 18px; text-decoration: none; }
.icon-btn svg { width: 22px; height: 22px; fill: currentColor; }
.icon-btn:active { transform: scale(.95); }
.topbar .icon-btn, .live-head .icon-btn { background: rgba(255, 255, 255, .16); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row .btn { flex: 1 1 auto; }

/* ---------- forms ---------- */
label.field { display: block; margin-bottom: 12px; font-size: 13px; font-weight: 500; color: var(--muted); }
label.field > span { display: block; margin-bottom: 6px; }
input[type=text], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--row); border: 1px solid var(--line); color: var(--text); font-size: 16px;
}
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(13, 71, 197, .12); }
input[type=color] { width: 56px; height: 48px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--row); padding: 4px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 48px; font-size: 15px; color: var(--text); cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); flex: none; }
.seg { display: flex; background: var(--row); border-radius: var(--radius-sm); padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 42px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
.seg button.on { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }
.roster { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 10px; }
.roster .check { background: var(--row); border-radius: 10px; padding: 0 10px; font-size: 14px; min-width: 0; }
.roster .check span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.count-ok { color: var(--ok); }
.count-bad { color: #b26b00; }

/* ---------- tabs (Live / Scorecard style) ---------- */
.tabs { display: flex; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.tabs button { flex: 1; min-width: 0; min-height: 56px; border: 0; background: transparent; color: var(--text); font-size: 16px; font-weight: 500; cursor: pointer; position: relative; padding: 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs button.on { color: var(--brand); font-weight: 600; }
.tabs button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--brand); }

/* ---------- match cards (Live Match / Result) ---------- */
.mc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.mc-head h2 { flex: 1; margin: 0; font-size: 20px; font-weight: 600; }
.mc-sub { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
.team-line { display: flex; align-items: center; gap: 12px; min-height: 46px; }
.team-line .tn { flex: 1; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-line .tn.lose { color: var(--muted); }
.team-line .tn.win, .team-line .tn.bat { font-weight: 600; }
.team-line .ts { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 16px; line-height: 1.2; }
.team-line .ts small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.team-line .ts.lose { color: var(--muted); font-weight: 500; }
.vs-row { display: flex; align-items: center; padding-left: 6px; height: 14px; }
.mc-result { color: var(--muted); font-size: 13px; margin-top: 10px; }
.bat-ico { color: var(--accent); font-size: 13px; }
.bowl-ico { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); vertical-align: super; margin-left: 2px; }

/* ---------- home ---------- */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.quick a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 84px; border-radius: 14px; background: var(--row); color: var(--text); text-decoration: none; font-weight: 600; font-size: 14px; text-align: center; padding: 8px; }
.quick svg { width: 26px; height: 26px; fill: var(--brand); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi { background: #fff; border-radius: 16px; padding: 14px 12px; box-shadow: var(--shadow); }
.kpi b { display: block; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--brand); }
.kpi span { font-size: 12px; color: var(--muted); }
.list { display: grid; gap: 10px; }
.list-item { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 12px 14px; border-radius: 16px; background: #fff; border: 0; box-shadow: var(--shadow); color: var(--text); text-decoration: none; cursor: pointer; width: 100%; text-align: left; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .s { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-item .chev { color: var(--dim); font-size: 20px; }
.match-row .scores { font-size: 14px; margin-top: 2px; }
.match-row .res { color: var(--brand); font-size: 13px; font-weight: 600; }

/* ---------- live scoring ---------- */
div.live { display: flex; flex-direction: column; gap: 12px; }
.live-head { display: flex; align-items: center; gap: 8px; color: #fff; min-height: 52px; }
.live-head .title { flex: 1; min-width: 0; }
.live-head .title b { display: block; font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-head .title span { font-size: 12px; color: rgba(255, 255, 255, .72); }
.live-head .icon-btn { width: 44px; height: 44px; }
.col-a, .col-b { display: flex; flex-direction: column; gap: 12px; }
.scoreboard { margin: 0; padding: 16px; }
.sb-main { display: flex; align-items: center; gap: 12px; }
.sb-main .tn { flex: 1; min-width: 0; font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-main .sb-vs { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 13px; font-weight: 400; color: var(--muted); overflow: hidden; }
.sb-main .sb-vs .pill { flex: none; font-size: 10px; padding: 3px 8px; }
.sb-score { font-size: 44px; font-weight: 700; letter-spacing: -1px; font-variant-numeric: tabular-nums; line-height: 1; text-align: right; }
.sb-overs { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; margin-top: 2px; }
.sb-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.mc-head .pill { flex: none; }
.sb-meta b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.sb-chase { margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--brand-tint); font-size: 15px; }
.sb-chase b { color: var(--brand); font-weight: 700; font-variant-numeric: tabular-nums; }
.sb-chase .small { color: var(--muted); display: block; margin-top: 2px; }
.balls { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; align-items: center; }
.balls .lbl { font-size: 11px; color: var(--dim); text-transform: uppercase; letter-spacing: .8px; margin-right: 2px; font-weight: 600; }
.ball { min-width: 30px; height: 30px; padding: 0 6px; border-radius: 15px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--row); color: var(--text); font-variant-numeric: tabular-nums; }
.ball.b4 { background: var(--four); color: #fff; }
.ball.b6 { background: var(--six); color: #fff; }
.ball.bw { background: var(--danger); color: #fff; }
.ball.bx { background: #fff4de; color: #b26b00; }
.ball.sep { min-width: 1px; width: 1px; padding: 0; background: var(--line); height: 22px; border-radius: 0; }

.crease { margin: 0; padding: 0; overflow: hidden; }
.crease .hd { display: flex; align-items: center; gap: 8px; padding: 7px 14px; font-size: 13px; font-weight: 600; background: #fff; box-shadow: 0 2px 6px rgba(17, 38, 92, .06); position: relative; z-index: 1; }
.crease .hd span:first-child { flex: 1; }
.crease .hd span { color: var(--text); }
.crease .p { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 14px; font-size: 15px; background: var(--row); border-bottom: 1px solid #edf0f6; }
.crease .p .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--brand); font-weight: 500; }
.crease .p .nm.on { font-weight: 700; }
.crease .p .fig { font-weight: 700; font-variant-numeric: tabular-nums; }
.crease .p .ex { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; min-width: 78px; text-align: right; }
.crease .p .role { width: 14px; text-align: center; color: var(--accent); flex: none; font-size: 11px; }
.crease .pship { font-size: 12px; color: var(--muted); padding: 8px 14px; background: #fff; }

.pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pad .k {
  min-height: 60px; border-radius: 16px; border: 0; background: #fff; box-shadow: var(--shadow-sm);
  font-size: 24px; font-weight: 700; cursor: pointer; color: var(--text); touch-action: manipulation;
  user-select: none; -webkit-user-select: none; transition: transform .07s ease, filter .15s;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05;
}
.pad .k small { font-size: 10px; font-weight: 600; letter-spacing: .6px; color: var(--muted); margin-top: 3px; text-transform: uppercase; }
.pad .k:active { transform: scale(.94); filter: brightness(.96); }
.pad .k.k4 { background: var(--brand); color: #fff; }
.pad .k.k6 { background: var(--six); color: #fff; }
.pad .k.k4 small, .pad .k.k6 small, .pad .k.kw small { color: rgba(255, 255, 255, .8); }
.pad .k.kx { color: #b26b00; background: #fffaf0; font-size: 18px; }
.pad .k.kw { background: var(--danger); color: #fff; font-size: 19px; }
.pad .k.ku { font-size: 18px; color: var(--muted); background: var(--row); box-shadow: none; }
.pad .k[disabled] { opacity: .4; }
.subpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.subpad .btn { min-height: 44px; font-size: 13px; padding: 6px; border: 0; box-shadow: var(--shadow-sm); }
.freehit { color: #b26b00; }

.prompt h2 { font-size: 18px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { min-height: 54px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--row); color: var(--brand); text-align: left; cursor: pointer; font-weight: 600; font-size: 15px; display: flex; flex-direction: column; justify-content: center; }
.choice small { color: var(--muted); font-weight: 400; font-size: 12px; }
.choice[disabled] { opacity: .45; cursor: not-allowed; color: var(--muted); }
.choice.sel { border-color: var(--brand); background: var(--brand-tint); }
.result-card { text-align: center; padding: 22px 16px; }
.result-card .trophy { font-size: 42px; }
.result-card h2 { font-size: 21px; margin: 6px 0; }
.paused-banner { display: flex; align-items: center; gap: 10px; background: #fff4de; color: #b26b00; border-radius: var(--radius-sm); padding: 10px 12px; font-weight: 600; box-shadow: var(--shadow); }
.paused-banner .btn { margin-left: auto; }

/* ---------- scorecard tables ---------- */
.sc-card { padding: 0; overflow: hidden; }
.sc-card .inn-title { padding: 14px 16px 10px; }
.sc-card .pad-x { padding: 0 16px; }
.sc-card .pad-b { padding-bottom: 14px; }
.inn-title { display: flex; align-items: center; gap: 10px; }
.inn-title h3 { flex: 1; margin: 0; }
.inn-title .tot { font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
table.sc { width: 100%; border-collapse: collapse; font-size: 14px; table-layout: fixed; }
table.sc th { font-size: 14px; color: var(--text); font-weight: 600; text-align: right; padding: 12px 4px; background: #fff; box-shadow: 0 3px 8px rgba(17, 38, 92, .06); position: relative; }
table.sc th:first-child, table.sc td:first-child { text-align: left; padding-left: 16px; }
table.sc th:last-child, table.sc td:last-child { padding-right: 16px; }
table.sc td { padding: 11px 4px; background: var(--row); border-bottom: 1px solid #edf0f6; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; vertical-align: top; }
table.sc td:first-child { overflow: hidden; }
table.sc td b { color: var(--text); font-weight: 600; }
table.sc col.n { width: auto; }
table.sc col.c { width: 38px; }
table.sc col.c2 { width: 52px; }
table.sc .nm { font-weight: 500; color: var(--brand); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.sc .how { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.sc .notout .nm::after { content: " *"; color: var(--accent); }
table.sc tr.ext td, table.sc tr.tot td { background: #fff; color: var(--text); }
table.sc tr.tot td { font-weight: 700; border-bottom: 0; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.fow { font-size: 13px; color: var(--muted); line-height: 1.6; }
.fow b { color: var(--text); font-weight: 600; }
.awards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.award { background: var(--row); border-radius: 12px; padding: 12px; }
.award span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; display: block; }
.award b { display: block; font-size: 15px; margin-top: 2px; font-weight: 600; }
.potm { display: flex; align-items: center; gap: 14px; }
.potm .lbl2 { font-size: 15px; color: var(--text); font-weight: 500; }
.potm .who { font-size: 22px; font-weight: 700; margin-top: 6px; }
.potm .who small { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.potm .big { width: 64px; height: 64px; font-size: 20px; margin-left: auto; }

/* ---------- teams ---------- */
.player-row { display: flex; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.player-row input[type=text] { flex: 1; min-width: 0; min-height: 44px; }
.tog { min-width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--dim); font-weight: 700; font-size: 13px; cursor: pointer; flex: none; padding: 0 6px; }
.tog.on { background: var(--brand-tint); color: var(--brand); border-color: #bcd0f5; }
.tog.del { color: var(--danger); }

/* ---------- stats ---------- */
.rec { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rec .award b { font-size: 17px; color: var(--brand); }
.rec .award small { color: var(--muted); display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h2h { font-size: 30px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; margin: 8px 0; color: var(--brand); }

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(255, 255, 255, .97); box-shadow: 0 -4px 20px rgba(17, 38, 92, .08);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.bottom-nav a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--dim); text-decoration: none; font-size: 11px; font-weight: 600; min-height: 48px; }
.bottom-nav svg { width: 24px; height: 24px; fill: currentColor; stroke: currentColor; }
.bottom-nav a.active { color: var(--brand); }
.bottom-nav .live-dot { position: absolute; top: 9px; left: calc(50% + 9px); width: 9px; height: 9px; border-radius: 50%; background: var(--danger); border: 2px solid #fff; animation: pulse 1.4s infinite; }

/* ---------- sheet (modal) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 25, 50, .45); animation: fade .15s ease; }
.sheet {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; overflow: auto;
  background: #fff; border-radius: 22px 22px 0 0; padding: 0 16px calc(16px + var(--safe-b));
  animation: up .18s ease; box-shadow: 0 -10px 40px rgba(17, 38, 92, .2);
}
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 16px 0 10px; background: #fff; }
.sheet-head h2 { flex: 1; font-size: 19px; font-weight: 600; }
.sheet-body .lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; font-weight: 600; margin: 14px 0 8px; }
.sheet-body .lbl:first-child { margin-top: 0; }
.runs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.runs-grid .btn { min-height: 56px; font-size: 20px; background: var(--row); border: 0; }
.sheet-actions { display: flex; gap: 8px; margin-top: 16px; }
.sheet-actions .btn { flex: 1; }
@media (min-width: 600px) {
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 22px; }
}
@keyframes up { from { transform: translateY(30px); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }

/* ---------- toast & flash ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; padding: 0 16px; }
.toast { max-width: 520px; background: #1b2236; color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: 0 8px 24px rgba(17, 38, 92, .25); animation: up .18s ease; }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--ok); }
.flash { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.flash span { font-size: 60px; font-weight: 800; letter-spacing: 2px; padding: 12px 30px; border-radius: 22px; animation: pop .75s ease forwards; box-shadow: 0 16px 40px rgba(17, 38, 92, .3); }
.flash .f4 { color: #fff; background: var(--brand); }
.flash .f6 { color: #fff; background: var(--six); }
.flash .fw { color: #fff; background: var(--danger); }
.flash .fi { color: var(--brand); background: #fff; font-size: 32px; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 18% { transform: scale(1.06); opacity: 1; } 70% { transform: scale(1); opacity: 1; } 100% { transform: scale(1.04); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- larger screens ---------- */
@media (min-width: 900px) {
  :root { --band: 200px; }
  #view { max-width: 980px; }
  div.live { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 14px; }
  div.live > .live-head, div.live > .paused-banner { grid-column: 1 / -1; }
  .bottom-nav { left: 50%; transform: translateX(-50%); max-width: 560px; border-radius: 18px 18px 0 0; }
}
@media (max-height: 700px) and (max-width: 600px) {
  .sb-score { font-size: 38px; }
  .pad .k { min-height: 54px; }
  .crease .p { min-height: 36px; }
}
