@font-face{font-family:'Big Shoulders Display';font-weight:600;font-display:swap;src:url(fonts/bsd-600.woff2) format('woff2')}
@font-face{font-family:'Big Shoulders Display';font-weight:800;font-display:swap;src:url(fonts/bsd-800.woff2) format('woff2')}
@font-face{font-family:'Figtree';font-weight:400;font-display:swap;src:url(fonts/figtree-400.woff2) format('woff2')}
@font-face{font-family:'Figtree';font-weight:500;font-display:swap;src:url(fonts/figtree-500.woff2) format('woff2')}
@font-face{font-family:'Figtree';font-weight:600;font-display:swap;src:url(fonts/figtree-600.woff2) format('woff2')}
@font-face{font-family:'Figtree';font-weight:700;font-display:swap;src:url(fonts/figtree-700.woff2) format('woff2')}
:root {
  --turf: #1c4f9e;
  --turf-deep: #153e80;
  --turf-dark: #0f2f63;
  --line: rgba(255, 255, 255, 0.82);
  --line-soft: rgba(255, 255, 255, 0.28);
  --ball: #e5f147;
  --ink: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --faint: rgba(255, 255, 255, 0.5);
  --bad: #ffb3a6;
  --c-Peppe: #ff94a8;
  --c-Blendz: #62e3cc;
  --c-Funion: #ffb658;
  --c-Coach: #cdbbff;
  --display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --body: 'Figtree', system-ui, sans-serif;
  --nav-h: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font: 16px/1.5 var(--body);
  background-color: var(--turf);
  background-image: repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 2px, transparent 2px 9px);
  min-height: 100vh; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--ball); outline-offset: 2px; }
.wrap { max-width: 640px; margin: 0 auto; padding: 0 18px; }

/* header */
.top { display: flex; align-items: baseline; justify-content: space-between; padding: 22px 0 10px; }
.brand { font: 800 30px/1 var(--display); letter-spacing: 0.01em; text-decoration: none; }
.brand small { display: block; font: 500 13px/1.3 var(--body); color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.who { font-size: 14px; color: var(--muted); text-align: right; }
.who b { color: var(--ink); }

/* nav */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--turf-dark); border-top: 2px solid var(--line-soft);
  padding-bottom: env(safe-area-inset-bottom);
}
nav.tabs ul { list-style: none; margin: 0 auto; padding: 0; display: flex; max-width: 640px; }
nav.tabs li { flex: 1; }
nav.tabs a { display: flex; align-items: center; justify-content: center; height: var(--nav-h); text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted); }
nav.tabs a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 3px 0 var(--ball); }

/* type */
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.05; margin: 0; }
h2 { font-size: 30px; margin: 34px 0 12px; }
h3 { font-size: 22px; margin: 22px 0 8px; }
p { margin: 0 0 12px; max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }

/* court-line box */
.box { border: 2px solid var(--line-soft); border-radius: 4px; padding: 16px; background: rgba(15, 47, 99, 0.35); }
.box + .box { margin-top: 12px; }

/* banners */
.demo { background: var(--ball); color: #13306a; font-weight: 600; font-size: 14px; padding: 8px 18px; text-align: center; }
.prov { margin: 6px 0 14px; font-size: 14px; color: var(--muted); }
.bar { height: 6px; background: var(--line-soft); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ball); }

/* personal panel */
.mine { border: 2px solid var(--ball); border-radius: 4px; padding: 14px 16px; margin: 10px 0 6px; }
.mine p { margin: 0 0 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 24px; border: 2px solid var(--line);
  background: transparent; font-weight: 700; text-decoration: none;
}
.btn.primary { background: var(--ball); border-color: var(--ball); color: #13306a; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

/* leaderboard */
.table { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--line); }
.row {
  display: grid; grid-template-columns: 54px 1fr auto; align-items: center; column-gap: 10px;
  padding: 14px 0 12px; border-bottom: 2px solid var(--line-soft); text-decoration: none;
}
.rank { font: 800 54px/0.8 var(--display); color: transparent; -webkit-text-stroke: 1.5px var(--line); }
.table li:first-child .rank { color: var(--ball); -webkit-text-stroke: 0; }
.pname { font: 800 34px/1 var(--display); }
.sub { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; align-items: center; }
.formline { display: block; margin-top: 6px; }
.sub b { color: var(--ink); font-weight: 600; }
.rating { text-align: right; font: 800 38px/1 var(--display); }
.chg { display: block; font: 600 13px/1.4 var(--body); color: var(--muted); }
.chg.up { color: var(--ball); }
.form { display: inline-flex; gap: 3px; vertical-align: middle; }
.form i { width: 9px; height: 9px; border-radius: 2px; border: 1.5px solid var(--line); }
.form i.W { background: var(--line); }
.weight { font-size: 14px; color: var(--muted); margin-top: 12px; }

/* court cards */
.court-card { display: block; text-decoration: none; margin-bottom: 14px; }
.court-card summary { list-style: none; cursor: pointer; }
.court-card summary::-webkit-details-marker { display: none; }
.meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
svg.court { display: block; width: 100%; height: auto; }
.court text { font-family: var(--display); font-weight: 800; }
.detail { padding: 12px 2px 4px; font-size: 14px; }
.votes { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.votes th, .votes td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line-soft); }
.votes th { font-weight: 600; color: var(--muted); }
.self { opacity: 0.5; text-decoration: line-through; }

/* stat grid */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; border-top: 2px solid var(--line-soft); border-left: 2px solid var(--line-soft); }
.grid > div { padding: 12px 14px; border-right: 2px solid var(--line-soft); border-bottom: 2px solid var(--line-soft); }
.grid .v { font: 800 30px/1 var(--display); }
.grid .k { font-size: 13px; color: var(--muted); margin-top: 4px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.list li span:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* player picker */
.picker { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px; }
.chip { border: 2px solid var(--line-soft); border-radius: 22px; padding: 8px 16px; background: transparent; font-weight: 700; text-decoration: none; }
.chip[aria-current="true"] { border-color: currentColor; background: rgba(255,255,255,0.08); }
.big-name { font: 800 64px/0.9 var(--display); margin: 18px 0 6px; }

/* forms */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  min-height: 64px; border: 2px solid var(--line-soft); border-radius: 4px; background: rgba(15,47,99,0.35);
  font: 800 28px/1 var(--display); display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
}
.choice[aria-pressed="true"] { border-color: var(--ball); }
.choice .place { font: 800 30px/1 var(--display); color: var(--ball); }
.setrow { display: grid; grid-template-columns: 64px 1fr 1fr; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.setrow .lab { font-weight: 600; color: var(--muted); font-size: 14px; }
.stepper { display: flex; align-items: center; justify-content: space-between; border: 2px solid var(--line-soft); border-radius: 26px; height: 52px; }
.stepper button { width: 48px; height: 48px; border: 0; background: transparent; font-size: 24px; }
.stepper output { font: 800 30px/1 var(--display); min-width: 28px; text-align: center; }
.cols { display: grid; grid-template-columns: 64px 1fr 1fr; gap: 10px; font-size: 13px; color: var(--muted); text-align: center; margin-top: 10px; }
.err { color: var(--bad); font-weight: 600; font-size: 14px; min-height: 22px; margin-top: 10px; }
input[type="date"] { font: inherit; color: var(--ink); background: transparent; border: 2px solid var(--line-soft); border-radius: 4px; padding: 10px 12px; color-scheme: dark; }
label.field { display: block; font-weight: 600; margin: 18px 0 6px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + 20px); transform: translateX(-50%); background: var(--ball); color: #13306a; font-weight: 700; padding: 12px 20px; border-radius: 24px; z-index: 20; max-width: 90vw; text-align: center; }
.loading { padding: 80px 0; text-align: center; color: var(--muted); }

/* chart */
svg.chart { display: block; width: 100%; height: auto; margin: 6px 0 4px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }

table.how { border-collapse: collapse; width: 100%; font-size: 14px; margin: 8px 0 16px; }
table.how td, table.how th { padding: 7px 4px; border-bottom: 1px solid var(--line-soft); text-align: left; }
table.how td:last-child, table.how th:last-child { text-align: right; }
table.how tr.best td { color: var(--ball); font-weight: 700; }

@media (prefers-reduced-motion: no-preference) {
  .table li { animation: rise 420ms cubic-bezier(.2,.7,.2,1) both; }
  .table li:nth-child(2) { animation-delay: 60ms; } .table li:nth-child(3) { animation-delay: 120ms; } .table li:nth-child(4) { animation-delay: 180ms; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } }
}
