:root {
  --ink: #f7fbff;
  --muted: #a9b5c8;
  --stage: #090711;
  --stage-deep: #03020a;
  --panel: rgba(12, 15, 31, 0.76);
  --pink: #ff3fd7;
  --cyan: #21e7ff;
  --gold: #ffd166;
  --green: #41ff9f;
  --red: #ff5068;
  --blue: #5b7cff;
  --violet: #9d5cff;
  --orange: #ff9f1c;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 63, 215, 0.22), transparent 30%),
    radial-gradient(circle at 82% 15%, rgba(33, 231, 255, 0.2), transparent 26%),
    radial-gradient(circle at 50% 95%, rgba(255, 209, 102, 0.15), transparent 35%),
    linear-gradient(140deg, var(--stage-deep), var(--stage) 55%, #110617);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -3;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(circle at center, black, transparent 76%);
}

body::after {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 5px
    );
  mix-blend-mode: screen;
  opacity: 0.22;
}

.stage-shell {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(18px, 2.2vw, 34px);
  isolation: isolate;
}

.hero-header {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto clamp(16px, 2vh, 28px);
  text-align: center;
}

.kicker {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.kicker {
  font-size: clamp(0.7rem, 1vw, 0.95rem);
}

h1 {
  margin: 8px 0 10px;
  font-family: Bungee, Inter, sans-serif;
  font-size: clamp(2.6rem, 6.5vw, 6.6rem);
  line-height: 0.95;
  text-shadow:
    0 0 12px rgba(255, 63, 215, 0.9),
    0 0 32px rgba(33, 231, 255, 0.48),
    6px 6px 0 rgba(0, 0, 0, 0.62);
}

.hub-layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(260px, 0.72fr) minmax(510px, 1.35fr);
  align-items: center;
  gap: clamp(18px, 2.2vw, 34px);
  max-width: 1180px;
  margin: 0 auto;
}

.scoreboard {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.1), transparent 36%),
    var(--panel);
  box-shadow:
    0 0 36px rgba(33, 231, 255, 0.16),
    inset 0 0 28px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(18px);
}

.scoreboard {
  padding: clamp(16px, 1.7vw, 24px);
}

.scoreboard-glow {
  position: absolute;
  inset: -45% -20% auto;
  height: 130px;
  background: linear-gradient(90deg, transparent, rgba(255, 63, 215, 0.62), transparent);
  transform: rotate(-11deg);
  animation: sweep 4.8s linear infinite;
}

.scoreboard-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.on-air {
  display: inline-flex;
  width: fit-content;
  border: 1px solid rgba(255, 80, 104, 0.75);
  border-radius: 999px;
  padding: 6px 9px;
  color: #fff4f6;
  font-size: 0.72rem;
  font-weight: 900;
  background: rgba(255, 80, 104, 0.22);
  box-shadow: 0 0 18px rgba(255, 80, 104, 0.28);
}

.scoreboard h2 {
  margin: 0;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 12px 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.team-label,
.team-note {
  margin: 0;
}

.team-label {
  font-size: clamp(1rem, 1.3vw, 1.22rem);
  font-weight: 900;
}

.team-note {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.score-row strong {
  color: var(--gold);
  font-family: Bungee, Inter, sans-serif;
  font-size: clamp(2rem, 3.4vw, 3.6rem);
  line-height: 1;
  text-shadow: 0 0 18px rgba(255, 209, 102, 0.5);
}

.leader-card {
  margin-top: 16px;
  border-radius: 8px;
  padding: 15px;
  background: linear-gradient(135deg, rgba(33, 231, 255, 0.18), rgba(255, 63, 215, 0.2));
}

.leader-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.leader-card strong {
  display: block;
  margin-top: 5px;
  font-size: clamp(1.2rem, 1.8vw, 1.75rem);
}

.game-wheel {
  --wheel-size: min(68vh, 690px);
  position: relative;
  width: var(--wheel-size);
  height: var(--wheel-size);
  min-width: 510px;
  min-height: 510px;
  margin: 0 auto;
  border-radius: 50%;
  filter: drop-shadow(0 0 34px rgba(33, 231, 255, 0.24));
}

.wheel-rim {
  position: absolute;
  inset: -18px;
  border: 5px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background:
    conic-gradient(
      from -90deg,
      var(--pink),
      var(--cyan),
      var(--gold),
      var(--green),
      var(--blue),
      var(--orange),
      var(--violet),
      var(--pink)
    );
  box-shadow:
    0 0 28px rgba(255, 63, 215, 0.7),
    0 0 58px rgba(33, 231, 255, 0.34),
    inset 0 0 28px rgba(255, 255, 255, 0.15);
  animation: rim-spin 16s linear infinite;
}

.wheel-rim::after {
  position: absolute;
  inset: 16px;
  content: "";
  border-radius: 50%;
  background: rgba(3, 2, 10, 0.9);
}

.wheel-segment {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 31%;
  height: 31%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  transform:
    translate(-50%, -50%)
    rotate(var(--angle))
    translateY(calc(var(--wheel-size) * -0.31))
    rotate(calc(var(--angle) * -1));
  transform-origin: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent 42%),
    linear-gradient(135deg, var(--segment-a), var(--segment-b));
  box-shadow:
    0 0 18px rgba(255, 255, 255, 0.09),
    inset 0 0 18px rgba(255, 255, 255, 0.08);
  transition:
    filter 180ms ease,
    box-shadow 180ms ease,
    scale 180ms ease,
    translate 180ms ease;
}

.wheel-segment::before {
  position: absolute;
  inset: 7px;
  content: "";
  border: 1px dashed rgba(255, 255, 255, 0.23);
  border-radius: 6px;
}

.wheel-segment:hover,
.wheel-segment:focus-visible {
  z-index: 4;
  outline: none;
  scale: 1.1;
  filter: saturate(1.35) brightness(1.16);
  box-shadow:
    0 0 26px var(--segment-a),
    0 0 54px rgba(255, 255, 255, 0.2),
    inset 0 0 24px rgba(255, 255, 255, 0.18);
}

.segment-icon {
  position: relative;
  z-index: 1;
  display: block;
  font-family: Bungee, Inter, sans-serif;
  font-size: clamp(1.25rem, 3vw, 2.4rem);
  line-height: 1;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.7);
}

.segment-name {
  position: relative;
  z-index: 1;
  max-width: 92%;
  font-size: clamp(0.72rem, 1.05vw, 1rem);
  font-weight: 900;
  line-height: 1.05;
  text-transform: uppercase;
}

.segment-jeopardy {
  --angle: 0deg;
  --segment-a: #3b66ff;
  --segment-b: #2012a8;
}

.segment-feud {
  --angle: 60deg;
  --segment-a: #ffd166;
  --segment-b: #ff7f11;
}

.segment-pointless {
  --angle: 120deg;
  --segment-a: #41ff9f;
  --segment-b: #087f5b;
}

.segment-score {
  --angle: 180deg;
  --segment-a: #ff5068;
  --segment-b: #a4133c;
}

.segment-scatter {
  --angle: 240deg;
  --segment-a: #ff3fd7;
  --segment-b: #7a1cac;
}

.segment-connections {
  --angle: 300deg;
  --segment-a: #a4ff3f;
  --segment-b: #5b7cff;
}

.wheel-centre {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 24%;
  aspect-ratio: 1;
  border: 4px solid rgba(255, 255, 255, 0.68);
  border-radius: 50%;
  padding: 14px;
  text-align: center;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.34), transparent 22%),
    linear-gradient(145deg, #121a35, #05030c);
  box-shadow:
    0 0 28px rgba(255, 209, 102, 0.45),
    inset 0 0 30px rgba(33, 231, 255, 0.22);
}

.centre-small,
.centre-big {
  display: block;
  text-transform: uppercase;
}

.centre-small {
  color: var(--muted);
  font-size: clamp(0.52rem, 0.72vw, 0.72rem);
  font-weight: 900;
}

.centre-big {
  font-family: Bungee, Inter, sans-serif;
  font-size: clamp(0.95rem, 1.75vw, 1.8rem);
  line-height: 0.9;
  text-shadow: 0 0 14px rgba(255, 63, 215, 0.8);
}

.connection-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.connection-modal.is-open {
  pointer-events: auto;
  opacity: 1;
}

.connection-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(33, 231, 255, 0.2), transparent 34%),
    rgba(3, 2, 10, 0.78);
  backdrop-filter: blur(8px);
}

.connection-dialog {
  position: relative;
  width: min(560px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  padding: clamp(22px, 3vw, 34px);
  background:
    linear-gradient(135deg, rgba(255, 63, 215, 0.2), transparent 38%),
    linear-gradient(225deg, rgba(33, 231, 255, 0.18), transparent 42%),
    rgba(10, 12, 28, 0.96);
  box-shadow:
    0 0 42px rgba(255, 63, 215, 0.34),
    0 0 72px rgba(33, 231, 255, 0.18),
    inset 0 0 30px rgba(255, 255, 255, 0.06);
  transform: translateY(14px) scale(0.97);
  transition: transform 180ms ease;
}

.connection-modal.is-open .connection-dialog {
  transform: translateY(0) scale(1);
}

.connection-close {
  position: absolute;
  right: 14px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 38px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 900;
  line-height: 1;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.connection-close:hover,
.connection-close:focus-visible {
  outline: none;
  box-shadow: 0 0 22px rgba(255, 63, 215, 0.5);
}

.connection-kicker,
.connection-dialog h2 {
  margin: 0;
  text-align: center;
}

.connection-kicker {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.connection-dialog h2 {
  margin-top: 5px;
  font-family: Bungee, Inter, sans-serif;
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 0.95;
  text-shadow:
    0 0 18px rgba(164, 255, 63, 0.48),
    0 0 26px rgba(91, 124, 255, 0.42);
}

.connection-options {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.connection-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 16px 18px;
  color: var(--ink);
  text-decoration: none;
  background:
    linear-gradient(90deg, rgba(164, 255, 63, 0.18), transparent 42%),
    rgba(255, 255, 255, 0.07);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.connection-option:hover,
.connection-option:focus-visible {
  outline: none;
  transform: translateX(6px);
  border-color: rgba(164, 255, 63, 0.72);
  box-shadow:
    0 0 24px rgba(164, 255, 63, 0.24),
    inset 0 0 18px rgba(255, 255, 255, 0.06);
}

.connection-option span {
  font-size: clamp(1rem, 1.8vw, 1.28rem);
  font-weight: 900;
  text-transform: uppercase;
}

.connection-option strong {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  white-space: nowrap;
}

.light-beam {
  position: fixed;
  top: -20vh;
  z-index: -1;
  width: 17vw;
  height: 125vh;
  transform-origin: top center;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.16), transparent 64%);
  filter: blur(6px);
  opacity: 0.36;
  animation: beam-swing 7s ease-in-out infinite alternate;
}

.light-beam-a {
  left: 12vw;
  transform: rotate(22deg);
}

.light-beam-b {
  left: 48vw;
  animation-delay: -2s;
  transform: rotate(-10deg);
}

.light-beam-c {
  right: 7vw;
  animation-delay: -4s;
  transform: rotate(-24deg);
}

.background-props span {
  position: fixed;
  z-index: -1;
  user-select: none;
}

.prop-token {
  display: grid;
  place-items: center;
  width: 54px;
  aspect-ratio: 1;
  border-radius: 50%;
  color: #171006;
  font-family: Bungee, Inter, sans-serif;
  background: var(--gold);
  box-shadow: 0 0 24px rgba(255, 209, 102, 0.45);
  animation: floaty 6.8s ease-in-out infinite;
}

.token-one {
  left: 4vw;
  top: 42vh;
}

.token-two {
  right: 11vw;
  top: 20vh;
  animation-delay: -2.5s;
}

.prop-card {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  padding: 10px 13px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 22px rgba(33, 231, 255, 0.17);
  animation: floaty 7.5s ease-in-out infinite;
}

.card-one {
  left: 11vw;
  bottom: 12vh;
  transform: rotate(-10deg);
}

.card-two {
  right: 5vw;
  bottom: 24vh;
  animation-delay: -3s;
  transform: rotate(12deg);
}

.prop-node {
  width: 15px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow:
    0 0 16px var(--cyan),
    44px 28px 0 rgba(255, 63, 215, 0.85),
    88px -6px 0 rgba(65, 255, 159, 0.85);
}

.node-one {
  left: 18vw;
  top: 22vh;
}

.node-two {
  right: 18vw;
  bottom: 13vh;
  transform: rotate(32deg);
}

@keyframes rim-spin {
  to {
    rotate: 360deg;
  }
}

@keyframes idle-wobble {
  50% {
    filter: brightness(1.14);
  }
}

@keyframes sweep {
  from {
    translate: -90% 0;
  }
  to {
    translate: 120% 0;
  }
}

@keyframes beam-swing {
  to {
    transform: rotate(18deg);
  }
}

@keyframes floaty {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -18px;
  }
}

@media (max-width: 1050px) {
  .hub-layout {
    grid-template-columns: 1fr;
  }

  .game-wheel {
    --wheel-size: min(78vw, 620px);
    min-width: min(78vw, 620px);
    min-height: min(78vw, 620px);
    order: -1;
  }

  .scoreboard {
    width: min(680px, 100%);
    margin: 0 auto;
  }
}

@media (min-width: 1051px) and (max-height: 820px) {
  .stage-shell {
    padding: 14px 28px;
  }

  .hero-header {
    margin-bottom: 8px;
  }

  h1 {
    margin: 5px 0 7px;
    font-size: clamp(3.2rem, 5.2vw, 4.8rem);
  }

  .kicker {
    font-size: 0.74rem;
  }

  .hub-layout {
    grid-template-columns: minmax(280px, 0.68fr) minmax(430px, 1.16fr);
    gap: 22px;
  }

  .game-wheel {
    --wheel-size: min(59vh, 520px);
    min-width: 430px;
    min-height: 430px;
  }

  .wheel-rim {
    inset: -14px;
  }

  .scoreboard {
    padding: 18px;
  }

  .score-row {
    margin: 9px 0;
    padding: 12px;
  }

  .leader-card {
    margin-top: 10px;
    padding: 12px;
  }
}

@media (max-width: 620px) {
  .stage-shell {
    padding: 16px;
  }

  .game-wheel {
    --wheel-size: min(88vw, 460px);
    min-width: min(88vw, 460px);
    min-height: min(88vw, 460px);
  }

  .wheel-segment {
    width: 34%;
    height: 34%;
  }

  .segment-icon {
    font-size: 1.05rem;
  }

  .segment-name {
    font-size: 0.62rem;
  }

  .wheel-centre {
    width: 28%;
    border-width: 3px;
  }
}

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