:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  background: #101522;
  color: #f5f7fc;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --panel: #1a2232;
  --line: #303c52;
  --muted: #b3bfd2;
  --accent: #79d6ff;
  --gold: #ffd36a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% -20%, #263854 0, #101522 55rem);
}

.shell { width: min(1040px, 100% - 32px); margin: 0 auto; padding: 48px 0 32px; }
.hero { margin-bottom: 28px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .14em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1; }
h2 { margin-bottom: 0; font-size: clamp(1.25rem, 3vw, 1.8rem); }
.intro { max-width: 700px; margin-bottom: 0; color: var(--muted); font-size: 1.1rem; line-height: 1.55; }
.challenge { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(135deg, #202d42, var(--panel)); box-shadow: 0 18px 48px #0003; }
.challenge-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.status { flex: 0 0 auto; padding: 7px 12px; border: 1px solid #51637e; border-radius: 999px; color: var(--muted); font-size: .82rem; font-weight: 800; text-transform: uppercase; }
.status.live { border-color: #459d73; color: #a8f2c5; background: #1a5335; }
.status.closed { border-color: #765b2c; color: #ffe5a0; background: #54401d; }
.muted { color: var(--muted); }
#challenge-meta { margin: 12px 0 0; }
.vote-callout { margin-top: 18px; padding: 14px 16px; border-left: 4px solid var(--gold); border-radius: 8px; background: #121a28; color: #e7edf7; font-weight: 650; }
code { padding: 3px 7px; border: 1px solid #56647a; border-radius: 6px; background: #0d111b; color: var(--gold); font: 700 .95em ui-monospace, Consolas, monospace; }
.rivals-section { margin-top: 36px; }
.section-heading { align-items: end; margin-bottom: 16px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.section-heading .muted { margin: 0; font-size: .86rem; }
.clip-list { display: grid; gap: 18px; }
.rival-group { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #151d2b; }
.rival-heading { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--gold); font-size: .85rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.clip-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.clip-card { min-width: 0; padding: 18px; }
.clip-card + .clip-card { border-left: 1px solid var(--line); }
.clip-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.clip-code { display: inline-grid; min-width: 38px; height: 34px; place-items: center; border: 1px solid #80662d; border-radius: 9px; background: #493919; color: #fff0bd; font: 850 1rem ui-monospace, Consolas, monospace; }
.vote-count { color: var(--muted); font-size: .9rem; font-weight: 750; }
.clip-title { margin: 0 0 10px; font-size: 1.12rem; line-height: 1.35; overflow-wrap: anywhere; }
.clip-meta { margin: 0 0 14px; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.clip-link { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 13px; border: 1px solid #427391; border-radius: 9px; color: #b8e8ff; font-weight: 800; text-decoration: none; }
.clip-link:hover, .clip-link:focus-visible { background: #17364a; outline: 2px solid var(--accent); outline-offset: 2px; }
.empty { margin: 0; padding: 26px; border: 1px dashed #45536a; border-radius: 14px; color: var(--muted); text-align: center; }
footer { display: flex; justify-content: space-between; gap: 14px; margin-top: 28px; color: #8e9bb0; font-size: .82rem; }

@media (max-width: 620px) {
  .shell { width: min(100% - 22px, 1040px); padding-top: 28px; }
  .challenge { padding: 18px; }
  .challenge-heading, .section-heading { align-items: flex-start; }
  .clip-card + .clip-card { border-left: 0; border-top: 1px solid var(--line); }
  footer { flex-direction: column; }
}
