/* Shared styles for the Team Records and Top 10 pages */
:root {
  --red: #D50F1C;
  --red-dark: #A00A14;
  --black: #0E0E0F;
  --ink: #1B1B1D;
  --gray: #6B6B70;
  --line: #E6E6E8;
  --paper: #F6F5F3;
  --white: #FFFFFF;
  --display: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif;
  --body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; }
a { color: inherit; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--black); color: var(--white); }
/* track lanes sweeping across the hero */
.hero .lanes { position: absolute; inset: 0; pointer-events: none; }
.hero-inner { position: relative; max-width: 1200px; margin: 0 auto; padding: 22px 20px 36px; }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand .mark { width: 46px; height: 46px; flex: none; }
.brand .org { font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: #BDBDC2; font-weight: 600; }
.brand .name { font-family: var(--display); font-size: 26px; letter-spacing: .04em; line-height: 1; }

/* site menu, top right on every page */
.sitenav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sitenav a { text-decoration: none; font-size: 13px; font-weight: 700; letter-spacing: .04em; padding: 9px 12px; border-radius: 9px; color: #CFCFD4; white-space: nowrap; }
.sitenav a:hover { color: var(--white); }
.sitenav a[aria-current="page"] { color: var(--white); box-shadow: inset 0 -2px 0 var(--red); border-radius: 0; }
.sitenav .btn-login { margin-left: 6px; background: var(--red); color: var(--white); border-radius: 10px; padding: 9px 14px; display: inline-flex; align-items: center; gap: 7px; }
.sitenav .btn-login:hover { background: #E8121F; }
@media (max-width: 640px) {
  .topline { align-items: flex-start; }
  .sitenav { width: 100%; flex-wrap: nowrap; gap: 2px; }
  .sitenav a { padding: 8px 8px; font-size: 12.5px; letter-spacing: .02em; }
  .sitenav .btn-login { margin-left: auto; padding: 8px 11px; gap: 6px; }
}
@media (max-width: 359px) { .sitenav .btn-login svg { display: none; } }

.hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(64px, 13vw, 148px); line-height: .86; letter-spacing: .01em; margin: 44px 0 0; }
.hero h1 .accent { color: var(--red); }
.hero .lede { color: #CFCFD4; font-size: 17px; max-width: 520px; margin: 14px 0 0; }
.hero .credit { color: #9A9AA0; font-size: 13px; font-weight: 600; letter-spacing: .02em; margin: 10px 0 0; }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 30px; max-width: 760px; }
.stat { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 14px; padding: 14px 16px; backdrop-filter: blur(4px); }
.stat .num { font-family: var(--display); font-size: 40px; line-height: 1; }
.stat .num.red { color: var(--red); }
.stat .lbl { font-size: 12px; color: #BDBDC2; text-transform: uppercase; letter-spacing: .12em; margin-top: 4px; font-weight: 600; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }

/* ---------- Sticky age tabs ---------- */
.tabbar { position: sticky; top: 0; z-index: 20; background: var(--white); border-bottom: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.05); }
.tabbar-inner { max-width: 1200px; margin: 0 auto; padding: 10px 20px; display: flex; gap: 12px; align-items: center; }
.tabs { display: flex; gap: 6px; background: #F0EFED; padding: 5px; border-radius: 14px; flex: none; }
.tab { appearance: none; border: 0; background: transparent; cursor: pointer; font-family: var(--display); font-size: 24px; letter-spacing: .04em; color: var(--ink); padding: 6px 16px 3px; border-radius: 10px; min-width: 64px; }
.tab:hover { background: rgba(0,0,0,.05); }
.tab[aria-selected="true"] { background: var(--red); color: var(--white); box-shadow: 0 4px 10px rgba(213,15,28,.35); }
.search { flex: 1; min-width: 0; position: relative; }
.search input { width: 100%; font: inherit; font-size: 15px; padding: 11px 14px 11px 38px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); outline: none; }
.search input:focus { border-color: var(--ink); background: var(--white); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray); }
@media (max-width: 640px) {
  .tabbar-inner { flex-direction: column; align-items: stretch; gap: 8px; }
  .tabs { display: grid; grid-template-columns: repeat(5, 1fr); }
  .tab { min-width: 0; padding: 6px 0 3px; }
}

/* League page: 8 age tabs, so they get their own row sooner and wrap into two rows on phones */
@media (max-width: 1000px) {
  .view-league .tabbar-inner { flex-direction: column; align-items: stretch; gap: 8px; }
  .view-league .tabs { display: grid; grid-template-columns: repeat(8, 1fr); }
  .view-league .tab { min-width: 0; padding: 6px 0 3px; }
}
@media (max-width: 640px) {
  .view-league .tabs { grid-template-columns: repeat(4, 1fr); }
}

/* event-group jump chips */
.chips { max-width: 1200px; margin: 0 auto; padding: 0 20px 10px; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips:empty { display: none; }
.chip { flex: none; text-decoration: none; font-size: 13px; font-weight: 600; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: var(--ink); white-space: nowrap; }
.chip:hover { border-color: var(--ink); }
.chip .ct { color: var(--gray); font-weight: 500; margin-left: 4px; }

/* ---------- Content ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 26px 20px 60px; }
.age-title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 4px 0 6px; }
.age-title h2 { font-family: var(--display); font-weight: 400; font-size: 56px; line-height: 1; margin: 0; }
.age-title .sub { color: var(--gray); font-size: 15px; }

.group { margin-top: 34px; scroll-margin-top: 140px; }
.group-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.group-head h3 { font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: .04em; margin: 0; }
.group-head .rule { flex: 1; height: 3px; background: repeating-linear-gradient(90deg, var(--ink) 0 18px, transparent 18px 26px); opacity: .15; }

.event { background: var(--white); border-radius: 18px; border: 1px solid var(--line); overflow: hidden; margin-bottom: 16px; }
.event-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; background: var(--black); color: var(--white); position: relative; }
.event-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--red); }
.event-top h4 { font-family: var(--display); font-weight: 400; font-size: 28px; letter-spacing: .04em; margin: 0; line-height: 1; }
.event-top .unit { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: #BDBDC2; font-weight: 600; }

.sides { display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .sides { grid-template-columns: 1fr 1fr; } .side + .side { border-left: 1px solid var(--line); } }
.side { padding: 16px 18px 12px; }
.side + .side { border-top: 1px solid var(--line); }
@media (min-width: 900px) { .side + .side { border-top: 0; } }
.side-label { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gray); margin-bottom: 10px; }

/* Team Records page: one table per gender, one row per event */
.rec-section { margin-top: 30px; }
.rec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.rec-head h3 { font-family: var(--display); font-weight: 400; font-size: 40px; letter-spacing: .03em; line-height: 1; margin: 0; }
.rec-head h3 .accent { color: var(--red); }
.rec-head .ct { color: var(--gray); font-size: 14px; }
.rec-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--white); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.rec-table thead th { background: var(--black); color: #BDBDC2; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: 13px 16px; border-bottom: 4px solid var(--red); }
.rec-table td { padding: 13px 16px; border-bottom: 1px solid #F0EFED; vertical-align: middle; }
.rec-table tbody tr:last-child td { border-bottom: 0; }
.rec-table tbody tr:nth-child(even) { background: #FBFAF9; }
.rec-table .ev { font-family: var(--display); font-size: 22px; letter-spacing: .03em; line-height: 1.05; white-space: nowrap; }
.rec-table .who { font-weight: 600; }
.rec-table .who .nm { padding: 1px 3px; margin-left: -3px; }
.rec-table .who .note { margin: 0 0 0 8px; vertical-align: 1px; }
.rec-table .mk { text-align: right; font-family: var(--display); font-size: 26px; color: var(--red); letter-spacing: .02em; white-space: nowrap; }
.rec-table th.mk { font-family: var(--body); font-size: 11px; color: #BDBDC2; }
.rec-table .dt { color: var(--gray); font-size: 14px; white-space: nowrap; width: 1%; }
.rec-table .m-date { display: none; color: var(--gray); font-size: 12px; font-weight: 500; }
.rec-table .none-yet .who { font-weight: 400; }
@media (max-width: 640px) {
  .rec-table th, .rec-table td { padding: 11px 10px; }
  .rec-table .ev { font-size: 18px; white-space: normal; }
  .rec-table .dt { display: none; }
  .rec-table .m-date { display: block; }
  .rec-table .mk { font-size: 22px; }
  .rec-table .who .note { margin: 4px 0 0; }
}
@media (max-width: 359px) {
  .rec-table th, .rec-table td { padding: 10px 7px; }
  .rec-table .ev { font-size: 16px; }
  .rec-table .mk { font-size: 20px; }
}
body.searching .rec-row:not(.has-hit) { display: none; }
.more { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--gray); text-decoration: none; }
.more:hover { color: var(--red); }

/* the record holder gets a spotlight */
.record { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: linear-gradient(120deg, var(--red) 0%, var(--red-dark) 100%); color: var(--white); position: relative; overflow: hidden; }
.record::before { content: ""; position: absolute; right: -30px; top: 0; bottom: 0; width: 140px; background: repeating-linear-gradient(105deg, rgba(255,255,255,.12) 0 6px, transparent 6px 22px); }
.record .badge { flex: none; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; background: var(--white); color: var(--red); padding: 4px 8px; border-radius: 6px; }
.record .who { flex: 1; min-width: 0; position: relative; }
.record .who .n { font-weight: 700; font-size: 17px; line-height: 1.25; }
.record .who .d { font-size: 12px; opacity: .85; }
.record .mark { font-family: var(--display); font-size: 40px; line-height: 1; position: relative; letter-spacing: .02em; white-space: nowrap; }

ol.rest { list-style: none; margin: 8px 0 0; padding: 0; }
ol.rest li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px solid #F0EFED; font-size: 15px; }
ol.rest li:last-child { border-bottom: 0; }
ol.rest .rk { font-family: var(--display); font-size: 20px; color: var(--gray); text-align: center; }
ol.rest .nm { min-width: 0; }
ol.rest .nm small { display: block; color: var(--gray); font-size: 12px; line-height: 1.3; }
ol.rest .mk { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.unknown { color: var(--gray); font-style: italic; }
.record .unknown { color: rgba(255,255,255,.85); }
.new { display: inline-block; font-size: 9px; font-weight: 800; letter-spacing: .12em; background: var(--ink); color: var(--white); padding: 2px 5px; border-radius: 4px; margin-left: 6px; vertical-align: 2px; }
.record .new { background: var(--black); }
.note { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--black); color: var(--white); padding: 3px 7px; border-radius: 5px; margin-top: 4px; }
.empty { color: var(--gray); font-size: 14px; padding: 18px 4px; }

.age-empty { background: var(--white); border: 2px dashed var(--line); border-radius: 18px; padding: 48px 24px; text-align: center; margin-top: 24px; }
.age-empty .big { font-family: var(--display); font-size: 40px; line-height: 1; }
.age-empty p { color: var(--gray); margin: 10px 0 0; }

.data-error { background: #FFF1F1; border: 2px solid var(--red); color: var(--red-dark); border-radius: 12px; padding: 14px 16px; margin-bottom: 20px; font-weight: 600; white-space: pre-wrap; }

/* search highlighting */
.hit { background: #FFE9EA; border-radius: 8px; }
.record.hit { outline: 3px solid var(--ink); outline-offset: 2px; background: linear-gradient(120deg, var(--red) 0%, var(--red-dark) 100%); }
body.searching .event:not(.has-hit) { display: none; }
body.searching .group:not(.has-hit) { display: none; }
.no-results { display: none; text-align: center; padding: 50px 20px; color: var(--gray); }
body.searching.none .no-results { display: block; }

footer { background: var(--black); color: #BDBDC2; font-size: 13px; }
footer .inner { max-width: 1200px; margin: 0 auto; padding: 28px 20px; display: flex; flex-wrap: wrap; gap: 10px 24px; justify-content: space-between; align-items: center; }
footer .lanes-strip { height: 6px; background: repeating-linear-gradient(90deg, var(--red) 0 60px, var(--white) 60px 64px); }
footer .links { display: flex; gap: 18px; flex-wrap: wrap; }
footer .links a { text-decoration: none; color: #CFCFD4; }
footer .links a:hover { color: var(--white); }

/* ---------- Home page ---------- */
.home .hero-inner { padding-bottom: 56px; }
.announce { display: flex; align-items: center; gap: 14px; margin-top: 30px; max-width: 640px; padding: 16px 18px; border-radius: 16px; background: var(--red); box-shadow: 0 10px 30px rgba(213,15,28,.35); }
.announce .icon { flex: none; width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.16); display: grid; place-items: center; }
.announce .kicker { font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; opacity: .85; }
.announce .msg { font-size: 19px; font-weight: 700; line-height: 1.3; }

.cards { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 760px) { .cards { grid-template-columns: 1fr 1fr; } }
.card { position: relative; overflow: hidden; display: block; text-decoration: none; color: var(--white); background: var(--black); border-radius: 20px; padding: 26px 24px 24px; min-height: 210px; transition: transform .2s ease, box-shadow .2s ease; }
.card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: var(--red); }
.card::before { content: ""; position: absolute; right: -40px; top: -20px; bottom: -20px; width: 200px; background: repeating-linear-gradient(105deg, rgba(255,255,255,.07) 0 8px, transparent 8px 28px); }
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(0,0,0,.18); }
.card .kicker { position: relative; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--red); }
.card h2 { position: relative; font-family: var(--display); font-weight: 400; font-size: 52px; line-height: .95; margin: 8px 0 10px; }
.card p { position: relative; color: #CFCFD4; margin: 0; max-width: 340px; }
.card .go { position: relative; display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-weight: 700; font-size: 14px; }
.card.red { background: linear-gradient(120deg, var(--red) 0%, var(--red-dark) 100%); }
.card.red::after { background: var(--white); }
.card.red .kicker { color: rgba(255,255,255,.85); }
.card.red p { color: rgba(255,255,255,.9); }

/* ---------- Text pages (Terms) ---------- */
.hero.slim .hero-inner { padding-bottom: 30px; }
.hero.slim h1 { font-size: clamp(52px, 10vw, 96px); margin-top: 34px; }
.doc { max-width: 760px; margin: 0 auto; padding: 34px 20px 70px; font-size: 16.5px; line-height: 1.65; }
.doc .callout { background: var(--white); border: 1px solid var(--line); border-left: 6px solid var(--red); border-radius: 14px; padding: 18px 20px; font-size: 18px; font-weight: 600; margin-bottom: 28px; }
.doc h2 { font-family: var(--display); font-weight: 400; font-size: 30px; letter-spacing: .03em; margin: 30px 0 4px; }
.doc p { margin: 8px 0; }
.doc .updated { color: var(--gray); font-size: 14px; margin-top: 30px; }

/* ---------- Coach's Login (placeholder) ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) { .auth { grid-template-columns: 1fr 1fr; } }
.auth-side { position: relative; overflow: hidden; background: var(--black); color: var(--white); display: none; }
@media (min-width: 900px) { .auth-side { display: flex; align-items: flex-end; } }
.auth-side .lanes { position: absolute; inset: 0; width: 100%; height: 100%; }
.auth-side-inner { position: relative; padding: 44px; }
.auth-side h2 { font-family: var(--display); font-weight: 400; font-size: 72px; line-height: .9; margin: 0; }
.auth-side h2 span { color: var(--red); }
.auth-side p { color: #CFCFD4; margin: 12px 0 0; max-width: 360px; }
.auth-main { display: flex; flex-direction: column; padding: 22px 20px 26px; background: var(--paper); }
.auth-main .brand { color: var(--ink); }
.auth-main .brand .org { color: var(--gray); }
.auth-card { width: 100%; max-width: 400px; margin: auto; padding: 40px 0; }
.auth-card .kicker { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--red); }
.auth-card h1 { font-family: var(--display); font-weight: 400; font-size: 56px; line-height: 1; margin: 6px 0 4px; }
.auth-card .sub { color: var(--gray); margin: 0 0 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field-row { display: flex; justify-content: space-between; align-items: baseline; }
.field input { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1px solid #D6D6DA; border-radius: 12px; background: var(--white); outline: none; }
.field input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(27,27,29,.08); }
.field input.invalid { border-color: var(--red); }
.field-error { color: var(--red-dark); font-size: 13px; margin: 6px 0 0; min-height: 0; }
.field-error:empty { display: none; }
.password-wrap { position: relative; }
.password-wrap input { padding-right: 66px; }
.reveal-pw { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: var(--gray); cursor: pointer; padding: 6px 8px; }
.text-link { color: var(--red); font-size: 13px; font-weight: 600; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.form-alert { border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 4px 0 16px; }
.form-alert.error { background: #FFF1F1; color: var(--red-dark); border: 1px solid #F5C2C5; }
.form-alert.info { background: var(--white); color: var(--ink); border: 1px solid var(--line); }
.btn-submit { width: 100%; border: 0; border-radius: 12px; background: var(--red); color: var(--white); font: inherit; font-weight: 700; font-size: 16px; padding: 13px 16px; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: 10px; }
.btn-submit:hover { background: #E8121F; }
.btn-submit:disabled { opacity: .8; cursor: wait; }
.btn-submit .spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: var(--white); border-radius: 50%; animation: spin .7s linear infinite; }
.btn-submit.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.auth-foot { color: var(--gray); font-size: 14px; margin-top: 20px; }
.auth-legal { color: var(--gray); font-size: 13px; text-align: center; margin: 0; }

@media print {
  .tabbar, .chips, footer, .hero .lanes, .sitenav { display: none; }
  .hero { background: none; color: var(--black); }
  .event { break-inside: avoid; }
}
