:root {
  color-scheme: dark;
  --ink: #0b0d0c;
  --surface: #131614;
  --surface-2: #1a1e1b;
  --line: #303631;
  --paper: #f2f3ed;
  --muted: #9da49d;
  --acid: #dfff3f;
  --orange: #ff6746;
  --blue: #70a5ff;
  --radius: 4px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--ink); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--ink); color: var(--paper); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
.eyebrow { margin: 0 0 .8rem; color: var(--acid); font-size: .72rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: var(--radius); padding: .68rem .95rem; background: transparent; color: var(--paper); font-weight: 750; text-decoration: none; cursor: pointer; }
.button:hover { border-color: var(--paper); }
.button-primary { border-color: var(--acid); background: var(--acid); color: var(--ink); }
.button-secondary { background: var(--surface-2); }
.button-danger { border-color: var(--orange); color: var(--orange); }
.button-quiet { color: var(--muted); }
.button-large { min-height: 52px; padding-inline: 1.3rem; }
.text-button { border: 0; padding: .3rem 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; }
.back-link { color: var(--muted); font-size: .88rem; text-decoration: none; }
.compact-brand { font-size: .88rem; font-weight: 900; letter-spacing: -.03em; text-decoration: none; }
.compact-brand em { color: var(--acid); font-style: normal; }
.flash { position: sticky; z-index: 3; top: .5rem; margin: .5rem auto 1rem; border: 1px solid; padding: .85rem 1rem; background: var(--ink); font-weight: 700; }
.flash-success { border-color: var(--acid); color: var(--acid); }
.flash-error { border-color: var(--orange); color: var(--orange); }
.empty-note, .help-text { color: var(--muted); line-height: 1.6; }

.identity-page { display: grid; min-height: 100vh; grid-template-rows: auto 1fr; }
.event-mark { position: relative; display: grid; grid-template-columns: 1fr auto; border-bottom: 1px solid var(--line); padding: 1.2rem; }
.event-kicker { grid-column: 1 / -1; margin-bottom: 1rem; color: var(--muted); font-size: .65rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.event-wordmark { font-size: clamp(2.5rem, 13vw, 5.5rem); font-weight: 950; letter-spacing: -.085em; line-height: .76; }
.event-year { align-self: end; color: var(--acid); font-size: 1.25rem; font-weight: 900; writing-mode: vertical-rl; }
.identity-panel { align-self: end; border-top: 1px solid var(--line); padding: 2rem 1.2rem 2.5rem; }
.identity-panel h1 { margin: 0 0 2rem; font-size: clamp(2.6rem, 14vw, 5rem); letter-spacing: -.06em; line-height: .94; }
.identity-panel h1 span { color: var(--acid); }
.participant-picker { display: grid; }
.participant-picker button { display: grid; grid-template-columns: 2.4rem 1fr auto; align-items: center; border: 0; border-top: 1px solid var(--line); padding: 1rem 0; background: none; color: var(--paper); text-align: left; cursor: pointer; }
.participant-picker button:last-child { border-bottom: 1px solid var(--line); }
.participant-picker button span { color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.participant-picker button b { color: var(--acid); }
.participant-picker button:hover { color: var(--acid); }
.choice-actions { display: flex; gap: .7rem; }

.portal-page { width: min(100%, 920px); margin: auto; }
.portal-header { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 1rem 1.2rem; }
.portal-header .text-button { font-size: .72rem; }
.portal-hero { padding: 4rem 1.2rem 1.5rem; }
.portal-hero h1 { margin: 0 0 3.5rem; font-size: clamp(3.2rem, 16vw, 7rem); letter-spacing: -.07em; line-height: .86; }
.current-discipline { border-left: 5px solid var(--acid); padding: .3rem 0 .3rem 1rem; }
.current-discipline span, .current-discipline small { display: block; color: var(--muted); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
.current-discipline strong { display: block; margin: .25rem 0; font-size: clamp(1.5rem, 7vw, 2.7rem); letter-spacing: -.04em; }
.schedule { padding: 3.5rem 1.2rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.section-heading .eyebrow { margin: 0; }
.section-heading h1, .section-heading h2 { margin: 0; font-size: clamp(2rem, 8vw, 3.5rem); letter-spacing: -.055em; }
.section-heading sup { color: var(--acid); font-size: .7rem; }
.discipline-list { margin: 0; padding: 0; list-style: none; }
.discipline-list li { display: grid; grid-template-columns: 2.5rem 1fr auto; gap: .5rem; align-items: center; min-height: 76px; border-top: 1px solid var(--line); }
.discipline-list li:last-child { border-bottom: 1px solid var(--line); }
.discipline-number { color: var(--muted); font-size: .72rem; }
.discipline-list strong, .discipline-list small { display: block; }
.discipline-list strong { font-size: 1rem; }
.discipline-list small { margin-top: .25rem; color: var(--muted); font-size: .68rem; text-transform: uppercase; }
.discipline-list a { color: var(--muted); font-size: .72rem; text-decoration: none; }
.discipline-list a span { color: var(--acid); }
.discipline-list li[data-status="in_progress"] { border-left: 4px solid var(--acid); padding-left: .8rem; }
.discipline-list li[data-status="in_progress"] .discipline-status { color: var(--acid); }
.discipline-list li[data-status="completed"] { opacity: .58; }

.placeholder-page { display: flex; min-height: 100vh; flex-direction: column; padding: 1.2rem; }
.placeholder-page section { margin: auto 0; }
.placeholder-page h1 { max-width: 900px; margin: 0; font-size: clamp(3.5rem, 15vw, 9rem); letter-spacing: -.075em; line-height: .84; }
.placeholder-page section > p:not(.eyebrow) { max-width: 40rem; color: var(--muted); font-size: 1.1rem; line-height: 1.6; }
.live-pill { display: inline-block; border: 1px solid var(--acid); padding: .45rem .7rem; color: var(--acid); font-size: .72rem; font-weight: 800; text-transform: uppercase; }

.screen-shell { overflow: hidden; }
.screen-app { display: grid; width: 100vw; min-height: 100vh; grid-template-rows: auto 1fr auto; padding: 3vh 4vw; }
.screen-header, .screen-footer { display: flex; justify-content: space-between; color: var(--muted); font-size: clamp(.65rem, 1vw, 1rem); font-weight: 850; letter-spacing: .14em; }
.screen-header b { color: var(--acid); }
.screen-content { display: flex; min-height: 0; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.screen-kicker { margin: 0 0 2vh; color: var(--acid); font-size: clamp(.85rem, 1.4vw, 1.5rem); font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.screen-title { max-width: 90vw; margin: 0; font-size: clamp(4rem, 10vw, 11rem); letter-spacing: -.075em; line-height: .86; }
.screen-subtitle { margin: 3vh 0 0; color: var(--muted); font-size: clamp(1.4rem, 2.6vw, 3rem); }
.ceremony-title { font-size: clamp(3rem, 7vw, 8rem); }
.ceremony-results { display: grid; width: min(90vw, 1250px); max-height: 55vh; grid-template-columns: repeat(2, 1fr); gap: 0 3vw; margin: 3vh 0 0; padding: 0; list-style: none; overflow: hidden; }
.ceremony-results li { display: grid; grid-template-columns: 4vw 1fr auto; align-items: center; border-top: 1px solid var(--line); padding: 1.2vh 0; text-align: left; }
.result-rank { color: var(--acid); font-size: clamp(1.2rem, 2vw, 2.5rem); font-weight: 900; }
.result-name { font-size: clamp(1.1rem, 2vw, 2.3rem); }
.result-value { color: var(--muted); font-size: clamp(.8rem, 1.25vw, 1.4rem); }
.standings-reveal { display: flex; max-width: 900px; flex-direction: column; }
.winner-rank { color: var(--acid); font-size: clamp(5rem, 12vw, 13rem); font-weight: 950; line-height: .8; }
.winner-name { margin: 1vh 0; font-size: clamp(5rem, 13vw, 14rem); letter-spacing: -.08em; line-height: .8; }
.winner-score { color: var(--muted); font-size: clamp(1.5rem, 2.4vw, 3rem); }

.admin-shell { background: #0e100f; }
.admin-header { position: sticky; z-index: 4; top: 0; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: .8rem 1rem; background: rgba(11, 13, 12, .96); }
.admin-header div small { display: block; margin-top: .18rem; color: var(--muted); font-size: .65rem; }
.admin-header nav { display: flex; align-items: center; gap: 1rem; }
.admin-header nav a, .admin-header > a { color: var(--muted); font-size: .75rem; text-decoration: none; }
.admin-page { width: min(100%, 1100px); margin: auto; padding: 1rem; }
.admin-section { margin: 1rem 0; border: 1px solid var(--line); padding: 1rem; background: var(--surface); }
.admin-section > h1 { margin: 0; font-size: clamp(2.3rem, 8vw, 4.5rem); letter-spacing: -.06em; }
.status-banner { display: grid; grid-template-columns: 1fr; border-left: 5px solid var(--muted); padding: 1rem; background: var(--ink); }
.status-banner span, .status-banner small { color: var(--muted); font-size: .72rem; text-transform: uppercase; }
.status-banner strong { margin: .25rem 0; font-size: 1.8rem; }
.status-in_progress { border-color: var(--acid); }
.status-finished { border-color: var(--blue); }
.action-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.action-row.compact { margin-top: auto; }
.admin-disciplines { display: grid; gap: .7rem; }
.admin-discipline { display: flex; min-height: 175px; flex-direction: column; border-top: 3px solid var(--line); padding: 1rem; background: var(--ink); }
.admin-discipline.is-in_progress { border-color: var(--acid); }
.admin-discipline.is-completed { opacity: .78; }
.discipline-topline { display: flex; justify-content: space-between; color: var(--muted); font-size: .7rem; text-transform: uppercase; }
.admin-discipline h3 { margin: .8rem 0 1.5rem; font-size: 1.35rem; line-height: 1.05; }
.tiebreak-form { display: grid; gap: .6rem; margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.tiebreak-form label, .add-participant label, .login-card label { display: grid; gap: .4rem; color: var(--muted); font-size: .7rem; font-weight: 750; text-transform: uppercase; }
input, select { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 2px; padding: .65rem .75rem; outline: 0; background: var(--ink); color: var(--paper); }
input:focus, select:focus { border-color: var(--acid); }
.add-participant { display: grid; gap: .7rem; border-bottom: 1px solid var(--line); padding-bottom: 1rem; }
.participant-admin-list form { display: grid; grid-template-columns: 2rem 1fr; gap: .6rem; align-items: center; border-bottom: 1px solid var(--line); padding: .8rem 0; }
.participant-admin-list form > span { color: var(--muted); font-size: .7rem; }
.toggle { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .7rem; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle i { position: relative; width: 34px; height: 20px; border: 1px solid var(--line); border-radius: 20px; }
.toggle i::after { position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); content: ""; transition: transform .15s; }
.toggle input:checked + i { border-color: var(--acid); }
.toggle input:checked + i::after { background: var(--acid); transform: translateX(14px); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { border-bottom: 1px solid var(--line); padding: .75rem .55rem; text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: .65rem; text-transform: uppercase; }
.warning-tag { color: var(--orange); font-size: .7rem; font-weight: 800; }
.ceremony-control > p { color: var(--muted); }
.result-editor { margin-top: 1.5rem; }
.result-editor label { display: grid; grid-template-columns: 1fr minmax(110px, 30%); gap: 1rem; align-items: center; border-bottom: 1px solid var(--line); padding: .8rem 0; }
.result-editor label span b, .result-editor label span small { display: block; }
.result-editor label span small { margin-top: .25rem; color: var(--muted); font-size: .7rem; }
.result-row { display: grid; grid-template-columns: 1fr minmax(180px, 40%); gap: 1rem; align-items: center; border-bottom: 1px solid var(--line); padding: .8rem 0; }
.result-row span b, .result-row span small { display: block; }
.result-row span small { margin-top: .25rem; color: var(--muted); font-size: .7rem; }
.result-row output { color: var(--ink); text-align: right; }
.sticky-actions { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: .5rem; border-top: 1px solid var(--line); padding: .8rem 0; background: var(--surface); }
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 1rem; }
.login-card { width: min(100%, 420px); border: 1px solid var(--line); padding: 1.2rem; background: var(--surface); }
.login-card h1 { margin: 0 0 2rem; font-size: 2.4rem; letter-spacing: -.05em; }
.login-card .button { width: 100%; margin: 1rem 0; }

.archive-shell { background: var(--paper); color: var(--ink); --line: #c8cbc3; --muted: #60665f; }
.archive-page { width: min(100%, 1000px); margin: auto; padding: 1rem; }
.archive-hero { min-height: 82vh; display: flex; flex-direction: column; justify-content: center; border-bottom: 1px solid var(--line); }
.archive-hero h1 { margin: 0; font-size: clamp(4.5rem, 18vw, 11rem); letter-spacing: -.09em; line-height: .7; }
.archive-hero span { margin-top: 2rem; color: var(--muted); font-weight: 750; }
.podium-section, .archive-disciplines { padding: 5rem 0; }
.final-standings { margin: 0; padding: 0; list-style: none; }
.final-standings li { display: grid; grid-template-columns: 3rem 1fr auto; align-items: center; border-top: 1px solid var(--line); padding: 1rem 0; }
.final-standings li > span { font-size: 1.8rem; font-weight: 950; }
.final-standings li > a { font-size: 1.15rem; font-weight: 800; text-decoration: none; }
.final-standings li > b small { color: var(--muted); }
.final-standings .place-1 { border-top: 5px solid var(--ink); padding: 2rem 0; }
.final-standings .place-1 > span { color: #a1b600; font-size: 3rem; }
.final-standings .place-1 > a { font-size: 2rem; }
.archive-disciplines details { border-top: 1px solid var(--line); }
.archive-disciplines details:last-child { border-bottom: 1px solid var(--line); }
.archive-disciplines summary { display: grid; grid-template-columns: 3rem 1fr auto; align-items: center; padding: 1.2rem 0; cursor: pointer; list-style: none; }
.archive-disciplines summary::-webkit-details-marker { display: none; }
.archive-disciplines summary > span { color: var(--muted); font-size: .7rem; }
.archive-disciplines summary > b { font-size: 1.5rem; }
.archive-disciplines details[open] summary > b { transform: rotate(45deg); }
.archive-shell table a { font-weight: 700; text-decoration: none; }
.participant-result-page { width: min(100%, 760px); margin: auto; padding: 1.2rem; }
.participant-result-page header { padding: 7rem 0 3rem; }
.participant-result-page h1 { margin: 0; font-size: clamp(3.7rem, 15vw, 7.5rem); letter-spacing: -.08em; line-height: .85; }
.participant-total { display: flex; align-items: center; gap: 1rem; margin-top: 2.5rem; }
.participant-total > span { font-size: 5rem; font-weight: 950; line-height: .8; }
.participant-total p, .participant-total small { margin: 0; display: block; color: var(--muted); }
.participant-results { margin: 0 0 5rem; padding: 0; list-style: none; }
.participant-results li { display: grid; grid-template-columns: 2.5rem 1fr auto; align-items: center; border-top: 1px solid var(--line); padding: 1rem 0; }
.participant-results li > span, .participant-results small { color: var(--muted); font-size: .7rem; }
.participant-results li div b, .participant-results li div small, .participant-results li > strong small { display: block; }
.participant-results li > strong { text-align: right; }

@media (min-width: 700px) {
  .identity-page { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
  .event-mark { grid-template-rows: auto 1fr; border-right: 1px solid var(--line); border-bottom: 0; padding: 2rem; }
  .event-wordmark { align-self: end; font-size: min(7vw, 7rem); }
  .identity-panel { align-self: stretch; display: flex; flex-direction: column; justify-content: center; border-top: 0; padding: 4rem; }
  .identity-panel h1 { font-size: min(7vw, 6rem); }
  .portal-header { padding: 1.2rem 2rem; }
  .portal-hero, .schedule { padding-inline: 2rem; }
  .discipline-list strong { font-size: 1.15rem; }
  .admin-disciplines { grid-template-columns: repeat(2, 1fr); }
  .admin-section { padding: 1.5rem; }
  .status-banner { grid-template-columns: 8rem 1fr auto; align-items: center; }
  .participant-admin-list form { grid-template-columns: 2rem 1fr 140px auto; }
  .add-participant { grid-template-columns: 1fr auto; align-items: end; }
  .tiebreak-form { grid-template-columns: 1fr auto; align-items: end; }
}
@media (min-width: 1000px) {
  .admin-disciplines { grid-template-columns: repeat(3, 1fr); }
  .archive-page { padding-inline: 2rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
