/* ==========================================================================
   1. VARIABLES Y TEMAS
   ========================================================================== */
:root {
    /* Conservo tus colores originales */
    --primary: #1a252f;
    --accent: #d35400;
    --success: #1e8449;
    --danger: #c0392b;
    --warning: #FFD41C;
    --bg: #f4f7f6;
    --gray: #444444;
    --white: #ffffff;
    --card-bg: #ffffff;
    --toggle-bg: #eeeeee;
    --purple: #8e44ad;
    --pink: #E4007C;
    --lightgray: lightgray;

    /* MODERNIZACIÓN: Añadimos capas y bordes sutiles */
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --radius-md: 12px;
    --radius-lg: 20px;

    /* Tipografía - Optimizada */
    --fs-title-1: 2.5rem;
    --fs-title-2: 2rem;
    --fs-title-3: 1.5rem;
    --fs-subtitle: 1.25rem;
    --fs-normal: 1rem;
    --fs-small: 0.875rem;
    --fs-extra-small: 0.75rem;

    --fw-normal: 400;
    --fw-medium: 600;
    --fw-bold: 700;
    --fw-extra-bold: 800;
}

body.dark-mode {
    --bg: #0d1117; /* Un negro azulado es más moderno que el #000 puro */
    --primary: #f0f6fc;
    --white: #161b22;  
    --gray: #8b949e;
    --success: #2ecc71;
    --accent: #f39c12;
    --card-bg: #161b22;
    --toggle-bg: #21262d;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.5);
}

/* ==========================================================================
   2. ESTILOS BASE Y ESTRUCTURA
   ========================================================================== */
body {
    font-family: 'Inter', 'Segoe UI', Roboto, -apple-system, sans-serif; /* Inter es más moderna */
    background-color: var(--bg);
    color: var(--primary);
    margin: 0;
    padding: 0; /* Quitamos el padding del body para que el Header pegue arriba */
    line-height: 1.6; /* Mejor legibilidad */
    -webkit-font-smoothing: antialiased; /* Suavizado de fuente pro */
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden; /* Seguridad para el truco del header 100vw */
}

/* El contenedor ahora respira mejor */
.container { 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 0 20px; /* El padding se lo damos al contenido, no al body */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   HEADER EN HORIZONTAL (VERSION BASE MANTENIDA)
   ========================================================================== */

.main-header {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-top: -10px !important; 
    top: 0;
    z-index: 9999;
    background-color: var(--white);
    border-bottom: 1px solid #eee; /* Línea modo claro */
    min-height: 95px; 
    display: flex;
    align-items: center; 
    justify-content: center;
    box-sizing: border-box;
}

/* --- SUAVIZADO DE LÍNEA EN MODO OSCURO --- */
body.dark-mode .main-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important; /* Más tenue */
}

.header-container-centered {
    position: relative;
    display: flex;
    align-items: center; 
    justify-content: center; 
    width: 100%;
    max-width: 1400px;
    padding: 0 40px;
    height: 100%;
    padding-top: 0; 
}

.header-left {
    position: absolute;
    left: 40px;
    top: 50%; 
    transform: translateY(-50%); 
    display: flex;
    align-items: center;
    max-width: 25%;
}

.logo-img {
    height: auto;
    max-height: 70px; 
    width: 100%;
    object-fit: contain; 
    display: block;
    margin: 8px 0 0 0 !important; 
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.header-title {
    margin: 0 !important;
    font-size: 1.85rem; 
    font-weight: 800;
    text-align: center;
    line-height: 1.2; 
    color: var(--primary);
}

.header-right {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

.lema {
    margin: 0 !important;
    font-size: 0.95rem;
    color: var(--primary);
    font-weight: 400;
    white-space: nowrap;
}

/* --- AJUSTES EXCLUSIVOS PARA CELULAR (LOGO EXTRA GRANDE + TEXTOS PEGADOS) --- */
@media (max-width: 900px) {
    .main-header {
        margin-top: 0 !important; 
        min-height: auto;
        padding: 15px 0 10px; 
    }

    .header-container-centered {
        flex-direction: column;
        gap: 2px; 
        padding: 0 15px;
    }

    .header-left, .header-right {
        position: static; 
        transform: none; 
        justify-content: center;
        max-width: 100%;
        width: 100%;
    }

    .logo-img {
        max-height: 120px; 
        width: auto;
        margin: 0 !important; 
    }

    .header-title {
        font-size: 1.5rem;
        order: 2;
        line-height: 1; 
        margin-top: 0 !important;
    }

    .header-left {
        order: 1; 
        margin-bottom: 0 !important; 
    }

    .header-right {
        order: 3;
        margin-top: -2px !important; 
    }

    .lema {
        font-size: 0.85rem;
    }
}
/* ==========================================================================
   3. LAYOUT DE TARJETAS (COMPETICIONES Y GENERAL)
   ========================================================================== */
.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px; /* Un poco más de aire entre tarjetas */
    width: 100%;
    margin: 30px auto;
}

.card {
    background: var(--card-bg);
    border-radius: 20px; /* Redondeado más moderno, igual que los gliders */
    padding: 20px;       /* Un poco más de espacio interno */
    
    /* Sombra suave y multicapa */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05), 
                0 1px 3px rgba(0,0,0,0.02);
    
    /* En lugar de un borde grueso, usamos uno sutil que brilla */
    border: 1px solid rgba(0,0,0,0.05);
    border-left: 5px solid var(--accent); 
    
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    background-clip: padding-box;
}

.card:hover { 
    transform: translateY(-6px); 
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border-color: rgba(0,0,0,0.1);
}

/* Efecto de brillo sutil al pasar el mouse */
.card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

/* Tipografía dentro de la card */
.card h3 {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-color);
}

.card p {
    margin: 4px 0;
    font-size: 0.95rem;
    color: #666; /* Texto secundario más suave */
    line-height: 1.5;
}

/* Contenedor de iconos mejorado */
.event-icons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 15px 0;
    padding: 12px;
    background: rgba(0,0,0,0.03); /* Fondo más sutil */
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.02);
}

.event-icons-container img {
    width: 24px;
    height: 24px;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.event-icons-container img:hover { 
    transform: translateY(-3px) scale(1.15); 
    opacity: 1;
}

/* Ajuste Dark Mode */
body.dark-mode .card {
    background: #1e1e1e;
    border-color: rgba(255,255,255,0.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

body.dark-mode .card p {
    color: #aaa;
}

body.dark-mode .event-icons-container {
    background: rgba(255,255,255,0.05);
}

/* SVG de eventos en tarjetas (aplica el filtro en modo oscuro) */
.card img[src*="cdn.jsdelivr.net/gh/cubing/icons"],
.card img[alt*="333"],
.card img[alt*="222"],
.card img[alt*="444"],
.card img[alt*="555"],
.card img[alt*="666"],
.card img[alt*="777"],
.card img[alt*="333oh"],
.card img[alt*="clock"],
.card img[alt*="minx"],
.card img[alt*="pyram"],
.card img[alt*="skewb"],
.card img[alt*="sq1"],
.card img[alt*="333bf"],
.card img[alt*="444bf"],
.card img[alt*="555bf"],
.card img[alt*="333mbf"],
.card img[alt*="333fm"] {
    transition: filter 0.3s ease;
}

body.dark-mode .card img[src*="cdn.jsdelivr.net/gh/cubing/icons"],
body.dark-mode .card img[alt*="333"],
body.dark-mode .card img[alt*="222"],
body.dark-mode .card img[alt*="444"],
body.dark-mode .card img[alt*="555"],
body.dark-mode .card img[alt*="666"],
body.dark-mode .card img[alt*="777"],
body.dark-mode .card img[alt*="333oh"],
body.dark-mode .card img[alt*="clock"],
body.dark-mode .card img[alt*="minx"],
body.dark-mode .card img[alt*="pyram"],
body.dark-mode .card img[alt*="skewb"],
body.dark-mode .card img[alt*="sq1"],
body.dark-mode .card img[alt*="333bf"],
body.dark-mode .card img[alt*="444bf"],
body.dark-mode .card img[alt*="555bf"],
body.dark-mode .card img[alt*="333mbf"],
body.dark-mode .card img[alt*="333fm"] {
    filter: brightness(0) invert(1) !important;
}



/* ==========================================================================
   4. SISTEMA DE GLIDERS (SWITCHES)
   ========================================================================== */
/* Contenedor general */
.toggle-main-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0;
    width: 100%;
}

/* Wrapper: Mantengo tu ancho de 240px y altura de 42px */
.switch-wrapper {
    width: 240px;
    height: 42px;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    position: relative;
    border-radius: 12px; /* Estilo moderno 'squircle' */
    border: 1px solid #ddd;
    background: var(--toggle-bg) !important;
    cursor: pointer;
    overflow: hidden; /* Tu regla para que el glider no se salga */
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05); /* Toque moderno: profundidad */
}

/* Gliders: Agrupados con tus IDs originales */
#switch-glider, #rank-glider, #eventos-glider, #calc-glider, #acc-glider {
    position: absolute;
    top: 4px;
    left: 4px; /* Ajustado para simetría */
    width: calc(50% - 8px);
    height: calc(100% - 8px);
    border-radius: 10px;
    z-index: 1;
    background: white; /* O var(--lightgray) si lo prefieres */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Elevación moderna */
    box-shadow: 0 3px 8px rgba(0,0,0,0.12), 0 1px 3px rgba(0,0,0,0.08);
}

/* Botones: Mantengo el flex: 1 y peso 800 */
.btn-switch {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent !important;
    font-weight: 800;
    z-index: 2;
    position: relative;
    cursor: pointer;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #444; /* Un poco más suave que negro puro */
    transition: color 0.3s ease;
}

/* Soporte Dark Mode original */
body.dark-mode .switch-wrapper {
    border-color: #444;
    background: #222 !important;
}

body.dark-mode #switch-glider, 
body.dark-mode #rank-glider, 
body.dark-mode #eventos-glider, 
body.dark-mode #calc-glider, 
body.dark-mode #acc-glider {
    background: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .btn-switch {
    color: white;
}

/* ==========================================================================
   5. TABS E ICONOS (Récords) - Versión Minimalista
   ========================================================================== */

.tabs-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 25px auto;
    padding: 10px 15px;
    max-width: fit-content; /* Se ajusta al ancho de los iconos */
    border-radius: 12px;
    background-color: var(--white);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* Icono Base */
.tab-icon {
    width: 32px;
    height: 32px;
    padding: 6px;
    cursor: pointer;
    border-radius: 8px;
    /* Borde sutil por defecto para definir la forma */
    border: 1px solid rgba(0,0,0,0.05) !important; 
    background: transparent;
    opacity: 0.4;
    filter: grayscale(1);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Reset de interacciones en móvil */
    outline: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hover: Feedback visual al pasar el mouse */
.tab-icon:hover {
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.03);
    transform: translateY(-1px);
}

/* Estado Activo: El icono seleccionado */
.tab-icon.active { 
    opacity: 1; 
    filter: grayscale(0) !important;
    transform: translateY(-3px) scale(1.1); /* Efecto de elevación */
    
    /* Usamos tu color accent para el borde y un fondo suave */
    border-color: var(--accent) !important; 
    background: rgba(211, 84, 0, 0.08) !important; 
    box-shadow: 0 4px 10px rgba(211, 84, 0, 0.15);
}

/* --- MODO OSCURO --- */
body.dark-mode .tabs-container {
    background-color: var(--card-bg);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .tab-icon { 
    filter: grayscale(0) brightness(1) invert(1);
    border-color: rgba(255, 255, 255, 0.05) !important;
}

body.dark-mode .tab-icon.active { 
    background: lightgray !important;
    border-color: var(--accent) !important;
    filter: invert(1) !important; /* Recupera los colores del cubo original */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Limpieza final de estados Focus/Active */
.tab-icon:active,
.tab-icon:focus {
    outline: none !important;
    box-shadow: none !important;
    background: rgba(0, 0, 0, 0.05) !important;
}

/* ==========================================================================
   6. TABLAS Y RANKINGS
   ========================================================================== */

.table-container { 
    width: 100%; 
    overflow-x: auto; 
    border-radius: 16px;
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important;
    margin-top: 10px;
}

#rankings-table { 
    width: 100%; 
    border-collapse: collapse; 
    color: var(--primary) !important; 
    font-size: 0.95rem;
}

/* Cabecera limpia */
#rankings-table thead tr { 
    background-color: transparent !important; 
    color: var(--primary) !important; 
    border-bottom: 2px solid var(--border-color);
}

#rankings-table th { 
    padding: 18px 15px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    font-size: 0.75rem; 
    font-weight: 800;
}

#rankings-table td { 
    padding: 14px 15px; 
    border-bottom: 1px solid var(--border-color); 
}

/* Efecto cebra muy sutil (gris neutro) */
#rankings-table tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

/* Récord Maestro - Eliminados los fondos de color */
#master-record-display {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: transparent; /* Fondo quitado */
    border-bottom: 1px solid var(--border-color); /* Separador discreto */
}

#master-record-display b {
    font-family: 'Inter', 'Monaco', monospace;
    font-size: 2.2rem;
    color: var(--primary); /* Cambiado de rojo a tu color principal */
    font-weight: 800;
    letter-spacing: -1px;
    display: block;
}

/* --- ADAPTACIÓN DARK MODE --- */
body.dark-mode #rankings-table thead tr {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode #rankings-table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.03);
}

body.dark-mode #rankings-table td { 
    border-bottom-color: rgba(255, 255, 255, 0.05); 
}

body.dark-mode #master-record-display {
    background: transparent;
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   8. INTERFAZ FLOTANTE (MENÚ DE COMPETENCIAS)
   ========================================================================== */
.comp-menu-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 9999;
    pointer-events: none;
}

#compOptions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-bottom: 15px;
    
    /* Estado inicial refinado */
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9); /* Escala sutil para el efecto de aparición */
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

#compOptions.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.comp-item { 
    background: var(--card-bg); 
    color: var(--primary) !important; 
    padding: 10px 18px; 
    border-radius: 12px; 
    margin-bottom: 8px; 
    /* Sombra más moderna y dispersa */
    box-shadow: 0 8px 20px rgba(0,0,0,0.12); 
    border: 1px solid rgba(0,0,0,0.05); /* Borde fino en lugar de grueso */
    border-right: 4px solid var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.comp-item:hover {
    transform: translateX(-8px); /* Desplazamiento más fluido */
    background: var(--accent);
    color: white !important;
    box-shadow: 0 10px 25px rgba(211, 84, 0, 0.25);
}

.btn-comp-round { 
    pointer-events: auto;
    width: 56px; 
    height: 56px; 
    border-radius: 16px; /* Squircle para hacer match con gliders y tabs */
    background: var(--card-bg); 
    color: var(--primary); 
    border: 1px solid rgba(0,0,0,0.08); 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    font-size: 1.4rem;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-comp-round:hover { 
    transform: scale(1.1); 
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

/* Rotación moderna al abrir */
.btn-comp-round.open {
    transform: rotate(135deg);
    background: var(--accent);
    color: white;
    border-color: transparent;
}

/* --- ADAPTACIÓN DARK MODE --- */
body.dark-mode .comp-item {
    background: #1e1e1e;
    border-color: rgba(255,255,255,0.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

body.dark-mode .btn-comp-round {
    background: #1e1e1e;
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* ==========================================================================
   9. FOOTER Y ANIMACIONES (Corrección: Sin saltos de pantalla)
   ========================================================================== */

/* Eliminamos el translateY y el scale para evitar que el body "baile" */
@keyframes fadeInSection {
    from { 
        opacity: 0; 
    }
    to { 
        opacity: 1; 
    }
}

.section-content { 
    display: none; 
}

.section-content.active { 
    display: block; 
    /* Una transición de opacidad pura es más profesional y estable */
    animation: fadeInSection 0.4s ease-in-out forwards; 
}

/* El resto del footer se mantiene igual de limpio */
.footer-minimal { 
    margin-top: auto; 
    padding: 40px 20px 30px; 
    text-align: center; 
    border-top: 1px solid var(--border-color); 
}

.social-links a {
    color: var(--primary);
    text-decoration: none;
    font-size: 1.5rem;
    margin: 0 18px;
    display: inline-block;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.social-links a:hover {
    color: var(--accent);
    opacity: 1;
    transform: translateY(-5px); /* Esto solo mueve el icono, no el body */
}

/* ==========================================================================
   10. AJUSTES MÓVILES
   ========================================================================== */
@media (max-width: 480px) {
    .grid-layout { grid-template-columns: 1fr; }
    .toggle-main-container { margin: 15px 0; }
    .comp-menu-container { bottom: 20px; right: 20px; }
    .btn-comp-round { width: 50px; height: 50px; font-size: 1.2rem; }
    /* Allow the switch wrapper to shrink on very small screens */
    .switch-wrapper { width: 100%; max-width: 320px; box-sizing: border-box; }
    .btn-switch { font-size: 0.7rem; }
}

/* --- RESPONSIVIDAD PARA CALCULADORAS --- */

@media (max-width: 480px) {
    /* Ajusta el contenedor principal de la calculadora */
    .calculator-container {
        width: 95% !important;
        padding: 15px !important;
        margin: 10px auto !important;
    }

    /* Si usas un grid para los botones (ej. calculadora de promedios) */
    .calc-grid {
        grid-template-columns: repeat(3, 1fr) !important; /* Menos columnas en móvil */
        gap: 8px !important;
    }

    /* Asegura que los inputs no se desborden */
    input[type="number"], input[type="text"], select {
        width: 100% !important;
        font-size: 16px !important; /* Evita que iOS haga zoom automático al enfocar */
        box-sizing: border-box;
    }

    /* Ajusta los botones para que sean fáciles de presionar con el dedo */
    .calc-btn {
        padding: 12px 5px !important;
        font-size: 1rem !important;
        min-height: 44px; /* Tamaño mínimo recomendado para botones táctiles */
    }

    /* Si tienes una tabla de resultados, la hacemos scrolleable */
    .results-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Títulos de la calculadora más pequeños */
    .calc-title {
        font-size: 1.3rem !important;
        text-align: center;
    }
}

/* ==========================================================================
   12. AJUSTE DE TARJETAS Y BOTÓN WCA
   ========================================================================== */

.card {
    display: flex;
    flex-direction: column; 
    height: 100%;           
    padding: 20px;          /* Un poco más de aire interno */
    background: var(--card-bg);
    border-radius: 16px;    /* Match con el resto del sitio */
    position: relative;
    
    /* Cambiamos drop-shadow por box-shadow para mejor rendimiento y look */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); 
    border: 1px solid rgba(0,0,0,0.05);
    border-left: 6px solid var(--accent);
    
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-sizing: border-box;
}

.card:hover { 
    transform: translateY(-6px); 
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    z-index: 2;
}

/* Contenedor de botones alineado al fondo */
.card-buttons {
    margin-top: auto;       /* El truco mágico para alinear botones abajo */
    display: flex;
    flex-direction: column; 
    gap: 12px;
    padding-top: 20px;
}

/* Botón WCA Estilizado */
.wca-button {
    display: flex;          /* Cambiado a flex para centrar mejor el texto */
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 42px;           /* Altura fija para consistencia */
    box-sizing: border-box;
    background: var(--accent);
    color: white !important;
    text-decoration: none;
    border-radius: 10px;    /* Bordes más suaves */
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase; /* Le da un toque más oficial */
    letter-spacing: 0.5px;
    
    /* Efecto de elevación sutil */
    box-shadow: 0 4px 10px rgba(211, 84, 0, 0.2);
    transition: all 0.3s ease;
    
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wca-button:hover {
    background: var(--accent);
    filter: brightness(1.1); /* Aclara un poco el color sin necesitar otra variable */
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(211, 84, 0, 0.3);
}

.wca-button:active {
    transform: translateY(0); /* Efecto de "presionado" */
}

/* Ajuste Dark Mode */
body.dark-mode .card {
    background: var(--card-bg);
    border-color: rgba(255,255,255,0.05);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* ==========================================================================
   13. BOTÓN "VER PERFIL WCA" EN TARJETAS DE STAFF
   ========================================================================== */

.btn-wca {
    color: var(--accent); /* Cambiado a naranja */
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    padding-bottom: 2px;
    transition: all 0.3s ease;
}

/* El subrayado moderno ya usa var(--accent), así que se queda igual */
.btn-wca::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.btn-wca:hover {
    color: var(--accent) !important;
    transform: translateX(5px); /* Añadimos el pequeño desplazamiento para consistencia */
}

.btn-wca:hover::after {
    width: 100%;
}

/* Ajustes para Modo Oscuro - Ahora también será naranja */
body.dark-mode .btn-wca {
    color: var(--accent); 
}

body.dark-mode .btn-wca:hover {
    color: var(--accent) !important;
}

/* ==========================================================================
   14. DISEÑO DE INPUTS (PROMEDIOS Y ACUMULATIVA)
   ========================================================================== */

.solve-input, 
.solve-input-acc {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 12px; /* Un poco más de aire vertical */
    box-sizing: border-box;
    gap: 12px;
}

/* Distribución inteligente */
.solve-input { justify-content: space-between; }
.solve-input-acc { justify-content: center; }

/* Etiquetas #1, #2... Estilo más moderno */
.solve-input label, 
.solve-input-acc label {
    font-weight: 800;
    color: var(--pink);
    min-width: 35px;
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* Grupos de entrada (Los cuadros donde se escribe) */
.input-group,
.solve-input-acc .input-group,
.limit-input-group .input-group {
    background: var(--toggle-bg);
    padding: 8px 12px;
    border-radius: 12px;
    border: 1.5px solid transparent; /* Borde invisible para que no salte al hacer focus */
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    flex: 0 1 350px; 
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05); /* Sombra interna para efecto de "hueco" */
    transition: all 0.2s ease;
}

/* Efecto de foco para saber qué estamos editando */
.input-group:focus-within {
    background: var(--card-bg);
    border-color: var(--pink);
    box-shadow: 0 4px 12px rgba(228, 0, 124, 0.15);
}

/* Inputs y Separadores - Optimizados para lectura */
.input-group input {
    flex: 1;
    width: 100% !important;
    max-width: 4ch;
    border: none;
    background: transparent;
    text-align: center;
    font-size: clamp(1.1rem, 4vw, 1.4rem); /* Mejor escala en móvil */
    font-weight: 700;
    /* Fuente mono para que los números no bailen */
    font-family: 'JetBrains Mono', 'Courier New', monospace; 
    color: var(--primary);
    outline: none;
}

.input-group .separator {
    font-weight: bold;
    color: var(--pink);
    opacity: 0.6;
    font-size: 1.2rem;
    padding: 0 2px;
}

/* Botón DNF - Más táctil */
.btn-dnf {
    flex-shrink: 0;
    min-width: 55px;
    height: 45px; /* Altura fija para facilitar el toque con el pulgar */
    padding: 0;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    border-radius: 10px;
    background: var(--toggle-bg);
    border: 1px solid rgba(0,0,0,0.05);
    color: var(--gray);
    transition: all 0.2s ease;
}

.btn-dnf.active {
    background-color: var(--pink) !important;
    border-color: var(--pink) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(228, 0, 124, 0.3);
    transform: scale(1.05);
}

/* ==========================================================================
   15. ESTILOS ESPECÍFICOS ACUMULATIVA Y RESPONSIVE
   ========================================================================== */

.limit-input-group, .solve-input-acc {
    display: flex;
    justify-content: center;
    width: 100%;
}

/* MODO OSCURO */
body.dark-mode .input-group {
    background: #252525;
    border-color: rgba(255,255,255,0.05);
}
body.dark-mode .btn-dnf {
    background: #252525;
    border-color: rgba(255,255,255,0.1);
}

/* AJUSTE MÓVIL CRÍTICO */
@media (max-width: 480px) {
    .solve-input, .solve-input-acc {
        gap: 8px; /* Menos espacio para ganar ancho de input */
    }
    .input-group {
        flex: 1 1 auto; /* Permite que el input crezca lo necesario */
        padding: 8px;
    }
    .btn-dnf {
        min-width: 50px;
        height: 40px;
    }
}


/* ==========================================================================
   16. ESTILOS DE BOTONES DE RESTABLECER (UNIFICADOS)
   ========================================================================== */

/* Contenedor: Menos líneas divisorias, más aire */
.btn-reset-container {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color); /* Usamos nuestra variable sutil */
    width: 100%;
}

/* Estilo base: Botón "Ghost" Minimalista */
.btn-reset-acum, 
.btn-reset-prom {
    background: var(--toggle-bg); /* Fondo muy tenue para que se vea clickable */
    border: 1.5px solid transparent; /* Borde invisible para evitar saltos */
    padding: 12px 28px;
    border-radius: 12px; /* Cambiado de 50px (píldora) a 12px (match con cards) */
    cursor: pointer;
    color: var(--gray);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 5px auto;
}

/* Efecto Hover: Vibrante y definido */
.btn-reset-acum:hover, 
.btn-reset-prom:hover {
    background: var(--pink);
    color: white !important;
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(228, 0, 124, 0.25);
}

/* Efecto Click: Feedback táctil */
.btn-reset-acum:active, 
.btn-reset-prom:active {
    transform: translateY(-1px) scale(0.96);
    box-shadow: 0 4px 10px rgba(228, 0, 124, 0.15);
}

/* Texto de ayuda debajo del botón */
.reset-help-text {
    font-size: 0.72rem;
    color: var(--gray);
    margin-top: 8px;
    font-weight: 500;
    opacity: 0.7;
    letter-spacing: 0.3px;
}

/* --- ADAPTACIÓN DARK MODE --- */
body.dark-mode .btn-reset-acum, 
body.dark-mode .btn-reset-prom {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
}

body.dark-mode .btn-reset-acum:hover, 
body.dark-mode .btn-reset-prom:hover {
    background: var(--pink);
    color: white;
}


/* ==========================================================================
   17. ESTILOS PARA LA SECCIÓN DE BUGS Y AGRADECIMIENTOS
   ========================================================================== */

.thanks-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    text-align: center;
    max-width: 600px;
    margin: 20px auto;
}

.thanks-photo {
    /* Tamaño aumentado a 180px */
    width: 180px; 
    height: 180px;
    object-fit: cover; 
    border-radius: 50%;
    margin-bottom: 25px; /* Un poco más de espacio */
    border: 5px solid var(--bg); /* Borde un poco más grueso para que resalte */
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease;
}

.thanks-photo:hover {
    transform: scale(1.05) rotate(3deg);
}

.thanks-text {
    color: var(--gray);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.thanks-text strong {
    color: var(--primary);
    display: block;
    font-size: 1.8rem; /* Aumentado ligeramente para acompañar la imagen */
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.btn-thanks {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    background-color: var(--primary);
    color: var(--white) !important;
    border: none;
    border-radius: 12px;
    font-weight: var(--fw-bold);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-thanks:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    filter: brightness(1.2);
}

/* --- MODO OSCURO --- */
body.dark-mode .thanks-card {
    background: var(--card-bg);
    border-color: rgba(255, 255, 255, 0.05);
}

body.dark-mode .btn-thanks {
    background-color: var(--primary); 
    color: #121212 !important; 
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .thanks-photo {
    border-color: #222;
}

/* ==========================================================================
   18. SECCIÓN DE EVENTOS WCA (BAJA CALIFORNIA)
   ========================================================================== */

/* Contenedor de la cuadrícula de eventos */
#eventos-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
    width: 100%;
}

/* Tarjeta de Competencia */
.card-evento {
    border-left: 6px solid var(--accent) !important;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
}

/* Badge de Estatus Minimalista (Sin el cuadro feo) */
.estatus-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

/* El punto de color tipo "indicador de estado" */
.estatus-badge::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: currentColor; /* Toma el color definido en el JS */
    display: inline-block;
}

/* Animación de pulso para registros ABIERTOS */
.estatus-badge.abierto::before {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    animation: status-pulse 2s infinite;
}

@keyframes status-pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(46, 204, 113, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

/* Contenedor de Iconos de Cubing */
.eventos-icon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    background: var(--toggle-bg);
    border-radius: var(--radius-md);
    margin: 15px 0;
    min-height: 50px;
    align-items: center;
}

.eventos-icon-grid img {
    width: 26px;
    height: 26px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
    opacity: 0.8;
}

/* Resalte de iconos al pasar el mouse */
.eventos-icon-grid img:hover {
    transform: scale(1.3) translateY(-3px);
    opacity: 1;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

/* Botón "Ver en WCA" con subrayado animado */
.btn-wca-eventos {
    color: var(--accent);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    padding-bottom: 4px;
    transition: all 0.3s ease;
    width: fit-content;
    margin-top: auto;
}

.btn-wca-eventos::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.btn-wca-eventos:hover::after {
    width: 100%;
}

.btn-wca-eventos:hover {
    transform: translateX(5px);
}

/* Adaptaciones Modo Oscuro */
body.dark-mode .eventos-icon-grid img {
    filter: brightness(0) invert(1);
}

body.dark-mode .eventos-icon-grid img:hover {
    filter: brightness(0) invert(1) drop-shadow(0 0 8px var(--accent));
}

body.dark-mode .eventos-icon-grid {
    background: rgba(255, 255, 255, 0.05);
}