:root {
  --navy: #082547;
  --navy-2: #0d3466;
  --red: #ee2233;
  --red-dark: #b8121f;
  --yellow: #e6f23a;
  --white: #fff;
  --paper: #f5f6fa;
  --ink: #14213a;
  --muted: #5d6b85;
  --line: #d8dde8;
  --pin: repeating-linear-gradient(90deg, rgba(255,255,255,.10) 0 2px, transparent 2px 14px);
  --pin-red: repeating-linear-gradient(90deg, rgba(8,37,71,.55) 0 2px, transparent 2px 14px);
  --display: "Alfa Slab One", Georgia, serif;
  --head: "Oswald", "Arial Narrow", Impact, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #06192f; --ink: #eef1f8; --muted: #9aa8c4; --line: #1d3a63; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
img { max-width: 100%; height: auto; }
a { color: var(--red-dark); }
@media (prefers-color-scheme: dark) { a { color: var(--yellow); } }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
main { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }

h1, h2, h3 { font-family: var(--head); text-transform: uppercase; letter-spacing: .04em; line-height: 1.15; }
h1 { font-size: 2.2rem; margin: 0 0 .6em; color: var(--navy); }
h2 { font-size: 1.5rem; margin: 1.6em 0 .5em; color: var(--navy); border-left: 6px solid var(--red); padding-left: 10px; }
h3 { font-size: 1.15rem; margin: 1.2em 0 .4em; color: var(--red-dark); }
@media (prefers-color-scheme: dark) { h1, h2 { color: var(--white); } h3 { color: var(--yellow); } }

/* header */
.site-header { background: var(--navy) var(--pin); color: var(--white); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; position: relative; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; font: 1.6rem var(--display); }
.brand img { mix-blend-mode: lighten; height: 48px; width: auto; display: block; }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  color: var(--white); text-decoration: none; font: 500 1rem var(--head);
  text-transform: uppercase; letter-spacing: .08em; padding: 8px 14px; border-bottom: 3px solid transparent;
}
.site-nav a:hover { border-color: var(--red); }
.site-nav a[aria-current] { border-color: var(--yellow); }
.stripe { height: 6px; background: var(--red) var(--pin-red); }
.nav-toggle, .nav-burger { display: none; }
@media (max-width: 640px) {
  .brand span { display: none; }
  .nav-burger { display: block; width: 44px; height: 44px; cursor: pointer; position: relative; }
  .nav-burger span, .nav-burger span::before, .nav-burger span::after {
    content: ""; position: absolute; left: 10px; right: 10px; height: 3px; background: var(--white); top: 21px;
  }
  .nav-burger span::before { top: -8px; left: 0; right: 0; }
  .nav-burger span::after { top: 8px; left: 0; right: 0; }
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; background: var(--navy); border-top: 1px solid var(--navy-2); }
  .nav-toggle:checked ~ .site-nav { display: flex; }
  .site-nav a { padding: 14px 16px; }
}

/* footer */
.site-footer { background: var(--navy) var(--pin); color: var(--white); border-top: 6px solid var(--red); padding: 22px 0; font-size: .9rem; }
.site-footer .muted { color: #b6c3dc; }
.footer-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* hero */
.hero {
  background: var(--navy) var(--pin); color: var(--white); text-align: center;
  margin: -24px calc(50% - 50vw) 32px; padding: 40px 16px 44px; border-bottom: 6px solid var(--red);
}
.hero img { width: min(340px, 70%); mix-blend-mode: lighten; }
.hero h1 { color: var(--white); font: clamp(2.2rem, 8vw, 3.6rem) var(--display); text-transform: none; margin: 8px 0 4px; letter-spacing: 0; }
.hero p { margin: 0 auto; max-width: 34em; color: #cdd7ea; }
.btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.btn, button {
  display: inline-block; background: var(--red); color: var(--white); border: 0; border-radius: 4px; cursor: pointer;
  font: 500 1rem var(--head); text-transform: uppercase; letter-spacing: .08em; padding: 10px 20px; text-decoration: none;
}
.btn:hover, button:hover { background: var(--red-dark); }
.btn.alt { background: transparent; border: 2px solid var(--yellow); color: var(--yellow); }
.btn.alt:hover { background: var(--yellow); color: var(--navy); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.card {
  background: var(--white); color: #14213a; border: 1px solid var(--line); border-top: 5px solid var(--red);
  border-radius: 6px; padding: 16px 18px; text-decoration: none; display: block;
}
.card h3 { margin: 0 0 4px; color: var(--navy); }
.card p { margin: 0; color: var(--muted); }
a.card:hover { border-top-color: var(--navy); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(8,37,71,.18); }
@media (prefers-color-scheme: dark) { .card { background: #0b2a4f; color: var(--ink); } .card h3 { color: var(--white); } }

/* uniform showcase */
.uniform { margin-top: 40px; }
.uniform input[type=radio] { position: absolute; opacity: 0; pointer-events: none; }
.swatches { display: flex; gap: 8px; margin: 8px 0 16px; }
.swatches label {
  cursor: pointer; padding: 8px 18px; border-radius: 4px; font: 500 .95rem var(--head);
  text-transform: uppercase; letter-spacing: .08em; color: var(--white); border: 3px solid transparent;
}
.swatches .l-red { background: var(--red); }
.swatches .l-blue { background: var(--navy); }
#u-red:checked ~ .swatches .l-red, #u-blue:checked ~ .swatches .l-blue { border-color: var(--yellow); box-shadow: 0 0 0 2px var(--navy); }
#u-red:focus-visible ~ .swatches .l-red, #u-blue:focus-visible ~ .swatches .l-blue { outline: 2px solid var(--yellow); outline-offset: 2px; }
.jerseys { display: none; grid-template-columns: 1fr 1fr; gap: 12px; }
#u-red:checked ~ .jerseys.red, #u-blue:checked ~ .jerseys.blue { display: grid; }
.jerseys img, .gear img { background: var(--white); border-radius: 8px; border: 1px solid var(--line); width: 100%; }
.gear { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; align-items: start; }
.gear figure { margin: 0; }
.gear img { aspect-ratio: 4 / 3; object-fit: contain; }
.gear .wide img { aspect-ratio: auto; }
@media (max-width: 520px) { .gear { grid-template-columns: 1fr; } }
.gear .wide { grid-column: 1 / -1; }
figcaption { font: 500 .85rem var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 4px; }
@media (max-width: 520px) { .jerseys { grid-template-columns: 1fr; } }

/* tables */
table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; background: var(--white); color: #14213a; font-size: .95rem; }
@media (prefers-color-scheme: dark) { table { background: #0b2a4f; color: var(--ink); } }
thead th, table th {
  background: var(--navy) var(--pin); color: var(--white); text-align: left; font: 500 .95rem var(--head);
  text-transform: uppercase; letter-spacing: .08em; padding: 10px 12px; border-bottom: 3px solid var(--red);
}
td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
tbody tr:nth-child(even) { background: rgba(8,37,71,.05); }
tbody tr:hover { background: rgba(230,242,58,.25); }
td strong { color: var(--red-dark); background: linear-gradient(transparent 60%, rgba(230,242,58,.7) 60%); }
@media (prefers-color-scheme: dark) { td strong { color: var(--yellow); background: none; } }
/* narrow screens: scroll wide tables sideways; children keep their table display so header and body columns stay aligned */
@media (max-width: 700px) { main table { display: block; overflow-x: auto; } }

/* forms */
select, textarea, input:not([type=radio]):not([type=checkbox]):not([type=button]):not([type=submit]) {
  font: inherit; padding: 8px 10px; border: 2px solid var(--line); border-radius: 4px; background: var(--white); color: #14213a; max-width: 100%;
}
select:focus, input:focus, textarea:focus { outline: 0; border-color: var(--red); }
hr { border: 0; height: 6px; background: var(--red) var(--pin-red); margin: 32px 0; border-radius: 3px; }

/* lineup */
#score {
  display: inline-block; background: var(--navy) var(--pin); color: var(--white); font: 1.3rem var(--head);
  text-transform: uppercase; letter-spacing: .06em; padding: 8px 18px; border-left: 6px solid var(--yellow); border-radius: 4px; margin-bottom: 8px;
}
#score:empty { display: none; }
.chip {
  display: inline-block; min-width: 2.4em; text-align: center; background: var(--red); color: var(--navy);
  font: 1.1rem var(--display); padding: 2px 8px; border-radius: 4px; border: 2px solid var(--white); box-shadow: 0 0 0 2px var(--navy);
}
tbody tr:nth-child(even) .chip { background: var(--navy); color: var(--red); }
.order { font: 1.1rem var(--head); color: var(--muted); }

/* lineup: chips follow the game's jersey */
.score-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.jersey-thumb { height: 72px; width: auto; border-radius: 6px; background: var(--white); border: 1px solid var(--line); }
.jersey-thumb[hidden] { display: none; }
#lineup-table.jersey-red tbody tr .chip { background: var(--red); color: var(--navy); }
#lineup-table.jersey-blue tbody tr .chip { background: var(--navy); color: var(--red); }

/* schedule game cards */
.game-cards { display: flex; flex-direction: column; gap: 12px; margin: 14px 0; }
.game-card {
  display: flex; gap: 14px; align-items: center; background: var(--white); color: #14213a;
  border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: 6px; padding: 12px;
}
.game-card.jersey-red { border-left-color: var(--red); }
.game-card.jersey-blue { border-left-color: var(--navy); }
.game-jersey { flex: 0 0 84px; text-align: center; }
.game-jersey img { width: 84px; height: auto; border-radius: 6px; background: var(--white); }
.jersey-tbd {
  display: flex; align-items: center; justify-content: center; height: 84px; border: 2px dashed var(--line);
  border-radius: 6px; color: var(--muted); font: 500 .8rem var(--head); text-transform: uppercase; letter-spacing: .06em;
}
.game-info { min-width: 0; }
.game-info h4 { margin: 0 0 2px; font: 1.15rem var(--head); text-transform: uppercase; letter-spacing: .04em; color: var(--navy); }
.game-info p { margin: 0; font-size: .9rem; color: var(--muted); }
.game-info .result { margin-top: 4px; color: #14213a; font-weight: 600; }
.game-info .btn { margin-top: 8px; }
@media (prefers-color-scheme: dark) { .game-card { background: #0b2a4f; color: var(--ink); } .game-info h4, .game-info .result { color: var(--ink); } }
.wl { display: inline-block; min-width: 1.6em; text-align: center; border-radius: 3px; color: var(--white); font: 700 .9rem var(--head); padding: 0 6px; }
.wl-W { background: #1b7f3b; } .wl-L { background: var(--red); } .wl-T { background: var(--muted); }
.btn.small { font-size: .85rem; padding: 5px 12px; }
details.all-games { margin: 12px 0 24px; }
details.all-games > summary {
  cursor: pointer; font: 500 1rem var(--head); text-transform: uppercase; letter-spacing: .08em; color: var(--navy); padding: 8px 0;
}
@media (prefers-color-scheme: dark) { details.all-games > summary { color: var(--white); } }

/* coach games */
.jersey-pick { display: inline-flex; gap: 4px; }
.swatch { opacity: .45; border: 3px solid transparent; padding: 6px 12px; }
.swatch-red { background: var(--red); }
.swatch-blue { background: var(--navy); }
.swatch.on { opacity: 1; border-color: var(--yellow); }
.score-in { width: 4em; }
.badge-new { background: var(--yellow); color: var(--navy); font: 700 .7rem var(--head); letter-spacing: .08em; text-transform: uppercase; padding: 1px 6px; border-radius: 3px; margin-left: 8px; }
tr.untracked td { background: rgba(230,242,58,.12); }
td.actions { white-space: nowrap; }
td.actions > * { margin-right: 4px; }
button.danger { background: transparent; color: var(--red-dark); border: 2px solid var(--red-dark); }
button.danger:hover { background: var(--red-dark); color: var(--white); }

/* full-width game rows: info left, result + lineup on the right */
.game-card { justify-content: flex-start; }
.game-info { flex: 1; }
@media (min-width: 640px) {
  .game-info { display: grid; grid-template-columns: 1fr auto; column-gap: 16px; align-items: center; }
  .game-info h4 { grid-column: 1; }
  .game-info .when, .game-info .where { grid-column: 1; }
  .game-info .result, .game-info .btn { grid-column: 2; grid-row: 1 / span 2; justify-self: end; margin: 0; }
  .game-info .result:not(:empty) { grid-row: 1; }
  .game-info .result:not(:empty) ~ .btn { grid-row: 2; }
}

.tbl-jersey img { height: 32px; width: auto; max-width: none; display: block; border-radius: 4px; }

/* coach nav */
.site-nav .nav-coach { color: var(--yellow); margin-left: 8px; border-left: 1px solid rgba(255,255,255,.25); padding-left: 18px; }
@media (max-width: 640px) { .site-nav .nav-coach { margin: 0; border-left: 0; border-top: 1px solid var(--navy-2); } }
.coach-nav { display: flex; gap: 6px; flex-wrap: wrap; background: var(--navy) var(--pin); border-bottom: 4px solid var(--red); border-radius: 6px 6px 0 0; padding: 6px 8px 0; margin: 0 0 20px; }
.coach-nav a {
  color: var(--white); text-decoration: none; font: 500 .95rem var(--head); text-transform: uppercase; letter-spacing: .08em;
  padding: 8px 16px; border-radius: 4px 4px 0 0;
}
.coach-nav a:hover { background: var(--navy-2); }
.coach-nav a[aria-current] { background: var(--red); }

/* lineup: divider between the batting order and players not batting */
#lineup-table tr.bench-divider td {
  background: var(--red) var(--pin-red); color: var(--white); font: 500 .95rem var(--head);
  text-transform: uppercase; letter-spacing: .1em; padding: 6px 12px; border-top: 4px solid var(--navy); border-bottom: 0;
}
#lineup-table tr.bench-divider:hover td { background: var(--red) var(--pin-red); }
#lineup-table tr.bench td { opacity: .65; }
#lineup-table tr.bench { background: transparent; }

[hidden] { display: none !important; }

/* honor strip (home) */
.honor { margin-top: 40px; text-align: center; }
.honor h2 { display: inline-block; text-align: left; }
.honor > p { max-width: 38em; margin: 0 auto; }
.seals { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 20px 28px; margin: 22px 0 8px; padding: 22px 12px; background: var(--navy) var(--pin); border-top: 4px solid var(--red); border-bottom: 4px solid var(--red); border-radius: 6px; }
.seals li { flex: 0 1 130px; }
.seals img { width: 100%; height: auto; display: block; filter: drop-shadow(0 2px 4px rgba(0,0,0,.45)); }
.seals span { display: block; margin-top: 8px; color: var(--white); font: 500 .85rem var(--head); text-transform: uppercase; letter-spacing: .1em; }
.honor .fine { font-size: .8rem; color: var(--muted); }
@media (max-width: 520px) { .seals li { flex-basis: 84px; } .seals { gap: 16px 14px; } }

/* footer seals */
.footer-seals { list-style: none; display: flex; gap: 8px; margin: 10px 0 0; padding: 0; }
.footer-seals img { width: 32px; height: 32px; display: block; }

/* inputs inside table rows (coach roster / games): readable size, fill the cell */
td input:not([type=radio]):not([type=checkbox]) { font-size: 1rem; padding: 6px 8px; width: 100%; min-width: 3.2em; }
td.score input.score-in { width: 4.2em; min-width: 0; text-align: center; }
#players-table td:last-child { white-space: nowrap; }
#players-table td:last-child button { margin-right: 4px; }
td.score, td.date { white-space: nowrap; }
td.actions button, td.actions .btn { vertical-align: middle; }

/* coach games: keep the unselected jersey swatch visible on navy */
.swatch { border-color: rgba(255,255,255,.4); opacity: .7; }
.swatch.on { opacity: 1; border-color: var(--yellow); }
@media (prefers-color-scheme: dark) {
  button.danger { color: #ff8b95; border-color: #ff8b95; }
  button.danger:hover { background: var(--red); color: var(--white); border-color: var(--red); }
}

.tourney-dates { margin: -6px 0 8px 16px; font: 500 1.1rem var(--head); letter-spacing: .06em; text-transform: uppercase; color: var(--red-dark); }
@media (prefers-color-scheme: dark) { .tourney-dates { color: var(--yellow); } }

p.fine { font-size: .85rem; margin: 0 0 12px; }

/* softball field diagram */
.lineup-layout { display: grid; gap: 20px; align-items: start; }
@media (min-width: 820px) { .lineup-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.field { position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; border: 3px solid var(--navy); background: #2e8b4e; }
.field-bg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.spot {
  position: absolute; transform: translate(-50%, -50%); width: 25%; min-height: 40px; padding: 2px 4px; margin: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border: 2px dashed rgba(255,255,255,.8); border-radius: 6px; background: rgba(8,37,71,.25); color: var(--white);
  font: 600 .8rem/1.15 system-ui, sans-serif; text-transform: none; letter-spacing: 0; cursor: default;
}
button.spot { cursor: pointer; }
button.spot:hover { background: rgba(8,37,71,.5); }
.spot-code { font: 700 .7rem var(--head); letter-spacing: .08em; text-transform: uppercase; }
.spot-player { display: flex; align-items: center; justify-content: center; gap: 4px; max-width: 100%; min-height: 0; }
.spot.filled { background: rgba(255,255,255,.95); color: #14213a; border: 2px solid var(--navy); }
.spot.filled .spot-code { color: var(--red-dark); }
.spot .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.spot .num {
  flex: 0 0 auto; background: var(--red); color: var(--navy); font: .7rem var(--display); padding: 0 4px; border-radius: 3px; border: 1px solid var(--navy);
}
.field.jersey-blue .spot .num { background: var(--navy); color: var(--red); border-color: var(--red); }
.dh-line { margin: 8px 0 0; font-size: .9rem; color: var(--muted); }
.dh-line strong { color: var(--red-dark); font-family: var(--head); letter-spacing: .06em; }
@media (prefers-color-scheme: dark) { .dh-line strong { color: var(--yellow); } }
@media (max-width: 520px) { .spot { width: 27%; font-size: .68rem; } .spot .num { font-size: .6rem; } }

/* coach: position picker */
dialog#pos-dialog { border: 3px solid var(--navy); border-radius: 8px; padding: 16px; width: min(420px, 92vw); background: var(--white); color: #14213a; }
dialog#pos-dialog::backdrop { background: rgba(8,37,71,.6); }
dialog#pos-dialog h3 { margin-top: 0; }
#pos-options { display: flex; flex-direction: column; gap: 6px; max-height: 55vh; overflow-y: auto; margin-bottom: 12px; }
#pos-options button { text-align: left; text-transform: none; letter-spacing: 0; font: 600 1rem system-ui, sans-serif; background: var(--paper); color: #14213a; border: 2px solid var(--line); display: flex; gap: 8px; align-items: center; }
#pos-options button:hover { border-color: var(--red); background: #fff; }
#pos-options .pos-tag { margin-left: auto; font: 500 .8rem var(--head); color: var(--muted); letter-spacing: .06em; }
#pos-options .pos-group { font: 500 .8rem var(--head); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-top: 6px; }
@media (prefers-color-scheme: dark) { dialog#pos-dialog { background: #0b2a4f; color: var(--ink); } #pos-options button { background: #0d3466; color: var(--ink); } }
