:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: #334155;
  --red: #ef4444;
  --green: #22c55e;
  --gold: #fbbf24;
  --silver: #cbd5e1;
  --accent: #c3f53c;        /* tennis-ball lime */
  --accent-ink: #1a2e05;    /* dark text on lime */
  --radius: 14px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 14px 16px 0;
  border-bottom: 1px solid var(--border);
}

.app-header h1 {
  margin: 0 0 2px;
  font-size: 1.25rem;
  text-align: center;
}

.whoami {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 10px;
  min-height: 0.9rem;
}

.tabs { display: flex; gap: 4px; }

.tab {
  flex: 1;
  padding: 10px 4px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.tab.active { color: var(--text); border-bottom-color: var(--accent); }

main { max-width: 720px; margin: 0 auto; padding: 16px; }

.view { display: none; }
.view.active { display: block; }

/* ---------- shared bits ---------- */
.btn {
  padding: 14px;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn.full { width: 100%; }

.text-in {
  width: 100%;
  padding: 13px;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  margin-bottom: 10px;
}
.text-in::placeholder { color: var(--muted); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.card h2 { margin: 0 0 4px; font-size: 1.05rem; }
.hint { margin: 0 0 12px; font-size: 0.8rem; color: var(--muted); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-row { display: flex; align-items: center; gap: 12px; }
.form-row .btn { flex: 0 0 auto; padding: 12px 22px; }
.pinned-date { flex: 1; font-size: 0.85rem; color: var(--accent); font-weight: 600; }
.date-field {
  flex: 1; display: flex; align-items: center; gap: 6px;
  padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2);
}
.date-field .date-pin { font-size: 0.9rem; }
.date-field input { flex: 1; border: none; background: transparent; color: var(--text); font-size: 0.95rem; }
.date-field input::-webkit-calendar-picker-indicator { filter: invert(0.8); cursor: pointer; }

/* ---------- Tab 1: Daily ---------- */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.week-label { font-weight: 600; font-size: 1rem; text-align: center; flex: 1; }

.nav-btn {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 1.5rem; line-height: 1; cursor: pointer;
}

.today-btn {
  display: block; margin: 10px auto 16px; padding: 6px 16px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: 0.85rem; cursor: pointer;
}

.week-grid { display: flex; flex-direction: column; gap: 10px; }

.day-card {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.12s;
}
.day-card:active { background: var(--surface-2); }
.day-card.is-today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.day-date { text-align: center; }
.day-name { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; }
.day-num { font-size: 1.4rem; font-weight: 700; }

.habit-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 40px;
}
.chip-dot {
  width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; font-weight: 700;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
}
.chip-dot.tick { background: var(--green); border-color: var(--green); color: #052e16; }
.chip-dot.cross { background: var(--red); border-color: var(--red); color: #450a0a; }
.chip-label { font-size: 0.58rem; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }

.legend {
  margin-top: 16px; font-size: 0.75rem; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend .swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.legend .swatch.tick { background: var(--green); }
.legend .swatch.cross { background: var(--red); }
.legend .swatch.none { background: var(--surface-2); border: 1px solid var(--border); }

/* --- Daily trends --- */
.trends-block { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.trends-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 10px;
}
.trends-head h2 { margin: 0; font-size: 1.05rem; }
.trends-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.select-in {
  padding: 9px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text); font-size: 0.88rem; font-weight: 600; cursor: pointer;
}
.trends-controls .seg-toggle { margin: 0; }
.trends-controls .seg { padding: 8px 14px; font-size: 0.85rem; }

/* This-week summary */
.week-summary { margin-bottom: 16px; }
.wk-headline { font-size: 0.9rem; color: var(--muted); margin-bottom: 10px; }
.wk-headline strong { color: var(--text); font-size: 1.05rem; }
.wk-headline .wk-sub { font-size: 0.74rem; }
.wk-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.wk-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-size: 0.76rem;
}
.wk-chip .wk-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.wk-chip .wk-count { font-weight: 800; }
.wk-chip .wk-note { font-size: 0.66rem; color: var(--muted); }
.wk-chip.over { border-color: var(--red); }
.wk-chip.over .wk-note { color: var(--red); }
.wk-chip.at { border-color: var(--amber); }
.wk-chip.at .wk-note { color: var(--amber); }
.wk-chip.met { border-color: var(--green); }
.wk-chip.met .wk-note { color: var(--green); }
.wk-chip.under .wk-note { color: var(--amber); }

/* Activity-by-day grid */
.grid-wrap { overflow-x: auto; padding-bottom: 4px; }
.activity-grid { display: inline-block; min-width: 100%; }
.grid-row { display: flex; align-items: center; }
.grid-label {
  position: sticky; left: 0; z-index: 1;
  flex: 0 0 60px; width: 60px;
  display: flex; align-items: center; gap: 4px;
  font-size: 0.62rem; color: var(--muted);
  background: var(--bg); padding-right: 4px;
}
.grid-label .wk-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.grid-cell, .grid-colhead { flex: 0 0 16px; width: 16px; height: 16px; margin: 1px; }
.grid-cell {
  border-radius: 3px; background: var(--surface);
  border: 1px solid var(--border); box-sizing: border-box;
}
.grid-cell.future { opacity: 0.25; }
.grid-cell.today { outline: 2px solid var(--accent); outline-offset: -1px; }
.grid-colhead { height: auto; font-size: 0.54rem; color: var(--muted); text-align: left; }
.wk-start { margin-left: 7px; }
.grid-head { margin-bottom: 2px; }

/* ---------- Modal (Tab 1 editor) ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
.modal.hidden { display: none; }
.modal-card {
  width: 100%; max-width: 480px; background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0; padding: 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  animation: slideUp 0.2s ease;
}
@media (min-width: 520px) {
  .modal { align-items: center; }
  .modal-card { border-radius: var(--radius); }
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-header h2 { margin: 0; font-size: 1.1rem; }
.icon-btn { background: none; border: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; padding: 4px 8px; }

.habit-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.habit-row:last-child { border-bottom: none; }
.habit-row .name { font-size: 1rem; font-weight: 600; }
.tristate { display: flex; gap: 8px; }
.tri {
  width: 48px; height: 44px; border-radius: 10px;
  border: 2px solid var(--border); background: var(--surface-2);
  color: var(--muted); font-size: 1.2rem; font-weight: 700; cursor: pointer;
  opacity: 0.55; transition: opacity .12s, transform .08s;
}
.tri:active { transform: scale(0.95); }
.tri.tick.on { background: var(--green); border-color: var(--green); color: #052e16; opacity: 1; }
.tri.cross.on { background: var(--red); border-color: var(--red); color: #450a0a; opacity: 1; }

.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }
.modal-actions .ghost { flex: 0 0 auto; }

/* ---------- Tab 2: Development feed ---------- */
.feed { display: flex; flex-direction: column; gap: 12px; }
.feed-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.feed-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.feed-headings { min-width: 0; }
.feed-title { font-size: 0.98rem; font-weight: 700; line-height: 1.25; margin-bottom: 4px; }
.feed-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.feed-date { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.src-badge {
  font-size: 0.64rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 2px 8px; border-radius: 999px;
}
.src-badge.coach { background: rgba(195, 245, 60, 0.18); color: var(--accent); }
.src-badge.parent { background: rgba(96, 165, 250, 0.20); color: #60a5fa; }
.src-badge.self { background: rgba(167, 139, 250, 0.20); color: #a78bfa; }
.feed-card ul { margin: 0; padding-left: 18px; }
.feed-card li { margin: 4px 0; line-height: 1.35; }
.card-actions { display: flex; gap: 2px; flex: 0 0 auto; }
.del-btn, .edit-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.85rem; padding: 2px 6px; }
.del-btn:hover { color: var(--red); }
.edit-btn:hover { color: var(--accent); }
.feed-card.editing { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* ---------- Tab 3: Finals ---------- */
.stat-row { display: flex; gap: 10px; margin-bottom: 14px; }
.stat {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; text-align: center;
}
.stat .big { font-size: 1.6rem; font-weight: 800; line-height: 1; }
.stat .lbl { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; margin-top: 4px; }

.add-toggle summary {
  cursor: pointer; font-weight: 600; color: var(--accent); list-style: none;
}
.add-toggle summary::-webkit-details-marker { display: none; }
.add-body { padding-top: 14px; }

.result-toggle, .seg-toggle {
  display: flex; gap: 6px; margin-bottom: 12px;
}
.result-toggle .seg { flex: 1; }
.seg {
  padding: 10px 16px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.seg.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.legend-line { font-size: 0.72rem; color: var(--muted); text-align: center; margin: 4px 0 14px; }

.year-group { margin-bottom: 18px; }
.year-head {
  font-size: 1.1rem; font-weight: 800; margin: 0 0 8px;
  display: flex; align-items: baseline; gap: 8px;
}
.year-head .count { font-size: 0.75rem; color: var(--muted); font-weight: 600; }

.final-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 11px 13px; margin-bottom: 8px;
}
.final-card.runner { opacity: 0.92; }
.medal { font-size: 1.3rem; flex: 0 0 auto; }
.final-main { flex: 1; min-width: 0; }
.final-tourn { font-size: 0.92rem; font-weight: 600; line-height: 1.25; }
.final-cat {
  display: inline-block; margin-top: 4px; font-size: 0.7rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--accent);
}
.final-card.runner .final-cat { color: var(--silver); }

/* ---------- Tab 4: Physical ---------- */
.metric-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }

.metric-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.metric-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px;
}
.metric-card .m-label { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; }
.metric-card .m-value { font-size: 1.5rem; font-weight: 800; margin-top: 4px; }
.metric-card .m-value .u { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.metric-card .m-meta { font-size: 0.72rem; color: var(--muted); margin-top: 4px; }
.metric-card.clickable { cursor: pointer; transition: border-color 0.12s, box-shadow 0.12s; }
.metric-card.clickable:active { background: var(--surface-2); }
.metric-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.metric-card .trend-hint { color: var(--accent); white-space: nowrap; }
.metric-card .m-delta { font-weight: 700; }
.m-delta.up { color: var(--green); }
.m-delta.down { color: var(--red); }

.chart-wrap h2 { font-size: 1rem; text-align: center; color: var(--muted); font-weight: 600; }
.seg-toggle { flex-wrap: wrap; justify-content: center; margin: 4px auto 12px; }
.chart-canvas-box { position: relative; height: 55vh; min-height: 300px; max-height: 480px; }
#phys-chart { width: 100% !important; height: 100% !important; }

.empty-note { text-align: center; color: var(--muted); font-size: 0.9rem; padding: 30px 10px; }

/* ==================== Matches tab ==================== */
.check-line { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--muted); margin: 4px 0; }
.check-line input { width: 18px; height: 18px; accent-color: var(--accent); }

.match-card { padding: 12px 14px; margin-bottom: 10px; }
.match-line1 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.match-names { font-weight: 700; font-size: 1.02rem; }
.match-line2 { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 0.8rem; margin-top: 3px; }
.match-score { font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.m-badge { font-size: 0.68rem; font-weight: 800; padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); letter-spacing: 0.04em; }
.m-badge.live { background: #7f1d1d; color: #fecaca; animation: pulse 1.6s infinite; }
.m-badge.won { background: #14532d; color: #bbf7d0; }
.m-badge.lost { background: var(--surface-2); color: var(--silver); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }
.match-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn.sm { padding: 8px 12px; font-size: 0.85rem; }
.btn.danger { color: var(--red); }
.btn.full { width: 100%; }

/* ---------- full-screen overlays ---------- */
body.noscroll { overflow: hidden; }
.track-screen, .analyze-screen {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg);
  display: flex; flex-direction: column;
}
.track-screen.hidden, .analyze-screen.hidden { display: none; }
.track-top { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.track-score { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; }
.ts-names { font-size: 0.78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ts-score { font-size: 1.02rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ts-score em { font-style: normal; color: var(--accent); }
.track-prompt { text-align: center; padding: 8px 12px; min-height: 38px; font-weight: 600; color: var(--gold); font-size: 0.92rem; }
.track-prompt.flash { animation: promptflash 1.2s ease-in-out infinite; }
@keyframes promptflash { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

.court-wrap { flex: 1; position: relative; display: flex; justify-content: center; min-height: 0; padding: 0 6px 6px; }
#court-svg, #scatter-svg, #replay-svg { height: 100%; max-width: 100%; }
.track-bottom { display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.track-bottom .btn { flex: 1; padding: 11px 4px; font-size: 0.85rem; }

/* tap outcome menu */
.tap-menu {
  position: absolute; z-index: 60; display: flex; flex-direction: column; gap: 2px;
  background: var(--surface); border: 1px solid var(--surface-2); border-radius: 12px;
  padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); min-width: 168px;
}
.tap-menu.hidden { display: none; }
.tap-menu button {
  text-align: left; padding: 11px 12px; background: none; border: none; color: var(--text);
  font-size: 0.95rem; font-weight: 600; border-radius: 8px; cursor: pointer;
}
.tap-menu button:active { background: var(--surface-2); }
.tap-menu button.def { background: var(--surface-2); position: relative; overflow: hidden; }
.tap-menu button.def.counting::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: var(--accent); transform-origin: left;
  animation: countdown 2.5s linear forwards;
}
@keyframes countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* between-games / dialogs panel */
.track-between {
  position: fixed; top: 18%; left: 50%; transform: translateX(-50%); z-index: 55;
  width: min(420px, calc(100vw - 32px));
  background: var(--surface); border: 1px solid var(--surface-2); border-radius: var(--radius);
  padding: 18px; box-shadow: 0 16px 50px rgba(0,0,0,0.6);
  max-height: 72vh; overflow-y: auto;
}
.track-between.hidden { display: none; }
.track-between h2 { margin: 0 0 10px; font-size: 1.05rem; text-align: center; }
.between-score { text-align: center; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: 8px 0 12px; }
.change-ends { text-align: center; color: var(--gold); font-weight: 700; }
.between-btns { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.between-btns.row { flex-direction: row; }
.between-btns.row .btn { flex: 1; }
.track-between .btn { margin-top: 6px; }
.track-between .btn.sel, .between-btns .sel { outline: 2px solid var(--accent); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tag-row button {
  padding: 7px 11px; border-radius: 99px; border: 1px solid var(--surface-2);
  background: none; color: var(--muted); font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.tag-row button.sel { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: var(--surface-2); color: var(--text); padding: 10px 18px; border-radius: 99px;
  font-weight: 700; font-size: 0.95rem; opacity: 0; pointer-events: none; z-index: 80;
  transition: opacity 0.25s, transform 0.25s; box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- analysis ---------- */
.subtabs { display: flex; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--border); }
.subtab {
  flex: 1; padding: 10px 2px; background: none; border: none; border-bottom: 3px solid transparent;
  color: var(--muted); font-size: 0.82rem; font-weight: 700; cursor: pointer;
}
.subtab.active { color: var(--text); border-bottom-color: var(--accent); }
.an-body { flex: 1; overflow-y: auto; padding: 14px; }
.an-pane { display: none; max-width: 720px; margin: 0 auto; }
.an-pane.active { display: block; }

.setfilter { margin-bottom: 10px; }
.stats-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.stats-table th { padding: 6px; font-size: 0.9rem; }
.stats-table td { padding: 8px 6px; text-align: center; border-top: 1px solid var(--border); font-weight: 700; }
.stats-table td.stat-label { color: var(--muted); font-weight: 500; font-size: 0.82rem; width: 46%; }
.stats-table td.best { color: var(--accent); }
.stats-table.players th { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.stats-table.players td { font-size: 0.85rem; }
.stats-table.players td.stat-label { width: auto; text-align: left; font-weight: 700; color: var(--text); }

/* Mid-game point editor */
.edit-list { max-height: 46vh; overflow-y: auto; margin: 10px 0; }
.edit-row { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 2px; border-bottom: 1px solid var(--line, #263449); font-size: 0.86rem; }
.edit-row span { min-width: 0; }
.edit-row button { flex: none; background: none; border: 1px solid var(--line, #37507a);
  color: var(--text, #e2e8f0); border-radius: 8px; padding: 6px 10px; font-size: 0.8rem; cursor: pointer; }
.edit-row button:active { background: rgba(148, 163, 184, 0.2); }

.shot-type, .shot-player { margin-bottom: 8px; }
.scatter-wrap { display: flex; flex-direction: column; align-items: center; margin: 8px 0; }
.scatter-wrap svg { width: min(320px, 88vw); height: auto; }
.shot-key { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; font-size: 0.75rem; color: var(--muted); }
.shot-key i { display: inline-block; width: 10px; height: 10px; border-radius: 99px; margin-right: 4px; }
.flow-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }

.game-block { margin-bottom: 8px; }
.game-block summary { padding: 10px 12px; cursor: pointer; font-weight: 700; font-size: 0.9rem; }
.game-score { color: var(--muted); font-weight: 600; margin-left: 6px; }
.pt-row { padding: 8px 14px; border-top: 1px solid var(--border); font-size: 0.86rem; color: var(--muted); cursor: pointer; }
.pt-row strong { color: var(--text); font-variant-numeric: tabular-nums; margin-right: 4px; }
.pt-row.sel { background: var(--surface-2); color: var(--text); border-radius: 8px; }
.sum-text {
  width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--surface-2);
  border-radius: 10px; padding: 12px; font-size: 0.9rem; line-height: 1.45; font-family: inherit;
}
.notes-head { font-size: 0.9rem; color: var(--muted); margin: 16px 0 4px; }
.hidden { display: none; }

/* ---------- Courtside auth screen ---------- */
.auth-screen {
  position: fixed; inset: 0; z-index: 50;
  background: var(--bg, #0f172a);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-screen.hidden { display: none; }
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--card, #1e293b);
  border-radius: 16px; padding: 26px 22px;
  display: flex; flex-direction: column; gap: 12px;
}
.auth-card h1 { font-size: 1.6rem; text-align: center; }
.auth-tag { font-size: 0.88rem; color: var(--muted, #94a3b8); text-align: center; margin-bottom: 4px; }
.auth-error { color: #f87171; font-size: 0.85rem; min-height: 1.1em; margin: 0; }
.whoami a { color: var(--muted, #94a3b8); text-decoration: underline; }
.auth-forgot { color: var(--muted, #94a3b8); font-size: 0.85rem; text-align: center; text-decoration: underline; }
.auth-error.ok { color: #4ade80; }
