/* planning/implementation-plan.md APP-01: original CSS preserved below; integration additions follow. */

/* Layout: one phone-width column — game picker, quarter tabs, field (attack at top, goal at bottom), bench, playtime.
   Deliberately dark-only: it's read on a sunny sideline, same look as the U9 tool. */
:root {
  color-scheme: dark;
  --bg: #0f0f0f;
  --surface: #1c1c1e;
  --surface2: #2a2a2d;
  --sheet: #1c1c20;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.18);
  --text: #f0ede8;
  --text-muted: #8f8b86;
  --text-faint: #5e5b58;
  --ok: #4dd6a8;
  --warn: #f5b84a;
  --warn-bg: #2a2008; --warn-border: #4a3a10;
  --danger-bg: #7a1f1f; --danger-fg: #ffaaaa; --danger-border: #a03030;
  --bar: #378ADD;
  --gk-bg: #2a2060;   --gk-fg: #c4beff;
  --mid-bg: #0d2a45;  --mid-fg: #7ec2f7;
  --lf-bg: #1a2e0a;   --lf-fg: #92d44e;
  --st-bg: #2e1c04;   --st-fg: #f5b84a;
  --rf-bg: #2e0d1e;   --rf-fg: #f093be;
  --def-bg: #042e22;  --def-fg: #4dd6a8;
  --bench-bg: #252420; --bench-fg: #a09c96;
  --btn-weak: rgba(255,255,255,0.4);
  --radius: 8px;
  --font: 'DM Sans', system-ui, -apple-system, sans-serif;
  --mono: 'DM Mono', ui-monospace, Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); padding: 20px 16px 48px; }
button, select { font-family: inherit; }
button:focus-visible, select:focus-visible, .tab:focus-visible, .opt:focus-visible { outline: 2px solid var(--bar); outline-offset: 2px; }
.page { max-width: 480px; margin: 0 auto; }

/* sticky game header */
.topbar { position: sticky; top: 0; z-index: 50; margin: -20px -16px 14px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: rgba(15,15,15,0.94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar-inner { max-width: 480px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.start-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 4px; border: 1px solid #fff; background: #000; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.start-btn .icon { font-size: 12px; }
.gtime { display: inline-flex; flex-direction: column; align-items: flex-start; background: none; border: none; padding: 0; cursor: pointer; color: var(--t-color, var(--text)); }
.gtime .big { font-family: var(--mono); font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.gtime .cap-label { font-size: 9px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.75; margin-top: 3px; }
.gtime.t-mid { --t-color: #f5d76e; }
.gtime.t-late { --t-color: #ff7a6b; }
.score-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); cursor: pointer; }
.score-chip .nums { font-family: var(--mono); font-size: 22px; font-variant-numeric: tabular-nums; }
.score-chip .opp { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.score-chip .jersey-icon, .team-name .jersey-icon { width: 13px; height: 13px; margin-right: 3px; }


.eyebrow { font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; text-align: center; }
h1 { font-size: 20px; font-weight: 600; margin: 0 0 14px; }

.game-picker { display: block; width: 100%; margin-bottom: 10px; padding: 10px 12px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius); cursor: pointer; text-align: left; }
/* ── game card: one shared layout for the game picker button, the picker sheet's list, and the
   schedule menu's list — same markup/classes everywhere so they can't drift apart. ── */
.game-card-top { display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; flex-wrap: wrap; }
.game-card-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 12px; color: var(--text-muted); }
.jersey-icon { display: inline-block; vertical-align: middle; }
.ball { display: inline-block; font-size: 13px; }
.ball.live { animation: ballpulse 1.1s ease-in-out infinite; filter: drop-shadow(0 0 4px var(--ok)); }
@keyframes ballpulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.result-icon { font-size: 13px; }
.game-card-score, .game-card-vs { font-variant-numeric: tabular-nums; margin: 0 2px; }
.game-card-vs { color: var(--text-faint); font-weight: 500; }
.game-card-snack { margin-top: 6px; font-size: 12px; color: var(--text-muted); display: flex; justify-content: space-between; gap: 8px; }
.game-card-snack b { color: var(--text); font-weight: 600; }
.game-card .cap-badges { margin-top: 6px; padding: 0; }

.action-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
.action-btn { padding: 10px 6px; font-size: 12px; font-weight: 500; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-muted); cursor: pointer; }
.action-btn:active { border-color: var(--border-strong); color: var(--text); }
.action-btn.primary { color: var(--text); border-color: var(--border-strong); }
.bottom-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.bottom-actions .action-btn { padding: 13px; font-size: 13px; }

.save-bar { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 12px; padding: 7px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 11px; }
.save-status { color: var(--text-faint); }
.save-status.saved { color: var(--ok); }
.save-status.local { color: var(--warn); }
.active-count { color: var(--text-muted); }
.sheet-status { font-size: 11px; color: var(--text-faint); margin: -6px 0 12px; padding: 0 2px; }
.sheet-status.ok { color: var(--ok); }
.sheet-status.bad { color: var(--warn); }
.sheet-status.view { color: var(--mid-fg); }
.sync-box { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; margin: 0 0 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-muted); }
.sync-box .ok { color: var(--ok); } .sync-box .bad { color: var(--warn); }
.sync-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sync-btn { padding: 10px 6px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface2); color: var(--text); }
.sync-btn:disabled { opacity: 0.4; cursor: default; }
.coach-input { width: 100%; padding: 12px; font: 16px var(--mono); background: var(--surface2); color: var(--text); border: 1px solid var(--border-strong); border-radius: 7px; margin-bottom: 12px; }

.tabs { display: flex; gap: 12px; margin-bottom: 12px; }
.tab { flex: 1; padding: 10px 4px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 16px; font-weight: 500; cursor: pointer; color: var(--text-muted); }
.tab.active { background: var(--text); color: #111; border-color: var(--text); }
.tab .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--warn); margin-left: 4px; vertical-align: middle; }

.warnings { margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.warning { font-size: 12px; color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 6px; padding: 7px 10px; }

/* ── shared "formation board" — used by the live field, the scorer/assist picker, and the sub/move
   picker so all three stay visually identical. One wrapper class (.field) and the same .board-row /
   .board-slot grid everywhere; the picker sheets don't get a different "pitch" treatment any more. ── */
.field { display: flex; flex-direction: column; gap: 15px; padding: 10px; margin-bottom: 10px; }
.chip { display: block; border-radius: 5px; padding: 8px 4px; font-size: 12.5px; font-weight: 600; cursor: pointer; border: none; width: 100%; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:active { transform: scale(0.95); }
.empty { font-size: 12px; color: var(--text-faint); background: none; border: 1px dashed var(--border-strong); border-radius: 5px; padding: 8px; width: 100%; cursor: pointer; }



.board-row { display: flex; gap: 15px; justify-content: center; }
.board-row.spread { justify-content: space-between; }
.board-row:nth-of-type(3) { justify-content: space-around; } /* the defenders' row */
.board-slot { flex: 0 0 calc((100% - 16px) / 3); width: calc((100% - 16px) / 3); min-width: 0; min-height: 96px;
  border: 2px solid transparent; border-radius: var(--radius); padding: 8px; position: relative;
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  cursor: pointer; background: var(--surface); color: var(--text); }
.board-slot.empty { background: var(--surface); border: 1px dashed var(--border-strong); height: 100%; justify-content: center; align-items: center; }
.board-slot.empty .board-abbr { color: var(--text-faint); }
.board-slot.c-gk { background: var(--gk-bg); color: var(--gk-fg); }
.board-slot.c-mid { background: var(--mid-bg); color: var(--mid-fg); }
.board-slot.c-lf, .board-slot.c-rf { background: var(--lf-bg); color: var(--lf-fg); } /* left/right wing positions (incl. LM/RM) share one color */
.board-slot.c-st { background: var(--st-bg); color: var(--st-fg); }
.board-slot.c-def { background: var(--def-bg); color: var(--def-fg); }
.board-slot.c-bench { background: var(--bench-bg); color: var(--bench-fg); }
.board-slot:disabled, .board-slot[disabled] { cursor: default; opacity: 0.4; }
.board-slot.sel { border-color: #fff; }
.board-slot.cur { box-shadow: inset 0 0 0 2px rgba(255,255,255,0.5); }
.board-abbr, .board-num { font-size: 16px; font-weight: 500; }
.board-abbr { position: absolute; top: 6px; left: 8px; letter-spacing: 0.03em; color: #fff; opacity: 0.95; }
.board-slot.empty .board-abbr { position: static; font-size: 19px; }
.board-num { position: absolute; top: 6px; right: 8px; font-family: var(--mono); color: #fff; opacity: 0.85; }
.board-name { font-size: 19px; font-weight: 700; line-height: 1.2; margin-top: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-sub, .board-status { display: block; font-size: 11px; font-weight: 600; opacity: 0.85; margin-top: 3px; }
.board-status { font-size: 13px; }
.board-note { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--ok); letter-spacing: 0.03em; }
.board-bench { display: flex; flex-direction: column; align-items: center; gap: 15px; padding-top: 10px; margin-top: 4px; border-top: 1px solid var(--border); }
.board-chip { width: 85%; min-height: 96px; border: none; border-radius: var(--radius); padding: 8px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; cursor: pointer; background: var(--bench-bg); color: var(--bench-fg); }
.board-chip .nm { font-size: 19px; font-weight: 700; }
.board-chip small { display: block; font-size: 12px; font-weight: 600; opacity: 0.85; margin-top: 4px; }

.section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 14px; }
.section-title { font-size: 9px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; }
.section-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.section-title-row .section-title { margin-bottom: 0; }
.bench-chips { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; min-height: 28px; }
.bench-chips .chip { width: auto; flex-basis: 45%; padding: 7px 14px; font-size: 18px; }
.bench-chips .chip .num { font-size: 16px; }
.bench-empty { font-size: 12px; color: var(--text-faint); }

.pt-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.pt-name { width: 84px; font-size: 12px; color: var(--text-muted); flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-track { flex: 1; display: flex; gap: 2px; height: 16px; }
.pt-seg { flex: 1; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.pt-seg-fill { height: 100%; background: var(--bar); transition: width 0.3s ease; }
.pt-seg-fill.under { background: var(--text-faint); }
.pt-seg-fill.over { background: var(--warn); }
.pt-val { width: 42px; font-family: var(--mono); font-size: 11px; text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.pt-val.over { color: var(--warn); }
.pt-val.under { color: var(--text-muted); }

.gk-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.gk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.gk-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; border-radius: 6px; border: 1px dashed var(--gk-fg); background: none; color: var(--text); cursor: pointer; text-align: left; min-width: 0; }
.gk-item.done { border-style: solid; border-color: transparent; background: var(--gk-bg); color: var(--gk-fg); }
.gk-name { font-size: 13px; font-weight: 600; }
.gk-meta { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.gk-item.done .gk-meta { color: var(--gk-fg); opacity: 0.8; }
.gk-hint { font-size: 11px; color: var(--text-faint); margin-top: 8px; line-height: 1.5; }
.num { display: inline-block; min-width: 1.6em; font-family: var(--mono); font-size: 10px; font-weight: 500; opacity: 0.7; margin-right: 3px; text-align: right; }
.chip .num, .gk-item .num { text-align: center; }
.cap { display: inline-block; font-size: 9px; font-weight: 700; line-height: 1; padding: 2px 4px; border-radius: 3px; background: var(--warn); color: #111; vertical-align: 1px; }
.score-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.team { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.team.them { align-items: flex-end; text-align: right; }
.team-name { font-size: 11px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.score-num { font-family: var(--mono); font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }
.score-dash { font-family: var(--mono); font-size: 24px; color: var(--text-faint); }
.goal-btn { padding: 8px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface2); color: var(--text); }
.goal-btn.us { background: #12351f; border-color: #1f5c35; color: #8be3a8; }
.log-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.log-row:last-child { border-bottom: none; }
.log-when { font-family: var(--mono); font-size: 11px; color: var(--text-muted); width: 80px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.log-what { flex: 1; min-width: 0; }
.log-what.against { color: var(--text-muted); }
.log-x { background: none; border: none; color: var(--text-faint); font-size: 16px; cursor: pointer; padding: 2px 6px; }
.log-empty { font-size: 12px; color: var(--text-faint); }
.score-big { background: none; border: none; color: var(--text); cursor: pointer; padding: 0; }
.timer-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.link-btn { background: none; border: none; color: var(--text-faint); font-size: 12px; cursor: pointer; padding: 6px; }
.goal-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.goal-choice .goal-btn { padding: 18px 10px; font-size: 15px; }
.scoreboard button.goal-btn { min-width: 75%; max-width: 75%; }
.gk-item.alt { border: 1px dashed var(--border-strong); color: var(--text-muted); }
.gk-item.off { border: 1px solid #ff7a6b; background: #3a1414; color: #ffb3a8; }
.gk-item.off .gk-meta { color: #ffb3a8; }
.gk-summary { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: none; border: none; color: var(--text); padding: 0; cursor: pointer; text-align: left; }
.gk-summary .ok { color: var(--ok); font-weight: 600; font-size: 12px; white-space: nowrap; }
.gk-summary .list { font-size: 12px; color: var(--text-muted); min-width: 0; }
.chip.off-plan { outline: 2px solid #ff7a6b; outline-offset: 2px; }
.warning.bad { color: #ffb3a8; background: #2e1010; border-color: #6a2020; }
.viewer .coach-only { display: none !important; }
.field-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 7px; overflow: hidden; }
.seg button { background: none; border: none; color: var(--text-muted); font: 600 12px var(--mono); padding: 8px 12px; cursor: pointer; }
.seg button.on { background: var(--text); color: #111; }
.form-label { font: 600 12px var(--mono); color: var(--text-muted); }
.note-btn { padding: 9px 14px; border-radius: 20px; border: 1px solid var(--border-strong); background: var(--surface2); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.bottom-status { margin-top: 16px; }
.viewer-info { font-size: 11px; color: var(--text-faint); margin-top: 14px; text-align: center; }
.viewer-info .link-btn { font-size: 11px; text-decoration: underline; padding: 0 4px; }
.note-bar { max-width: 480px; margin: 8px auto 0; display: flex; align-items: center; gap: 8px; }
.note-bar[hidden] { display: none; }
.nb-when { font: 500 11px var(--mono); color: var(--text-muted); white-space: nowrap; }
.nb-input { flex: 1; min-width: 0; height: 40px; padding: 0 10px; font-size: 16px; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: 8px; }
.nb-btn { flex: 0 0 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface2); color: var(--text); font-size: 16px; cursor: pointer; }
.nb-ok { background: var(--ok); color: #111; border-color: var(--ok); font-weight: 700; }
.note-row { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: flex-start; }
.note-row:last-child { border-bottom: none; }
.note-when { font-family: var(--mono); font-size: 11px; color: var(--text-muted); width: 88px; flex-shrink: 0; padding-top: 2px; }
.note-text { flex: 1; min-width: 0; font-size: 13px; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word; }
.id-input { width: 100%; padding: 12px; font-size: 16px; background: var(--surface2); color: var(--text); border: 1px solid var(--border-strong); border-radius: 7px; margin-bottom: 12px; }
.chip.picked { outline: 2px solid var(--text); outline-offset: 1px; }
.note { font-size: 11px; color: var(--text-faint); padding-top: 12px; border-top: 1px solid var(--border); line-height: 1.6; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.overlay[hidden] { display: none; }
.sheet { background: var(--sheet); border-radius: 14px 14px 0 0; padding: 16px 16px calc(28px + env(safe-area-inset-bottom, 0px)); width: 100%; max-width: 480px; border-top: 1px solid var(--border-strong);
  min-height: 75vh; max-height: 90vh; overflow-y: auto; display: flex; flex-direction: column; justify-content: flex-end; gap: 5px; }
.sheet canvas {
  flex-grow: 1;
  max-height: 100% !important;
  margin-top: auto;
}
.sheet .goal-summary {
  flex-grow: 1;
}
.sheet .big-opts {
  gap: 12px;
  display: flex;
  justify-content: space-between;
}
.sheet .big-opts button.big-opt {
  width: 45%;
  height: auto;
}
.sheet .big-opts button.big-opt small {
  overflow: visible;
  display: block;
  white-space: wrap;
}

.sheet .handle { align-self: flex-start; }
.sheet .field { flex-grow: 1; }
.handle { width: 36px; height: 4px; background: #444; border-radius: 2px; margin: 0 auto 14px; }
.sheet-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.sheet-sub { font-size: 12px; color: var(--text-muted); margin-bottom: 14px; line-height: 1.5; }

.roster-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.roster-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 7px; background: var(--surface2); }
.roster-name { font-size: 14px; font-weight: 500; }
.roster-name.out { color: var(--text-faint); text-decoration: line-through; }
.toggle { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider { position: absolute; inset: 0; border-radius: 13px; background: var(--surface); border: 1px solid var(--border-strong); cursor: pointer; transition: background 0.2s; }
.toggle-slider::before { content: ''; position: absolute; width: 20px; height: 20px; left: 2px; top: 2px; border-radius: 50%; background: var(--text-faint); transition: transform 0.2s; }
.toggle input:checked + .toggle-slider { background: #1D9E75; border-color: #1D9E75; }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); background: #fff; }
.toggle input:focus-visible + .toggle-slider { outline: 2px solid var(--bar); outline-offset: 2px; }

.options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.opt { padding: 11px 8px; border-radius: 6px; border: 2px solid transparent; font-size: 12px; font-weight: 600; cursor: pointer; text-align: center; }
.opt.selected { border-color: rgba(255,255,255,0.7); }
.opt small { display: block; font-size: 10px; font-weight: 500; opacity: 0.8; margin-top: 2px; }
.opt small.avoid { color: var(--warn); opacity: 1; }
.picks { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.picks .chip { width: auto; padding: 9px 14px; }

.btn-row { display: flex; gap: 8px; }
.btn { flex: 1; padding: 12px; border-radius: 7px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface2); color: var(--text); }
.btn.full { width: 100%; flex: none; }
.btn-primary { background: var(--text); color: #111; border-color: var(--text); }
.btn-danger { background: var(--danger-bg); color: var(--danger-fg); border-color: var(--danger-border); }

/* quarter clock, subs, goal flow */
button { touch-action: manipulation; }
.start-btn.final { background: var(--surface2); color: var(--text-muted); }
.tab.live { border-color: var(--ok); }
.tab.live.active { background: var(--ok); border-color: var(--ok); }
.tab .live-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); margin-left: 4px; vertical-align: middle; }
.tab.live.active .live-dot { background: #111; }
.qtimes { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; line-height: 1.5; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.sheet-head .sheet-title { margin: 0; padding-top: 4px; font-size: 20px; }
.sheet-head .sheet-title .num { font-size: 16px; margin-right: 10px; }
.x-btn { flex: 0 0 36px; height: 36px; border-radius: 18px; border: 1px solid var(--border-strong); background: var(--surface2); color: var(--text); font-size: 16px; cursor: pointer; }
/* Quick Remove / Quick Add — header button (next to ✕) and full-width button (below the toggle),
   both shown at once, both wired to the same immediate action. Quick Add only confirms once a
   bench chip is selected (.sel) — tapping a chip never fills the slot by itself. */
.btn-header-action { flex: 0 0 auto; height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--warn-border); background: var(--warn-bg); color: var(--warn); font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn-header-action:disabled, .btn-quick-full:disabled { opacity: 0.4; cursor: default; }
.btn-quick-full { width: 100%; background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.bench-chips .chip.sel { outline: 2px solid var(--ok); outline-offset: -2px; }
/* Bench chips inside a sheet show "needs Xm" under the name — two lines, so override the base
   single-line .chip truncation just for these. */
.sheet .bench-chips .chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; white-space: normal; text-align: left; }
.sheet .bench-chips .chip small { font-size: 10px; font-weight: 600; opacity: 0.75; }
.cap-badges { padding: 9px 0; display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; }
.cap-side { display: inline-flex; align-items: center; gap: 8px; }
.cap-side.right { flex-direction: row; }
.armband { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; font-size: 12px; font-weight: 800; border-style: solid; border-radius: 4px; border-width: 1px; border-color: #9b4dca; color: #9b4dca; background: #000; text-shadow: 0 0 2px #fff; }
.armband-2 { border-color: #9b4dca; color: #9b4dca; }
/* min-height: 0 lets this nested flex column actually shrink inside .sheet's overflow-y:auto —
   without it, some Android browsers (Chrome/Samsung Internet) refuse to scroll a long list here
   even though the same markup scrolls fine on iOS Safari. */
.sched-list { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.sched-row { display: block; width: 100%; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface2); font-size: 13px; text-align: left; cursor: pointer; }
.sched-row.next { border-color: var(--ok); }
.sched-row.past { opacity: 0.6; }
.sched-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px; }
.sched-note { font-size: 11px; color: var(--mid-fg); }
.sched-score { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; }
.sched-snack { margin-top: 3px; font-size: 12px; color: var(--text-muted); }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 0 0 12px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface2); font-size: 13px; font-weight: 600; cursor: pointer; }
.check input { accent-color: var(--ok); width: 20px; height: 20px; margin: 0; flex-shrink: 0; }
.check small, .copyq-list small { display: block; font-size: 11px; font-weight: 400; color: var(--text-muted); margin-top: 2px; }
.copyq-list { display: flex; flex-direction: column; gap: 8px; }
.copyq-list .btn { text-align: left; }
.copyq-row { display: flex; justify-content: flex-end; margin: -6px 0 12px; }
.mini-btn { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface2); color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; }
.time-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 12px 0; font-size: 13px; color: var(--text-muted); }
.time-row input { font: inherit; font-size: 16px; padding: 8px 10px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface2); color: var(--text); color-scheme: dark; }
.pills.goal-q { margin-bottom: 10px; display: flex; flex-wrap: nowrap; gap: 8px; justify-content: space-between; }
.goal-q .pill { flex: 1; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 16px; }
.radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.radio { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface2); font-size: 13px; font-weight: 600; cursor: pointer; }
.radio input { accent-color: var(--ok); width: 18px; height: 18px; margin: 0; flex-shrink: 0; }
.radio.on { border-color: var(--ok); }
.radio.off { opacity: 0.45; cursor: default; }
.radio small { display: block; font-size: 10px; font-weight: 500; color: var(--text-muted); }
.sheet-hint { font-size: 11px; color: var(--text-faint); margin: -4px 0 12px; line-height: 1.5; text-align: center; }
.subs-strip { margin: -2px 0 12px; display: flex; flex-direction: column; gap: 4px; }
.sub-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); padding: 6px 10px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); }
.sub-row .when { font-family: var(--mono); font-size: 11px; flex-shrink: 0; }
.sub-row .what { flex: 1; min-width: 0; }
.sub-row .log-x { padding: 0 4px; }
.spot-canvas { width: auto; max-width: 100%; height: auto; max-height: 58vh; display: block; margin-left: auto; margin-right: auto; border-radius: 8px; touch-action: none; image-rendering: pixelated; margin-bottom: 12px; cursor: crosshair; }
/* ── fast goal capture: text/voice, reviewed after the game instead of picked live ── */
.capture-row { display: flex; gap: 8px; margin: 2px 0 10px; }
.capture-btn { flex: 1; padding: 13px 8px; border-radius: 8px; border: 1px dashed var(--border-strong); background: none; color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.capture-btn .ic { font-size: 18px; }
.capture-btn:active { background: var(--surface2); }
.capture-textarea { width: 100%; min-height: 140px; padding: 12px; font-size: 16px; line-height: 1.5; background: var(--surface2); color: var(--text); border: 1px solid var(--border-strong); border-radius: 8px; resize: vertical; margin-bottom: 10px; font-family: inherit; }
.voice-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 8px 22px; }
.mic-dot { width: 84px; height: 84px; border-radius: 50%; background: var(--surface2); border: 2px solid var(--border-strong); display: flex; align-items: center; justify-content: center; font-size: 32px; }
.mic-dot.rec { border-color: var(--danger-border); background: var(--danger-bg); animation: voicepulse 1.4s ease-in-out infinite; }
@keyframes voicepulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,122,107,0.35); } 50% { box-shadow: 0 0 0 14px rgba(255,122,107,0); } }
.voice-timer { font-family: var(--mono); font-size: 32px; font-variant-numeric: tabular-nums; }
.voice-timer.warn-mid { color: var(--warn); }
.voice-timer.warn-late { color: #ff7a6b; }
.voice-banner { font-size: 13px; font-weight: 700; text-align: center; min-height: 18px; letter-spacing: 0.01em; }
.voice-banner.warn-mid { color: var(--warn); }
.voice-banner.warn-late { color: #ff7a6b; }
.voice-banner.saved { color: var(--ok); }
.voice-ctl-row { display: flex; gap: 10px; }
.voice-ctl { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--border-strong); background: var(--surface2); color: var(--text); font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.voice-ctl.stop { background: #ff7a6b; border-color: #ff7a6b; color: #2a0a06; }
.goal-summary { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.goal-summary small { display: block; font-size: 12px; font-weight: 500; color: var(--text-muted); margin-top: 3px; }
.big-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.big-opt { padding: 14px 8px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface2); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; text-align: center; }
.big-opt small { display: block; font-size: 11px; font-weight: 500; color: var(--ok); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.big-opt.done { border-color: var(--ok); }
.tag-group { margin-bottom: 12px; }
.tag-group .section-title { margin-bottom: 6px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface2); color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; }
.pill.on { background: var(--ok); border-color: var(--ok); color: #111; font-weight: 600; }
.shot-tags .section-title { color: #fff; font-size: 14px; letter-spacing: 3px; text-align: center; margin-bottom: 10px; margin-top: 14px; }
.shot-tags .pills { gap: 8px; }
.shot-tags button.pill { font-size: 16px; color: #fff; font-weight: 400; letter-spacing: 1.05px; background: #000; border: 1px solid rgba(255,255,255,0.48); border-radius: 8px; padding: 10px 14px; }
.shot-tags button.pill.on { background: purple; }
.log-what.tap { background: none; border: none; color: inherit; text-align: left; padding: 0; font: inherit; cursor: pointer; }
.log-detail { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* test mode */
.test-banner { max-width: 480px; margin: 0 auto 8px; padding: 5px 10px; border-radius: 6px; background: #f5d76e; color: #111; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-align: center; }
.test-banner[hidden], .test-tools[hidden] { display: none; }
.test-tools { margin-top: 18px; padding: 12px; border-radius: var(--radius); background: #f5d76e; color: #111; display: flex; flex-direction: column; gap: 8px; }
.test-sub { font-size: 12px; line-height: 1.45; }
.test-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.test-tools .btn:not(.btn-danger) { background: #fff8dc; color: #111; border-color: rgba(0,0,0,0.2); }
.test-exit { font-size: 12px; color: #111; text-align: center; text-decoration: underline; padding: 4px; }

/* closed games, follow mode, menu, goal detail, parent entries */
.closed .live-only, .follow .contrib-only { display: none !important; }
.closed-badge { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 10px; background: var(--surface2); border: 1px solid var(--border-strong); font-size: 11px; font-weight: 600; color: var(--text-muted); vertical-align: middle; }
.close-box { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.close-box .hint { font-size: 11px; color: var(--text-faint); text-align: center; }
.menu-btn { flex: 0 0 44px; height: 44px; border-radius: 22px; border: 1px solid var(--border-strong); background: var(--surface2); color: var(--text); font-size: 18px; cursor: pointer; }
.topbar-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.menu-list { display: flex; flex-direction: column; gap: 6px; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; width: 100%; }
.menu-item small { display: block; font-size: 11px; font-weight: 500; color: var(--text-muted); margin-top: 2px; }
.menu-item .ico { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.menu-item.on { border-color: var(--ok); }
.menu-group { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); margin: 10px 2px 2px; }
.soon { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: 0.06em; padding: 2px 6px; border-radius: 4px; background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-border); margin-left: 6px; vertical-align: 1px; }
.score-chip .nums, .score-chip .opp { white-space: nowrap; }
.note-btn.icon { padding: 9px 14px; font-size: 16px; }
a.menu-item { text-decoration: none; }
.plan-list { margin: 0 0 14px; padding-left: 18px; font-size: 13px; line-height: 1.6; color: var(--text-muted); }
.follow-banner { margin: -6px 0 12px; padding: 10px 12px; border-radius: var(--radius); background: #0d2a45; border: 1px solid #1d4a75; color: #cfe6ff; font-size: 12px; line-height: 1.5; }
.follow-banner[hidden] { display: none; }
.follow-banner b { color: #fff; }
.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 14px; }
.stats-table th { font-size: 10px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); text-align: right; padding: 6px 4px; border-bottom: 1px solid var(--border-strong); }
.stats-table th:first-child, .stats-table td:first-child { text-align: left; }
.stats-table td { padding: 7px 4px; border-bottom: 1px solid var(--border); text-align: right; font-variant-numeric: tabular-nums; }
.stats-table .narrow { max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gk-recalc-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--border); font-size: 13px; }
.gk-recalc-row small { color: var(--text-faint); font-size: 11px; }
.stats-table tr.stats-row { cursor: pointer; }
.stats-table tr.stats-row:active { background: var(--surface2); }
.section-awards { padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface2); margin-bottom: 10px; }
.section-awards .section-title { margin-bottom: 6px; }
.award-row { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 0; flex-wrap: wrap; }
.award-icon { font-size: 14px; }
.award-name { color: var(--text-faint); }
.award-player { font-weight: 600; }
.award-note { color: var(--text-faint); font-size: 11px; width: 100%; padding-left: 20px; }
.awards-group-title { font-size: 13px; font-weight: 700; margin: 14px 0 6px; }
.awards-group-title:first-child { margin-top: 0; }
.goal-detail { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.gd-row { display: flex; gap: 8px; font-size: 13px; }
.gd-row .k { width: 64px; flex-shrink: 0; color: var(--text-muted); font-size: 12px; padding-top: 1px; }
.gd-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.gd-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 6px; border-radius: 999px; background: var(--surface2); border: 1px solid var(--border-strong); font-size: 12px; font-weight: 600; }
.gd-tag img { width: 22px; height: 22px; display: block; }
.gd-tag.noimg { padding-left: 10px; }
.spot-canvas.ro { cursor: default; max-height: 46vh; }
.fp-item { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.fp-item:last-child { border-bottom: none; }
.fp-item .what { flex: 1; min-width: 0; }
.fp-item .what small { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.fp-btn { padding: 7px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid var(--border-strong); background: var(--surface2); color: var(--text); }
.fp-btn.ok { background: var(--ok); border-color: var(--ok); color: #111; }
.fp-later { margin-top: 8px; }
.fp-later summary { font-size: 12px; color: var(--text-muted); cursor: pointer; padding: 4px 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .chip:active { transform: none; } }

/* APP-01 AUTH-01 SYNC-01 integration status and sign-in only. */
.auth-loading>.page,.auth-loading>.topbar{display:none}.integration-gate{max-width:480px;margin:12vh auto;padding:20px}.integration-gate input{box-sizing:border-box;width:100%;padding:12px;margin:8px 0 16px;background:var(--surface2);color:var(--text);border:1px solid var(--border-strong);border-radius:8px}.integration-status{font-size:12px;padding:10px 12px;background:var(--surface2);border:1px solid var(--border-strong);border-radius:8px;margin:12px 0;overflow-wrap:anywhere}.integration-status.warn{border-color:var(--warn);color:var(--warn)}.integration-pending{border-left:3px solid var(--warn);padding:10px;margin:12px 0;font-size:12px}.integration-pending button{margin:6px}.integration-gate a{color:var(--ok)}
