/* ========================================
   VARIABLES CSS - DARK PURPLE THEME
   ======================================== */
:root {
    --blue-primary: #38bdf8;
    --blue-dark: #0ea5e9;
    --green-400: #4ade80;
    --red-danger: #ef4444;
    --red-critical: #dc2626;
    --gray-900: #111827;
    --gray-800: #1f2937;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-400: #9ca3af;
    --gray-300: #d1d5db;
    --gray-200: #e5e7eb;
    --white: #ffffff;
    --yellow-warning: #f59e0b;
    --blue-info: #3b82f6;
    --track-bg: #e9ecef;
    --track-active: linear-gradient(90deg, #4f46e5, #6366f1);
    --thumb-color: #ffffff;
    --thumb-border: #cbd5e1;
    --thumb-shadow: rgba(99, 102, 241, 0.25);
    --label-color: #1e293b;
    --badge-bg: #4f46e5;
    --badge-color: #ffffff;
}

/* ========================================
   BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--white);
    min-height: 100vh;
    font-weight: 400;
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

/* Después de body */
.container {
    max-width: 100% !important;
    padding-left: 20px;
    padding-right: 20px;
    width: 100%;
}

#welcome,
#game {
    width: 100%;
    max-width: 100%;
    padding: 0 20px;
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--white);
}

.welcome-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--blue-primary), var(--blue-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 2rem;
    animation: fadeIn 0.6s ease-out;
}

.panel-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--purple-light);
    margin-bottom: 1rem;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-custom {
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary-custom {
    background: linear-gradient(135deg, var(--blue-primary), var(--blue-dark));
    color: var(--white);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.btn-primary-custom:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

.btn-secondary-custom {
    background-color: var(--gray-700);
    color: var(--white);
}

.btn-secondary-custom:hover {
    background-color: var(--gray-600);
    transform: scale(1.03);
}

.btn-warning-custom {
    background: linear-gradient(135deg, var(--yellow-warning), #f59e0b);
    color: var(--gray-900);
}

.btn-warning-custom:hover {
    transform: scale(1.04);
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.5);
}

#save-settings {
    background: rgba(56, 189, 248, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid rgba(56, 189, 248, 0.3);
    box-shadow: 0 8px 32px rgba(56, 189, 248, 0.2);
    color: var(--blue-primary);
    font-weight: 700;
}

#save-settings:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: var(--blue-primary);
    box-shadow: 0 8px 32px rgba(56, 189, 248, 0.4);
    transform: scale(1.05);
}


/* ========================================
   MODAL
   ======================================== */

.modal-custom {
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 20px;
    color: var(--white);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.modal-header {
    border-bottom: 2px solid var(--gray-700);
    background: linear-gradient(135deg, var(--gray-800), var(--gray-900));
    border-radius: 20px 20px 0 0;
}

.modal-title {
    color: var(--blue-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.modal-footer {
    border-top: 2px solid var(--gray-700);
    background: var(--gray-900);
    border-radius: 0 0 20px 20px;
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background-color: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 14px;
    color: var(--white);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.3);
    cursor: pointer;
}

.card-body {
    padding: 1.5rem;
}

.card-selected {
    background: linear-gradient(135deg, var(--gray-800), var(--gray-900));
    border: 2px solid var(--purple-primary);
    padding: 20px;
    margin: 10px auto;
    width: 50%;
    text-align: center;
    border-radius: 14px;
    animation: slideInTop 0.4s ease-out;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

/* ========================================
   GAME ITEMS
   ======================================== */
.target-item,
.word-item {
    background-color: var(--gray-800);
    border: 2px solid var(--gray-700);
    padding: 12px;
    margin: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.target-item:hover,
.word-item:hover {
    border-color: var(--purple-light);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(167, 139, 250, 0.3);
}

.target-item img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.item-disabled {
    filter: grayscale(100%) brightness(0.6);
    pointer-events: none;
    opacity: 0.5;
}

.item-highlight {
    border-color: var(--purple-primary);
    box-shadow: 0 0 18px rgba(139, 92, 246, 0.7);
    transform: scale(1.03);
}

/* En styles.css - Agregar después de .item-highlight */

.target-item {
    scroll-margin: 20px;
    /* Espacio adicional al hacer scroll */
    transition: all 0.3s ease;
}

/* Efecto cuando se centra el item */
.target-item.item-highlight {
    border-color: var(--blue-primary);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.7);
    transform: scale(1.05);
    /* Agranda ligeramente */
    z-index: 10;
    /* Pone por encima de otros */
}

/* ========================================
   HEADER & STATUS BAR
   ======================================== */
.header {
    background: linear-gradient(135deg, var(--gray-800), var(--gray-900));
    border-bottom: 2px solid var(--gray-700);
    border-radius: 0 0 14px 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 1030;
}

.header-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-weight: 600;
}

#status-bar {
    background: linear-gradient(135deg, var(--gray-800), var(--gray-900));
    border-bottom: 1px solid var(--gray-700);
    z-index: 1020;
}

.timer-display {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--purple-light);
}

/* ========================================
   LIVES & PERKS
   ======================================== */
.lives .bi-heart-fill {
    color: var(--red-danger);
    margin-right: 5px;
    font-size: 1.5rem;
    animation: heartBeat 1s infinite;
}

@keyframes heartBeat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.perk-icon {
    cursor: pointer;
    padding: 8px 12px;
    background-color: var(--gray-800);
    border: 2px solid var(--gray-700);
    border-radius: 10px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.perk-icon:hover {
    border-color: var(--purple-primary);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.perk-icon i {
    font-size: 1.2rem;
}

.badge-custom {
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-dark));
    color: var(--white);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ========================================
   PROGRESS BARS
   ======================================== */
.progress-custom {
    width: 50%;
    margin: 0 auto;
    height: 20px;
    background-color: var(--gray-800);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--gray-700);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-bar-custom {
    height: 100%;
    transition: width 0.1s linear;
    border-radius: 8px;
}

.progress-bar-success {
    background: linear-gradient(90deg, var(--green-400), #22c55e);
}

.progress-bar-warning {
    background: linear-gradient(90deg, var(--yellow-warning), #f59e0b);
}

.progress-bar-danger {
    background: linear-gradient(90deg, var(--red-danger), var(--red-critical));
}
.progress-bar-frozen {
    background: linear-gradient(90deg, 
        var(--blue-primary), 
        #38bdf8, 
        #0ea5e9) !important;
    animation: frozen-pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.6),
                inset 0 0 10px rgba(56, 189, 248, 0.4);
}

@keyframes frozen-pulse {
    0%, 100% {
        filter: brightness(1);
        box-shadow: 0 0 20px rgba(56, 189, 248, 0.6);
    }
    50% {
        filter: brightness(1.3);
        box-shadow: 0 0 30px rgba(56, 189, 248, 0.9),
                    0 0 40px rgba(56, 189, 248, 0.5);
    }
}
/* Efecto de congelación en el perk activo */
.perk-icon.freeze-active {
    animation: freeze-shake 0.5s ease-in-out infinite;
    border-color: var(--blue-primary) !important;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.6) !important;
}

@keyframes freeze-shake {
    0%, 100% { transform: translateX(0) scale(1); }
    25% { transform: translateX(-2px) scale(1.05); }
    75% { transform: translateX(2px) scale(1.05); }
}

/* ========================================
   NOTIFICATIONS
   ======================================== */
.alert-card {
    position: fixed;
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    max-width: 420px;
    width: calc(100% - 40px);
    z-index: 2000;
    padding: 1rem 1.5rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.15), rgba(56, 189, 248, 0.1));
    border: 1.5px solid rgba(56, 189, 248, 0.4);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 8px 24px rgba(56, 189, 248, 0.25);
    animation: slideInTop 0.3s ease-out;
    transition: all 0.3s ease;
}

/* Apilamiento horizontal para múltiples alerts */
.alert-card:nth-child(1) {
    left: 50%;
    transform: translateX(-50%);
}
.alert-card:nth-child(2) {
    left: calc(50% + 230px);
    transform: translateX(-50%);
}
.alert-card:nth-child(3) {
    left: calc(50% - 230px);
    transform: translateX(-50%);
}
.alert-card:nth-child(4) {
    left: calc(50% + 460px);
    transform: translateX(-50%);
}

/* === VARIANTES === */

/* Éxito */
.alert-card--success {
    border-color: rgba(74, 222, 128, 0.6);
    background: linear-gradient(135deg,
        rgba(56, 189, 248, 0.2),
        rgba(74, 222, 128, 0.15));
    box-shadow: 0 8px 20px rgba(74, 222, 128, 0.2);
}

/* Advertencia leve (celeste dorado) */
.alert-card--warning {
    border-color: rgba(56, 189, 248, 0.6);
    background: linear-gradient(135deg,
        rgba(56, 189, 248, 0.25),
        rgba(59, 130, 246, 0.15));
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.25);
}

/* Error crítico (único rojo) */
.alert-card--error {
    border-color: var(--red-danger);
    background: linear-gradient(135deg,
        rgba(239, 68, 68, 0.2),
        rgba(220, 38, 38, 0.1));
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.25);
}

/* Información */
.alert-card--info {
    border-color: var(--blue-primary);
    background: linear-gradient(135deg,
        rgba(56, 189, 248, 0.3),
        rgba(14, 165, 233, 0.15));
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.25);
}

/* === ICONOS === */
.alert-card__icon {
    font-size: 1.8rem;
    font-weight: 700;
    min-width: 32px;
    text-align: center;
}

.alert-card--success .alert-card__icon {
    color: var(--green-400);
}
.alert-card--warning .alert-card__icon {
    color: var(--blue-primary);
}
.alert-card--error .alert-card__icon {
    color: var(--red-danger);
}
.alert-card--info .alert-card__icon {
    color: var(--blue-primary);
}

/* Reemplaza la definición duplicada que está al final del archivo */
.alert-card__body {
    flex: 1;
    font-weight: 600;
    color: var(--white); /* texto blanco */
    font-size: 0.95rem;
    /* text-shadow: 0 0 6px rgba(14,165,233,0.85); sombra azul */
}


/* === ANIMACIÓN === */
@keyframes slideInTop {
    0% {
        transform: translate(-50%, -30px);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}


/* Agregar después de .alert-card */

#persistent-pause-alert {
    animation: pulse 2s ease-in-out infinite;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95), rgba(55, 65, 81, 0.95));
    z-index: 2500; /* Más alto que otras notificaciones */
}

@keyframes pulse {
    0%, 100% {
        transform: translate(-50%, 0) scale(1);
        box-shadow: 0 10px 30px rgba(56, 189, 248, 0.25); /* azul */
    }
    50% {
        transform: translate(-50%, 0) scale(1.02);
        box-shadow: 0 15px 40px rgba(56, 189, 248, 0.45); /* azul */
    }
}

/* En styles.css */
.game-paused-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 1500;
    pointer-events: none;
    animation: fadeIn 0.3s ease-out;
}

/* Feedback Card - Mensajes de juego (apilamiento vertical desde top-right) */
.feedback-card {
    position: fixed;
    top: 2rem;
    right: 2rem;
    max-width: 320px;
    z-index: 1500;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    background: var(--gray-900);
    border: 2px solid var(--gray-700);
    color: var(--white);
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    animation: slideInRight 0.3s ease-out;
    transition: all 0.3s ease;
}

/* Apilamiento vertical para múltiples feedbacks */
.feedback-card:nth-child(1) {
    top: 2rem;
}

.feedback-card:nth-child(2) {
    top: calc(2rem + 60px);
}

.feedback-card:nth-child(3) {
    top: calc(2rem + 120px);
}

.feedback-card:nth-child(4) {
    top: calc(2rem + 180px);
}

.feedback-card:nth-child(5) {
    top: calc(2rem + 240px);
}

.feedback-card--correct {
    border-color: var(--green-400);
    background: linear-gradient(135deg,
            var(--gray-900),
            rgba(74, 222, 128, 0.1));
    color: var(--green-400);
}

.feedback-card--incorrect {
    border-color: var(--red-danger);
    background: linear-gradient(135deg,
            var(--gray-900),
            rgba(239, 68, 68, 0.1));
    color: var(--red-danger);
}

/* Animaciones */
@keyframes slideInTop {
    from {
        transform: translate(-50%, -100px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutTop {
    from {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    to {
        transform: translate(-50%, -100px);
        opacity: 0;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}





/* ========================================
   PROGRESS BARS
   ======================================== */
.progress-custom {
    width: 50%;
    margin: 0 auto;
    height: 20px;
    background-color: var(--gray-800);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--gray-700);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-bar-custom {
    height: 100%;
    transition: width 0.1s linear;
    border-radius: 8px;
}

.progress-bar-success {
    background: linear-gradient(90deg, var(--green-400), #22c55e);
}

.progress-bar-warning {
    background: linear-gradient(90deg, var(--yellow-warning), #f59e0b);
}

.progress-bar-danger {
    background: linear-gradient(90deg, var(--red-danger), var(--red-critical));
}

/* ========================================
   NOTIFICATIONS
   ======================================== */
.notification-card {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 520px;
    z-index: 9999;
    padding: 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
    border: 2px solid var(--gray-700);
    display: flex;
    gap: 12px;
    align-items: center;
    animation: slideInTop 0.28s ease-out;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.notification-card--success {
    border-color: var(--green-400);
}

.notification-card--info {
    border-color: var(--blue-info);
}

.notification-card--warning {
    border-color: var(--purple-light);
}

.notification-card--error {
    border-color: var(--red-danger);
}

.notification-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    flex-shrink: 0;
}

.notification-card__body {
    flex: 1;
    font-weight: 500;
    color: var(--white);
}

.notification-card__action {
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-dark));
    color: var(--white);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.notification-card__action:hover {
    transform: scale(1.05);
}

/* ========================================
   MODALS
   ======================================== */
.modal-custom {
    background: linear-gradient(135deg, var(--gray-800), var(--gray-900));
    border: 2px solid var(--gray-700);
    border-radius: 14px;
    color: var(--white);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.modal-header {
    border-bottom: 2px solid var(--gray-700);
}

.modal-footer {
    border-top: 2px solid var(--gray-700);
}

.btn-close-custom {
    filter: invert(1);
    opacity: 0.8;
}

.btn-close-custom:hover {
    opacity: 1;
}

/* Agregar después de los estilos de modales */

#vocab-checklist {
    max-height: calc(100vh - 400px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3 columnas iguales */
    gap: 10px;
    padding: 10px;
}

#vocab-checklist .list-group-item {
    margin-bottom: 0;
    /* Quitar margen porque usamos gap */
    padding: 10px;
}

/* Scrollbar personalizado para el checklist */
#vocab-checklist::-webkit-scrollbar {
    width: 8px;
}

#vocab-checklist::-webkit-scrollbar-track {
    background: var(--gray-800);
    border-radius: 10px;
}

#vocab-checklist::-webkit-scrollbar-thumb {
    background: var(--blue-primary);
    border-radius: 10px;
}

#vocab-checklist::-webkit-scrollbar-thumb:hover {
    background: var(--blue-dark);
}

/* Para Firefox */
#vocab-checklist {
    scrollbar-width: thin;
    scrollbar-color: var(--blue-primary) var(--gray-800);
}

/* ========================================
   LEFT PANEL
   ======================================== */


/* Agregar después de los estilos de #vocab-checklist */

#targets-container {
    max-height: calc(100vh - 350px);
    /* Altura dinámica basada en viewport */
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    padding: 10px;
    scroll-behavior: smooth;
}

/* Scrollbar personalizado para targets */
#targets-container::-webkit-scrollbar {
    width: 8px;
}

#targets-container::-webkit-scrollbar-track {
    background: var(--gray-800);
    border-radius: 10px;
}

#targets-container::-webkit-scrollbar-thumb {
    background: var(--blue-primary);
    border-radius: 10px;
}

#targets-container::-webkit-scrollbar-thumb:hover {
    background: var(--blue-dark);
}

/* Para Firefox */
#targets-container {
    scrollbar-width: thin;
    scrollbar-color: var(--blue-primary) var(--gray-800);
}



/* ========================================
   FORMS
   ======================================== */
.form-control-custom,
.form-select-custom {
    background-color: var(--gray-800);
    border: 2px solid var(--gray-700);
    border-radius: 10px;
    color: var(--white);
    padding: 10px 14px;
    transition: all 0.3s ease;
}

.form-control-custom:focus,
.form-select-custom:focus {
    background-color: var(--gray-700);
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 0.2rem rgba(139, 92, 246, 0.25);
    color: var(--white);
    outline: none;
}

.form-label {
    font-weight: 600;
    color: var(--purple-light);
    margin-bottom: 0.5rem;
}

.form-check-custom {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-check-input {
    width: 20px;
    height: 20px;
    cursor: pointer;
    border: 2px solid var(--gray-600);
    background-color: var(--gray-800);
}

.form-check-input:checked {
    background-color: var(--purple-primary);
    border-color: var(--purple-primary);
}


/* ========================================
   MODERN RANGE SLIDER
   ======================================== */

.form-range-custom {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--gray-200), var(--gray-300));
    border-radius: 999px;
    outline: none;
    cursor: pointer;
    position: relative;
    box-shadow:
        inset 0 1px 3px rgba(0, 0, 0, 0.1),
        inset 0 -1px 3px rgba(255, 255, 255, 0.6);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.form-range-custom:hover {
    background: linear-gradient(90deg, var(--gray-300), var(--gray-200));
}

/* ==== TRACK ==== */
.form-range-custom::-webkit-slider-runnable-track,
.form-range-custom::-moz-range-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
}

/* ==== THUMB - WebKit ==== */
.form-range-custom::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, var(--blue-primary), var(--blue-dark));
    border-radius: 50%;
    cursor: grab;
    box-shadow:
        0 2px 6px rgba(37, 99, 235, 0.4),
        0 0 0 3px rgba(255, 255, 255, 0.9);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-range-custom::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow:
        0 4px 10px rgba(37, 99, 235, 0.5),
        0 0 0 4px rgba(255, 255, 255, 0.9);
}

.form-range-custom::-webkit-slider-thumb:active {
    transform: scale(1.05);
    cursor: grabbing;
    box-shadow:
        0 3px 8px rgba(37, 99, 235, 0.4),
        0 0 0 5px rgba(255, 255, 255, 0.8);
}

/* ==== THUMB - Firefox ==== */
.form-range-custom::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-primary), var(--blue-dark));
    border: 2px solid var(--white);
    cursor: grab;
    box-shadow:
        0 2px 6px rgba(37, 99, 235, 0.4),
        0 0 0 2px rgba(255, 255, 255, 0.8);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-range-custom::-moz-range-thumb:hover {
    transform: scale(1.1);
}

.form-range-custom::-moz-range-thumb:active {
    transform: scale(1.05);
    cursor: grabbing;
}

/* ==== BADGE ==== */
.badge-custom {
    background: rgba(59, 130, 246, 0.9);
    color: var(--white);
    padding: 5px 10px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
    transition: all 0.25s ease-in-out;
}

.badge-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* ==== LABEL ==== */
#countdown-slider-group .form-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray-600);
    margin-bottom: 10px;
}

/* ========================================
   LOADING BAR
   ======================================== */

.loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    z-index: 3000;
    background: linear-gradient(90deg, var(--blue-primary), var(--blue-dark), var(--blue-primary));
    background-size: 400% 400%;
    animation: loadingAnimation 2s ease infinite;
}

@keyframes loadingAnimation {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ========================================
   LISTS
   ======================================== */
.list-group-custom .list-group-item {
    background-color: var(--gray-800);
    border: 1px solid var(--gray-700);
    color: var(--white);
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 10px;
}

/* ========================================
   TABS
   ======================================== */
.nav-tabs-custom {
    border-bottom: 2px solid var(--gray-700);
}

.nav-tabs-custom .nav-link {
    color: var(--gray-400);
    border: none;
    padding: 12px 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-tabs-custom .nav-link:hover {
    color: var(--purple-light);
}

.nav-tabs-custom .nav-link.active {
    color: var(--purple-primary);
    background: transparent;
    border-bottom: 3px solid var(--purple-primary);
}

/* ========================================
   OVERLAY & LOADING
   ======================================== */

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px) saturate(120%);
    -webkit-backdrop-filter: blur(12px) saturate(120%);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    background: linear-gradient(135deg,
            var(--gray-800) 0%,
            var(--gray-900) 50%,
            var(--gray-800) 100%);
    padding: 45px 55px 50px 55px;
    border-radius: 24px;
    backdrop-filter: blur(25px) saturate(150%);
    -webkit-backdrop-filter: blur(25px) saturate(150%);
    border: 1px solid var(--gray-700);
    border-top: 1px solid rgba(56, 189, 248, 0.3);
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.5),
        0 10px 20px rgba(56, 189, 248, 0.1),
        inset 0 1px 0 rgba(56, 189, 248, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.3);
    transform: translateY(0px) scale(1);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.loading-overlay.show .loader-container {
    transform: translateY(-5px) scale(1.02);
}

.loading-text {
    color: var(--white);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(90deg,
            rgba(56, 189, 248, 0.6) 0%,
            rgba(56, 189, 248, 1) 25%,
            var(--white) 50%,
            rgba(56, 189, 248, 1) 75%,
            rgba(56, 189, 248, 0.6) 100%);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer-text 2.5s ease-in-out infinite;
}

@keyframes shimmer-text {
    0% {
        background-position: -200% 0;
    }

    50% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.progress-bar {
    width: 320px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.25),
        0 1px 2px rgba(56, 189, 248, 0.1);
    position: relative;
    border: 1px solid var(--gray-700);
}

.progress-inner {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg,
            var(--blue-primary) 0%,
            var(--blue-dark) 50%,
            var(--blue-primary) 100%);
    border-radius: 12px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: pulse-glow 2s infinite alternate;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 5px rgba(56, 189, 248, 0.5);
    }

    100% {
        box-shadow: 0 0 20px rgba(56, 189, 248, 0.8),
            0 0 30px rgba(56, 189, 248, 0.4);
    }
}





/* ========================================
   FOOTER
   ======================================== */
.game-footer {
    background: linear-gradient(135deg, var(--gray-800), var(--gray-900));
    border-top: 2px solid var(--gray-700);
    border-radius: 14px 14px 0 0;
    color: var(--gray-400);
    font-weight: 500;
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInTop {
    from {
        transform: translate(-50%, -100px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

@keyframes slideOutTop {
    from {
        transform: translate(-50%, 0);
        opacity: 1;
    }

    to {
        transform: translate(-50%, -100px);
        opacity: 0;
    }
}

.fade-out {
    animation: fadeOut 1s forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}

/* ========================================
   FOOTER
   ======================================== */


/* Footer */
footer {
    position: relative;
    overflow: hidden;
    padding: 2rem 0;
    background: var(--gray-900);
    border-top: 1px solid var(--gray-700);
    margin-top: 3rem;
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--blue-primary);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) translateX(0);
    }

    50% {
        transform: translateY(-20px) translateX(10px);
    }
}

.bar-black {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--blue-primary), var(--blue-dark));
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.5);
}

.footer-bottom {
    position: relative;
    z-index: 2;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.copyright a {
    color: var(--gray-400);
    text-decoration: none;
    transition: color 0.3s ease;
}

.copyright a:hover {
    color: var(--blue-primary);
}

.lang-section {
    display: flex;
    gap: 0.5rem;
}

.lang-section button {
    padding: 0.5rem 1rem;
    background: var(--gray-800);
    border: 1px solid var(--gray-700);
    border-radius: 8px;
    color: var(--gray-400);
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-section button:hover {
    border-color: var(--blue-primary);
    color: var(--blue-primary);
}

.lang-section button.active {
    background: linear-gradient(135deg, var(--blue-primary), var(--blue-dark));
    border-color: var(--blue-primary);
    color: var(--white);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 767.98px) {

    #targets-container {
        max-height: 400px;
        /* Altura fija en móvil */
    }

    .progress-custom {
        width: 100%;
    }

    #game.main-mode .row {
        flex-direction: column;
    }

    #game.main-mode #left-panel {
        order: 2;
    }

    #game.main-mode #right-panel {
        order: 1;
    }

    #game.main-mode .col-md-4,
    #game.main-mode .col-md-8 {
        flex-basis: 100%;
        max-width: 100%;
    }

    .welcome-title {
        font-size: 1.8rem;
    }

    .btn-custom {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .loader-container {
        padding: 35px 40px;
    }

    .progress-bar {
        width: 260px;
    }

    .loading-text {
        font-size: 12px;
    }

    .alert-card {
        max-width: calc(100% - 40px);
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    .alert-card:nth-child(n+2) {
        top: calc(2rem + 70px * (var(--index) - 1));
    }

    .feedback-card {
        right: 1rem;
        left: 1rem;
        max-width: calc(100% - 2rem);
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.cursor-pointer {
    cursor: pointer;
}

.end-info {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--purple-light);
}

.end-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--green-400);
}