:root {
  --bg: #09060f;
  --panel: #140d1f;
  --line: #33244a;
  --text: #fbf7ff;
  --muted: #b3a6c9;
  --pink: #ff2d9b;
  --cyan: #25e2f0;
  --yellow: #ffe81a;
  --red: #ff2433;
  --display: "Anton", Impact, "Arial Narrow Bold", sans-serif;
  --marker: "Permanent Marker", "Marker Felt", "Segoe Print", "Barlow", sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.55 var(--body);
}
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }

/* ---------- Hero: stage lights ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 11vw, 120px) 20px clamp(36px, 6vw, 64px);
  text-align: center;
  border-bottom: 3px solid var(--pink);
  background:
    conic-gradient(from 150deg at 8% -5%, transparent 0 8deg, rgba(255, 45, 155, .35) 14deg, transparent 22deg, transparent 30deg, rgba(37, 226, 240, .16) 36deg, transparent 44deg),
    conic-gradient(from 166deg at 92% -5%, transparent 0 8deg, rgba(37, 226, 240, .16) 14deg, transparent 22deg, transparent 30deg, rgba(255, 45, 155, .35) 36deg, transparent 44deg),
    radial-gradient(ellipse at 50% 115%, rgba(150, 40, 255, .5), transparent 60%),
    #0b0613;
}
.eyebrow { font-family: var(--marker); color: var(--yellow); font-size: 1.25rem; min-height: 1.2em; margin-bottom: 10px; transform: rotate(-2deg); }
h1 {
  font-family: var(--display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(3.2rem, 13vw, 8rem); line-height: .95; letter-spacing: .01em;
  transform: skew(-8deg) rotate(-2deg);
  text-shadow: 4px 4px 0 var(--pink), -2px -2px 0 rgba(37, 226, 240, .7), 0 0 40px rgba(255, 45, 155, .55);
}
.tagline { font-family: var(--marker); margin: 26px auto 0; max-width: 30em; color: var(--cyan); font-size: 1.2rem; }
.jump { margin-top: 30px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.jump a {
  padding: 9px 18px; background: rgba(9, 6, 15, .7); border: 2px solid var(--line);
  text-decoration: none; font-family: var(--display); text-transform: uppercase; letter-spacing: .06em; font-size: 1rem;
  transform: skew(-8deg);
}
.jump a:hover, .jump a:focus-visible { border-color: var(--yellow); color: var(--yellow); outline: none; }

main { max-width: 1080px; margin: 0 auto; padding: 0 20px 40px; }
section { padding-top: 60px; }
h2 {
  display: inline-block; margin-bottom: 24px; padding: 4px 18px 6px;
  font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 2.3rem; line-height: 1.1; letter-spacing: .03em;
  background: var(--pink); color: #0b0613; transform: skew(-8deg) rotate(-1.5deg);
}
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; }
.panel.scroll { overflow-x: auto; }
.empty { color: var(--muted); padding: 22px 24px; }

.badge {
  display: inline-block; padding: 1px 12px 2px; transform: skew(-8deg);
  font-family: var(--display); text-transform: uppercase; letter-spacing: .05em; font-size: 1.05rem; color: #0b0613;
}
.badge.rx { background: var(--pink); }
.badge.scaled { background: var(--cyan); }

/* ---------- Workouts ---------- */
.wod { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; margin-bottom: 20px; overflow: hidden; }
.wod.has-img { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.wod-img { display: block; align-self: start; }
.wod-img img { display: block; width: 100%; height: auto; }
.wod-info { padding: 26px 28px 24px; }
.wod-kicker { font-family: var(--marker); color: var(--yellow); font-size: 1.1rem; transform: rotate(-1.5deg); transform-origin: left; }
.wod h3 { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.05; letter-spacing: .02em; margin: 2px 0 6px; }
.wod-meta { color: var(--cyan); font-weight: 600; margin-bottom: 14px; }
.wod-body h4 {
  font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .05em; font-size: 1.15rem;
  color: var(--pink); margin: 16px 0 6px;
}
.wod-body h4:first-child { margin-top: 0; }
.wod-body p { color: #e4dcf2; }
.wod-body p.rep { display: flex; align-items: baseline; gap: 12px; font-weight: 700; text-transform: uppercase; font-size: 1.08rem; color: var(--text); line-height: 1.35; }
.wod-body p.rep b { font-family: var(--display); font-weight: 400; font-size: 1.7rem; color: var(--yellow); min-width: 1.5em; text-align: right; }
.loads { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.loads p { margin-top: 6px; font-weight: 600; }
.standards { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 14px; }
.standards summary { cursor: pointer; font-weight: 700; color: var(--cyan); }
.standards summary:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.standards ul { margin: 12px 0 0; padding-left: 18px; color: #e4dcf2; font-size: .95rem; }
.standards li { margin-bottom: 7px; }
.standards li::marker { color: var(--pink); }
.standards strong { color: var(--text); }
.wod.locked { padding: 34px 28px; background: repeating-linear-gradient(-45deg, transparent 0 14px, rgba(255, 232, 26, .045) 14px 28px); border: 2px dashed var(--yellow); }
.wod.locked h3 { color: var(--yellow); }
.wod-tba { color: var(--muted); }

/* ---------- Heat times ---------- */
.heats { list-style: none; margin: 0; padding: 0; }
.heats li { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 24px; border-bottom: 1px solid var(--line); align-items: baseline; }
.heats li:last-child { border-bottom: 0; }
.heats time { font-family: var(--display); font-size: 1.35rem; color: var(--yellow); letter-spacing: .03em; white-space: nowrap; }
.heats div { display: flex; flex-direction: column; }
.heats span { color: var(--muted); font-size: .95rem; }

/* ---------- Teams ---------- */
.team-cols { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.team-col { padding: 22px 24px; }
.team-col .empty { padding: 0; }
.team-col h3 { font-size: 1rem; font-weight: 500; color: var(--muted); display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.team-col ul { list-style: none; margin: 0; padding: 0; }
.team-col li { padding: 10px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; }
.team-col li span { color: var(--muted); font-size: .9rem; }

/* ---------- Leaderboard ---------- */
.lb-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.tabs button {
  padding: 6px 22px 8px; background: transparent; color: var(--muted); border: 2px solid var(--line); cursor: pointer;
  font-family: var(--display); text-transform: uppercase; letter-spacing: .05em; font-size: 1.15rem; transform: skew(-8deg);
}
.tabs button.on.rx { background: var(--pink); border-color: var(--pink); color: #0b0613; }
.tabs button.on.scaled { background: var(--cyan); border-color: var(--cyan); color: #0b0613; }
.tabs button:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

table.lb { width: 100%; border-collapse: collapse; min-width: 620px; }
.lb th { padding: 12px 14px; text-align: left; font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .06em; font-size: .95rem; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.lb td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.lb tbody tr:last-child td { border-bottom: 0; }
.lb td.c-rank, .lb td.c-total { font-family: var(--display); font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.lb .c-rank { width: 56px; text-align: center; }
.lb .c-total { text-align: right; }
.lb td.c-total { color: var(--yellow); }
.lb .c-team { font-weight: 700; font-size: 1.05rem; }
.lb .c-wod b { display: block; font-family: var(--display); font-weight: 400; font-size: 1.2rem; line-height: 1.15; }
.lb .c-wod small { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb .c-wod b.pending { color: var(--muted); }
.lb tr.p1 td { background: rgba(255, 232, 26, .07); }
.lb tr.p1 td.c-rank { color: var(--yellow); }
.lb tr.p2 td.c-rank { color: var(--cyan); }
.lb tr.p3 td.c-rank { color: var(--pink); }

.fine { color: var(--muted); font-size: .88rem; margin-top: 14px; }
footer { padding: 30px 20px 50px; text-align: center; color: var(--muted); font-size: .85rem; }

@media (max-width: 760px) {
  .wod.has-img { grid-template-columns: 1fr; }
  .wod-info { padding: 22px 20px; }
  .heats li { grid-template-columns: 86px 1fr; padding: 12px 16px; }
  h2 { font-size: 1.9rem; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- Admin ---------- */
.admin { max-width: 920px; margin: 0 auto; padding: 28px 20px 80px; }
.admin h1 { font-size: 2.2rem; transform: none; text-shadow: 3px 3px 0 var(--pink); }
.admin-nav { display: flex; gap: 4px; flex-wrap: wrap; margin: 20px 0 26px; border-bottom: 1px solid var(--line); }
.admin-nav a {
  padding: 10px 14px; text-decoration: none; color: var(--muted);
  font-family: var(--display); text-transform: uppercase; font-size: 1.05rem; letter-spacing: .05em;
  border-bottom: 3px solid transparent;
}
.admin-nav a.on { color: var(--text); border-color: var(--pink); }
.admin-nav a.right { margin-left: auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 22px; margin-bottom: 18px; }
.card h3 { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 14px; font-size: 1.4rem; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 4px; font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--pink); outline-offset: 0; border-color: transparent; }
textarea { min-height: 150px; resize: vertical; margin-bottom: 14px; }
textarea.short { min-height: 0; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 1rem; margin: 6px 0 0; }
.check input { width: 18px; height: 18px; accent-color: var(--pink); }
.btn {
  display: inline-block; padding: 10px 26px 12px; background: var(--pink); color: #0b0613; border: 0; border-radius: 3px;
  font-family: var(--display); text-transform: uppercase; font-size: 1.15rem; letter-spacing: .06em; cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.flash { padding: 12px 16px; border-radius: 4px; margin-bottom: 18px; background: rgba(37, 226, 240, .1); border: 1px solid var(--cyan); }
.flash.err { background: rgba(255, 36, 51, .12); border-color: var(--red); }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; padding: 6px 8px 8px 0; font-size: .9rem; color: var(--muted); font-weight: 500; }
table.grid td { padding: 6px 8px 6px 0; vertical-align: middle; }
table.grid td.name { font-weight: 600; }
table.grid td.narrow { width: 120px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.pills a { padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; }
.pills a.on { background: var(--yellow); color: var(--bg); border-color: var(--yellow); }
.hint { color: var(--muted); font-size: .88rem; margin: 0 0 14px; }
.scroll-x { overflow-x: auto; }
.thumb { max-width: 140px; display: block; margin-bottom: 8px; border: 1px solid var(--line); }
