:root {
  --bg: #030006;
  --glass: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --muted: #d9c8ff;
  --pink: #ff2fa6;
  --purple: #9b35ff;
  --blue: #00d9ff;
  --red: #ff1744;
  --green: #00ff99;
}

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

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
}

button,
select {
  font: inherit;
}

button {
  border: none;
  cursor: pointer;
}

main {
  min-height: 100vh;
}

#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}

.background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: -10;
  background:
    radial-gradient(circle at top, rgba(255, 47, 166, 0.22), transparent 35%),
    radial-gradient(circle at bottom right, rgba(0, 217, 255, 0.2), transparent 35%),
    linear-gradient(135deg, #020005, #090014, #030006);
}

.grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 55px 55px;
  mask-image: linear-gradient(to bottom, transparent, black, transparent);
}

.fog {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle, rgba(255,255,255,.08), transparent 35%),
    radial-gradient(circle at right, rgba(255,47,166,.12), transparent 40%);
  filter: blur(70px);
  animation: fogMove 9s infinite alternate ease-in-out;
}

@keyframes fogMove {
  from { transform: translateX(-4%) scale(1); }
  to { transform: translateX(4%) scale(1.15); }
}

.orb {
  position: absolute;
  width: 45vmax;
  height: 45vmax;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .38;
  animation: floatOrb 12s infinite alternate ease-in-out;
}

.orb-one {
  background: var(--pink);
  top: -20%;
  left: -15%;
}

.orb-two {
  background: var(--blue);
  bottom: -25%;
  right: -20%;
  animation-delay: 2s;
}

.orb-three {
  background: var(--purple);
  top: 25%;
  right: 18%;
  animation-delay: 4s;
}

@keyframes floatOrb {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(8%, -8%) scale(1.2); }
}

.screen {
  display: none;
  min-height: 100vh;
  place-items: center;
  padding: 80px 18px 35px;
}

.screen.active {
  display: grid;
  animation: enterScreen .6s ease both;
}

@keyframes enterScreen {
  from {
    opacity: 0;
    transform: scale(.96);
    filter: blur(12px);
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

.glass {
  background: var(--glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(24px);
  box-shadow:
    0 35px 120px rgba(0,0,0,.6),
    inset 0 0 45px rgba(255,255,255,.05);
}

.start-card,
.game-shell,
.result-card {
  width: min(1100px, 95vw);
  border-radius: 38px;
  padding: clamp(30px, 6vw, 75px);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.start-card::before,
.game-shell::before,
.result-card::before {
  content: "";
  position: absolute;
  inset: -3px;
  z-index: -1;
  background: linear-gradient(120deg, var(--pink), var(--purple), var(--blue), var(--red));
  filter: blur(28px);
  opacity: .38;
}

.warning {
  color: var(--red);
  letter-spacing: 6px;
  font-weight: 900;
  margin-bottom: 18px;
  text-shadow: 0 0 18px var(--red);
}

.title {
  font-size: clamp(3.1rem, 11vw, 9rem);
  line-height: .86;
  letter-spacing: -6px;
  text-shadow:
    0 0 15px var(--pink),
    0 0 40px var(--purple),
    0 0 80px var(--blue);
}

.glitch {
  animation: glitch 3s infinite;
}

@keyframes glitch {
  0%, 90%, 100% { transform: translate(0); }
  92% { transform: translate(-3px, 2px); }
  94% { transform: translate(4px, -2px); }
  96% { transform: translate(-2px, -1px); }
}

.start-card h2 {
  margin-top: 14px;
  font-size: clamp(1.8rem, 5vw, 4.5rem);
  color: var(--muted);
  text-shadow: 0 0 20px var(--purple);
}

.subtitle {
  max-width: 780px;
  margin: 24px auto 32px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.6;
}

.mode-box {
  width: min(440px, 100%);
  margin: 0 auto 32px;
}

.mode-box label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 800;
}

.mode-box select {
  width: 100%;
  padding: 16px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.45);
  color: white;
  outline: none;
}

.main-btn,
.ghost-btn,
.danger-btn {
  padding: 17px 34px;
  border-radius: 999px;
  color: white;
  font-weight: 1000;
  letter-spacing: 1px;
  transition: .25s ease;
}

.main-btn {
  background: linear-gradient(135deg, var(--pink), var(--purple), var(--blue));
  box-shadow: 0 0 30px rgba(255, 47, 166, .6);
}

.main-btn.large {
  font-size: clamp(1.4rem, 3vw, 2.3rem);
  padding: 22px 70px;
}

.pulse {
  animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 25px rgba(255,47,166,.55); }
  50% { box-shadow: 0 0 55px rgba(0,217,255,.85); }
}

.ghost-btn {
  background: rgba(255,255,255,.1);
  border: 1px solid var(--border);
}

.danger-btn {
  background: rgba(255, 23, 68, .24);
  border: 1px solid rgba(255, 23, 68, .7);
}

.main-btn:hover,
.ghost-btn:hover,
.danger-btn:hover {
  transform: translateY(-4px) scale(1.04);
  filter: brightness(1.15);
}

.small-note {
  color: var(--muted);
  margin-top: 28px;
  font-size: .95rem;
}

.floating-btn {
  position: fixed;
  top: 18px;
  z-index: 120;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: rgba(255,255,255,.11);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  color: white;
  font-size: 1.35rem;
}

.floating-btn.left {
  left: 18px;
}

.floating-btn.right {
  right: 18px;
}

.ritual-text {
  color: var(--red);
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 1000;
  letter-spacing: 5px;
  margin-bottom: 20px;
  text-shadow: 0 0 20px var(--red);
}

.bottle-stage {
  width: min(58vw, 430px);
  height: min(58vw, 430px);
  margin: 0 auto 28px;
  display: grid;
  place-items: center;
  position: relative;
}

.danger-ring {
  position: absolute;
  inset: 5%;
  border-radius: 50%;
  border: 3px dashed rgba(255,255,255,.25);
  box-shadow:
    0 0 45px rgba(255,47,166,.5),
    inset 0 0 45px rgba(0,217,255,.25);
  animation: ringRotate 5s linear infinite;
}

@keyframes ringRotate {
  to { transform: rotate(360deg); }
}

.bottle {
  width: 92px;
  height: 325px;
  position: relative;
  transform-origin: center;
  z-index: 3;
  filter:
    drop-shadow(0 0 25px var(--pink))
    drop-shadow(0 0 45px var(--blue));
}

.bottle-cap {
  width: 42px;
  height: 35px;
  margin: 0 auto;
  border-radius: 12px 12px 5px 5px;
  background: linear-gradient(135deg, var(--red), var(--pink));
}

.bottle-neck {
  width: 52px;
  height: 80px;
  margin: 0 auto;
  border-radius: 18px 18px 8px 8px;
  background: linear-gradient(90deg, rgba(255,255,255,.18), rgba(0,217,255,.5), rgba(255,255,255,.18));
  border: 1px solid rgba(255,255,255,.35);
}

.bottle-body {
  width: 94px;
  height: 195px;
  border-radius: 42px 42px 50px 50px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(255,47,166,.72), rgba(155,53,255,.5), rgba(0,217,255,.35));
  border: 1px solid rgba(255,255,255,.35);
  box-shadow: inset 0 0 35px rgba(255,255,255,.15);
}

.bottle-body span {
  transform: rotate(90deg);
  font-weight: 1000;
  letter-spacing: 8px;
}

.bottle-light {
  position: absolute;
  width: 15px;
  height: 190px;
  top: 92px;
  left: 22px;
  border-radius: 20px;
  background: rgba(255,255,255,.35);
  filter: blur(2px);
}

.bottle.shaking {
  animation: bottleShake .12s infinite;
}

@keyframes bottleShake {
  0% { margin-left: 0; }
  25% { margin-left: -5px; }
  50% { margin-left: 4px; }
  75% { margin-left: -3px; }
  100% { margin-left: 5px; }
}

.suspense-text {
  color: var(--muted);
  font-size: clamp(1.1rem, 2.3vw, 1.7rem);
  min-height: 48px;
  margin-bottom: 20px;
}

.controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 22px;
}

.ratio {
  margin-top: 28px;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 1px;
}

.result-card {
  min-height: 560px;
  display: grid;
  place-items: center;
}

.result-type {
  font-size: clamp(3.4rem, 12vw, 9rem);
  font-weight: 1000;
  line-height: .9;
  text-shadow:
    0 0 18px currentColor,
    0 0 60px currentColor;
}

.result-card.truth .result-type {
  color: var(--blue);
}

.result-card.dare .result-type {
  color: var(--pink);
}

.result-card.skip .result-type {
  color: var(--green);
}

.result-card h2 {
  color: var(--muted);
  font-size: clamp(1.2rem, 3vw, 2.3rem);
}

.result-text {
  max-width: 900px;
  font-size: clamp(1.45rem, 4vw, 3.2rem);
  line-height: 1.22;
  font-weight: 900;
}

.flash {
  animation: flash .75s ease;
}

@keyframes flash {
  0%, 100% { filter: brightness(1); }
  40% { filter: brightness(2.8) saturate(1.9); }
}

#emojiLayer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 110;
  overflow: hidden;
}

.emoji {
  position: absolute;
  font-size: 2.5rem;
  animation: emojiRise 2.3s ease-out forwards;
}

@keyframes emojiRise {
  from {
    opacity: 0;
    transform: translateY(60px) scale(.7) rotate(0deg);
  }
  20% {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: translateY(-190px) scale(1.4) rotate(35deg);
  }
}

@media (max-width: 700px) {
  .screen {
    padding: 78px 14px 28px;
  }

  .start-card,
  .game-shell,
  .result-card {
    border-radius: 26px;
  }

  .title {
    letter-spacing: -3px;
  }

  .bottle {
    transform: scale(.8);
  }

  .main-btn,
  .ghost-btn,
  .danger-btn {
    width: 100%;
  }

  .controls {
    flex-direction: column;
  }
}