:root {
  --bg-main: #0b0622;
  --bg-card: rgba(12, 16, 46, 0.7);
  --border: rgba(255, 255, 255, 0.14);
  --text-main: #fef7ff;
  --text-sub: #c9d1ff;
  --accent-pink: #ff4fa2;
  --accent-yellow: #ffd76c;
  --accent-cyan: #4ff6ff;
  --accent-orange: #ff8a3c;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "Avenir Next", "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top, rgba(101, 71, 255, 0.22), transparent 28%),
    radial-gradient(circle at 20% 20%, rgba(255, 79, 162, 0.18), transparent 30%),
    radial-gradient(circle at 85% 10%, rgba(79, 246, 255, 0.16), transparent 24%),
    linear-gradient(180deg, #160a3b 0%, #090412 52%, #150723 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 92%);
  pointer-events: none;
}

.background-grid {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.16;
  mix-blend-mode: screen;
  pointer-events: none;
}

.background-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.65;
  pointer-events: none;
  animation: floatGlow 12s ease-in-out infinite;
}

.background-glow--one {
  top: 4rem;
  left: -4rem;
  width: 18rem;
  height: 18rem;
  background: radial-gradient(circle, rgba(255, 79, 162, 0.9), transparent 70%);
}

.background-glow--two {
  right: -5rem;
  bottom: 7rem;
  width: 24rem;
  height: 24rem;
  background: radial-gradient(circle, rgba(79, 246, 255, 0.85), transparent 72%);
  animation-delay: -4s;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(16, 20, 60, 0.88), rgba(10, 8, 27, 0.78));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.12), transparent 30%);
  pointer-events: none;
}

.hero-panel {
  padding: 2.8rem 2rem 2.4rem;
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  letter-spacing: 0.34em;
  color: var(--accent-cyan);
}

h1,
h2,
.start-button,
.winner-slot strong {
  font-family: "Arial Black", "Avenir Next Condensed", "Impact", sans-serif;
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 4.9rem);
  line-height: 0.96;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-shadow:
    0 0 18px rgba(255, 79, 162, 0.55),
    0 0 36px rgba(79, 246, 255, 0.22);
}

.lead {
  width: min(720px, 100%);
  margin: 1rem auto 0;
  color: var(--text-sub);
  font-size: 1.02rem;
  line-height: 1.8;
}

.hero-actions {
  margin-top: 1.9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}

.start-button {
  min-width: 240px;
  border: 0;
  border-radius: 999px;
  padding: 1rem 2.2rem;
  color: #13051d;
  font-size: 1.15rem;
  letter-spacing: 0.2em;
  cursor: pointer;
  background:
    linear-gradient(135deg, var(--accent-yellow), #fff58b 36%, #ffffff 50%, var(--accent-pink));
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.12),
    0 18px 36px rgba(255, 79, 162, 0.35),
    0 0 36px rgba(255, 215, 108, 0.25);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.start-button:hover {
  transform: translateY(-2px) scale(1.02);
  filter: saturate(1.1);
}

.start-button:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.status-text {
  margin: 0;
  min-height: 1.5em;
  color: var(--accent-yellow);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.roulette-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.4rem;
  margin-top: 1.4rem;
}

.wheel-card,
.winners-panel,
.entries-panel {
  padding: 1.4rem;
}

.wheel-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pick-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-cyan);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
}

.wheel-frame {
  position: relative;
  width: min(100%, 420px);
  margin-top: 0.8rem;
  padding-top: 0.6rem;
}

.wheel-pointer {
  position: absolute;
  left: 50%;
  top: -0.15rem;
  z-index: 3;
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 0;
  border-bottom: 34px solid #fff3c6;
  transform: translateX(-50%);
  filter:
    drop-shadow(0 4px 12px rgba(255, 215, 108, 0.7))
    drop-shadow(0 0 22px rgba(255, 79, 162, 0.55));
}

.wheel-pointer::after {
  content: "";
  position: absolute;
  left: -10px;
  top: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ffffff, var(--accent-yellow));
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.7);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 24px 42px rgba(0, 0, 0, 0.35));
}

.wheel-result-label {
  margin: 0.7rem 0 0;
  color: var(--text-sub);
  letter-spacing: 0.18em;
  font-size: 0.78rem;
}

.wheel-result {
  margin: 0.25rem 0 0;
  min-height: 1.2em;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: 0.08em;
  text-shadow:
    0 0 12px rgba(255, 79, 162, 0.55),
    0 0 22px rgba(79, 246, 255, 0.25);
}

.wheel-card.is-spinning .wheel-result {
  animation: pulseText 0.8s ease-in-out infinite;
}

.wheel-card.is-finished {
  box-shadow:
    var(--shadow),
    0 0 0 2px rgba(255, 255, 255, 0.1),
    0 0 42px rgba(79, 246, 255, 0.28);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.section-head h2 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: 0.08em;
}

.section-head span {
  color: var(--accent-cyan);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
}

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

.winner-slot {
  position: relative;
  min-height: 160px;
  padding: 1.2rem;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at top right, rgba(255, 79, 162, 0.18), transparent 42%),
    rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.winner-slot__label {
  color: var(--accent-yellow);
  font-size: 0.8rem;
  letter-spacing: 0.18em;
}

.winner-slot strong {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.08em;
  line-height: 1;
}

.winner-slot.is-revealed {
  animation: winnerFlash 900ms ease;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 0 36px rgba(255, 79, 162, 0.28);
}

.participants-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.8rem;
}

.participants-list li {
  padding: 0.88rem 0.95rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  color: var(--text-main);
  font-weight: 700;
  text-align: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

@keyframes floatGlow {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(1.2rem, -1.6rem, 0) scale(1.08);
  }
}

@keyframes pulseText {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.04);
    opacity: 0.82;
  }
}

@keyframes winnerFlash {
  0% {
    transform: scale(0.96);
    filter: brightness(1.2);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

@media (max-width: 900px) {
  .roulette-layout,
  .winner-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    width: min(100%, calc(100% - 1rem));
    padding-top: 1rem;
  }

  .hero-panel {
    padding-inline: 1.25rem;
  }
}

@media (max-width: 520px) {
  .panel {
    border-radius: 22px;
  }

  .wheel-card,
  .winners-panel,
  .entries-panel {
    padding: 1rem;
  }

  .start-button {
    width: 100%;
    min-width: 0;
  }

  .participants-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
