/* ==========================================================================
   SISTEMA DE DISEÑO Y CONFIGURACIÓN GENERAL (Mobile-First)
   ========================================================================== */

:root {
    --bg-primary: #0a0d16;
    --bg-secondary: rgba(20, 26, 42, 0.65);
    --bg-card: rgba(22, 28, 45, 0.55);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Colores Temáticos */
    --accent-primary: #6366f1; /* Indigo */
    --accent-secondary: #a855f7; /* Violet */
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
    --accent-glow: rgba(99, 102, 241, 0.15);
    
    --winner-color: #10b981; /* Esmeralda */
    --winner-bg: rgba(16, 185, 129, 0.08);
    --winner-border: rgba(16, 185, 129, 0.25);
    
    --substitute-color: #f59e0b; /* Ámbar */
    --substitute-bg: rgba(245, 158, 11, 0.06);
    --substitute-border: rgba(245, 158, 11, 0.25);
    
    --danger-color: #ef4444;
    
    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-display: 'Outfit', sans-serif;
    
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
    --shadow-md: 0 8px 20px rgba(0,0,0,0.3);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.4);
    --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.25);
    
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 8px;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset de Estilos */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Confetti Canvas */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999;
    pointer-events: none;
    display: none;
}

/* Ocultar scrollbars generales de forma elegante */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   DECORACIONES Y CONTENEDOR PRINCIPAL
   ========================================================================== */

.app-background-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-sphere {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    opacity: 0.25;
}

.glow-1 {
    top: -10%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--accent-secondary);
}

.glow-2 {
    bottom: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--accent-primary);
}

.app-container {
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==========================================================================
   HEADER DE LA APLICACIÓN
   ========================================================================== */

.app-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 18px 24px;
    margin-bottom: 20px;
    background: var(--bg-secondary);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.instagram-logo {
    width: 36px;
    height: 36px;
    color: var(--text-primary);
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

.logo-text h1 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #ffffff 40%, #c13584 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text span {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   ESTILOS DE VISTAS (SPA) Y TARJETAS
   ========================================================================== */

.view {
    display: none;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.view.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
    border-color: var(--border-hover);
}

.card-glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.card-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.card-icon-wrapper svg {
    width: 18px;
    height: 18px;
}

.card-header h2 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    flex-grow: 1;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.4;
}

.card-body {
    padding: 20px;
}

.badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    color: var(--text-secondary);
}

/* ==========================================================================
   COMPONENTES DE FORMULARIO
   ========================================================================== */

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

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

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

@media(min-width: 480px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    letter-spacing: 0.01em;
}

.required {
    color: var(--danger-color);
}

input[type="text"],
input[type="number"],
input[type="url"],
input[type="datetime-local"] {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--font-sans);
    font-size: 0.92rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    outline: none;
    -webkit-appearance: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="datetime-local"]:focus {
    border-color: var(--accent-primary);
    background: rgba(0, 0, 0, 0.3);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-tip {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Selector Numérico */
.number-input-wrapper {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    height: 46px;
}

.number-input-wrapper input {
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 700;
    font-size: 1.05rem;
    font-family: var(--font-display);
    padding: 0;
    width: 100%;
    pointer-events: none;
}

.number-input-wrapper button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.number-input-wrapper button:active {
    background: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   FORMULARIOS DINÁMICOS DE USUARIOS (Ganadores y Suplentes)
   ========================================================================== */

.dynamic-user-card {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 14px;
    align-items: center;
    padding: 14px;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    animation: slideInDown 0.3s var(--transition-fast);
}

.dynamic-user-card:last-child {
    margin-bottom: 0;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.avatar-upload-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
}

.avatar-preview-box {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    background-size: cover;
    background-position: center;
    background-color: rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    position: relative;
    transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.avatar-preview-box:hover {
    border-color: var(--accent-primary);
    background-color: rgba(99, 102, 241, 0.05);
}

.avatar-preview-box svg {
    width: 22px;
    height: 22px;
    color: var(--text-secondary);
}

.file-input-hidden {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Modificaciones de cabeceras de tarjeta ganadores/suplentes */
.border-winner {
    border-left: 4px solid var(--winner-color);
}
.text-winner {
    color: var(--winner-color) !important;
}
.border-substitute {
    border-left: 4px solid var(--substitute-color);
}
.text-substitute {
    color: var(--substitute-color) !important;
}

/* ==========================================================================
   USUARIOS DE ANIMACIÓN DE RELLENO
   ========================================================================== */

.animation-users-list {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 6px;
}

.animation-user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    margin-bottom: 8px;
    transition: border-color var(--transition-fast);
}

.animation-user-row:focus-within {
    border-color: var(--accent-primary);
}

.animation-row-num {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    width: 18px;
    text-align: center;
}

.animation-user-row input {
    border: none;
    background: transparent;
    padding: 6px 0;
    border-radius: 0;
}

.animation-user-row input:focus {
    border: none;
    box-shadow: none;
    background: transparent;
}

/* ==========================================================================
   BOTONES DE ACCIÓN
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.btn-large {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.05rem;
    border-radius: var(--radius-lg);
}

.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--danger-color);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.18);
}

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

.form-actions {
    margin-top: 10px;
    margin-bottom: 24px;
}

.d-none {
    display: none !important;
}

/* ==========================================================================
   ESTILOS DEL LOBBY / PORTADA DEL SORTEO
   ========================================================================== */

.lobby-card {
    text-align: center;
    padding: 32px 24px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    margin-bottom: 24px;
}

.lobby-title {
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 5vw, 1.65rem);
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 20px;
    line-height: 1.25;
}

.lobby-prize-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 28px;
}

.lobby-prize-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.lobby-prize-title {
    font-family: var(--font-display);
    font-size: clamp(1.15rem, 4.5vw, 1.45rem);
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lobby-stats-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 28px;
}

.lobby-stat-item {
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    text-align: center;
}

.lobby-stat-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.lobby-stat-value {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
}

.lobby-status-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.btn-glow-pulse {
    animation: glowPulse 2s infinite;
}

@keyframes glowPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(99, 102, 241, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

/* ==========================================================================
   VISTA DE ANIMACIÓN / RULETA HORIZONTAL
   ========================================================================== */

.animation-screen-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 55vh;
    padding: 16px;
    width: 100%;
}

/* Cuenta Atrás */
.countdown-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.countdown-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 4px solid var(--accent-primary);
    box-shadow: var(--shadow-glow), inset 0 0 20px rgba(99, 102, 241, 0.2);
    margin-bottom: 20px;
    position: relative;
}

.countdown-text {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 8vw, 3.2rem);
    font-weight: 800;
    color: #ffffff;
    animation: pulseScale 1s infinite;
}

@keyframes pulseScale {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.04); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.8; }
}

.countdown-label {
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Ruleta Horizontal (Estilo Stories) */
.roulette-wrapper {
    width: 100%;
    max-width: 480px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.draw-live-status-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.status-icon-animated {
    display: inline-block;
    animation: rotateGear 2s linear infinite;
}

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

/* Visor de la ruleta horizontal */
.horizontal-wheel-viewport {
    position: relative;
    width: 100%;
    height: 130px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
}

/* Indicadores de Centro */
.horizontal-wheel-indicator-top {
    position: absolute;
    top: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 10px solid var(--accent-secondary);
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.horizontal-wheel-indicator-bottom {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 10px solid var(--accent-secondary);
    z-index: 10;
    filter: drop-shadow(0 -2px 4px rgba(0,0,0,0.5));
}

/* Marco de selección del centro */
.horizontal-wheel-viewport::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 96px;
    height: 106px;
    border: 2px solid var(--accent-secondary);
    border-radius: var(--radius-md);
    background: rgba(168, 85, 247, 0.05);
    pointer-events: none;
    z-index: 5;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.15);
}

.horizontal-wheel-track {
    display: flex;
    flex-direction: row;
    align-items: center;
    position: absolute;
    left: 0;
    will-change: transform;
    transition: transform 5s cubic-bezier(0.1, 0.88, 0.2, 1), filter 5s cubic-bezier(0.2, 0.6, 0.4, 1);
}

/* Elementos de la ruleta horizontal (Instagram Story style) */
.wheel-item-horizontal {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 90px; /* Ancho exacto del ítem para cálculos de JS */
    height: 110px;
    flex-shrink: 0;
    gap: 8px;
    transition: transform var(--transition-fast);
}

.wheel-avatar-large {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 2px solid var(--border-hover);
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}

/* Destacar el elemento del centro de forma dinámica en JS */
.wheel-item-horizontal.is-active .wheel-avatar-large {
    transform: scale(1.16);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.3);
}

.wheel-username-small {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-secondary);
    width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.roulette-stats {
    width: 100%;
    margin-bottom: 16px;
}

.r-stat {
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    text-align: center;
}

.r-stat-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
    letter-spacing: 0.03em;
}

.r-stat-val {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 700;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.progress-bar-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--accent-gradient);
    transition: width 0.1s linear;
}

/* ==========================================================================
   VISTA DE CERTIFICADO DE RESULTADOS (REDISEÑADA Y LIMPIA)
   ========================================================================== */

.results-container-card {
    background: #0f162a; /* Fondo pizarra premium */
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    margin-bottom: 24px;
    text-align: center;
}

.results-top-header {
    margin-bottom: 20px;
}

.results-badge-gradient {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 30px;
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.15);
}

.results-main-title {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 5vw, 1.45rem);
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
}

/* Caja de Premio */
.results-prize-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 24px;
}

.prize-card-tag {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    display: block;
    margin-bottom: 4px;
}

.prize-card-title {
    font-family: var(--font-display);
    font-size: clamp(1.05rem, 4.2vw, 1.25rem);
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 40%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Bloques de Resultados */
.results-block {
    margin-bottom: 24px;
    text-align: center;
}

.results-block-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 16px;
}

.results-block-title svg {
    width: 18px;
    height: 18px;
}

.results-winners-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
}

@media(min-width: 480px) {
    .results-winners-grid {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }
}

.winner-result-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px 20px;
    border-radius: var(--radius-lg);
    border: 1.5px solid var(--winner-border);
    background: var(--winner-bg);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 250px; /* Centrada y evita que se estire horizontalmente */
    margin: 0 auto;
    animation: cardPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.winner-result-card:hover {
    transform: translateY(-2px);
}

.winner-result-card.is-winner {
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.06);
}

.winner-result-card.is-substitute {
    border-color: var(--substitute-border);
    background: var(--substitute-bg);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.04);
}

@keyframes cardPop {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.winner-result-card .wheel-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid var(--winner-color);
    background-size: cover;
    background-position: center;
    margin-bottom: 14px;
    box-shadow: var(--shadow-md);
}

.winner-result-card.is-substitute .wheel-avatar-large {
    border-color: var(--substitute-color);
}

.winner-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.winner-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 2px;
    word-break: break-all;
}

.winner-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 6px;
    display: inline-block;
}

.winner-result-card.is-winner .winner-badge {
    background: rgba(16, 185, 129, 0.15);
    color: var(--winner-color);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.winner-result-card.is-substitute .winner-badge {
    background: rgba(245, 158, 11, 0.12);
    color: var(--substitute-color);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

/* Ficha técnica */
.results-technical-specs {
    background: rgba(0,0,0,0.18);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.specs-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.spec-cell {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.spec-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.spec-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
}

.specs-tc-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    text-align: left;
}

.spec-link {
    font-size: 0.82rem;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.spec-link:hover {
    text-decoration: underline;
}

.results-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

@media(min-width: 480px) {
    .results-actions {
        grid-template-columns: 1fr 1fr;
    }
}

/* ==========================================================================
   FOOTER DE LA MARCA
   ========================================================================== */

.results-footnote {
    font-size: 0.76rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 14px;
    margin-bottom: 24px;
    font-weight: 500;
    line-height: 1.4;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
}

.app-footer-brand {
    text-align: center;
    padding: 24px 16px;
    margin-top: auto;
}

.app-footer-brand p {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ==========================================================================
   SOPORTE DE IMPRESIÓN (PDF Resultados)
   ========================================================================== */

@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    .app-background-decor,
    .app-header,
    #view-config,
    #view-lobby,
    #view-animation,
    .results-actions,
    .app-footer-brand {
        display: none !important;
    }
    
    .app-container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .view.active {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .results-container-card {
        border: 1px solid #cbd5e1 !important;
        background: #ffffff !important;
        color: #000000 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        padding: 30px !important;
        width: 100% !important;
        height: auto !important;
        position: relative !important;
    }
    
    .results-main-title {
        color: #000000 !important;
    }

    .results-badge-gradient {
        background: #f1f5f9 !important;
        border: 1px solid #cbd5e1 !important;
        color: #0f172a !important;
        box-shadow: none !important;
    }
    
    .results-prize-card {
        border: 1px solid #e2e8f0 !important;
        background: #f8fafc !important;
    }
    
    .prize-card-title {
        color: #000000 !important;
        background: none !important;
        -webkit-text-fill-color: initial !important;
    }
    
    .winner-result-card {
        background: #f8fafc !important;
        border: 1px solid #cbd5e1 !important;
        color: #000000 !important;
    }

    .winner-result-card.is-winner {
        border-color: #10b981 !important;
        background: #f0fdf4 !important;
    }

    .winner-result-card.is-substitute {
        border-color: #f59e0b !important;
        background: #fffbeb !important;
    }

    .winner-name {
        color: #000000 !important;
    }
    
    .results-technical-specs {
        background: #f8fafc !important;
        border: 1px solid #cbd5e1 !important;
    }
    
    .specs-grid {
        border-bottom-color: #cbd5e1 !important;
    }
    
    .spec-value, .spec-link {
        color: #000000 !important;
    }
}

/* ==========================================================================
   NUEVOS ESTILOS: TOGGLE DE DATOS DE PRUEBA Y SPOTLIGHT INDIVIDUAL
   ========================================================================== */

/* Toggle de Datos de Prueba */
.test-data-toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.test-data-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-display);
    letter-spacing: 0.01em;
}

/* Switch Toggle Slider */
.switch-toggle {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    margin-bottom: 0;
}

.switch-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: .3s;
    border-radius: 34px;
    border: 1px solid var(--border-color);
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.switch-toggle input:checked + .switch-slider {
    background: var(--accent-gradient);
    border-color: rgba(168, 85, 247, 0.4);
}

.switch-toggle input:checked + .switch-slider:before {
    transform: translateX(20px);
    background-color: #ffffff;
}

/* Spotlight de Ganador Individual */
.winner-spotlight-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 7, 12, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

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

.spotlight-card {
    width: 90%;
    max-width: 380px;
    padding: 36px 24px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--accent-secondary);
    background: var(--bg-card);
    box-shadow: 0 0 35px rgba(168, 85, 247, 0.35);
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.winner-spotlight-overlay.active .spotlight-card {
    transform: scale(1);
}

.spotlight-avatar-outer {
    width: 124px;
    height: 124px;
    margin: 0 auto 20px auto;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spotlight-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--bg-primary);
    background-size: cover;
    background-position: center;
    background-color: rgba(255, 255, 255, 0.05);
}

.spotlight-username {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 850;
    color: #ffffff;
    margin-bottom: 8px;
    word-break: break-all;
}

.spotlight-badge {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    margin-bottom: 24px;
}

.spotlight-card.is-winner {
    border-color: var(--winner-color);
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.3);
}

.spotlight-card.is-winner .spotlight-avatar-outer {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.spotlight-card.is-winner .spotlight-badge {
    background: rgba(16, 185, 129, 0.15);
    color: var(--winner-color);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.spotlight-card.is-substitute {
    border-color: var(--substitute-color);
    box-shadow: 0 0 35px rgba(245, 158, 11, 0.3);
}

.spotlight-card.is-substitute .spotlight-avatar-outer {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.spotlight-card.is-substitute .spotlight-badge {
    background: rgba(245, 158, 11, 0.12);
    color: var(--substitute-color);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.spotlight-prize-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 28px;
}

.spotlight-prize-lbl {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.spotlight-prize-name {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
}

/* ==========================================================================
   ESTILOS DE ESCANEO DIGITAL (LECTURA RÁPIDA IN-PLACE)
   ========================================================================== */

.digital-scanner-wrapper {
    width: 100%;
    max-width: 440px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.digital-scanner-card {
    width: 100%;
    max-width: 280px;
    padding: 32px 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    box-shadow: var(--shadow-md);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

/* Efecto de pulso en el borde cuando encuentra al ganador */
.digital-scanner-card.winner-locked {
    border-color: var(--winner-color) !important;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.35) !important;
    background: rgba(16, 185, 129, 0.06) !important;
    transform: scale(1.04);
}

.scanner-avatar-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    padding: 3px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.digital-scanner-card.winner-locked .scanner-avatar-wrapper {
    background: linear-gradient(135deg, var(--winner-color) 0%, #059669 100%) !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.45) !important;
}

.scanner-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid var(--bg-primary);
    background-size: cover;
    background-position: center;
    background-color: rgba(255, 255, 255, 0.05);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Línea Láser del Escáner */
.scanner-laser-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-secondary), var(--accent-primary), var(--accent-secondary), transparent);
    box-shadow: 0 0 10px var(--accent-primary), 0 0 4px var(--accent-secondary);
    z-index: 10;
    pointer-events: none;
    animation: scanLaserAnimation 2.0s ease-in-out infinite;
}

.digital-scanner-card.winner-locked .scanner-laser-line {
    background: linear-gradient(90deg, transparent, #10b981, #059669, #10b981, transparent) !important;
    box-shadow: 0 0 10px #10b981 !important;
}

@keyframes scanLaserAnimation {
    0% {
        top: 5%;
    }
    50% {
        top: 95%;
    }
    100% {
        top: 5%;
    }
}

.scanner-username {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    word-break: break-all;
    transition: color 0.3s ease;
}

.digital-scanner-card.winner-locked .scanner-username {
    color: var(--winner-color) !important;
}
