:root {
            --bg-deep: #080a0c;
            --bg-panel: #111418;
            --border-subtle: #30363d;
            --text-main: #f0f6fc;
            --text-muted: #8b949e;
            --text-chess: #c9d1d9; /* Gris plateado para "Chess" */
            --accent: #0062ff; /* Verde esmeralda */
            --font-main: system-ui, 'Inter', -apple-system, sans-serif;
            --primary: #0062ff;
            --dark: #0f172a;
        }

        body {
            background-color: var(--bg-deep);
            color: var(--text-main);
            font-family: var(--font-main);
            height: 100vh;
            margin: 0;
            display: flex;
            flex-direction: row;
            overflow: hidden;
        }

        /* --- Sidebar Responsivo --- */
        #sidebar {
            width: 320px;
            background-color: var(--bg-panel);
            border-right: 1px solid var(--border-subtle);
            display: flex;
            flex-direction: column;
            padding: 1.5rem; /* Más espaciado superior */
            padding-top: 0.5rem;
            z-index: 1050;
            transition: all 0.3s ease;
            max-height: 100vh;    /* Limita la altura al tamaño de la pantalla */
            overflow-y: auto;     /* Activa el scroll vertical si el contenido sobresale */
            -webkit-overflow-scrolling: touch; /* Suaviza el scroll en iPhone/iOS */
        }

        .logo-link {
            display: flex;
            align-items: center;
            text-decoration: none; /* Quita el subrayado */
            color: inherit;        /* Mantiene el color original de tu h1 */
            gap: 10px;             /* Espacio entre imagen y texto */
        }

        .logo-link:hover {
            text-decoration: none;
            opacity: 0.9;          /* Un ligero efecto al pasar el ratón */
        }
        .logo-text {
            font-size: 1.5rem;
            font-weight: 950;       
            color: var(--text-chess);
            margin: 0;
        }
        .logo-accent {
            color: var(--primary);
        }
        /* Estilos responsivos para el sidebar */
        @media (max-width: 768px) {
            #sidebar {
                position: fixed;
                left: -320px; /* Oculto por defecto */
                height: 100%;
                padding-top: 4rem;
            }
            #sidebar.active {
                left: 0;
            }
            .mobile-toggle {
                display: block;
                left: 15px;   /* Ajustado para alinear con el padding del sidebar */
                top: 15px;
                z-index: 1200; /* Por encima del sidebar (que tiene 1050) */
            }  
            #sidebar .alert {
                margin-top: 1rem !important; /* Espacio pequeño en móvil */
            }
        }

        /* --- Estilo Refinado del Logo --- */
        .brand-wrapper {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 3.5rem; /* Más espacio debajo del logo */
        }

        .brand-logo-svg {
            color: var(--accent); /* Color verde para el icono */
            flex-shrink: 0; /* Evita que el SVG se encoja */
        }

        .brand-name {
            font-weight: 700;
            font-size: 1.4rem;
            letter-spacing: -0.5px;
            color: var(--text-main);
            line-height: 1;
        }

        .brand-name span {
            color: var(--text-chess); /* Color plateado para "Chess" */
            font-weight: 500; /* Un poco menos gruesa para elegancia */
        }

        /* --- Botón Flotante para Móvil (Hamburguesa) --- */
        .mobile-toggle {
            display: none;
            position: fixed;
            top: 22px;
            left: 24px;
            z-index: 1100;
            background: var(--bg-panel);
            border: 1px solid var(--border-subtle);
            color: var(--accent);
            padding: 10px 15px;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.5);
            cursor: pointer;
        }

        @media (max-width: 768px) {
            .mobile-toggle { display: block; }
        }

        /* --- Estilos de Formulario y Botones --- */
        .form-control-custom {
            background-color: #0d1117;
            border: 1px solid var(--border-subtle);
            color: white;
            border-radius: 8px;
            padding: 0.75rem;
            font-size: 0.9rem;
        }

        .form-control-custom:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 1px var(--accent);
            background-color: #0d1117;
            outline: none;
        }

        .btn-premium {
            background-color: var(--primary);
            color: var(--text-main);
            font-weight: 600;
            border-radius: 8px;
            padding: 0.75rem;
            border: none;
            font-size: 0.9rem;
            transition: background-color 0.2s;
        }

        .btn-premium:hover {
            background-color: var(--primary);
        }

        /* --- Mapa --- */
        #map-container {
            flex-grow: 1;
            position: relative;
            height: 100vh;
        }

        #map { height: 100%; width: 100%; background: var(--bg-deep); }

        /* Overlay para cerrar el menú en móvil */
        #sidebar-overlay {
            display: none;
            position: fixed;
            top: 0; left: 0;
            width: 100%; height: 100%;
            background: rgba(0,0,0,0.6);
            z-index: 1040;
        }
        #sidebar-overlay.active { display: block; }

        /* Contenedor del footer en el sidebar */
        .sidebar-footer {
            margin-top: auto;
            padding-top: 1.5rem;
            border-top: 1px solid var(--border-subtle);
            text-align: center;
        }

        .github-link {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            color: var(--text-muted); /* Gris suave */
            text-decoration: none;
            font-family: 'ui-monospace', 'SFMono-Regular', 'Menlo', monospace;
            font-size: 0.75rem;
            transition: all 0.2s ease;
            opacity: 0.6;
        }

        .github-link:hover {
            opacity: 1;          
        }

        .github-icon {
            fill: currentColor; /* El icono toma el color del texto automáticamente */
        }

        /* Color del círculo exterior (el más transparente) */
.marker-cluster-small, 
.marker-cluster-medium, 
.marker-cluster-large {
    background-color: rgba(174, 183, 197, 0.4) !important; /* Azul suave */
}

/* Color del círculo interior (el más sólido) */
.marker-cluster-small div, 
.marker-cluster-medium div, 
.marker-cluster-large div {
    background-color:rgba(29, 28, 28, 0.7) !important; /* Azul fuerte */
    color: white !important; /* Color del número */
    font-weight: bold;
}

.leaflet-popup-close-button {
    font-size: 1.2rem !important;
    background-color: #000 !important;
    color: #fff !important; /* Cambié a blanco para que resalte más en el marrón */
    
    /* El truco para el círculo perfecto */
   
    width: 30px !important;  /* Ajusta el tamaño a tu gusto */
    height: 30px !important;
    
    /* Para centrar la "X" perfectamente */
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important; 

}

/* Feedback visual para el mapa */
#map {
    transition: filter 0.4s ease;
}

.map-updating {
    filter: blur(4px) grayscale(30%);
    pointer-events: none;
}

#map-loader-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1500;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.chess-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.leaflet-popup-content-wrapper {
    border-radius:  12px !important;
}