/* ODJ Lower Deck — Rocket Race
   Shared space theme + artwork. Works on any modern browser. */

:root {
  --remote: #22d3ee;   /* cyan */
  --remote-2: #0891b2;
  --onsite: #f59e0b;   /* amber */
  --onsite-2: #d97706;
  --ink: #e8ecff;
  --muted: #97a0c9;
  --panel: rgba(18, 22, 48, 0.72);
  --panel-solid: #12162f;
  --good: #4ade80;
  --bad: #fb7185;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #05060f;
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body {
  min-height: 100%;
  position: relative;
  overflow-x: hidden;
}

/* ---------- Cosmic background ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(1200px 700px at 80% -10%, rgba(96, 84, 220, 0.35), transparent 60%),
    radial-gradient(1000px 800px at 10% 110%, rgba(20, 120, 160, 0.25), transparent 60%),
    linear-gradient(180deg, #070a1f 0%, #0a0a24 45%, #04040c 100%);
  overflow: hidden;
}
.stars, .stars2, .stars3 {
  position: absolute;
  inset: -50%;
  background-repeat: repeat;
  animation: drift 120s linear infinite;
}
.stars  { background-image: radial-gradient(1px 1px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 120px 80px, #cfe, transparent), radial-gradient(1px 1px at 200px 160px, #fff, transparent); background-size: 260px 260px; opacity: .7; }
.stars2 { background-image: radial-gradient(2px 2px at 60px 120px, #fff, transparent), radial-gradient(1.5px 1.5px at 180px 40px, #ad9, transparent); background-size: 340px 340px; opacity: .5; animation-duration: 200s; }
.stars3 { background-image: radial-gradient(1px 1px at 90px 200px, #fff, transparent), radial-gradient(1px 1px at 240px 100px, #bcf, transparent); background-size: 420px 420px; opacity: .35; animation-duration: 300s; }
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(120px); } }

.content { position: relative; z-index: 2; }

/* ---------- Generic bits ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 20px; }
.brand {
  text-align: center;
  letter-spacing: .04em;
}
.brand .kicker { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .35em; }
.brand h1 {
  margin: 6px 0 2px;
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 800;
  background: linear-gradient(90deg, var(--remote), #a78bfa, var(--onsite));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(120,120,255,.25);
}
.brand .sub { color: var(--muted); font-size: 15px; }

.btn {
  border: none; cursor: pointer; font-weight: 700;
  border-radius: 14px; padding: 14px 22px; font-size: 16px;
  color: #071018; background: linear-gradient(180deg, #ffffff, #cfe0ff);
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
  transition: transform .06s ease, box-shadow .2s ease, filter .2s ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.btn:active { transform: translateY(2px) scale(.99); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid rgba(255,255,255,.22); }
.btn.remote { background: linear-gradient(180deg, var(--remote), var(--remote-2)); color: #04141a; }
.btn.onsite { background: linear-gradient(180deg, var(--onsite), var(--onsite-2)); color: #1a1002; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.panel {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  backdrop-filter: blur(6px);
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; font-weight: 700; font-size: 13px;
  border: 1px solid rgba(255,255,255,.15);
}
.pill.remote { color: var(--remote); box-shadow: inset 0 0 0 1px rgba(34,211,238,.3); }
.pill.onsite { color: var(--onsite); box-shadow: inset 0 0 0 1px rgba(245,158,11,.3); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 10px currentColor; }

/* ---------- Race scene ---------- */
.scene {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, #0b0c28 0%, #0a1030 40%, #0b1a3a 100%);
  border: 1px solid rgba(255,255,255,.08);
}

/* The moon at the top */
.moon {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 120px; border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #f4f6ff 0%, #cdd3ee 45%, #9aa2c8 80%, #7c85ad 100%);
  box-shadow: 0 0 60px rgba(180,200,255,.55), inset -14px -12px 30px rgba(0,0,0,.35);
  z-index: 2;
}
.moon::before, .moon::after {
  content: ""; position: absolute; border-radius: 50%;
  background: rgba(0,0,0,.10); box-shadow: inset 3px 3px 6px rgba(0,0,0,.25);
}
.moon::before { width: 22px; height: 22px; top: 26px; left: 24px; }
.moon::after  { width: 14px; height: 14px; top: 62px; left: 70px; }
.moon-label {
  position: absolute; top: 138px; left: 50%; transform: translateX(-50%);
  z-index: 3; text-align: center; white-space: nowrap;
  font-weight: 800; letter-spacing: .12em; font-size: 13px; color: #dfe6ff;
  text-shadow: 0 0 12px rgba(180,200,255,.6);
}
.moon-flag { display:block; font-size: 11px; color: var(--muted); letter-spacing:.25em; }

/* Earth glow at bottom */
.earth {
  position: absolute; bottom: -140px; left: 50%; transform: translateX(-50%);
  width: 700px; height: 260px; border-radius: 50% 50% 0 0;
  background: radial-gradient(120px 90px at 30% 20%, #37b6ff, transparent 70%),
              radial-gradient(140px 100px at 70% 30%, #2ee6a6, transparent 70%),
              linear-gradient(180deg, #1d6bd6, #0b3b86);
  box-shadow: 0 -10px 90px rgba(60,150,255,.5);
  z-index: 1;
}

/* Rocket lanes */
.lanes { position: relative; display: flex; z-index: 3; height: 100%; }
.lane { position: relative; flex: 1; }
.lane .track {
  position: absolute; top: 172px; bottom: 40px; left: 50%; transform: translateX(-50%);
  width: 2px; background: repeating-linear-gradient(180deg, rgba(255,255,255,.25) 0 8px, transparent 8px 18px);
}
.rocket {
  position: absolute; left: 50%; bottom: 40px;
  transform: translate(-50%, 0);
  width: 64px; height: 96px;
  transition: bottom .25s cubic-bezier(.22,.61,.36,1);
  z-index: 4;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.5));
}
.rocket.boost { animation: shake .18s ease; }
@keyframes shake { 0%,100%{ margin-left:0 } 25%{ margin-left:-2px } 75%{ margin-left:2px } }

.flame {
  position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  width: 22px; height: 34px;
  background: radial-gradient(circle at 50% 20%, #fff 0%, #ffd166 30%, #ff7b00 60%, transparent 75%);
  border-radius: 50% 50% 50% 50%;
  filter: blur(1px);
  animation: flicker .12s infinite alternate;
  opacity: .95;
}
@keyframes flicker { from { transform: translateX(-50%) scaleY(.8); opacity:.7 } to { transform: translateX(-50%) scaleY(1.25); opacity:1 } }
.rocket.idle .flame { display: none; }

.lane-head {
  position: absolute; top: 172px; left: 50%; transform: translateX(-50%);
  text-align: center; z-index: 4;
}
.lane-score { font-size: clamp(24px, 4vw, 40px); font-weight: 900; }
.lane .lane-score.remote { color: var(--remote); text-shadow: 0 0 24px rgba(34,211,238,.6); }
.lane .lane-score.onsite { color: var(--onsite); text-shadow: 0 0 24px rgba(245,158,11,.6); }
.lane-meta { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* progress bars */
.bar { height: 12px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; transition: width .25s ease; }
.bar.remote > span { background: linear-gradient(90deg, var(--remote), #67e8f9); }
.bar.onsite > span { background: linear-gradient(90deg, var(--onsite), #fcd34d); }

/* timer */
.timer {
  font-variant-numeric: tabular-nums; font-weight: 900;
  font-size: clamp(28px, 6vw, 56px); letter-spacing: .04em;
}
.timer.low { color: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* winner overlay */
.overlay {
  position: fixed; inset: 0; z-index: 40; display: none;
  align-items: center; justify-content: center; text-align: center;
  background: radial-gradient(circle at 50% 40%, rgba(10,12,40,.75), rgba(2,3,10,.92));
  backdrop-filter: blur(4px);
}
.overlay.show { display: flex; }
.overlay h2 { font-size: clamp(32px, 8vw, 84px); margin: 0; font-weight: 900; }
.overlay .who { font-size: clamp(28px, 10vw, 96px); }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 39; overflow: hidden; }
.confetti i {
  position: absolute; top: -20px; width: 10px; height: 14px; opacity: .9;
  animation: fall linear forwards;
}
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--muted); }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; justify-content: center; }
