:root {
  --bg: #100818;
  --panel: rgba(29, 15, 39, 0.94);
  --panel-light: rgba(58, 25, 69, 0.88);
  --blue: #3268c8;
  --cyan: #8dd8e8;
  --gold: #ffc943;
  --gold-2: #ff9d1c;
  --ruby: #a82f54;
  --emerald: #258471;
  --violet: #7447a8;
  --lead: #170f1b;
  --white: #fff9ec;
  --muted: #c9b9c9;
  --green: #26d980;
  --red: #ff496a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--white);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(118, 72, 132, 0.16), transparent 52%),
    linear-gradient(160deg, #211327 0%, var(--bg) 58%, #09070c 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(4, 3, 7, 0.34) 100%);
}

body::after {
  content: none;
}

button {
  font: inherit;
}

.app {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 26px clamp(18px, 3vw, 48px) 34px;
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 201, 67, 0.75);
  border-radius: 50%;
  color: var(--gold);
  background:
    linear-gradient(135deg, rgba(168, 47, 84, 0.5), rgba(116, 71, 168, 0.5)),
    radial-gradient(circle, rgba(255, 201, 67, 0.16), transparent 68%);
  box-shadow: 0 0 26px rgba(255, 201, 67, 0.16);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 1px solid rgba(168, 178, 219, 0.24);
  border-radius: 50%;
  color: var(--muted);
  background: rgba(32, 16, 40, 0.82);
  transition: 180ms ease;
}

.icon-button:hover {
  color: var(--white);
  border-color: rgba(84, 220, 255, 0.5);
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 245px;
  gap: clamp(20px, 3vw, 42px);
  align-items: stretch;
  min-height: calc(100vh - 130px);
}

.stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
}

.spotlight {
  flex: 1;
  min-height: 320px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border: 5px solid rgba(20, 12, 24, 0.92);
  border-radius: 180px 180px 28px 28px;
  background:
    linear-gradient(60deg, transparent 46%, rgba(15, 8, 18, 0.7) 47% 53%, transparent 54%) 0 0 / 72px 126px,
    linear-gradient(-60deg, transparent 46%, rgba(15, 8, 18, 0.7) 47% 53%, transparent 54%) 0 0 / 72px 126px,
    radial-gradient(circle at center, rgba(244, 199, 98, 0.15), transparent 42%),
    linear-gradient(145deg, rgba(91, 30, 69, 0.88), rgba(26, 18, 61, 0.94));
  box-shadow: var(--shadow), inset 0 0 0 2px rgba(244, 199, 98, 0.28), inset 0 0 90px rgba(0, 0, 0, 0.5);
}

.spotlight::before,
.spotlight::after {
  content: "";
  position: absolute;
  width: 36%;
  height: 145%;
  top: -38%;
  background: linear-gradient(90deg, transparent, rgba(255, 224, 157, 0.13), transparent);
  transform: rotate(18deg);
  animation: stainedSweep 12s ease-in-out infinite alternate;
}

.spotlight::after {
  animation-delay: -6s;
  transform: rotate(-18deg);
}

@keyframes stainedSweep {
  0% { left: -45%; opacity: 0.35; }
  100% { left: 110%; opacity: 0.8; }
}

.logo {
  width: min(320px, 68vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  position: relative;
  border-radius: 50%;
  border: 9px solid var(--lead);
  background:
    radial-gradient(circle at center, rgba(255, 244, 191, 0.92) 0 5%, var(--lead) 5.5% 8%, transparent 8.5%),
    repeating-conic-gradient(from 0deg, var(--ruby) 0 12deg, var(--lead) 12deg 15deg, var(--gold-2) 15deg 27deg, var(--lead) 27deg 30deg, var(--blue) 30deg 42deg, var(--lead) 42deg 45deg, var(--emerald) 45deg 57deg, var(--lead) 57deg 60deg);
  box-shadow: 0 0 0 5px rgba(244, 199, 98, 0.5), 0 0 55px rgba(244, 199, 98, 0.32), inset 0 0 45px rgba(255, 237, 178, 0.32);
  filter: drop-shadow(0 18px 35px rgba(0, 0, 0, 0.45));
  animation: breathe 3.8s ease-in-out infinite;
}

.logo::before,
.logo::after {
  content: "";
  position: absolute;
  inset: 14%;
  border: 8px solid var(--lead);
  border-radius: 50%;
  background: rgba(28, 13, 36, 0.77);
  transform: none;
}

.logo::after {
  inset: 7%;
  border: 3px solid rgba(255, 224, 146, 0.48);
  background: transparent;
}

@keyframes breathe {
  50% { filter: drop-shadow(0 12px 48px rgba(244, 199, 98, 0.32)) brightness(1.08); }
}

.logo-copy {
  position: relative;
  z-index: 2;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 2px 20px #05071a;
}

.logo-copy span {
  display: block;
  color: #f6d989;
  font-size: clamp(0.68rem, 1.5vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 0.34em;
  margin-left: 0.34em;
}

.logo-copy strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5.2vw, 4rem);
  font-weight: 500;
  line-height: 0.92;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #fff7c7, var(--gold) 55%, var(--gold-2));
  -webkit-background-clip: text;
  color: transparent;
}

.intro-copy {
  max-width: 520px;
  padding: 24px;
  position: absolute;
  inset: auto 50% 24px auto;
  transform: translateX(50%);
  text-align: center;
}

.intro-copy p {
  color: var(--muted);
  margin: 0 0 16px;
  line-height: 1.6;
}

.primary-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 28px;
  cursor: pointer;
  color: #171006;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #fff1a8, var(--gold) 48%, var(--gold-2));
  box-shadow: 0 8px 32px rgba(255, 174, 31, 0.3);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 38px rgba(255, 174, 31, 0.42);
}

.primary-button:active {
  transform: translateY(0);
}

.game-area {
  display: none;
  gap: 16px;
  animation: rise 420ms ease both;
}

.game-area.active {
  display: grid;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.question-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.question-card {
  min-height: 122px;
  padding: 25px clamp(24px, 4vw, 46px);
  display: grid;
  place-items: center;
  position: relative;
  border: 3px solid var(--lead);
  border-radius: 52px 52px 18px 18px;
  background:
    linear-gradient(110deg, rgba(168, 47, 84, 0.18), transparent 35%),
    linear-gradient(250deg, rgba(50, 104, 200, 0.18), transparent 35%),
    rgba(33, 17, 43, 0.97);
  box-shadow: inset 0 0 0 1px rgba(244, 199, 98, 0.35), inset 0 0 32px rgba(116, 71, 168, 0.18);
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.18rem, 2.4vw, 1.65rem);
  line-height: 1.35;
}

.answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 16px;
}

.answer {
  min-height: 66px;
  padding: 12px 24px 12px 42px;
  display: flex;
  align-items: center;
  position: relative;
  cursor: pointer;
  color: var(--white);
  border: 3px solid var(--lead);
  border-radius: 14px;
  background:
    linear-gradient(120deg, rgba(168, 47, 84, 0.2), transparent 32%),
    linear-gradient(300deg, rgba(50, 104, 200, 0.2), transparent 36%),
    rgba(40, 20, 49, 0.97);
  box-shadow: inset 0 0 0 1px rgba(244, 199, 98, 0.24);
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, opacity 200ms ease;
}

.answer:hover:not(:disabled),
.answer:focus-visible:not(:disabled) {
  outline: none;
  transform: translateY(-2px);
  border-color: var(--gold);
  background:
    linear-gradient(120deg, rgba(168, 47, 84, 0.7), transparent 45%),
    linear-gradient(300deg, rgba(50, 104, 200, 0.7), transparent 45%),
    #3b2147;
}

.answer:disabled {
  cursor: default;
}

.answer .letter {
  margin-right: 12px;
  color: var(--gold);
  font-weight: 900;
}

.answer.selected {
  color: #191208;
  border-color: #fff2ad;
  background: linear-gradient(135deg, #fff2ad, var(--gold-2));
  animation: pulse 680ms ease-in-out infinite alternate;
}

.answer.selected .letter,
.answer.correct .letter,
.answer.wrong .letter {
  color: inherit;
}

.answer.correct {
  color: #03170d;
  border-color: #b3ffdc;
  background: linear-gradient(135deg, #7ff2ba, var(--green));
}

.answer.wrong {
  color: #21040a;
  border-color: #ffb1bf;
  background: linear-gradient(135deg, #ff879d, var(--red));
}

.answer.removed {
  opacity: 0.12;
  pointer-events: none;
}

@keyframes pulse {
  to { filter: brightness(1.18); }
}

.sidebar {
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  border: 4px solid var(--lead);
  border-radius: 80px 80px 20px 20px;
  background:
    linear-gradient(135deg, rgba(168, 47, 84, 0.13), transparent 35%),
    linear-gradient(225deg, rgba(50, 104, 200, 0.13), transparent 35%),
    linear-gradient(180deg, var(--panel-light), var(--panel));
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(244, 199, 98, 0.28);
}

.sidebar h2 {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.lifelines {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.lifeline {
  aspect-ratio: 1.45;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--cyan);
  border: 3px solid var(--lead);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(141, 216, 232, 0.22), transparent 30%),
    linear-gradient(135deg, rgba(50, 104, 200, 0.76), rgba(116, 71, 168, 0.72));
  box-shadow: inset 0 0 0 1px rgba(244, 199, 98, 0.28);
  font-weight: 900;
  font-size: 0.83rem;
  transition: 180ms ease;
}

.lifeline:hover:not(:disabled) {
  border-color: var(--gold);
  color: var(--gold);
  transform: scale(1.04);
}

.lifeline:disabled,
.lifeline.used {
  opacity: 0.26;
  cursor: default;
  text-decoration: line-through 2px var(--red);
}

.ladder {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  margin: auto 0 0;
  padding: 0;
  list-style: none;
  font-variant-numeric: tabular-nums;
}

.ladder li {
  min-height: 27px;
  padding: 4px 11px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 6px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.ladder li.checkpoint {
  color: var(--white);
}

.ladder li.current {
  color: #fff9ec;
  background: linear-gradient(90deg, var(--ruby), var(--violet), var(--blue));
  border: 1px solid rgba(244, 199, 98, 0.75);
  box-shadow: 0 0 20px rgba(255, 201, 67, 0.24);
}

.ladder .step {
  width: 24px;
  color: inherit;
  opacity: 0.65;
}

.audience-panel {
  display: none;
  margin-top: 13px;
  padding: 14px 16px;
  border: 1px solid rgba(84, 220, 255, 0.28);
  border-radius: 14px;
  background: rgba(5, 7, 26, 0.9);
}

.audience-panel.visible {
  display: block;
  animation: rise 260ms ease both;
}

.bars {
  height: 105px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: end;
}

.bar-wrap {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.bar {
  width: 100%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(var(--cyan), var(--blue));
  transition: height 700ms cubic-bezier(.2,.8,.2,1);
}

.modal-backdrop {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(2, 4, 18, 0.78);
  backdrop-filter: blur(12px);
}

.modal-backdrop.visible {
  display: grid;
}

.modal {
  width: min(510px, 100%);
  padding: 38px;
  border: 1px solid rgba(255, 201, 67, 0.45);
  border-radius: 26px;
  background:
    radial-gradient(circle at top, rgba(244, 199, 98, 0.2), transparent 38%),
    linear-gradient(135deg, rgba(168, 47, 84, 0.2), transparent 45%),
    #24142d;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65);
  text-align: center;
  animation: rise 330ms ease both;
}

.modal-kicker {
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.modal h2 {
  margin: 8px 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 8vw, 3.3rem);
  font-weight: 500;
}

.modal .earned-title {
  margin: 8px 0 16px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.9rem, 7vw, 3.4rem);
  font-weight: 900;
  line-height: 1.08;
}

.modal p {
  color: var(--muted);
  line-height: 1.6;
}

.hint {
  margin-top: 12px;
  color: rgba(168, 178, 219, 0.58);
  font-size: 0.68rem;
  text-align: center;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

  .sidebar {
    order: -1;
    padding: 14px;
  }

  .sidebar h2 {
    display: none;
  }

  .lifelines {
    width: 180px;
    margin: 0 auto 10px;
  }

  .ladder {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 3px;
    order: -1;
    margin: 0 0 12px;
  }

  .ladder li {
    min-height: 7px;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 201, 67, 0.2);
  }

  .ladder li span {
    display: none;
  }

  .ladder li.current {
    background: var(--gold);
  }

  .spotlight {
    min-height: 285px;
  }
}

@media (max-width: 620px) {
  .app {
    padding: 18px 13px 26px;
  }

  .brand {
    font-size: 0.7rem;
  }

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

  .answer {
    min-height: 58px;
  }

  .question-card {
    min-height: 112px;
    border-radius: 38px 38px 14px 14px;
  }

  .intro-copy {
    width: 100%;
    padding: 18px;
    bottom: 8px;
  }

  .logo {
    transform: translateY(-40px);
  }

  .hint {
    display: none;
  }
}

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