/* ==================== VARIABLES GLOBALES ==================== */
:root {
  --primary: #0052CC;
  --primary-light: #2684FF;
  --primary-dark: #0747A6;
  --accent: #FFB800;
  --accent-light: #FFCF40;
  --accent-dark: #E6A600;
  --success: #36B37E;
  --danger: #FF5630;
  --warning: #FFAB00;
  
  --dark-900: #0D1117;
  --dark-800: #161B22;
  --dark-700: #21262D;
  --dark-600: #30363D;
  --dark-500: #484F58;
  
  --light-100: #FFFFFF;
  --light-200: #F0F6FC;
  --light-300: #C9D1D9;
  --light-400: #8B949E;
  
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Outfit', system-ui, sans-serif;
  
  --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
  --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== RESET & BASE ==================== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--dark-900);
  color: var(--light-100);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ==================== PANTALLA DE CONFIGURACIÓN ==================== */
.config-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* Efectos de fondo */
.bg-effects {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(0, 82, 204, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(255, 184, 0, 0.1) 0%, transparent 50%),
    linear-gradient(180deg, var(--dark-900) 0%, var(--dark-800) 100%);
}

.floating-elements {
  position: absolute;
  inset: 0;
}

.float-plane {
  position: absolute;
  font-size: 1.8rem;
  opacity: 0.1;
  animation: floatAcross 25s linear infinite;
}

.fp1 { top: 15%; animation-delay: 0s; }
.fp2 { top: 45%; animation-delay: 8s; font-size: 1.4rem; }
.fp3 { top: 75%; animation-delay: 16s; font-size: 2.2rem; }

@keyframes floatAcross {
  0% { left: -50px; transform: rotate(10deg); }
  100% { left: calc(100% + 50px); transform: rotate(15deg); }
}

.float-star {
  position: absolute;
  font-size: 1rem;
  color: var(--accent);
  opacity: 0;
  animation: twinkle 4s ease-in-out infinite;
}

.fs1 { top: 10%; left: 20%; animation-delay: 0s; }
.fs2 { top: 30%; left: 70%; animation-delay: 1s; }
.fs3 { top: 60%; left: 15%; animation-delay: 2s; }
.fs4 { top: 80%; left: 85%; animation-delay: 3s; }

@keyframes twinkle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

/* Container principal */
.config-container {
  width: 100%;
  max-width: 520px;
  position: relative;
  z-index: 1;
  animation: slideUp 0.6s var(--ease-out-expo);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header */
.config-header {
  text-align: center;
  margin-bottom: 30px;
}

.logo-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 20px;
}

.logo-img {
  height: 65px;
  width: auto;
  position: relative;
  z-index: 1;
}

.logo-glow {
  position: absolute;
  inset: -20px;
  background: radial-gradient(circle, rgba(0, 82, 204, 0.4) 0%, transparent 70%);
  filter: blur(15px);
  animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
}

.main-title {
  margin-bottom: 10px;
}

.title-line {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: var(--light-400);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.title-highlight {
  display: block;
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--light-100) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.tagline {
  color: var(--light-400);
  font-size: 1rem;
}

/* Form Cards */
.form-card {
  background: linear-gradient(145deg, var(--dark-700), var(--dark-800));
  border: 1px solid var(--dark-600);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
  transition: all 0.3s var(--ease-in-out);
}

.form-card:hover {
  border-color: var(--dark-500);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.form-group {
  margin-bottom: 18px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label,
.section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 600;
  font-size: 0.9rem;
}

.section-label.compact {
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.label-icon {
  font-size: 1.1rem;
}

.optional-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--light-400);
  background: var(--dark-600);
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-left: auto;
}

.helper-text {
  font-size: 0.8rem;
  color: var(--light-400);
  margin-bottom: 12px;
}

/* Inputs */
input[type="text"] {
  width: 100%;
  padding: 14px 18px;
  background: var(--dark-900);
  border: 2px solid var(--dark-600);
  border-radius: 12px;
  color: var(--light-100);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.25s var(--ease-in-out);
}

input[type="text"]:hover {
  border-color: var(--dark-500);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-light);
  background: rgba(38, 132, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(38, 132, 255, 0.15);
}

input[type="text"]::placeholder {
  color: var(--light-400);
  font-weight: 400;
}

/* Participants Card */
.participants-card .card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.btn-clear-all {
  background: transparent;
  border: none;
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.btn-clear-all:hover {
  background: rgba(255, 86, 48, 0.15);
}

.input-wrapper {
  display: flex;
  gap: 10px;
}

.input-wrapper input {
  flex: 1;
}

.btn-add {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: 12px;
  color: var(--light-100);
  font-size: 1.8rem;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s var(--ease-out-back);
  flex-shrink: 0;
}

.btn-add:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 25px rgba(0, 82, 204, 0.4);
}

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

.btn-add-icon {
  line-height: 1;
}

/* Participants Grid */
.participants-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
  min-height: 40px;
}

.participant-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 25px;
  font-size: 0.85rem;
  font-weight: 600;
  animation: popIn 0.3s var(--ease-out-back);
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.3);
}

@keyframes popIn {
  0% { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

.tag-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.remove-tag {
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  color: var(--light-100);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.remove-tag:hover {
  background: var(--danger);
  transform: scale(1.15) rotate(90deg);
}

.participants-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.count-badge {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.count-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.count-label {
  font-size: 0.85rem;
  color: var(--light-400);
}

.min-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--warning);
  background: rgba(255, 171, 0, 0.15);
  padding: 4px 12px;
  border-radius: 20px;
  transition: all 0.3s ease;
}

.min-badge.ready {
  color: var(--success);
  background: rgba(54, 179, 126, 0.15);
}

/* Options Card */
.options-card {
  padding: 20px;
}

.options-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.option-group {
  display: flex;
  flex-direction: column;
}

/* Color Options */
.color-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.color-btn {
  width: 36px;
  height: 36px;
  border: 3px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  padding: 3px;
  background: var(--dark-800);
  transition: all 0.25s var(--ease-out-back);
}

.color-btn:hover {
  transform: scale(1.15);
}

.color-btn.active {
  border-color: var(--light-100);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.color-dot {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.color-dot.corporate { background: conic-gradient(#0052CC, #00875A, #C92A2A, #5F3DC4, #0052CC); }
.color-dot.fiesta { background: conic-gradient(#E03131, #1098AD, #F59F00, #2F9E44, #E03131); }
.color-dot.neon { background: conic-gradient(#BE4BDB, #15AABF, #FAB005, #FF6B6B, #BE4BDB); }
.color-dot.tropical { background: conic-gradient(#0CA678, #E67700, #D9480F, #1C7ED6, #0CA678); }
.color-dot.sunset { background: conic-gradient(#E03131, #E67700, #A61E4D, #F03E3E, #E03131); }
.color-dot.ocean { background: conic-gradient(#1864AB, #1098AD, #0CA678, #087F5B, #1864AB); }

/* Speed Options */
.speed-selector {
  display: flex;
  background: var(--dark-900);
  border-radius: 12px;
  padding: 4px;
}

.speed-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.speed-btn:hover {
  background: var(--dark-700);
}

.speed-btn.active {
  background: var(--primary);
  box-shadow: 0 4px 15px rgba(0, 82, 204, 0.4);
}

/* Toggles */
.toggles-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.toggle-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 12px;
  background: var(--dark-900);
  border-radius: 10px;
  transition: all 0.2s ease;
  flex: 1;
  justify-content: center;
}

.toggle-item:hover {
  background: var(--dark-700);
}

.toggle-item input {
  display: none;
}

.toggle-visual {
  width: 18px;
  height: 18px;
  border: 2px solid var(--dark-500);
  border-radius: 4px;
  position: relative;
  transition: all 0.2s ease;
}

.toggle-item input:checked + .toggle-visual {
  background: var(--primary);
  border-color: var(--primary);
}

.toggle-item input:checked + .toggle-visual::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--light-100);
}

.toggle-text {
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.btn-reset {
  padding: 16px 24px;
  background: var(--dark-700);
  border: 2px solid var(--dark-600);
  border-radius: 14px;
  color: var(--light-300);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
}

.btn-reset:hover {
  background: var(--dark-600);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-start {
  flex: 1;
  padding: 18px 30px;
  background: none;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s var(--ease-out-back);
}

.btn-start:disabled {
  cursor: not-allowed;
}

.btn-start:disabled .btn-bg {
  background: var(--dark-600);
}

.btn-start:not(:disabled):hover {
  transform: translateY(-3px);
}

.btn-start:not(:disabled):hover .btn-bg {
  box-shadow: 0 15px 40px rgba(255, 184, 0, 0.4);
}

.btn-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  border-radius: 14px;
  transition: all 0.3s ease;
}

.btn-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-start .btn-icon {
  font-size: 1.4rem;
}

.btn-start .btn-text {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--dark-900);
}

.btn-start:disabled .btn-text {
  color: var(--light-400);
}

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

.btn-start:not(:disabled):hover .btn-shine {
  animation: shineMove 0.6s ease;
}

@keyframes shineMove {
  100% { left: 100%; }
}

/* ==================== PANTALLA DE RULETA ==================== */
.wheel-screen {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.wheel-screen.hidden {
  display: none;
}

/* Fondo animado */
.wheel-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.wheel-bg-gradient {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, var(--dark-800) 0%, var(--dark-900) 100%);
}

.wheel-bg-rays {
  position: absolute;
  inset: 0;
  opacity: 0.03;
}

.wheel-bg-sparkles {
  position: absolute;
  inset: 0;
}

.sparkle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  animation: sparkleAnim 3s ease-in-out infinite;
}

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

/* Top Controls */
.top-controls {
  position: fixed;
  top: 15px;
  left: 15px;
  right: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  pointer-events: none;
}

.top-controls > * {
  pointer-events: auto;
}

.btn-back,
.btn-reset-wheel {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(0, 82, 204, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 25px;
  color: var(--light-100);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.btn-back svg,
.btn-reset-wheel svg {
  width: 20px;
  height: 20px;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: var(--accent);
  transform: translateX(-3px);
  box-shadow: 0 4px 20px rgba(255, 184, 0, 0.3);
}

.btn-back span {
  display: inline;
}

.btn-reset-wheel {
  background: rgba(54, 179, 126, 0.2);
  border-color: var(--success);
  color: var(--success);
}

.btn-reset-wheel:hover {
  background: var(--success);
  color: var(--dark-900);
}

.btn-reset-wheel.hidden {
  display: none;
}

/* Main Content */
.wheel-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* Header */
.wheel-header {
  text-align: center;
  margin-bottom: 15px;
  flex-shrink: 0;
}

.wheel-logo {
  height: 60px;
  width: auto;
  margin-bottom: 10px;
  filter: drop-shadow(0 4px 20px rgba(0, 82, 204, 0.6));
  animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.event-title {
  font-family: var(--font-body);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--light-100);
  line-height: 1.1;
  margin-bottom: 5px;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  letter-spacing: -0.02em;
}

.event-subtitle {
  font-size: 0.9rem;
  color: var(--light-400);
}

/* Wheel Arena */
.wheel-arena {
  position: relative;
  margin: 10px 0;
  flex-shrink: 0;
}

.wheel-outer-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 480px;
  height: 480px;
  border-radius: 50%;
  pointer-events: none;
}

.ring-lights {
  position: absolute;
  inset: 0;
}

.ring-light {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent);
  animation: lightBlink 1s ease-in-out infinite;
}

@keyframes lightBlink {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 1; }
}

.wheel-wrapper {
  position: relative;
  width: 440px;
  height: 440px;
}

#wheelCanvas {
  width: 440px !important;
  height: 440px !important;
}

/* Pointer */
.pointer-container {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
}

.pointer-glow {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 35px;
  height: 35px;
  background: var(--accent);
  border-radius: 50%;
  filter: blur(18px);
  opacity: 0.6;
  animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.4; transform: translateX(-50%) scale(0.8); }
  50% { opacity: 0.8; transform: translateX(-50%) scale(1.2); }
}

.pointer-plane {
  width: 70px;
  height: auto;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s ease;
  animation: pointerBob 2s ease-in-out infinite;
}

@keyframes pointerBob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(2deg); }
}

.pointer-plane.bouncing {
  animation: pointerBounce 0.15s ease infinite;
}

@keyframes pointerBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* Wheel Frame */
.wheel-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  padding: 8px;
  background: linear-gradient(145deg, var(--dark-600) 0%, var(--dark-800) 100%);
  box-shadow: 
    0 0 0 4px var(--dark-500),
    0 0 0 8px var(--dark-700),
    0 20px 60px rgba(0, 0, 0, 0.5),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.wheel-inner-shadow {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 5;
}

#wheelCanvas {
  display: block;
  border-radius: 50%;
}

/* Wheel Controls */
.wheel-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 15px;
  flex-shrink: 0;
}

.spin-button {
  position: relative;
  padding: 16px 45px;
  background: none;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s var(--ease-out-back);
}

.spin-button:hover:not(:disabled) {
  transform: scale(1.05);
}

.spin-button:active:not(:disabled) {
  transform: scale(0.98);
}

.spin-button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.spin-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent) 0%, #FF6B00 50%, var(--danger) 100%);
  background-size: 200% 200%;
  border-radius: 50px;
  animation: gradientMove 3s ease infinite;
  box-shadow: 0 10px 40px rgba(255, 184, 0, 0.4);
}

@keyframes gradientMove {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.spin-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.spin-icon {
  font-size: 1.4rem;
  animation: iconRock 1s ease-in-out infinite;
}

@keyframes iconRock {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
}

.spin-text {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--dark-900);
  letter-spacing: 0.02em;
}

.spin-pulse {
  position: absolute;
  inset: -4px;
  border: 3px solid var(--accent);
  border-radius: 50px;
  animation: pulseRing 2s ease-in-out infinite;
}

@keyframes pulseRing {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.05); opacity: 0; }
}

.spin-button.spinning .spin-bg {
  animation: gradientMove 0.4s linear infinite;
}

.spin-button.spinning .spin-icon {
  animation: spinFast 0.3s linear infinite;
}

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

.remaining-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  font-size: 0.9rem;
}

.remaining-badge.hidden {
  display: none;
}

.remaining-badge strong {
  color: var(--accent);
  font-weight: 800;
}

.keyboard-hint {
  font-size: 0.8rem;
  color: var(--light-400);
}

.keyboard-hint kbd {
  padding: 4px 10px;
  background: var(--dark-700);
  border-radius: 6px;
  font-family: var(--font-body);
  font-weight: 600;
  margin: 0 2px;
}

/* ==================== WINNER MODAL ==================== */
.winner-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.winner-modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  animation: fadeIn 0.3s ease;
}

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

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

.firework {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  animation: fireworkBurst 1s ease-out forwards;
}

@keyframes fireworkBurst {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(20); opacity: 0; }
}

.modal-box {
  position: relative;
  background: linear-gradient(165deg, var(--dark-700) 0%, var(--dark-900) 100%);
  border: 2px solid rgba(255, 184, 0, 0.3);
  border-radius: 30px;
  padding: 50px 60px;
  text-align: center;
  max-width: 450px;
  width: 100%;
  animation: modalBounce 0.6s var(--ease-out-back);
  box-shadow: 
    0 0 100px rgba(255, 184, 0, 0.3),
    0 30px 80px rgba(0, 0, 0, 0.6);
}

@keyframes modalBounce {
  0% { opacity: 0; transform: scale(0.3) rotate(-10deg); }
  50% { transform: scale(1.05) rotate(2deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

.winner-spotlight {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 184, 0, 0.4) 0%, transparent 70%);
  filter: blur(30px);
  animation: spotlightPulse 2s ease-in-out infinite;
}

@keyframes spotlightPulse {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(0.8); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.2); }
}

.celebration-header {
  position: relative;
  height: 100px;
  margin-bottom: 15px;
}

.trophy-container {
  position: relative;
  display: inline-block;
}

.trophy {
  font-size: 4rem;
  display: block;
  animation: trophyBounce 0.5s ease infinite alternate;
  filter: drop-shadow(0 10px 20px rgba(255, 184, 0, 0.5));
}

@keyframes trophyBounce {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(-10px) scale(1.1); }
}

.trophy-rays {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 150px;
  height: 150px;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg, transparent, var(--accent), transparent, var(--accent), transparent, var(--accent), transparent, var(--accent), transparent);
  border-radius: 50%;
  opacity: 0.3;
  animation: raysRotate 4s linear infinite;
}

@keyframes raysRotate {
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.flying-planes {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.fly-plane {
  position: absolute;
  font-size: 1.8rem;
  animation: flyAround 3s ease-in-out infinite;
}

.fp1 { top: 10%; left: 10%; animation-delay: 0s; }
.fp2 { top: 10%; right: 10%; animation-delay: 0.5s; }
.fp3 { bottom: 10%; left: 10%; animation-delay: 1s; }
.fp4 { bottom: 10%; right: 10%; animation-delay: 1.5s; }

@keyframes flyAround {
  0%, 100% { transform: translate(0, 0) rotate(15deg); opacity: 0.8; }
  25% { transform: translate(20px, -20px) rotate(30deg); opacity: 1; }
  50% { transform: translate(0, -30px) rotate(15deg); opacity: 0.8; }
  75% { transform: translate(-20px, -20px) rotate(0deg); opacity: 1; }
}

.winner-announce {
  margin-bottom: 15px;
}

.announce-pre {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--light-400);
  letter-spacing: 0.2em;
  margin-bottom: 10px;
  animation: textPulse 1s ease-in-out infinite;
}

@keyframes textPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.winner-tag {
  display: inline-block;
  padding: 10px 35px;
  background: linear-gradient(135deg, var(--accent) 0%, #FF9500 100%);
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--dark-900);
  box-shadow: 0 5px 20px rgba(255, 184, 0, 0.4);
  transition: all 0.3s ease;
}

.winner-name {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--light-100);
  margin: 20px 0;
  line-height: 1.2;
  animation: nameReveal 0.8s var(--ease-out-back);
  text-shadow: 0 4px 20px rgba(255, 184, 0, 0.3);
}

@keyframes nameReveal {
  0% { opacity: 0; transform: translateY(20px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.celebration-emojis {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 25px;
  font-size: 1.8rem;
}

.celebration-emojis span {
  animation: emojiJump 0.6s ease infinite;
}

.celebration-emojis span:nth-child(1) { animation-delay: 0s; }
.celebration-emojis span:nth-child(2) { animation-delay: 0.1s; }
.celebration-emojis span:nth-child(3) { animation-delay: 0.2s; }
.celebration-emojis span:nth-child(4) { animation-delay: 0.3s; }
.celebration-emojis span:nth-child(5) { animation-delay: 0.4s; }

@keyframes emojiJump {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.btn-continue {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 40px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: 30px;
  color: var(--light-100);
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease-out-back);
  box-shadow: 0 8px 25px rgba(0, 82, 204, 0.4);
}

.btn-continue:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(0, 82, 204, 0.5);
}

.btn-continue svg {
  width: 18px;
  height: 18px;
}

/* ==================== CONFETTI ==================== */
.confetti {
  position: fixed;
  pointer-events: none;
  z-index: 1500;
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(100vh) rotate(720deg);
  }
}

/* ==================== RESPONSIVE ==================== */

/* Laptops con altura limitada (768px - 900px) */
@media (max-height: 800px) and (min-width: 601px) {
  .wheel-main {
    padding: 15px;
  }
  
  .wheel-logo {
    height: 50px;
    margin-bottom: 8px;
  }
  
  .wheel-header {
    margin-bottom: 10px;
  }
  
  .event-title {
    font-size: 1.8rem;
  }
  
  .wheel-wrapper {
    width: 380px;
    height: 380px;
  }
  
  #wheelCanvas {
    width: 380px !important;
    height: 380px !important;
  }
  
  .wheel-outer-ring {
    width: 415px;
    height: 415px;
  }
  
  .pointer-plane {
    width: 60px;
  }
  
  .pointer-container {
    top: -25px;
  }
  
  .wheel-controls {
    margin-top: 12px;
    gap: 8px;
  }
  
  .spin-button {
    padding: 14px 38px;
  }
  
  .spin-text {
    font-size: 1.1rem;
  }
}

@media (max-width: 600px) {
  .config-container {
    padding: 0 5px;
  }
  
  .config-header {
    margin-bottom: 20px;
  }
  
  .logo-img {
    height: 45px;
  }
  
  .title-highlight {
    font-size: 1.8rem;
  }
  
  .form-card {
    padding: 18px 16px;
    border-radius: 14px;
  }
  
  .options-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .toggles-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .toggle-item {
    justify-content: flex-start;
    padding: 12px 15px;
  }
  
  .action-buttons {
    flex-direction: column;
  }
  
  .btn-reset {
    justify-content: center;
  }
  
  /* Wheel screen mobile */
  .wheel-main {
    padding: 15px 10px;
  }
  
  .wheel-header {
    margin-bottom: 8px;
  }
  
  .wheel-logo {
    height: 45px;
    margin-bottom: 5px;
  }
  
  .event-title {
    font-size: 1.5rem;
  }
  
  .wheel-arena {
    margin: 8px 0;
  }
  
  .wheel-wrapper {
    width: 300px;
    height: 300px;
  }
  
  #wheelCanvas {
    width: 300px !important;
    height: 300px !important;
  }
  
  .wheel-outer-ring {
    width: 330px;
    height: 330px;
  }
  
  .pointer-plane {
    width: 55px;
  }
  
  .pointer-container {
    top: -22px;
  }
  
  .wheel-controls {
    margin-top: 10px;
    gap: 8px;
  }
  
  .spin-button {
    padding: 14px 35px;
  }
  
  .spin-text {
    font-size: 1.1rem;
  }
  
  .spin-icon {
    font-size: 1.2rem;
  }
  
  .remaining-badge {
    padding: 6px 14px;
    font-size: 0.85rem;
  }
  
  .keyboard-hint {
    font-size: 0.75rem;
  }
  
  .top-controls {
    top: 10px;
    left: 10px;
    right: 10px;
  }
  
  .btn-back,
  .btn-reset-wheel {
    padding: 10px 16px;
    font-size: 0.85rem;
  }
  
  .btn-back svg,
  .btn-reset-wheel svg {
    width: 18px;
    height: 18px;
  }
  
  /* Modal mobile */
  .modal-box {
    padding: 35px 25px;
    border-radius: 24px;
  }
  
  .trophy {
    font-size: 3rem;
  }
  
  .winner-name {
    font-size: 2rem;
  }
  
  .celebration-emojis {
    font-size: 1.4rem;
    gap: 10px;
  }
  
  .btn-continue {
    padding: 14px 30px;
    font-size: 1rem;
  }
}

@media (max-width: 380px) {
  .wheel-wrapper {
    width: 260px;
    height: 260px;
  }
  
  #wheelCanvas {
    width: 260px !important;
    height: 260px !important;
  }
  
  .wheel-outer-ring {
    width: 285px;
    height: 285px;
  }
  
  .pointer-plane {
    width: 48px;
  }
  
  .pointer-container {
    top: -20px;
  }
  
  .event-title {
    font-size: 1.3rem;
  }
  
  .wheel-logo {
    height: 40px;
  }
  
  .color-options {
    gap: 6px;
  }
  
  .color-btn {
    width: 32px;
    height: 32px;
  }
}

/* Landscape mobile */
@media (max-height: 600px) {
  .wheel-main {
    padding: 10px;
  }
  
  .wheel-header {
    margin-bottom: 5px;
  }
  
  .wheel-logo {
    height: 35px;
    margin-bottom: 3px;
  }
  
  .event-title {
    font-size: 1.2rem;
  }
  
  .wheel-arena {
    margin: 5px 0;
  }
  
  .wheel-wrapper {
    width: 220px;
    height: 220px;
  }
  
  #wheelCanvas {
    width: 220px !important;
    height: 220px !important;
  }
  
  .wheel-outer-ring {
    width: 245px;
    height: 245px;
  }
  
  .pointer-plane {
    width: 40px;
  }
  
  .pointer-container {
    top: -16px;
  }
  
  .wheel-controls {
    margin-top: 5px;
    gap: 5px;
  }
  
  .spin-button {
    padding: 10px 25px;
  }
  
  .spin-text {
    font-size: 0.95rem;
  }
  
  .keyboard-hint {
    display: none;
  }
  
  .top-controls {
    top: 5px;
  }
  
  .btn-back,
  .btn-reset-wheel {
    padding: 8px 12px;
    font-size: 0.8rem;
  }
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Shake animation */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.4s ease;
}
