:root {
  --night: #071e2b;
  --night-deep: #03131b;
  --denim: #0c4152;
  --teal: #2ec4b6;
  --paper: #fff1ce;
  --paper-bright: #fff9e8;
  --amber: #ffb21c;
  --orange: #e55b23;
  --red: #b82f2f;
  --ink: #182224;
  --muted: #677273;
  --white: #fffdf7;
  --line: rgba(255, 241, 206, 0.22);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
body {
  margin: 0;
  color: var(--paper-bright);
  background: var(--night-deep);
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  letter-spacing: 0;
}
button, input { font: inherit; letter-spacing: 0; }
a { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  transform: translateY(-150%);
  background: var(--paper);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 4px;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 100%;
  height: 66px;
  padding: 0 clamp(18px, 4vw, 58px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(3, 19, 27, 0.76);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--paper-bright);
  text-decoration: none;
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-weight: 800;
  font-size: 19px;
}
.brand-star { color: var(--amber); font-size: 17px; }
.header-actions { display: flex; align-items: center; gap: 22px; }
.header-link { text-decoration: none; font-size: 14px; font-weight: 700; }
.sound-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0;
  color: var(--white);
  background: transparent;
  border: 0;
  cursor: pointer;
}
.sound-icon { font-size: 18px; width: 22px; }
.sound-label { font-size: 13px; font-weight: 700; }
.switch-track {
  position: relative;
  width: 38px;
  height: 22px;
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 11px;
  background: rgba(255,255,255,.12);
}
.switch-track span {
  position: absolute;
  width: 16px;
  height: 16px;
  top: 2px;
  left: 3px;
  border-radius: 50%;
  background: var(--paper);
  transition: transform 180ms ease, background 180ms ease;
}
.sound-switch[aria-checked="true"] .switch-track { background: var(--teal); border-color: var(--teal); }
.sound-switch[aria-checked="true"] .switch-track span { transform: translateX(15px); background: var(--night); }

.hero {
  position: relative;
  min-height: min(840px, 86svh);
  overflow: hidden;
  background: var(--night);
}
.hero-picture { position: absolute; inset: 0; display: block; }
.hero-art { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 16, 22, .18) 45%, rgba(2, 16, 22, .88) 100%);
}
.hero-bottom {
  position: absolute;
  z-index: 3;
  left: clamp(20px, 5vw, 74px);
  right: clamp(20px, 5vw, 74px);
  bottom: 28px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}
.hero-live-count {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-height: 46px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 241, 206, .42);
  border-radius: 5px;
  background: rgba(3, 19, 27, .78);
  white-space: nowrap;
  backdrop-filter: blur(10px);
}
.hero-live-count strong { color: var(--amber); font-size: 26px; line-height: 1; }
.hero-live-count span { color: var(--paper); font-size: 12px; font-weight: 800; }
.hero-bottom p {
  margin: 0;
  max-width: 650px;
  font-family: Georgia, serif;
  font-size: clamp(26px, 3.5vw, 58px);
  line-height: 1;
}
.hero-bottom a {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--paper);
  font-weight: 800;
  white-space: nowrap;
}

.section-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.submission-band {
  background: var(--paper);
  color: var(--ink);
  border-top: 8px solid var(--amber);
  padding: clamp(46px, 7vw, 92px) 0;
}
.submit-layout { display: grid; grid-template-columns: minmax(250px, .72fr) minmax(580px, 1.5fr); gap: clamp(36px, 7vw, 96px); align-items: start; }
.submit-intro h2,
.board-header h2,
.origin-copy h2,
.song-links h2,
.song-studio h2 {
  margin: 0;
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-weight: 900;
  line-height: .98;
}
.submit-intro h2 { font-size: clamp(38px, 5vw, 67px); }
.submit-intro > p { color: #4e5a5a; font-size: 18px; line-height: 1.55; }
.rules-details { border-top: 1px solid rgba(24,34,36,.2); padding-top: 16px; color: #4e5a5a; }
.rules-details summary, .identity-details summary { cursor: pointer; font-weight: 800; color: var(--ink); }
.rules-details p { font-size: 14px; line-height: 1.5; }

.word-form { min-width: 0; }
.word-inputs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.word-inputs label {
  position: relative;
  display: block;
  min-width: 0;
  background: var(--white);
  border: 2px solid #29474b;
  border-radius: 6px;
  box-shadow: 5px 5px 0 #29474b;
}
.word-inputs label:focus-within { border-color: var(--orange); box-shadow: 5px 5px 0 var(--orange); }
.word-inputs label > span {
  position: absolute;
  left: 10px;
  top: 8px;
  color: var(--red);
  font-size: 11px;
  font-weight: 900;
}
.word-inputs input {
  width: 100%;
  min-width: 0;
  height: 82px;
  padding: 22px 10px 8px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  text-align: center;
  font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif;
  font-size: clamp(19px, 2vw, 29px);
  font-weight: 900;
}
.word-inputs input::placeholder { color: #a8a998; }
.identity-details { margin-top: 24px; border-top: 1px solid rgba(24,34,36,.2); border-bottom: 1px solid rgba(24,34,36,.2); padding: 15px 0; }
.identity-details summary span { color: var(--muted); font-size: 12px; font-weight: 600; }
.identity-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 14px; padding-top: 16px; }
.identity-grid label > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.identity-grid input { width: 100%; height: 46px; padding: 0 12px; border: 1px solid #a9afa8; border-radius: 4px; background: var(--white); }
.identity-grid input:focus { outline: 3px solid rgba(46,196,182,.38); border-color: var(--denim); }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; }
.check-line { display: flex; align-items: flex-start; gap: 10px; margin-top: 18px; font-size: 14px; font-weight: 700; cursor: pointer; }
.check-line input { width: 20px; height: 20px; margin: 0; accent-color: var(--denim); flex: 0 0 auto; }
.form-footer { margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.form-status { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.form-status.is-error { color: var(--red); font-weight: 800; }
.form-status.is-success { color: #147460; font-weight: 800; }
.submit-button, .studio-button {
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 5px;
  background: var(--red);
  color: white;
  box-shadow: 5px 5px 0 #65201c;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}
.submit-button:hover { background: #ce3933; }
.submit-button:disabled { opacity: .55; cursor: wait; }

.wordboard-section { padding: clamp(62px, 9vw, 120px) 0; background: var(--night); }
.board-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 34px; }
.section-kicker { margin: 0 0 10px; color: var(--amber); font-size: 13px; font-weight: 900; }
.board-header h2, .origin-copy h2, .song-links h2, .song-studio h2 { font-size: clamp(36px, 5vw, 68px); }
.live-stamp { display: inline-flex; align-items: center; gap: 7px; color: #b8d5d5; font-size: 13px; white-space: nowrap; }
.live-stamp > span { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 12px var(--teal); animation: live-pulse 2s infinite; }
@keyframes live-pulse { 50% { opacity: .35; } }
.board-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .7fr); border: 1px solid var(--line); }
.ranking-stage { min-height: 520px; padding: clamp(22px, 4vw, 44px); border-right: 1px solid var(--line); background-color: #092a38; background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px); background-size: 22px 22px; }
.rank-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 44px; gap: 12px; align-items: center; min-height: 38px; margin-bottom: 11px; }
.rank-number { color: var(--amber); font-family: Georgia, serif; font-weight: 700; font-size: 18px; }
.rank-track { position: relative; height: 34px; background: rgba(255,255,255,.06); overflow: hidden; }
.rank-fill { position: absolute; inset: 0 auto 0 0; width: var(--rank-width); min-width: 4px; background: var(--rank-color); transform-origin: left; animation: rank-in 700ms cubic-bezier(.2,.8,.2,1) both; }
.rank-word { position: relative; z-index: 1; display: flex; align-items: center; height: 100%; padding: 0 12px; color: white; font-family: "Avenir Next Condensed", "Arial Narrow", sans-serif; font-size: 19px; font-weight: 900; text-transform: uppercase; }
.rank-count { font-weight: 900; text-align: right; font-variant-numeric: tabular-nums; }
@keyframes rank-in { from { transform: scaleX(0); } }
.empty-state { display: grid; place-items: center; min-height: 430px; color: #a9c2c3; text-align: center; font-family: Georgia, serif; font-size: 24px; line-height: 1.35; }
.recent-board { min-width: 0; background: #061d29; }
.recent-heading { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 22px; border-bottom: 1px solid var(--line); }
.recent-heading h3 { margin: 0; font-size: 18px; }
.recent-heading span { color: #9ebcbd; font-size: 12px; }
.recent-list { list-style: none; margin: 0; padding: 0; max-height: 520px; overflow: auto; }
.recent-list li { padding: 18px 22px; border-bottom: 1px solid rgba(255,255,255,.1); }
.recent-words { display: flex; flex-wrap: wrap; gap: 5px 9px; font-weight: 900; }
.recent-words span:not(:last-child)::after { content: "/"; color: var(--orange); margin-left: 9px; }
.recent-meta { display: flex; justify-content: space-between; gap: 14px; margin-top: 8px; color: #92adae; font-size: 11px; }
.recent-meta a { color: var(--teal); }
.recent-empty { color: #9eb4b5; line-height: 1.5; }

.origin-section { padding: clamp(64px, 9vw, 120px) 0; background: #f3d98f; color: var(--ink); }
.origin-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(48px, 8vw, 110px); align-items: center; }
.origin-copy .section-kicker, .song-links .section-kicker { color: var(--red); }
.origin-copy p:not(.section-kicker) { color: #465152; font-size: 17px; line-height: 1.65; }
.plain-link { display: inline-flex; min-height: 44px; align-items: center; color: #0b5865; font-weight: 900; }
.song-links { display: grid; grid-template-columns: 94px 1fr; gap: 24px; align-items: center; padding: 26px; border: 2px solid #664115; border-radius: 7px; background: var(--paper-bright); box-shadow: 8px 8px 0 rgba(102,65,21,.25); }
.song-links h2 { font-size: clamp(31px, 4vw, 52px); }
.song-links p { color: var(--muted); }
.vinyl-mark { width: 86px; height: 86px; border-radius: 50%; background: repeating-radial-gradient(circle, #182224 0 4px, #3e4747 5px 6px); display: grid; place-items: center; }
.vinyl-mark span { width: 28px; height: 28px; border-radius: 50%; background: var(--orange); border: 7px solid var(--paper); }
.player-shell { grid-column: 1 / -1; min-width: 0; margin-top: 4px; }
.provider-tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid #c8b588; border-bottom: 0; background: #eee1c4; }
.provider-option {
  min-width: 0;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 8px;
  border: 0;
  border-right: 1px solid #c8b588;
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}
.provider-option:last-child { border-right: 0; }
.provider-option img { width: 23px; height: 23px; object-fit: contain; flex: 0 0 auto; }
.provider-option:hover { background: #fff3d2; }
.provider-option.is-active, .provider-option[aria-selected="true"] { background: var(--paper-bright); box-shadow: inset 0 -4px var(--orange); }
.provider-all-icon { display: grid; place-items: center; width: 24px; height: 24px; color: white; background: var(--denim); border-radius: 50%; font-size: 15px; }
.player-window { min-height: 176px; display: grid; place-items: stretch; overflow: hidden; border: 1px solid #c8b588; background: #121212; }
.music-player { width: 100%; height: 176px; border: 0; display: block; }
.player-window[data-provider="youtube"] .music-player { height: auto; aspect-ratio: 16 / 9; }
.player-footer { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 8px 12px; color: #596263; border: 1px solid #c8b588; border-top: 0; font-size: 11px; font-weight: 800; }
.player-footer a { color: #0b5865; }

.song-studio { padding: clamp(64px, 8vw, 110px) 0; background: #b6322f; color: white; }
.studio-layout { display: grid; grid-template-columns: 1.1fr .8fr; gap: clamp(48px, 8vw, 100px); align-items: center; }
.song-studio .section-kicker { color: #ffd467; }
.song-studio p:not(.section-kicker) { max-width: 680px; line-height: 1.65; }
.studio-control { padding: 26px; border: 2px solid rgba(255,255,255,.75); border-radius: 6px; background: rgba(73,11,9,.28); }
.adult-check { margin: 0 0 18px; }
.adult-check input { accent-color: var(--amber); }
.studio-button { width: 100%; background: var(--paper); color: var(--ink); box-shadow: 5px 5px 0 #6b1716; }
.studio-button:disabled { opacity: .65; cursor: not-allowed; }
.studio-control p { margin: 17px 0 0; font-size: 13px; color: #ffe6d8; }

.site-footer { display: flex; justify-content: space-between; gap: 60px; padding: 42px clamp(20px, 5vw, 74px); background: #020e14; border-top: 1px solid rgba(255,255,255,.12); }
.site-footer strong { font-size: 17px; }
.site-footer p { max-width: 680px; color: #94abad; font-size: 12px; line-height: 1.55; }
.footer-links { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; font-size: 13px; font-weight: 800; text-align: right; }

button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }

@media (max-width: 900px) {
  .hero { min-height: 720px; }
  .submit-layout, .origin-grid, .studio-layout { grid-template-columns: 1fr; }
  .submit-layout { gap: 34px; }
  .board-grid { grid-template-columns: 1fr; }
  .ranking-stage { border-right: 0; border-bottom: 1px solid var(--line); }
  .song-links { max-width: 680px; }
}

@media (max-width: 620px) {
  .site-header { height: 58px; padding: 0 14px; }
  .brand { font-size: 16px; }
  .header-link, .sound-label { display: none; }
  .sound-switch { gap: 5px; }
  .hero { min-height: 640px; }
  .hero-art { object-position: center top; }
  .hero-shade { background: linear-gradient(180deg, rgba(2,16,22,.28) 35%, rgba(2,16,22,.94) 100%); }
  .hero-bottom { bottom: 18px; align-items: flex-start; flex-direction: column; gap: 10px; }
  .hero-bottom p { max-width: 310px; font-size: 28px; }
  .hero-live-count { min-height: 42px; padding: 7px 11px; }
  .hero-live-count strong { font-size: 22px; }
  .section-shell { width: min(100% - 28px, 1180px); }
  .word-inputs { grid-template-columns: 1fr 1fr; gap: 12px; }
  .word-inputs input { height: 72px; font-size: 24px; }
  .identity-grid { grid-template-columns: 1fr; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .submit-button { width: 100%; }
  .board-header { align-items: flex-start; flex-direction: column; }
  .ranking-stage { min-height: 430px; padding: 20px 14px; }
  .rank-row { grid-template-columns: 26px minmax(0, 1fr) 34px; gap: 8px; }
  .rank-word { font-size: 16px; }
  .song-links { grid-template-columns: 70px 1fr; padding: 18px; gap: 14px; }
  .vinyl-mark { width: 66px; height: 66px; }
  .provider-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid #c8b588; }
  .provider-option { min-height: 50px; justify-content: flex-start; padding: 8px 11px; border-bottom: 1px solid #c8b588; }
  .provider-option:nth-child(2n) { border-right: 0; }
  .provider-option:last-child { grid-column: 1 / -1; border-bottom: 0; justify-content: center; }
  .player-footer { align-items: flex-start; flex-direction: column; }
  .site-footer { flex-direction: column; gap: 24px; padding: 34px 20px; }
  .footer-links { align-items: flex-start; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
