:root {
  color-scheme: dark;
  --bg: #101a35;
  --panel: #172341;
  --raised: #202e51;
  --ink: #fff9ec;
  --muted: #c5cce1;
  --accent: #ffdf34;
  --line: #425175;
  --error: #ffb3a2;
  font-family: system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse at 75% 0, #202d54, var(--bg) 48rem); }
main { width: min(100%, 66rem); margin: auto; padding: max(1.25rem, env(safe-area-inset-top)) clamp(1rem, 4vw, 2.25rem) max(4rem, env(safe-area-inset-bottom)); }
p { line-height: 1.55; }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0 0 1rem; }
.team-masthead { display: flex; align-items: center; gap: .65rem; }
.crest { width: 3.1rem; height: 3.1rem; object-fit: contain; filter: drop-shadow(0 0 1px #f7e79c) drop-shadow(0 0 2px #f7e79c70); }
.team-name { margin: 0; font-weight: 760; }
.eyebrow { margin: 0; color: var(--accent); font-size: .73rem; font-weight: 760; letter-spacing: .095em; text-transform: uppercase; white-space: nowrap; }
.challenge-hero { display: grid; grid-template-columns: 1.65fr minmax(11rem, 1fr); gap: clamp(1.25rem, 5vw, 4rem); align-items: end; padding: clamp(1.25rem, 5vw, 3rem); border: 1px solid #556189; border-radius: 1.25rem; background: repeating-linear-gradient(133deg, transparent 0 48px, #fff1b00c 49px 50px, transparent 51px 74px), linear-gradient(115deg, #243565, #1d2b52 68%, #303957); }
h1 { margin: 0; font-size: clamp(2.7rem, 7.6vw, 5.2rem); line-height: .96; letter-spacing: -.065em; font-weight: 850; }
h1 span { display: block; margin-bottom: .17em; color: var(--accent); font-size: 1.12em; line-height: .82; }
.lede { margin: 1rem 0 0; max-width: 30rem; }
.muted, .lede { color: var(--muted); }
.countdown { min-width: 0; padding: 1rem 1.15rem .85rem; border: 1px solid #657092; border-radius: .85rem; background: #111b36db; }
.countdown-value { display: flex; gap: .55rem; align-items: baseline; }
.countdown-value strong { color: var(--accent); font-size: clamp(2.05rem, 5vw, 3.6rem); line-height: 1; font-weight: 850; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.countdown-value span { font-weight: 710; }
.countdown p { margin: .45rem 0 0; color: var(--muted); font-size: .8rem; }
progress { display: block; width: 100%; height: .45rem; border: 0; border-radius: 1rem; overflow: hidden; appearance: none; background: #39496e; }
progress::-webkit-progress-bar { background: #39496e; border-radius: 1rem; }
progress::-webkit-progress-value { background: var(--accent); border-radius: 1rem; }
progress::-moz-progress-bar { background: var(--accent); border-radius: 1rem; }
.countdown progress { margin-top: .75rem; }
.challenge-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem; margin: 1.2rem 0 .85rem; padding: .3rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--panel); }
button, input, .file { font: inherit; }
button, .file { cursor: pointer; }
.challenge-nav button { min-height: 44px; padding: .45rem .15rem; border: 0; border-radius: .6rem; background: transparent; color: var(--muted); font-weight: 710; }
.challenge-nav button[aria-pressed=true] { background: var(--accent); color: var(--bg); }
.challenge-nav button:not([aria-pressed=true]):hover, .secondary:hover { background: #2a3b66; }
.panel { min-width: 0; padding: clamp(1rem, 3vw, 1.75rem); border: 1px solid var(--line); border-radius: 1rem; background: var(--panel); }
.panel > p:last-child, .panel > p:empty { margin-bottom: 0; }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .65rem; }
.panel-heading p { flex-shrink: 0; margin: 0; font-size: .85rem; }
h2 { margin: 0; font-size: clamp(1.2rem, 4vw, 1.7rem); letter-spacing: -.025em; }
.panel > p { margin-top: .55rem; }
.hero { margin-top: 1rem; padding: 1rem 1.2rem; display: grid; gap: .55rem; border: 1px solid var(--line); border-radius: .75rem; color: var(--muted); background: var(--raised); }
.hero strong { font-size: clamp(2rem, 7vw, 3.5rem); letter-spacing: -.045em; line-height: 1.1; color: var(--ink); font-variant-numeric: tabular-nums; }
.actions, .fields { display: flex; gap: .65rem; }
.fields label, .actions label { flex: 1; min-width: 0; }
label { display: grid; gap: .4rem; font-weight: 650; margin-top: .9rem; }
input { width: 100%; min-width: 0; min-height: 44px; padding: .65rem .75rem; color: var(--ink); border: 1px solid #637295; border-radius: .6rem; background: #111b35; }
.primary, .secondary { min-height: 44px; padding: .65rem .7rem; border: 1px solid transparent; border-radius: .65rem; font-weight: 760; text-align: center; }
.primary { background: var(--accent); color: var(--bg); }
.primary:hover { background: #ffe775; }
.secondary { background: var(--raised); color: var(--ink); border-color: #637295; }
form button { margin-top: 1rem; width: 100%; }
button:disabled { cursor: wait; opacity: .55; }
.file { position: relative; display: grid; place-items: center; font-size: .95rem; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file:focus-within, :focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
#proof { display: block; width: 100%; height: clamp(10rem, 35vw, 20rem); object-fit: contain; background: #0e172e; border: 1px solid var(--line); border-radius: .75rem; }
.capture-date { margin: .65rem 0 0; color: var(--accent); font-size: .85rem; font-weight: 680; }
.rankings { padding: 0; list-style: none; margin: .8rem 0 0; }
.rankings li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .36rem .8rem; padding: .85rem .15rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.rankings li:last-child { border-bottom: 0; }
.rankings span { font-variant-numeric: tabular-nums; font-weight: 730; }
.rankings small { color: var(--muted); }
#rankings progress { grid-column: 1/-1; margin-top: .13rem; }
#notice { padding: .7rem .9rem; margin: .85rem 0; border-left: 3px solid var(--accent); border-radius: .35rem; background: var(--raised); }
#notice[data-error=true] { border-color: var(--error); }
details { margin-top: 1.4rem; color: var(--muted); }
.check-row { display: flex; align-items: center; gap: .65rem; min-height: 44px; color: var(--accent); }
.check-row input { width: 1.2rem; height: 1.2rem; min-height: 0; accent-color: var(--accent); }
@media (max-width: 38rem) {
  .challenge-hero { grid-template-columns: minmax(0, 1fr); }
  .countdown { max-width: none; }
}
@media (max-width: 23rem) {
  .team-name, .challenge-nav button { font-size: .87rem; }
  .crest { width: 2.55rem; height: 2.55rem; }
  .site-header { gap: .65rem; }
}
