:root {
    --orange: #ff9900; --purple: #cc99cc; --blue: #9999ff; --tan: #ffcc66;
}

/* BASE RESET */
html, body {
    background: black; color: white; font-family: 'Antonio', sans-serif;
    margin: 0; padding: 0; height: 100%; width: 100%; overflow: hidden;
    text-transform: uppercase;
}

/* MOBILE FIRST LAYOUT (Default) */
.lcars-app {
    display: flex;
    flex-direction: column; /* Stack vertically on phones */
    height: 100dvh;
    width: 100vw;
    padding: 10px;
    box-sizing: border-box;
    gap: 10px;
}

.lcars-header {
    height: 45px;
    flex-shrink: 0;
}

.header-bar {
    height: 100%;
    background: var(--orange);
    border-radius: 0 20px 20px 0;
    display: flex;
    align-items: center;
    padding: 0 20px;
    font-weight: bold;
    color: black;
    font-size: 1.1rem;
}

/* VIEWSCREEN FIX */
#viewscreen-container {
    flex-grow: 1; /* Greedy expansion */
    position: relative;
    border: 4px solid var(--blue);
    border-radius: 15px;
    background: black;
    min-height: 0; /* Prevents container from collapsing to iframe default */
}

#bridge-viewscreen {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* NAVIGATION (Mobile Dock) */
.lcars-sidebar {
    height: auto;
    display: flex;
    flex-direction: row; /* Horizontal on phones */
    gap: 10px;
    flex-shrink: 0;
    /* Respects Android/iOS system navigation bars */
    padding-bottom: env(safe-area-inset-bottom, 15px);
}

.nav-item {
    flex: 1;
    height: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
}

.elbow-top, .elbow-bottom { display: none; } /* Hide decoration on mobile */

/* DESKTOP OVERRIDE (Screens > 768px) */
@media (min-width: 769px) {
    .lcars-app {
        flex-direction: row; /* Sidebar on left */
        padding: 15px;
        gap: 15px;
    }

    .lcars-sidebar {
        flex-direction: column;
        width: 180px;
        height: 100%;
        padding-bottom: 0;
    }

    .elbow-top { display: block; height: 80px; border-top-left-radius: 40px; background: var(--purple); }
    .elbow-bottom { display: block; flex-grow: 1; border-bottom-left-radius: 40px; background: var(--blue); }

    .nav-item {
        flex: none;
        height: auto;
        padding: 20px;
        border-radius: 0;
        text-align: right;
        justify-content: flex-end;
    }

    .lcars-content {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        gap: 15px;
    }
}

.color-blue { background: var(--blue); }
.color-tan { background: var(--tan); }
