/* =========================================
   1. BASE & RESETS
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body, h1, h2, h3, p, ul {
    margin: 0;
    padding: 0;
    font-family: 'Courier New', Courier, monospace, Arial, sans-serif;
}

html, body {
    height: 100%;
}

body {
    background: #08080f url('img/bg1.png') center center / cover no-repeat fixed;
    color: #fff;
    text-align: center;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #00ffff #08080f;
}

body::-webkit-scrollbar {
    width: 6px;
}
body::-webkit-scrollbar-track {
    background: #08080f;
}
body::-webkit-scrollbar-thumb {
    background: #00ffff;
    border-radius: 3px;
}

/* =========================================
   2. TYPOGRAPHY & NAVIGATION
   ========================================= */
h1, h2, h3 {
    text-align: center;
}

header h1 {
    font-family: 'Brush Script MT', cursive, sans-serif;
    font-size: 2.2em;
    color: #ff007f;
    text-shadow: 0 0 10px #ff007f, 0 0 20px #ff007f;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 15px;
    padding: 0;
}

nav li {
    display: inline-block;
}

nav a {
    color: #a0aec0;
    text-decoration: none;
    font-size: 0.95em;
    padding: 6px 12px;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

nav a:hover, nav a.active {
    color: #00ffff;
    border-color: rgba(0, 255, 255, 0.4);
    background: rgba(0, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
}

/* =========================================
   3. LAYOUT CONTAINERS
   ========================================= */
.centered {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 10px;
}

section {
    padding: 15px;
}

body.scrollable {
    overflow-y: auto;
    height: 100%;
    padding-bottom: 80px;
}

/* =========================================
   4. HEADER & TELEMETRY
   ========================================= */
header {
    background: rgba(8, 8, 15, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-link img {
    filter: drop-shadow(0 0 6px #ff007f);
    transition: transform 0.3s ease;
}
.logo-link img:hover {
    transform: scale(1.05);
}

.telemetry {
    font-family: monospace;
    font-size: 0.85em;
    color: #00ffff;
    background: rgba(0, 10, 20, 0.8);
    /* Pull the bar to the edges, ignoring the header's 12px 20px padding */
    margin: -12px -20px 12px -20px;
    padding: 6px 20px;
    display: flex;
    justify-content: center; 
    align-items: center;
    border-bottom: 1px dashed rgba(0, 255, 255, 0.3);
    border-radius: 0;
}

.neon-text {
    color: #ff007f;
    text-shadow: 0 0 5px #ff007f, 0 0 10px #ff007f;
}
.neon-text-green {
    color: #00ff88;
    text-shadow: 0 0 5px #00ff88;
}
.neon-text-title {
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
    margin-bottom: 10px;
}

/* =========================================
   5. S.A.R.A. DASHBOARD & 3D MODEL VIEWER
   ========================================= */
.sara-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.model-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 480px;
    height: 100%;
    background: rgba(0, 15, 25, 0.6);
    position: relative;
    padding: 10px;
}

model-viewer {
    width: 100%;
    height: 400px;
    display: block;
    margin: auto;
    --poster-color: transparent;
}

.model-info-tag {
    font-size: 0.8em;
    color: #00ffff;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 10px;
    border-radius: 3px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    margin-top: 5px;
}

.terminal-container {
    background: rgba(4, 8, 16, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 480px;
    font-family: 'Courier New', Courier, monospace;
    text-align: left;
    padding: 15px;
    border: 1px solid rgba(0, 255, 255, 0.4);
}

.hud-label {
    font-size: 0.75em;
    color: #00ffff;
    letter-spacing: 1px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    padding-bottom: 4px;
    text-transform: uppercase;
}

.hud-label-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    padding-bottom: 4px;
}

.terminal-output {
    flex-grow: 1;
    overflow-y: auto;
    color: #00ffff;
    font-size: 0.85em;
    line-height: 1.5;
    padding-right: 5px;
    margin-bottom: 10px;
}

.terminal-output p {
    margin-bottom: 6px;
    word-break: break-word;
}

.sys-msg { color: #a0aec0; }
.user-msg { color: #ffffff; font-weight: bold; }
.sara-msg { color: #ff007f; }

.terminal-input-wrapper {
    display: flex;
    align-items: center;
    border-top: 1px solid rgba(0, 255, 255, 0.3);
    padding-top: 10px;
    gap: 8px;
}

.prompt-symbol {
    color: #ff007f;
    font-weight: bold;
    font-size: 0.85em;
}

.terminal-input-wrapper input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 4px;
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    flex-grow: 1;
    outline: none;
    padding: 8px 10px;
    font-size: 0.85em;
}

.terminal-input-wrapper input:focus {
    border-color: #00ffff;
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.4);
}

.hud-btn {
    background: rgba(255, 0, 127, 0.2);
    color: #ff007f;
    border: 1px solid #ff007f;
    padding: 6px 14px;
    font-family: inherit;
    font-size: 0.8em;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.hud-btn:hover {
    background: #ff007f;
    color: #fff;
    box-shadow: 0 0 10px #ff007f;
}

.hud-btn-small {
    background: rgba(0, 255, 255, 0.15);
    color: #00ffff;
    border: 1px solid #00ffff;
    padding: 4px 8px;
    font-size: 0.7em;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
}
.hud-btn-small:hover {
    background: #00ffff;
    color: #000;
}

/* =========================================
   6. CAROUSEL & VIDEO TAB
   ========================================= */
.video-hologram {
    max-width: 900px;
    margin: 0 auto;
}

.carousel-container {
    position: relative;
    width: 100%;
    margin: 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-track-wrapper {
    overflow: hidden;
    width: 100%;
    border-radius: 4px;
}

.carousel {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    width: 100%;
}

.carousel-item {
    min-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.carousel-item img {
    max-width: 100%;
    max-height: 380px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.8);
}

.slide-caption {
    margin-top: 8px;
    font-size: 0.85em;
    color: #00ffff;
    background: rgba(0, 0, 0, 0.6);
    padding: 4px 12px;
    border-radius: 3px;
}

.carousel-button {
    background: rgba(0, 0, 0, 0.7);
    color: #00ffff;
    border: 1px solid #00ffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin: 0 10px;
    user-select: none;
}
.carousel-button:hover {
    background: #00ffff;
    color: #000;
    box-shadow: 0 0 10px #00ffff;
}

.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}
.carousel-dot {
    width: 10px;
    height: 10px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 255, 255, 0.3);
    cursor: pointer;
    transition: background 0.3s ease;
}
.carousel-dot.active {
    background: #ff007f;
    box-shadow: 0 0 6px #ff007f;
}

/* =========================================
   7. GAME EMBED & AUDIO CONTROLS
   ========================================= */


.game-hologram {
    max-width: 1314px;
    margin: 0 auto;
}

.game-container {
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    width: 100%;
}

#full-embed iframe {
    width: 100%;
    aspect-ratio: 1280 / 740;
    max-height: none;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 4px;
}

/* =========================================
   8. RADIO & PERSISTENT AUDIO WIDGET
   ========================================= */
.now-playing-box {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 255, 255, 0.05);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 4px;
    text-align: center;
}

.radio-deck-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px 20px;
}

.audio-visualizer-mock {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 6px;
    height: 80px;
    margin: 25px 0;
}

.audio-visualizer-mock .bar {
    width: 10px;
    background: linear-gradient(to top, #ff007f, #00ffff);
    height: 20%;
    border-radius: 2px;
    animation: barJump 1.2s infinite ease-in-out alternate;
}

.audio-visualizer-mock .bar:nth-child(2n) { animation-delay: 0.2s; }
.audio-visualizer-mock .bar:nth-child(3n) { animation-delay: 0.4s; }
.audio-visualizer-mock .bar:nth-child(4n) { animation-delay: 0.1s; }
.audio-visualizer-mock .bar:nth-child(5n) { animation-delay: 0.5s; }

@keyframes barJump {
    0% { height: 10%; }
    100% { height: 95%; }
}

.audio-visualizer-mock.paused .bar {
    animation: none;
    height: 10%;
    background: #a0aec0; /* Grays out the visualizer to clearly indicate pause */
}

.persistent-audio {
    position: fixed !important;
    bottom: 40px; /* Lowered significantly to clear scroll content */
    right: 0px;
    width: 320px;
    padding: 0;
    z-index: 999;
    background: rgba(8, 12, 22, 0.92);
    border: 1px solid #00ffff;
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 255, 255, 0.15);
    padding: 6px 12px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.3);
    font-size: 0.75em;
    color: #00ffff;
}

.widget-title {
    font-weight: bold;
    letter-spacing: 0.5px;
}

.widget-toggle-btn {
    background: transparent;
    border: 1px solid #00ffff;
    color: #00ffff;
    width: 22px;
    height: 22px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.widget-toggle-btn:hover {
    background: #00ffff;
    color: #000;
}

.widget-body {
    overflow: hidden;
    transition: max-height 0.3s ease;
    max-height: 150px;
}

.persistent-audio.minimized {
    width: 200px;
}

.persistent-audio.minimized .widget-body {
    max-height: 0;
    display: none;
}

/* =========================================
   9. HOLOGRAM CONTAINER & CRT FX
   ========================================= */
.hologram-container {
    position: relative;
    padding: 16px;
    background-color: rgba(0, 20, 30, 0.45);
    border: 1px solid #00ffff;
    border-radius: 6px;
    width: 100%;
    box-shadow: 
        0 0 8px rgba(0, 255, 255, 0.3),
        inset 0 0 10px rgba(0, 255, 255, 0.1);
    animation: hologram-flicker 6s infinite linear;
}

.hologram-container::after {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 255, 0.05),
        rgba(0, 255, 255, 0.05) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
}

@keyframes hologram-flicker {
    0%   { opacity: 0.98; }
    50%  { opacity: 0.94; }
    100% { opacity: 0.98; }
}

.crt::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 999;
    background-size: 100% 3px, 6px 100%;
    pointer-events: none;
}

.active-screen { display: flex !important; }
.hidden { display: none !important; }
.route-section { display: none; animation: fadeIn 0.4s ease-in; }
.active-route { display: block; }

/* Center the boot screen completely */
#boot-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background: #08080f;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.boot-terminal {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: #00ffff;
    font-family: 'Courier New', Courier, monospace;
}
.boot-logo { width: 100px; margin-bottom: 20px; animation: pulse 2s infinite; }

.text-container, .text-container-game {
    background-color: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 4px;
    display: inline-block;
    padding: 10px 20px;
    margin-top: 15px;
    max-width: 800px;
}

footer {
    color: #a0aec0;
    text-align: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 10;
    background-color: rgba(4, 6, 12, 0.9);
    padding: 10px;
    font-size: 0.8em;
    border-top: 1px solid rgba(0, 255, 255, 0.2);
}


/* Social List Styling */
.social-links-wrapper {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.social-list {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}

.social-list li {
    margin-bottom: 10px;
}

.social-list a {
    display: block;
    color: #00e5ff;
    text-decoration: none;
    background: rgba(0, 255, 255, 0.1);
    padding: 10px 15px;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 4px;
    transition: background 0.3s, color 0.3s;
}

.social-list a:hover {
    background: #00e5ff;
    color: #000;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

/* =========================================
   10. MEDIA QUERIES
   ========================================= */
@media screen and (max-width: 900px) {
    .sara-dashboard { grid-template-columns: 1fr; }
    .terminal-container, .model-wrapper { height: auto; min-height: 380px; }
    .persistent-audio { width: 260px; right: 10px; bottom: 45px; }
    header .header-content { flex-direction: column; align-items: center; }
}

@media screen and (max-width: 768px) {
    /* Hide the playable web build */
    .desktop-game-embed {
        display: none !important;
    }
    
    /* Show the smaller itch widget */
    .mobile-game-embed {
        display: block !important;
    }
}

@media screen and (max-width: 600px) {
    nav ul { flex-wrap: wrap; justify-content: center; }
    .carousel-button { width: 30px; height: 30px; font-size: 14px; margin: 0 2px; }
}

#netnavi-entity {
        position: fixed;
        top: 0;
        left: 0;
        width: 64px;
        height: 64px;
        z-index: 99999;
        pointer-events: auto;
        cursor: pointer;
        user-select: none; 
        opacity: 0; 
        transition: opacity 0.5s ease;
    }

    #netnavi-entity.navi-visible {
        opacity: 1;
    }

    /* ATHENA.EXE Hover Nameplate */
    .navi-label {
        position: absolute;
        top: -20px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 20, 40, 0.9);
        color: #ff007f;
        border: 1px solid #ff007f;
        font-family: monospace;
        font-weight: bold;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 12px;
        opacity: 0;
        transition: opacity 0.2s;
        pointer-events: none;
        white-space: nowrap;
        box-shadow: 0 0 5px rgba(255, 0, 127, 0.5);
    }

    #netnavi-entity:hover .navi-label {
        opacity: 1;
    }

    .navi-sprite {
        width: 64px;
        height: 64px;
        background-image: url('img/SF_Actor3_8.png');
        background-repeat: no-repeat;
        --col-x: 0px; 
        --row-y: -64px; 
        animation: play-sprite 0.6s steps(3, end) infinite;
        filter: drop-shadow(0px 4px 2px rgba(0,255,255,0.3));
    }

    @keyframes play-sprite {
        from { background-position: var(--col-x) var(--row-y); }
        to { background-position: calc(var(--col-x) - 192px) var(--row-y); }
    }



/* =========================================
   11. MEGA MAN BATTLE NETWORK - NAVI STYLING
   ========================================= */

/* Elemental Affinity Overlay */
#netnavi-entity[data-element="Heat"] .navi-label {
    color: #ff4500;
    border-color: #ff4500;
    box-shadow: 0 0 6px rgba(255, 69, 0, 0.6);
}
#netnavi-entity[data-element="Heat"] .navi-sprite {
    filter: drop-shadow(0px 4px 2px rgba(255, 69, 0, 0.8));
}

#netnavi-entity[data-element="Aqua"] .navi-label {
    color: #1e90ff;
    border-color: #1e90ff;
    box-shadow: 0 0 6px rgba(30, 144, 255, 0.6);
}
#netnavi-entity[data-element="Aqua"] .navi-sprite {
    filter: drop-shadow(0px 4px 2px rgba(30, 144, 255, 0.8));
}

#netnavi-entity[data-element="Wood"] .navi-label {
    color: #32cd32;
    border-color: #32cd32;
    box-shadow: 0 0 6px rgba(50, 205, 50, 0.6);
}
#netnavi-entity[data-element="Wood"] .navi-sprite {
    filter: drop-shadow(0px 4px 2px rgba(50, 205, 50, 0.8));
}

#netnavi-entity[data-element="Elec"] .navi-label {
    color: #ffd700;
    border-color: #ffd700;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.6);
}
#netnavi-entity[data-element="Elec"] .navi-sprite {
    filter: drop-shadow(0px 4px 2px rgba(255, 215, 0, 0.8));
}

#netnavi-entity[data-element="Null"] .navi-label {
    color: #cccccc;
    border-color: #cccccc;
    box-shadow: 0 0 6px rgba(204, 204, 204, 0.6);
}
#netnavi-entity[data-element="Null"] .navi-sprite {
    filter: drop-shadow(0px 4px 2px rgba(204, 204, 204, 0.8));
}

/* Dark Soul Override (Darkloid/Bug Threshold) */
#netnavi-entity[data-darksoul="true"] .navi-label {
    color: #8a2be2 !important;
    border-color: #8a2be2 !important;
    background: rgba(20, 0, 40, 0.9) !important;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.8) !important;
}
#netnavi-entity[data-darksoul="true"] .navi-sprite {
    filter: drop-shadow(0px 4px 2px rgba(138, 43, 226, 0.8)) hue-rotate(270deg) saturate(1.5) !important;
}