:root {
    --space-dark: #06111f;
    --space-blue: #0d2b4d;
    --space-mid: #123f6f;
    --rocket-orange: #f28c28;
    --rocket-orange-soft: #fff1df;
    --page-bg: #eef4fa;
    --card-border: #d5e3f2;
    --text-dark: #071426;
}

html,
body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--page-bg);
    color: var(--text-dark);
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

/* MAIN LAYOUT */

.page {
    min-height: 100vh;
    display: flex;
    background: var(--page-bg);
}

.sidebar {
    width: 250px;
    min-height: 100vh;
    background: radial-gradient(circle at top, rgba(242, 140, 40, 0.22), transparent 28%), linear-gradient(180deg, var(--space-dark) 0%, var(--space-blue) 55%, var(--space-mid) 100%);
    color: white;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.top-row {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 28px;
    background: #ffffff;
    border-bottom: 1px solid #d8e2f0;
}

    .top-row a {
        color: var(--space-mid);
        text-decoration: none;
        font-weight: 800;
    }

.content {
    flex: 1;
    min-height: calc(100vh - 64px);
    padding: 0;
}

/* NAV MENU */

.nav-brand-area {
    padding: 22px 14px 18px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.16);
    text-align: center;
}

.brand-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 14px;
    background: #ffffff;
    padding: 6px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.nav-brand-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.2;
}

.nav-main-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
}

.nav-sub-title {
    margin-top: 5px;
    font-size: 0.78rem;
    color: #b9d7f2;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    padding: 16px 10px;
    gap: 8px;
}

.nav-link {
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    color: #d7e6f8;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.92rem;
}

    .nav-link:hover {
        background: rgba(255, 255, 255, 0.12);
        color: white;
    }

    .nav-link.active {
        background: rgba(255, 255, 255, 0.22);
        color: white;
        border-left: 4px solid var(--rocket-orange);
    }

/* HOME PAGE */

.home-page {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.home-hero {
    width: min(760px, 100%);
    padding: 46px 38px;
    text-align: center;
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(7, 20, 38, 0.12);
}

.rocket-badge {
    display: inline-block;
    margin-bottom: 16px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--rocket-orange-soft);
    color: #9a4b00;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.home-hero h1 {
    margin: 0 0 16px 0;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--space-dark);
}

.home-hero p {
    max-width: 620px;
    margin: 0 auto 28px auto;
    font-size: 1.08rem;
    line-height: 1.6;
}

.start-button {
    display: inline-block;
    padding: 13px 24px;
    border-radius: 14px;
    background: var(--space-mid);
    color: white;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 10px 22px rgba(18, 63, 111, 0.25);
}

    .start-button:hover {
        background: var(--rocket-orange);
        color: white;
    }

/* ROCKETSHELL GAME PAGE */

.game-shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px;
    display: grid;
    gap: 18px;
}

.intro {
    max-width: 800px;
    margin: 0 auto 20px auto;
    text-align: center;
    font-size: 1.1rem;
}

.status-card,
.cargo-card,
.message-card,
.end-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

    .status-card h2,
    .cargo-card h2,
    .message-card h2,
    .end-card h2 {
        margin-top: 0;
    }

    .cargo-card select {
        width: 100%;
        max-width: 320px;
        padding: 10px;
        margin-bottom: 12px;
        border-radius: 8px;
        border: 1px solid #b8c7d9;
    }

    .cargo-card button {
        display: block;
        width: 100%;
        margin: 10px 0 0 0;
        padding: 10px 16px;
        border: none;
        border-radius: 10px;
        background: var(--space-mid);
        color: white;
        cursor: pointer;
    }

        .cargo-card button:hover {
            background: var(--rocket-orange);
        }

        .cargo-card button:disabled {
            background: #999;
            cursor: not-allowed;
        }

.end-card {
    border-color: var(--rocket-orange);
    background: var(--rocket-orange-soft);
}
.cargo-explanation {
    margin: 10px 0 14px 0;
    padding: 12px 14px;
    background: #eef4fa;
    border: 1px solid #d8e2f0;
    border-left: 5px solid var(--space-mid);
    border-radius: 12px;
    font-weight: 700;
    line-height: 1.45;
}
    .cargo-explanation p {
        margin: 0 0 6px 0;
    }

        .cargo-explanation p:last-child {
            margin-bottom: 0;
        }
.stat-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 12px 0 6px 0;
    font-size: 0.95rem;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: #dce8f5;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--space-mid);
    border-radius: 999px;
    transition: width 0.35s ease;
}

.rocket-health {
    background: var(--rocket-orange);
}

.fuel-level {
    background: #1f8fdd;
}
.message-card {
    border-left: 6px solid var(--space-mid);
}

    .message-card.success {
        border-left-color: #1f8f55;
        background: #f0fff6;
    }

    .message-card.storm {
        border-left-color: #2f6fba;
        background: #f1f7ff;
    }

    .message-card.warning {
        border-left-color: var(--rocket-orange);
        background: #fff8ef;
    }

    .message-card.failed {
        border-left-color: #b32121;
        background: #fff1f1;
    }

.mission-report-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .mission-report-header h2 {
        margin: 0;
    }

.mission-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--space-mid);
    color: white;
    font-weight: 900;
}
.objective-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    grid-column: span 2;
}

    .objective-card h2 {
        margin-top: 0;
    }

.objective-line {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    background: #eef4fa;
    border: 1px solid #d8e2f0;
}

    .objective-line span {
        width: 28px;
        height: 28px;
        border-radius: 999px;
        background: var(--space-mid);
        color: white;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-weight: 900;
        flex-shrink: 0;
    }

    .objective-line p {
        margin: 0;
        font-weight: 700;
    }

    .objective-line.done {
        background: #f0fff6;
        border-color: #b7e7c8;
    }

        .objective-line.done span {
            background: #1f8f55;
        }

/* BLAZOR ERROR UI */

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* RESPONSIVE */

@media (min-width: 800px) {
    .game-shell {
        grid-template-columns: 1fr 1fr;
    }

    .objective-card,
    .crew-card,
    .tip-card,
    .cargo-card,
    .level-card,
    .message-card,
    .danger-card,
    .end-card {
        grid-column: span 2;
    }
}
.crew-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    grid-column: span 2;
}

    .crew-card h2 {
        margin-top: 0;
    }

.crew-button {
    display: inline-block;
    margin-top: 10px;
    padding: 12px 18px;
    border: none;
    border-radius: 12px;
    background: var(--rocket-orange);
    color: white;
    font-weight: 800;
    cursor: pointer;
}

    .crew-button:hover {
        background: #d87412;
    }

    .crew-button:disabled {
        background: #999;
        cursor: not-allowed;
    }

.crew-morale {
    background: #1f8f55;
}

.tip-card {
    background: #fff8ef;
    border: 1px solid #f6c78f;
    border-left: 6px solid var(--rocket-orange);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    grid-column: span 2;
}

    .tip-card h2 {
        margin-top: 0;
        color: #9a4b00;
    }

    .tip-card p {
        margin-bottom: 0;
        font-weight: 700;
    }
.level-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-left: 6px solid var(--rocket-orange);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    grid-column: span 2;
}

    .level-card h2 {
        margin-top: 0;
    }
.danger-card {
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    grid-column: span 2;
    border: 1px solid #efb8b8;
    border-left: 6px solid #b32121;
    background: #fff1f1;
}

.danger-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.danger-icon {
    width: 46px;
    height: 46px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
    flex-shrink: 0;
    background: #b32121;
    color: white;
}

.danger-card h2 {
    margin: 0 0 8px 0;
}

.danger-card p {
    margin: 0;
    font-weight: 700;
}

/* Danger types */

.danger-power {
    background: #fff8ef;
    border-color: #f6c78f;
    border-left-color: #f28c28;
}

    .danger-power .danger-icon {
        background: #f28c28;
    }

.danger-oxygen {
    background: #eef8ff;
    border-color: #add8f6;
    border-left-color: #1f8fdd;
}

    .danger-oxygen .danger-icon {
        background: #1f8fdd;
    }

.danger-food {
    background: #f4fff2;
    border-color: #b9e7b3;
    border-left-color: #1f8f55;
}

    .danger-food .danger-icon {
        background: #1f8f55;
    }

.danger-shelter {
    background: #fff1f1;
    border-color: #efb8b8;
    border-left-color: #b32121;
}

    .danger-shelter .danger-icon {
        background: #b32121;
    }

.danger-rocket {
    background: #f5f1ff;
    border-color: #cdbdf7;
    border-left-color: #5f3dc4;
}

    .danger-rocket .danger-icon {
        background: #5f3dc4;
    }

.emergency-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

    .emergency-actions button {
        padding: 10px 14px;
        border: none;
        border-radius: 10px;
        background: #b32121;
        color: white;
        font-weight: 800;
        cursor: pointer;
    }

        .emergency-actions button:hover {
            background: #8a1515;
        }

        .emergency-actions button:disabled {
            background: #999;
            cursor: not-allowed;
        }
.danger-power .emergency-actions button {
    background: #f28c28;
}

    .danger-power .emergency-actions button:hover {
        background: #d87412;
    }

.danger-oxygen .emergency-actions button {
    background: #1f8fdd;
}

    .danger-oxygen .emergency-actions button:hover {
        background: #176da8;
    }

.danger-food .emergency-actions button {
    background: #1f8f55;
}

    .danger-food .emergency-actions button:hover {
        background: #176d41;
    }

.danger-shelter .emergency-actions button {
    background: #b32121;
}

    .danger-shelter .emergency-actions button:hover {
        background: #8a1515;
    }

.danger-rocket .emergency-actions button {
    background: #5f3dc4;
}

    .danger-rocket .emergency-actions button:hover {
        background: #43279b;
    }
.mars-scene {
    position: relative;
    min-height: calc(100vh - 64px);
    padding: 28px 24px 60px 24px;
    overflow: hidden;
    background: radial-gradient(circle at 78% 12%, rgba(255, 210, 150, 0.55), transparent 8%), linear-gradient(180deg, #162b46 0%, #355a78 34%, #d99a6c 68%, #8f3f2a 100%);
}

    .mars-scene::before {
        content: "";
        position: absolute;
        left: -10%;
        right: -10%;
        bottom: -80px;
        height: 260px;
        background: radial-gradient(circle at 25% 20%, rgba(255, 210, 150, 0.28), transparent 18%), radial-gradient(circle at 68% 30%, rgba(98, 43, 28, 0.32), transparent 20%), linear-gradient(180deg, #b75f36 0%, #74301f 100%);
        border-radius: 50% 50% 0 0;
        z-index: 0;
    }

    .mars-scene::after {
        content: "";
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.10), transparent 2%), radial-gradient(circle at 72% 22%, rgba(255,255,255,0.08), transparent 2%), radial-gradient(circle at 45% 45%, rgba(255,255,255,0.06), transparent 2%);
        opacity: 0.7;
        z-index: 0;
        pointer-events: none;
    }

.mars-sky {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.sun {
    position: absolute;
    top: 46px;
    right: 90px;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: #ffd28f;
    box-shadow: 0 0 55px rgba(255, 210, 143, 0.75);
}

.mars-planet {
    position: absolute;
    top: 95px;
    left: 14%;
    width: 105px;
    height: 105px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #e28a55 0%, #b85232 45%, #6e2c20 100%);
    opacity: 0.65;
    box-shadow: inset -18px -18px 26px rgba(0,0,0,0.22);
}

.game-title,
.intro,
.game-shell {
    position: relative;
    z-index: 1;
}

.game-title {
    margin: 0 0 12px 0;
    text-align: center;
    color: #ffffff;
    text-shadow: 0 3px 10px rgba(0,0,0,0.35);
}

.mars-scene .intro {
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.mars-scene .status-card,
.mars-scene .level-card,
.mars-scene .objective-card,
.mars-scene .tip-card,
.mars-scene .crew-card,
.mars-scene .danger-card,
.mars-scene .cargo-card,
.mars-scene .message-card,
.mars-scene .end-card {
    backdrop-filter: blur(4px);
    background-color: rgba(255, 255, 255, 0.94);
}
@media (max-width: 700px) {
    .mars-scene {
        padding: 22px 12px 44px 12px;
    }

    .sun {
        width: 48px;
        height: 48px;
        top: 24px;
        right: 24px;
    }

    .mars-planet {
        width: 70px;
        height: 70px;
        top: 70px;
        left: 8%;
    }
}

@media (max-width: 700px) {
    .page {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
    }

    .nav-brand-area {
        flex-direction: row;
        justify-content: center;
    }

    .nav-menu {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }

    .content {
        min-height: auto;
    }

    .home-page {
        min-height: auto;
        padding: 24px 14px;
    }

    .home-hero {
        padding: 32px 20px;
    }
}
/* FINAL MOBILE FIX FOR ROCKETSHELL */

* {
    box-sizing: border-box;
}

.game-shell {
    width: 100%;
}

.status-card,
.cargo-card,
.message-card,
.end-card,
.objective-card,
.crew-card,
.tip-card,
.level-card,
.danger-card {
    min-width: 0;
    max-width: 100%;
}

/* Phone layout */
@media (max-width: 799px) {
    .mars-scene {
        padding: 14px 8px 34px 8px;
    }

    .game-shell {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 12px;
        padding: 14px 8px;
        width: 100%;
        max-width: 100%;
    }

    .level-card,
    .objective-card,
    .status-card,
    .tip-card,
    .danger-card,
    .cargo-card,
    .crew-card,
    .message-card,
    .end-card {
        grid-column: 1 / -1 !important;
        width: 100%;
        max-width: 100%;
        padding: 14px;
        border-radius: 14px;
    }

        .level-card h2,
        .objective-card h2,
        .status-card h2,
        .tip-card h2,
        .danger-card h2,
        .cargo-card h2,
        .crew-card h2,
        .message-card h2,
        .end-card h2 {
            font-size: 1.45rem;
            margin-bottom: 12px;
        }

        .level-card p,
        .status-card p,
        .tip-card p,
        .cargo-card p,
        .crew-card p,
        .message-card p,
        .end-card p {
            margin: 6px 0;
            line-height: 1.35;
        }

    .objective-line {
        padding: 8px 10px;
        margin-bottom: 7px;
        gap: 10px;
    }

        .objective-line span {
            width: 26px;
            height: 26px;
            font-size: 0.9rem;
        }

    .stat-line {
        gap: 12px;
        margin: 8px 0 4px 0;
        font-size: 0.95rem;
    }

    .progress-bar {
        height: 10px;
        margin-bottom: 8px;
    }

    .cargo-card select {
        width: 100%;
        max-width: 100%;
        padding: 9px;
        margin-bottom: 10px;
        font-size: 1rem;
    }

    .cargo-explanation {
        width: 100%;
        max-width: 100%;
        padding: 10px 12px;
        margin: 8px 0 12px 0;
        line-height: 1.35;
        font-size: 0.95rem;
        overflow-wrap: break-word;
        word-break: normal;
    }

    .cargo-card button,
    .emergency-actions button,
    .crew-button {
        display: block;
        width: 100%;
        margin: 8px 0 0 0;
        padding: 11px 12px;
        border-radius: 10px;
        font-size: 0.95rem;
    }
}