/* Valencianismo Lo-Fi — Sistema de Estilos Premium */

:root {
    --primary-color: #ff9f1c; /* Naranja valencianista cálido */
    --accent-color: #2ec4b6;  /* Azul relajante */
    --bg-glass: rgba(12, 14, 20, 0.22);
    --border-glass: rgba(255, 255, 255, 0.08);
    --shadow-premium: 0 20px 50px rgba(0, 0, 0, 0.5);
    --font-sans: 'Outfit', sans-serif;
    --font-serif: 'Playfair Display', serif;
    --transition-smooth: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #08090c;
    font-family: var(--font-sans);
    color: #f1f3f9;
}

/* Contenedor de Fondos de Ambiente */
.background-container {
    position: absolute;
    width: 120vw;
    height: 120vw;
    left: -10vw;
    top: calc(50vh - 60vw);
    z-index: 1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-image 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translate3d(0, 0, 0) scale(1.02);
    filter: brightness(0.7) contrast(1.05);
}

/* Efecto de viñeta oscura para enfocar el centro */
.background-container::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 20%, rgba(5, 6, 8, 0.75) 100%);
    pointer-events: none;
}

/* Contenedor General de la Aplicación */
.app-container {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 3;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 2.5rem;
    pointer-events: none;
}

.app-container * {
    pointer-events: auto;
}

/* --- Área de Widgets Superior Derecha --- */
.top-right-area {
    align-self: flex-end;
    display: flex;
    align-items: center;
    gap: 1.2rem;
    pointer-events: none;
    z-index: 100;
}

.top-right-area * {
    pointer-events: auto;
}

/* --- Conmutador de Idioma Premium (VAL/CAS) --- */
.lang-switcher {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    padding: 3px;
    border-radius: 50px;
    display: inline-flex;
    position: relative;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    height: 38px;
    align-items: center;
    user-select: none;
    transition: var(--transition-smooth);
}

.lang-switcher:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(15, 18, 26, 0.55);
}

.lang-slider {
    position: absolute;
    top: 3px;
    bottom: 3px;
    left: 3px;
    width: 44px;
    background: linear-gradient(135deg, var(--primary-color), #ffb84d);
    border-radius: 50px;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 10px rgba(255, 159, 28, 0.35);
    z-index: 1;
}

.lang-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
    width: 44px;
    height: 30px;
    cursor: pointer;
    border-radius: 50px;
    position: relative;
    z-index: 2;
    transition: color 0.35s ease;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:hover {
    color: #ffffff;
}

.lang-btn.active {
    color: #0c0d12 !important;
}

/* Slider transition positions */
.lang-switcher[data-active-lang="cas"] .lang-slider {
    transform: translateX(44px);
}

/* --- Widget del Reloj Analógico --- */
.clock-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    padding: 1rem 1.2rem;
    border-radius: 1.5rem;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: var(--transition-smooth);
}

.clock-widget:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(15, 18, 26, 0.55);
}

.clock {
    width: 70px;
    height: 70px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    border-radius: 4px;
    background: #ffffff;
    transition: transform 0.1s cubic-bezier(0.4, 2.08, 0.55, 0.44);
}

.hand.hour {
    width: 3px;
    height: 20px;
    margin-left: -1.5px;
    background: #ffffff;
}

.hand.minute {
    width: 2px;
    height: 28px;
    margin-left: -1px;
    background: rgba(255, 255, 255, 0.85);
}

.hand.second {
    width: 1px;
    height: 31px;
    margin-left: -0.5px;
    background: var(--primary-color);
}

.center-dot {
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 5px var(--primary-color);
}

.digital-time {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.7);
    font-feature-settings: "tnum";
}

/* --- Panel Central del Reproductor --- */
.player-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 10;
    width: calc(100% - 40px);
    max-width: 440px;
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 1.6rem;
    padding: 1.2rem 1.4rem;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    transition: var(--transition-smooth);
}

.player-panel.dragging {
    transition: none !important;
}

.player-panel:hover {
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    cursor: grab;
    user-select: none;
    gap: 0.8rem;
}

.logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
}

.logo-link:hover {
    transform: scale(1.08) rotate(3deg);
}

.player-logo {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2.5px solid var(--primary-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    object-fit: cover;
    background: #0f121a;
    transition: var(--transition-smooth);
}

.player-panel.minimized .player-logo {
    width: 36px;
    height: 36px;
    border-color: rgba(255, 255, 255, 0.2);
}

.player-header-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    margin-left: auto;
}

/* Botón Play/Pausa General */
.play-btn {
    border-radius: 50%;
    border: none;
    background: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 -2px 0px rgba(0, 0, 0, 0.1);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    flex-shrink: 0;
}

.play-btn:hover {
    transform: scale(1.08);
    background: #ffffff;
    box-shadow: 0 6px 15px rgba(255, 159, 28, 0.35);
}

.play-btn:active {
    transform: scale(0.95);
}

.play-btn svg {
    fill: #0c0d12;
}

/* Play de Cabecera (Oculto por defecto en maximizado, visible en minimizado) */
.header-play-btn {
    display: none;
    width: 32px;
    height: 32px;
}

.header-play-btn svg {
    width: 12px;
    height: 12px;
}

/* Play de Cuerpo (Visible por defecto) */
.body-play-btn {
    width: 44px;
    height: 44px;
}

.body-play-btn svg {
    width: 16px;
    height: 16px;
}

/* Botones de Cabecera (Historial, Fullscreen y Minimizar) */
.player-action-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.55);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 0.72rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none;
}

.player-action-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
}

/* Cuerpo del Reproductor */
.player-body {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.player-controls-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
}

.now-playing {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.7rem 0.9rem;
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
    flex: 1;
}

.music-icon {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    width: 20px;
    height: 16px;
    flex-shrink: 0;
}

.music-icon .bar {
    width: 4px;
    height: 100%;
    background: var(--primary-color);
    border-radius: 10px;
    animation: bounce 0.8s ease-in-out infinite alternate;
}

.music-icon .bar:nth-child(2) {
    animation-delay: 0.2s;
    animation-duration: 0.6s;
}

.music-icon .bar:nth-child(3) {
    animation-delay: 0.4s;
    animation-duration: 0.9s;
}

.music-icon.paused .bar {
    animation-play-state: paused;
    height: 4px;
}

@keyframes bounce {
    0% { height: 4px; }
    100% { height: 16px; }
}

.track-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    width: 100%;
}

.now-playing-label {
    font-size: 0.6rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 2px;
}

.track-title-wrapper {
    overflow: hidden;
    width: 100%;
    white-space: nowrap;
}

.track-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: #ffffff;
    display: inline-block;
    will-change: transform;
}

.track-title.marquee {
    animation: marquee 15s linear infinite;
    padding-left: 100%;
}

@keyframes marquee {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* --- Panel de Sintonización de Ambiente (Desplegable integrado) --- */
.player-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding-top: 0.6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
}

.ambient-controls {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 2px 4px;
    border-radius: 20px;
}

.footer-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none;
}

.footer-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
}

.ambient-selector-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 180px;
    opacity: 1;
    overflow: hidden;
    margin-top: 0.1rem;
    padding-bottom: 0.8rem;
}

.ambient-selector-wrapper.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.ambient-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    text-align: center;
}

.ambient-label strong {
    color: var(--primary-color);
}

.ambient-hint {
    display: block;
    font-size: 0.58rem;
    color: rgba(255, 255, 255, 0.3);
    text-transform: none;
    font-weight: 400;
    margin-top: 1px;
}

/* Selector de ambientes agrupado en 2 filas de 5 */
.ambient-selector {
    display: grid;
    grid-template-columns: repeat(5, auto);
    justify-content: center;
    gap: 0.6rem 1rem;
    width: 100%;
}

.ambient-btn {
    background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.01));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1), 0 2px 5px rgba(0,0,0,0.2);
    color: rgba(255, 255, 255, 0.65);
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    position: relative;
    overflow: hidden;
}

/* Brillo que pasa por encima (Glow Sweep) */
.ambient-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.15), transparent);
    transform: skewX(-20deg);
    transition: all 0.5s ease;
}

.ambient-btn:hover::before {
    left: 150%;
}

.ambient-btn:hover {
    background: linear-gradient(145deg, rgba(255,255,255,0.12), rgba(255,255,255,0.04));
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px) scale(1.05);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.2), 0 8px 15px rgba(0, 0, 0, 0.4), 0 0 12px rgba(255,255,255,0.1);
}

.ambient-btn:active {
    transform: translateY(1px) scale(0.95);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
    transition-duration: 0.05s;
}

.ambient-btn.active {
    background: linear-gradient(145deg, var(--primary-color), #e07a00);
    border-color: #ffd166;
    color: #0c0d12;
    /* Anillo exterior con espacio (gap) respecto al borde */
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.8), 0 4px 15px rgba(255, 159, 28, 0.5), 0 0 20px rgba(255, 159, 28, 0.4);
    text-shadow: 0 1px 2px rgba(255,255,255,0.5);
}

.ambient-btn.active:hover {
    transform: translateY(-2px) scale(1.05);
    outline-offset: 4px;
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.9), 0 6px 20px rgba(255, 159, 28, 0.6), 0 0 25px rgba(255, 159, 28, 0.5);
}

/* --- Estado Minimizado del Reproductor --- */
.player-panel.minimized {
    padding: 0.8rem 1.2rem !important;
    gap: 0 !important;
    width: 440px !important;
    max-width: 440px !important;
}

.player-panel.minimized .badge,
.player-panel.minimized .tagline,
.player-panel.minimized .player-body,
.player-panel.minimized .player-footer {
    display: none !important;
}

.player-panel.minimized .player-header-text {
    overflow: visible !important;
}

/* Al estar minimizado, el play de cabecera sí se muestra */
.player-panel.minimized .header-play-btn {
    display: flex !important;
    flex-shrink: 0 !important;
}

/* --- Marca de agua y extras --- */
.watermark {
    position: fixed;
    bottom: 32px;
    right: 80px;
    font-size: 0.75rem;
    letter-spacing: 5px;
    color: rgba(255, 255, 255, 0.12);
    font-weight: 800;
    text-transform: uppercase;
    z-index: 90;
}

.hidden {
    display: none !important;
}

/* --- Adaptación Responsive --- */
@media (max-width: 580px) {
    .background-container {
        /* En móvil, para que no se recorte tanta imagen con "cover",
           ajustamos el contenedor para que mantenga proporción 16:9 
           y el menor zoom posible (100vh * 16 / 9 = 177.77vh). */
        width: 177.77vh;
        height: 100vh;
        left: calc(50vw - 88.88vh); /* Centrado por defecto */
        top: 0;
    }

    .app-container {
        padding: 1rem;
    }
    
    .top-right-area {
        align-self: center;
        margin-top: 1rem;
        display: flex;
        flex-direction: row;
        gap: 0.8rem;
    }
    
    .clock-widget {
        align-self: auto;
        margin-top: 0;
    }
    
    .player-panel {
        bottom: 15px;
        left: 15px;
        width: calc(100% - 30px);
        padding: 1.2rem;
        gap: 1.2rem;
    }

    /* En móvil ocultamos el reloj y dejamos solo el conmutador de idiomas */
    .clock-widget {
        display: none !important;
    }

    /* En móvil, al minimizar, se muestra como una pequeña píldora en la esquina inferior izquierda */
    .player-panel.minimized {
        background: var(--bg-glass) !important;
        border: 1px solid var(--border-glass) !important;
        box-shadow: var(--shadow-premium) !important;
        backdrop-filter: blur(25px) !important;
        -webkit-backdrop-filter: blur(25px) !important;
        padding: 0.3rem 0.4rem !important;
        width: auto !important;
        height: auto !important;
        min-width: 0 !important;
        max-width: none !important;
        bottom: 15px !important;
        left: 15px !important;
        top: auto !important;
        right: auto !important;
        border-radius: 50px !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .player-panel.minimized .player-header {
        width: auto !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.6rem !important;
        padding: 0 !important;
    }

    .player-panel.minimized .player-header-text {
        display: none !important;
    }

    .player-panel.minimized .logo-link {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .player-panel.minimized .player-logo {
        width: 36px !important;
        height: 36px !important;
        display: block !important;
        border-radius: 50%;
    }

    .player-panel.minimized .player-header-actions {
        width: auto !important;
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
        flex-shrink: 0 !important;
    }

    .player-panel.minimized .player-action-btn,
    .player-panel.minimized .header-play-btn {
        display: none !important;
    }

    .player-panel.minimized .player-toggle-btn {
        width: 36px !important;
        height: 36px !important;
        border-radius: 50% !important;
        background: rgba(255, 255, 255, 0.08) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        color: #ffffff !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: none !important;
        font-size: 1rem !important;
        transition: transform 0.2s ease, background-color 0.2s ease !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .player-panel.minimized .player-toggle-btn:hover {
        background: rgba(255, 255, 255, 0.18) !important;
        transform: scale(1.05);
    }

    .radio-title {
        font-size: 1.3rem;
        white-space: normal;
        line-height: 1.25;
    }

    /* Ocultar botón de minimizar en desktop */
    @media (min-width: 581px) {
        .player-toggle-btn {
            display: none !important;
        }
    }

    .watermark {
        position: static !important;
        margin-top: 1rem !important;
        text-align: center;
        width: auto;
    }
}

/* --- Punts de proximitat (4 colors) --- */
.prox-dot {
    position: fixed;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 6;
    opacity: 0;
    background: rgba(255, 255, 255, 0.9);
    transform: translate(-50%, -50%) scale(1);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* --- Panel Integrado de Historial --- */
.history-wrapper {
    margin-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 15px;
    padding-bottom: 15px;
    max-height: 280px;
    opacity: 1;
    overflow-y: auto;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.history-wrapper.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top-color: transparent;
    pointer-events: none;
}

.history-header {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    text-align: center;
}

#history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#history-list li {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

#history-list li .time {
    font-size: 0.7rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 2px;
}

#history-list li .artist {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 2px;
}

#history-list li .title {
    font-size: 0.85rem;
    color: #fff;
    font-weight: 400;
}

.history-loading {
    text-align: center;
    color: rgba(255, 255, 255, 0.5) !important;
    font-style: italic;
    background: none !important;
    border: none !important;
}

/* Scrollbar fina para el historial */
.history-wrapper::-webkit-scrollbar {
    width: 4px;
}
.history-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
.history-wrapper::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* --- Anell fi sobre el hotspot (apareix en apropar-se) --- */
.hs-ring {
    position: absolute;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 4;
    opacity: 0;
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    transform: translate(-50%, -50%) scale(0.85);
    transition: opacity 0.35s ease, transform 0.35s ease, border-color 0.35s ease;
    will-change: opacity, transform;
}

.hs-ring.pulse {
    animation: ring-pulse 1.8s ease-in-out infinite;
}

.hs-ring.reveal {
    transform: translate(-50%, -50%) scale(1.02) !important;
}

@keyframes ring-pulse {
    0%   { transform: translate(-50%, -50%) scale(0.95); }
    50%  { transform: translate(-50%, -50%) scale(1.08); }
    100% { transform: translate(-50%, -50%) scale(0.95); }
}

/* --- Hotspots invisibles sobre el fondo (4 botons) --- */
.hs-btn {
    position: absolute;
    z-index: 5;
    width: 80px;
    height: 80px;
    transform: translate(-50%, -50%);
    background: transparent;
    border: none;
    cursor: zoom-in;
    border-radius: 50%;
    display: none; /* activado por JS al cargar el ambiente */
    padding: 0;
    outline: none;
}

.hs-btn:hover {
    background: rgba(255, 255, 255, 0.03);
}

/* --- Modal pequeño de información --- */
#hotspot-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
}

#hotspot-modal.visible {
    pointer-events: auto;
    opacity: 1;
}

#hotspot-modal-box {
    position: relative;
    background: rgba(12, 14, 22, 0.93);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--hs-color, rgba(255,255,255,0.1));
    border-radius: 1.4rem;
    padding: 2rem 2.2rem 2rem;
    max-width: 380px;
    width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,255,255,0.04);
    text-align: center;
    transform: translateY(10px);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

#hotspot-modal.visible #hotspot-modal-box {
    transform: translateY(0);
}

#hotspot-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.85rem;
    background: rgba(255,255,255,0.06);
    border: none;
    color: rgba(255,255,255,0.5);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    outline: none;
}

#hotspot-modal-close:hover {
    background: rgba(255,255,255,0.14);
    color: #fff;
    transform: scale(1.05);
}

#hotspot-modal-icon {
    font-size: 2rem;
    margin-bottom: 0.55rem;
    line-height: 1;
}

#hotspot-modal-title {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

#hotspot-modal-desc {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.65);
    line-height: 1.65;
    margin-bottom: 0;
}

/* --- Enlace a L'Enciclopèdia --- */
#hotspot-wiki-link-container {
    margin-top: 1.2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 1rem;
    text-align: center;
}

#hotspot-wiki-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    transition: color 0.2s;
    display: inline-block;
}

#hotspot-wiki-link:hover {
    color: #ffb84d;
    text-decoration: underline;
}

/* --- Controles de zoom al estilo Google Maps --- */
.zoom-controls {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: rgba(12, 14, 22, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 2px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.zoom-btn {
    width: 38px;
    height: 38px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.3rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s, transform 0.1s;
    user-select: none;
    outline: none;
}

.zoom-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.zoom-btn:active {
    transform: scale(0.92);
}



