/* ==========================================================================
   core.css - El Esqueleto Visual
   Entidad: Define reset, layout, posicionamiento y estructura base sin estilos decorativos
   Misión: Proveer una base neutral y reutilizable para todos los temas visuales
   Versión: 1.9.7 (Escudo Inexpugnable - Jack Frost)
   Masa: <150 líneas (Fragata)
   ========================================================================== */

/* ---------- VARIABLES GLOBALES (Z-INDEX) ---------- */
:root {
    --z-top-panel: 2000000;
    --z-floating-window: 1000000;
    --z-floating-window-active: 2000;
    --z-overlay: 9999999;
}

/* ---------- RESET Y BASE ---------- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeSpeed;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* ========== LAYOUTS FLEX ========== */
.flex {
    display: flex;
    gap: 1rem;
}
.flex-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

/* ========== TIPOGRAFÍA BASE ========== */
h1, h2, h3 {
    margin-bottom: 0.5rem;
    font-weight: bold;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* ========== UTILIDADES ========== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.w-100 { width: 100%; }

/* ========== PANEL SUPERIOR (posicionamiento y grid) ========== */
.top-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-top-panel);
    pointer-events: auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    padding: 8px 16px;
    gap: 16px;
    transition: all 0.2s;
}

/* ========== VENTANAS FLOTANTES ========== */
.floating-window {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-floating-window);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Eliminado resize: none para permitir redimensionamiento futuro si se desea */
}
.floating-window.active-window {
    z-index: var(--z-floating-window-active);
}
.floating-window.fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    top: 0 !important;
    left: 0 !important;
}
.floating-window .window-content,
.floating-window .window-inactive-overlay {
    z-index: auto;
}

.window-content {
    flex: 1;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    -webkit-overflow-scrolling: touch;
}

.window-inactive-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: pointer;
    display: none;
}
.floating-window.inactive .window-inactive-overlay {
    display: block;
}

/* ========== PANEL INACTIVO ========== */
.top-panel.panel-inactive .dynamic-slider {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.top-panel.panel-inactive .panel-left,
.top-panel.panel-inactive .panel-right {
    opacity: 1;
    visibility: visible;
}

/* ========== RESPONSIVE ========== */
@media (orientation: portrait) {
    .top-panel {
        padding: 6px 12px;
        gap: 12px;
    }
    .avalanche-trigger {
        width: 42px;
        height: 42px;
    }
    .dynamic-slider {
        font-size: 0.85rem;
        padding: 2px 6px;
    }
}
@media (max-width: 500px) {
    .win-menu-btn {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
}
