/* Variables del Sistema de Diseño - Light Theme */
:root {
  --bg-primary: #f3f5fa;
  --bg-secondary: rgba(255, 255, 255, 0.65);
  --accent-neon: #2e418c; /* Khipu Blue */
  --accent-neon-bright: #4b62c7;
  --accent-gold: #d97706; /* Más oscuro para contraste en fondo claro */
  --accent-rose: #db2777; /* Más oscuro para contraste */
  --accent-blue: #0284c7;
  --text-main: #0f172a;
  --text-muted: #475569;
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-glow: 0 10px 35px 0 rgba(46, 65, 140, 0.06);
  --font-display: 'Space Grotesk', sans-serif;
  --font-sans: 'Outfit', sans-serif;
}

/* Reset y Estilos Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
}

/* Efectos de Fondo Ambientales (Luz Pastel) */
.background-effects {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #f7f9fc 0%, #e2e8f0 100%);
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  animation: orbFloat 20s infinite alternate ease-in-out;
}

.orb-1 {
  background: var(--accent-neon-bright);
  width: 500px;
  height: 500px;
  top: -100px;
  left: -100px;
}

.orb-2 {
  background: #f43f5e; /* Pastel rose */
  width: 600px;
  height: 600px;
  bottom: -150px;
  right: -150px;
  animation-delay: -5s;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(50px, 80px) scale(1.1); }
  100% { transform: translate(-30px, -50px) scale(0.9); }
}

/* Contenedor Principal */
.app-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 900px;
  padding: 20px;
  z-index: 1;
}

/* Cabecera */
.app-header {
  text-align: center;
  margin-bottom: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.brand-logo-container {
  height: 70px;
  margin-bottom: 15px;
  filter: drop-shadow(0 4px 8px rgba(46, 65, 140, 0.1));
}

.brand-logo {
  max-height: 100%;
  object-fit: contain;
}

.app-title {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: linear-gradient(135deg, var(--accent-neon) 0%, var(--accent-neon-bright) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 20px rgba(46, 65, 140, 0.1);
}

.app-subtitle {
  color: var(--text-muted);
  font-size: 1.15rem;
  margin-top: 5px;
}

/* Contenedor de la Ruleta */
.wheel-outer-container {
  position: relative;
  width: 100%;
  max-width: 650px;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
}

/* Puntero de Selección */
.wheel-marker {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  filter: drop-shadow(0 4px 10px rgba(219, 39, 119, 0.5));
  animation: pointerIdle 2s infinite ease-in-out;
  transform-origin: top center;
}

@keyframes pointerIdle {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(3px); }
}

.wheel-marker.tick {
  animation: markerTick 0.15s ease-out;
}

@keyframes markerTick {
  0% { transform: translateX(-50%) rotate(0deg); }
  30% { transform: translateX(-50%) rotate(-15deg); }
  70% { transform: translateX(-50%) rotate(5deg); }
  100% { transform: translateX(-50%) rotate(0deg); }
}

/* Lienzo Canvas */
.wheel-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 15px 45px rgba(46, 65, 140, 0.12), 
              inset 0 0 20px rgba(255, 255, 255, 0.6),
              0 0 0 10px rgba(255, 255, 255, 0.8);
  background-color: #ffffff;
  border: 1px solid rgba(0,0,0,0.05);
}

#wheel-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transition: transform 0.05s linear;
}

/* Botón de Giro Central - Glossy White & Blue */
.spin-btn {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  z-index: 5;
  background: linear-gradient(135deg, var(--accent-neon-bright) 0%, var(--accent-neon) 100%);
  padding: 6px;
  box-shadow: 0 8px 25px rgba(46, 65, 140, 0.25),
              inset 0 2px 4px rgba(255, 255, 255, 0.4),
              0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.spin-btn:hover {
  transform: scale(1.08);
}

.spin-btn:active {
  transform: scale(0.95);
}

.spin-btn-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #f1f5f9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.spin-text {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--accent-neon);
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.spin-btn-ring {
  position: absolute;
  top: -8px;
  left: -8px;
  right: -8px;
  bottom: -8px;
  border-radius: 50%;
  border: 2px solid rgba(46, 65, 140, 0.2);
  animation: pulseRing 2s infinite;
  pointer-events: none;
}

@keyframes pulseRing {
  0% { transform: scale(0.95); opacity: 1; }
  100% { transform: scale(1.15); opacity: 0; }
}

.spin-btn:disabled {
  cursor: not-allowed;
  opacity: 0.8;
  transform: scale(1) !important;
}

.spin-btn:disabled .spin-btn-ring {
  display: none;
}

.spin-btn:disabled .spin-text {
  color: var(--text-muted);
  text-shadow: none;
}

/* Pie de página */
.app-footer {
  text-align: center;
  margin-top: 10px;
}

.keyboard-tip {
  color: var(--text-muted);
  font-size: 0.9rem;
  background-color: var(--bg-secondary);
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.keyboard-tip strong {
  color: var(--accent-neon);
}

/* MODAL GANADOR (WHITE GLASSMORPHISM PREMIUM) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 100%);
  width: 90%;
  max-width: 500px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15), 
              0 0 30px rgba(46, 65, 140, 0.05);
  padding: 35px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transform: scale(0.8) translateY(20px);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-glow {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(46, 65, 140, 0.08) 0%, transparent 60%);
  pointer-events: none;
  animation: modalSpin 15s linear infinite;
}

@keyframes modalSpin {
  100% { transform: rotate(360deg); }
}

.win-badge {
  background: linear-gradient(90deg, var(--accent-rose), var(--accent-neon));
  color: #fff;
  padding: 6px 16px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 2px;
  font-family: var(--font-display);
  box-shadow: 0 4px 15px rgba(46, 65, 140, 0.2);
  display: inline-block;
  margin-bottom: 20px;
}

.prize-image-container {
  width: 160px;
  height: 160px;
  margin: 0 auto 20px auto;
  border-radius: 20px;
  background: radial-gradient(circle, rgba(46, 65, 140, 0.04) 0%, rgba(46, 65, 140, 0) 100%);
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.05);
}

.prize-image-container img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.15));
  animation: floatWinnerImage 3s infinite alternate ease-in-out;
}

@keyframes floatWinnerImage {
  0% { transform: translateY(0) rotate(0deg); }
  100% { transform: translateY(-8px) rotate(3deg); }
}

.prize-placeholder-icon {
  font-size: 5rem;
  filter: drop-shadow(0 0 15px rgba(255, 183, 3, 0.2));
  animation: pulseIcon 1.5s infinite alternate ease-in-out;
}

@keyframes pulseIcon {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}

.prize-title {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-neon);
  text-shadow: 0 2px 4px rgba(46, 65, 140, 0.05);
  margin-bottom: 20px;
  letter-spacing: 0.5px;
}

.uuid-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.uuid-badge {
  background-color: rgba(241, 245, 249, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 10px 15px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
  margin: 0 auto 30px auto;
}

.uuid-badge span {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--accent-neon-bright);
  user-select: all;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.copy-btn:hover {
  color: var(--text-main);
}

.copy-btn.copied {
  color: #10b981;
}

.accept-btn {
  background: linear-gradient(135deg, var(--accent-neon-bright) 0%, var(--accent-neon) 100%);
  color: #fff;
  border: none;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 800;
  padding: 14px 40px;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 1px;
  box-shadow: 0 4px 20px rgba(46, 65, 140, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
}

.accept-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(46, 65, 140, 0.35);
}

.accept-btn:active {
  transform: translateY(0);
}

/* Pantallas grandes y adaptabilidad */
@media (max-width: 768px) {
  .app-title {
    font-size: 2.2rem;
  }
  .wheel-outer-container {
    max-width: 500px;
  }
  .spin-btn {
    width: 100px;
    height: 100px;
  }
  .spin-text {
    font-size: 1rem;
  }
  .prize-title {
    font-size: 1.8rem;
  }
}
