/* Cricket Kitchen studio. Mobile first; logo colours only (blue #004aad, ball red #c8202c) plus haldi, ink and neutrals. */
:root {
  --blue: #004aad; --blue-deep: #00347a; --blue-tint: #e8eef8;
  --ink: #172338; --ink-2: #3c475b; --muted: #5f6b80; --line: #d8dfea; --mist: #f1f4f9; --paper: #fff;
  --ball: #c8202c; --haldi: #f2b33d; --haldi-tint: rgba(242, 179, 61, .16);
  --skin: #c68b60; /* player figures only */
  --f-body: "Mukta", "Noto Sans Devanagari", system-ui, sans-serif;
  --f-disp: "Khand", "Mukta", sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--mist); color: var(--ink); font: 400 16px/1.5 var(--f-body); }
body.has-sheet { overflow: hidden; }
h1, h2, h3 { font-family: var(--f-disp); font-weight: 600; line-height: 1.15; margin: 0 0 10px; }
h1 { font-size: 30px; }
h2 { font-size: 23px; }
p { margin: 0 0 10px; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--haldi); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.err { color: var(--ball); font-weight: 600; }
.ok { color: var(--blue); font-weight: 600; }
.boot, .loading { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ---------- frame ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--blue); color: #fff; }
.top-in { max-width: 1100px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 16px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; margin-right: auto; }
.brand span { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand b { font: 700 22px/1 var(--f-disp); }
.brand small { font-size: 13px; opacity: .88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.top-nav { display: none; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.top-nav a { color: #fff; text-decoration: none; font-weight: 600; padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
.count { display: inline-block; margin-left: 6px; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--haldi); color: var(--ink); font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }
.top-nav a.is-on { background: rgba(255, 255, 255, .16); box-shadow: inset 0 -3px 0 var(--haldi); }
.top-site { color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; padding: 6px 12px; border: 1px solid rgba(255, 255, 255, .45); border-radius: 16px; }
.main { max-width: 1100px; margin: 0 auto; padding: 16px 16px calc(84px + var(--safe-b)); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--paper); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabbar a { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 0 2px; color: var(--ink-2); font-weight: 600; font-size: 15px; text-decoration: none; text-align: center; line-height: 1.15; }
.tabbar a.is-on { color: var(--blue); box-shadow: inset 0 3px 0 var(--blue); }
body.is-scoring .tabbar { display: none; }
body.is-scoring .main { padding-bottom: calc(24px + var(--safe-b)); }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.page-head h1, .page-head h2 { margin: 0; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.back { display: inline-block; font-weight: 600; text-decoration: none; margin-bottom: 8px; }
.form-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.form-top .back { margin-bottom: 0; }
.btn-score { border-color: var(--blue); color: var(--blue); font-weight: 700; }
.back::before { content: "‹"; margin-right: 6px; font-size: 20px; line-height: 0; }
.search { margin-bottom: 12px; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer; text-align: center; line-height: 1.2; }
.btn:hover { border-color: var(--blue); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--blue); }
.btn-danger { color: var(--ball); }
.btn-danger:hover { border-color: var(--ball); }
.btn-danger-fill { background: var(--ball); border-color: var(--ball); color: #fff; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
/* a button whose server call is running (set by api() in studio.js) */
.btn.is-busy, button.is-busy { cursor: progress; opacity: .75; }
button.is-busy::before { content: ""; display: inline-block; vertical-align: -2px; margin-right: 6px; width: 1em; height: 1em; flex: none; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ck-spin .7s linear infinite; }
@keyframes ck-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { button.is-busy::before { animation-duration: 2s; } }
.btn-lg { min-height: 52px; font-size: 18px; padding: 0 22px; }
.btn-block { display: flex; width: 100%; margin-top: 8px; }
.link { background: none; border: 0; padding: 10px 0; color: var(--blue); text-decoration: underline; cursor: pointer; display: inline-block; }
input, select, textarea { width: 100%; min-height: 46px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 16px; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-tint); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field-l { font-weight: 600; font-size: 15px; }
.field-h { font-size: 13px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; font-weight: 600; }
.check input { width: 22px; min-height: 22px; height: 22px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 16px; }
.form-act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 21px; background: var(--paper); font-weight: 600; font-size: 15px; cursor: pointer; }
.seg button.is-on { background: var(--blue); border-color: var(--blue); color: #fff; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 1px 10px; border-radius: 12px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.b-live { background: var(--ball); color: #fff; }
.b-break { background: var(--haldi); color: var(--ink); }
.b-scheduled { background: var(--blue-tint); color: var(--blue); }
.b-complete, .b-abandoned { background: var(--mist); color: var(--ink-2); border: 1px solid var(--line); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- avatars: photo or two letters, brand colours ---------- */
.av { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--av); height: var(--av); border-radius: 50%;
  background: var(--blue-tint); color: var(--blue); font: 700 calc(var(--av) * .38)/1 var(--f-body); overflow: hidden; }
.av-c1 { background: var(--blue); color: #fff; }
.av-c2 { background: var(--haldi); color: var(--ink); }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; background: #fff; }
.av-team img { object-fit: contain; padding: 8%; }
.av-bust { position: absolute; inset: 0; width: 100%; height: 100%; }
.b-skin { fill: var(--skin); }
.b-hair { fill: var(--ink); }
.b-jersey { fill: var(--blue); }
.av-c1 .b-jersey { fill: var(--haldi); }
.b-collar { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.b-txt { font: 800 8.5px/1 var(--f-body); fill: #fff; text-anchor: middle; }
.av-c1 .b-txt { fill: var(--ink); }

/* ---------- sheets & toasts ---------- */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(23, 35, 56, .55); display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--paper); width: 100%; max-height: 92vh; overflow: auto; border-radius: 16px 16px 0 0; }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
.sheet-head h2 { margin: 0; }
.x-btn { width: 44px; height: 44px; border: 0; background: var(--mist); border-radius: 50%; font-size: 26px; line-height: 1; cursor: pointer; }
.sheet-body { padding: 16px 16px calc(20px + var(--safe-b)); }
.toast-zone { position: fixed; left: 16px; right: 16px; bottom: calc(72px + var(--safe-b)); z-index: 60; display: flex; justify-content: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; max-width: 520px; box-shadow: 0 6px 20px rgba(23, 35, 56, .25); }
.toast.is-err { background: var(--ball); }
body.is-scoring .toast-zone { bottom: calc(16px + var(--safe-b)); }

/* ---------- sign in ---------- */
.auth { max-width: 440px; margin: 0 auto; padding: 24px 16px 40px; }
.auth-brand { background: var(--blue); color: #fff; border-radius: 16px; padding: 24px; text-align: center; margin-bottom: 12px; }
.auth-brand b { display: block; font: 700 28px/1.1 var(--f-disp); margin: 8px 0 4px; }
.auth-brand p { margin: 0; opacity: .9; }
.auth-card h1 { font-size: 26px; }
.auth-links { display: flex; flex-direction: column; align-items: flex-start; margin-top: 8px; }

/* ---------- lists ---------- */
.mlist, .tlist, .plist, .pick-list, .xi-list, .balls, .pgrid, .inn-sum, .steps, .slist, .olist, .review, .log, .guide, .toc, .tt-list { list-style: none; margin: 0; padding: 0; }
.mlist { display: grid; gap: 12px; }
.mcard { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.mcard.is-live { box-shadow: inset 0 3px 0 var(--ball); }
.mcard-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.mcard-meta { font-size: 14px; color: var(--muted); }
.mcard-team { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.mcard-team b { flex: 1; min-width: 0; font-size: 17px; }
.mcard-team .num { font-weight: 700; }
.mcard-status { margin: 6px 0 0; font-size: 14px; color: var(--ink-2); }
.mcard-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.first .steps { counter-reset: s; margin: 8px 0 12px; }
.first .steps li { counter-increment: s; position: relative; padding: 0 0 12px 40px; }
.first .steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.first .steps b, .first .steps span { display: block; }
.first .steps span { color: var(--muted); font-size: 15px; }

.tlist li a, .plist li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; color: var(--ink); text-decoration: none; }
.pl-name { flex: 1; min-width: 0; }
.pl-name b, .pl-name small { display: block; }
.pl-name small { color: var(--muted); font-size: 13px; }
.tlist em, .pick-list em { font-style: normal; font-size: 13px; color: var(--muted); white-space: nowrap; }
.pl-act { display: flex; gap: 4px; }
.team-head { display: flex; align-items: center; gap: 16px; }
.team-head h1 { margin: 0 0 4px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 10px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

.pick-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 8px; max-height: 320px; overflow-y: auto; }
.pick-list li + li { border-top: 1px solid var(--line); }
.pick-list button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--paper); border: 0; text-align: left; cursor: pointer; min-height: 52px; }
.pick-list button:hover { background: var(--blue-tint); }
.pick-new { color: var(--blue); font-weight: 600; }
.tp { margin-bottom: 14px; min-width: 0; }
.tp > .field-l { display: block; margin-bottom: 6px; }
.tp-team { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.tp-team b { flex: 1; min-width: 0; font-size: 18px; }
.vs { display: grid; grid-template-columns: minmax(0, 1fr); }
.vs-x { font: 600 18px/1 var(--f-disp); color: var(--muted); text-align: center; padding: 4px 0 12px; }
.img-in { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.share-url { display: flex; gap: 8px; margin-bottom: 8px; }
.share-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }

/* ---------- match centre ---------- */
.mc-head { margin-bottom: 10px; }
.mc-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.mc-title h1 { margin: 0; font-size: 26px; }
.mc-title .vs-x { display: inline; padding: 0; font-size: 18px; }
.mc-act { display: flex; flex-wrap: wrap; gap: 8px; }
.inn-sum { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.inn-sum li { display: flex; align-items: baseline; gap: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px; font-size: 15px; }
.inn-sum li.is-on { border-color: var(--blue); }
.inn-sum small { color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 12px 0 14px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap; min-height: 44px; }
.tabs button.is-on { color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue); }
.step-note { background: var(--blue-tint); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; }
.step-note b, .step-note span { display: block; }
.step-note span { font-size: 15px; color: var(--ink-2); }
.seg-teams { margin-bottom: 8px; }
.xi-count { font-weight: 600; margin: 8px 0; }
.xi-count.is-warn { color: var(--ball); }
.xi-list li { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); }
.xi-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 4px; background: none; border: 0; text-align: left; cursor: pointer; min-height: 52px; }
.tick { width: 24px; height: 24px; flex: none; border: 2px solid var(--line); border-radius: 6px; position: relative; }
.is-on .tick { background: var(--blue); border-color: var(--blue); }
.is-on .tick::after { content: ""; position: absolute; left: 6px; top: 2px; width: 7px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }
.tag-btn { min-width: 40px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-weight: 700; font-size: 13px; cursor: pointer; }
.tag-btn.is-on { background: var(--haldi); border-color: var(--haldi); }
.add-row { display: flex; gap: 8px; margin: 12px 0; }
.add-row input { flex: 1; min-width: 0; }
.toss h2 { margin-top: 8px; }
.toss .seg { margin-bottom: 12px; }
.toss-line, .big-line { font-size: 19px; font-weight: 600; margin: 12px 0; }
.big-line b { font-size: 24px; }

/* scoreboard */
.sb { position: relative; background: var(--ink); color: #fff; border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; overflow: hidden; }
.sb-main { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.sb-team { font: 600 20px/1.2 var(--f-disp); }
.sb-runs { font: 800 44px/1.05 var(--f-body); }
.sb-runs small { font-size: 16px; font-weight: 600; opacity: .75; }
.sb-runs.is-pop { color: var(--haldi); transition: color .2s; }
.sb-rate { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; opacity: .9; }
.sb-rate b { font-size: 22px; }
.sb-chase { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; color: var(--haldi); font-size: 15px; }
.sb-over { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.sb-over .lbl { font-size: 13px; opacity: .75; margin-right: 4px; }
.sb .muted { color: rgba(255, 255, 255, .7); }
.sb-pop { position: absolute; right: 16px; top: 8px; font: 700 56px/1 var(--f-disp); color: var(--haldi); animation: pop .9s ease-out forwards; pointer-events: none; }
@keyframes pop { 0% { transform: scale(.5); opacity: 0; } 30% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }
.chip { min-width: 30px; height: 30px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; border-radius: 15px; border: 1px solid var(--line); background: var(--paper); font-size: 14px; font-weight: 700; }
.chip.f { background: var(--haldi); border-color: var(--haldi); }
.chip.s { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip.w { background: var(--ball); border-color: var(--ball); color: #fff; }
.chip.x { background: var(--blue-tint); border-color: var(--blue-tint); color: var(--blue); }
.chip.d { color: var(--muted); }
.sb .chip { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; }
.sb .chip.f { background: var(--haldi); border-color: var(--haldi); color: var(--ink); }
.sb .chip.s { background: var(--blue); border-color: rgba(255, 255, 255, .45); }
.sb .chip.w { background: var(--ball); border-color: var(--ball); }
.sb .chip.x { background: rgba(255, 255, 255, .18); color: #fff; }

/* at the crease */
.crease { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.crease-p { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; min-width: 0; }
.crease-p.is-on { border-color: var(--haldi); background: var(--haldi-tint); }
.crease-p.is-bowl { grid-column: 1 / -1; }
.cp-body { min-width: 0; }
.cp-body b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-body small { color: var(--muted); }
.strike { display: inline-block; width: 10px; height: 10px; margin-left: 6px; border-radius: 50%; background: var(--haldi); color: transparent; vertical-align: 1px; overflow: hidden; }
.crease-act { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }

/* scoring pad */
.pad.is-busy { opacity: .7; }
.pad-runs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pk { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 68px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper);
  font: 800 30px/1 var(--f-body); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.pk small { font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 4px; }
.pk:active { transform: scale(.97); }
.pk:disabled { opacity: .5; }
.pk-0 { color: var(--ink-2); }
.pk-4 { background: var(--haldi); border-color: var(--haldi); }
.pk-4 small { color: var(--ink); }
.pk-6 { background: var(--blue); border-color: var(--blue); color: #fff; }
.pk-6 small { color: #fff; opacity: .85; }
.pad-x { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.pk-x { min-height: 52px; font: 600 16px/1.1 var(--f-body); background: var(--mist); }
.pk-w { grid-column: 1 / -1; min-height: 56px; background: var(--ball); border-color: var(--ball); color: #fff; font: 700 20px/1 var(--f-body); }
.pad-more { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.note-in { flex: 1 1 200px; }
.keys { display: none; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.last-ball { margin-top: 12px; color: var(--ink-2); font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.how-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.how-grid .btn { min-height: 52px; }
.w-line { font-weight: 700; font-size: 18px; margin: 14px 0; }
.more-list { display: grid; gap: 8px; }
.more-list .btn { justify-content: flex-start; min-height: 52px; }

/* player picking (openers, new batter, new bowler) */
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.pcard { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); text-align: left; cursor: pointer; min-height: 60px; position: relative; }
.pcard.is-on { border-color: var(--blue); background: var(--blue-tint); box-shadow: inset 0 0 0 1px var(--blue); }
.pcard em { position: absolute; top: -9px; right: 8px; font-style: normal; font-size: 12px; font-weight: 700; background: var(--blue); color: #fff; padding: 0 8px; border-radius: 9px; }
.pcard small { display: block; color: var(--muted); font-size: 13px; }

/* ball history */
.balls li { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.b-ov { font-weight: 700; color: var(--ink-2); min-width: 36px; }
.bl-txt { font-size: 15px; line-height: 1.35; font-weight: 600; min-width: 0; }
.bl-txt small { display: block; color: var(--muted); font-size: 14px; font-weight: 400; }
.b-over { margin-top: 12px; }
.b-over-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--mist); font-size: 15px; }
.b-over-h span { font-weight: 500; color: var(--ink-2); font-size: 14px; }
.b-over + .btn, .b-over ~ .btn { margin-top: 14px; }

/* ---------- staff tools ---------- */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.filters .search { flex: 1 1 220px; margin: 0; }
.filters select { width: auto; min-height: 42px; }
.filters .check { margin: 0; }
.tag { display: inline-block; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--mist); color: var(--ink-2); font-size: 12px; font-weight: 700; line-height: 20px; margin-left: 6px; }
.mcard-src { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.mcard-src .tag { margin-left: 0; }
.mcard-staff { display: flex; flex-wrap: wrap; gap: 4px; width: 100%; border-top: 1px solid var(--line); padding-top: 6px; }
.staff-box { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 14px; }
.src-box { background: var(--mist); border-radius: 10px; padding: 12px; margin: 8px 0 12px; }
.src-box p { margin-bottom: 6px; }
.mc-src { font-size: 14px; color: var(--ink-2); margin: -4px 0 10px; }
.mc-src .link { padding: 0; }
.help-card { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; margin-bottom: 12px; border-radius: 12px; background: var(--blue-tint); color: var(--ink); text-decoration: none; }
.help-card b { color: var(--blue); font-size: 17px; }
.help-card span { font-size: 14px; color: var(--ink-2); }
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.cols .card { margin: 0; }
.cols + .card { margin-top: 12px; }
.cols-top { align-items: start; }
.card-sec { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.card-sec.field { margin-bottom: 0; }
.card-sec .add-row { margin-bottom: 0; }
.save-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 12px 0; }
.cols + .save-bar + .card { margin-top: 0; }
.review li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.review-act { display: flex; flex-wrap: wrap; gap: 6px; }
.log li { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: baseline; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.log .tag { margin: 0; }
.lvl-error { background: var(--ball); border-color: var(--ball); color: #fff; }
.lvl-warn { background: var(--haldi); border-color: var(--haldi); color: var(--ink); }
.srow-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; }
.srow-head .tag { margin: 0; }
.slist .add-row { margin: 10px 0; }
.olist { margin-top: 12px; }
.org-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.org-head h2 { margin: 0; }
.reason { white-space: pre-line; background: var(--mist); border-radius: 10px; padding: 10px 12px; }
.gap-top { margin-top: 12px; }
.step-note .btn { margin-top: 8px; }

/* ---------- tournaments ---------- */
.grid4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 12px; }
.pts + .pts { margin-top: 16px; }
.pts h3 { font-size: 19px; margin-bottom: 6px; }
.pts-wrap { overflow-x: auto; margin: 0 -4px; }
.pts-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 460px; }
.pts-table th { text-align: right; font-weight: 700; color: var(--muted); font-size: 13px; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.pts-table th:first-child, .pts-table td:first-child { text-align: left; }
.pts-table td { text-align: right; padding: 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.pts-table tbody tr:first-child td { background: var(--blue-tint); }
.pts-team { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.pts-pos { width: 18px; color: var(--muted); font-weight: 700; }
.pts-table small { color: var(--muted); }
.tt-list { margin-bottom: 12px; }
.tt-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 10px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--line); }
.tt-name { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; }
.tt-f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
.tt-f input { min-height: 40px; }
.tt-note { grid-column: 1 / -1; }
.tt-act { grid-column: 1 / -1; display: flex; gap: 6px; }

/* ---------- help ---------- */
.guide-intro p { line-height: 1.7; }
.toc { display: flex; flex-wrap: wrap; gap: 0 16px; counter-reset: t; }
.toc li { counter-increment: t; }
.toc li::before { content: counter(t) "."; color: var(--muted); margin-right: 4px; font-size: 14px; }
.toc .link { padding: 4px 0; }
.guide { counter-reset: g; }
.gstep { counter-increment: g; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; scroll-margin-top: 72px; }
.gstep h2 { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.gstep h2::before { content: counter(g); flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font: 700 16px/1 var(--f-body); }
.gstep h2 small { flex-basis: 100%; padding-left: 40px; font: 600 16px/1.3 var(--f-body); color: var(--muted); }
.gstep p { line-height: 1.75; }
.gstep-shots { display: flex; flex-wrap: wrap; gap: 12px; }
.gstep-shots img { width: min(100%, 260px); height: auto; border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(23, 35, 56, .12); background: var(--mist); }
.faq { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; padding: 10px 0; }
.faq p { line-height: 1.7; }

/* ---------- larger screens ---------- */
@media (min-width: 480px) {
  .pad-runs { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 640px) {
  .grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 .field.is-wide { grid-column: 1 / -1; }
  .vs { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: start; }
  .vs-x { padding-top: 40px; }
  .sheet-bg { align-items: center; padding: 24px; }
  .sheet { max-width: 540px; border-radius: 16px; }
  .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crease { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .crease-p.is-bowl { grid-column: auto; }
  .pad-x { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .pk-w { grid-column: auto; }
  .how-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .share-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
  .top-nav { display: flex; }
  .tabbar { display: none; }
  .main { padding-bottom: 40px; }
  .toast-zone { bottom: 24px; }
  .mlist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tt-row { grid-template-columns: minmax(0, 1.4fr) 90px 100px minmax(0, 1.6fr) auto; }
  .tt-name, .tt-note, .tt-act { grid-column: auto; }
  .sb-runs { font-size: 52px; }
}
@media (min-width: 900px) {
  .gstep { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .gstep-shots { max-width: 540px; justify-content: flex-end; }
}
@media (min-width: 1024px) {
  .keys { display: block; }
  .pgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pk { min-height: 76px; }
}
@media (prefers-reduced-motion: reduce) {
  .dot, .sb-pop { animation: none; }
  .pk:active { transform: none; }
}
.captcha { margin: 4px 0 14px; }
.captcha-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 8px; }
.captcha-row img { border: 1px solid var(--line); border-radius: 8px; }
.captcha-q { font-size: 26px; letter-spacing: .04em; }
/* totals-only scoring */
.totals-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.totals-row input, .totals-row select { font-size: 22px; font-weight: 700; text-align: center; }
.totals-fix { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.totals-fix h3 { margin: 0 0 6px; font-size: 16px; }
.totals-fix .totals { margin: 8px 0 12px; }
