:root {
  color-scheme: dark;
  --ink: #fffaf0;
  --muted: #b6bfd7;
  --panel: rgba(13, 17, 32, 0.82);
  --panel-strong: rgba(13, 17, 32, 0.94);
  --line: rgba(255, 250, 240, 0.18);
  --gold: #ffcf33;
  --pink: #ec5aa6;
  --cyan: #3ec7d3;
  --red: #f04e37;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 15%, rgba(236, 90, 166, 0.32), transparent 28rem),
    radial-gradient(circle at 82% 22%, rgba(62, 199, 211, 0.28), transparent 30rem),
    linear-gradient(145deg, #080913 0%, #11151c 48%, #1e1224 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.show-shell {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

.show-shell::before {
  position: fixed;
  inset: -20vh -10vw;
  z-index: -2;
  content: "";
  background:
    linear-gradient(80deg, transparent 0 42%, rgba(255, 207, 51, 0.26) 47%, transparent 55%),
    linear-gradient(102deg, transparent 0 48%, rgba(62, 199, 211, 0.18) 52%, transparent 59%);
  filter: blur(2px);
  opacity: 0.8;
  transform-origin: center top;
  animation: sweep 8s ease-in-out infinite alternate;
}

.show-shell::after {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
}

.screen {
  display: grid;
  min-height: 100vh;
  padding: clamp(1.2rem, 3vw, 3.2rem);
  grid-template-rows: auto 1fr;
  gap: clamp(1rem, 2.2vw, 2rem);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 3rem;
  height: 3rem;
  place-items: center;
  border: 2px solid var(--gold);
  background: #11151c;
  color: var(--gold);
  box-shadow: 0 0 24px rgba(255, 207, 51, 0.35);
}

.pill {
  border: 1px solid var(--line);
  padding: 0.55rem 0.8rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.stage,
.ready-stage,
.welcome-stage {
  display: grid;
  align-items: center;
  min-height: 0;
}

.ready-stage,
.welcome-stage {
  justify-items: center;
  text-align: center;
  gap: clamp(1.5rem, 4vw, 3rem);
}

.welcome-stage {
  min-height: 70vh;
}

.ready-stage h1,
.welcome-stage h1,
.intro-copy h1,
.elimination h1 {
  margin: 0;
  font-size: clamp(3.3rem, 9vw, 9.2rem);
  line-height: 0.9;
  text-transform: uppercase;
}

.ready-stage p,
.welcome-stage p,
.intro-copy p,
.elimination-text {
  max-width: 62rem;
  margin: 1.4rem auto 0;
  color: var(--muted);
  font-size: clamp(1.35rem, 2.5vw, 2.6rem);
  line-height: 1.22;
}

.game-number {
  color: var(--gold);
  font-size: clamp(1.3rem, 2vw, 2rem);
  font-weight: 900;
  text-transform: uppercase;
}

.intro {
  grid-template-columns: minmax(0, 1.1fr) minmax(22rem, 0.9fr);
  gap: clamp(1.4rem, 3vw, 3rem);
}

.movie-frame {
  position: relative;
  min-height: 28rem;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #101520;
  box-shadow: var(--shadow);
}

.movie-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.marquee {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(90deg, rgba(255, 207, 51, 0.18) 0 12px, transparent 12px 34px),
    radial-gradient(circle at center, rgba(236, 90, 166, 0.5), transparent 34%),
    linear-gradient(160deg, #12182a, #151019);
}

.marquee span {
  border: 2px solid rgba(255, 250, 240, 0.4);
  padding: clamp(1rem, 2vw, 1.8rem);
  background: rgba(8, 9, 19, 0.8);
  color: var(--gold);
  font-size: clamp(2rem, 5vw, 5rem);
  font-weight: 1000;
  text-transform: uppercase;
  text-align: center;
  box-shadow: 0 0 44px rgba(255, 207, 51, 0.28);
}

.description {
  align-content: center;
  max-width: 86rem;
}

.description h1 {
  margin: 0 0 1.4rem;
  color: var(--gold);
  font-size: clamp(2rem, 5vw, 5.5rem);
  text-transform: uppercase;
}

.rules {
  border-left: 0.7rem solid var(--cyan);
  padding: clamp(1.4rem, 3vw, 3rem);
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: clamp(1.55rem, 2.8vw, 3rem);
  line-height: 1.28;
}

.elimination {
  align-content: center;
  max-width: 86rem;
}

.grid-screen {
  align-content: stretch;
}

.contestant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: clamp(0.75rem, 1.5vw, 1.4rem);
  align-content: center;
}

.contestant {
  position: relative;
  display: grid;
  min-height: 10rem;
  place-items: center;
  border: 1px solid var(--line);
  padding: 1rem;
  background: rgba(255, 255, 255, 0.08);
  transition: transform 260ms ease, border-color 260ms ease, opacity 260ms ease;
}

.contestant.featured {
  grid-column: span 2;
  grid-row: span 2;
  border-color: var(--red);
  background: rgba(240, 78, 55, 0.18);
  transform: scale(1.03);
}

.contestant.eliminated {
  opacity: 0.48;
  filter: grayscale(0.8);
}

.contestant.eliminated::after,
.contestant.featured::after {
  position: absolute;
  inset: 18%;
  content: "";
  border-top: 0.42rem solid var(--red);
  transform: rotate(-17deg);
}

.contestant-name {
  text-align: center;
  color: var(--gold);
  font-size: clamp(1.35rem, 2.5vw, 3rem);
  font-weight: 1000;
  text-transform: uppercase;
}

.error {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 2rem;
  color: var(--ink);
}

.error div {
  max-width: 44rem;
  border: 1px solid var(--line);
  padding: 2rem;
  background: var(--panel-strong);
}

.icon-button,
.arrow-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.09);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  text-transform: uppercase;
}

.icon-button {
  min-height: 2.45rem;
  padding: 0 0.9rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.step-nav {
  position: fixed;
  right: clamp(1.2rem, 3vw, 3.2rem);
  bottom: clamp(1.2rem, 3vw, 3.2rem);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.arrow-button {
  width: 4rem;
  height: 4rem;
  font-size: 2.4rem;
}

.arrow-button:disabled {
  cursor: default;
  opacity: 0.35;
}

.step-count {
  min-width: 5.5rem;
  border: 1px solid var(--line);
  padding: 0.75rem 1rem;
  background: var(--panel-strong);
  color: var(--muted);
  text-align: center;
  font-weight: 900;
}

.icon-button:hover,
.icon-button:focus-visible,
.arrow-button:hover:not(:disabled),
.arrow-button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

@keyframes sweep {
  from {
    transform: rotate(-5deg) translateX(-4vw);
  }

  to {
    transform: rotate(7deg) translateX(4vw);
  }
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .screen {
    min-height: 100svh;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions {
    flex-wrap: wrap;
  }

  .intro {
    grid-template-columns: 1fr;
  }

  .movie-frame {
    min-height: 16rem;
  }

  .contestant.featured {
    grid-column: span 1;
    grid-row: span 1;
  }

  .step-nav {
    position: static;
    justify-content: center;
  }
}
