:root {
  --navy: #0e1b33;
  --navy-2: #182a4d;
  --green: #1d5c45;
  --gold: #c99a2e;
  --gold-light: #f3e3b8;
  --silver: #9aa3b2;
  --bronze: #b0703c;
  --bg: #f7f5ef;
  --surface: #ffffff;
  --ink: #16202f;
  --muted: #5b6475;
  --line: #e2ddd0;
  --danger: #b3261e;
  --ok: #1d7a4c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(14, 27, 51, 0.06), 0 8px 24px rgba(14, 27, 51, 0.06);
  --font-head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }
img { max-width: 100%; }
a { color: var(--green); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.1; margin: 0 0 0.5em; letter-spacing: 0.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.4rem; font-weight: 600; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 720px; }
.section { padding: 56px 0; }
.eyebrow { font-family: var(--font-head); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 600; color: var(--gold); font-size: 0.95rem; margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }

/* Header */
.site-header { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 20; }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--font-head); font-size: 1.45rem; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: #d7deea; text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 0.95rem; }
.nav a:hover, .nav a.active { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav .btn { margin-left: 6px; }
.nav-toggle { display: none; background: none; border: 1px solid rgba(255,255,255,0.3); color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 1rem; cursor: pointer; }
@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy); flex-direction: column; align-items: stretch; padding: 8px 16px 16px; border-top: 1px solid rgba(255,255,255,0.1); }
  .nav.open { display: flex; }
  .nav .btn { margin: 8px 0 0; text-align: center; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 11px 22px; font: 600 0.95rem var(--font-body); cursor: pointer; text-decoration: none; transition: transform 0.08s ease, background 0.15s ease; }
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #d8aa3c; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); }
.btn-outline { background: transparent; color: inherit; border: 1.5px solid currentColor; }
.btn-small { padding: 7px 14px; font-size: 0.85rem; }
.btn-danger { background: var(--danger); color: #fff; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-lg { padding: 15px 30px; font-size: 1.05rem; }

/* Hero */
.hero { background: radial-gradient(1200px 500px at 80% -10%, #28406f 0%, transparent 60%), linear-gradient(160deg, var(--navy) 0%, #11284a 60%, var(--green) 140%); color: #fff; padding: 72px 0 88px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: center; }
.hero p.lead { font-size: 1.15rem; color: #d7deea; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero .btn-outline { color: #fff; }
.medals { display: flex; justify-content: center; gap: 14px; }
.medal { width: 118px; text-align: center; }
.medal-disc { width: 110px; height: 110px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-head); font-size: 2.8rem; font-weight: 700; color: var(--navy); background: radial-gradient(circle at 35% 30%, #fff6d6, var(--gold) 55%, #8f6a17); box-shadow: inset 0 0 0 6px rgba(255,255,255,0.25), 0 10px 30px rgba(0,0,0,0.35); }
.medal:nth-child(2) { transform: translateY(-22px); }
.medal-label { font-size: 0.85rem; color: #d7deea; }
@media (max-width: 800px) {
  .hero-grid { grid-template-columns: 1fr; }
  .medal { width: 92px; }
  .medal-disc { width: 84px; height: 84px; font-size: 2.1rem; }
}

/* Cards and grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-main { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 800px) { .grid-3, .grid-2, .grid-main { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card h3 { margin-top: 0; }
.step-num { width: 40px; height: 40px; border-radius: 50%; background: var(--navy); color: var(--gold); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; margin-bottom: 12px; }
.race-card .race-num { font-family: var(--font-head); color: var(--gold); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; font-size: 0.9rem; }
.race-meta { list-style: none; padding: 0; margin: 0 0 16px; color: var(--muted); font-size: 0.92rem; }
.race-meta li { padding: 2px 0; }
.callout { border-left: 4px solid var(--gold); background: var(--gold-light); padding: 16px 20px; border-radius: 0 var(--radius) var(--radius) 0; }
.band { background: var(--navy); color: #fff; }
.band .muted { color: #b9c3d6; }

/* Page header */
.page-head { background: var(--navy); color: #fff; padding: 48px 0 40px; }
.page-head p { color: #c9d2e3; max-width: 40em; margin: 0; }

/* Forms */
.form { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
label { font-weight: 600; font-size: 0.92rem; display: block; margin-bottom: 6px; }
input, select, textarea { width: 100%; font: inherit; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(29, 92, 69, 0.15); }
input[type="checkbox"] { width: auto; margin: 3px 10px 0 0; flex: none; }
.check { display: flex; align-items: flex-start; font-weight: 400; }
.hint { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.alert { padding: 12px 16px; border-radius: 10px; font-size: 0.95rem; }
.alert-error { background: #fbe9e7; color: var(--danger); }
.alert-ok { background: #e6f4ec; color: var(--ok); }
.alert-info { background: #eaf0fa; color: var(--navy-2); }
[hidden] { display: none !important; }

/* Tabs */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; }
.tab { border: 1.5px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 8px 18px; font: 600 0.95rem var(--font-body); cursor: pointer; }
.tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.tab .hof-star { color: var(--gold); }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { background: #faf8f2; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
th button { all: unset; cursor: pointer; }
th button:hover, th.sorted button { color: var(--navy); }
tr:last-child td { border-bottom: 0; }
td.time { font-variant-numeric: tabular-nums; }
td.combined { font-weight: 700; font-variant-numeric: tabular-nums; }
.rank { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; width: 44px; }
.rank-1 { color: var(--gold); }
.rank-2 { color: var(--silver); }
.rank-3 { color: var(--bronze); }
.member-link { color: var(--ink); font-weight: 600; text-decoration: none; }
.member-link:hover { color: var(--green); text-decoration: underline; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

/* Badges */
.badge { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #eef0f4; color: var(--muted); vertical-align: middle; }
.badge-gold { background: var(--gold-light); color: #7a5a10; }
.badge-ok { background: #e6f4ec; color: var(--ok); }
.badge-pending { background: #fff4d6; color: #8a6400; }
.badge-bad { background: #fbe9e7; color: var(--danger); }
.progress-dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.progress-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.progress-dots span.done { background: var(--gold); }

/* Members */
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.toolbar input { max-width: 320px; }
.toolbar select { max-width: 200px; }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.member-card { display: block; text-decoration: none; color: inherit; }
.member-card:hover { border-color: var(--gold); }
.avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--navy); color: var(--gold); display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 1.3rem; margin-bottom: 10px; }
.avatar-lg { width: 84px; height: 84px; font-size: 2rem; }
.page-head .avatar { background: var(--gold); color: var(--navy); }

/* Profile */
.profile-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.result-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.result-row:last-child { border-bottom: 0; }
.result-time { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.combined-box { text-align: center; background: var(--navy); color: #fff; border-radius: var(--radius); padding: 20px; }
.combined-box .result-time { color: var(--gold); font-size: 2.4rem; }

/* FAQ */
details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 20px; margin-bottom: 12px; }
summary { cursor: pointer; font-weight: 600; padding: 18px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::after { content: "+"; font-size: 1.3rem; color: var(--gold); line-height: 1; }
details[open] summary::after { content: "\2212"; }
details > div { padding-bottom: 18px; color: var(--muted); }

/* Admin */
.pending-item { display: grid; grid-template-columns: 220px 1fr; gap: 20px; }
.pending-item img { width: 100%; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; }
@media (max-width: 700px) { .pending-item { grid-template-columns: 1fr; } }

/* Footer */
.site-footer { background: var(--navy); color: #b9c3d6; padding: 32px 0; font-size: 0.9rem; margin-top: 56px; }
.site-footer .bar { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: #d7deea; text-decoration: none; margin-right: 16px; }
.site-footer a:hover { color: #fff; }
.no-footer-gap .site-footer { margin-top: 0; }
