:root {
  --redline-bg: #080b11;
  --redline-panel: rgba(14, 19, 27, .88);
  --redline-line: rgba(255, 255, 255, .12);
  --redline-accent: #e5ff54;
  --redline-hot: #ff4b38;
}

html { scroll-padding-top: 78px; }
body { background: var(--redline-bg); }

body.start-mode #startPage {
  background:
    radial-gradient(ellipse at 66% 25%, rgba(80, 89, 47, .16), transparent 42rem),
    linear-gradient(180deg, #080b11, #0b0f16 56%, #080b11);
}

body.start-mode .top {
  position: sticky;
  top: 0;
  inset: auto;
  height: 76px;
  padding: 0 clamp(18px, 5vw, 76px);
  justify-content: space-between;
  gap: 24px;
  background: rgba(8, 11, 17, .9);
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

body.start-mode .top::before { display: none; }
body.start-mode #logo, body.start-mode #logo-link { display: none !important; }
body.start-mode .top > .nav { order: 2; margin-left: auto; }
body.start-mode .top .nav { display: flex; gap: clamp(18px, 3vw, 42px); }
body.start-mode .top .nav a {
  color: #c1c7d0;
  font: 600 12px/1 Arial, sans-serif;
  letter-spacing: .16em;
  transition: color .18s ease;
}
body.start-mode .top .nav a:hover { color: var(--redline-accent); }
body.start-mode .top .btn-play {
  order: 3;
  padding: 13px 18px;
  border-radius: 3px;
  background: var(--redline-accent);
  box-shadow: none;
  color: #10140a;
  font: 800 11px/1 Arial, sans-serif;
  letter-spacing: .12em;
  transform: none;
}
body.start-mode .top .btn-play span { transform: none; }
body.start-mode .top .btn-play:hover { filter: brightness(1.06); box-shadow: 0 0 28px #e5ff5440; }
body.start-mode .top::after {
  content: "REDLINE / NIGHT SHIFT";
  order: 1;
  color: #f4f5ef;
  font: 800 13px/1 Arial, sans-serif;
  letter-spacing: .19em;
}

body.start-mode #ride { height: 170vh; }
body.start-mode .stage {
  height: calc(100svh - 76px);
  top: 76px;
  min-height: 500px;
  background: linear-gradient(115deg, rgba(8,11,17,.56), transparent 64%);
}
body.start-mode .stage::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  height: 34%;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(8,11,17,.82), transparent);
}
body.start-mode #scene { filter: saturate(.78) contrast(1.08); }
body.start-mode #rider { z-index: 1; filter: drop-shadow(0 22px 44px rgba(0,0,0,.5)) drop-shadow(0 0 26px rgba(229,255,84,.12)); }
body.start-mode .caption { z-index: 3; top: 10vh; font-size: clamp(24px, 4vw, 46px); }
body.start-mode .caption small { color: var(--redline-accent); }
body.start-mode .hero-copy {
  position: absolute;
  z-index: 4;
  top: clamp(76px, 15vh, 150px);
  left: clamp(22px, 7vw, 104px);
  width: min(39vw, 460px);
  pointer-events: none;
}
body.start-mode .hero-copy > * { pointer-events: auto; }
body.start-mode .hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 24px;
  color: var(--redline-accent);
  font: 700 11px/1 Arial, sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
}
body.start-mode .hero-kicker::before { content: ""; width: 28px; height: 1px; background: currentColor; }
body.start-mode .hero-copy h1 {
  max-width: 9ch;
  margin: 0;
  color: #f4f5ef;
  font: 900 clamp(42px, 6.4vw, 88px)/.87 Arial, sans-serif;
  letter-spacing: -.075em;
  text-transform: uppercase;
}
body.start-mode .hero-copy h1 em { color: var(--redline-accent); font-style: normal; }
body.start-mode .hero-copy p {
  max-width: 32ch;
  margin: 24px 0 26px;
  color: #b6bec8;
  font: 500 clamp(15px, 1.45vw, 18px)/1.5 Arial, sans-serif;
}
body.start-mode .hero-actions { display: flex; align-items: center; gap: 20px; }
body.start-mode .hero-actions .btn-play {
  padding: 16px 20px;
  border-radius: 3px;
  color: #10140a;
  background: var(--redline-accent);
  box-shadow: 0 8px 24px rgba(229,255,84,.12);
  font: 800 11px/1 Arial, sans-serif;
  letter-spacing: .13em;
  transform: none;
}
body.start-mode .hero-actions .btn-play span { transform: none; }
body.start-mode .hero-link {
  color: #e2e5e7;
  font: 700 10px/1 Arial, sans-serif;
  letter-spacing: .15em;
  text-decoration: none;
}
body.start-mode .hero-link:hover { color: var(--redline-accent); }
body.start-mode .hero-index {
  position: absolute;
  z-index: 4;
  right: clamp(20px, 5vw, 72px);
  bottom: 13vh;
  color: #e5ff54;
  font: 700 10px/1.5 Arial, sans-serif;
  letter-spacing: .16em;
  writing-mode: vertical-rl;
}
body.start-mode .hint {
  z-index: 4;
  bottom: 25px;
  left: auto;
  right: clamp(20px, 5vw, 72px);
  transform: none;
  color: #d0d4db;
  font: 700 9px/1 Arial, sans-serif;
  letter-spacing: .18em;
}
body.start-mode .hint .mouse { display: none; }
body.start-mode .hint::after { content: " ↓"; color: var(--redline-accent); font-size: 14px; }
body.start-mode .post { z-index: 4; }
body.start-mode .sign { font-size: 13px; border-width: 1px; border-radius: 2px; }
body.start-mode .sign.go { font-size: 15px; }

body.start-mode section.page {
  padding: clamp(76px, 10vw, 132px) clamp(20px, 6vw, 90px);
  background: transparent;
}
body.start-mode .wrap { max-width: 1280px; }
body.start-mode .kicker {
  color: var(--redline-accent);
  font: 700 10px/1.3 Arial, sans-serif;
  letter-spacing: .22em;
  text-transform: uppercase;
  transform: none;
}
body.start-mode h2 {
  margin: 0 0 18px;
  color: #f4f5ef;
  font: 900 clamp(34px, 5.4vw, 68px)/.94 Arial, sans-serif;
  letter-spacing: -.065em;
  transform: none;
}
body.start-mode .grad {
  background: none;
  color: inherit;
  filter: none;
}
body.start-mode .lead {
  max-width: 54ch;
  color: #9ca6b2;
  font: 400 clamp(16px, 1.5vw, 19px)/1.55 Arial, sans-serif;
}
body.start-mode #bikes .wrap > br,
body.start-mode #how .wrap > br,
body.start-mode #play > br { display: none; }
body.start-mode .bikes { gap: 14px; }
body.start-mode .bike {
  padding: 18px;
  background: linear-gradient(145deg, rgba(24,31,41,.95), rgba(12,16,22,.95));
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 4px;
}
body.start-mode .bike:hover { border-color: #e5ff5470; }
body.start-mode .bike::before { background: radial-gradient(closest-side,rgba(229,255,84,.18),transparent); }
body.start-mode .bike h3 { font: 800 16px/1.2 Arial,sans-serif; letter-spacing: .03em; }
body.start-mode .bike .ride { color: var(--redline-accent); font: 700 10px/1 Arial,sans-serif; letter-spacing: .15em; }
body.start-mode .bike .type,
body.start-mode .stat { font-family: Arial,sans-serif; }
body.start-mode .bars i.on { background: var(--redline-accent); }

body.start-mode #globalLeaderboard {
  padding: clamp(72px, 9vw, 112px) clamp(20px, 6vw, 90px);
  color: #eff1ec;
  background: #10151d;
  border-block: 1px solid rgba(255,255,255,.07);
  font-family: Arial,sans-serif;
}
body.start-mode #globalLeaderboard .leaderboardWrap { max-width: 1280px; }
body.start-mode #globalLeaderboard .leaderboardWrap > p:first-child {
  color: var(--redline-accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .2em;
}
body.start-mode #globalLeaderboard h2 { color: #f4f5ef; font: 900 clamp(34px,5.4vw,68px)/.94 Arial,sans-serif; letter-spacing: -.065em; }
body.start-mode #globalLeaderboard .leaderboardWrap > p:nth-of-type(2) { color: #9ca6b2; font-size: 15px; }
body.start-mode #globalLeaderboard table { margin-top: 30px; }
body.start-mode #globalLeaderboard th { color: #8e9aa7; font-size: 9px; letter-spacing: .14em; }
body.start-mode #globalLeaderboard td { border-color: rgba(255,255,255,.09); font-size: 14px; }

body.start-mode #how .how { gap: 14px; }
body.start-mode #how .card {
  padding: clamp(20px,3vw,34px);
  background: #111720;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 4px;
}
body.start-mode #how .card h3 { color: var(--redline-accent); font: 700 11px/1 Arial,sans-serif; letter-spacing: .18em; }
body.start-mode #how .key { font-family: Arial,sans-serif; font-size: 14px; }
body.start-mode #how kbd { color: #f4f5ef; background: #0a0e14; border: 1px solid rgba(255,255,255,.14); border-bottom-width: 3px; border-radius: 3px; }
body.start-mode #how .tricks li { font: 600 14px/1.3 Arial,sans-serif; }
body.start-mode #how .tricks li b { color: var(--redline-accent); font-family: Arial,sans-serif; font-weight: 800; }
body.start-mode #how .phone { color: #9ca6b2; font: 14px/1.5 Arial,sans-serif; }
body.start-mode .final {
  padding: clamp(80px,12vw,160px) 20px;
  background: radial-gradient(50% 90% at 50% 100%, #29301a 0, transparent 100%), #0b0f15;
  border-top: 1px solid rgba(255,255,255,.08);
}
body.start-mode .final .btn-play { border-radius: 3px; color: #10140a; background: var(--redline-accent); box-shadow: none; transform: none; }
body.start-mode .final .btn-play span { transform: none; }
body.start-mode footer { padding: 28px 20px; background: #080b11; font: 11px/1.5 Arial,sans-serif; }

#accountMenu:not(.account-required) { top: 90px !important; left: 22px !important; }
#accountMenu:not(.account-required) #accountPanel {
  width: min(320px, calc(100vw - 36px));
  padding: 16px;
  background: rgba(13,18,26,.96);
  border: 1px solid rgba(229,255,84,.28);
  border-radius: 4px;
  box-shadow: 0 18px 55px #000b;
}
#accountMenu:not(.account-required) > summary {
  border: 1px solid rgba(229,255,84,.32);
  border-radius: 3px;
  background: rgba(13,18,26,.94);
}
#accountPanel h2 { letter-spacing: .02em; }
#accountPanel button { border-radius: 3px; }
#accountPanel button[type=submit] { background: var(--redline-accent); color: #10140a; }
#ownerOverlay { background: rgba(4,7,11,.82) !important; backdrop-filter: blur(7px); }
#ownerDialog { background: #111720 !important; border-color: rgba(229,255,84,.34) !important; border-radius: 4px; }
#ownerDialog button { background: var(--redline-accent) !important; color: #11150a !important; }

body.game-mode #gameLayer,
body:not(.start-mode) #gameLayer {
  background:
    radial-gradient(ellipse at 50% 48%, rgba(29,36,47,.45), transparent 58%),
    #080b11;
}
body.game-mode #c,
body:not(.start-mode) #c { filter: drop-shadow(0 16px 38px rgba(0,0,0,.35)); }
body:not(.start-mode) #accountMenu { top: 12px !important; left: 12px !important; }

@media (max-width: 760px) {
  body.start-mode .top { height: 64px; padding-inline: 16px; }
  body.start-mode .top::after { font-size: 10px; letter-spacing: .12em; }
  body.start-mode .top .nav { display: none; }
  body.start-mode .top .btn-play { padding: 12px 13px; font-size: 10px; }
  body.start-mode #ride { height: 145vh; }
  body.start-mode .stage { top: 64px; height: calc(100svh - 64px); min-height: 440px; }
  body.start-mode .hero-copy { top: 12vh; left: 22px; width: min(72vw, 370px); }
  body.start-mode .hero-kicker { margin-bottom: 18px; font-size: 9px; }
  body.start-mode .hero-copy h1 { font-size: clamp(42px, 11vw, 66px); }
  body.start-mode .hero-copy p { max-width: 29ch; margin: 16px 0 19px; font-size: 14px; }
  body.start-mode .hero-actions { gap: 14px; }
  body.start-mode .hero-actions .btn-play { padding: 14px; font-size: 9px; }
  body.start-mode .hero-link { font-size: 9px; }
  body.start-mode .hero-index { right: 16px; bottom: 68px; font-size: 8px; }
  body.start-mode .hint { right: 16px; bottom: 22px; font-size: 8px; }
  body.start-mode .caption { top: 8vh; }
  body.start-mode .post { left: 12px; bottom: 12vh; height: 50vh; }
  body.start-mode section.page { padding: 72px 18px; }
  body.start-mode #globalLeaderboard { padding: 66px 18px; overflow-x: auto; }
  body.start-mode #globalLeaderboard table { min-width: 520px; }
  body.start-mode #accountMenu:not(.account-required) { top: 74px !important; left: 12px !important; }
  #accountMenu.account-required { top: 50% !important; left: 50% !important; }
}

@media (max-width: 430px) {
  body.start-mode .hero-copy { width: calc(100vw - 44px); }
  body.start-mode .hero-copy h1 { max-width: 8ch; }
  body.start-mode .hero-copy p { max-width: 27ch; }
  body.start-mode .hero-index { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  body.start-mode *, #accountMenu *, #ownerOverlay * { scroll-behavior: auto !important; }
}
