/* =========================================
   VARIABLES Y RESET
   ========================================= */
   :root {
    --bg-dark: #121212;
    --bg-panel: #1e1e24;
    --primary: #6200ea;
    --primary-hover: #7c4dff;
    --accent: #00e5ff;
    --text-light: #ffffff;
    --text-muted: #b0bec5;
    --wheel-border: #333;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* =========================================
   CABECERA
   ========================================= */
.game-header {
    text-align: center;
    padding: 1.5rem 0;
    background: #000;
    border-bottom: 2px solid var(--primary);
    box-shadow: 0 5px 20px rgba(98, 0, 234, 0.3);
    z-index: 10;
}
.logo { font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 2px; }
.game-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 3rem;
    font-weight: 900;
    margin: 5px 0;
    letter-spacing: 2px;
}
.highlight { color: var(--accent); text-shadow: 0 0 15px rgba(0, 229, 255, 0.6); }

/* =========================================
   LAYOUT PRINCIPAL
   ========================================= */
.roulette-layout {
    flex: 1;
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem;
    gap: 3rem;
    align-items: center;
}

/* Panel de Configuración (Izquierda) */
.config-panel {
    width: 350px;
    background: var(--bg-panel);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.config-panel h2 { font-family: 'Poppins', sans-serif; font-size: 1.5rem; color: var(--accent); }
.helper-text { font-size: 0.9rem; color: var(--text-muted); }

textarea {
    width: 100%;
    height: 300px;
    background: #111;
    border: 1px solid #444;
    border-radius: 8px;
    color: var(--text-light);
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    padding: 15px;
    resize: none;
    outline: none;
    transition: border-color 0.3s;
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 10px rgba(0,229,255,0.2); }

.stats { font-size: 0.9rem; color: var(--text-muted); text-align: right; }
#student-count { color: var(--accent); font-size: 1.1rem; }

/* Botones */
.btn-primary, .btn-secondary {
    padding: 12px 20px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 10px;
    font-family: 'Poppins', sans-serif;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(98,0,234,0.4); }

.btn-secondary { background: transparent; border: 2px solid var(--accent); color: var(--accent); }
.btn-secondary:hover { background: var(--accent); color: #000; }

/* =========================================
   ZONA DE LA RULETA (Centro)
   ========================================= */
.wheel-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.wheel-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1;
    filter: drop-shadow(0 0 30px rgba(0,0,0,0.8));
}

/* El puntero de arriba */
.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    color: var(--text-light);
    z-index: 5;
    text-shadow: 0 5px 10px rgba(0,0,0,0.8);
    filter: drop-shadow(0 0 5px #fff);
}

#wheel-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 8px solid var(--wheel-border);
    background: #000;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.8);
}

.btn-spin {
    background: linear-gradient(135deg, #00e5ff 0%, #007bb5 100%);
    color: #000;
    border: none;
    padding: 20px 50px;
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    border-radius: 50px;
    cursor: pointer;
    text-transform: uppercase;
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.4);
    transition: all 0.1s;
    letter-spacing: 2px;
}
.btn-spin:hover { transform: scale(1.05); box-shadow: 0 15px 40px rgba(0, 229, 255, 0.6); }
.btn-spin:active { transform: scale(0.95); }
.btn-spin:disabled { background: #555; color: #888; cursor: not-allowed; box-shadow: none; transform: none; }

/* =========================================
   MODAL DE GANADOR
   ========================================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden;
    transition: all 0.3s ease;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.winner-card {
    background: linear-gradient(135deg, var(--bg-panel) 0%, #111 100%);
    border: 3px solid var(--accent);
    padding: 3rem 4rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 0 50px rgba(0, 229, 255, 0.3);
    transform: scale(0.5) translateY(100px);
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.modal-overlay.active .winner-card { transform: scale(1) translateY(0); }

.sparkles { font-size: 3rem; color: var(--accent); animation: pulse 1s infinite alternate; }
@keyframes pulse { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(1.2); opacity: 1; text-shadow: 0 0 20px var(--accent); } }

.winner-title { font-family: 'Inter', sans-serif; font-size: 1.5rem; color: var(--text-muted); letter-spacing: 5px; text-transform: uppercase; }
.winner-name { font-family: 'Poppins', sans-serif; font-size: 4.5rem; font-weight: 900; color: var(--text-light); text-shadow: 0 5px 15px rgba(0,0,0,0.5); margin: 10px 0 30px; line-height: 1.1; }

/* =========================================
   CONFETTI CONTAINER
   ========================================= */
#confetti-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 900; overflow: hidden; }
.confetti-piece { position: absolute; width: 10px; height: 20px; opacity: 0; animation: fall 3s ease-in forwards; }
@keyframes fall {
    0% { transform: translateY(-100px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* =========================================
   RESPONSIVO
   ========================================= */
@media (max-width: 992px) {
    .roulette-layout { flex-direction: column; padding: 1rem; }
    .config-panel { width: 100%; max-width: 600px; }
    .wheel-container { max-width: 450px; }
    .winner-name { font-size: 3rem; }
}