/* ================= VARIABLES & RESETS ================= */
:root {
    --bg-dark: #070512;
    --bg-card: rgba(20, 16, 45, 0.6);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-focus: rgba(255, 255, 255, 0.2);
    
    /* Neon Palettes */
    --accent: #ff0077;       /* Rosa de neón */
    --accent-glow: rgba(255, 0, 119, 0.4);
    --secondary: #00f2fe;    /* Celeste de neón */
    --secondary-glow: rgba(0, 242, 254, 0.3);
    --gold: #ffbe0b;         /* Amarillo/Dorado */
    --gold-glow: rgba(255, 190, 11, 0.3);
    --success: #00f5d4;      /* Verde menta */
    
    /* Text colors */
    --text-primary: #ffffff;
    --text-secondary: #c2c0d8;
    --text-muted: #807d9e;
    
    /* Transition defaults */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Montserrat', sans-serif;
}

body {
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at 50% 20%, #17123a 0%, var(--bg-dark) 70%);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* ================= AMBIENCE & DECORATION ================= */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background-image: url('background.jpg');
    background-repeat: repeat;
    background-size: 2000px auto;
    animation: move-bg 160s linear infinite;
    opacity: 0.55;
    filter: saturate(1.2);
}

@keyframes move-bg {
    from {
        background-position: 0 0;
    }
    to {
        background-position: 2000px 0;
    }
}

.star {
    position: absolute;
    background-color: #ffffff;
    border-radius: 50%;
    animation: pulse-star infinite alternate;
}

@keyframes pulse-star {
    0% { opacity: 0.2; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1.2); }
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.4;
    mix-blend-mode: screen;
}

.orb-1 {
    top: -10%;
    left: 10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
    animation: float-orb 20s infinite alternate;
}

.orb-2 {
    bottom: -10%;
    right: 10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    animation: float-orb 25s infinite alternate-reverse;
}

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

/* ================= GLOBAL LAYOUT & UTILITIES ================= */
.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 24px;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 90vh;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(25px) saturate(160%);
    -webkit-backdrop-filter: blur(25px) saturate(160%);
    border: 1px solid var(--border-glass);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: var(--transition-normal);
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5), 
                inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Views management */
.view-section {
    display: none;
    width: 100%;
    max-width: 500px;
    animation: fadeIn 0.5s var(--transition-normal);
}

.view-section.active {
    display: block;
}

#view-wheel {
    max-width: 700px;
}

#view-admin {
    max-width: 1000px;
    width: 100%;
}

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

/* ================= BUTTONS ================= */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    overflow: hidden;
    text-decoration: none;
    letter-spacing: 0.5px;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, #0072ff 100%);
    color: #070512;
    box-shadow: 0 4px 20px var(--secondary-glow);
    font-weight: 700;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 242, 254, 0.5);
}

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

.btn-accent {
    background: linear-gradient(135deg, var(--accent) 0%, #b200ff 100%);
    color: #ffffff;
    box-shadow: 0 4px 20px var(--accent-glow);
    font-weight: 700;
}

.btn-accent:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 0, 119, 0.6);
}

.btn-accent:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-glass-focus);
    color: var(--text-primary);
}

.btn-outline:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-primary);
}

.btn-danger {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 75, 43, 0.2);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(255, 75, 43, 0.4);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 8px;
}

.btn-large {
    padding: 16px 36px;
    font-size: 18px;
    border-radius: 14px;
}

/* Button shine effect */
.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: skewX(-25deg);
    transition: 0.75s;
    pointer-events: none;
}

.btn:hover .btn-shine {
    left: 125%;
    transition: 0.75s ease-in-out;
}

/* ================= FORMS & INPUTS ================= */
.input-group {
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.input-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    font-size: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    color: #ffffff;
    font-size: 16px;
    transition: var(--transition-fast);
}

.input-wrapper input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 15px var(--secondary-glow);
    background: rgba(0, 0, 0, 0.4);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

/* ================= MESSAGES & ALERTS ================= */
.alert-message {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin-top: 16px;
    line-height: 1.4;
    text-align: left;
}

.error-message {
    background: rgba(255, 75, 43, 0.1);
    border: 1px solid rgba(255, 75, 43, 0.3);
    color: #ff6b6b;
}

.success-message {
    background: rgba(0, 245, 212, 0.1);
    border: 1px solid rgba(0, 245, 212, 0.3);
    color: var(--success);
}

.hidden {
    display: none !important;
}

/* ================= VISTA 1: LOGIN CARD ================= */
.login-card {
    text-align: center;
}

.logo-area {
    margin-bottom: 24px;
}

.logo-icon {
    font-size: 40px;
    margin-bottom: 8px;
    display: inline-block;
    animation: pulse-slow 3s infinite ease-in-out;
}

@keyframes pulse-slow {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(255,255,255,0.2)); }
    50% { transform: scale(1.08); filter: drop-shadow(0 0 10px var(--secondary-glow)); }
}

.login-card h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 32px;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(to right, #ffffff, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-sub {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 6px;
    color: var(--secondary);
    text-transform: uppercase;
    margin-top: -2px;
    margin-left: 6px;
}

.login-card h2 {
    font-size: 20px;
    color: var(--text-primary);
    margin-bottom: 12px;
    font-weight: 600;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 30px;
}

.info-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.info-footer p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Float Admin toggle button */
.admin-toggle-btn {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-fast);
}

.admin-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: var(--secondary);
    box-shadow: 0 0 15px var(--secondary-glow);
}

/* ================= VISTA 2: LA RULETA GAME AREA ================= */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 32px;
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-glass);
    padding: 16px 24px;
    border-radius: 16px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    font-size: 24px;
    background: rgba(255, 255, 255, 0.08);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.user-email {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    display: block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-badge {
    font-size: 11px;
    color: var(--secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spin-counter-container {
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 8px 20px;
    border: 1px dashed rgba(255, 255, 255, 0.15);
}

.spin-counter-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.spin-counter-number {
    font-size: 26px;
    font-weight: 900;
    color: var(--gold);
    text-shadow: 0 0 10px var(--gold-glow);
    font-family: 'Outfit', sans-serif;
}

.btn-logout {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 8px 12px;
    border-radius: 8px;
}

.btn-logout:hover {
    color: #ff6b6b;
    background: rgba(255, 75, 43, 0.08);
}

/* Wheel container layout */
.wheel-main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.wheel-outer-wrapper {
    position: relative;
    padding: 10px;
    background: radial-gradient(circle, #241e54 0%, #0d0a22 100%);
    border-radius: 50%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 
                0 0 0 10px rgba(255, 255, 255, 0.05),
                0 0 40px rgba(100, 80, 255, 0.25);
    display: flex;
    justify-content: center;
    align-items: center;
}

.wheel-viewport {
    position: relative;
    width: 550px;
    height: 550px;
    border-radius: 50%;
    overflow: visible;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Canvas standard size */
#wheel-canvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: block;
}

/* Central spin button */
.wheel-center-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 116px;
    height: 116px;
    border-radius: 50%;
    background: radial-gradient(circle, #1a163a 0%, #08061a 100%);
    border: 5px solid #ffffff;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6),
                inset 0 0 15px rgba(255, 255, 255, 0.1),
                0 0 20px rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wheel-center-button::after {
    content: '';
    position: absolute;
    top: -5px; left: -5px; right: -5px; bottom: -5px;
    border-radius: 50%;
    border: 5px solid var(--secondary);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.wheel-center-button:hover:not(:disabled) {
    transform: translate(-50%, -50%) scale(1.06);
    box-shadow: 0 12px 30px rgba(0, 242, 254, 0.4),
                inset 0 0 10px rgba(255, 255, 255, 0.2),
                0 0 30px rgba(0, 242, 254, 0.3);
    border-color: #ffffff;
}

.wheel-center-button:hover:not(:disabled)::after {
    opacity: 1;
    animation: pulse-ring 1.5s infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.2); opacity: 0; }
}

.wheel-center-button:active:not(:disabled) {
    transform: translate(-50%, -50%) scale(0.95);
}

.wheel-center-button:disabled {
    cursor: not-allowed;
    background: radial-gradient(circle, #2d2b38 0%, #1c1b24 100%);
    border-color: #4e4c5a;
    box-shadow: none;
}

.wheel-center-button:disabled .spin-text-main {
    color: var(--text-muted);
}

.wheel-center-button:disabled .spin-text-sub {
    color: rgba(255, 255, 255, 0.15);
}

.spin-text-main {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 1px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    margin-top: 4px;
}

.spin-text-sub {
    font-size: 9px;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* Pulsing effect when spins are available */
.wheel-center-button.pulse-active:not(:disabled) {
    animation: pulse-glow-btn 2s infinite ease-in-out;
}

@keyframes pulse-glow-btn {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6),
                    0 0 15px var(--secondary-glow);
    }
    50% {
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6),
                    0 0 35px rgba(0, 242, 254, 0.6);
        border-color: var(--secondary);
    }
}

/* INDICADOR EN FORMATO FLECHA EN LA PARTE SUPERIOR (Petición explícita del usuario) */
.pointer-container-top {
    position: absolute;
    top: -15px; /* Superpuesto al borde exterior superior */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.pointer-arrow {
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    /* Flecha apuntando hacia abajo, por lo tanto usamos borde superior de color */
    border-top: 32px solid var(--accent);
    filter: drop-shadow(0 0 8px var(--accent-glow));
    transition: transform 0.1s ease;
    transform-origin: top center;
}

/* Pinza golpeando los pines de la ruleta (animación de rebote) */
.pointer-arrow.tick {
    transform: rotate(-12deg);
}

.pointer-glow {
    width: 12px;
    height: 12px;
    background-color: var(--accent);
    border-radius: 50%;
    margin-bottom: -4px; /* Pegado al borde superior de la flecha */
    box-shadow: 0 0 15px 5px var(--accent);
    opacity: 0.8;
    z-index: 2;
}

/* Instrucciones */
.wheel-instructions {
    text-align: center;
    padding: 20px 40px;
    max-width: 500px;
    width: 100%;
}

.wheel-instructions h3 {
    font-size: 18px;
    margin-bottom: 6px;
    font-weight: 700;
}

.wheel-instructions p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ================= VISTA 3: PANEL DE ADMINISTRACIÓN ================= */
.admin-card {
    padding: 0; /* Controlado por las sub-vistas */
    overflow: hidden;
    width: 100%;
}

.admin-subview {
    display: none;
}

.admin-subview.active {
    display: block;
}

/* Login Admin */
#admin-login-subview {
    padding: 40px;
    max-width: 450px;
    margin: 0 auto;
}

.admin-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.admin-login-header h2 {
    font-size: 24px;
    font-weight: 700;
}

.admin-login-header p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.btn-back-link {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 24px;
    cursor: pointer;
    text-decoration: underline;
    display: block;
    width: 100%;
    text-align: center;
}

.btn-back-link:hover {
    color: var(--text-primary);
}

/* Dashboard Admin */
#admin-dashboard-subview {
    padding: 32px;
}

.admin-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.admin-dashboard-header h2 {
    font-size: 26px;
    font-weight: 800;
}

.admin-user-active {
    font-size: 13px;
    color: var(--text-secondary);
}

.text-accent {
    color: var(--secondary);
    font-weight: 600;
}

.admin-actions-header {
    display: flex;
    gap: 12px;
}

/* Tabs */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 12px;
    overflow-x: auto;
}

.admin-tab-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.admin-tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.admin-tab-btn.active {
    background: rgba(0, 242, 254, 0.1);
    border-color: var(--secondary);
    color: var(--secondary);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}

/* Tab contents */
.admin-tab-content {
    display: none;
}

.admin-tab-content.active {
    display: block;
    animation: fadeIn 0.4s var(--transition-normal);
}

.tab-actions {
    margin-bottom: 20px;
}

.tab-actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.tab-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Admin Form Inline */
.admin-inline-form {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 16px;
    background: rgba(0, 0, 0, 0.15);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 24px;
    align-items: end;
}

@media (max-width: 650px) {
    .admin-inline-form {
        grid-template-columns: 1fr;
    }
}

.admin-inline-form .input-group {
    margin-bottom: 0;
}

.admin-inline-form input {
    width: 100%;
    padding: 11px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: #ffffff;
    font-size: 15px;
}

.admin-inline-form input:focus {
    outline: none;
    border-color: var(--secondary);
}

.mt-4 {
    margin-top: 24px;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-glass);
    background: rgba(0, 0, 0, 0.15);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
}

.admin-table th {
    background: rgba(255, 255, 255, 0.03);
    padding: 14px 20px;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-glass);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.admin-table td {
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

.empty-table-msg {
    text-align: center;
    color: var(--text-muted);
    padding: 30px !important;
}

/* Spinner Adjust Buttons */
.spin-adjust-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    margin: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.spin-adjust-btn:hover {
    background: var(--secondary);
    color: #070512;
    border-color: var(--secondary);
}

.spin-count-display {
    font-weight: 700;
    font-size: 15px;
    display: inline-block;
    min-width: 24px;
    text-align: center;
}

.badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge-success {
    background: rgba(0, 245, 212, 0.15);
    color: var(--success);
}

.badge-warning {
    background: rgba(255, 190, 11, 0.15);
    color: var(--gold);
}

/* ================= MODAL: ¡ENHORABUENA / PREMIO! ================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 5, 18, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    max-width: 450px;
    width: 100%;
    text-align: center;
    position: relative;
    z-index: 10;
    border-color: rgba(255, 255, 255, 0.15);
    background: radial-gradient(circle at 50% 0%, #20174c 0%, #0d0a21 100%);
    box-shadow: 0 0 50px rgba(255, 0, 119, 0.2), 
                0 30px 60px rgba(0, 0, 0, 0.7);
}

.modal-glow {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    box-shadow: inset 0 0 40px rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    pointer-events: none;
}

.modal-emoji {
    font-size: 64px;
    margin-bottom: 16px;
    animation: bounce 1.5s infinite;
}

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

.modal-content h2 {
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.modal-sub {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 24px;
}

.prize-badge-container {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    position: relative;
    overflow: hidden;
}

.prize-badge-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.prize-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--secondary);
    text-shadow: 0 0 15px var(--secondary-glow);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-footer-info {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 30px;
}

/* Confetti canvas */
.confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

/* Animation classes */
.animate-pop {
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
    0% { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ================= RESPONSIVE ADJUSTMENTS ================= */
@media (max-width: 600px) {
    .app-container {
        padding: 16px;
    }
    
    .glass-card {
        padding: 24px;
    }
    
    .wheel-viewport {
        width: 320px;
        height: 320px;
    }
    
    .wheel-center-button {
        width: 80px;
        height: 80px;
        border-width: 3px;
    }
    
    .spin-text-main {
        font-size: 13px;
    }
    
    .spin-text-sub {
        font-size: 8px;
    }
    
    .pointer-arrow {
        border-left-width: 12px;
        border-right-width: 12px;
        border-bottom-width: 22px;
    }
    
    .game-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
        text-align: center;
    }
    
    .user-info {
        justify-content: center;
    }
    
    .btn-logout {
        justify-content: center;
    }
    
    .admin-dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .admin-actions-header {
        justify-content: space-between;
    }
}

/* ================= CAJA DE REGALO Y REVELACIÓN DE PREMIO ================= */
.gift-box-container {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.gift-box {
    position: relative;
    width: 90px;
    height: 90px;
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.5s ease, filter 0.5s ease;
    z-index: 3;
    animation: bounce-box 2.5s infinite ease-in-out;
}

@keyframes bounce-box {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.02); }
}

.gift-box-body {
    position: absolute;
    bottom: 0;
    left: 5px;
    width: 80px;
    height: 70px;
    background: linear-gradient(135deg, var(--accent) 0%, #a0004c 100%);
    border-radius: 4px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.gift-box-lid {
    position: absolute;
    top: 10px;
    left: 0;
    width: 90px;
    height: 16px;
    background: linear-gradient(135deg, var(--accent) 0%, #b80057 100%);
    border-radius: 3px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    z-index: 4;
    transition: transform 0.7s cubic-bezier(0.25, 0.8, 0.25, 1.4), opacity 0.4s ease;
}

.gift-box-ribbon-v {
    position: absolute;
    top: 10px;
    left: 41px;
    width: 8px;
    height: 80px;
    background: var(--gold);
    z-index: 5;
    transition: transform 0.7s ease, opacity 0.4s ease;
}

.gift-box-ribbon-h {
    position: absolute;
    top: 38px;
    left: 5px;
    width: 80px;
    height: 8px;
    background: var(--gold);
    z-index: 2;
    transition: opacity 0.3s ease;
}

.gift-prize-reveal {
    position: absolute;
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: scale(0.1) translateY(20px);
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.3s, opacity 0.8s ease 0.3s;
    z-index: 10;
}

.prize-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 15px var(--secondary-glow));
    animation: float-prize 3s infinite ease-in-out 1.2s;
}

@keyframes float-prize {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.03); }
}

/* Estado ABIERTO de la caja */
.gift-box-container.open .gift-box-lid {
    transform: translateY(-50px) rotate(-18deg) scale(0.8);
    opacity: 0;
}

.gift-box-container.open .gift-box-ribbon-v {
    transform: translateY(-50px) rotate(-18deg) scale(0.8);
    opacity: 0;
}

.gift-box-container.open .gift-box-ribbon-h {
    opacity: 0;
}

.gift-box-container.open .gift-box {
    transform: scale(0.6) translateY(10px);
    opacity: 0;
    filter: blur(5px);
    pointer-events: none;
    animation: none; /* Desactivar rebote al abrir */
}

.gift-box-container.open .gift-prize-reveal {
    opacity: 1;
    transform: scale(1.3) translateY(-15px);
}

/* ================= SELECCIÓN DE CATEGORÍAS (PÁGINA INICIAL) ================= */
.category-card {
    max-width: 750px;
    margin: 0 auto;
}

.category-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 40px;
}

.category-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid var(--border-glass);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    outline: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.category-circle:hover {
    transform: translateY(-8px) scale(1.05);
}

.category-circle:active {
    transform: translateY(-2px) scale(0.98);
}

/* Colores y brillos por categoría */
.circle-blue {
    border-color: rgba(59, 130, 246, 0.4);
}
.circle-blue:hover {
    border-color: #3b82f6;
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.6), inset 0 0 15px rgba(59, 130, 246, 0.2);
}

.circle-cyan {
    border-color: rgba(0, 242, 254, 0.4);
}
.circle-cyan:hover {
    border-color: var(--secondary);
    box-shadow: 0 0 25px var(--secondary-glow), inset 0 0 15px rgba(0, 242, 254, 0.2);
}

.circle-purple {
    border-color: rgba(139, 92, 246, 0.4);
}
.circle-purple:hover {
    border-color: #8b5cf6;
    box-shadow: 0 0 25px rgba(139, 92, 246, 0.6), inset 0 0 15px rgba(139, 92, 246, 0.2);
}

.circle-icon {
    font-size: 44px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

.category-circle:hover .circle-icon {
    transform: scale(1.15);
}

.circle-title {
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    max-width: 140px;
    text-align: center;
    line-height: 1.4;
}

/* Botón de volver atrás */
.btn-back-link-left {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
    margin-bottom: 20px;
    text-decoration: none;
}

.btn-back-link-left:hover {
    color: #ffffff;
}

.btn-back-link-left svg {
    transition: transform var(--transition-fast);
}

.btn-back-link-left:hover svg {
    transform: translateX(-3px);
}

/* Badges de Categoría */
.active-category-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(0, 242, 254, 0.08);
    border: 1px solid var(--secondary);
    color: var(--secondary);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}

.wheel-active-title {
    text-align: center;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px var(--secondary-glow);
}

/* Estilos de formulario administrador de 3 columnas */
.admin-inline-form-three {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr auto;
    gap: 16px;
    background: rgba(0, 0, 0, 0.15);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    margin-bottom: 24px;
    align-items: end;
}

.admin-inline-form-three select {
    width: 100%;
    padding: 11px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: #ffffff;
    font-size: 15px;
    outline: none;
    transition: var(--transition-fast);
}

.admin-inline-form-three select:focus {
    border-color: var(--secondary);
}

.admin-inline-form-three input {
    width: 100%;
    padding: 11px 14px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: #ffffff;
    font-size: 15px;
    outline: none;
}

.admin-inline-form-three input:focus {
    border-color: var(--secondary);
}

.text-center {
    text-align: center !important;
}

/* Responsividad para círculos */
@media (max-width: 600px) {
    .category-grid {
        gap: 16px;
    }
    .category-circle {
        width: 130px;
        height: 130px;
        gap: 8px;
    }
    .circle-icon {
        font-size: 32px;
    }
    .circle-title {
        font-size: 9px;
        max-width: 110px;
    }
    .admin-inline-form-three {
        grid-template-columns: 1fr;
    }
}

/* ================= COMPLEMENTOS EDICIÓN DE PREMIOS ================= */
.admin-table input[type="text"].prize-text-input {
    width: 100%;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
    transition: var(--transition-fast);
}

.admin-table input[type="text"].prize-text-input:focus {
    border-color: var(--secondary);
    background: rgba(0, 0, 0, 0.45);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.15);
}

.admin-table select.prize-type-select,
.admin-table select.prize-icon-select {
    width: 100%;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    color: #ffffff;
    font-size: 13.5px;
    outline: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.admin-table select.prize-type-select:focus,
.admin-table select.prize-icon-select:focus {
    border-color: var(--secondary);
    background: rgba(0, 0, 0, 0.45);
}

/* Estilo para opciones de selectores en navegadores */
.admin-table select option {
    background-color: var(--bg-dark);
    color: #ffffff;
}

/* ================= BOTÓN DE CONTROL DE MÚSICA ================= */
.music-toggle-btn {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 100;
    background: rgba(25, 20, 50, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.music-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: var(--secondary);
    box-shadow: 0 0 15px var(--secondary-glow);
    transform: scale(1.08);
}

.music-toggle-btn.playing {
    border-color: var(--success);
    box-shadow: 0 0 15px rgba(0, 245, 212, 0.4);
    animation: rotate-music 8s linear infinite;
    color: var(--success);
}

.music-icon {
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes rotate-music {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .music-toggle-btn {
        bottom: 16px;
        left: 16px;
        width: 40px;
        height: 40px;
    }
    .music-icon {
        font-size: 15px;
    }
}
