@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&display=swap');

:root {
    --bg-dark: #05000a; --gold: #d4af37; --cyan-magic: #00ffff;
}

body { margin: 0; padding: 0; overflow: hidden; background-color: var(--bg-dark); font-family: sans-serif; color: #fff; touch-action: none; overscroll-behavior: none;}
.oculto { display: none !important; }

#mapa-canvas { 
    position: absolute; top: 0; left: 0; 
    width: 100vw; height: 100vh; 
    z-index: 1; cursor: grab; touch-action: none;
}
#mapa-canvas:active { cursor: grabbing; }

#ui-overlay { 
    position: absolute; top: 0; left: 0; 
    width: 100%; height: 100%; 
    pointer-events: none; 
    z-index: 10; display:flex; flex-direction:column;
}

.nav-bar, .panel-info { pointer-events: auto; }

.nav-bar { 
    display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; 
    padding: 15px 25px; background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent); 
    font-family: 'Cinzel', serif; gap: 10px;
}
.btn-basic, .btn-action { background: #111; color: var(--gold); border: 1px solid rgba(212,175,55,0.4); padding: 8px 15px; border-radius: 4px; cursor: pointer; font-weight: bold; transition: 0.2s;}
.btn-basic:hover { background: var(--gold); color: #000; }
.btn-action { background: #004a00; color: white; border-color: #00ff00; }

/* NUEVOS CONTROLES DE VISTA GLOBAL */
.view-controls {
    display: flex; background: rgba(0,0,0,0.6); border: 1px solid var(--gold); border-radius: 6px; overflow: hidden;
}
.btn-switch {
    background: transparent; color: #888; border: none; padding: 6px 12px; font-family: 'Cinzel', serif; font-size: 0.75em; font-weight: bold; cursor: pointer; transition: all 0.3s ease;
}
.btn-switch.active {
    background: var(--gold); color: #000;
}

#btn-toggle-sidebar { display: none; } 
.sidebar {
    position: absolute; top: 80px; left: 20px; width: 200px; 
    background: rgba(10,0,20,0.85); border: 1px solid var(--gold); border-radius: 8px;
    padding: 15px; z-index: 20;
    max-height: calc(100vh - 110px); overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.9);
}
.btn-jugador {
    width: 100%; background: #111; color: #fff; border: 1px solid #555;
    padding: 8px; border-radius: 6px; margin-bottom: 8px; cursor: pointer;
    font-family: 'Cinzel', serif; font-weight: bold; transition: all 0.2s;
    display: flex; align-items: center; gap: 10px;
}
.btn-jugador:hover { border-color: var(--gold); transform: scale(1.02); }
.btn-jugador.activo { background: rgba(138, 43, 226, 0.3); border-color: rgba(138, 43, 226, 1); color: #fff; box-shadow: 0 0 10px rgba(138, 43, 226, 0.5); }

.panel-info { 
    position: absolute; 
    bottom: 25px; left: 50%; transform: translateX(-50%); 
    width: 95vw; 
    max-width: 480px; 
    background: rgba(10,0,20,0.65); 
    border: 1px solid var(--gold); border-radius: 8px; padding: 18px; box-shadow: 0 10px 30px rgba(0,0,0,0.9); transition: opacity 0.2s;
}

.panel-info h3 { margin: 0 0 10px 0; color: var(--cyan-magic); font-family: 'Cinzel', serif; font-size: 1.3em; padding-right: 35px; }
.tags-container { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tag { font-size: 0.75em; padding: 4px 8px; border-radius: 4px; border: 1px solid #555; background: #000; font-weight: bold; }

.loading { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: var(--bg-dark); z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: 'Cinzel', serif; transition: opacity 0.5s; }

#btn-cerrar-panel {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 28px;
    height: 28px;
    background-color: rgba(220, 20, 60, 0.5); 
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 50;
    transition: all 0.2s ease;
}

#btn-cerrar-panel:hover {
    background-color: rgba(220, 20, 60, 1); 
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .nav-bar { padding: 10px; justify-content: center; }
    .nav-bar h2 { width: 100%; text-align: center; font-size: 1.2em; order: -1; margin-bottom: 5px !important;}
    .btn-basic, .btn-action, .view-controls, button[onclick="window.abrirMenuOP()"] { font-size: 0.7em; padding: 6px 8px; flex-grow: 1; text-align: center;}
    .view-controls { order: 2; width: 100%; justify-content: center; margin-top: 5px; }
    .panel-info { padding: 15px; bottom: 10px; max-width: 95vw; }
    
    #btn-toggle-sidebar {
        display: block;
        position: absolute;
        top: 95px; left: 10px;
        z-index: 30;
        background: rgba(10,0,20,0.85);
        border: 1px solid var(--gold);
        color: var(--gold);
        padding: 8px 12px;
        border-radius: 6px;
        font-family: 'Cinzel', serif;
        font-weight: bold;
    }
    .sidebar { 
        top: 135px; left: 10px; width: 180px; max-height: 50vh; padding: 10px;
        transition: transform 0.3s ease, opacity 0.3s ease;
        transform: translateX(-150%);
        opacity: 0;
        pointer-events: none;
    }
    .sidebar.open {
        transform: translateX(0); 
        opacity: 1;
        pointer-events: auto;
    }
    .btn-jugador { padding: 6px; font-size: 0.8em; }
}
