@font-face { font-family: 'Poppins'; font-weight: 500; font-display: swap; src: url('fonts/poppins-medium.woff') format('woff'); }
@font-face { font-family: 'Poppins'; font-weight: 700; font-display: swap; src: url('fonts/poppins-bold.woff') format('woff'); }
/* Inter, one variable file covering weights 400-800 (Latin subset). */
@font-face { font-family: 'Inter'; font-weight: 400 800; font-display: swap; src: url('fonts/inter-var.woff') format('woff'); }
/* BowlBoard — brand v0.2: lane gold on charcoal, like a scoreboard over the lanes,
   with warm paper-cream cards like a real scorecard. Poppins for headings and big
   numbers, Inter for everything else. */
:root {
  /* palette from BowlBoard_Brand_Spec v0.2 */
  --bg: #0E0E0E;
  --bg2: #161412;
  --card: #1A1611;
  --card2: #232323;
  --line: #2f2a22;
  --text: #FFF7E6;
  --muted: #a39d92;
  --blue: #FFB347;
  --cyan: #F6A623;
  --gold: #F6A623; --amber-2: #FFB347; --orange: #E67E22;
  --grad: linear-gradient(135deg, #FFB347 0%, #F6A623 55%, #E67E22 100%);
  --glow: 0 0 18px rgba(246, 166, 35, .25);
  --warn: #FFB347;
  --danger: #E74C3C;
  --radius: 14px;
  --font-head: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }   /* the hidden attribute wins over any display rule, e.g. label.field */
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 50% -10%, #2a1d0c 0%, var(--bg) 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }

/* The header is pinned to the top and is the only thing that clears the phone's
   status bar (its own top padding), so there's no double gap and nothing scrolls
   underneath it. The page gets top padding equal to the header's measured height. */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  max-width: 560px; margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 18px 10px;
  /* Keep the brand layer opaque and independent from the blurred lane backdrop.
     This prevents iOS Safari from compositing the wordmark/gear through the
     backdrop filter near the status-bar safe area. */
  background: #0E0E0E;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; }
.app-logo {
  width: 42px; height: 42px; border-radius: 12px; object-fit: cover;
  object-position: 50% 28%; border: 1px solid var(--line);
  box-shadow: var(--glow);
}
.logo {
  font-size: 22px; font-weight: 800; letter-spacing: .3px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.screens { flex: 1; padding: calc(var(--header-h, 70px) + 4px) 16px 90px; }
.screen { display: none; animation: fade .18s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; justify-content: center; gap: 4px;
  background: rgba(14,14,14,.96); border-top: 1px solid var(--line);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  z-index: 30;
}
.tabbar button {
  flex: 1; max-width: 110px; background: none; border: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 0 5px; border-radius: 10px; cursor: pointer;
}
.tabbar button .ic { width: 23px; height: 23px; stroke-width: 1.7; }
.tabbar button span { font-size: 11px; font-weight: 600; }
.tabbar button.active { color: var(--cyan); background: rgba(246,166,35, .1); }

/* generic */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 10px 0; }
.card h3 { margin: 0 0 8px; font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; }
.btn {
  display: inline-block; border: none; cursor: pointer; font-size: 16px; font-weight: 700;
  padding: 13px 20px; border-radius: 12px; background: var(--grad); color: #fff;
  width: 100%; text-align: center; box-shadow: var(--glow);
}
.btn:active { transform: scale(.98); }
.btn.secondary { background: var(--card2); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.btn.danger { background: none; color: var(--danger); border: 1px solid var(--danger); width: auto; padding: 8px 14px; font-size: 14px; box-shadow: none; }
.btn.small-btn { width: auto; padding: 9px 16px; font-size: 14px; }
.btn:disabled { opacity: .45; box-shadow: none; }
label.field { display: block; margin: 10px 0; font-size: 14px; color: var(--muted); }
input[type=text], input[type=number], input[type=date], select {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 11px 12px; font-size: 16px; margin-top: 4px;
}
input:focus, select:focus { outline: 2px solid var(--cyan); border-color: var(--cyan); }

.score-line { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 2px; }
.score-line .now { font-size: 15px; color: var(--muted); }
.score-line .now b { color: var(--text); font-size: 22px; }
.score-line .max { font-size: 13px; color: var(--muted); }

/* pin deck */
.pindeck { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 8px 12px; margin: 10px 0; }
.pinrow { display: flex; justify-content: center; gap: 14px; margin: 7px 0; }
.pin {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--card2); border: 2px solid var(--line);
  color: var(--text); font-weight: 800; font-size: 17px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.pin.down { background: #3a2b12; border-color: var(--warn); color: var(--warn); opacity: .75; }
.throw-bar { display: flex; gap: 8px; margin-top: 10px; }
.throw-bar .btn { padding: 12px 8px; }
.quick-row { display: flex; gap: 8px; margin-top: 8px; }
.quick-row .btn { padding: 10px 8px; font-size: 14px; }

/* photo */
.photo-preview { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); margin: 10px 0; max-height: 320px; object-fit: contain; background: #000; }
.review-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 10px 0; }
.review-frame { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px; }
.review-frame .fn { font-size: 11px; color: var(--muted); text-align: center; margin-bottom: 4px; }
.review-frame .ballinputs { display: flex; gap: 4px; justify-content: center; }
.review-frame input { width: 40px; text-align: center; padding: 8px 2px; margin: 0; font-size: 15px; }
.scan-status { font-size: 14px; color: var(--warn); margin: 8px 0; min-height: 20px; }

/* stats */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: center; }
.stat-card b {
  display: block; font-size: 30px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-card span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; }
table.split { width: 100%; border-collapse: collapse; font-size: 14px; }
table.split td, table.split th { padding: 9px 6px; border-bottom: 1px solid var(--line); text-align: left; }
table.split td:last-child, table.split th:last-child { text-align: right; }
table.split th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }

/* lists */
.list-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin: 8px 0;
}
.list-item .grow .t { font-weight: 700; }
.list-item .grow .s { font-size: 13px; color: var(--muted); }
.seed-tag { font-size: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }

.filters { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.filters select { width: auto; flex: 1; min-width: 120px; margin-top: 0; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: #232323; border: 1px solid var(--line); color: var(--text);
  padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
h2.screen-title { font-size: 20px; margin: 12px 2px 4px; }
.finish-bar { position: sticky; bottom: 76px; padding: 10px 0; background: linear-gradient(180deg, transparent, var(--bg) 40%); }

/* ===== v2 additions ===== */
.mt0 { margin-top: 0; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mb8 { margin-bottom: 8px; }
.center { text-align: center; }
.warn { color: var(--warn); }
.row.wrap { flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.hint { margin: -4px 0 8px; }
button { font-family: inherit; }
.app-logo { object-position: 50% 50%; }
input[type=email], textarea {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 11px 12px; font-size: 16px; margin-top: 4px; font-family: inherit;
}
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; resize: vertical; }
input.bad { border-color: var(--danger) !important; outline-color: var(--danger); }
label.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 12px 0; color: var(--text); }
label.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--cyan); flex: none; }
fieldset.fs { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px 10px; margin: 14px 0; }
fieldset.fs legend { font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--cyan); padding: 0 6px; }
.back-link { background: none; border: none; color: var(--cyan); font-size: 15px; padding: 8px 2px 0; cursor: pointer; }
.link-btn { background: none; border: none; color: var(--cyan); font-size: 14px; padding: 6px 0; cursor: pointer; text-align: left; font-weight: 600; }
.badge { font-size: 10px; padding: 2px 7px; border-radius: 999px; background: rgba(246,166,35,.12); color: var(--cyan); border: 1px solid rgba(246,166,35,.35); margin-left: 6px; vertical-align: 2px; font-weight: 700; letter-spacing: .3px; }
.badge.league { background: rgba(255,179,71,.15); color: #FFB347; border-color: rgba(255,179,71,.4); }
.badge.split { background: rgba(251,191,36,.12); color: var(--warn); border-color: rgba(251,191,36,.4); }
.badge.ok { background: rgba(46,204,113,.12); color: #2ECC71; border-color: rgba(46,204,113,.4); }
.notice { background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.35); color: #fde68a; border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 10px 0; }
.info-card b { display: block; }
.btn.grow { width: auto; }
.btn[disabled] { cursor: default; }
label.btn { display: block; }

.league-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.league-chip { background: var(--card2); border: 1px solid var(--line); border-radius: 12px; color: var(--text); padding: 8px 14px; display: grid; text-align: center; cursor: pointer; }
.league-chip span { font-size: 11px; color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.league-chip b { font-size: 20px; color: var(--cyan); }
.league-chip small { font-size: 11px; color: var(--muted); }

/* series cards */
.series-card {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 8px 0;
}
.series-card .meta { flex: 1; min-width: 0; }
.series-card .d { font-weight: 700; }
.series-card .s { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.series-card .score { font-size: 28px; font-weight: 800; text-align: right; line-height: 1.1;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.series-card .score small { display: block; font-size: 10px; font-weight: 600; color: var(--muted); -webkit-text-fill-color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip { background: var(--card2); border: 1px solid var(--line); color: var(--text); border-radius: 8px; padding: 4px 10px; font-size: 14px; font-weight: 700; cursor: pointer; }
.chip.sel { border-color: var(--cyan); color: var(--cyan); }
.chip.ghost { background: none; color: var(--muted); cursor: default; }

.pending-note { font-size: 12px; color: var(--cyan); margin-left: 4px; }

/* pin deck */
.pin.gone { background: transparent; border: 2px dashed #3a352c; color: #5a5245; cursor: default; }
.pin.down { background: rgba(251,191,36,.14); }
.leave-line { text-align: center; margin-bottom: 4px; }
.leave-chip { display: inline-block; font-size: 13px; font-weight: 700; padding: 3px 12px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); }
.leave-chip.split { color: var(--warn); border-color: rgba(251,191,36,.5); }
.deck-hint { text-align: center; margin-bottom: 4px; }
.quick-row { margin-top: 12px; }
.btn.quick { background: var(--card2); color: var(--text); border: 1px solid var(--line); box-shadow: none; padding: 12px 4px; font-size: 15px; }
.btn.quick.strong { border-color: var(--cyan); color: var(--cyan); flex: 1.4; }
.finish-bar { display: flex; gap: 8px; }

/* saved + detail */
.saved-card, .detail-score { text-align: center; }
.big-score { font-size: 64px; font-weight: 800; line-height: 1.05;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.series-line { font-size: 20px; font-weight: 700; margin: 6px 0 2px; }
.series-line i { color: var(--muted); margin: 0 8px; font-style: normal; }
.series-line .hl { color: var(--cyan); }
.mini-stats { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.mini-stats b { color: var(--text); }
.cum-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 8px; }
.cum-row div { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 4px; }
.cum-row small { display: block; font-size: 10px; color: var(--muted); }
table.kv { width: 100%; border-collapse: collapse; font-size: 14px; }
table.kv td { padding: 7px 2px; border-bottom: 1px solid var(--line); }
table.kv td:first-child { color: var(--muted); width: 40%; }
table.kv tr:last-child td { border-bottom: none; }
.photo-preview.small { max-height: 200px; }
.scan-status.good { color: #2ECC71; }

/* stats */
.stat-grid.four { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat-grid.four .stat-card { padding: 10px 4px; }
.stat-grid.four .stat-card b { font-size: 20px; }
.stat-grid.four .stat-card span { font-size: 10px; letter-spacing: .3px; }
.versus { display: flex; gap: 10px; }
.versus div { flex: 1; text-align: center; background: var(--bg2); border-radius: 10px; padding: 10px; }
.versus b { display: block; font-size: 26px; }
.versus span { font-size: 12px; color: var(--muted); }

/* more */
.nav-item { width: 100%; text-align: left; color: var(--text); cursor: pointer; font: inherit; }
.nav-item .ic { font-size: 22px; }
.nav-item .chev { color: var(--muted); font-size: 22px; }
.about { text-align: center; margin-top: 24px; }
.about img { width: 150px; border-radius: 16px; border: 1px solid var(--line); }

/* bottom sheet */
.sheet-wrap { position: fixed; inset: 0; background: rgba(0,0,0,.62); z-index: 90; display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .18s; }
.sheet-wrap.open { opacity: 1; }
.sheet-wrap[hidden] { display: none; }
.sheet-wrap.closing .sheet { pointer-events: none; } /* a second tap lands on the backdrop, not a button or the page */
.sheet { position: relative; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-bottom: none;
  border-radius: 18px 18px 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); transform: translateY(30px); transition: transform .18s; }
.sheet-wrap.open .sheet { transform: none; }
.sheet h3 { margin: 0 36px 8px 0; font-size: 18px; }
.sheet-x { position: absolute; top: 12px; right: 12px; background: var(--card2); border: 1px solid var(--line); color: var(--muted); width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }

/* league */
.intro { text-align: center; }
.intro-ic { font-size: 40px; }
.intro h3 { font-size: 18px; }
.league-head .screen-title { margin-bottom: 0; }
.seg { display: flex; gap: 4px; overflow-x: auto; margin: 12px -14px 4px; padding: 0 14px 4px; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: none; background: var(--card); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 600; cursor: pointer; }
.seg button.on { background: rgba(246,166,35,.12); border-color: var(--cyan); color: var(--cyan); }
.week-picker { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.wk-btn { width: 44px; height: 44px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); color: var(--text); font-size: 22px; cursor: pointer; }
.wk-btn:disabled { opacity: .35; }
.wk-mid { flex: 1; text-align: center; }
.wk-mid b { display: block; font-size: 17px; }
.wk-mid small { color: var(--muted); font-size: 12px; }
.matchup-card { width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 8px 0; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.matchup-card .lanes { font-size: 11px; color: var(--muted); width: 46px; line-height: 1.2; }
.matchup-card .teams { display: flex; flex-direction: column; font-weight: 600; min-width: 0; }
.matchup-card .teams span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.matchup-card .teams i { font-size: 11px; color: var(--muted); font-style: normal; }
.matchup-card .teams .win { color: var(--cyan); }
.pill { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill.todo { color: var(--muted); border: 1px solid var(--line); }
.pill.part { color: var(--warn); border: 1px solid rgba(251,191,36,.5); }
.pill.done { color: #1a1206; background: var(--grad); font-size: 14px; }
.mu-score { display: flex; align-items: center; justify-content: center; gap: 12px; background: var(--card2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin: 6px 0; font-size: 14px; }
.mu-score b { font-size: 22px; color: var(--cyan); }
.team-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.team-head .pts { color: var(--cyan); font-weight: 800; }
.line { border-top: 1px solid var(--line); padding: 10px 0; }
.line.absent .line-meta { color: var(--warn); }
.line-top { display: flex; gap: 8px; align-items: center; }
.line-top select { margin-top: 0; flex: 1; padding: 9px 10px; }
.abs-btn { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 9px 10px; font-size: 13px; cursor: pointer; }
.abs-btn.on { border-color: var(--warn); color: var(--warn); background: rgba(251,191,36,.1); }
.line-meta { font-size: 12px; color: var(--muted); margin: 4px 2px; }
.game-inputs { display: flex; gap: 6px; align-items: center; }
.game-inputs input { margin: 0; text-align: center; padding: 10px 2px; font-size: 18px; font-weight: 700; min-width: 0; flex: 1; }
.game-inputs .ser { width: 76px; text-align: right; line-height: 1.1; }
.game-inputs .ser b { display: block; font-size: 18px; }
.game-inputs .ser small { font-size: 11px; color: var(--muted); }
table.totals { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
table.totals th { font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px; text-align: right; }
table.totals td { padding: 5px 4px; text-align: right; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.totals td:first-child { text-align: left; color: var(--muted); }
table.totals tr.tot td { font-weight: 800; font-size: 15px; }
table.totals td.won { color: var(--cyan); }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
table.data th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; padding: 6px 5px; text-align: right; font-weight: 600; white-space: nowrap; }
table.data td { padding: 8px 5px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.data .l { text-align: left; }
table.data td.l { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
table.data tr.me td { background: rgba(246,166,35,.07); }
.share-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.share-grid .btn { padding: 11px 6px; font-size: 14px; }
.recap-preview { border-radius: var(--radius); overflow-x: auto; border: 1px solid var(--line); background: #f8fafc; color: #0f172a; margin: 10px 0; }
.team-list .b-row { width: 100%; display: flex; align-items: center; gap: 8px; background: none; border: none; border-top: 1px solid var(--line); color: var(--text); padding: 10px 2px; font: inherit; text-align: left; cursor: pointer; }
.team-list .b-row .nm { flex: 1; font-weight: 600; }
.team-list .b-row .av { font-weight: 700; font-variant-numeric: tabular-nums; }
.team-list .b-row .av small { color: var(--muted); font-weight: 500; }
.team-list .b-row .em { width: 18px; text-align: center; color: var(--cyan); }
.team-list .b-row .em.none { color: var(--line); }
.team-list .b-row.inactive { opacity: .5; }
.sched-week.cur { border-color: var(--cyan); }
.sched-row { display: flex; gap: 10px; font-size: 14px; padding: 5px 0; border-top: 1px solid var(--line); }
.sched-row span { width: 42px; font-size: 12px; }
.league-row .s + .s { margin-top: 1px; }

@media (max-width: 360px) {
  .pin { width: 40px; height: 40px; }
  .stat-grid.four { grid-template-columns: repeat(2, 1fr); }
}
.quick-row .btn { width: auto; flex: 1; white-space: nowrap; }
.quick-row .btn.quick.strong { flex: 1.5; }
.quick-row .btn#undoBtn { flex: .6; }

/* number inputs: no spinners (they eat the digits on phones) */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.review-frame input { min-width: 0; flex: 1; width: 100%; padding: 8px 0; }
.review-grid.balls { grid-template-columns: repeat(4, 1fr); }
.review-grid.balls .review-frame:last-child { grid-column: span 2; }
.matchup-card .lanes { width: 44px; white-space: normal; }
.matchup-card .lanes b { display: block; font-size: 14px; color: var(--text); white-space: nowrap; }
table.data td.l small { display: block; color: var(--muted); font-size: 11px; }

.btn.btn-danger-solid { background: #dc2626; box-shadow: none; }

details.addr { margin-top: 8px; font-size: 13px; }
details.addr summary { color: var(--cyan); cursor: pointer; }
.addr-list { user-select: all; -webkit-user-select: all; color: var(--muted); margin-top: 6px; word-break: break-all; }
.sample-note .link-btn { padding: 2px 0; }
.badge.league { display: inline-block; max-width: 170px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: -1px; }
.share-grid > :last-child:nth-child(odd) { grid-column: span 2; }

/* ===== v0.3 additions ===== */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.sheet:focus { outline: none; }
fieldset.lanes-fs { border: none; padding: 0; margin: 10px 0; }
fieldset.lanes-fs legend { font-size: 14px; color: var(--muted); padding: 0; margin-bottom: 4px; }
.lane-pair { display: flex; align-items: center; gap: 8px; }
.lane-pair input { margin-top: 0; text-align: center; }
.lane-pair span { color: var(--muted); }
.new-center { border-left: 2px solid var(--cyan); padding-left: 10px; margin: -2px 0 8px; }
.ball-line { display: flex; align-items: center; gap: 10px; margin: 2px 2px 6px; font-size: 13px; color: var(--muted); }
.ball-line select { margin-top: 0; padding: 7px 10px; font-size: 14px; flex: 1; }
.mode-note { font-size: 13px; }
.link-ok { margin-top: 8px; font-size: 13px; color: #2ECC71; }
.link-note { font-size: 12px; color: var(--cyan); margin-top: 6px; }
.game-inputs input.linked { border-color: rgba(246,166,35,.6); background: rgba(246,166,35,.06); }
.badge.sheet-only { background: rgba(148,163,184,.12); color: var(--muted); border-color: var(--line); }
.league-send .btn { width: 100%; }
.send-preview { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
details.defs { margin: 10px 2px; font-size: 13px; color: var(--muted); }
details.defs summary { color: var(--cyan); cursor: pointer; font-weight: 600; }
details.defs ul { padding-left: 18px; margin: 8px 0; }
details.defs li { margin: 4px 0; }
details.defs b { color: var(--text); }
.me-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 50vh; overflow-y: auto; }
.me-pick { background: var(--card2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px; text-align: left; font: inherit; font-weight: 600; cursor: pointer; }
.me-pick small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.sched-row.edit { width: 100%; background: none; border: none; border-top: 1px solid var(--line); color: var(--text); font: inherit; font-size: 14px; text-align: left; cursor: pointer; align-items: center; }
.sched-row .chev { margin-left: auto; color: var(--muted); font-style: normal; }
.draft-note { font-size: 13px; }
.review-frame.scanned { border-color: rgba(251,191,36,.45); }
.backup-note .row { gap: 8px; }
.series-card .d { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.series-card .d .badge { margin-left: 0; }
.badge { display: inline-block; white-space: nowrap; }

.lanes-fs .opt { font-size: 12px; color: var(--muted); opacity: .8; }
.lane-pair input { max-width: 96px; }
.lane-toggle { padding: 6px 2px; white-space: nowrap; }

.import-link { display: block; margin: 14px auto 0; text-align: center; }
.import-preview { margin: 10px 0; display: grid; gap: 4px; }

/* ===== charts (tokens validated: CVD + contrast on the card surface #0e1628) ===== */
:root { --series-1: #F6A623; --series-2: #3498DB; --viz-dot: #6b6459; --viz-grid: rgba(255,247,230,.08); }
.viz { position: relative; }
.viz-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin: -2px 0 6px; }
.viz-legend span { display: inline-flex; align-items: center; gap: 6px; }
.viz-legend .sw { display: inline-block; background: var(--c); }
.viz-legend .sw-dot { width: 8px; height: 8px; border-radius: 50%; }
.viz-legend .sw-line { width: 16px; height: 2px; border-radius: 2px; }
.viz-plot { position: relative; }
.viz-plot svg { display: block; overflow: visible; touch-action: pan-y; }
.viz-plot svg:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; border-radius: 6px; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-axis { fill: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.viz-label { fill: var(--text); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-label.strong { font-weight: 700; }
.viz-dot { fill: var(--viz-dot); }
.viz-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-line.s1 { stroke: var(--series-1); } .viz-line.s2 { stroke: var(--series-2); }
.viz-mark, .viz-end { stroke: var(--card); stroke-width: 2; }
.viz-mark.s1, .viz-end.s1 { fill: var(--series-1); } .viz-mark.s2 { fill: var(--series-2); }
.viz-focus { fill: none; stroke: var(--text); stroke-width: 2; }
.viz-hair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.viz-tip { position: absolute; top: -6px; transform: translateY(-100%); background: #232323; border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 10px; font-size: 12px; color: var(--muted); pointer-events: none; white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,.35); z-index: 3; }
.viz-tip strong { display: block; color: var(--text); font-size: 15px; }
.viz-table { margin-top: 6px; font-size: 13px; }
.viz-table summary { color: var(--cyan); cursor: pointer; font-size: 13px; }
.viz-table table { margin-top: 6px; }

ol.steps { padding-left: 20px; margin: 4px 0 10px; }
ol.steps li { margin: 6px 0; }

ul.import-facts { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 6px; font-size: 13px; }
ul.import-facts li { padding-left: 22px; position: relative; color: var(--muted); }
ul.import-facts li b { color: var(--text); }
ul.import-facts li::before { position: absolute; left: 0; top: 0; font-weight: 800; }
ul.import-facts li.ok::before { content: '✓'; color: #2ECC71; }
ul.import-facts li.warn::before { content: '!'; color: var(--warn); left: 5px; }
.import-check { border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 8px 0; }
.import-check.ok { background: rgba(46,204,113,.08); border: 1px solid rgba(46,204,113,.4); color: #8be3ae; }
.import-check.warn { background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.4); color: #fde68a; }

.game-inputs input[data-abs]::placeholder { color: var(--warn); opacity: .9; font-size: 13px; }

/* ===================== v0.6 ===================== */
:root {
  /* scorecard + accents (from the BowlBoard palette) */
  --paper: #F8EED9; --ink: #1C1B18; --amber: #F6A623; --pin-red: #C1443C; --graphite: #3A3A38;
  --good: #2ECC71; --bad: #fca5a5;
}
svg.ic { width: 1.15em; height: 1.15em; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; flex: none; }
.btn .ic { margin-right: 8px; width: 1.2em; height: 1.2em; }
.btn.small-btn .ic { margin-right: 6px; }
.btn[aria-label] .ic:only-child { margin: 0; }
.kicker { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--cyan); }
.kicker .ic { width: 14px; height: 14px; }
em.up, em.down { font-style: normal; font-weight: 700; }
em.up { color: var(--good); } em.down { color: var(--bad); }
button.card { width: 100%; font: inherit; color: var(--text); text-align: left; cursor: pointer; display: block; }

/* ---- home ---- */
.greet h2 { font-size: 23px; margin: 14px 2px 0; letter-spacing: .2px; }
.greet .small { margin: 0 2px 4px; }
.card.night { padding: 14px 14px 12px; }
.card.night.tonight, .card.this-week.tonight { border-color: rgba(232,163,61,.7); background: linear-gradient(160deg, rgba(232,163,61,.12), var(--card) 55%); }
.card.night.tonight .kicker, .card.this-week.tonight .kicker { color: var(--amber); }
.night-title, .tw-title { font-size: 18px; margin: 6px 0 2px; line-height: 1.3; }
.night-result { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.night-result .pts { font-size: 20px; font-weight: 800; color: var(--cyan); }
.night-result .my-games { font-size: 14px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.night-result .my-games .ic { color: var(--cyan); }
.bowl-btn { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 2px 10px; font-size: 21px; padding: 17px 16px 15px; margin: 12px 0 4px; }
.bowl-btn .ic { width: 26px; height: 26px; margin: 0; }
.bowl-btn small { flex-basis: 100%; font-size: 12px; font-weight: 600; opacity: .88; }
.card.season { padding: 14px; }
.season-row { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.season-avg { min-width: 118px; text-align: center; }
.season-avg b { display: block; font-size: 54px; line-height: 1; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 12px rgba(246,166,35, .3)); }
.season-avg span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.season-avg em { display: block; font-size: 12px; margin-top: 4px; }
.season-stats { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; text-align: center; }
.season-stats b { display: block; font-size: 21px; }
.season-stats span { font-size: 11px; color: var(--muted); }
.card.season .league-chips { justify-content: flex-start; margin-top: 12px; }
.card.last-night .ln-games { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 0; }
.card.last-night .ln-games b { font-size: 28px; }
.card.last-night .ln-games i { color: var(--muted); font-style: normal; }
.card.insight { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; }
.card.insight > .ic { color: var(--amber); width: 20px; height: 20px; margin-top: 2px; }
.card.insight > span:first-of-type { flex: 1; }
.card.insight .more-link { font-size: 12px; color: var(--cyan); white-space: nowrap; align-self: flex-end; font-weight: 700; }
.night-actions .btn { white-space: nowrap; padding: 12px 10px; }
.night-actions .bowl-night { flex: 1.5; }
.photo-tools .btn { flex: 1 1 auto; }
.backup-card.due { display: flex; gap: 12px; align-items: flex-start; border-color: rgba(232,163,61,.55); }
.backup-card.due > .ic { width: 26px; height: 26px; color: var(--amber); margin-top: 2px; }
.backup-ok { display: flex; align-items: center; gap: 6px; color: var(--good); margin: 8px 4px; }
.card.welcome { text-align: center; padding: 22px 16px; }
.welcome-logo { width: 116px; height: 116px; border-radius: 28px; object-fit: cover; border: 1px solid var(--line); box-shadow: var(--glow); }
.card.welcome h2 { font-size: 22px; margin: 14px 0 6px; }
.card.welcome p { margin: 0 0 14px; }
.card.recover { border-color: var(--pin-red); background: rgba(193,68,60,.1); }
.card.recover h3 { display: flex; gap: 8px; align-items: center; }
.card.recover h3 .ic { color: var(--bad); }

/* ---- how are you scoring ---- */
.mode-list { display: grid; gap: 8px; margin: 8px 0; }
.mode-card { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.mode-card .mc-ic { width: 44px; height: 44px; border-radius: 12px; background: var(--card2); display: grid; place-items: center; color: var(--cyan); flex: none; }
.mode-card .mc-ic .ic { width: 24px; height: 24px; }
.mode-card .mc-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.mode-card .t { font-weight: 800; font-size: 16px; }
.mode-card .d { font-size: 13px; color: var(--muted); }
.mode-card .tag { font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--warn); border: 1px solid rgba(251,191,36,.45); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.mode-card.sel { border-color: var(--cyan); background: rgba(246,166,35, .07); box-shadow: var(--glow); }
.mode-card.sel .mc-ic { background: var(--grad); color: #fff; }
.link-hint { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #a5f3fc; background: rgba(246,166,35,.06); border: 1px solid rgba(246,166,35,.25); border-radius: 10px; padding: 8px 10px; margin: 4px 0 8px; }
.link-hint .ic { color: var(--cyan); margin-top: 1px; }

/* ---- the paper scorecard ---- */
.scorecard { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)) minmax(0, 1.5fr); background: var(--paper); color: var(--ink);
  border: 1.5px solid var(--ink); border-radius: 9px; overflow: hidden; margin: 10px 0; box-shadow: 0 8px 22px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.6); font-variant-numeric: tabular-nums; }
.scorecard .frame { display: flex; flex-direction: column; min-height: 68px; min-width: 0; background: transparent; border: 0; border-right: 1px solid rgba(28,27,24,.55); border-radius: 0; padding: 0; margin: 0; color: inherit; font: inherit; position: relative; }
.scorecard .frame:last-child { border-right: 0; }
.scorecard .fnum { font-size: 10px; font-weight: 800; text-align: center; color: #5d584b; background: rgba(28,27,24,.07); border-bottom: 1px solid rgba(28,27,24,.35); line-height: 15px; }
.scorecard .balls { display: flex; justify-content: flex-end; height: 22px; }
.scorecard .balls span { width: 50%; text-align: center; font-size: 13px; font-weight: 800; line-height: 21px; position: relative; }
.scorecard .balls span + span { border-left: 1px solid rgba(28,27,24,.5); border-bottom: 1px solid rgba(28,27,24,.5); }
.scorecard .frame.tenth .balls span { width: 33.34%; border-bottom: 1px solid rgba(28,27,24,.5); }
.scorecard .cum { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; }
.scorecard .cum .pend { color: #8a8475; font-style: normal; letter-spacing: 1px; }
.scorecard .balls span.foul { color: var(--pin-red); }
.scorecard .balls span.split::after { content: ''; position: absolute; left: 50%; top: 50%; width: 15px; height: 15px; transform: translate(-50%, -50%); border: 1.5px solid var(--pin-red); border-radius: 50%; }
.scorecard .frame.cur { background: rgba(232,163,61,.3); box-shadow: inset 0 -3px 0 var(--amber); }
.scorecard .balls span.here { background: rgba(232,163,61,.55); }
.scorecard .balls span.here::before { content: ''; position: absolute; left: 50%; bottom: 3px; width: 8px; height: 2px; margin-left: -4px; background: var(--ink); animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.scorecard.tappable .frame { cursor: pointer; }
.scorecard.tappable .frame:focus-visible { outline: 2px solid var(--ink); outline-offset: -3px; }
.scorecard .frame.flag-good { box-shadow: inset 0 -3px 0 #3f8a5a; }
.scorecard .frame.flag-low { box-shadow: inset 0 0 0 2px var(--amber); background: rgba(232,163,61,.14); }
.scorecard .frame.flag-bad { box-shadow: inset 0 0 0 2px var(--pin-red); background: rgba(193,68,60,.14); }
.scorecard .frame.cur.flag-low, .scorecard .frame.cur.flag-bad, .scorecard .frame.cur.flag-good { background: rgba(232,163,61,.3); }
.scorecard .balls span.pop { animation: pop .42s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(2.1); color: var(--pin-red); } to { transform: none; } }
.score-line .now b { font-variant-numeric: tabular-nums; }

/* ---- pin deck feel ---- */
.pin { transition: background .12s, border-color .12s, color .12s; }
.pin.knock span { display: inline-block; animation: knock .32s ease-out; }
@keyframes knock { 0% { transform: none; } 40% { transform: translateY(3px) rotate(-18deg) scale(.86); } 100% { transform: none; } }
.pin.down { background: rgba(232,163,61,.16); border-color: var(--amber); color: var(--amber); opacity: .8; }
.ball-line .ic { color: var(--muted); }

/* ---- tap-a-frame editor + keypad ---- */
.editor:focus { outline: none; }
.running-strip { display: flex; justify-content: space-between; align-items: baseline; margin: -2px 2px 8px; font-size: 14px; color: var(--muted); }
.running-strip b { color: var(--text); font-size: 20px; font-variant-numeric: tabular-nums; }
.keypad { background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.pad-head { font-size: 13px; font-weight: 700; color: var(--text); margin: 0 2px 8px; }
.keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.key { height: 48px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line); color: var(--text); font: inherit; font-size: 19px; font-weight: 800; cursor: pointer; line-height: 1.05; padding: 0; }
.key small { display: block; font-size: 9px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.key.mark { color: var(--cyan); }
.key.wide { font-size: 13px; }
.key:disabled { opacity: .22; cursor: default; }
.key:not(:disabled):active { transform: scale(.95); background: rgba(246,166,35,.15); }
.key .ic { width: 20px; height: 20px; }

/* ---- photo of the lane screen ---- */
ul.tips { margin: 4px 0 10px; padding-left: 20px; font-size: 14px; }
ul.tips li { margin: 3px 0; }
.crop-wrap { position: relative; width: fit-content; max-width: 100%; margin: 10px auto 6px; border-radius: 10px; overflow: hidden; background: #000; line-height: 0; }
.crop-wrap .photo-preview { display: block; width: auto; height: auto; max-width: 100%; max-height: 360px; margin: 0; border: 0; border-radius: 0; object-fit: fill; }
.crop-wrap { touch-action: manipulation; }
.crop-wrap.cropping { touch-action: none; cursor: crosshair; outline: 2px dashed var(--cyan); outline-offset: -2px; -webkit-user-select: none; user-select: none; }
.crop-box { position: absolute; border: 2px solid var(--amber); border-radius: 3px; box-shadow: 0 0 0 9999px rgba(0,0,0,.5); pointer-events: none; }
details.proc { margin: 8px 0 0; font-size: 13px; }
details.proc summary { color: var(--cyan); cursor: pointer; font-weight: 600; }
details.proc img { width: 100%; margin-top: 6px; border-radius: 8px; background: #fff; border: 1px solid var(--line); }
.draft-note .legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12px; color: var(--text); }
.legend .lg::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend .lg.good::before { background: #3f8a5a; } .legend .lg.low::before { background: var(--amber); } .legend .lg.bad::before { background: var(--pin-red); }

/* ---- links between your log and the league sheet ---- */
.link-card { display: flex; gap: 10px; align-items: flex-start; background: rgba(246,166,35,.07); border: 1px solid rgba(246,166,35,.4); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; color: var(--text); font-size: 14px; }
.link-card > .ic { width: 22px; height: 22px; color: var(--cyan); margin-top: 1px; }
.link-card b { color: var(--cyan); }
.link-card .small { color: var(--muted); margin-top: 2px; }
.link-ok .ic { color: var(--cyan); }
.badge.linked { background: rgba(246,166,35,.1); color: var(--cyan); border-color: rgba(246,166,35,.4); display: inline-flex; align-items: center; gap: 3px; }
.badge.linked .ic { width: 11px; height: 11px; }
.link-note { display: flex; gap: 6px; align-items: flex-start; }
.link-note .ic { width: 15px; height: 15px; margin-top: 1px; }
.line.me { background: rgba(246,166,35,.04); border-radius: 8px; }

/* ---- stats ---- */
.stat-card em { display: block; font-size: 11px; margin-top: 3px; font-style: normal; font-weight: 700; }
.stat-card em:not(.up):not(.down) { color: var(--muted); }
.card.insights h3, .card h3 { display: flex; align-items: center; gap: 7px; }
.card.insights h3 .ic { color: var(--amber); }
.card.insights ul { list-style: none; margin: 0; padding: 0; }
.card.insights li { position: relative; padding: 9px 0 9px 20px; border-top: 1px solid var(--line); font-size: 14px; }
.card.insights li::before { content: ''; position: absolute; left: 3px; top: 15px; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); }
.card.insights li.up::before { background: var(--good); } .card.insights li.down::before { background: var(--amber); }
.form-games { display: flex; gap: 6px; margin-bottom: 8px; }
.form-g { flex: 1; min-width: 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 0 6px; color: var(--text); font: inherit; cursor: pointer; text-align: center; }
.form-g b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; }
.form-g small { font-size: 10px; color: var(--muted); }
.form-g.hi { border-color: rgba(246,166,35,.55); }
.form-g.hi b { color: var(--cyan); }
.consistency { display: flex; gap: 12px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.consistency > b { font-size: 20px; color: var(--text); white-space: nowrap; }
.consistency span b { color: var(--text); }
.link-btn.inline { padding: 0; font-size: inherit; font-weight: 600; }
.ball-head { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.ball-head .screen-title { margin: 0; }
.ball-ic { width: 44px !important; height: 44px !important; color: var(--cyan); stroke-width: 1.5 !important; }
ul.plain { margin: 0; padding-left: 18px; font-size: 14px; }
ul.plain li { margin: 5px 0; }
.chip small { font-weight: 500; color: var(--muted); font-size: 11px; }

/* ---- more ---- */
.group-title { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin: 18px 4px 2px; }
.li-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--card2); display: grid; place-items: center; color: var(--cyan); flex: none; }
.li-ic .ic { width: 21px; height: 21px; }
.nav-item .chev .ic { width: 18px; height: 18px; }
.nav-item .chev { display: flex; }
.nav-item[data-due] .s { color: var(--warn); }
.toggle-item { cursor: pointer; }
input.switch { -webkit-appearance: none; appearance: none; width: 48px; height: 28px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
input.switch::before { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
input.switch:checked { background: var(--cyan); }
input.switch:checked::before { transform: translateX(20px); }
.ball-open { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; background: none; border: 0; padding: 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.about p { margin: 6px 0; }

/* ---- backup ---- */
.backup-status { display: flex; gap: 12px; align-items: flex-start; }
.bs-ic { width: 34px !important; height: 34px !important; color: var(--cyan); margin-top: 2px; }
.backup-status.ok .bs-ic { color: var(--good); } .backup-status.due .bs-ic { color: var(--amber); }
.backup-status.due { border-color: rgba(232,163,61,.55); }
.bs-label { font-size: 21px; font-weight: 800; margin: 2px 0; }
.backup-status.ok .bs-label { color: var(--good); }
.snap-list .snap { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.snap .t { font-weight: 700; font-size: 14px; }
.snap .s { font-size: 12px; color: var(--muted); }

/* ---- league ---- */
.card.intro .intro-ic { width: 46px; height: 46px; color: var(--cyan); stroke-width: 1.5; }
.card.this-week { margin-top: 12px; }
.this-week .link-btn { padding-bottom: 0; }
.seg { overflow: visible; margin: 12px 0 4px; padding: 0; }
.seg button { flex: 1 1 0; min-width: 0; padding: 7px 2px; font-size: 13.5px; }
.seg button.admin-tab { flex: 0 0 auto; padding: 5px 11px; }
.seg button .ic { width: 18px; height: 18px; vertical-align: -4px; }
.admin-note { display: flex; align-items: center; gap: 6px; margin: 10px 2px 4px; }
.subseg { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.subseg button { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 10px; padding: 7px 11px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.subseg button.on { color: var(--text); border-color: var(--cyan); background: rgba(246,166,35,.08); }
.matchup-card.mine { border-color: rgba(246,166,35,.55); }
.sched-row.mine { color: var(--cyan); font-weight: 600; }
.sched-tools { margin: 10px 0 4px; }
.dup-note label.check { margin: 8px 0 0; color: #fde68a; }
.team-list .b-row .em .ic { width: 15px; height: 15px; }

@media (prefers-reduced-motion: reduce) {
  .screen, .pin.knock span, .scorecard .balls span.pop, .scorecard .balls span.here::before { animation: none !important; }
}
@media (max-width: 360px) {
  .scorecard .balls span { font-size: 12px; }
  .season-avg { min-width: 96px; } .season-avg b { font-size: 44px; }
  .keys { gap: 4px; } .key { height: 44px; }
}

/* ===================== v0.7: brand v0.1 (lane gold) ===================== */
h1, h2, h3, .screen-title, .btn, .kicker, .big-score, .stat-card b, .season-avg b, .bc-title, .bs-label, .night-title, .tw-title { font-family: var(--font-head); }
.btn { color: #1a1206; box-shadow: 0 6px 18px rgba(246,166,35,.18); }
.btn.secondary { color: var(--text); }
.btn .ic { stroke-width: 2.1; }
.link-btn, .back-link { color: var(--gold); }
.scan-status.good, .link-ok { color: var(--good); }
/* header: wordmark left, gear right */
.app-header { padding-top: calc(8px + env(safe-area-inset-top, 0px)); padding-bottom: 8px; }
.app-wordmark { height: 40px; width: auto; display: block; flex: none; image-rendering: auto; object-fit: contain; object-position: left center; }
.hdr-gear, .app-wordmark, .hdr-gear .ic { -webkit-transform: none; transform: none; -webkit-backface-visibility: visible; backface-visibility: visible; }
.hdr-gear { background: none; border: 0; color: var(--gold); width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; border-radius: 12px; flex: none; }
.hdr-gear .ic { width: 26px; height: 26px; stroke-width: 1.7; shape-rendering: geometricPrecision; }
/* tab bar: gold active item with an underline */
.tabbar button { position: relative; }
.tabbar button.active { color: var(--gold); background: none; }
.tabbar button.active::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: -2px; height: 3px; border-radius: 3px; background: var(--gold); }
.tabbar button.active .ic { fill: rgba(246,166,35,.18); }
/* home backdrop: blurred lane at the top, fading into charcoal */
#screen-home { position: relative; }
.home-backdrop { position: absolute; left: -16px; right: -16px; top: calc(-1 * var(--header-h, 70px)); height: 420px; z-index: -1; overflow: hidden; pointer-events: none; }
.home-backdrop img { width: 100%; height: 100%; object-fit: cover; filter: blur(3px) saturate(1.2); transform: scale(1.08); opacity: .8; }
.home-backdrop::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14,14,14,.35) 0%, rgba(14,14,14,.55) 45%, var(--bg) 100%); }
.screens { position: relative; z-index: 0; }
.greet h2 { font-size: 26px; margin: 18px 2px 10px; }
/* the BOWL hero */
.bowl-card { display: flex; align-items: center; gap: 10px; padding: 16px 12px; margin: 8px 0 14px; border: 2px solid var(--gold); border-radius: 18px;
  background: linear-gradient(135deg, rgba(14,14,14,.92), rgba(26,22,17,.92)); box-shadow: 0 10px 28px rgba(0,0,0,.45), 0 0 22px rgba(246,166,35,.15); cursor: pointer; }
.bowl-card .bc-mark { width: 66px; height: auto; flex: none; }
.bowl-card .bc-body { flex: 1; min-width: 0; }
.bowl-card .bc-title { font-size: 40px; font-weight: 700; line-height: 1; letter-spacing: 1px; color: #FFF7E6; }
.bowl-card .bc-sub { font-size: 16px; font-weight: 600; margin: 4px 0 10px; }
.bc-modes { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0; border: 1px solid rgba(255,247,230,.25); border-radius: 16px; padding: 2px 5px; }
.bc-modes button { background: none; border: 0; color: var(--text); font: inherit; font-size: 12px; padding: 4px 4px; white-space: nowrap; cursor: pointer; border-radius: 999px; }
.bc-modes button:hover { color: var(--gold); }
.bc-modes i { color: var(--muted); font-style: normal; font-size: 10px; }
.bc-go { flex: none; width: 50px; height: 50px; border-radius: 50%; border: 0; background: var(--grad); color: #1a1206; display: grid; place-items: center; cursor: pointer; box-shadow: 0 0 18px rgba(246,166,35,.35); }
.bc-go .ic { width: 28px; height: 28px; stroke-width: 2.4; }
.bc-alt { display: block; margin: -6px auto 12px; text-align: center; }
/* this season: paper card */
.card.season-card { background: var(--paper); color: var(--ink); border: 0; border-radius: 18px; padding: 16px 16px 12px; box-shadow: 0 8px 22px rgba(0,0,0,.35); }
.season-card .kicker { color: var(--ink); letter-spacing: 2.5px; font-size: 12px; }
.season-top { display: flex; align-items: flex-end; gap: 10px; }
.season-top .sa { flex: none; }
.season-top .sa b { display: block; font-family: var(--font-head); font-size: 64px; line-height: .95; font-weight: 700; color: var(--ink); margin-top: 6px; }
.season-top .sa span { display: block; font-size: 13px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; margin-top: 4px; }
.season-top .sa em { display: block; font-style: normal; font-size: 14px; margin-top: 6px; }
.season-top .sa em.up { color: #1e8a4c; } .season-top .sa em.down { color: #b23a2e; }
.season-top svg { flex: 1; min-width: 0; height: 90px; }
.season-row3 { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid rgba(28,27,24,.18); margin-top: 12px; padding-top: 10px; text-align: center; }
.season-row3 div + div { border-left: 1px solid rgba(28,27,24,.18); }
.season-row3 b { display: block; font-family: var(--font-head); font-size: 26px; font-weight: 700; }
.season-row3 span { font-size: 11px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; }
/* last session */
.card.last-session { background: rgba(14,14,14,.85); border-radius: 18px; padding: 14px 16px; }
.last-session .ls-head { display: flex; justify-content: space-between; align-items: baseline; }
.last-session .ls-head small { color: var(--muted); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.last-session .kicker { color: var(--text); letter-spacing: 2.5px; }
.ls-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.ls-games { flex: 1; min-width: 0; }
.ls-games .g { font-family: var(--font-head); font-size: 28px; font-weight: 700; }
.ls-games .g i { color: var(--muted); font-style: normal; margin: 0 8px; font-size: 20px; }
.ls-games small { display: block; color: var(--muted); letter-spacing: 2px; font-size: 12px; text-transform: uppercase; margin-top: 2px; }
.btn-outline { background: none; border: 1.5px solid var(--gold); color: var(--gold); border-radius: 999px; padding: 9px 14px; font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
/* your game insight */
.card.your-game { display: flex; align-items: center; gap: 12px; border: 1.5px solid rgba(246,166,35,.7); border-radius: 18px; background: linear-gradient(135deg, rgba(246,166,35,.13), rgba(26,22,17,.9) 60%); }
.your-game > .ic { width: 30px; height: 30px; color: var(--gold); flex: none; }
.your-game .yg { flex: 1; min-width: 0; }
.your-game .kicker { letter-spacing: 2.5px; }
.your-game .yg-title { font-family: var(--font-head); font-size: 18px; font-weight: 700; margin: 4px 0 2px; }
.your-game .yg-text { font-size: 14px; color: var(--text); opacity: .85; }
.your-game .chev .ic { color: var(--gold); width: 20px; height: 20px; }
/* league: contextual, quieter */
.card.night { background: rgba(26,22,17,.9); }
.card.night .night-title { font-size: 16px; }
.card.night.tonight { border-color: rgba(246,166,35,.55); background: rgba(26,22,17,.95); }
.card.welcome .welcome-logo { width: 240px; height: auto; border: 0; box-shadow: none; border-radius: 0; }
.card.welcome .tagline { font-family: var(--font-head); font-size: 15px; letter-spacing: 3px; text-transform: uppercase; color: var(--gold); margin: 6px 0 12px; }
.about .tagline { font-family: var(--font-head); letter-spacing: 3px; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.about img { border: 0; width: 220px; }
/* iPhone Safari gives date boxes their own width and centred text: make them behave */
input[type=date] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; min-height: 46px; text-align: left; }
input[type=date]::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type=date]::-webkit-calendar-picker-indicator { filter: invert(.8) sepia(1) saturate(4) hue-rotate(-10deg); }
a { color: var(--gold); }

.your-game .yg > span { display: block; }
.bowl-card .bc-title { font-size: 38px; }

/* v0.7.1: the Bowl card's three scoring modes sit on their own full-width row */
.bowl-card { flex-wrap: wrap; row-gap: 12px; }
.bowl-card .bc-sub { margin-bottom: 0; }
.bowl-card .bc-modes { display: flex; flex: 1 1 100%; justify-content: space-evenly; padding: 4px 6px; }
.bc-modes button { font-size: 13px; padding: 5px 6px; }

/* v0.8: final brand (cream icon, clean wordmark) */
.bowl-card .bc-mark { width: 64px; height: 64px; border-radius: 15px; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.card.welcome .welcome-icon { display: block; width: 96px; height: 96px; margin: 0 auto 10px; border-radius: 22px; box-shadow: 0 8px 22px rgba(0,0,0,.5); }
.card.welcome .welcome-logo { width: 220px; height: auto; }
.about .about-icon { display: block; width: 84px; height: 84px; margin: 0 auto 8px; border-radius: 19px; }
.about .about-wordmark { display: block; width: 200px; margin: 0 auto 4px; }
.app-wordmark { height: 40px; }

/* v0.8: the league is read-only for bowlers */
.line-top .who { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.game-scores { display: flex; gap: 6px; align-items: center; }
.game-scores .gs { flex: 1; min-width: 0; text-align: center; padding: 9px 2px; font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--card2); border: 1px solid var(--line); border-radius: 10px; }
.game-scores .gs.none { color: var(--muted); font-weight: 500; }
.game-scores .gs.abs { color: var(--warn); font-size: 14px; }
.game-scores .gs.linked { border-color: rgba(246,166,35,.6); background: rgba(246,166,35,.06); }
.game-scores .ser { width: 76px; text-align: right; line-height: 1.1; }
.game-scores .ser b { display: block; font-size: 18px; }
.game-scores .ser small { font-size: 11px; color: var(--muted); }
.link-note .link-btn.inline { margin-left: auto; flex: none; }
.card.league-options { margin-top: 16px; }
.card.league-options h3 { margin-bottom: 2px; }
.link-btn.danger-link { color: var(--danger); margin-top: 10px; display: block; font-weight: 500; }

/* v0.8: importing scores */
.field-label { font-size: 13px; color: var(--muted); margin: 12px 2px 6px; }
.field-label small { font-size: 12px; }
.chips .chip:disabled { opacity: .35; cursor: default; }
.more-cols { margin-top: 10px; }
.more-cols summary { cursor: pointer; color: var(--gold); font-size: 14px; font-weight: 600; padding: 4px 0; }
.import-preview .table-wrap { margin-top: 8px; }
.import-preview .small { margin: 4px 0; }

/* v0.8: exporting games */
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.head-row .link-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; padding: 8px 2px; flex: none; }
.head-row .link-btn .ic { width: 18px; height: 18px; }
.export-list .list-item:disabled { opacity: .45; cursor: default; }

/* v0.8: achievements */
.coin { width: 52px; height: 52px; border-radius: 50%; flex: none; display: inline-grid; place-content: center; justify-items: center; text-align: center; line-height: 1; font-family: var(--font-head); color: var(--muted); background: var(--card2); border: 2px dashed #4a4236; }
.coin b { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.coin b.sm { font-size: 12px; }
.coin small { font-size: 7.5px; letter-spacing: .8px; font-weight: 700; margin-top: 2px; opacity: .9; }
.coin .ic { width: 26px; height: 26px; }
.coin.on { color: #2a1a03; background: radial-gradient(circle at 32% 26%, #ffe7ad 0%, #f6b042 45%, #c97d0d 100%); border: 2px solid rgba(255,236,190,.6); box-shadow: 0 2px 12px rgba(246,166,35,.3), inset 0 -3px 5px rgba(120,60,0,.28); }
.coin.lg { width: 104px; height: 104px; }
.coin.lg b { font-size: 34px; }
.coin.lg b.sm { font-size: 22px; }
.coin.lg small { font-size: 12px; margin-top: 4px; }
.coin.lg .ic { width: 50px; height: 50px; }
.bar { height: 6px; border-radius: 3px; background: var(--card2); overflow: hidden; margin: 8px 0 4px; }
.bar i { display: block; height: 100%; background: var(--gold); border-radius: 3px; }
.ach-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ach-head h3 { margin: 0; }
.ach-head h3 .ic { margin-right: 6px; color: var(--gold); }
.ach-count { font-size: 14px; color: var(--muted); white-space: nowrap; }
.ach-count b { color: var(--text); font-size: 18px; font-family: var(--font-head); }
.ach-recent { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.ach-chip { background: none; border: none; padding: 2px; cursor: pointer; flex: none; }
.ach-summary .ach-total { font-size: 16px; }
.ach-summary .ach-total b { font-size: 30px; font-family: var(--font-head); color: var(--gold); }
.ach-row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin: 8px 0; color: var(--text); font: inherit; cursor: pointer; }
.ach-row .grow { min-width: 0; }
.ach-row .t { font-weight: 700; }
.ach-row .s { font-size: 13px; color: var(--muted); }
.ach-row .ok { font-size: 13px; color: var(--gold); font-weight: 600; margin-top: 2px; }
.ach-row.locked .t { color: #d8d0c0; }
.ach-row .chev { color: var(--muted); display: flex; }
.ach-row .chev .ic { width: 18px; height: 18px; }
.card.ach-new { border-color: rgba(246,166,35,.55); background: linear-gradient(180deg, rgba(246,166,35,.10), var(--card) 70%); }
.ach-new-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.ach-new-row .t { font-weight: 700; }
.ach-new-row .s { font-size: 13px; color: var(--muted); }
.ach-new-row .link-btn { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.ach-hero { display: flex; align-items: center; gap: 16px; margin: 4px 0 12px; }
.ach-hero p { margin: 0; color: var(--text); }
.ach-when { margin: 8px 0 14px; }
.card .kicker .ic { margin-right: 4px; }

/* v0.8: share cards */
.share-preview { background: #000; border-radius: 12px; overflow: hidden; margin: 4px 0 12px; min-height: 120px; display: grid; place-items: center; }
.share-preview img { display: block; width: 100%; max-height: 52vh; object-fit: contain; }
.share-opts { margin-bottom: 12px; }
.btn .ic { flex: none; }

/* v0.8: balls (a generic ball tinted by brand), the add-a-ball form, and the collapsed "Details" row on New game */
.ballico { --bt: hsl(210 62% 46%); --bt-hi: hsl(210 72% 70%); --bt-lo: hsl(210 60% 20%); display: inline-block; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 61% 27%, rgba(0,0,0,.72) 0 6%, transparent 7.5%), radial-gradient(circle at 73% 36%, rgba(0,0,0,.72) 0 6%, transparent 7.5%),
    radial-gradient(circle at 62% 42%, rgba(0,0,0,.72) 0 6%, transparent 7.5%), radial-gradient(circle at 34% 28%, var(--bt-hi) 0, var(--bt) 46%, var(--bt-lo) 100%);
  box-shadow: inset -2px -3px 6px rgba(0,0,0,.35), 0 1px 3px rgba(0,0,0,.45); }
.ballico.lg { width: 52px; height: 52px; }
.li-ic.ball { background: none; }
.ball-head .ballico { width: 48px; height: 48px; }
.ball-pick { display: flex; align-items: flex-start; gap: 12px; }
.ball-pick .grow { min-width: 0; }
.ball-pick-ic { margin-top: 30px; flex: none; }
.ball-form .opt { font-size: 12px; opacity: .8; }
.ng-more { margin-top: 6px; border-top: 1px solid var(--line); }
.ng-more > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 2px 8px; cursor: pointer; }
.ng-more > summary::-webkit-details-marker { display: none; }
.ng-more-main { flex: 1; min-width: 0; display: block; }
.ng-more-t { display: block; font-weight: 700; }
.ng-more-t .opt { font-weight: 500; font-size: 13px; color: var(--muted); }
.ng-more-s { display: block; font-size: 14px; color: var(--text); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ng-more-s.none { color: var(--muted); }
.ng-more[open] .ng-more-s { display: none; }
.ng-more > summary .chev { display: flex; color: var(--muted); transition: transform .15s; }
.ng-more[open] > summary .chev { transform: rotate(90deg); }
.ng-more > summary .chev .ic { width: 18px; height: 18px; }
.ng-more-body { padding-top: 2px; }

/* v0.8: photo of the lane screen — "Copy scan details" under the scan tools */
.scan-tools { display: flex; flex-direction: column; align-items: flex-start; gap: 0; margin: 6px 0 0; }
.scan-tools .link-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 0 2px; }
.scan-tools .link-btn .ic { width: 16px; height: 16px; }
.scan-tools .small { line-height: 1.35; }

/* v0.9: verification-first photo result */
.scan-summary { display:flex; align-items:center; gap:14px; margin:12px 0 10px; padding:14px; border-radius:16px; background:linear-gradient(135deg, rgba(246,166,35,.12), rgba(26,22,17,.86)); border:1.5px solid rgba(246,166,35,.55); }
.scan-summary.ready { border-color:rgba(46,204,113,.45); background:rgba(46,204,113,.07); }
.scan-summary-score { width:76px; flex:none; text-align:center; }
.scan-summary-score b { display:block; font-family:var(--font-head); font-size:38px; line-height:1; }
.scan-summary-score span { display:block; margin-top:4px; color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:1.8px; }
.scan-summary-copy { min-width:0; }
.scan-summary-copy b { display:block; font-family:var(--font-head); font-size:18px; }
.scan-summary-copy span { display:block; color:var(--muted); font-size:13px; line-height:1.35; margin-top:3px; }
.scan-summary.ready .scan-summary-copy b { color:var(--good); }
/* v0.9: onboarding is a deliberate choice, not an empty dashboard */
.welcome-choice { margin-top:14px; padding-top:14px; border-top:1px solid var(--line); text-align:left; }
.welcome-choice b { font-family:var(--font-head); font-size:16px; }
.welcome-choice p { margin:4px 0 0; font-size:13px; }


/* v1.0: history calendar */
.calendar-toggle { display:flex; gap:8px; margin:10px 0 12px; }
.calendar-toggle .btn { flex:1; }
.cal-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.cal-head h3 { margin:0; }
.cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:5px; }
.cal-dow { text-align:center; font-size:10px; font-weight:700; color:var(--muted); padding:3px 0; }
.cal-day { min-height:54px; border:1px solid var(--line); border-radius:10px; background:var(--paper); padding:5px; text-align:left; position:relative; }
.cal-day.muted { opacity:.38; }
.cal-day.today { outline:2px solid var(--amber); outline-offset:-2px; }
.cal-day.has-games { cursor:pointer; }
.cal-num { font-size:11px; font-weight:700; }
.cal-score { display:block; margin-top:5px; font-size:14px; font-weight:800; }
.cal-meta { display:block; font-size:9px; color:var(--muted); margin-top:1px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.season-wrap-card { margin-top:12px; }

/* v1.2: session detail — make a bowling night feel like a first-class object. */
.session-hero { background: linear-gradient(135deg, rgba(246,166,35,.16), rgba(26,22,17,.96) 62%); border: 1.5px solid rgba(246,166,35,.55); }
.session-score { display:flex; align-items:flex-end; gap:14px; }
.session-score .big-score { margin:0; }
.session-score .session-series-label { color:var(--muted); font-size:12px; letter-spacing:2px; text-transform:uppercase; margin-bottom:8px; }
.session-games { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:14px; }
.session-game { background:rgba(14,14,14,.7); border:1px solid var(--line); border-radius:12px; padding:10px 6px; text-align:center; cursor:pointer; color:var(--text); }
.session-game b { display:block; font-family:var(--font-head); font-size:26px; }
.session-game small { color:var(--muted); font-size:11px; letter-spacing:1px; text-transform:uppercase; }
.session-context { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; }
.session-context .ctx { background:var(--card2); border-radius:12px; padding:10px; }
.session-context small { display:block; color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:1px; }
.session-context b { display:block; margin-top:2px; font-size:14px; }
.session-actions { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
@media (max-width:380px) { .session-games { grid-template-columns:repeat(2,1fr); } }

/* Accounts beta */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 12px 0 14px; background: var(--surface-2, #171717); border: 1px solid var(--line, #2a2a2a); border-radius: 12px; }
.segmented button { border: 0; background: transparent; color: var(--muted, #999); border-radius: 9px; padding: 9px 10px; font: inherit; font-weight: 700; cursor: pointer; }
.segmented button.active { background: var(--surface, #242424); color: var(--text, #fff); }


/* Redesign phase 1 — scoped to home quick actions and live roll entry. */
.home-shortcuts { display:grid; gap:9px; margin:12px 0 16px; }
.home-shortcut { display:flex; align-items:center; gap:12px; width:100%; min-height:60px; padding:12px 14px; text-align:left; color:#F0EAD6; background:#262421; border:1px solid #3A3A38; border-radius:14px; cursor:pointer; }
.home-shortcut span { flex:1; min-width:0; }
.home-shortcut b, .home-shortcut small { display:block; }
.home-shortcut b { font-size:15px; }
.home-shortcut small { font-size:12px; color:#BDB4A5; margin-top:2px; }
.home-shortcut .ic { color:#E8A33D; width:21px; height:21px; }
.home-shortcut:active { background:#3A3A38; }
#screen-home .card.welcome #homeNew { background:#E8A33D; color:#1C1B18; box-shadow:none; }
#screen-home .bowl-card { border-color:#E8A33D; }
#screen-home .bowl-card .bc-title { font-size:clamp(25px,7vw,36px); color:#F0EAD6; letter-spacing:0; }
.roll-switch { display:grid; grid-template-columns:1fr 1fr; gap:5px; padding:4px; background:#1C1B18; border:1px solid #3A3A38; border-radius:12px; margin:12px 0 8px; }
.roll-switch button { font:inherit; font-size:14px; font-weight:700; min-height:44px; border:0; border-radius:9px; color:#F0EAD6; background:transparent; cursor:pointer; }
.roll-switch button[aria-pressed="true"] { background:#E8A33D; color:#1C1B18; }
.roll-switch button:disabled { opacity:.42; cursor:default; }
.roll-note { margin:6px 0; }
.roll-panel { background:#1C1B18; border:1px solid #3A3A38; border-radius:16px; padding:14px; margin:8px 0 12px; }
.roll-heading { display:flex; justify-content:space-between; align-items:center; gap:8px; margin-bottom:8px; }
.roll-heading b { display:block; font-size:21px; color:#F0EAD6; }
.roll-heading small { display:block; color:#BDB4A5; font-size:12px; }
.roll-heading > span { color:#E8A33D; font-size:13px; }
.roll-keypad { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.roll-keypad button { min-height:54px; border:1px solid #514C45; border-radius:11px; background:#302D28; color:#F0EAD6; font:inherit; font-size:24px; font-weight:700; cursor:pointer; }
.roll-keypad button:disabled { opacity:.32; cursor:default; }
.roll-keypad button.roll-clear { background:#E8A33D; border-color:#E8A33D; color:#1C1B18; }
.roll-keypad button:active:not(:disabled) { transform:scale(.97); }
.roll-foul { display:block; width:100%; min-height:44px; color:#F0EAD6; background:none; border:1px solid #514C45; border-radius:10px; font:inherit; font-weight:600; margin-top:8px; cursor:pointer; }
.home-shortcut:focus-visible,.roll-switch button:focus-visible,.roll-keypad button:focus-visible,.roll-foul:focus-visible { outline:2px solid #E8A33D; outline-offset:2px; }


/* Approved redesign: warm ink, paper and amber. Scoped to the main screens. */
:root { --bb-ink:#1C1B18; --bb-paper:#F0EAD6; --bb-amber:#E8A33D; --bb-red:#C1443C; --bb-graphite:#3A3A38; }
#screen-home,#screen-entry,#screen-history,#screen-stats,#screen-photo { --card:#24221e; --card2:#302d28; --line:#48433b; --text:var(--bb-paper); --muted:#BDB4A5; --gold:var(--bb-amber); --cyan:var(--bb-amber); --amber:var(--bb-amber); --grad:linear-gradient(135deg,#efb453,#E8A33D); }
#screen-home .home-brand { display:grid; justify-items:center; gap:4px; padding:16px 0 8px; }
#screen-home .home-brand > img:first-child { width:86px; height:86px; object-fit:contain; border-radius:19px; }
#screen-home .home-brand-wordmark { width:min(220px,75%); height:auto; }
#screen-home .home-brand p { font-size:11px; letter-spacing:2.6px; text-transform:uppercase; font-weight:700; color:var(--bb-paper); margin:0; }
#screen-home .card.welcome { background:rgba(28,27,24,.9); border-color:#48433b; }
#screen-home .bowl-card { background:#E8A33D; color:#1C1B18; border:0; box-shadow:0 5px 16px rgba(0,0,0,.25); }
#screen-home .bowl-card .bc-title,#screen-home .bowl-card .bc-sub { color:#1C1B18; }
#screen-home .bowl-card .bc-sub { font-size:13px; }
#screen-home .bc-go { color:#F0EAD6; background:#1C1B18; box-shadow:none; }
#screen-home .bc-modes { border-color:rgba(28,27,24,.36); }
#screen-home .bc-modes button,#screen-home .bc-modes i { color:#1C1B18; }
#screen-home .home-shortcut { min-height:64px; }
#screen-home .home-shortcut > .ic:last-child { width:16px; height:16px; color:#BDB4A5; }
#screen-entry .score-line { padding:12px; border:1px solid #48433b; background:#24221e; border-radius:12px; margin:8px 0; }
#screen-entry .score-line .now b { font-size:32px; color:var(--bb-amber); }
#screen-entry .scorecard { --paper:#F0EAD6; }
#screen-entry .scorecard .frame.cur { box-shadow:inset 0 -4px 0 #C27B15; }
#screen-history .history-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; padding:12px 6px; margin:10px 0 14px; border:1px solid #48433b; border-radius:14px; background:#24221e; text-align:center; }
.history-summary b { display:block; font-size:24px; color:var(--bb-amber); font-variant-numeric:tabular-nums; }
.history-summary small { display:block; font-size:11px; color:#BDB4A5; }
#screen-history .series-card { border-color:#48433b; border-radius:15px; padding:14px; }
#screen-history .series-card .score { color:#E8A33D; background:none; -webkit-text-fill-color:currentColor; }
#screen-history .series-card .score small { color:#BDB4A5; -webkit-text-fill-color:currentColor; }
#screen-history .filters,#screen-stats .filters { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
#screen-history .filters select,#screen-stats .filters select { width:100%; min-width:0; }
#screen-stats .stats-hero { padding:22px 16px; text-align:center; background:#24221e; }
.stats-hero .kicker { justify-content:center; color:#BDB4A5; }
.stats-average { color:var(--bb-amber); font-family:var(--font-head); font-size:64px; font-weight:700; line-height:1.15; font-variant-numeric:tabular-nums; }
.stats-hero em { display:block; margin:2px 0 5px; }
.stats-records .stat-card b { color:var(--bb-paper); background:none; -webkit-text-fill-color:currentColor; }
#screen-stats .stats-trend h3 { font-size:16px; }
.scan-example { margin:12px 0; }
.scan-example img { display:block; width:100%; border-radius:12px; }
.scan-example figcaption { font-size:12px; color:#BDB4A5; text-align:center; margin-top:6px; }
#screen-photo .crop-box { border-color:var(--bb-amber); }
#screen-photo .crop-wrap.cropping { outline-color:var(--bb-amber); }
#screen-home .btn:not(.secondary):not(.danger),#screen-entry .btn:not(.secondary):not(.danger),#screen-photo .btn:not(.secondary):not(.danger),#screen-history .btn:not(.secondary):not(.danger) { color:#1C1B18; }
@media (max-width:360px) { #screen-home .bowl-card .bc-title { font-size:24px; } .stats-average { font-size:56px; } }
@media (prefers-reduced-motion:reduce) { #screen-entry .roll-keypad button:active { transform:none; } }


/* Redesign: standalone vector branding and compact two-row live scorecard. */
.app-header .app-wordmark { height:38px; width:auto; max-width:210px; }
#screen-home .home-brand { padding:12px 0 6px; gap:0; }
#screen-home .home-brand > img:first-child { width:103px; height:103px; border-radius:0; }
#screen-home .home-brand-wordmark { width:min(240px,78%); height:auto; }
#screen-home .home-brand p { margin-top:4px; letter-spacing:2.5px; }
#screen-home .card.welcome .welcome-icon { width:110px; height:110px; box-shadow:none; border-radius:0; margin-bottom:0; }
#screen-home .card.welcome .welcome-logo { width:min(245px,90%); }
#screen-home .card.welcome .tagline { font-size:12px; color:#F0EAD6; }
#screen-home .bowl-card { padding:13px 14px; min-height:76px; flex-wrap:nowrap; border-radius:18px; }
#screen-home .bowl-card .bc-mark { width:44px; height:44px; box-shadow:none; border-radius:0; }
#screen-home .bowl-card .bc-title { font-size:clamp(21px,6vw,29px); }
#screen-home .bc-go { width:40px; height:40px; }
#screen-home .bc-go .ic { width:22px; height:22px; }
#screen-home .home-shortcuts { gap:9px; margin-top:10px; }
#screen-home .home-shortcut { border-radius:18px; background:#25231f; min-height:58px; }
#screen-home .home-shortcut b { font-size:16px; }
#screen-home .home-shortcut small { font-size:11px; }
#screen-entry #scoreWrap .scorecard { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); grid-auto-rows:minmax(62px,auto); gap:5px; border:0; background:transparent; color:#F0EAD6; box-shadow:none; overflow:visible; }
#screen-entry #scoreWrap .scorecard .frame { min-height:62px; border:1px solid #48433b; border-radius:8px; background:#24221e; overflow:hidden; }
#screen-entry #scoreWrap .scorecard .fnum { background:#302d28; color:#BDB4A5; border-bottom:1px solid #48433b; font-size:11px; line-height:17px; }
#screen-entry #scoreWrap .scorecard .balls { height:23px; }
#screen-entry #scoreWrap .scorecard .balls span { border-color:#48433b; font-size:14px; }
#screen-entry #scoreWrap .scorecard .cum { font-size:16px; }
#screen-entry #scoreWrap .scorecard .frame.cur { border-color:#E8A33D; box-shadow:inset 0 0 0 1px #E8A33D; background:#30281b; }
#screen-entry #scoreWrap .scorecard .frame.cur .fnum { background:#E8A33D; color:#1C1B18; }
#screen-entry #scoreWrap .scorecard .balls span.here { background:rgba(232,163,61,.25); }
#screen-entry #scoreWrap .scorecard .balls span.here::before { background:#E8A33D; }
#screen-entry #scoreWrap .scorecard .cum .pend { color:#BDB4A5; }
#screen-entry #scoreWrap .scorecard .balls span.foul { color:#ff9287; }
#screen-entry #scoreWrap .score-line { padding:7px 12px; }
#screen-entry .roll-keypad button { min-height:48px; }
#screen-entry .roll-heading b { font-size:19px; }
#screen-entry .roll-panel { padding:12px; }
#screen-entry .roll-switch { margin:8px 0 6px; }
@media(max-width:360px) { #screen-entry #scoreWrap .scorecard { gap:3px; } #screen-entry #scoreWrap .scorecard .balls span { font-size:12px; } #screen-home .bowl-card .bc-mark { width:36px;height:36px; } }

/* Core screen refinement */
.quick-filters{display:flex;gap:6px;margin:10px 0;flex-wrap:wrap}.quick-filters button{flex:1;min-height:42px;padding:8px 9px;border:1px solid #514C45;border-radius:999px;color:#F0EAD6;background:#302D28;font:inherit;font-size:12px;font-weight:700;cursor:pointer}.quick-filters button[aria-pressed=true]{background:#E8A33D;border-color:#E8A33D;color:#1C1B18}.history-game-row{width:100%;display:flex;align-items:center;gap:10px;background:#24221e;border:1px solid #48433b;border-radius:14px;padding:12px;color:#F0EAD6;text-align:left;margin:8px 0;min-height:66px;cursor:pointer;font:inherit}.history-game-row img{width:33px;height:33px}.history-game-row span{flex:1;min-width:0}.history-game-row b,.history-game-row small{display:block;overflow-wrap:anywhere}.history-game-row small{color:#BDB4A5;font-size:12px}.history-game-row strong{color:#E8A33D;font-size:23px;font-variant-numeric:tabular-nums}.history-game-row>.ic{color:#BDB4A5}.stats-quick-rates{grid-template-columns:repeat(3,minmax(0,1fr))}.stats-quick-rates .stat-card{padding:10px 3px}.stats-quick-rates .stat-card b{font-size:24px}.stats-quick-rates .stat-card span{font-size:10px}.stats-average{color:#F0EAD6}.stats-records .stat-card b{color:#E8A33D}.quick-filters button:focus-visible,.history-game-row:focus-visible{outline:2px solid #E8A33D;outline-offset:2px}#screen-photo .crop-box{border-width:3px}#screen-photo .crop-wrap.cropping{outline:1px solid #6d6455}#screen-photo #cropHint{padding:10px 0}#screen-history .calendar-toggle{display:flex;gap:6px}#screen-history .calendar-toggle .btn{flex:1;min-width:0;padding:10px 5px;font-size:13px}
