:root {
  --ruleta-black: #0a0a0a;
  --ruleta-white: var(--text);
  --ruleta-accent: var(--accent);
  --ruleta-red: #e63946;
  --ruleta-green: #2ecc71;
  --ruleta-yellow: #f1c40f;
}

.ruleta-page {
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.ruleta-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.06;
  pointer-events: none;
  z-index: 1;
}

.blob,
.drip {
  display: none;
}

.wheel-container {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 20px auto;
}

.pill-row {
  display: flex;
  justify-content: center;
  margin: 8px 0;
}

.cta-notice {
  margin: 6px auto 0;
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted);
}

.cta-notice .cta-handle {
  color: #f1c40f;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.wheel-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  transition: transform 0.05s;
}

.wheel-wrap.shake {
  animation: shake 0.08s infinite;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px) rotate(-0.5deg);
  }
  75% {
    transform: translateX(3px) rotate(0.5deg);
  }
}

@keyframes shakeIntense {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  10% {
    transform: translate(-4px, 2px) rotate(-1deg);
  }
  20% {
    transform: translate(4px, -2px) rotate(1deg);
  }
  30% {
    transform: translate(-3px, -1px) rotate(-0.5deg);
  }
  40% {
    transform: translate(3px, 1px) rotate(0.5deg);
  }
  50% {
    transform: translate(-2px, 2px) rotate(-1deg);
  }
  60% {
    transform: translate(2px, -2px) rotate(1deg);
  }
  70% {
    transform: translate(-4px, 1px) rotate(-0.5deg);
  }
  80% {
    transform: translate(4px, -1px) rotate(0.5deg);
  }
  90% {
    transform: translate(-1px, 2px) rotate(0deg);
  }
}

.wheel-wrap.shake-intense {
  animation: shakeIntense 0.15s infinite;
}

@keyframes borderPulse {
  0%,
  100% {
    box-shadow: 0 0 0 8px var(--ruleta-black), 0 0 0 12px var(--ruleta-accent),
      0 0 40px rgba(241, 196, 15, 0.3);
  }
  50% {
    box-shadow: 0 0 0 8px var(--ruleta-black), 0 0 0 12px var(--ruleta-red),
      0 0 60px rgba(230, 57, 70, 0.5);
  }
}

#wheel.tension-pulse {
  animation: borderPulse 0.5s infinite;
}

#wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 0 0 10px rgba(15, 17, 24, 0.95),
    0 0 0 14px rgba(255, 255, 255, 0.14),
    0 0 50px rgba(241, 196, 15, 0.25),
    0 0 80px rgba(0, 0, 0, 0.45);
  transition: box-shadow 0.15s;
}

#wheel.glow-pulse {
  box-shadow:
    0 0 0 10px rgba(15, 17, 24, 0.95),
    0 0 0 14px rgba(255, 255, 255, 0.25),
    0 0 70px rgba(241, 196, 15, 0.55),
    0 0 120px rgba(241, 196, 15, 0.35);
}

.wheel-glow {
  position: absolute;
  inset: -28px;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 45%, rgba(241, 196, 15, 0.18) 65%, transparent 85%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.wheel-glow.active {
  opacity: 1;
  animation: glowRotate 0.5s linear infinite;
}

@keyframes glowRotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 19px solid transparent;
  border-right: 19px solid transparent;
  border-top: 38px solid var(--ruleta-accent);
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.55));
  z-index: 3;
  transition: transform 0.1s;
}

.pointer::after {
  content: "";
  position: absolute;
  top: -40px;
  left: -15px;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 30px solid #0f1118;
}

.pointer.tick {
  transform: translateX(-50%) scaleY(0.85);
}

.tick-flash {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8) 0%, transparent 70%);
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

.tick-flash.flash {
  animation: tickFlash 0.15s ease-out;
}

@keyframes tickFlash {
  0% {
    opacity: 0.8;
    transform: translateX(-50%) scale(0.5);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scale(1.5);
  }
}

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #0f1118;
  border: 2px solid rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 2;
  transition: transform 0.2s, background 0.2s;
}

.wheel-logo {
  width: 70%;
  height: 70%;
  object-fit: contain;
  display: block;
}

.wheel-center.spinning {
  animation: centerPulse 0.3s ease-in-out infinite;
}

.wheel-center .wheel-logo {
  margin: 0;
}

@keyframes centerPulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.08);
  }
}

.sparks-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
  z-index: 5;
}

.spark {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  pointer-events: none;
}

.dynamic-words {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.dynamic-word {
  position: absolute;
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  -webkit-text-stroke: 1px #0b0b0b;
  animation: floatUp 1s ease-out forwards;
}

@keyframes floatUp {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.7) rotate(-8deg);
  }
  15% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(1.2) rotate(5deg);
  }
}

.speed-lines {
  position: absolute;
  inset: -30px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.speed-lines.active {
  opacity: 1;
}

.speed-line {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200%;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  transform-origin: center;
}

.spin-section {
  background: linear-gradient(180deg, rgba(241, 196, 15, 0.16), rgba(23, 28, 40, 0.95));
  border: 1px solid rgba(241, 196, 15, 0.5);
  border-radius: 14px;
  padding: 16px;
  margin-top: 16px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(241, 196, 15, 0.15);
}

.spin-section h2 {
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.6rem;
  margin: 0 0 6px;
  text-align: center;
  color: #f1c40f;
  letter-spacing: 0.05em;
}

.spin-section p {
  margin: 0 0 12px;
  color: var(--muted);
  text-align: center;
}

.ruleta-page h1 {
  text-align: center;
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.6rem;
  letter-spacing: 0.06em;
  margin-top: 6px;
  text-transform: uppercase;
  color: #f1c40f;
  text-shadow: 0 6px 18px rgba(241, 196, 15, 0.25);
  position: relative;
}

.ruleta-page .muted {
  text-align: center;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.ruleta-page h1 + .muted {
  margin-top: -4px;
  margin-bottom: 6px;
}

.spin-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  background: linear-gradient(180deg, #f9d423, #f1c40f);
  color: #0b0b0b;
  border: 1px solid rgba(241, 196, 15, 0.8);
  text-shadow: none;
}

.spin-btn .btn-shine {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.spin-btn:not(:disabled) .btn-shine {
  animation: btnShine 2s infinite;
}

@keyframes btnShine {
  0% {
    left: -100%;
  }
  50%,
  100% {
    left: 100%;
  }
}

.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
}

.screen-flash {
  position: fixed;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
  z-index: 150;
  transition: opacity 0.1s;
}

.screen-flash.flash {
  animation: screenFlash 0.3s ease-out;
}

@keyframes screenFlash {
  0% {
    opacity: 0.7;
  }
  100% {
    opacity: 0;
  }
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal-overlay.show {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: linear-gradient(180deg, #1c1f2a 0%, #141620 100%);
  border: 1px solid #2a2f3a;
  border-radius: 18px;
  padding: 32px 26px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  position: relative;
  transform: scale(0.5);
  opacity: 0;
  animation: modalPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  animation-delay: 0.1s;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

@keyframes modalPop {
  0% {
    transform: scale(0.5) rotate(-5deg);
    opacity: 0;
  }
  60% {
    transform: scale(1.05) rotate(2deg);
    opacity: 1;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.modal-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
  animation: iconPulse 0.6s ease-in-out infinite alternate;
}

@keyframes iconPulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.1);
  }
}

.modal-icon.win {
  color: var(--ruleta-green);
}

.modal-icon.lose {
  color: var(--ruleta-yellow);
}

.modal-title {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.4rem;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
  line-height: 1.1;
}

.modal-title.win {
  color: var(--ruleta-green);
}

.modal-title.lose {
  color: var(--ruleta-white);
}

.modal-prize {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2rem;
  color: var(--ruleta-accent);
  margin-bottom: 12px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.modal-sub {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 18px;
}

.modal-code {
  display: inline-block;
  background: var(--ruleta-accent);
  color: #0b0b0b;
  padding: 10px 20px;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  margin-bottom: 18px;
  border-radius: 10px;
}

.modal-close-btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 12px 26px;
  font-family: "Bebas Neue", sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.modal-close-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.modal-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.modal-confetti span {
  position: absolute;
  width: 10px;
  height: 10px;
  animation: confettiFall 2s ease-in-out infinite;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(400px) rotate(720deg);
    opacity: 0;
  }
}

@media (max-width: 768px) {
  .wheel-container {
    max-width: 90vw;
  }

  .pointer {
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 28px solid var(--ruleta-accent);
    top: -5px;
  }

  .pointer::after {
    top: -30px;
    left: -11px;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-top: 22px solid #0f1118;
  }

  .wheel-center {
    width: 60px;
    height: 60px;
    font-size: 0.7rem;
  }

  .dynamic-word {
    font-size: 1.1rem !important;
  }

  .modal-content {
    padding: 24px 20px;
  }
}

@media (max-width: 520px) {
  .wheel-center {
    width: 52px;
    height: 52px;
    font-size: 0.65rem;
  }
}
