/* ═══════════════════════════════════════════════════════════════════════════════
   LAYOUT - Header, Navigation, Pages
   ═══════════════════════════════════════════════════════════════════════════════ */

header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.4);
    margin-bottom: 0;
    box-shadow:
            0 2px 10px rgba(var(--primary-rgb), 0.15),
            inset 0 -1px 0 rgba(var(--primary-rgb), 0.1);
    position: relative;
}

body:has(.torch-left) header {
    box-shadow:
            0 2px 10px rgba(var(--primary-rgb), 0.15),
            inset 0 -1px 0 rgba(var(--primary-rgb), 0.1),
            -50px 0 100px rgba(255, 165, 0, 0.1),
            -100px 0 150px rgba(255, 100, 0, 0.05);
}

body:has(.torch-right) header {
    box-shadow:
            0 2px 10px rgba(var(--primary-rgb), 0.15),
            inset 0 -1px 0 rgba(var(--primary-rgb), 0.1),
            50px 0 100px rgba(255, 165, 0, 0.1),
            100px 0 150px rgba(255, 100, 0, 0.05);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    text-align: center;
}

.header-content::after {
    content: '╬════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╬';
    color: var(--primary-color);
    font-family: var(--ascii-font-family);
    font-size: 0.4em;
    opacity: 0.8;
    margin: 10px 0;
    text-align: center;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-shadow: 0 0 5px var(--primary-color);
    display: block;
}

@media (max-width: 768px) {
    header {
        padding: 15px 0;
    }
}

.logo {
    font-weight: 400;
    color: var(--primary-color);
    text-shadow: var(--glow);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo span {
    color: var(--primary-color);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════════════════════════════ */

nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 15px;
    padding: 15px 0;
    position: relative;
    font-family: var(--ascii-font-family);
}

nav::before {
    content: '';
    position: absolute;
    top: -15px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--primary-color);
    opacity: 0.7;
    box-shadow: 0 0 5px var(--primary-color);
    pointer-events: none;
}

nav::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--primary-color);
    opacity: 0.7;
    box-shadow: 0 0 5px var(--primary-color);
    pointer-events: none;
}


/* ═══════════════════════════════════════════════════════════════════════════════
   PAGE CONTAINERS
   ═══════════════════════════════════════════════════════════════════════════════ */

.page {
    display: none;
    position: relative;
    padding: 20px 0;
    font-family: var(--ascii-font-family);
}

.page.active {
    display: block;
}

/* ASCII разделитель перед контентом страницы */
.page.active::before {
    content: '╬════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════╬';
    display: block;
    width: 100%;
    text-align: center;
    color: var(--primary-color);
    opacity: 0.6;
    font-family: var(--ascii-font-family);
    font-size: 0.4em;
    margin: 0 0 20px 0;
    white-space: nowrap;
    overflow: hidden;
    text-shadow: 0 0 3px var(--primary-color);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.app {
    position: relative;
    z-index: 10;
    border: 1px solid var(--border);
    margin: 10px auto;
    max-width: 1400px;
    padding: 20px;
    box-shadow:
            0 0 20px rgba(var(--primary-rgb), 0.2),
            inset 0 0 30px rgba(var(--primary-rgb), 0.05);
    background: rgba(0, 0, 0, 0.3);
}

/* ═══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1400px) {
    .container { padding: var(--space-lg); }
}

@media (max-width: 1200px) {
    .app { padding: var(--space-lg); }
}

@media (max-width: 1024px) {
    .container { max-width: 100%; }
}

@media (max-width: 768px) {
    .app {
        margin: var(--space-xs) auto;
        padding: var(--space-md);
    }
    .container { padding: var(--space-md); }
}

@media (max-width: 480px) {
    .app {
        margin: 0;
        border-left: none;
        border-right: none;
        padding: var(--space-xs);
    }
    .container { padding: var(--space-xs); }
    header { padding: 10px 0; }
    .header-content { gap: 4px; }
    .header-content::after { display: none; }
    .page.active::before { display: none; }
    nav {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-xs);
        margin-top: 8px;
        padding: 8px 0;
    }
    .nav-btn {
        min-width: unset;
        width: 100%;
        padding: 8px 12px;
        font-size: 12px;
    }
    .nav-btn::before, .nav-btn::after {
        font-size: 10px;
    }
}