/* Nunito (variable weight), served from this site so no page sends visitors to Google's font servers.
   Files: Fontsource @fontsource-variable/nunito 5.3.0, latin + latin-ext; license in fonts/OFL.txt. */
@font-face {
  font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url(fonts/nunito-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Nunito'; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url(fonts/nunito-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --bg: #f4f6f1;
  --surface: #ffffff;
  --surface-2: #eef1ea;
  --text: #1c2419;
  --muted: #5f6b5a;
  --border: #dde3d6;
  --accent: #d6452b;       /* stitching red */
  --accent-ink: #ffffff;
  --hero: #1f3a5f;          /* fixed dark navy panel; white text on it in both themes */
  --on-good: #ffffff;
  --navy: #1f3a5f;
  --good: #2f8a4a;
  --good-bg: #e3f3e6;
  --bad: #c0392b;
  --bad-bg: #fbe6e3;
  --warn: #8a5a12;
  --warn-bg: #fdf1dc;
  --grass: #7fb56a;
  --grass-2: #74aa60;
  --dirt: #d8b384;
  --dirt-2: #b98f5c;       /* darker dirt: mound edge, base paths in the first-person view */
  --chalk: #ffffff;
  --ball: #ffffff;
  --shadow: rgba(0,0,0,.28);
  --radius: 14px;
  --card-shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.05);
  --bezel: #1b2330;         /* device frames on the marketing page */
  --sun: #f2c94c; --sun-ink: #3b300a; /* highlight yellow (same as the runner markers) */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11150f; --surface: #1a2017; --surface-2: #232a1f; --text: #e9eee4; --muted: #9aa692;
    --border: #2f382a; --accent: #ef6a4f; --navy: #8fb3e0; --good: #5cc27a; --good-bg: #183322;
    --bad: #f07c6c; --bad-bg: #3a1c18; --warn: #e6b35c; --warn-bg: #3a2e16;
    --grass: #3f6a34; --grass-2: #3a6230; --dirt: #8f7453; --dirt-2: #6e5639; --chalk: #e8e8e8; --shadow: rgba(0,0,0,.5);
    --card-shadow: none; color-scheme: dark; --accent-ink: #1d0c07; --on-good: #0b1d10; --hero: #22416a;
    --bezel: #04070b; --sun: #f2c94c; --sun-ink: #2a2206;
  }
}
:root[data-theme="dark"] {
  --bg: #11150f; --surface: #1a2017; --surface-2: #232a1f; --text: #e9eee4; --muted: #9aa692;
  --border: #2f382a; --accent: #ef6a4f; --navy: #8fb3e0; --good: #5cc27a; --good-bg: #183322;
  --bad: #f07c6c; --bad-bg: #3a1c18; --warn: #e6b35c; --warn-bg: #3a2e16;
  --grass: #3f6a34; --grass-2: #3a6230; --dirt: #8f7453; --dirt-2: #6e5639; --chalk: #e8e8e8; --shadow: rgba(0,0,0,.5);
  --card-shadow: none; color-scheme: dark; --accent-ink: #1d0c07; --on-good: #0b1d10; --hero: #22416a;
    --bezel: #04070b; --sun: #f2c94c; --sun-ink: #2a2206;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Nunito', system-ui, -apple-system, sans-serif; font-weight: 600;
  line-height: 1.45;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 900; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* App pages stay hidden until gate.js knows a grown-up is signed in. */
html[data-gate="pending"] body { visibility: hidden; }

/* App chrome */
.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 1.1rem; }
/* The logo (img/logo.svg) draws its own navy disc, so it reads on light and dark backgrounds alike. */
.brand .logo { width: 30px; height: 30px; flex: none; background: url(img/logo.svg) center / contain no-repeat; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px;
  background: var(--surface-2); font-size: .85rem; font-weight: 800; white-space: nowrap; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy); color: var(--surface); font-weight: 900; font-size: .85rem; flex: none; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 20px 16px 48px; }
.grid { display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--card-shadow); min-width: 0; }
.card h2 { margin-bottom: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrapflex { flex-wrap: wrap; }

.btn { appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 900;
  padding: 10px 18px; border-radius: 12px; background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 3px 0 rgba(0,0,0,.18); transition: transform .06s; text-decoration: none; display: inline-block; min-height: 44px; min-width: 44px; text-align: center; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }
.btn.ghost { background: var(--surface-2); color: var(--text); box-shadow: none; }
.btn.navy { background: var(--navy); color: var(--surface); }
.btn:disabled { opacity: .45; cursor: default; }

.chip { appearance: none; font: inherit; font-weight: 800; font-size: .85rem; cursor: pointer;
  border: 2px solid var(--border); background: var(--surface); color: var(--text);
  padding: 5px 12px; border-radius: 99px; min-height: 44px; min-width: 44px; }
.chip.on { border-color: var(--navy); background: var(--navy); color: var(--surface); }
/* This week's points of a kid signed in on a kid device, on the play pages (kid.js): a link to the kid's home. */
.ptschip { display: inline-flex; align-items: center; gap: 4px; text-decoration: none; background: var(--warn-bg); }
.ptschip[hidden] { display: none; }

.bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--good); border-radius: 99px; }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; color: var(--muted); font-weight: 800; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .04em; padding: 6px 8px; border-bottom: 1px solid var(--border); }
td { padding: 8px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: 0; }
.tablewrap { overflow-x: auto; }

/* The season views' chart and table (progress.js; the coach's Season card, the parent's "This season"): bars and a line
   that differ in shape as well as color, with a key and the same numbers as a table. */
.svwrap { margin: 8px 0 0; max-width: 560px; }
.sv { display: block; width: 100%; height: auto; }
.sv-bar { fill: var(--navy); }
.sv-line { stroke: var(--good); stroke-width: 2.5; fill: none; }
.sv-dot { fill: var(--surface); stroke: var(--good); stroke-width: 2.5; }
.sv-axis { stroke: var(--muted); stroke-width: 1; }
.sv-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; }
.sv-label { fill: var(--muted); font-size: 15px; font-weight: 700; }
.sv-key { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 6px 0 0; }
.sv-key > span { display: inline-flex; align-items: center; gap: 6px; }
.svmore summary { cursor: pointer; font-weight: 800; padding: 12px 0; line-height: 20px; }
.svtable th, .svtable td { text-align: right; white-space: nowrap; }
.svtable th[scope=row], .svtable thead th:first-child { text-align: left; }
.svtable caption { text-align: left; font-weight: 800; color: var(--muted); font-size: .85rem; padding: 0 0 4px; }

.tag { font-size: .72rem; font-weight: 900; padding: 2px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }
.tag.good { background: var(--good-bg); color: var(--good); }
.tag.bad { background: var(--bad-bg); color: var(--bad); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }

/* Field SVG */
.field svg { display: block; width: 100%; height: auto; }
.fld-grass { fill: var(--grass); }
.fld-grass2 { fill: var(--grass-2); }
.fld-dirt { fill: var(--dirt); }
.fld-line { stroke: var(--chalk); stroke-width: 2; fill: none; }
.fld-base { fill: var(--chalk); }
.fld-fence { stroke: var(--navy); stroke-width: 5; fill: none; stroke-linecap: round; }
.fld-cam { fill: rgba(255,255,255,.22); stroke: var(--chalk); stroke-width: 2; stroke-linejoin: round; }
.fielder circle { fill: #1f3a5f; stroke: var(--chalk); stroke-width: 2; }
.fielder text { fill: #fff; font-size: 10px; font-weight: 900; text-anchor: middle; dominant-baseline: central; }
.fielder.me circle { fill: var(--accent); }
.me .halo { fill: none; stroke: var(--accent); stroke-width: 2; opacity: .6; animation: halo 1.6s infinite; }
@keyframes halo { from { r: 13; opacity: .7 } to { r: 24; opacity: 0 } }
.runner circle { fill: #f2c94c; stroke: #5b4a10; stroke-width: 2; }
.runner text { fill: #3b300a; font-size: 9px; font-weight: 900; text-anchor: middle; dominant-baseline: central; }
.runner.me circle { fill: var(--accent); stroke: #fff; }
.runner.me text { fill: #fff; }
.batter circle { fill: #f2c94c; stroke: #5b4a10; stroke-width: 2; }
.ball { fill: var(--ball); stroke: #999; stroke-width: 1; }
.ballshadow { fill: var(--shadow); }
.trail { stroke: var(--ball); stroke-width: 2; stroke-dasharray: 3 5; fill: none; opacity: .8; }
.target { cursor: pointer; }
.target .ring { fill: rgba(255,255,255,.15); stroke: #fff; stroke-width: 3; stroke-dasharray: 5 4; animation: spin 6s linear infinite; transform-box: fill-box; transform-origin: center; }
.target:hover .ring { fill: rgba(255,255,255,.4); }
.target text { fill: #fff; font-size: 12px; font-weight: 900; text-anchor: middle; paint-order: stroke; stroke: rgba(0,0,0,.75); stroke-width: 4px; }
@media (max-width: 600px) { .target text { font-size: 16px; } } /* the field is drawn at ~70% on a phone */
.target.correct .ring { stroke: #3ddc6b; fill: rgba(61,220,107,.3); stroke-dasharray: none; }
.target.wrong .ring { stroke: #ff6b57; fill: rgba(255,107,87,.3); stroke-dasharray: none; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  h1 { font-size: 1.4rem; }
  .hide-sm { display: none !important; }
}

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; padding: 16px; z-index: 10; }
.modal.on { display: flex; }
.modal > .card { width: min(640px, 100%); max-height: 90vh; overflow: auto; }
input[type=search], input[type=text], input[type=email], input[type=date], select, textarea {
  font: inherit; padding: 9px 12px; border-radius: 10px; border: 2px solid var(--border); background: var(--surface); color: var(--text); width: 100%; }
/* iPhone Safari draws a native select 29px tall whatever its height, so selects are drawn here to stay 44px tall to
   tap; the arrow is two gradient triangles. */
select { min-height: 44px; appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
label.f { display: block; font-size: .8rem; font-weight: 800; color: var(--muted); margin: 12px 0 4px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.switch:last-child { border-bottom: 0; }
.tog { appearance: none; width: 44px; height: 26px; border-radius: 99px; background: var(--surface-2); border: 2px solid var(--border); position: relative; cursor: pointer; flex: none; }
.tog::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: .15s; }
.tog:checked { background: var(--good); border-color: var(--good); }
.tog:checked::after { left: 20px; background: #fff; }
