:root {
  --bg: #06030b;
  --panel: rgba(31, 11, 42, 0.74);
  --text: #fff7ff;
  --muted: #c9a8d8;
  --pink: #ff4fa3;
  --pink-hot: #ff2f92;
  --violet: #9d4edd;
  --violet-bright: #c77dff;
  --green: #39ffbc;
  --border: rgba(255, 79, 163, 0.3);
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.58);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 16% 18%, rgba(157, 78, 221, 0.3), transparent 20rem),
    radial-gradient(circle at 88% 40%, rgba(255, 79, 163, 0.28), transparent 22rem),
    radial-gradient(circle at 50% 110%, rgba(57, 255, 188, 0.08), transparent 24rem),
    linear-gradient(145deg, #05020a 0%, #13081d 48%, #050309 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(115deg, transparent 0 42px, rgba(255, 79, 163, 0.052) 43px 44px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.022) 0 1px, transparent 1px 7px);
  opacity: 0.7;
}

button,
a {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

button {
  min-height: 50px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 950;
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
}

button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.game-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px 0 30px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 18px;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 950;
}

.brand img {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  box-shadow: 0 0 22px rgba(255, 79, 163, 0.28);
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(86px, 1fr));
  gap: 8px;
}

.scoreboard div {
  padding: 12px 14px;
  text-align: center;
  border: 1px solid rgba(255, 79, 163, 0.26);
  border-radius: 8px;
  background: rgba(16, 7, 25, 0.7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.scoreboard span,
.eyebrow {
  color: #ff9bd3;
  font-size: 0.66rem;
  font-weight: 950;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.scoreboard strong {
  display: block;
  margin-top: 4px;
  color: var(--violet-bright);
  font-size: 1.35rem;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
  gap: 18px;
  align-items: stretch;
}

.intro,
.round-card,
.answer-card,
.start-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 79, 163, 0.11), transparent 42%),
    rgba(24, 9, 35, 0.72);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(18px);
}

.intro {
  min-height: 360px;
  padding: clamp(26px, 5vw, 54px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

h1,
h2 {
  color: transparent;
  background: linear-gradient(90deg, #c77dff 0%, #ff7ac8 48%, #ff3d99 100%);
  -webkit-background-clip: text;
  background-clip: text;
  letter-spacing: 0;
}

h1 {
  max-width: 9ch;
  margin-top: 10px;
  font-size: clamp(3.4rem, 9vw, 6.8rem);
  line-height: 0.88;
}

.intro p:not(.eyebrow) {
  max-width: 620px;
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 720;
  line-height: 1.45;
}

.round-card {
  padding: 18px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 14px;
}

.cover-stage {
  position: relative;
  min-height: 268px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 122, 200, 0.28);
  border-radius: 8px;
  background: rgba(8, 4, 14, 0.58);
}

#cover {
  width: min(72%, 260px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  filter: blur(16px) saturate(0.9);
  transform: scale(1.08);
  opacity: 0.55;
  transition: filter 300ms ease, transform 300ms ease, opacity 300ms ease;
}

.is-revealed #cover {
  filter: none;
  transform: scale(1);
  opacity: 1;
}

#cover-mask {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(8, 4, 14, 0.1), rgba(8, 4, 14, 0.58));
  transition: opacity 260ms ease;
}

.is-revealed #cover-mask {
  opacity: 0;
}

#cover-mask span {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  color: var(--pink);
  border: 1px solid rgba(255, 79, 163, 0.72);
  border-radius: 50%;
  background: rgba(17, 6, 25, 0.82);
  box-shadow: 0 0 42px rgba(255, 79, 163, 0.38);
  font-size: 2.4rem;
  font-weight: 950;
}

.snippet-panel {
  display: grid;
  gap: 12px;
}

.snippet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#snippet-label,
#points-label {
  font-weight: 950;
}

#points-label {
  color: var(--green);
}

.snippet-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.step {
  min-height: 28px;
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px solid rgba(255, 122, 200, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.76rem;
  font-weight: 900;
}

.step.is-active {
  color: #fff7ff;
  border-color: rgba(255, 79, 163, 0.65);
  background: linear-gradient(135deg, var(--pink), var(--violet));
}

.snippet-meter {
  height: 12px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 122, 200, 0.22);
  border-radius: 999px;
  background: rgba(8, 4, 14, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#snippet-progress {
  width: 0%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--violet-bright), var(--green));
  box-shadow: 0 0 18px rgba(255, 79, 163, 0.34);
}

#snippet-progress.is-running {
  animation-name: snippetProgress;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

.player-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#play-snippet {
  color: #fff7ff;
  background: linear-gradient(135deg, var(--pink), var(--violet));
}

#more-snippet,
#next-round {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 122, 200, 0.24);
}

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

.answer-card {
  min-height: 104px;
  padding: 18px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.answer-letter {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--pink);
  border: 1px solid rgba(255, 79, 163, 0.48);
  border-radius: 50%;
  background: rgba(8, 4, 14, 0.48);
  font-weight: 950;
}

.answer-card strong {
  display: block;
  font-size: 1.18rem;
}

.answer-card span:last-child {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 760;
}

.answer-card.is-correct {
  border-color: rgba(57, 255, 188, 0.86);
  background:
    linear-gradient(135deg, rgba(57, 255, 188, 0.24), rgba(57, 255, 188, 0.08)),
    rgba(8, 32, 24, 0.74);
  box-shadow: var(--shadow), 0 0 42px rgba(57, 255, 188, 0.24);
  animation: answer-pop 320ms ease both;
}

.answer-card.is-correct .answer-letter {
  color: #05120d;
  border-color: rgba(57, 255, 188, 0.95);
  background: var(--green);
}

.answer-card.is-wrong {
  border-color: rgba(255, 60, 86, 0.9);
  background:
    linear-gradient(135deg, rgba(255, 60, 86, 0.26), rgba(255, 60, 86, 0.08)),
    rgba(38, 5, 16, 0.78);
  box-shadow: var(--shadow), 0 0 42px rgba(255, 60, 86, 0.24);
  animation: answer-shake 330ms ease both;
}

.answer-card.is-wrong .answer-letter {
  color: #fff7ff;
  border-color: rgba(255, 60, 86, 0.95);
  background: #ff3c56;
}

.inline-result {
  display: none;
  grid-template-columns: minmax(170px, auto) 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(57, 255, 188, 0.28);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 50%, rgba(57, 255, 188, 0.14), transparent 10rem),
    rgba(8, 4, 14, 0.62);
  box-shadow: var(--shadow), 0 0 34px rgba(57, 255, 188, 0.09);
  backdrop-filter: blur(18px);
}

.inline-result.is-visible {
  display: grid;
  animation: result-rise 360ms ease both;
}

.inline-result h2 {
  margin-top: 6px;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 0.95;
}

.inline-result p:not(.eyebrow) {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.inline-result #next-round {
  min-width: 142px;
  margin: 0;
  color: #fff7ff;
  background: linear-gradient(135deg, var(--green), var(--violet));
  border: 0;
  box-shadow: 0 16px 32px rgba(57, 255, 188, 0.13);
}

@keyframes snippetProgress {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

.start-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(4, 2, 8, 0.82);
  backdrop-filter: blur(18px);
}

.start-screen.is-visible {
  display: grid;
}

.start-box {
  width: min(440px, 100%);
  padding: 30px;
  text-align: center;
}

.start-box img {
  width: 104px;
  height: 104px;
  margin-bottom: 16px;
  border-radius: 22px;
}

.start-box h2 {
  margin-top: 8px;
  font-size: 2.7rem;
  line-height: 0.95;
}

.start-box p:not(.eyebrow) {
  margin-top: 14px;
  color: var(--muted);
  font-weight: 720;
  line-height: 1.45;
}

#start-game {
  width: 100%;
  margin-top: 22px;
  color: #fff7ff;
  background: linear-gradient(135deg, var(--pink), var(--violet));
}

@keyframes result-rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes answer-pop {
  0% {
    transform: scale(0.985);
  }

  70% {
    transform: scale(1.018);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes answer-shake {
  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  55% {
    transform: translateX(4px);
  }

  80% {
    transform: translateX(-2px);
  }
}

@media (max-width: 760px) {
  .game-shell {
    width: min(100% - 16px, 1120px);
    padding: 12px 0 18px;
    gap: 10px;
  }

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

  .scoreboard {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .scoreboard div {
    padding: 8px;
  }

  .scoreboard strong {
    font-size: 1.08rem;
  }

  .hero-panel {
    grid-template-columns: 1fr;
  }

  .intro {
    min-height: auto;
    padding: 18px;
  }

  h1 {
    max-width: 100%;
    font-size: clamp(2.65rem, 14vw, 4rem);
  }

  .round-card {
    padding: 12px;
  }

  .cover-stage {
    min-height: 210px;
  }

  #cover {
    width: min(62%, 190px);
  }

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

  .answer-card {
    min-height: 82px;
    padding: 14px;
  }

  .answer-card strong {
    font-size: 1rem;
  }

  .inline-result {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .inline-result #next-round {
    width: 100%;
  }
}
