﻿
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600;700;800&family=Rajdhani:wght@400;500;600;700&family=Russo+One&family=Fredoka:wght@500;700&display=swap');

:root {
    --cyan: #38d9ff;
    --blue: #268cff;
    --green: #4dffb5;
    --red: #ff496c;
    --purple: #9b7bff;
    --text: #e7f4ff;
    --muted: #829bb5;
    --panel: rgba(10, 22, 42, 0.91);
    --type-micro: clamp(0.5625rem, calc(0.54rem + 0.1vw), 0.625rem);
    --type-label: clamp(0.625rem, calc(0.6rem + 0.1vw), 0.6875rem);
    --type-small: clamp(0.6875rem, calc(0.66rem + 0.12vw), 0.8125rem);
    --type-reading: clamp(0.75rem, calc(0.72rem + 0.16vw), 0.8rem);
    --type-body: clamp(0.9rem, calc(0.86rem + 0.18vw), 1rem);
    --type-lead: clamp(0.95rem, calc(0.9rem + 0.25vw), 1.0625rem);
    --type-question: clamp(1rem, calc(0.94rem + 0.35vw), 1.125rem);
    --type-display: clamp(1.75rem, calc(1.4rem + 1.2vw), 2.6875rem);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 90px 20px 65px;
    background: #050b16;
    color: var(--text);
    font-family: 'Russo One', sans-serif;
    font-size: var(--type-body);
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(56,217,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56,217,255,.035) 1px, transparent 1px);
    background-size: 45px 45px;
    mask-image: linear-gradient(to bottom, black, transparent 90%);
}

button {
    font-family: inherit;
}

/* BACKGROUND ENVIRONMENT */

.cyber-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.ambient {
    position: absolute;
    width: 480px;
    height: 480px;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .13;
    animation: ambientDrift 16s ease-in-out infinite alternate;
}

.ambient-one {
    background: #087bff;
    top: 5%;
    left: 12%;
}

.ambient-two {
    background: #763cff;
    bottom: -15%;
    right: 5%;
    animation-delay: -7s;
}

@keyframes ambientDrift {
    to {
        transform: translate(100px, 60px);
    }
}

.digital-rain {
    position: absolute;
    inset: 0;
    opacity: .075;
    overflow: hidden;
}

.digital-rain::before {
    content: "";
    position: absolute;
    inset: -75px 0;
    background: repeating-linear-gradient(
        180deg,
        transparent 0 35px,
        rgba(56,217,255,.18) 36px,
        transparent 37px
    );
    background-size: 100% 75px;
    animation: rainMove 16s linear infinite;
}

@keyframes rainMove {
    to { transform: translateY(75px); }
}

.cyber-background.paused *,
.cyber-background.paused *::before,
.cyber-background.paused *::after {
    animation-play-state: paused;
}

/* RADAR */

.radar {
    position: absolute;
    top: 17%;
    right: 10%;
    width: 220px;
    height: 220px;
    border: 1px solid rgba(56,217,255,.28);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(56,217,255,.04), transparent 70%);
    box-shadow: 0 0 45px rgba(38,140,255,.09);
}

.radar-ring {
    position: absolute;
    border: 1px solid rgba(56,217,255,.18);
    border-radius: 50%;
}

.ring-one { inset: 20%; }
.ring-two { inset: 40%; }
.ring-three { inset: 49%; }

.radar-cross {
    position: absolute;
    background: rgba(56,217,255,.18);
}

.radar-cross.horizontal {
    height: 1px;
    left: 0;
    right: 0;
    top: 50%;
}

.radar-cross.vertical {
    width: 1px;
    top: 0;
    bottom: 0;
    left: 50%;
}

.radar-sweep {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        transparent 280deg,
        rgba(56,217,255,.03) 310deg,
        rgba(56,217,255,.38) 360deg
    );
    animation: radarSpin 5s linear infinite;
}

.radar-dot {
    position: absolute;
    top: 31%;
    left: 66%;
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--green);
    animation: dotPulse 2s infinite alternate;
}

@keyframes radarSpin {
    to { transform: rotate(360deg); }
}

@keyframes dotPulse {
    to { opacity: .3; transform: scale(.6); }
}

/* NETWORK NODES */

.network-node {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 15px var(--cyan);
    animation: nodePulse 3s infinite alternate;
}

.node-one { top: 22%; left: 16%; }
.node-two { top: 64%; left: 80%; }
.node-three { top: 84%; left: 32%; }
.node-four { top: 42%; left: 91%; }
.node-five { top: 76%; left: 12%; }

@keyframes nodePulse {
    to { opacity: .25; transform: scale(1.8); }
}

.connection-line {
    position: absolute;
    height: 1px;
    transform-origin: left;
    background: linear-gradient(90deg, transparent, #38d9ff55, transparent);
}

.line-one {
    width: 270px;
    top: 22%;
    left: 16%;
    transform: rotate(25deg);
}

.line-two {
    width: 260px;
    top: 64%;
    left: 35%;
    transform: rotate(-20deg);
}

.line-three {
    width: 200px;
    top: 42%;
    left: 70%;
    transform: rotate(35deg);
}

.line-four {
    width: 220px;
    top: 75%;
    left: 12%;
    transform: rotate(-12deg);
}

/* DATA PACKETS */

.data-packet {
    position: absolute;
    left: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 13px var(--green);
}

.packet-one {
    top: 28%;
    animation: packetOne 12s linear infinite;
}

.packet-two {
    top: 60%;
    animation: packetTwo 15s linear infinite;
}

.packet-three {
    top: 82%;
    animation: packetOne 18s linear infinite;
}

@keyframes packetOne {
    from { transform: translateX(-10px); }
    to { transform: translateX(calc(100vw + 10px)); }
}

@keyframes packetTwo {
    from { transform: translateX(calc(100vw + 10px)); }
    to { transform: translateX(-10px); }
}

/* HUD PANELS */

.hud {
    width: 100%;
    min-width: 0;
    padding: clamp(0.75rem, 0.8vw, 0.9375rem);
    background: rgba(5,16,32,.72);
    border: 1px solid rgba(56,217,255,.25);
    color: #a4c7df;
    font-family: monospace;
    font-size: var(--type-label);
    line-height: 1.8;
    letter-spacing: 0.04em;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 25px rgba(56,217,255,.04);
    overflow-wrap: anywhere;
}

.hud span:not(.online-dot) {
    float: right;
    color: var(--cyan);
}

.hud .safe {
    color: var(--green) !important;
}

.hud-heading {
    color: var(--cyan);
    font-size: var(--type-small);
    border-bottom: 1px solid #38d9ff33;
    padding-bottom: 0.375rem;
    margin-bottom: 0.4375rem;
    letter-spacing: 0.08em;
}

.online-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--green);
    border-radius: 50%;
    box-shadow: 0 0 9px var(--green);
    margin-right: 5px;
    animation: dotPulse 2s infinite alternate;
}

/* TOP BAR */

.top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 65px;
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(56,217,255,.15);
    background: rgba(5,11,22,.75);
    backdrop-filter: blur(10px);
}

.brand {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.75rem, calc(0.68rem + 0.35vw), 0.9375rem);
    letter-spacing: 0.08em;
    font-weight: 700;
}

.brand span:last-child {
    color: var(--cyan);
}

.brand-icon {
    color: var(--cyan);
    margin-right: 0.5rem;
    font-size: clamp(1.125rem, calc(1rem + 0.5vw), 1.4375rem);
}

.connection-status {
    font-family: monospace;
    font-size: var(--type-label);
    color: var(--green);
    letter-spacing: 0.08em;
}

/* Three-column gameplay layout */

.game-layout {
    display: grid;
    grid-template-columns: minmax(205px, 250px) minmax(0, 900px) minmax(205px, 250px);
    grid-template-areas: "left game right";
    justify-content: center;
    align-items: stretch;
    gap: clamp(16px, 1.5vw, 28px);
    width: min(100%, 1580px);
    margin: 0 auto;
}

.panel-column {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: clamp(16px, 2vh, 24px);
    min-width: 0;
}

.left-column {
    grid-area: left;
}

.right-column {
    grid-area: right;
}

/* MAIN GAME CONSOLE */

.game-container {
    grid-area: game;
    width: 100%;
    max-width: 900px;
    min-width: 0;
    justify-self: center;
    margin: 0;
    position: relative;
    padding: 24px clamp(20px, 2vw, 36px);
    border: 1px solid rgba(56,217,255,.3);
    border-radius: 12px;
    background: var(--panel);
    backdrop-filter: blur(16px);
    box-shadow:
        0 0 50px rgba(0,0,0,.55),
        0 0 55px rgba(38,140,255,.08),
        inset 0 0 35px rgba(56,217,255,.025);
    animation: consoleEnter .8s ease-out;
}

@keyframes consoleEnter {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.game-container::before,
.game-container::after {
    content: "";
    position: absolute;
    width: 28px;
    height: 28px;
    border-color: var(--cyan);
    border-style: solid;
    pointer-events: none;
}

.game-container::before {
    top: -2px;
    left: -2px;
    border-width: 2px 0 0 2px;
}

.game-container::after {
    bottom: -2px;
    right: -2px;
    border-width: 0 2px 2px 0;
}

.console-top,
.console-bottom {
    display: flex;
    justify-content: space-between;
    color: #607d9b;
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: 0.12em;
}

.console-top {
    padding-bottom: clamp(0.5rem, 0.75vw, 0.75rem);
    border-bottom: 1px solid rgba(56,217,255,.15);
}

.console-bottom {
    margin-top: clamp(0.5rem, 1vw, 1rem);
    padding-top: clamp(0.5rem, 0.6vw, 0.625rem);
    border-top: 1px solid rgba(56,217,255,.15);
}

/* WELCOME SCREEN */

.screen {
    padding: clamp(1.375rem, 2vw, 2rem) 0 clamp(0.5rem, 0.75vw, 0.75rem);
    text-align: center;
}

#mission-screen {
    padding: clamp(0.875rem, 2vh, 1.375rem) 0 clamp(0.25rem, 0.5vh, 0.375rem);
    text-align: left;
}

.hero-icon {
    width: 66px;
    height: 66px;
    margin: 0 auto 22px;
    display: grid;
    place-items: center;
    font-size: clamp(1.65rem, calc(1.4rem + 0.8vw), 2.125rem);
    color: var(--cyan);
    border: 1px solid #38d9ff66;
    border-radius: 18px;
    background: rgba(56,217,255,.08);
    box-shadow: 0 0 30px #38d9ff22;
}

.eyebrow {
    color: var(--cyan);
    font-family: monospace;
    font-size: var(--type-label);
    letter-spacing: 0.12em;
    margin-bottom: 13px;
}

h1, h2, h3 {
    font-family: 'Orbitron', sans-serif;
}

h1 {
    font-size: var(--type-display);
    line-height: 1.3;
    letter-spacing: 0.05em;
    margin: 10px 0;
}

h1 span,
.result-heading span {
    color: var(--cyan);
    text-shadow: 0 0 20px #38d9ff44;
}

.hero-description {
    max-width: 430px;
    margin: 18px auto 26px;
    color: #9cb2ca;
    font-size: var(--type-lead);
    line-height: 1.5;
}

.mission-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid #38d9ff25;
    border-radius: 9px;
    background: rgba(56,217,255,.035);
    margin: clamp(1rem, 1.3vw, 1.5625rem) 0;
    padding: clamp(0.75rem, 0.9vw, 1.0625rem) 5px;
}

.mission-stats div + div {
    border-left: 1px solid #38d9ff25;
}

.mission-stats strong,
.mission-stats small {
    display: block;
}

.mission-stats strong {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.125rem, calc(1rem + 0.45vw), 1.375rem);
    color: var(--cyan);
}

.mission-stats small {
    margin-top: 0.375rem;
    color: var(--muted);
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: 0.08em;
}

/* BUTTONS */

.primary-btn {
    width: 100%;
    min-height: clamp(2.875rem, calc(2.75rem + 0.3vw), 3.125rem);
    margin-top: clamp(0.625rem, 0.8vw, 0.9375rem);
    border: 1px solid var(--cyan);
    border-radius: 6px;
    background: linear-gradient(100deg, #1264aa, #087fbd);
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.6875rem, calc(0.66rem + 0.1vw), 0.75rem);
    font-weight: 600;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: .25s ease;
    box-shadow: 0 0 20px rgba(56,217,255,.13);
}

.primary-btn span {
    float: right;
    margin-right: 0.9375rem;
    font-size: clamp(1rem, calc(0.9rem + 0.35vw), 1.25rem);
}

.primary-btn:hover {
    background: linear-gradient(100deg, #087fbd, #159edb);
    box-shadow: 0 0 28px rgba(56,217,255,.35);
    transform: translateY(-2px);
}

.bottom-note {
    color: #69849f;
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: 0.08em;
    margin-top: clamp(1rem, 1.2vw, 1.4375rem);
}

/* MISSION SCREEN */

.mission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(0.375rem, 0.75vw, 0.625rem);
    text-align: left;
}

.mission-header h2 {
    color: white;
    font-size: clamp(0.9375rem, calc(0.82rem + 0.45vw), 1.125rem);
    margin: 0.3125rem 0;
}

.mission-header .eyebrow {
    margin-bottom: clamp(0.25rem, 0.5vw, 0.5rem);
}

.mission-header .timer-panel {
    margin: clamp(0.5rem, 0.75vw, 0.625rem) auto;
    padding: clamp(0.5rem, 0.65vw, 0.625rem);
}

.mission-number {
    color: var(--cyan);
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-label);
    line-height: 1.35;
    white-space: nowrap;
}

.progress-track {
    height: 4px;
    background: #25384e;
    margin: clamp(0.375rem, 0.75vw, 0.75rem) 0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0;
    background: var(--green);
    transition: width .3s ease;
}

.mission-tracker {
    margin: -0.25rem 0 clamp(0.5rem, 0.75vw, 0.75rem);
}

.tracker-status,
.mission-chips {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: clamp(0.375rem, 0.6vw, 0.5rem);
}

.tracker-status {
    color: #8aa6b8;
    font-family: monospace;
    font-size: var(--type-label);
    letter-spacing: 0.06em;
    line-height: 1.4;
}

#xp {
    color: var(--cyan);
}

.mission-chips {
    justify-content: flex-start;
    margin-top: clamp(0.375rem, 0.6vw, 0.625rem);
}

.mission-chip {
    flex: 1;
    padding: clamp(0.3125rem, 0.55vw, 0.4375rem) clamp(0.1875rem, 0.35vw, 0.3125rem);
    border: 1px solid #25384e;
    border-radius: 5px;
    color: #7993ac;
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-label);
    line-height: 1.25;
}

.mission-chip.active,
.mission-chip.unlocked {
    border-color: #38d9ff66;
    color: var(--cyan);
}

.mission-chip.cleared {
    border-color: #4dffb555;
    color: var(--green);
}

.mission-chip.failed {
    border-color: #ff496c55;
    color: var(--red);
}

.mission-chip.locked {
    opacity: .55;
}

.progress-fill {
    height: 100%;
    width: 33.33%;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    box-shadow: 0 0 12px var(--cyan);
    transition: width .5s ease;
}

.incident-panel {
    padding: clamp(0.75rem, calc(0.65rem + 0.6vw), 0.875rem);
    text-align: left;
    border: 1px solid rgba(255,184,77,.25);
    border-left: 3px solid #ffb84d;
    background: rgba(255,184,77,.045);
    border-radius: 5px;
}

.incident-label {
    color: #ffbd66;
    font-family: monospace;
    font-size: var(--type-label);
    letter-spacing: 0.06em;
}

.alert-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffb84d;
    box-shadow: 0 0 10px #ffb84d;
    margin-right: 6px;
}

.incident-panel p {
    color: #c0d0e0;
    line-height: 1.4;
    margin: 0.5rem 0 0;
    font-size: var(--type-lead);
    overflow-wrap: anywhere;
}

.question-area {
    text-align: left;
    margin: clamp(0.75rem, 1vw, 1.125rem) 0 clamp(0.5rem, 0.75vw, 0.75rem);
}

.question-area .eyebrow {
    margin-bottom: clamp(0.25rem, 0.5vw, 0.5rem);
}

.question-area h3 {
    margin: 0;
    font-size: var(--type-question);
    line-height: 1.4;
}

/* ANSWER OPTIONS */

.answer-list {
    display: grid;
    gap: clamp(0.375rem, 0.55vw, 0.5rem);
}

.answer-btn {
    width: 100%;
    min-height: clamp(3rem, calc(2.85rem + 0.4vw), 3.375rem);
    display: flex;
    align-items: center;
    gap: clamp(0.5rem, 0.8vw, 0.875rem);
    text-align: left;
    padding: clamp(0.5rem, 0.65vw, 0.625rem) clamp(0.625rem, 0.8vw, 0.875rem);
    color: #c7d9e9;
    background: rgba(23,43,67,.75);
    border: 1px solid #36516c;
    border-radius: 6px;
    cursor: pointer;
    transition: .2s ease;
}

.option-code {
    flex: 0 0 clamp(1.5rem, calc(1.4rem + 0.2vw), 1.6875rem);
    width: clamp(1.5rem, calc(1.4rem + 0.2vw), 1.6875rem);
    height: clamp(1.5rem, calc(1.4rem + 0.2vw), 1.6875rem);
    display: grid;
    place-items: center;
    border: 1px solid #38d9ff55;
    color: var(--cyan);
    font-family: monospace;
    font-size: var(--type-label);
    border-radius: 4px;
}

.option-text {
    flex: 1;
    min-width: 0;
    font-size: clamp(0.9375rem, calc(0.88rem + 0.24vw), 1rem);
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.option-arrow {
    font-size: clamp(1.125rem, calc(1rem + 0.25vw), 1.375rem);
    color: #6d89a4;
}

.answer-btn:hover:not(:disabled) {
    border-color: var(--cyan);
    background: rgba(38,140,255,.15);
    transform: translateX(4px);
}

.answer-btn:disabled {
    cursor: not-allowed;
    opacity: .65;
}

.answer-btn.correct-answer {
    border-color: var(--green);
    background: rgba(77,255,181,.13);
    color: var(--green);
    box-shadow: 0 0 20px rgba(77,255,181,.12);
}

.answer-btn.wrong-answer {
    border-color: var(--red);
    background: rgba(255,73,108,.13);
    color: #ff91a6;
    box-shadow: 0 0 20px rgba(255,73,108,.12);
}

/* FEEDBACK */

.feedback {
    min-height: 1.5625rem;
    margin-top: clamp(0.5rem, 0.75vw, 0.75rem);
    font-size: var(--type-small);
    font-weight: 700;
}

.feedback:empty {
    display: none;
}

.clearance-status {
    margin: 0.5rem 0;
    padding: 0.5rem 0.625rem;
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-label);
}

.clearance-status.completed {
    color: var(--green);
    border: 1px solid #4dffb555;
    background: rgba(77, 255, 181, .08);
}

.clearance-status.failed {
    color: #ff496c;
    border: 1px solid #ff496c55;
    background: rgba(255, 73, 108, .08);
}

.danger-alert {
    padding: clamp(0.625rem, 0.8vw, 0.8125rem);
    margin-top: clamp(0.5rem, 0.75vw, 0.75rem);
    color: var(--red);
    background: rgba(255,73,108,.1);
    border: 1px solid rgba(255,73,108,.5);
    border-radius: 5px;
    font-family: monospace;
    font-size: var(--type-label);
    animation: alertAppear .35s ease-out, alertPulse 1.5s ease-in-out 2 alternate;
}

@keyframes alertAppear {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes alertPulse {
    to { box-shadow: 0 0 18px rgba(255,73,108,.2); }
}

.mission-footer {
    display: flex;
    justify-content: space-between;
    margin-top: clamp(0.5rem, 0.75vw, 0.75rem);
    padding-top: clamp(0.4375rem, 0.6vw, 0.625rem);
    border-top: 1px solid #38d9ff22;
    color: #7993ac;
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: 0.07em;
}

#score {
    color: var(--green);
}

/* RESULTS */

.result-icon {
    color: var(--green);
    border-color: #4dffb566;
    background: rgba(77,255,181,.08);
    box-shadow: 0 0 30px #4dffb522;
}

.result-heading {
    font-size: clamp(1.5rem, calc(1.35rem + 1vw), 2.2rem);
    line-height: 1.5;
}

.result-heading span {
    color: var(--green);
}

.final-score-panel {
    padding: clamp(1rem, calc(0.85rem + 0.65vw), 1.375rem);
    margin: clamp(1rem, 1.3vw, 1.5625rem) 0;
    background: rgba(77,255,181,.045);
    border: 1px solid #4dffb533;
    border-radius: 8px;
}

.final-score-panel small {
    color: #8aa6b8;
    font-family: monospace;
    font-size: var(--type-label);
    letter-spacing: 0.06em;
}

.final-score-panel h3 {
    font-size: clamp(1.75rem, calc(1.55rem + 0.8vw), 2.125rem);
    color: var(--green);
    margin: 0.9375rem 0;
}

#final-percentage {
    font-size: var(--type-small);
}

#final-xp {
    font-size: var(--type-small);
    line-height: 1.4;
    overflow-wrap: anywhere;
}

#result-message {
    color: #b5c9d9;
    font-size: var(--type-lead);
    overflow-wrap: anywhere;
    line-height: 1.45;
}

.result-meter {
    height: 6px;
    background: #263b4d;
    border-radius: 10px;
    overflow: hidden;
}

#result-fill {
    height: 100%;
    width: 0;
    background: var(--green);
    box-shadow: 0 0 15px var(--green);
    transition: width 1s ease;
}

/* WRONG / CORRECT ENVIRONMENT STATES */

body.threat-mode .ambient-one,
body.threat-mode .ambient-two {
    background: var(--red);
    opacity: .22;
}

body.threat-mode .game-container {
    border-color: rgba(255,73,108,.6);
}

body.secure-mode .game-container {
    border-color: rgba(77,255,181,.55);
}

/* FOOTER */

.footer-status {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: clamp(0.625rem, 0.75vw, 0.75rem) 5%;
    background: rgba(5,11,22,.85);
    border-top: 1px solid #38d9ff20;
    color: #68849c;
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: 0.06em;
}

/* RESPONSIVE */

@media (max-width: 800px) {
    .radar {
        right: -70px;
        top: 16%;
        opacity: .5;
    }
}

@media (max-width: 600px) {
    body {
        padding: 75px 13px 60px;
    }

    .top-bar {
        padding: 0 15px;
    }

    .brand {
        font-size: clamp(0.6875rem, calc(0.65rem + 0.12vw), 0.75rem);
    }

    .connection-status {
        font-size: var(--type-micro);
    }

    .console-top,
    .console-bottom {
        font-size: var(--type-micro);
    }

    .screen {
        padding-top: 25px;
    }

    .footer-status {
        font-size: var(--type-micro);
        padding: 0.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

.timer-panel {
    text-align: center;
    margin: clamp(0.625rem, 1vw, 1.125rem) auto;
    padding: clamp(0.5rem, 0.75vw, 0.75rem);
    width: clamp(9.5rem, 14vw, 11.25rem);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 10px;
    background: rgba(0, 229, 255, 0.05);
    font-family: 'Orbitron', sans-serif;
}

.timer-panel span {
    color: #8caab8;
    font-size: var(--type-label);
    letter-spacing: 0.1em;
}

#mission-timer {
    margin-top: 6px;
    color: #4dfcff;
    font-size: clamp(1.375rem, calc(1.1rem + 0.75vw), 1.75rem);
    font-weight: bold;
    text-shadow: 0 0 12px rgba(77, 252, 255, 0.6);
}

#mission-timer.warning {
    color: #ff496c;
    text-shadow: 0 0 12px rgba(255, 73, 108, 0.8);
    animation: timer-pulse 0.7s infinite alternate;
}

@keyframes timer-pulse {
    from { opacity: 1; }
    to { opacity: 0.45; }
}
.incident-log {
    width: 100%;
    margin: 0;
    position: relative;
    background: rgba(3, 14, 30, 0.94);
    border: 1px solid rgba(0, 229, 255, 0.4);
    border-radius: 10px;
    overflow: hidden;
    backdrop-filter: blur(12px);
    box-shadow:
        0 0 25px rgba(0, 229, 255, 0.12),
        0 12px 35px rgba(0, 0, 0, 0.5);
    opacity: 0.92;
    transition: height 0.25s ease;
}

.log-header {
    display: flex;
    justify-content: space-between;
    padding: clamp(0.5rem, 0.75vw, 0.75rem) clamp(0.75rem, 1vw, 1rem);
    background: rgba(0, 229, 255, 0.08);
    color: #4dfcff;
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-label);
    letter-spacing: 0.08em;
}

.log-status {
    color: #4dffb5;
}

.log-content {
    height: 125px;
    overflow-y: auto;
    padding: clamp(0.5rem, 0.75vw, 0.75rem) clamp(0.75rem, 1vw, 1rem);
    font-family: monospace;
    font-size: var(--type-reading);
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.log-entry {
    color: #8caab8;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.log-entry:last-child {
    color: #4dfcff;
}

.incident-log .log-header {
    min-height: 42px;
    align-items: center;
}

.log-toggle {
    background: transparent;
    border: 1px solid rgba(0, 229, 255, 0.4);
    color: #4dfcff;
    padding: clamp(0.25rem, 0.4vw, 0.375rem) clamp(0.4375rem, 0.6vw, 0.5rem);
    border-radius: 4px;
    font-size: var(--type-micro);
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
}

.log-toggle:hover {
    background: rgba(0, 229, 255, 0.12);
}

/* MINIMIZED STATE */

.incident-log.minimized .log-content {
    display: none;
}
.incident-log:hover {
    opacity: 1;
}

/* Small animated scene shown for the matching tutorial incidents. */
.incident-visual {
    flex: 0 0 auto;
    width: 100%;
    overflow: hidden;
    border: 1px solid rgba(56,217,255,.32);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(7,25,42,.97), rgba(9,15,31,.96));
    box-shadow: 0 0 24px rgba(0,190,255,.08), inset 0 0 22px rgba(0,190,255,.035);
}
.incident-visual[hidden], .incident-visual-scene[hidden] { display: none; }
.incident-visual-header { display: flex; justify-content: space-between; gap: .4rem; padding: .55rem .7rem; color: #49dff7; background: rgba(0,210,245,.07); font: 700 clamp(.55rem, .68vw, .68rem) monospace; letter-spacing: .08em; }
.incident-visual-header span:last-child { color: #6d8da8; }
.incident-visual-scene { position: relative; padding: .35rem .45rem 0; }
.incident-visual-scene svg { display: block; width: 100%; height: auto; max-height: clamp(145px, 20vh, 210px); }
.incident-visual-caption { min-height: 2.3em; padding: .3rem .7rem .6rem; color: #a9bfd1; font-size: clamp(.65rem, .72vw, .75rem); line-height: 1.4; }
.scene-grid { fill: none; stroke: rgba(54,116,148,.14); stroke-width: 1; }
.scene-orbit { fill: none; stroke: rgba(56,217,255,.18); stroke-width: 1; stroke-dasharray: 3 5; }
.monitor-shell { fill: #15283b; stroke: #45dfff; stroke-width: 2; }
.screen-kicker { fill: #7697ac; font: 8px monospace; letter-spacing: 2px; }
.screen-alert { fill: #6deeff; font: 700 18px monospace; letter-spacing: 2px; }
.screen-scan { stroke: rgba(72,220,255,.58); stroke-width: 1; animation: screen-scan 2.4s ease-in-out infinite; }
.power-led { fill: #4dffb5; filter: drop-shadow(0 0 4px #4dffb5); animation: led-pulse 1.6s ease-in-out infinite alternate; }
.monitor-stand, .monitor-foot { fill: none; stroke: #45647d; stroke-width: 5; stroke-linecap: round; }
.power-cable { fill: none; stroke: #49dff7; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 5 3; }
.power-plug { fill: #14364a; stroke: #49dff7; stroke-width: 2; }
.plug-pin { stroke: #49dff7; stroke-width: 2; }
.cable-label { fill: #ffbf68; font: 7px monospace; letter-spacing: 1px; }
.power-label { fill: #67f5bb; }
.pulse-ring { fill: none; stroke: #ffb84d; stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: clue-pulse 1.8s ease-out infinite; }
.app-window { fill: #101f32; stroke: #42617b; stroke-width: 1.5; }
.app-topline { stroke: #42617b; }
.window-dot { fill: #5f829a; }
.offline-pill { fill: rgba(255,73,108,.1); stroke: rgba(255,73,108,.55); }
.offline-dot { fill: #ff496c; filter: drop-shadow(0 0 3px #ff496c); animation: led-pulse 1.3s ease-in-out infinite alternate; }
.small-alert { fill: #ff8094; font-size: 8px; letter-spacing: .4px; }
.data-link { fill: none; stroke: #45dfff; stroke-width: 2; stroke-dasharray: 4 4; animation: data-flow 1.1s linear infinite; }
.data-packet { fill: #45dfff; filter: drop-shadow(0 0 4px #45dfff); }
.packet-one { animation: packet-drift 2s ease-in-out infinite alternate; }
.printer-body { fill: #1a3044; stroke: #57bdd5; stroke-width: 2; }
.paper, .printer-tray { fill: #d1e3e9; stroke: #6b91a2; stroke-width: 1; }
.paper-lines { fill: none; stroke: #7395a4; stroke-width: 1.5; }
.printer-led { fill: #ffb84d; filter: drop-shadow(0 0 3px #ffb84d); animation: led-pulse 1.8s ease-in-out infinite alternate; }
.uncertain-mark { fill: none; stroke: #ffb84d; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes screen-scan { 0%,100% { opacity: .25; transform: translateY(-4px); } 50% { opacity: .9; transform: translateY(5px); } }
@keyframes led-pulse { from { opacity: .55; } to { opacity: 1; } }
@keyframes clue-pulse { 0% { opacity: .85; transform: scale(.6); } 100% { opacity: 0; transform: scale(1.5); } }
@keyframes data-flow { to { stroke-dashoffset: -16; } }
.laptop-body { fill: #15283b; stroke: #45dfff; stroke-width: 2; }
.lock-shake { fill: none; stroke: #ff496c; stroke-width: 2; stroke-linecap: round; animation: lock-shake 1.2s ease-in-out infinite; }
.reset-bar { fill: #4dffb5; animation: reset-pulse 1.6s ease-in-out infinite alternate; }
.reset-card { fill: none; stroke: #45dfff; stroke-width: 2; stroke-linecap: round; }
.reset-dot { fill: #4dffb5; filter: drop-shadow(0 0 3px #4dffb5); animation: led-pulse 1.4s ease-in-out infinite alternate; }
.reset-check { fill: none; stroke: #4dffb5; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; animation: reset-check-draw 1s ease-out infinite alternate; }
.browser-window { fill: #101f32; stroke: #42617b; stroke-width: 1.5; }
.browser-topline { stroke: #42617b; }
.tab-strip { fill: none; stroke: #45647d; stroke-width: 3; stroke-linecap: round; }
.tab-freeze { fill: none; stroke: #ff496c; stroke-width: 2; stroke-linecap: round; animation: tab-shiver 1s ease-in-out infinite alternate; }
.incognito-window { fill: #1a3044; stroke: #45647d; stroke-width: 1.5; }
.incognito-dot { filter: drop-shadow(0 0 3px #4dffb5); animation: incognito-blink 1s ease-in-out infinite alternate; }
.reload-arrow { fill: none; stroke: #45dfff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; animation: reload-spin 1.4s ease-in-out infinite; }
.mouse-body { fill: none; stroke: #45647d; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; animation: mouse-wobble 1.5s ease-in-out infinite alternate; }
.mouse-scroll { fill: none; stroke: #45647d; stroke-width: 2; stroke-linecap: round; }
.mouse-led { filter: drop-shadow(0 0 4px #45dfff); animation: led-pulse 1.2s ease-in-out infinite alternate; }
.signal-wave-one { fill: none; stroke: #45dfff; stroke-width: 1.5; stroke-linecap: round; animation: signal-pulse 1.8s ease-in-out infinite; }
.signal-wave-two { fill: none; stroke: #45dfff; stroke-width: 1; stroke-linecap: round; animation: signal-pulse 2.2s ease-in-out infinite reverse; }
.battery-shell { fill: none; stroke: #45647d; stroke-width: 1.5; }
.battery-low { animation: battery-flash 1s ease-in-out infinite alternate; }
@keyframes lock-shake { 0%, 100% { transform: rotate(0deg); } 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }
@keyframes reset-pulse { from { opacity: 0.6; width: 44px; } to { opacity: 1; width: 56px; } }
@keyframes reset-check-draw { from { stroke-dashoffset: 16; } to { stroke-dashoffset: 0; } }
@keyframes tab-shiver { from { transform: translateX(0); } to { transform: translateX(3px); } }
@keyframes incognito-blink { from { opacity: 0.6; } to { opacity: 1; } }
@keyframes reload-spin { from { transform: rotate(0deg); } to { transform: rotate(90deg); } }
@keyframes mouse-wobble { from { transform: translateX(0) rotate(0deg); } to { transform: translateX(4px) rotate(2deg); } }
@keyframes signal-pulse { from { opacity: 0.5; transform: scale(0.9); } to { opacity: 0; transform: scale(1.4); } }
@keyframes battery-flash { from { opacity: 0.6; } to { opacity: 1; } }
@keyframes packet-drift { to { transform: translateX(14px); opacity: .3; } }
@media (prefers-reduced-motion: reduce) {
    .incident-visual *, .incident-visual *::before, .incident-visual *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}

/* DIFFICULTY SELECTION */

.difficulty-section {
    margin: 25px auto;
    text-align: center;
}

.difficulty-section h3 {
    color: #4dfcff;
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-small);
    letter-spacing: 0.1em;
    margin-bottom: clamp(0.625rem, 0.8vw, 0.9375rem);
}

.difficulty-options {
    display: flex;
    justify-content: center;
    gap: clamp(0.5rem, 0.75vw, 0.75rem);
}

.difficulty-btn {
    min-height: 48px;
    padding: clamp(0.625rem, 0.75vw, 0.75rem) clamp(0.875rem, 1.2vw, 1.375rem);
    border: 1px solid rgba(111, 231, 255, .86);
    background: linear-gradient(110deg, #1679c7, #24bce4);
    color: #04121e;
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-label);
    font-weight: 700;
    letter-spacing: .07em;
    cursor: pointer;
    border-radius: 5px;
    box-shadow: 0 0 18px rgba(56, 217, 255, .18);
    transition: transform .2s ease, filter .2s ease, box-shadow .2s ease,
        background .2s ease, border-color .2s ease;
}

.difficulty-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 0 26px rgba(56, 217, 255, .3);
    transform: translateY(-2px);
}

.difficulty-btn.active {
    border-color: #c1f8ff;
    background: linear-gradient(110deg, #24bce4, #54e8ff);
    color: #04121e;
    box-shadow: 0 0 26px rgba(56, 217, 255, .42), inset 0 0 12px rgba(255, 255, 255, .2);
}

.difficulty-btn:active {
    transform: translateY(1px) scale(.98);
}

@media (max-width: 450px) {
    .difficulty-options {
        gap: 6px;
    }

    .difficulty-btn {
        padding: 0.625rem clamp(0.5rem, 3.3vw, 0.8125rem);
        font-size: var(--type-label);
    }
}

/* LAPTOP AND TABLET ADAPTATION */

@media (max-width: 1180px) {
    .game-layout {
        width: min(100%, 1000px);
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "game game"
            "left right";
        gap: 16px;
    }

    .panel-column {
        gap: 16px;
    }

    .footer-status {
        position: relative;
        width: 100%;
        margin: 0;
    }

    .radar {
        right: -35px;
        opacity: .35;
    }

    .incident-log .log-content {
        height: min(125px, 20vh);
    }

    .learning-panel {
        max-height: none;
    }
}

@media (max-width: 800px) {
    body {
        padding: 82px 16px 48px;
    }

    .top-bar {
        height: 58px;
    }

    .game-container {
        width: 100%;
        margin: 0;
        padding: 24px 24px;
    }

    .radar {
        width: 180px;
        height: 180px;
        right: -85px;
        top: 12%;
    }

    .mission-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
    }

    .mission-header .timer-panel {
        grid-column: 1 / -1;
        width: 100%;
        max-width: 220px;
        margin: 0 auto 4px;
    }

    .mission-header h2 {
        margin: 0;
    }

    .mission-chips {
        flex-wrap: wrap;
    }

    .mission-chip {
        flex: 1 1 140px;
        text-align: center;
    }

    .footer-status {
        padding: 12px 16px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 72px 10px 20px;
    }

    .game-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "game"
            "left"
            "right";
        gap: 12px;
    }

    .panel-column {
        gap: 12px;
    }

    .top-bar {
        height: 62px;
        padding: 0 12px;
    }

    .brand {
        max-width: 62%;
        font-size: clamp(0.6875rem, calc(0.65rem + 0.12vw), 0.75rem);
        line-height: 1.4;
    }

    .brand-icon {
        margin-right: 0.25rem;
        font-size: clamp(1.125rem, calc(1rem + 0.5vw), 1.25rem);
    }

    .connection-status {
        max-width: 38%;
        text-align: right;
        line-height: 1.4;
    }

    .game-container {
        width: 100%;
        margin: 0;
        padding: clamp(1rem, calc(0.9rem + 1vw), 1.125rem) clamp(0.6875rem, 3.6vw, 0.875rem);
        border-radius: 9px;
    }

    .console-top,
    .console-bottom {
        align-items: center;
        gap: 8px;
        line-height: 1.4;
    }

    .console-top span,
    .console-bottom span {
        min-width: 0;
    }

    .terminal-id {
        text-align: right;
    }

    .screen {
        padding: 22px 0 8px;
    }

    .hero-icon {
        width: 58px;
        height: 58px;
        margin-bottom: clamp(0.75rem, 3.5vw, 1.125rem);
    }

    .hero-description {
        font-size: var(--type-lead);
        margin: clamp(0.625rem, 3.6vw, 0.875rem) auto clamp(0.75rem, 5vw, 1.25rem);
    }

    .mission-stats {
        padding: clamp(0.75rem, 3.5vw, 0.8125rem) 2px;
        margin: clamp(0.875rem, 4.6vw, 1.125rem) 0;
    }

    .mission-stats strong {
        font-size: clamp(1.0625rem, calc(0.98rem + 0.45vw), 1.25rem);
    }

    .mission-stats small {
        font-size: var(--type-micro);
        letter-spacing: 0.04em;
    }

    .difficulty-section {
        margin: clamp(0.875rem, 4.6vw, 1.125rem) auto;
    }

    .difficulty-options {
        width: 100%;
    }

    .difficulty-btn {
        flex: 1 1 0;
        min-height: 48px;
        padding: 0.625rem 0.375rem;
    }

    .primary-btn {
        min-height: clamp(2.875rem, calc(2.75rem + 0.3vw), 3rem);
        margin-top: clamp(0.625rem, 3vw, 0.75rem);
    }

    .mission-header {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .mission-header .timer-panel {
        max-width: 180px;
        padding: clamp(0.5rem, 2.3vw, 0.5625rem);
    }

    #mission-timer {
        font-size: clamp(1.375rem, 5.5vw, 1.5rem);
    }

    .mission-header h2 {
        font-size: clamp(0.9375rem, calc(0.82rem + 0.45vw), 1.0625rem);
        line-height: 1.4;
    }

    .mission-number {
        font-size: var(--type-label);
    }

    .tracker-status {
        gap: 6px;
        font-size: var(--type-micro);
    }

    .mission-chips {
        gap: 6px;
    }

    .mission-chip {
        flex-basis: calc(50% - 3px);
        min-height: 36px;
        display: grid;
        place-items: center;
        font-size: var(--type-label);
    }

    .incident-panel {
        padding: clamp(0.75rem, 3.6vw, 0.875rem);
    }

    .question-area {
        margin: clamp(0.875rem, 5vw, 1.25rem) 0 clamp(0.5rem, 3vw, 0.75rem);
    }

    .answer-btn {
        min-height: clamp(3rem, calc(2.85rem + 0.4vw), 3.125rem);
        gap: 0.625rem;
        padding: 0.625rem;
    }

    .option-code {
        flex-basis: clamp(1.5rem, calc(1.4rem + 0.2vw), 1.5625rem);
        width: clamp(1.5rem, calc(1.4rem + 0.2vw), 1.5625rem);
        height: clamp(1.5rem, calc(1.4rem + 0.2vw), 1.5625rem);
    }

    .option-text {
        font-size: clamp(0.875rem, 3.8vw, 0.9375rem);
        line-height: 1.35;
    }

    .mission-footer {
        gap: 0.625rem;
        align-items: center;
        font-size: var(--type-micro);
    }

    .final-score-panel {
        padding: clamp(1rem, calc(0.85rem + 0.65vw), 1.125rem) clamp(0.75rem, 3vw, 0.875rem);
    }

    .incident-log .log-header {
        min-height: 44px;
    }

    .log-toggle {
        min-height: 36px;
        padding: 0.4375rem 0.5625rem;
    }

    .incident-log .log-content {
        height: 110px;
        font-size: var(--type-reading);
    }

    .learning-panel {
        padding: clamp(0.75rem, calc(0.65rem + 0.6vw), 1rem);
        max-height: none;
    }

    .footer-status {
        flex-direction: column;
        align-items: center;
        gap: 0.3125rem;
        text-align: center;
        font-size: var(--type-micro);
    }
}

@media (max-width: 360px) {
    body {
        padding-left: 7px;
        padding-right: 7px;
    }

    .game-container {
        padding-left: 11px;
        padding-right: 11px;
    }

    .mission-chip {
        flex-basis: 100%;
    }

    .mission-stats small {
        max-width: 90px;
        margin-left: auto;
        margin-right: auto;
    }
}

.learning-panel {
    display: none;
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 180px;
    max-height: none;
    overflow-y: auto;

    padding: clamp(0.75rem, calc(0.65rem + 0.6vw), 1.25rem);
    background: rgba(5, 18, 35, 0.96);
    border: 1px solid rgba(56, 217, 255, 0.4);
    border-radius: 12px;
    backdrop-filter: blur(12px);
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.12);
}

.learning-panel h3,
.learning-panel h4,
.learning-panel p {
    display: block;
    visibility: visible;
    opacity: 1;
}

.learning-panel h3 {
    color: #4dfcff;
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-small);
    margin-bottom: clamp(0.625rem, 0.9vw, 1.125rem);
}

.learning-panel h4 {
    color: #4dfcff;
    font-size: var(--type-label);
    margin-top: clamp(0.625rem, 0.75vw, 0.9375rem);
}

.learning-panel p {
    color: #b9cbd8;
    font-size: var(--type-reading);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.hud-left,
.hud-right {
    margin-top: auto;
}
/* LEVEL ROADMAP */

.level-selection-section {
    margin: clamp(0.875rem, 1.1vw, 1.25rem) auto;
    text-align: left;
}

.roadmap-title {
    margin: 0.5rem 0 0.75rem;
    color: var(--text);
    font-size: clamp(1.25rem, calc(1.05rem + 0.85vw), 1.75rem);
    line-height: 1.35;
}

.roadmap-description {
    max-width: 430px;
    margin: 0 auto clamp(0.75rem, 0.9vw, 1.125rem);
    color: #9cb2ca;
    font-size: var(--type-body);
    line-height: 1.5;
}

.roadmap-stats {
    display: flex;
    justify-content: space-between;
    gap: clamp(0.5rem, 0.75vw, 0.75rem);
    padding: clamp(0.5rem, 0.75vw, 0.75rem) clamp(0.625rem, 0.9vw, 0.875rem);
    border: 1px solid rgba(56, 217, 255, .2);
    border-radius: 6px;
    background: rgba(56, 217, 255, .035);
    color: var(--cyan);
    font-family: monospace;
    font-size: var(--type-label);
    letter-spacing: 0.04em;
}

.level-selection-section h3 {
    color: var(--cyan);
    font-size: var(--type-small);
    letter-spacing: 0.08em;
    text-align: center;
}

#level-screen .level-chip {
    min-height: 60px;
}

.level-roadmap {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(0.25rem, 0.45vw, 0.4375rem);
    margin-top: 0.625rem;
}

.level-chip {
    min-width: 0;
    min-height: 46px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.375rem 0.1875rem;
    border: 1px solid #25384e;
    border-radius: 5px;
    background: rgba(23, 43, 67, .55);
    color: #7993ac;
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-label);
    line-height: 1.2;
    text-align: center;
}

button.level-chip {
    cursor: pointer;
    transition: .2s ease;
}

button.level-chip:hover:not(:disabled),
button.level-chip.selected {
    border-color: var(--cyan);
    color: var(--cyan);
    background: rgba(38, 140, 255, .13);
}

button.level-chip:disabled {
    cursor: not-allowed;
}

button.level-chip:focus-visible,
.secondary-btn:focus-visible,
.difficulty-btn:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 2px;
}

.level-chip small {
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: 0.02em;
}

.level-chip.passed {
    border-color: #4dffb555;
    color: var(--green);
}

.level-chip.failed {
    border-color: #ff496c66;
    color: var(--red);
}

.level-chip.unlocked,
.level-chip.active {
    border-color: #38d9ff66;
    color: var(--cyan);
}

.level-chip.locked {
    opacity: .5;
}

.level-chip.current {
    box-shadow: inset 0 0 12px rgba(56, 217, 255, .1);
}

.compact-roadmap {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
}

.compact-roadmap .level-chip {
    min-height: 34px;
    padding: 0.1875rem 0.125rem;
    font-size: clamp(0.5625rem, calc(0.53rem + 0.13vw), 0.6rem);
    gap: 0.125rem;
}

.compact-roadmap .level-chip small {
    font-size: clamp(0.5625rem, calc(0.53rem + 0.13vw), 0.6rem);
    letter-spacing: 0;
}

.secondary-btn {
    width: 100%;
    min-height: clamp(2.75rem, calc(2.65rem + 0.2vw), 2.875rem);
    margin-top: 0.625rem;
    border: 1px solid rgba(56, 217, 255, .35);
    border-radius: 6px;
    background: rgba(10, 22, 42, .65);
    color: var(--cyan);
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-label);
    letter-spacing: 0.06em;
    cursor: pointer;
}

.secondary-btn:hover {
    background: rgba(38, 140, 255, .13);
    border-color: var(--cyan);
}

#result-screen.level-failed .result-heading span,
#result-screen.level-failed .final-score-panel h3 {
    color: var(--red);
}

@media (max-width: 600px) {
    .level-selection-section .level-roadmap {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .roadmap-stats {
        flex-direction: column;
        align-items: center;
        text-align: center;
        font-size: var(--type-label);
    }

    .level-chip {
        min-height: 44px;
    }

    #level-screen .level-chip {
        min-height: 52px;
    }

    .compact-roadmap .level-chip {
        min-height: 36px;
        font-size: clamp(0.5625rem, calc(0.53rem + 0.13vw), 0.6rem);
    }

    .mission-number {
        max-width: 84px;
        white-space: normal;
        text-align: right;
        line-height: 1.4;
    }
}

@media (min-width: 1181px) {
    .compact-roadmap {
        grid-template-columns: repeat(10, minmax(0, 1fr));
    }
}

@media (min-width: 601px) and (max-height: 920px) {
    body {
        padding-top: 72px;
        padding-bottom: 36px;
    }

    body:has(#result-screen[style*="display: block"]) .footer-status {
        position: relative;
        width: 100%;
        margin: 0;
    }

    .game-container:has(#mission-screen[style*="display: block"]) {
        padding: clamp(0.25rem, 0.4vw, 0.875rem) clamp(1rem, 1.5vw, 1.5rem);
    }

    .game-container:has(#mission-screen[style*="display: block"]) .console-top {
        padding-bottom: 6px;
    }

    .game-container:has(#mission-screen[style*="display: block"]) .console-bottom {
        margin-top: 4px;
        padding-top: 6px;
    }

    #mission-screen {
        padding: 7px 0 0;
    }

    #mission-screen[style*="display: block"] {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(170px, .65fr);
        align-content: start;
        column-gap: 12px;
    }

    #mission-screen > .mission-header,
    #mission-screen > .progress-track,
    #mission-screen > .mission-tracker,
    #mission-screen > .incident-panel,
    #mission-screen > .question-area,
    #mission-screen > .answer-list,
    #mission-screen > #feedback,
    #mission-screen > #clearance-status,
    #mission-screen > #danger-alert {
        grid-column: 1 / -1;
    }

    #mission-screen > .mission-footer {
        grid-column: 1;
        margin-top: 4px;
        padding-top: 4px;
    }

    #mission-screen > #next-btn {
        grid-column: 2;
        align-self: center;
        min-height: 44px;
        margin: 4px 0 0;
    }

    .mission-header {
        display: flex;
        gap: 8px;
    }

    .mission-header .timer-panel {
        grid-column: auto;
        width: 160px;
        max-width: 160px;
        margin: 0 auto;
        padding: 0.25rem 0.4375rem;
    }

    .mission-header .eyebrow {
        margin-bottom: 4px;
    }

    #mission-timer {
        font-size: clamp(1.2rem, calc(1rem + 0.35vw), 1.375rem);
    }

    .progress-track {
        margin: 3px 0;
    }

    .mission-tracker {
        margin: -2px 0 8px;
    }

    .compact-roadmap {
        grid-template-columns: repeat(10, minmax(0, 1fr));
        gap: 3px;
    }

    .compact-roadmap .level-chip {
        min-height: 24px;
        padding: 0.125rem 0.0625rem;
        font-size: clamp(0.5625rem, calc(0.53rem + 0.13vw), 0.6rem);
        line-height: 1.2;
    }

    .compact-roadmap .level-chip small {
        font-size: clamp(0.5625rem, calc(0.53rem + 0.13vw), 0.6rem);
    }

    .incident-panel {
        padding: 6px 12px;
    }

    .incident-panel p {
        margin-top: 0.375rem;
        font-size: var(--type-body);
        line-height: 1.35;
    }

    .question-area {
        margin: 6px 0 4px;
    }

    .question-area .eyebrow {
        margin-bottom: 6px;
    }

    .question-area h3 {
        font-size: var(--type-question);
        line-height: 1.35;
    }

    .answer-list {
        gap: 6px;
    }

    .answer-btn {
        min-height: clamp(3rem, calc(2.85rem + 0.4vw), 3.25rem);
        padding: 0.4375rem clamp(0.625rem, 0.8vw, 0.75rem);
    }

    .option-text {
        font-size: clamp(0.9375rem, calc(0.88rem + 0.24vw), 1rem);
        line-height: 1.3;
    }

    .feedback {
        min-height: 20px;
        margin-top: 4px;
    }

    .clearance-status {
        margin: 4px 0;
        padding: 6px 9px;
    }

    .danger-alert {
        margin-top: 8px;
        padding: 9px;
    }

    .mission-footer {
        margin-top: 8px;
        padding-top: 8px;
    }

    #next-btn {
        min-height: 46px;
        margin-top: 8px;
    }
}

@media (min-width: 1181px) and (min-height: 821px) and (max-height: 920px) {
    body {
        padding-top: 80px;
        padding-bottom: 48px;
    }

    .game-container:has(#mission-screen[style*="display: block"]) {
        padding: 14px 24px;
    }

    .game-container:has(#mission-screen[style*="display: block"]) .console-top {
        padding-bottom: 10px;
    }

    .game-container:has(#mission-screen[style*="display: block"]) .console-bottom {
        margin-top: 8px;
        padding-top: 8px;
    }

    #mission-screen {
        padding: 12px 0 4px;
    }

    .mission-header .timer-panel {
        width: 180px;
        max-width: 180px;
        padding: 8px;
    }

    #mission-timer {
        font-size: clamp(1.375rem, calc(1.25rem + 0.25vw), 1.5rem);
    }

    .progress-track {
        margin: 6px 0;
    }

    .mission-tracker {
        margin-bottom: 10px;
    }

    .compact-roadmap .level-chip {
        min-height: 30px;
        font-size: clamp(0.5625rem, calc(0.53rem + 0.13vw), 0.6rem);
    }

    .compact-roadmap .level-chip small {
        font-size: clamp(0.5625rem, calc(0.53rem + 0.13vw), 0.6rem);
    }

    .incident-panel {
        padding: 10px 12px;
    }

    .question-area {
        margin: 12px 0 8px;
    }

    .question-area h3 {
        font-size: var(--type-question);
    }

    .answer-list {
        gap: 8px;
    }

    .answer-btn {
        min-height: clamp(3rem, calc(2.9rem + 0.4vw), 3.25rem);
        padding: 0.5rem 0.75rem;
    }

    .option-text {
        font-size: clamp(0.9375rem, calc(0.88rem + 0.24vw), 1rem);
    }

    .feedback {
        min-height: 22px;
        margin-top: 6px;
    }

    .clearance-status {
        margin: 6px 0;
        padding: 8px 10px;
    }

    .danger-alert {
        margin-top: 8px;
        padding: 10px;
    }

    #mission-screen > .mission-footer {
        margin-top: 6px;
        padding-top: 8px;
    }

    #mission-screen > #next-btn {
        min-height: 48px;
        margin-top: 6px;
    }
}

/* INTRO SCREENS */

body[data-active-screen="system-boot"],
body[data-active-screen="welcome"],
body[data-active-screen^="access-"],
body[data-active-screen="dashboard"],
body.player-app-active {
    min-height: 100vh;
    padding: 0;
    overflow: hidden;
    background: #050b16;
}

body[data-active-screen="system-boot"]::before,
body[data-active-screen="welcome"]::before,
body[data-active-screen^="access-"]::before,
body[data-active-screen="dashboard"]::before,
body.player-app-active::before,
body[data-active-screen="system-boot"] > .cyber-background,
body[data-active-screen="welcome"] > .cyber-background,
body[data-active-screen^="access-"] > .cyber-background,
body[data-active-screen="dashboard"] > .cyber-background,
body.player-app-active > .cyber-background,
body[data-active-screen="system-boot"] > .top-bar,
body[data-active-screen="welcome"] > .top-bar,
body[data-active-screen^="access-"] > .top-bar,
body[data-active-screen="dashboard"] > .top-bar,
body.player-app-active > .top-bar,
body[data-active-screen="system-boot"] > .game-layout,
body[data-active-screen="welcome"] > .game-layout,
body[data-active-screen^="access-"] > .game-layout,
body[data-active-screen="dashboard"] > .game-layout,
body.player-app-active > .game-layout,
body[data-active-screen="system-boot"] > .footer-status,
body[data-active-screen="welcome"] > .footer-status,
body[data-active-screen^="access-"] > .footer-status,
body[data-active-screen="dashboard"] > .footer-status,
body.player-app-active > .footer-status {
    display: none;
}

.intro-screen {
    position: fixed;
    inset: 0;
    z-index: 20;
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--text);
    background:
        radial-gradient(ellipse at 50% 42%, rgba(12, 45, 76, .68), transparent 58%),
        linear-gradient(145deg, #050b16 0%, #071326 52%, #050b16 100%);
}

.intro-screen::before {
    content: "";
    position: fixed;
    inset: -30%;
    pointer-events: none;
    opacity: .38;
    background-image:
        linear-gradient(rgba(56, 217, 255, .075) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 217, 255, .075) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(ellipse at center, black 15%, transparent 76%);
    animation: introGridDrift 36s linear infinite;
}

.intro-screen::after {
    content: "";
    position: fixed;
    top: -18%;
    left: 0;
    width: 100%;
    height: 18%;
    pointer-events: none;
    background: linear-gradient(transparent, rgba(56, 217, 255, .08), transparent);
    animation: introScan 5.5s ease-in-out infinite;
}

@keyframes introGridDrift {
    to { transform: translate3d(46px, 46px, 0); }
}

@keyframes introScan {
    50%, 100% { transform: translateY(660%); }
}

.intro-shell {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: min(100%, 1120px);
    min-height: 100vh;
    min-height: 100svh;
    margin: 0 auto;
    padding: clamp(1.25rem, 3vw, 2.5rem);
}

.intro-header,
.intro-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 24px;
    color: #7692ac;
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: .12em;
}

.intro-header span,
.intro-footer span {
    min-width: 0;
}

.boot-content,
.welcome-content {
    width: min(100%, 760px);
    margin: auto;
    padding: clamp(2rem, 6vh, 4rem) 0;
    text-align: center;
}

.intro-emblem {
    display: grid;
    place-items: center;
    width: clamp(3.75rem, 8vw, 4.75rem);
    height: clamp(3.75rem, 8vw, 4.75rem);
    margin: 0 auto 1.5rem;
    border: 1px solid rgba(56, 217, 255, .55);
    border-radius: 20px;
    background: rgba(56, 217, 255, .08);
    box-shadow: 0 0 35px rgba(56, 217, 255, .12), inset 0 0 20px rgba(56, 217, 255, .05);
    color: var(--cyan);
    font-size: clamp(1.75rem, 4vw, 2.25rem);
}

.intro-eyebrow {
    margin: 0 0 .75rem;
    color: var(--cyan);
    font-family: monospace;
    font-size: var(--type-label);
    letter-spacing: .18em;
}

.boot-heading {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.35rem, 4vw, 2.25rem);
    letter-spacing: .08em;
}

.boot-message {
    min-height: 1.6em;
    margin: 1.5rem 0 1.25rem;
    color: var(--cyan);
    font-family: monospace;
    font-size: clamp(.75rem, 1.8vw, .95rem);
    letter-spacing: .1em;
}

.boot-progress {
    width: min(100%, 620px);
    height: 7px;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid rgba(56, 217, 255, .25);
    border-radius: 999px;
    background: rgba(56, 217, 255, .07);
}

.boot-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    box-shadow: 0 0 16px rgba(56, 217, 255, .7);
    transition: width .42s ease;
}

.boot-progress-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    width: min(100%, 620px);
    margin: .65rem auto 0;
    color: var(--muted);
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: .08em;
}

.welcome-title {
    margin: 0;
    color: var(--text);
    font-size: clamp(2.2rem, 7.2vw, 5.5rem);
    line-height: 1.1;
    letter-spacing: .055em;
    text-shadow: 0 0 34px rgba(56, 217, 255, .12);
}

.welcome-title span {
    color: var(--cyan);
    text-shadow: 0 0 26px rgba(56, 217, 255, .32);
}

.welcome-tagline {
    max-width: 620px;
    margin: clamp(1rem, 2.4vw, 1.5rem) auto clamp(1.5rem, 4vh, 2.25rem);
    color: #a9bfd3;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(.82rem, 1.8vw, 1.125rem);
    line-height: 1.65;
    letter-spacing: .1em;
}

.enter-command-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-height: 56px;
    padding: .9rem clamp(1.25rem, 4vw, 2.25rem);
    border: 1px solid rgba(111, 231, 255, .9);
    border-radius: 5px;
    background: linear-gradient(110deg, #1679c7, #24bce4);
    box-shadow: 0 0 28px rgba(38, 140, 255, .26), inset 0 1px rgba(255, 255, 255, .18);
    color: #04121e;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(.72rem, 1.4vw, .88rem);
    font-weight: 700;
    letter-spacing: .1em;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.enter-command-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 34px rgba(56, 217, 255, .4), inset 0 1px rgba(255, 255, 255, .22);
    filter: brightness(1.08);
}

.enter-command-btn:focus-visible {
    outline: 2px solid #d6f8ff;
    outline-offset: 4px;
}

.welcome-online {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    margin-top: 1.5rem;
    color: var(--green);
    font-family: monospace;
    font-size: var(--type-small);
    letter-spacing: .12em;
}

.portal-shell {
    width: min(100%, 900px);
}

.portal-card {
    width: min(100%, 560px);
    margin: auto;
    padding: clamp(1.25rem, 3.6vw, 2.25rem);
    border: 1px solid rgba(56, 217, 255, .32);
    border-radius: 10px;
    background: rgba(5, 15, 29, .92);
    box-shadow:
        0 0 44px rgba(0, 0, 0, .38),
        0 0 36px rgba(38, 140, 255, .1),
        inset 0 0 28px rgba(56, 217, 255, .025);
}

.portal-heading {
    margin-bottom: 1.5rem;
    text-align: center;
}

.portal-title {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    letter-spacing: .08em;
}

.portal-description {
    margin: .65rem 0 0;
    color: #9cb2ca;
    font-size: var(--type-body);
}

.portal-form {
    display: grid;
    gap: .75rem;
}

.portal-form[hidden] {
    display: none;
}

.portal-field {
    display: grid;
    gap: .4rem;
}

.portal-field label {
    color: #b7cde0;
    font-family: monospace;
    font-size: var(--type-small);
    letter-spacing: .08em;
}

.portal-field label span {
    color: var(--muted);
}

.portal-field input {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: .65rem .8rem;
    border: 1px solid rgba(86, 146, 183, .44);
    border-radius: 4px;
    background: rgba(2, 9, 18, .8);
    color: var(--text);
    font: inherit;
}

.portal-field input::placeholder {
    color: #7189a1;
}

.portal-field input:focus-visible,
.portal-toggle-button:focus-visible,
.portal-check-row input:focus-visible,
.portal-link-button:focus-visible,
.portal-guest-button:focus-visible,
.portal-back-button:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

.portal-password-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .5rem;
}

.portal-toggle-button {
    min-width: 64px;
    min-height: 48px;
    padding: .5rem;
    border: 1px solid rgba(56, 217, 255, .3);
    border-radius: 4px;
    background: rgba(56, 217, 255, .06);
    color: var(--cyan);
    font-family: monospace;
    font-size: var(--type-small);
    letter-spacing: .06em;
    cursor: pointer;
}

.portal-check-row {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    gap: .6rem;
    min-height: 44px;
    color: #b7cde0;
    font-family: monospace;
    font-size: var(--type-small);
    letter-spacing: .06em;
    cursor: pointer;
}

.portal-check-row input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--cyan);
}

.portal-submit-btn {
    width: 100%;
    min-height: 52px;
    margin-top: .2rem;
}

.portal-message {
    min-height: 1.4em;
    margin: .1rem 0 0;
    color: var(--cyan);
    font-size: var(--type-small);
    line-height: 1.5;
    text-align: center;
}

.portal-links {
    display: flex;
    justify-content: space-between;
    gap: .5rem 1rem;
    margin-top: .75rem;
}

.portal-link-button,
.portal-back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: .5rem .65rem;
    border: 0;
    background: transparent;
    color: var(--cyan);
    font-family: monospace;
    font-size: var(--type-small);
    letter-spacing: .04em;
    text-align: center;
    cursor: pointer;
}

.portal-link-button:hover,
.portal-back-button:hover {
    color: #b9f4ff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.portal-guest-button {
    width: 100%;
    min-height: 52px;
    margin-top: .65rem;
    border: 1px solid rgba(56, 217, 255, .35);
    border-radius: 4px;
    background: rgba(56, 217, 255, .045);
    color: var(--text);
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-small);
    letter-spacing: .08em;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease;
}

.portal-guest-button:hover {
    border-color: var(--cyan);
    background: rgba(56, 217, 255, .1);
}

.portal-note {
    margin: .75rem 0 0;
    color: var(--muted);
    font-size: var(--type-small);
    line-height: 1.5;
    text-align: center;
}

.portal-return-button {
    width: 100%;
    margin-top: .7rem;
}

.portal-back-button {
    min-height: 40px;
    padding: .35rem .5rem;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .intro-shell {
        padding: 1.125rem clamp(1rem, 5vw, 1.5rem);
    }

    .intro-header,
    .intro-footer {
        flex-wrap: wrap;
        line-height: 1.5;
    }

    .intro-header span:last-child,
    .intro-footer span:last-child {
        margin-left: auto;
        text-align: right;
    }

    .boot-content,
    .welcome-content {
        padding: 2rem 0;
    }

    .intro-emblem {
        margin-bottom: 1.125rem;
        border-radius: 16px;
    }

    .welcome-title {
        font-size: clamp(2rem, 10.2vw, 3.25rem);
    }

    .welcome-tagline {
        font-size: clamp(.8rem, 3.2vw, .95rem);
        letter-spacing: .07em;
    }

    .enter-command-btn {
        width: 100%;
        min-height: 54px;
        padding: .85rem 1rem;
    }

    .portal-shell {
        padding: 1rem clamp(.8rem, 4vw, 1.25rem);
    }

    .portal-card {
        padding: 1.125rem clamp(.85rem, 4vw, 1.25rem);
    }

    .portal-links {
        flex-direction: column;
        gap: .1rem;
    }

    .portal-links .portal-link-button {
        width: 100%;
    }

    .portal-back-button {
        white-space: normal;
    }
}

/* PLAYER COMMAND DASHBOARD */

.dashboard-screen {
    position: fixed;
    inset: 0;
    z-index: 20;
    overflow: hidden;
    color: var(--text);
    background:
        radial-gradient(ellipse at 70% 0%, rgba(12, 45, 76, .4), transparent 42%),
        linear-gradient(145deg, #050b16 0%, #071326 52%, #050b16 100%);
}

.dashboard-screen::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .16;
    background-image:
        linear-gradient(rgba(56, 217, 255, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 217, 255, .08) 1px, transparent 1px);
    background-size: 46px 46px;
}

.dashboard-screen::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .1;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(56, 217, 255, .16) 50%,
        transparent
    ) 0 0 / 100% 220px no-repeat;
    transform: translateY(-220px);
    animation: dashboard-background-scan 22s linear infinite;
}

.dashboard-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: clamp(220px, 19vw, 270px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: calc(100vh - 4.5rem - env(safe-area-inset-bottom, 0px));
    height: calc(100svh - 4.5rem - env(safe-area-inset-bottom, 0px));
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.dashboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
    padding: clamp(1.25rem, 2vw, 1.75rem) 1rem;
    border-right: 1px solid rgba(56, 217, 255, .16);
    background: rgba(5, 13, 25, .88);
}

.dashboard-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    color: #d7edfc;
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-small);
    font-weight: 700;
    letter-spacing: .07em;
}

.dashboard-brand-icon {
    color: var(--cyan);
    font-size: 1.6rem;
}

.dashboard-brand small {
    display: block;
    margin-top: .3rem;
    color: var(--muted);
    font-family: monospace;
    font-size: var(--type-micro);
    font-weight: 400;
}

.dashboard-player {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-width: 0;
    padding: .85rem .65rem;
    border: 1px solid rgba(56, 217, 255, .14);
    border-radius: 6px;
    background: rgba(56, 217, 255, .035);
}

.dashboard-avatar {
    display: grid;
    flex: 0 0 42px;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(56, 217, 255, .48);
    border-radius: 50%;
    background: rgba(56, 217, 255, .1);
    color: var(--cyan);
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
}

.dashboard-player > div:last-child {
    display: grid;
    gap: .25rem;
    min-width: 0;
}

.dashboard-player strong {
    overflow: hidden;
    color: var(--text);
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-small);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-player span {
    color: var(--green);
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: .06em;
}

.dashboard-nav {
    display: grid;
    gap: .35rem;
}

.dashboard-nav-item {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr);
    align-items: center;
    column-gap: .55rem;
    min-height: 46px;
    padding: .55rem .65rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: #a6bbce;
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-micro);
    letter-spacing: .045em;
    text-align: left;
}

.dashboard-nav-item > span {
    grid-row: span 2;
    color: var(--cyan);
    font-size: 1rem;
    text-align: center;
}

.dashboard-nav-item.active {
    border-color: rgba(56, 217, 255, .22);
    background: rgba(56, 217, 255, .09);
    color: var(--text);
}

.dashboard-nav-item:disabled {
    opacity: .62;
    cursor: not-allowed;
}

.dashboard-nav-item small {
    margin-top: .2rem;
    color: var(--muted);
    font-family: monospace;
    font-size: .55rem;
    letter-spacing: .08em;
}

.dashboard-sidebar-bottom {
    display: grid;
    gap: 1rem;
    margin-top: auto;
}

.dashboard-engine-indicator {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--green);
    font-family: monospace;
    font-size: var(--type-micro);
}

.dashboard-main {
    min-width: 0;
    padding: clamp(1.25rem, 2.8vw, 2.5rem);
}

.dashboard-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    max-width: 1440px;
    margin: 0 auto clamp(1.5rem, 2.5vw, 2rem);
}

.dashboard-eyebrow {
    margin: 0 0 .45rem;
    color: var(--cyan);
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: .14em;
}

.dashboard-header h1 {
    margin: 0;
    font-size: clamp(1.2rem, 2.6vw, 1.85rem);
    line-height: 1.35;
}

.dashboard-header h1 span {
    color: var(--cyan);
}

.dashboard-date {
    margin: .45rem 0 0;
    color: var(--muted);
    font-size: var(--type-small);
}

.dashboard-header-status {
    display: grid;
    justify-items: end;
    gap: .6rem;
    white-space: nowrap;
}

.dashboard-account-chip,
.dashboard-online {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 30px;
    padding: .4rem .65rem;
    border: 1px solid rgba(56, 217, 255, .18);
    border-radius: 999px;
    background: rgba(56, 217, 255, .045);
    color: #b7d5e8;
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: .06em;
}

.dashboard-online {
    border-color: transparent;
    background: transparent;
    color: var(--green);
}

.dashboard-content {
    display: grid;
    gap: clamp(1rem, 1.7vw, 1.4rem);
    width: min(100%, 1440px);
    margin: 0 auto;
}

.dashboard-route-screen {
    width: min(100%, 1440px);
    min-width: 0;
    margin: 0 auto;
    animation: dashboard-section-arrive .42s ease both;
}

.dashboard-page-heading {
    margin: 0 auto clamp(1rem, 2vw, 1.5rem);
}

.dashboard-page-heading h2 {
    margin: 0;
    color: var(--text);
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.25rem, 2.2vw, 1.8rem);
    letter-spacing: .06em;
}

.dashboard-page-heading > p:last-child {
    max-width: 760px;
    margin: .55rem 0 0;
    color: #a9bfd3;
    font-size: var(--type-body);
    line-height: 1.5;
}

.dashboard-screen-message {
    min-height: 1.2em;
    margin: 0 0 .75rem;
    color: #ffb1bf;
    font-size: var(--type-small);
}

.dashboard-mission-card {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(250px, .9fr);
    align-items: center;
    gap: 1.25rem 2rem;
    padding: clamp(1.25rem, 2.5vw, 2rem);
    border: 1px solid rgba(56, 217, 255, .42);
    border-radius: 9px;
    background:
        radial-gradient(ellipse at 90% 0%, rgba(38, 140, 255, .15), transparent 45%),
        linear-gradient(120deg, rgba(8, 24, 43, .97), rgba(7, 17, 33, .94));
    box-shadow: 0 0 40px rgba(38, 140, 255, .1), inset 0 0 30px rgba(56, 217, 255, .025);
}

.dashboard-mission-card,
.dashboard-stat-card,
.dashboard-panel,
.dashboard-mode-card {
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.dashboard-mission-copy h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.25rem, 2.4vw, 1.8rem);
}

.dashboard-mission-note {
    max-width: 640px;
    margin: .65rem 0 0;
    color: #a9bfd3;
    font-size: var(--type-body);
    line-height: 1.55;
}

.dashboard-mission-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
}

.dashboard-mission-details > div {
    display: grid;
    align-content: start;
    gap: .4rem;
    min-width: 0;
    padding: .7rem;
    border-left: 1px solid rgba(56, 217, 255, .26);
    background: rgba(56, 217, 255, .035);
}

.dashboard-mission-details span,
.dashboard-progress-label {
    color: var(--muted);
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: .06em;
}

.dashboard-mission-details strong {
    overflow-wrap: anywhere;
    color: var(--cyan);
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-small);
}

.dashboard-mission-progress {
    min-width: 0;
}

.dashboard-progress-label {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .55rem;
}

.dashboard-progress-track {
    height: 7px;
    overflow: hidden;
    border: 1px solid rgba(56, 217, 255, .2);
    border-radius: 999px;
    background: rgba(56, 217, 255, .06);
}

.dashboard-progress-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--cyan));
    box-shadow: 0 0 12px rgba(56, 217, 255, .44);
    transition: width .25s ease;
}

.dashboard-primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .8rem;
    min-height: 50px;
    padding: .8rem 1rem;
    border: 1px solid rgba(111, 231, 255, .86);
    border-radius: 4px;
    background: linear-gradient(110deg, #1679c7, #24bce4);
    color: #04121e;
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-small);
    font-weight: 700;
    letter-spacing: .07em;
    cursor: pointer;
    transition: filter .18s ease, box-shadow .18s ease;
}

.dashboard-primary-button:hover {
    filter: brightness(1.08);
    box-shadow: 0 0 26px rgba(56, 217, 255, .26);
}

.dashboard-mission-action-arrow {
    font-size: 1.35em;
    transition: transform .2s ease;
}

.dashboard-primary-button:focus-visible,
.dashboard-nav-item:focus-visible {
    outline: 2px solid #d6f8ff;
    outline-offset: 3px;
}

.dashboard-statistics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .85rem;
}

.dashboard-stat-card,
.dashboard-panel {
    min-width: 0;
    padding: clamp(.9rem, 1.45vw, 1.2rem);
    border: 1px solid rgba(56, 217, 255, .17);
    border-radius: 6px;
    background: rgba(8, 19, 35, .84);
}

.dashboard-stat-card {
    display: grid;
    align-content: start;
    gap: .4rem;
}

.dashboard-stat-card > span {
    color: var(--muted);
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: .07em;
}

.dashboard-stat-card strong {
    color: var(--cyan);
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.25rem, 2.5vw, 1.8rem);
}

.dashboard-stat-card small {
    color: #829bb5;
    font-size: var(--type-small);
}

.dashboard-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: 1rem;
}

.dashboard-panel-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(.9rem, 1.3vw, 1.1rem);
    letter-spacing: .06em;
}

.dashboard-panel-code {
    color: #68849c;
    font-family: monospace;
    font-size: var(--type-micro);
}

.dashboard-difficulty-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .8rem;
}

.dashboard-mode-card {
    min-width: 0;
    padding: .9rem;
    border: 1px solid rgba(56, 217, 255, .15);
    border-radius: 5px;
    background: rgba(56, 217, 255, .025);
}

.dashboard-mode-header,
.dashboard-mode-values {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
}

.dashboard-mode-header h3 {
    margin: 0;
    color: var(--cyan);
    font-size: var(--type-small);
    letter-spacing: .1em;
}

.dashboard-mode-status {
    color: #adc0d3;
    font-family: monospace;
    font-size: var(--type-micro);
    text-align: right;
}

.dashboard-mode-status.passed {
    color: var(--green);
}

.dashboard-mode-status.failed {
    color: #ff9aaf;
}

.dashboard-mode-status.locked {
    color: #829bb5;
}

.dashboard-mode-values {
    margin: .85rem 0 .55rem;
    color: #a9bfd3;
    font-size: var(--type-small);
}

.dashboard-mode-track {
    height: 5px;
}

.dashboard-mode-current {
    margin: .55rem 0 0;
    color: var(--muted);
    font-family: monospace;
    font-size: var(--type-micro);
}

.dashboard-lower-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
    gap: .85rem;
}

.dashboard-activity-note,
.dashboard-telemetry-note {
    margin: -.35rem 0 .8rem;
    color: var(--muted);
    font-size: var(--type-small);
    line-height: 1.4;
}

.dashboard-activity-list {
    display: grid;
    gap: .65rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dashboard-activity-item {
    display: grid;
    grid-template-columns: 1.5rem minmax(0, 1fr);
    gap: .55rem;
    padding: .65rem 0;
    border-top: 1px solid rgba(56, 217, 255, .1);
}

.dashboard-activity-marker {
    color: var(--cyan);
    font-size: 1.2rem;
    text-align: center;
}

.dashboard-activity-item > div {
    display: grid;
    gap: .3rem;
    min-width: 0;
}

.dashboard-activity-item strong {
    color: #d8eaf7;
    font-family: monospace;
    font-size: var(--type-small);
    letter-spacing: .03em;
}

.dashboard-activity-item small {
    color: var(--muted);
    font-size: var(--type-small);
}

.dashboard-activity-empty {
    padding: .9rem 0;
    color: var(--muted);
    font-size: var(--type-body);
}

.dashboard-telemetry-list {
    display: grid;
    gap: .2rem;
    margin: 0;
}

.dashboard-telemetry-list > div {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .65rem 0;
    border-bottom: 1px solid rgba(56, 217, 255, .1);
}

.dashboard-telemetry-list dt {
    color: var(--muted);
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: .05em;
}

.dashboard-telemetry-list dd {
    margin: 0;
    color: var(--cyan);
    font-family: monospace;
    font-size: var(--type-small);
    text-align: right;
}

.dashboard-telemetry-note {
    margin: .8rem 0 0;
}

.dashboard-missions-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: .85rem;
}

.dashboard-mission-mode {
    padding: clamp(.85rem, 1.35vw, 1.15rem);
}

.dashboard-mission-mode .dashboard-panel-heading {
    align-items: center;
    margin-bottom: .8rem;
}

.dashboard-mission-mode h3,
.dashboard-statistics-panels h3,
.dashboard-profile-notes h3,
.dashboard-settings-grid h3 {
    margin: 0;
    color: #d8eaf7;
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-small);
    letter-spacing: .05em;
}

.dashboard-mission-mode-summary {
    margin: .35rem 0 0;
    color: var(--muted);
    font-family: monospace;
    font-size: var(--type-micro);
    line-height: 1.5;
}

.dashboard-mission-mode > .dashboard-progress-track {
    margin-bottom: .8rem;
}

.mission-level-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .4rem;
}

.mission-level-button {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: .15rem;
    min-width: 0;
    min-height: 64px;
    padding: .35rem .15rem;
    border: 1px solid rgba(56, 217, 255, .24);
    border-radius: 4px;
    background: rgba(56, 217, 255, .06);
    color: #b7d5e8;
    font-family: monospace;
    font-size: var(--type-micro);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease,
        background .18s ease, border-color .18s ease;
}

.mission-level-button > span {
    color: var(--text);
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(.48rem, .7vw, .62rem);
    font-weight: 700;
    white-space: nowrap;
}

.mission-level-button small {
    max-width: 100%;
    overflow: hidden;
    color: #91abc2;
    font-size: .5rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mission-level-button.available:hover,
.mission-level-button.current:hover,
.mission-level-button.failed:hover,
.mission-level-button.completed:hover {
    transform: translateY(-2px);
    border-color: rgba(56, 217, 255, .72);
    box-shadow: 0 0 15px rgba(56, 217, 255, .15);
}

.mission-level-button.current {
    border-color: var(--cyan);
    background: rgba(56, 217, 255, .16);
    box-shadow: 0 0 14px rgba(56, 217, 255, .16);
}

.mission-level-button.completed {
    border-color: rgba(77, 255, 181, .42);
    background: rgba(77, 255, 181, .08);
}

.mission-level-button.completed small:first-of-type {
    color: var(--green);
}

.mission-level-button.failed {
    border-color: rgba(255, 73, 108, .46);
    background: rgba(255, 73, 108, .075);
}

.mission-level-button.failed small:first-of-type {
    color: #ff9aaf;
}

.mission-level-button:disabled {
    border-color: rgba(130, 155, 181, .14);
    background: rgba(130, 155, 181, .035);
    color: #6f849a;
    cursor: not-allowed;
}

.mission-level-button:disabled > span,
.mission-level-button:disabled small {
    color: #6f849a;
}

.mission-level-button:focus-visible,
.dashboard-secondary-button:focus-visible,
.dashboard-setting-row input:focus-visible {
    outline: 2px solid #d6f8ff;
    outline-offset: 3px;
}

.dashboard-detail-statistics {
    margin-bottom: .85rem;
}

.dashboard-statistics-panels {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr);
    gap: .85rem;
}

.dashboard-statistics-panels > .dashboard-panel:last-child {
    grid-column: 1 / -1;
}

.dashboard-statistics-panels > .dashboard-panel:first-child {
    grid-column: 1 / -1;
}

.statistics-difficulty-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .75rem;
}

.statistics-mode-row {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    min-width: 0;
    padding: .9rem;
    border: 1px solid rgba(56, 217, 255, 0.18);
    border-radius: 6px;
    background: rgba(5, 18, 38, 0.5);
}

.statistics-mode-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.statistics-mode-heading h4 {
    margin: 0;
    color: var(--cyan);
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-small);
}

.statistics-mode-heading strong {
    color: var(--text);
    font-family: monospace;
    font-size: var(--type-small);
    font-weight: 400;
}

.statistics-mode-xp {
    color: var(--text);
    font-family: monospace;
    font-size: var(--type-small);
}

.statistics-mode-divider {
    width: 100%;
    border-top: 1px solid rgba(156, 178, 202, 0.2);
}

.statistics-progress-section {
    display: flex;
    flex-direction: column;
    gap: .3rem;
}

.statistics-progress-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .75rem;
}

.statistics-progress-label,
.statistics-progress-percent {
    font-size: var(--type-small);
    font-weight: 600;
}

.statistics-progress-label {
    color: var(--muted);
    letter-spacing: .08em;
    text-transform: uppercase;
}

.statistics-progress-percent {
    color: var(--cyan);
    font-family: monospace;
    white-space: nowrap;
}

.statistics-progress-detail {
    margin: 0;
    color: var(--muted);
    font-size: var(--type-small);
    font-family: monospace;
}

.statistics-mode-track {
    height: 8px;
}

.dashboard-stat-empty {
    display: grid;
    align-content: center;
    min-height: 130px;
    color: var(--muted);
    text-align: center;
}

.dashboard-stat-empty strong {
    color: var(--cyan);
    font-family: 'Orbitron', sans-serif;
    font-size: 2rem;
}

.dashboard-stat-empty p {
    max-width: 540px;
    margin: .5rem auto;
    font-size: var(--type-body);
    line-height: 1.5;
}

.dashboard-achievements-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .85rem;
    margin-bottom: 1rem;
}

.dashboard-achievement-card {
    position: relative;
    min-width: 0;
    min-height: 190px;
    padding: 1.1rem;
    overflow: hidden;
    border: 1px solid rgba(56, 217, 255, .16);
    border-radius: 6px;
    background: rgba(8, 19, 35, .84);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.dashboard-achievement-card.unlocked {
    border-color: rgba(56, 217, 255, .4);
    background:
        radial-gradient(ellipse at 100% 0%, rgba(56, 217, 255, .1), transparent 60%),
        rgba(8, 19, 35, .9);
}

.dashboard-achievement-card.locked {
    opacity: .76;
}

.dashboard-achievement-seal {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    margin-bottom: .8rem;
    border: 1px solid rgba(56, 217, 255, .3);
    border-radius: 50%;
    color: var(--muted);
    font-family: 'Orbitron', sans-serif;
}

.dashboard-achievement-card.unlocked .dashboard-achievement-seal {
    border-color: rgba(56, 217, 255, .7);
    background: rgba(56, 217, 255, .1);
    color: var(--cyan);
    box-shadow: 0 0 14px rgba(56, 217, 255, .18);
}

.dashboard-achievement-card .dashboard-eyebrow {
    margin-bottom: .35rem;
}

.dashboard-achievement-card h3 {
    margin: 0;
    color: var(--text);
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-small);
}

.dashboard-achievement-card > p:not(.dashboard-eyebrow) {
    min-height: 3em;
    margin: .45rem 0 .8rem;
    color: #a9bfd3;
    font-size: var(--type-small);
    line-height: 1.45;
}

.dashboard-achievement-card > small {
    color: var(--muted);
    font-family: monospace;
    font-size: .55rem;
    line-height: 1.4;
}

.dashboard-achievement-card.unlocked > small {
    color: var(--cyan);
}

.dashboard-profile-card {
    display: grid;
    grid-template-columns: minmax(200px, .7fr) minmax(0, 1.3fr);
    gap: 1.5rem;
    padding: clamp(1rem, 2vw, 1.6rem);
}

.dashboard-profile-identity {
    display: grid;
    align-content: start;
    justify-items: start;
    gap: .75rem;
}

.dashboard-profile-avatar {
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border: 1px solid rgba(56, 217, 255, .5);
    border-radius: 50%;
    background: rgba(56, 217, 255, .1);
    color: var(--cyan);
    font-family: 'Orbitron', sans-serif;
    font-size: 1.7rem;
}

.dashboard-profile-identity .dashboard-eyebrow {
    margin-bottom: .3rem;
}

.dashboard-profile-identity h3 {
    margin: 0 0 .6rem;
    color: var(--text);
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    overflow-wrap: anywhere;
}

.dashboard-profile-details {
    display: grid;
    gap: .15rem;
    min-width: 0;
    margin: 0;
}

.dashboard-profile-details > div {
    display: grid;
    grid-template-columns: minmax(110px, .7fr) minmax(0, 1.3fr);
    gap: .75rem;
    padding: .65rem 0;
    border-bottom: 1px solid rgba(56, 217, 255, .1);
}

.dashboard-profile-details dt {
    color: var(--muted);
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: .05em;
}

.dashboard-profile-details dd {
    min-width: 0;
    margin: 0;
    color: var(--cyan);
    font-family: monospace;
    font-size: var(--type-small);
    overflow-wrap: anywhere;
}

.dashboard-profile-notes,
.dashboard-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
    margin-top: .85rem;
}

.dashboard-profile-notes > .dashboard-panel,
.dashboard-settings-grid > .dashboard-panel {
    min-width: 0;
}

.dashboard-profile-notes p:not(.dashboard-eyebrow) {
    color: #a9bfd3;
    font-size: var(--type-body);
    line-height: 1.5;
}

.dashboard-secondary-button {
    min-height: 44px;
    padding: .65rem .85rem;
    border: 1px solid rgba(56, 217, 255, .24);
    border-radius: 4px;
    background: rgba(56, 217, 255, .07);
    color: #a9bfd3;
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-micro);
    letter-spacing: .04em;
}

.dashboard-secondary-button:disabled {
    opacity: .68;
    cursor: not-allowed;
}

.dashboard-settings-grid {
    margin-top: 0;
}

.dashboard-settings-grid > .dashboard-panel > h3 {
    margin-bottom: .9rem;
}

.dashboard-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 64px;
    padding: .75rem 0;
    border-top: 1px solid rgba(56, 217, 255, .1);
}

.dashboard-setting-row > span:first-child {
    display: grid;
    gap: .3rem;
    min-width: 0;
}

.dashboard-setting-row strong {
    color: #d8eaf7;
    font-size: var(--type-small);
}

.dashboard-setting-row small,
.dashboard-setting-note {
    color: var(--muted);
    font-size: var(--type-small);
    line-height: 1.45;
}

.dashboard-setting-row input[role="switch"] {
    position: relative;
    flex: 0 0 48px;
    width: 48px;
    height: 28px;
    margin: 0;
    appearance: none;
    border: 1px solid rgba(130, 155, 181, .55);
    border-radius: 999px;
    background: rgba(130, 155, 181, .16);
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

.dashboard-setting-row input[role="switch"]::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #9bb9cc;
    transition: transform .2s ease, background .2s ease;
}

.dashboard-setting-row input[role="switch"]:checked {
    border-color: rgba(56, 217, 255, .85);
    background: rgba(56, 217, 255, .35);
}

.dashboard-setting-row input[role="switch"]:checked::before {
    background: #b9f7ff;
    box-shadow: 0 0 8px rgba(56, 217, 255, .65);
    transform: translateX(20px);
}

.dashboard-setting-unavailable {
    color: var(--muted);
}

.dashboard-setting-badge {
    flex: 0 0 auto;
    color: var(--muted);
    font-family: monospace;
    font-size: .55rem;
    letter-spacing: .04em;
}

.dashboard-setting-note {
    margin: .75rem 0 0;
}

.dashboard-telemetry-visuals {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    gap: .8rem;
    min-height: 104px;
    margin: -.1rem 0 .85rem;
    padding: .5rem;
    overflow: hidden;
    border: 1px solid rgba(56, 217, 255, .12);
    border-radius: 4px;
    background: linear-gradient(105deg, rgba(56, 217, 255, .035), transparent 70%);
}

.dashboard-radar {
    position: relative;
    width: 84px;
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid rgba(56, 217, 255, .25);
    border-radius: 50%;
    background:
        repeating-radial-gradient(
            circle,
            transparent 0 12px,
            rgba(56, 217, 255, .14) 13px 13.5px
        ),
        linear-gradient(90deg, transparent 49.5%, rgba(56, 217, 255, .12) 50%, transparent 50.5%),
        linear-gradient(0deg, transparent 49.5%, rgba(56, 217, 255, .12) 50%, transparent 50.5%),
        rgba(3, 15, 27, .7);
}

.dashboard-radar::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: conic-gradient(
        from 0deg,
        transparent 0deg 275deg,
        rgba(56, 217, 255, .04) 315deg,
        rgba(56, 217, 255, .42) 360deg
    );
    animation: dashboard-radar-sweep 8s linear infinite;
}

.dashboard-radar-target {
    position: absolute;
    z-index: 1;
    top: 29%;
    right: 24%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #8af0ff;
    box-shadow: 0 0 8px 2px rgba(56, 217, 255, .55);
    animation: dashboard-radar-target 3s ease-in-out infinite;
}

.dashboard-network-map {
    display: block;
    width: 100%;
    max-height: 88px;
    overflow: visible;
}

.dashboard-network-link {
    fill: none;
    stroke: rgba(56, 217, 255, .33);
    stroke-width: 1;
    stroke-dasharray: 4 7;
    animation: dashboard-network-flow 8s linear infinite;
}

.dashboard-network-node {
    fill: #56dfff;
    opacity: .66;
    filter: drop-shadow(0 0 3px rgba(56, 217, 255, .55));
    animation: dashboard-network-pulse 3.4s ease-in-out infinite;
}

.dashboard-network-node:nth-of-type(2n) {
    animation-delay: -1.7s;
}

.dashboard-network-node-primary {
    fill: #b7f7ff;
    opacity: .9;
}

.dashboard-telemetry-signal {
    margin-bottom: .45rem;
}

.dashboard-signal-heading {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .45rem;
    color: var(--muted);
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: .05em;
}

.dashboard-signal-heading strong {
    color: var(--cyan);
    font-weight: 400;
    text-align: right;
}

.dashboard-signal-track {
    position: relative;
    height: 14px;
    overflow: hidden;
    border: 1px solid rgba(56, 217, 255, .2);
    border-radius: 2px;
    background:
        repeating-linear-gradient(
            90deg,
            rgba(56, 217, 255, .08) 0 1px,
            transparent 1px 9px
        ),
        rgba(56, 217, 255, .045);
}

.dashboard-signal-track > span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(22, 121, 199, .8), rgba(56, 217, 255, .85));
    box-shadow: 0 0 12px rgba(56, 217, 255, .38);
    transition: width .7s ease;
}

.dashboard-signal-track::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(196, 249, 255, .22), transparent);
    transform: translateX(-100%);
    animation: dashboard-signal-scan 4.5s ease-in-out infinite;
}

@keyframes dashboard-background-scan {
    to { transform: translateY(100vh); }
}

@keyframes dashboard-launch-breathe {
    0%, 100% { box-shadow: 0 0 14px rgba(56, 217, 255, .16); }
    50% { box-shadow: 0 0 25px rgba(56, 217, 255, .34); }
}

@keyframes dashboard-radar-sweep {
    to { transform: rotate(360deg); }
}

@keyframes dashboard-radar-target {
    0%, 100% { opacity: .65; }
    50% { opacity: 1; }
}

@keyframes dashboard-network-flow {
    to { stroke-dashoffset: -44; }
}

@keyframes dashboard-network-pulse {
    0%, 100% { opacity: .48; }
    50% { opacity: .95; }
}

@keyframes dashboard-signal-scan {
    0%, 35% { transform: translateX(-100%); }
    75%, 100% { transform: translateX(100%); }
}

@keyframes dashboard-section-arrive {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

.dashboard-content > * {
    animation: dashboard-section-arrive .42s ease both;
}

.dashboard-content > *:nth-child(2) {
    animation-delay: .06s;
}

.dashboard-content > *:nth-child(3) {
    animation-delay: .12s;
}

.dashboard-content > *:nth-child(4) {
    animation-delay: .18s;
}

@media (hover: hover) and (pointer: fine) {
    .dashboard-stat-card:hover,
    .dashboard-panel:hover,
    .dashboard-mode-card:hover {
        transform: translateY(-2px);
        border-color: rgba(56, 217, 255, .32);
        box-shadow: 0 8px 24px rgba(0, 0, 0, .18), 0 0 16px rgba(56, 217, 255, .06);
    }

    .dashboard-mission-card:hover {
        border-color: rgba(56, 217, 255, .58);
        box-shadow: 0 0 46px rgba(38, 140, 255, .14), inset 0 0 30px rgba(56, 217, 255, .035);
    }
}

@media (max-width: 1100px) {
    .dashboard-layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .dashboard-statistics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-missions-list,
    .dashboard-achievements-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-mission-card {
        grid-template-columns: minmax(0, 1fr);
    }

}

@media (max-width: 900px) {
    .dashboard-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
    }

    .dashboard-sidebar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: center;
        gap: .8rem 1rem;
        padding: .9rem 1rem;
        border-right: 0;
        border-bottom: 1px solid rgba(56, 217, 255, .16);
    }

    .dashboard-player {
        justify-self: end;
        padding: .35rem .5rem;
        border: 0;
        background: transparent;
    }

    .dashboard-nav {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dashboard-nav-item {
        grid-template-columns: 1.2rem minmax(0, 1fr);
        min-height: 44px;
        padding: .4rem;
        font-size: var(--type-micro);
    }

    .dashboard-nav-item small {
        font-size: .5rem;
    }

    .dashboard-sidebar-bottom {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: .75rem;
        margin-top: 0;
    }

    .dashboard-main {
        min-height: 0;
        padding: 1.25rem clamp(1rem, 3vw, 1.75rem);
    }

    .dashboard-lower-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-missions-list,
    .dashboard-statistics-panels {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-statistics-panels > .dashboard-panel:last-child {
        grid-column: auto;
    }
}

@media (max-width: 600px) {
    .dashboard-sidebar {
        padding: .75rem;
    }

    .dashboard-brand {
        font-size: var(--type-micro);
    }

    .dashboard-brand-icon {
        font-size: 1.3rem;
    }

    .dashboard-player {
        gap: .45rem;
        padding: .2rem;
    }

    .dashboard-avatar {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
        font-size: .9rem;
    }

    .dashboard-player strong {
        max-width: 96px;
        font-size: var(--type-micro);
    }

    .dashboard-nav {
        gap: .35rem;
    }

    .dashboard-nav-item {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: .15rem;
        min-height: 48px;
        padding: .35rem .15rem;
        font-size: .55rem;
        text-align: center;
    }

    .dashboard-nav-item > span {
        grid-row: auto;
    }

    .dashboard-nav-item small {
        display: none;
    }

    .dashboard-engine-indicator {
        font-size: .55rem;
    }

    .dashboard-main {
        padding: 1rem .75rem 1.5rem;
    }

    .dashboard-header {
        flex-direction: column;
        gap: .8rem;
        margin-bottom: 1rem;
    }

    .dashboard-header h1 {
        font-size: clamp(1rem, 5vw, 1.35rem);
    }

    .dashboard-header-status {
        display: flex;
        flex-wrap: wrap;
        justify-items: start;
        gap: .4rem;
    }

    .dashboard-account-chip,
    .dashboard-online {
        min-height: 26px;
        padding: .3rem .5rem;
    }

    .dashboard-mission-card {
        gap: 1rem;
        padding: 1rem;
    }

    .dashboard-mission-details {
        gap: .45rem;
    }

    .dashboard-mission-details > div {
        padding: .55rem .4rem;
    }

    .dashboard-statistics {
        gap: .55rem;
    }

    .dashboard-stat-card {
        padding: .75rem;
    }

    .dashboard-stat-card strong {
        font-size: 1.25rem;
    }

    .dashboard-difficulty-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-panel {
        padding: .9rem;
    }

    .dashboard-achievements-grid,
    .dashboard-profile-notes,
    .dashboard-settings-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-profile-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .mission-level-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-telemetry-visuals {
        grid-template-columns: 76px minmax(0, 1fr);
        gap: .55rem;
        min-height: 92px;
    }

    .dashboard-radar {
        width: 72px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-screen::after {
        display: none;
    }

    .dashboard-route-screen,
    .dashboard-content > *,
    .dashboard-radar::before,
    .dashboard-radar-target,
    .dashboard-network-link,
    .dashboard-network-node,
    .dashboard-signal-track::after {
        animation: none;
    }

    .dashboard-mission-card,
    .dashboard-stat-card,
    .dashboard-panel,
    .dashboard-mode-card,
    .dashboard-primary-button,
    .dashboard-mission-action-arrow,
    .dashboard-signal-track > span {
        transition: none;
    }
}

body.app-reduced-motion *,
body.app-reduced-motion *::before,
body.app-reduced-motion *::after {
    animation: none !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
}

/* WELCOME SCREEN REFINEMENT */

.welcome-intro .welcome-content {
    padding: clamp(1.75rem, 4.5vh, 3rem) 0;
}

.welcome-intro .welcome-title {
    font-size: clamp(2rem, 5vw, 4.4rem);
}

.welcome-intro .welcome-tagline {
    margin: clamp(.75rem, 1.5vw, 1rem) auto clamp(1.1rem, 2.4vh, 1.6rem);
    font-size: clamp(.9rem, 1.5vw, 1rem);
}

.welcome-intro .enter-command-btn {
    min-height: 52px;
    padding: .8rem clamp(1.1rem, 2.8vw, 1.75rem);
    gap: .75rem;
    font-size: clamp(.7rem, 1.2vw, .84rem);
}

@media (max-width: 600px) {
    .welcome-intro .welcome-content {
        padding: clamp(1.2rem, 3vh, 1.75rem) 0;
    }

    .welcome-intro .welcome-title {
        font-size: clamp(1.9rem, 8.8vw, 3rem);
    }

    .welcome-intro .welcome-tagline {
        margin: clamp(.7rem, 2.2vw, .85rem) auto clamp(1rem, 3vh, 1.25rem);
        font-size: clamp(.78rem, 3vw, .88rem);
    }

    .welcome-intro .enter-command-btn {
        width: min(100%, 20rem);
        min-height: 50px;
        padding: .72rem .9rem;
        font-size: .72rem;
    }
}

/* CINEMATIC PLAYER LOBBY */

.dashboard-screen {
    overflow: hidden;
    background:
        radial-gradient(ellipse at 60% 48%, rgba(12, 57, 84, .34), transparent 54%),
        linear-gradient(145deg, #040a14 0%, #071326 52%, #040a14 100%);
}

.dashboard-screen::before,
.dashboard-screen::after {
    display: none;
}

.dashboard-layout {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: clamp(220px, 19vw, 260px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.dashboard-screen.is-sidebar-collapsed .dashboard-layout {
    grid-template-columns: 76px minmax(0, 1fr);
}

.dashboard-sidebar {
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
    padding: calc(76px + 1.5rem) 1rem 1.5rem;
    overflow: hidden;
    border-right: 1px solid rgba(56, 217, 255, .16);
    background: linear-gradient(180deg, rgba(5, 13, 25, .97), rgba(5, 13, 25, .84));
    transition: width .28s ease, padding .28s ease, transform .28s ease;
}

.dashboard-sidebar > .dashboard-brand,
.dashboard-sidebar > .dashboard-player {
    display: none;
}

.dashboard-nav {
    display: grid;
    gap: .45rem;
}

.dashboard-nav-item {
    position: relative;
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
    align-items: center;
    gap: .65rem;
    min-height: 48px;
    padding: .65rem .75rem;
    overflow: hidden;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #a6bbce;
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-micro);
    letter-spacing: .06em;
    text-align: left;
    cursor: pointer;
    transition: color .22s ease, background .22s ease, border-color .22s ease,
        box-shadow .22s ease, padding .28s ease;
}

.dashboard-nav-icon {
    display: grid;
    place-items: center;
    color: var(--cyan);
    font-size: 1.15rem;
}

.dashboard-nav-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-nav-item:hover {
    border-color: rgba(56, 217, 255, .18);
    background: rgba(56, 217, 255, .055);
    color: #e7f4ff;
}

.dashboard-nav-item.active {
    border-color: rgba(56, 217, 255, .28);
    background: linear-gradient(100deg, rgba(56, 217, 255, .14), rgba(56, 217, 255, .035));
    box-shadow: inset 2px 0 var(--cyan);
    color: var(--text);
}

.dashboard-nav-item.active .dashboard-nav-icon {
    text-shadow: 0 0 14px rgba(56, 217, 255, .8);
}

.dashboard-sidebar-bottom {
    margin-top: auto;
    padding: 1rem .5rem 0;
    border-top: 1px solid rgba(56, 217, 255, .12);
}

.dashboard-engine-indicator {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: #84d9cc;
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: .04em;
    white-space: nowrap;
}

.dashboard-screen.is-sidebar-collapsed .dashboard-sidebar {
    padding-right: .75rem;
    padding-left: .75rem;
}

.dashboard-screen.is-sidebar-collapsed .dashboard-nav-item {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    padding-right: .35rem;
    padding-left: .35rem;
}

.dashboard-screen.is-sidebar-collapsed .dashboard-nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.dashboard-screen.is-sidebar-collapsed .dashboard-sidebar-bottom {
    display: flex;
    justify-content: center;
    padding-right: 0;
    padding-left: 0;
}

.dashboard-screen.is-sidebar-collapsed .dashboard-engine-indicator {
    justify-content: center;
    font-size: 0;
}

.dashboard-main {
    position: relative;
    min-width: 0;
    height: 100vh;
    height: 100dvh;
    padding: 76px 0 0;
    overflow: auto;
    overscroll-behavior: contain;
}

.dashboard-header {
    position: fixed;
    z-index: 10;
    top: 0;
    right: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: auto;
    max-width: none;
    height: 76px;
    margin: 0;
    padding: 0 clamp(1.25rem, 2.8vw, 2.5rem);
    border-bottom: 1px solid rgba(56, 217, 255, .15);
    background: rgba(5, 11, 22, .78);
    box-shadow: 0 8px 26px rgba(0, 0, 0, .13);
    backdrop-filter: blur(12px);
}

.dashboard-header-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.dashboard-sidebar-toggle {
    display: grid;
    flex: 0 0 38px;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(56, 217, 255, .2);
    border-radius: 5px;
    background: rgba(56, 217, 255, .045);
    color: var(--cyan);
    font-size: 1.15rem;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}

.dashboard-sidebar-toggle:hover {
    border-color: rgba(56, 217, 255, .6);
    background: rgba(56, 217, 255, .1);
    color: #d6f8ff;
}

.dashboard-game-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    min-width: 0;
    color: #e7f4ff;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(.65rem, .9vw, .78rem);
    font-weight: 600;
    letter-spacing: .1em;
    white-space: nowrap;
}

.dashboard-game-brand strong {
    color: var(--cyan);
    font-weight: 700;
}

.dashboard-game-brand .dashboard-brand-icon {
    color: var(--cyan);
    font-size: 1.5rem;
}

.dashboard-profile-menu {
    position: relative;
}

.dashboard-profile-trigger {
    display: flex;
    align-items: center;
    gap: .7rem;
    min-height: 48px;
    padding: .3rem .6rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color .2s ease, background .2s ease;
}

.dashboard-profile-trigger:hover,
.dashboard-profile-trigger[aria-expanded="true"] {
    border-color: rgba(56, 217, 255, .2);
    background: rgba(56, 217, 255, .055);
}

.dashboard-profile-trigger .dashboard-avatar {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
    font-size: .95rem;
}

.dashboard-profile-trigger-copy {
    display: grid;
    gap: .2rem;
    min-width: 0;
}

.dashboard-profile-trigger-copy strong {
    max-width: 180px;
    overflow: hidden;
    color: #e7f4ff;
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-micro);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard-profile-trigger-copy small {
    display: flex;
    align-items: center;
    gap: .25rem;
    color: var(--muted);
    font-family: monospace;
    font-size: .57rem;
    letter-spacing: .06em;
}

#dashboard-header-rank,
#dashboard-header-xp { color: #91eaff; }

.dashboard-profile-chevron {
    color: var(--cyan);
    font-size: 1.1rem;
    transition: transform .2s ease;
}

.dashboard-profile-trigger[aria-expanded="true"] .dashboard-profile-chevron {
    transform: rotate(180deg);
}

.dashboard-profile-popover {
    position: absolute;
    top: calc(100% + .6rem);
    right: 0;
    z-index: 15;
    width: min(320px, calc(100vw - 1.5rem));
    padding: 1rem;
    border: 1px solid rgba(56, 217, 255, .3);
    border-radius: 7px;
    background: rgba(5, 15, 29, .98);
    box-shadow: 0 14px 40px rgba(0, 0, 0, .45), 0 0 24px rgba(56, 217, 255, .08);
}

.dashboard-profile-popover[hidden] {
    display: none;
}

.dashboard-profile-popover > .dashboard-eyebrow {
    margin: 0 0 .65rem;
}

.dashboard-profile-summary {
    display: grid;
    gap: .15rem;
    margin: 0 0 .65rem;
}

.dashboard-profile-summary > div {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem 0;
    border-bottom: 1px solid rgba(56, 217, 255, .1);
}

.dashboard-profile-summary dt {
    flex: 0 0 auto;
    color: var(--muted);
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: .05em;
}

.dashboard-profile-summary dd {
    min-width: 0;
    margin: 0;
    color: #d9f7ff;
    font-family: monospace;
    font-size: var(--type-small);
    text-align: right;
    overflow-wrap: anywhere;
}

.dashboard-profile-action {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 40px;
    padding: .55rem .65rem;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: #b7d5e8;
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-micro);
    letter-spacing: .06em;
    text-align: left;
    cursor: pointer;
    transition: color .18s ease, background .18s ease;
}

.dashboard-profile-action:hover {
    background: rgba(56, 217, 255, .08);
    color: var(--cyan);
}

.dashboard-profile-logout {
    margin-top: .45rem;
    border-top: 1px solid rgba(56, 217, 255, .12);
    color: #ff9aaf;
}

.dashboard-profile-logout:hover {
    background: rgba(255, 73, 108, .08);
    color: #ffb1bf;
}

.dashboard-route-screen {
    width: 100%;
    max-width: none;
    min-height: 100%;
    margin: 0;
}

.dashboard-content.dashboard-lobby {
    position: relative;
    display: block;
    width: 100%;
    max-width: none;
    height: calc(100dvh - 76px);
    min-height: 460px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(ellipse at 52% 60%, rgba(16, 76, 105, .2), transparent 54%),
        linear-gradient(180deg, rgba(4, 12, 23, .15), rgba(4, 12, 23, .38));
}

.dashboard-content.dashboard-lobby::before,
.dashboard-content.dashboard-lobby::after {
    position: absolute;
    z-index: -1;
    pointer-events: none;
    content: "";
}

.dashboard-content.dashboard-lobby::before {
    inset: 0;
    opacity: .14;
    background-image:
        linear-gradient(rgba(56, 217, 255, .09) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 217, 255, .09) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 55% 55%, #000 12%, transparent 78%);
    animation: lobby-grid-drift 52s linear infinite;
}

.dashboard-content.dashboard-lobby::after {
    inset: 0;
    background: radial-gradient(ellipse at 52% 85%, rgba(26, 142, 179, .13), transparent 42%);
    animation: lobby-workstation-glow 8s ease-in-out infinite alternate;
}

.lobby-backdrop {
    position: absolute;
    z-index: -1;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.lobby-ambient {
    position: absolute;
    width: min(38vw, 440px);
    aspect-ratio: 1;
    border-radius: 50%;
    opacity: .11;
    filter: blur(65px);
    will-change: transform;
}

.lobby-ambient-one {
    top: 4%;
    left: 28%;
    background: #078bd6;
    animation: lobby-light-drift-one 24s ease-in-out infinite alternate;
}

.lobby-ambient-two {
    right: 2%;
    bottom: -16%;
    background: #1151bb;
    animation: lobby-light-drift-two 31s ease-in-out infinite alternate;
}

.lobby-grid {
    position: absolute;
    inset: 0;
    opacity: .32;
    background:
        linear-gradient(transparent 96%, rgba(56, 217, 255, .04) 100%),
        linear-gradient(90deg, transparent 96%, rgba(56, 217, 255, .035) 100%);
    background-size: 54px 54px;
    mask-image: linear-gradient(transparent, #000 30%, #000 75%, transparent);
}

.lobby-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #9af4ff;
    box-shadow: 0 0 10px rgba(56, 217, 255, .8);
    opacity: .35;
    will-change: transform, opacity;
}

.lobby-particle-one {
    top: 25%;
    left: 19%;
    animation: lobby-particle-float-one 17s ease-in-out infinite alternate;
}

.lobby-particle-two {
    top: 53%;
    right: 15%;
    width: 2px;
    height: 2px;
    animation: lobby-particle-float-two 23s ease-in-out infinite alternate;
}

.lobby-particle-three {
    bottom: 22%;
    left: 31%;
    animation: lobby-particle-float-three 20s ease-in-out infinite alternate;
}

.lobby-particle-four {
    top: 33%;
    right: 28%;
    width: 2px;
    height: 2px;
    animation: lobby-particle-float-two 26s ease-in-out -8s infinite alternate;
}

.lobby-welcome {
    position: absolute;
    z-index: 3;
    top: clamp(1.4rem, 3vw, 2.5rem);
    left: clamp(1.25rem, 3.2vw, 3.25rem);
    max-width: min(38vw, 440px);
    animation: lobby-welcome-arrive .8s ease both;
}

.lobby-welcome .dashboard-eyebrow {
    margin: 0 0 .55rem;
}

.lobby-welcome h1 {
    margin: 0;
    color: #e7f4ff;
    font-size: clamp(1.15rem, 2vw, 1.8rem);
    line-height: 1.35;
    letter-spacing: .07em;
    overflow-wrap: anywhere;
}

.lobby-welcome h1 span {
    color: var(--cyan);
    text-shadow: 0 0 20px rgba(56, 217, 255, .26);
}

.lobby-welcome > p:last-child {
    margin: .55rem 0 0;
    color: #91abc2;
    font-size: var(--type-body);
}

.lobby-stage {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem 1rem 4.5rem;
    pointer-events: none;
}

.lobby-artwork {
    display: block;
    width: min(100%, 980px);
    max-height: 100%;
    overflow: visible;
    opacity: 0;
    filter: drop-shadow(0 10px 38px rgba(16, 104, 144, .15));
    transform: translate3d(0, 14px, 0) scale(.98);
    animation: lobby-art-reveal 1.1s .1s cubic-bezier(.2, .75, .3, 1) forwards;
}

.lobby-shield {
    transform-box: fill-box;
    transform-origin: center;
    animation: lobby-shield-rotation 72s linear infinite;
}

.lobby-network {
    animation: lobby-network-breathe 6s ease-in-out infinite alternate;
}

.lobby-monitor-light,
.lobby-diagnostics circle {
    animation: lobby-diagnostic-blink 4.2s ease-in-out infinite;
}

.lobby-monitor-light:nth-of-type(2) {
    animation-delay: -1.7s;
}

.lobby-diagnostics circle:nth-child(2) {
    animation-delay: -2.4s;
}

.lobby-screen-activity {
    animation: lobby-monitor-refresh 5.5s ease-in-out infinite;
}

.dashboard-start-game {
    position: absolute;
    z-index: 4;
    right: clamp(1.25rem, 3vw, 2.5rem);
    bottom: clamp(1.25rem, 3vh, 2rem);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    min-width: clamp(190px, 19vw, 255px);
    min-height: 60px;
    padding: .9rem 1.35rem;
    border-radius: 5px;
    background: linear-gradient(110deg, #126ba9, #159ec4);
    color: #e9fbff;
    font-size: var(--type-small);
    letter-spacing: .12em;
    box-shadow: 0 0 24px rgba(56, 217, 255, .2), inset 0 1px rgba(255, 255, 255, .18);
    overflow: hidden;
    transition: transform .22s ease, box-shadow .22s ease, filter .22s ease;
}

.dashboard-start-game::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 35%;
    content: "";
    background: linear-gradient(90deg, transparent, rgba(220, 251, 255, .24), transparent);
    transform: skewX(-20deg);
    transition: left .5s ease;
}

.dashboard-start-game > span {
    position: relative;
    z-index: 1;
}

.dashboard-start-game:hover {
    box-shadow: 0 0 32px rgba(56, 217, 255, .34), inset 0 1px rgba(255, 255, 255, .2);
    filter: brightness(1.08);
    transform: translateY(-2px);
}

.dashboard-start-game:hover::before {
    left: 130%;
}

.dashboard-start-game .dashboard-mission-action-arrow {
    transition: transform .22s ease;
}

.dashboard-start-game:hover .dashboard-mission-action-arrow {
    transform: translateX(4px);
}

.dashboard-start-game:active {
    transform: translateY(0);
}

.dashboard-primary-button:focus-visible,
.dashboard-nav-item:focus-visible,
.dashboard-profile-trigger:focus-visible,
.dashboard-profile-action:focus-visible,
.dashboard-sidebar-toggle:focus-visible {
    outline: 2px solid #d6f8ff;
    outline-offset: 3px;
}

.dashboard-drawer-backdrop {
    display: none;
}

.dashboard-route-screen:not(#dashboard-screen) {
    padding: 1.5rem clamp(1.25rem, 2.8vw, 2.5rem) 2rem;
}

@keyframes lobby-grid-drift {
    to { transform: translate3d(48px, 48px, 0); }
}

@keyframes lobby-light-drift-one {
    to { transform: translate3d(34px, 18px, 0); }
}

@keyframes lobby-light-drift-two {
    to { transform: translate3d(-28px, -24px, 0); }
}

@keyframes lobby-particle-float-one {
    to { opacity: .7; transform: translate3d(26px, -18px, 0); }
}

@keyframes lobby-particle-float-two {
    to { opacity: .75; transform: translate3d(-18px, 24px, 0); }
}

@keyframes lobby-particle-float-three {
    to { opacity: .65; transform: translate3d(14px, -30px, 0); }
}

@keyframes lobby-workstation-glow {
    to { opacity: .65; }
}

@keyframes lobby-shield-rotation {
    to { transform: rotate(360deg); }
}

@keyframes lobby-network-breathe {
    to { opacity: .58; }
}

@keyframes lobby-diagnostic-blink {
    0%, 78%, 100% { opacity: .95; }
    84% { opacity: .35; }
}

@keyframes lobby-monitor-refresh {
    0%, 100% { opacity: .76; }
    48% { opacity: 1; }
    54% { opacity: .58; }
}

@keyframes lobby-welcome-arrive {
    from { opacity: 0; transform: translate3d(0, 8px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes lobby-art-reveal {
    to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@media (max-width: 760px) {
    .dashboard-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-sidebar {
        position: fixed;
        z-index: 30;
        top: 76px;
        bottom: 0;
        left: 0;
        width: min(280px, 82vw);
        padding: 1.25rem 1rem;
        border-right: 1px solid rgba(56, 217, 255, .24);
        border-bottom: 0;
        box-shadow: 18px 0 44px rgba(0, 0, 0, .34);
        transform: translate3d(-105%, 0, 0);
        transition: transform .28s ease;
    }

    .dashboard-screen.is-mobile-navigation-open .dashboard-sidebar {
        transform: translate3d(0, 0, 0);
    }

    .dashboard-nav {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-screen.is-sidebar-collapsed .dashboard-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .dashboard-screen.is-sidebar-collapsed .dashboard-sidebar {
        padding: 1.25rem 1rem;
    }

    .dashboard-screen.is-sidebar-collapsed .dashboard-nav-item {
        grid-template-columns: 2rem minmax(0, 1fr);
        justify-items: stretch;
        padding: .65rem .75rem;
    }

    .dashboard-screen.is-sidebar-collapsed .dashboard-nav-label {
        position: static;
        width: auto;
        height: auto;
        overflow: visible;
        clip-path: none;
    }

    .dashboard-screen.is-sidebar-collapsed .dashboard-engine-indicator {
        justify-content: flex-start;
        font-size: var(--type-micro);
    }

    .dashboard-drawer-backdrop {
        position: absolute;
        z-index: 2;
        inset: 76px 0 0;
        display: block;
        visibility: hidden;
        border: 0;
        background: rgba(1, 7, 14, .66);
        opacity: 0;
        pointer-events: none;
        transition: opacity .24s ease, visibility 0s linear .24s;
    }

    .dashboard-screen.is-mobile-navigation-open .dashboard-drawer-backdrop {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        transition-delay: 0s;
    }

    .dashboard-main {
        grid-column: 1;
    }

    .dashboard-header {
        flex-direction: row;
        align-items: center;
        padding-right: 1rem;
        padding-left: 1rem;
    }

    .dashboard-header-brand {
        flex: 1 1 auto;
        gap: .65rem;
        min-width: 0;
    }

    .dashboard-game-brand {
        min-width: 0;
    }

    .dashboard-game-brand > span:last-child {
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .dashboard-profile-trigger {
        gap: .45rem;
        padding-right: .25rem;
        padding-left: .25rem;
    }

    .dashboard-profile-trigger-copy strong {
        max-width: 112px;
    }

    .dashboard-content.dashboard-lobby {
        height: calc(100dvh - 76px);
        min-height: 420px;
    }

    .lobby-welcome {
        top: 1.4rem;
        left: 1.25rem;
        max-width: min(65vw, 360px);
    }

    .lobby-welcome h1 {
        font-size: clamp(1.05rem, 4vw, 1.4rem);
    }

    .lobby-stage {
        padding: 1rem .25rem 5.2rem;
    }

    .lobby-artwork {
        width: 112%;
        max-width: none;
    }

    .dashboard-start-game {
        right: 1rem;
        bottom: 1rem;
        min-width: 180px;
        min-height: 54px;
    }

    .dashboard-route-screen:not(#dashboard-screen) {
        padding: 1.25rem 1rem 2rem;
    }
}



@media (max-width: 460px) {
    .dashboard-header {
        height: 68px;
        gap: .25rem;
        padding-right: .6rem;
        padding-left: .6rem;
    }

    .dashboard-main {
        padding-top: 68px;
    }

    .dashboard-sidebar {
        top: 68px;
    }

    .dashboard-drawer-backdrop {
        inset-block-start: 68px;
    }

    .dashboard-game-brand {
        gap: .4rem;
        flex: 1 1 auto;
        font-size: .52rem;
        letter-spacing: .04em;
    }

    .dashboard-game-brand .dashboard-brand-icon {
        font-size: 1.2rem;
    }

    .dashboard-sidebar-toggle {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }

    .dashboard-profile-trigger .dashboard-avatar {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
    }

    .dashboard-profile-trigger-copy strong {
        max-width: 76px;
        font-size: .52rem;
    }

    .dashboard-profile-trigger-copy small {
        font-size: .45rem;
        letter-spacing: .03em;
    }

    .dashboard-content.dashboard-lobby {
        height: calc(100dvh - 68px);
        min-height: 390px;
    }

    .lobby-welcome {
        top: 1.1rem;
        left: 1rem;
        max-width: 73vw;
    }

    .lobby-welcome .dashboard-eyebrow {
        font-size: .53rem;
    }

    .lobby-welcome h1 {
        font-size: clamp(.9rem, 4.3vw, 1.15rem);
    }

    .lobby-welcome > p:last-child {
        font-size: .75rem;
    }

    .lobby-stage {
        padding: 2.5rem 0 5.3rem;
    }

    .lobby-artwork {
        width: 138%;
        max-width: none;
    }

    .dashboard-start-game {
        right: .75rem;
        bottom: .75rem;
        min-width: 168px;
        min-height: 50px;
        padding: .75rem 1rem;
        font-size: .64rem;
    }

    .dashboard-route-screen:not(#dashboard-screen) {
        padding: 1rem .75rem 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dashboard-sidebar,
    .dashboard-nav-item,
    .dashboard-sidebar-toggle,
    .dashboard-profile-trigger,
    .dashboard-profile-chevron,
    .dashboard-profile-action,
    .dashboard-drawer-backdrop,
    .dashboard-start-game,
    .dashboard-start-game::before {
        transition: none;
    }

    .dashboard-content.dashboard-lobby::before,
    .dashboard-content.dashboard-lobby::after,
    .lobby-ambient,
    .lobby-particle,
    .lobby-artwork,
    .lobby-welcome,
    .lobby-shield,
    .lobby-network,
    .lobby-monitor-light,
    .lobby-diagnostics circle,
    .lobby-screen-activity {
        animation: none;
    }

    .lobby-artwork {
        opacity: 1;
        transform: none;
    }
}

/* PART 6.1 LOBBY REFINEMENTS */

.welcome-access-note {
    margin: .55rem 0 0;
    color: #9cb2ca;
    font-size: var(--type-small);
    letter-spacing: .02em;
}

.lobby-welcome {
    max-width: min(440px, 42vw);
}

.lobby-welcome .dashboard-eyebrow {
    margin-bottom: .65rem;
}

.lobby-welcome h1 {
    max-width: 13em;
    font-size: clamp(1.2rem, 2.15vw, 1.8rem);
    line-height: 1.4;
}

.lobby-supporting-copy {
    max-width: 340px;
    margin: .75rem 0 0;
    color: #9cb2ca;
    font-size: var(--type-small);
    line-height: 1.5;
}

.levels-overview-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: clamp(.7rem, 1.3vw, 1rem);
}

.levels-overview-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: clamp(.9rem, 1.5vw, 1.25rem);
    border: 1px solid rgba(56, 217, 255, .18);
    border-radius: 7px;
    background:
        radial-gradient(ellipse at 100% 0%, rgba(38, 140, 255, .08), transparent 55%),
        rgba(8, 19, 35, .9);
}

.levels-overview-card.easy {
    border-top-color: rgba(77, 255, 181, .62);
}

.levels-overview-card.medium {
    border-top-color: rgba(56, 217, 255, .65);
}

.levels-overview-card.hard {
    border-top-color: rgba(255, 125, 150, .62);
}

.levels-overview-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
}

.levels-overview-heading h3 {
    margin: 0;
    color: var(--cyan);
    font-size: var(--type-body);
    letter-spacing: .1em;
}

.levels-overview-card.easy .levels-overview-heading h3 {
    color: var(--green);
}

.levels-overview-card.hard .levels-overview-heading h3 {
    color: #ff9aaf;
}

.levels-overview-heading span {
    color: var(--muted);
    font-family: monospace;
    font-size: var(--type-micro);
    text-align: right;
}

.levels-overview-description {
    min-height: 2.8em;
    margin: .55rem 0 .8rem;
    color: #a9bfd3;
    font-size: var(--type-small);
    line-height: 1.45;
}

.levels-overview-configuration {
    display: grid;
    gap: .25rem;
    margin: 0;
}

.levels-overview-configuration > div {
    display: flex;
    justify-content: space-between;
    gap: .75rem;
    padding: .4rem 0;
    border-bottom: 1px solid rgba(56, 217, 255, .09);
}

.levels-overview-configuration dt {
    color: var(--muted);
    font-family: monospace;
    font-size: var(--type-micro);
}

.levels-overview-configuration dd {
    margin: 0;
    color: #d3eff7;
    font-family: monospace;
    font-size: var(--type-micro);
    text-align: right;
}

.levels-progress-heading {
    margin: .85rem 0 .45rem;
    color: var(--muted);
    font-family: monospace;
    font-size: .56rem;
    letter-spacing: .035em;
}

.levels-overview-map {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .3rem;
}

.levels-overview-marker {
    display: grid;
    place-items: center;
    min-height: 30px;
    border: 1px solid rgba(130, 155, 181, .16);
    border-radius: 3px;
    background: rgba(130, 155, 181, .04);
    color: #738ba2;
    font-family: monospace;
    font-size: var(--type-micro);
}

.levels-overview-marker.current,
.levels-overview-marker.unlocked {
    border-color: rgba(56, 217, 255, .34);
    background: rgba(56, 217, 255, .07);
    color: var(--cyan);
}

.levels-overview-marker.completed {
    border-color: rgba(77, 255, 181, .38);
    background: rgba(77, 255, 181, .07);
    color: var(--green);
}

.levels-overview-marker.failed {
    border-color: rgba(255, 73, 108, .38);
    color: #ff9aaf;
}

.levels-roadmap-button {
    width: 100%;
    min-height: 44px;
    margin-top: auto;
    padding: .65rem .5rem;
    font-size: var(--type-micro);
}

.lobby-network-links {
    stroke-dasharray: 4 9;
    animation: lobby-network-flow 12s linear infinite;
}

.lobby-radar-sweep {
    transform-box: view-box;
    transform-origin: 256px 350px;
    animation: lobby-radar-rotation 8s linear infinite;
}

.lobby-radar-target {
    animation: lobby-radar-target-pulse 2.7s ease-in-out infinite;
}

.lobby-radar-target.secondary {
    animation-delay: -1.3s;
}

.lobby-terminal-heading {
    fill: #57d8ef;
    font-family: monospace;
    font-size: 10px;
    letter-spacing: .04em;
}

.lobby-terminal-line {
    font-family: monospace;
    font-size: 11px;
    letter-spacing: .015em;
    transition: opacity .2s ease;
}

.lobby-terminal-line.info {
    fill: #76cde0;
}

.lobby-terminal-line.success {
    fill: #75e3b1;
}

.lobby-terminal-line.warning {
    fill: #f3cb7c;
}

.lobby-monitor-scanline {
    animation: lobby-monitor-scan 5.2s ease-in-out infinite;
}

@keyframes lobby-network-flow {
    to { stroke-dashoffset: -52; }
}

@keyframes lobby-radar-rotation {
    to { transform: rotate(360deg); }
}

@keyframes lobby-radar-target-pulse {
    0%, 100% { opacity: .48; }
    50% { opacity: 1; }
}

@keyframes lobby-monitor-scan {
    0%, 100% { transform: translateY(0); opacity: .3; }
    50% { transform: translateY(52px); opacity: .72; }
}

@media (max-width: 1100px) {
    .levels-overview-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .lobby-welcome {
        max-width: min(76vw, 420px);
    }

    .lobby-welcome h1 {
        font-size: clamp(1rem, 4.2vw, 1.4rem);
    }

    .lobby-supporting-copy {
        max-width: 290px;
        margin-top: .5rem;
        font-size: .74rem;
    }

    .levels-overview-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .levels-overview-description {
        min-height: 0;
    }

    .lobby-terminal-heading,
    .lobby-terminal-line,
    .lobby-monitor-scanline {
        display: none;
    }
}

@media (max-width: 460px) {
    .welcome-access-note {
        max-width: 19rem;
        margin-right: auto;
        margin-left: auto;
        font-size: var(--type-small);
        line-height: 1.4;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lobby-network-links,
    .lobby-radar-sweep,
    .lobby-radar-target,
    .lobby-monitor-scanline {
        animation: none;
    }

    .lobby-network-data-signal animateMotion {
        display: none;
    }

    .lobby-terminal-line {
        transition: none;
    }
}

body.app-reduced-motion .lobby-network-data-signal animateMotion {
    display: none;
}

/* Lobby operator: replace the central globe with a seated workstation scene. */
.lobby-globe {
    display: none;
}

.lobby-environment-near .lobby-workstation {
    bottom: 22%;
    width: min(66vw, 820px);
    height: 38%;
}

.lobby-environment-near .lobby-monitor {
    bottom: 31%;
}

.lobby-environment-near .lobby-monitor-left {
    left: 1%;
    transform: perspective(520px) rotateY(12deg) rotateZ(-1deg);
}

.lobby-environment-near .lobby-monitor-centre {
    left: 35%;
    bottom: 36%;
    height: 69%;
}

.lobby-environment-near .lobby-monitor-right {
    right: 1%;
    transform: perspective(520px) rotateY(-12deg) rotateZ(1deg);
}

.lobby-environment-near .lobby-console {
    bottom: 17%;
}

.lobby-environment-near .lobby-desk-surface {
    bottom: 7%;
    height: 16%;
}

.lobby-operator {
    bottom: 3.5%;
    width: clamp(190px, 18vw, 270px);
    height: 38%;
    transform: translateX(-50%) translateZ(190px);
    filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .78));
    transform-origin: 50% 100%;
    animation: lobby-operator-breathe 4.2s ease-in-out infinite;
}

.lobby-operator-head,
.lobby-operator-neck,
.lobby-operator-body,
.lobby-operator-shoulder,
.lobby-operator-arm,
.lobby-operator-leg,
.lobby-operator-chair {
    position: absolute;
    display: block;
}

.lobby-operator-head {
    z-index: 8;
    top: 0;
    left: 50%;
    width: 24%;
    height: 19%;
    border: 1px solid rgba(91, 208, 238, .38);
    border-radius: 46% 46% 52% 52%;
    background:
        radial-gradient(circle at 33% 48%, #38d9ff 0 2%, transparent 3%),
        radial-gradient(circle at 67% 48%, #38d9ff 0 2%, transparent 3%),
        linear-gradient(135deg, #102a3b 0%, #02060c 62%);
    box-shadow: inset 0 -6px 12px rgba(0, 0, 0, .7), 0 0 16px rgba(56, 217, 255, .12);
    transform: translateX(-50%);
}

.lobby-operator-head i {
    position: absolute;
    left: 14%;
    right: 14%;
    bottom: 18%;
    height: 2px;
    border-radius: 50%;
    background: rgba(134, 229, 245, .42);
}

.lobby-operator-neck {
    z-index: 5;
    top: 16%;
    left: 50%;
    width: 12%;
    height: 12%;
    background: linear-gradient(90deg, #091725, #164158, #091725);
    transform: translateX(-50%);
}

.lobby-operator-body {
    z-index: 4;
    top: 24%;
    left: 50%;
    width: 54%;
    height: 48%;
    border: 1px solid rgba(72, 178, 210, .28);
    border-radius: 35% 35% 12% 12%;
    background:
        linear-gradient(90deg, transparent 49%, rgba(83, 211, 239, .12) 50%, transparent 51%),
        linear-gradient(145deg, #102f42 0%, #071421 54%, #02070e 100%);
    clip-path: polygon(18% 0, 82% 0, 100% 24%, 90% 100%, 10% 100%, 0 24%);
    transform: translateX(-50%);
}

.lobby-operator-shoulder {
    z-index: 6;
    top: 27%;
    left: 50%;
    width: 82%;
    height: 18%;
    border: 1px solid rgba(92, 210, 238, .22);
    border-radius: 48%;
    background: linear-gradient(90deg, #07111c, #16455a 48%, #07111c);
    transform: translateX(-50%);
}

.lobby-operator-arm {
    z-index: 7;
    top: 39%;
    width: 18%;
    height: 27%;
    border: 1px solid rgba(67, 176, 207, .24);
    border-radius: 999px;
    background: linear-gradient(90deg, #07111b, #12374a);
}

.lobby-operator-arm-left {
    left: 14%;
    transform: rotate(-28deg);
    transform-origin: top center;
}

.lobby-operator-arm-right {
    right: 14%;
    transform: rotate(28deg);
    transform-origin: top center;
}

.lobby-operator-leg {
    z-index: 3;
    bottom: 0;
    width: 25%;
    height: 34%;
    border: 1px solid rgba(58, 155, 189, .18);
    border-radius: 35% 35% 8px 8px;
    background: linear-gradient(135deg, #091824, #02060b);
}

.lobby-operator-leg-left {
    left: 25%;
    transform: rotate(5deg);
}

.lobby-operator-leg-right {
    right: 25%;
    transform: rotate(-5deg);
}

.lobby-operator-chair {
    z-index: 2;
    left: 50%;
    bottom: -1%;
    width: 70%;
    height: 67%;
    border: 2px solid rgba(69, 190, 222, .24);
    border-radius: 44% 44% 12% 12%;
    background: linear-gradient(160deg, #0b1d2b, #02070d 70%);
    box-shadow: 0 0 22px rgba(27, 131, 165, .12);
    transform: translateX(-50%);
}

@keyframes lobby-operator-breathe {
    0%, 100% { transform: translateX(-50%) translateZ(190px) translateY(0); }
    50% { transform: translateX(-50%) translateZ(190px) translateY(-3px); }
}

@media (max-width: 760px) {
    .lobby-environment-near .lobby-workstation {
        bottom: 28%;
        width: 118%;
        height: 32%;
    }

    .lobby-operator {
        bottom: 9%;
        width: clamp(150px, 38vw, 210px);
        height: 34%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lobby-operator {
        animation: none;
    }
}

/* EMAIL VERIFICATION SCREENS */

#email-verification-pending-screen .portal-card,
#email-verified-screen .portal-card {
    text-align: center;
}

#email-verification-pending-screen .intro-emblem,
#email-verified-screen .intro-emblem {
    width: 80px;
    height: 80px;
    font-size: clamp(2.5rem, calc(2rem + 1.5vw), 3.5rem);
    margin: 0 auto 1.5rem;
    border-color: var(--cyan);
    background: rgba(56, 217, 255, 0.08);
}

#email-verified-screen .intro-emblem {
    color: var(--green);
    border-color: #4dffb566;
    background: rgba(77, 255, 181, 0.08);
    box-shadow: 0 0 30px rgba(77, 255, 181, 0.15);
}

#email-verification-pending-screen .portal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    margin: 1.5rem 0;
}

#email-verification-pending-screen .portal-field {
    width: 100%;
    max-width: 320px;
}

#resend-verification-email {
    text-align: center;
    background: rgba(56, 217, 255, 0.05);
}

#resend-verification-btn {
    width: 100%;
    max-width: 320px;
}

#resend-verification-countdown {
    color: var(--muted);
    font-family: monospace;
    font-size: var(--type-small);
    text-align: center;
    min-height: 1.25rem;
}

#email-verified-screen .portal-note,
#account-created-screen .portal-note {
    margin: 1.5rem 0;
    color: #9cb2ca;
    font-size: var(--type-lead);
}

#verified-login-btn,
#account-created-login {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    display: block;
}

#verification-pending-login {
    margin-top: 1.5rem;
}

@media (max-width: 600px) {
    #email-verification-pending-screen .portal-form {
        gap: 0.75rem;
    }
    #verified-login-btn,
    #account-created-login {
        max-width: 100%;
    }
}

/* RANK SYSTEM STYLES */

.lobby-ranks-container {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.lobby-rank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--type-small);
    padding: 0.2rem 0;
}

.lobby-rank-mode {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.65rem;
}

.lobby-rank-title {
    color: var(--cyan);
    font-weight: 600;
    font-size: 0.78rem;
}

.dashboard-rank-sections {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dashboard-rank-panel {
    padding: 1rem 1.25rem;
}

.dashboard-panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.dashboard-rank-panel .dashboard-panel-heading h3 {
    font-size: var(--type-lead);
    color: var(--cyan);
}

.dashboard-rank-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dashboard-rank-bar {
    height: 8px;
    background: rgba(56, 217, 255, 0.12);
    border-radius: 4px;
    overflow: hidden;
}

.dashboard-rank-bar > div {
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), #4dffb5);
    border-radius: 4px;
    transition: width 0.4s ease;
}

.dashboard-rank-stats {
    display: flex;
    justify-content: space-between;
    font-size: var(--type-small);
    color: var(--muted);
}

.dashboard-rank-stats span:last-child {
    color: var(--cyan);
}

.statistics-mode-rank {
    color: var(--cyan);
    font-weight: 600;
    padding: .2rem .45rem;
    border: 1px solid rgba(56, 217, 255, 0.35);
    border-radius: 999px;
    font-size: var(--type-micro);
    letter-spacing: .06em;
    text-transform: uppercase;
}

@media (max-width: 600px) {
    .statistics-difficulty-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .statistics-mode-row {
        padding: .8rem;
    }

    .dashboard-rank-sections {
        gap: 0.75rem;
    }
    .dashboard-rank-panel {
        padding: 0.75rem 1rem;
    }
    .lobby-ranks-container {
        gap: 0.2rem;
    }
    .lobby-rank-title {
        font-size: 0.7rem;
    }
    .lobby-rank-mode {
        font-size: 0.6rem;
    }
}

/* Final lobby composition overrides */
.dashboard-screen {
    overflow: hidden;
    background: #030914;
}

.dashboard-layout {
    display: block;
    height: 100dvh;
    overflow: hidden;
}

.dashboard-main {
    width: 100%;
    height: 100dvh;
    padding: 0;
    overflow: auto;
}

.dashboard-header {
    position: fixed;
    z-index: 25;
    height: auto;
    min-height: 0;
    padding: 1.1rem clamp(1rem, 3vw, 2.75rem);
    border: 0;
    background: linear-gradient(180deg, rgba(2, 8, 18, .76), transparent);
    box-shadow: none;
    backdrop-filter: none;
    pointer-events: none;
}

.dashboard-header > * { pointer-events: auto; }
.dashboard-header-brand { gap: .75rem; }
.dashboard-game-brand { text-shadow: 0 0 18px rgba(56, 217, 255, .2); }

.dashboard-sidebar-toggle {
    width: 36px;
    height: 36px;
    border-color: rgba(56, 217, 255, .35);
    background: rgba(3, 19, 35, .45);
    box-shadow: 0 0 18px rgba(56, 217, 255, .08);
}

.dashboard-profile-trigger {
    min-height: 44px;
    border-color: rgba(56, 217, 255, .28);
    background: rgba(3, 19, 35, .5);
    box-shadow: 0 0 24px rgba(0, 0, 0, .2);
    backdrop-filter: blur(8px);
}

.dashboard-sidebar {
    position: fixed;
    z-index: 20;
    top: 7.25rem;
    bottom: auto;
    left: clamp(1rem, 3vw, 2.75rem);
    width: 210px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.dashboard-nav { gap: .2rem; }

.dashboard-nav-item {
    min-height: 38px;
    padding: .5rem .55rem;
    border-color: transparent;
    border-radius: 0;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    color: rgba(202, 224, 239, .72);
    font-size: .58rem;
    letter-spacing: .09em;
}

.dashboard-nav-icon { font-size: 1rem; }

.dashboard-nav-item:hover,
.dashboard-nav-item.active {
    border-color: rgba(56, 217, 255, .42);
    background: linear-gradient(90deg, rgba(56, 217, 255, .18), rgba(56, 217, 255, .025));
    box-shadow: inset 2px 0 var(--cyan), 0 0 18px rgba(56, 217, 255, .08);
    color: #e9fbff;
}

.dashboard-sidebar-bottom { display: none; }

.dashboard-screen.is-sidebar-collapsed .dashboard-layout { display: block; }

.dashboard-screen.is-sidebar-collapsed .dashboard-sidebar {
    width: 52px;
    padding: .55rem .35rem;
    border-color: rgba(56, 217, 255, .18);
}

.dashboard-screen.is-sidebar-collapsed .dashboard-nav-item {
    min-height: 38px;
    padding: .5rem .25rem;
}

.dashboard-content.dashboard-lobby {
    height: 100dvh;
    min-height: 560px;
    background: #030914;
}

.dashboard-content.dashboard-lobby::before { opacity: .2; background-size: 42px 42px; }
.dashboard-content.dashboard-lobby::after {
    z-index: 2;
    opacity: 1;
    background:
        linear-gradient(180deg, rgba(1, 7, 17, .62) 0%, rgba(1, 7, 17, .08) 34%, rgba(1, 7, 17, .2) 68%, rgba(1, 7, 17, .76) 100%),
        linear-gradient(90deg, rgba(1, 7, 17, .48), transparent 38%, transparent 68%, rgba(1, 7, 17, .24));
}
.lobby-backdrop { z-index: 0; }
.lobby-stage {
    position: absolute;
    inset: 0;
    z-index: 1;
    padding: 0;
    overflow: hidden;
    pointer-events: none;
}

.lobby-welcome {
    top: clamp(7rem, 14vh, 9.5rem);
    left: 0;
    right: 0;
    width: min(90%, 560px);
    max-width: none;
    margin-inline: auto;
    text-align: center;
    transform: none;
}

.lobby-welcome .dashboard-eyebrow { margin-bottom: .7rem; }

.lobby-welcome h1 {
    color: #effcff;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    line-height: 1.05;
    letter-spacing: .14em;
    white-space: nowrap;
    text-shadow: 0 0 28px rgba(56, 217, 255, .3);
}

.lobby-hero-tagline {
    margin: .8rem 0 0;
    color: var(--cyan);
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(.72rem, 1.15vw, .9rem);
    font-weight: 600;
    letter-spacing: .12em;
}

.lobby-welcome > p:last-child { margin-top: .45rem; color: #b3cada; font-size: var(--type-small); }

.lobby-actions {
    position: absolute;
    z-index: 4;
    bottom: clamp(1rem, 4vh, 2.5rem);
    right: 0;
    left: 0;
    display: flex;
    justify-content: center;
    gap: .7rem;
    width: min(92%, 520px);
    margin-inline: auto;
    transform: none;
}

.lobby-action-button {
    position: static;
    min-width: 0;
    flex: 1 1 0;
    min-height: 48px;
    padding: .75rem 1rem;
    font-size: .62rem;
}

.lobby-actions .dashboard-start-game {
    right: auto;
    bottom: auto;
}

.lobby-action-button.dashboard-secondary-button {
    border: 1px solid rgba(56, 217, 255, .38);
    background: rgba(4, 25, 43, .66);
    color: #ccecf5;
}

.lobby-action-button.dashboard-secondary-button:hover {
    border-color: var(--cyan);
    background: rgba(56, 217, 255, .12);
    color: #effcff;
}

.lobby-hud {
    position: absolute;
    z-index: 4;
    right: clamp(1rem, 3vw, 2.75rem);
    bottom: clamp(1rem, 4vh, 2.5rem);
    display: flex;
    align-items: end;
    gap: 1.25rem;
    width: min(31vw, 300px);
    color: #b9d5e5;
    font-family: monospace;
}

.lobby-hud-item { display: grid; gap: .3rem; min-width: 0; }
.lobby-hud-label { color: #7da1b8; font-size: .55rem; letter-spacing: .08em; }
.lobby-hud-item strong { color: var(--cyan); font-size: .85rem; font-weight: 500; }
.lobby-hud-track { display: block; width: 120px; height: 4px; overflow: hidden; border: 1px solid rgba(56, 217, 255, .25); background: rgba(56, 217, 255, .08); }
.lobby-hud-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--cyan), #4dffb5); transition: width .4s ease; }

@media (max-width: 760px) {
    .dashboard-header { padding: .8rem; }
    .dashboard-game-brand { font-size: .58rem; }
    .dashboard-sidebar { top: 4.6rem; left: .75rem; width: min(250px, calc(100vw - 1.5rem)); padding: 0; }
    .dashboard-content.dashboard-lobby { min-height: 680px; }
    .lobby-welcome { top: 6.2rem; width: calc(100% - 2rem); }
    .lobby-welcome h1 { font-size: clamp(1.45rem, 8vw, 2.4rem); white-space: normal; }
    .lobby-stage { inset: 0; }
    .lobby-actions { bottom: 5.6rem; width: calc(100% - 2rem); flex-direction: column; }
    .lobby-action-button { width: 100%; }
    .lobby-hud { right: 1rem; bottom: 1rem; left: 1rem; justify-content: space-between; width: auto; }
}

/* Animated command-centre environment */
.dashboard-content.dashboard-lobby {
    background: #020914;
    perspective: 1200px;
    perspective-origin: 50% 46%;
}

.dashboard-content.dashboard-lobby::before {
    opacity: .22;
    z-index: 2;
    background-size: 56px 56px;
    mask-image: linear-gradient(180deg, transparent 8%, #000 44%, transparent 96%);
}

.dashboard-content.dashboard-lobby::after {
    z-index: 2;
    opacity: 1;
    background:
        linear-gradient(180deg, rgba(1, 7, 17, .7), rgba(1, 7, 17, .03) 39%, rgba(1, 7, 17, .15) 66%, rgba(1, 7, 17, .78)),
        linear-gradient(90deg, rgba(1, 7, 17, .56), transparent 27%, transparent 76%, rgba(1, 7, 17, .42));
}

.lobby-stage {
    position: absolute;
    z-index: 1;
    inset: 0;
    overflow: hidden;
    isolation: isolate;
    pointer-events: none;
    transform-style: preserve-3d;
    background:
        radial-gradient(ellipse at 50% 54%, rgba(7, 88, 125, .3), transparent 42%),
        linear-gradient(180deg, #061426 0%, #07192b 47%, #020812 100%);
}

.lobby-environment,
.lobby-environment > * { position: absolute; }
.lobby-environment { inset: 0; transform-style: preserve-3d; }
.lobby-environment-far { z-index: 1; opacity: .92; transform: translate3d(calc(var(--lobby-parallax-x, 0px) * -.35), calc(var(--lobby-parallax-y, 0px) * -.2), 0); }
.lobby-environment-mid { z-index: 2; transform: translate3d(calc(var(--lobby-parallax-x, 0px) * .35), calc(var(--lobby-parallax-y, 0px) * .2), 0); }
.lobby-environment-near { z-index: 3; transform: translate3d(var(--lobby-parallax-x, 0px), var(--lobby-parallax-y, 0px), 0); }

.lobby-ceiling-grid {
    top: -12%; left: 13%; right: 13%; height: 46%;
    transform: perspective(700px) rotateX(62deg);
    transform-origin: top center;
    border: 1px solid rgba(56, 217, 255, .11);
    background-image:
        linear-gradient(90deg, rgba(56, 217, 255, .12) 1px, transparent 1px),
        linear-gradient(rgba(56, 217, 255, .1) 1px, transparent 1px);
    background-size: 88px 58px;
    box-shadow: 0 0 48px rgba(11, 112, 156, .2);
}

.lobby-ceiling-grid i {
    top: 35%; width: 18%; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(133, 239, 255, .9), transparent);
    box-shadow: 0 0 16px rgba(56, 217, 255, .8);
    animation: lobby-light-pulse 4.8s ease-in-out infinite;
}
.lobby-ceiling-grid i:nth-child(1) { left: 8%; }
.lobby-ceiling-grid i:nth-child(2) { left: 32%; animation-delay: -1.5s; }
.lobby-ceiling-grid i:nth-child(3) { left: 56%; animation-delay: -3s; }
.lobby-ceiling-grid i:nth-child(4) { left: 80%; animation-delay: -4s; }

.lobby-wall-panels { inset: 16% 0 20%; opacity: .8; }
.lobby-wall-panels i {
    top: 0; bottom: 0; width: 18%;
    border: 1px solid rgba(63, 157, 193, .12);
    border-top: 0; border-bottom: 0;
    background: linear-gradient(90deg, rgba(4, 22, 39, .7), rgba(15, 51, 75, .18), rgba(2, 10, 22, .65));
    box-shadow: inset 0 0 35px rgba(0, 174, 214, .05);
}
.lobby-wall-panels i:nth-child(1) { left: -5%; transform: skewY(8deg); }
.lobby-wall-panels i:nth-child(2) { left: 15%; transform: skewY(4deg); }
.lobby-wall-panels i:nth-child(3) { left: 35%; width: 30%; }
.lobby-wall-panels i:nth-child(4) { right: 15%; transform: skewY(-4deg); }
.lobby-wall-panels i:nth-child(5) { right: -5%; transform: skewY(-8deg); }

.lobby-ceiling-lights { top: 10%; left: 16%; right: 16%; height: 8%; }
.lobby-ceiling-lights i {
    top: 0; width: 22%; height: 3px;
    background: linear-gradient(90deg, transparent, #92f5ff 25%, #28bde6 75%, transparent);
    box-shadow: 0 0 22px rgba(56, 217, 255, .75);
    transform: rotate(-8deg);
    animation: lobby-light-pulse 5.6s ease-in-out infinite;
}
.lobby-ceiling-lights i:nth-child(1) { left: 1%; }
.lobby-ceiling-lights i:nth-child(2) { left: 39%; animation-delay: -2.1s; }
.lobby-ceiling-lights i:nth-child(3) { right: 1%; animation-delay: -3.7s; }

.lobby-horizon-glow {
    top: 37%; left: 20%; right: 20%; height: 25%;
    background: radial-gradient(ellipse, rgba(19, 161, 205, .24), transparent 68%);
    filter: blur(14px);
    animation: lobby-horizon-breathe 7s ease-in-out infinite alternate;
}

.lobby-server-rack {
    top: 22%; bottom: 19%; width: clamp(82px, 9vw, 150px);
    border: 1px solid rgba(62, 174, 214, .34);
    background: linear-gradient(110deg, rgba(2, 13, 27, .96), rgba(10, 37, 56, .73));
    box-shadow: 0 0 30px rgba(0, 123, 172, .14), inset 0 0 24px rgba(67, 194, 226, .08);
    transform: perspective(600px) rotateY(8deg);
}
.lobby-server-rack-left { left: 4%; }
.lobby-server-rack-right { right: 4%; transform: perspective(600px) rotateY(-8deg); }
.lobby-rack-topline { display: block; top: 8%; left: 13%; right: 13%; height: 3px; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); }
.lobby-server-rack b {
    left: 12%; right: 12%; height: 9%;
    border-top: 1px solid rgba(92, 184, 217, .22);
    border-bottom: 1px solid rgba(92, 184, 217, .09);
    background: repeating-linear-gradient(90deg, rgba(126, 226, 241, .2) 0 4px, transparent 4px 10px);
    animation: lobby-rack-flicker 4.4s steps(2, end) infinite;
}
.lobby-server-rack b:nth-of-type(1) { top: 24%; }
.lobby-server-rack b:nth-of-type(2) { top: 36%; animation-delay: -1.2s; }
.lobby-server-rack b:nth-of-type(3) { top: 48%; animation-delay: -2.5s; }
.lobby-server-rack b:nth-of-type(4) { top: 60%; animation-delay: -3.3s; }
.lobby-server-rack b:nth-of-type(5) { top: 72%; animation-delay: -.6s; }

.lobby-rail-lights { top: 42%; left: 10%; right: 10%; height: 2px; background: linear-gradient(90deg, transparent, rgba(56, 217, 255, .8), transparent); opacity: .65; }
.lobby-rail-lights i { top: -2px; width: 4px; height: 6px; border-radius: 50%; background: #a7fbff; box-shadow: 0 0 12px #38d9ff; animation: lobby-rail-travel 8s linear infinite; }
.lobby-rail-lights i:nth-child(2) { animation-delay: -1.7s; }.lobby-rail-lights i:nth-child(3) { animation-delay: -3.5s; }.lobby-rail-lights i:nth-child(4) { animation-delay: -5.2s; }.lobby-rail-lights i:nth-child(5) { animation-delay: -6.8s; }

.lobby-globe {
    top: 14%; left: 50%; width: clamp(260px, 30vw, 440px); aspect-ratio: 1;
    transform: translateX(-50%) translateZ(80px);
    filter: drop-shadow(0 0 22px rgba(37, 204, 255, .42));
    animation: lobby-globe-float 8s ease-in-out infinite;
}
.lobby-globe svg { width: 100%; height: 100%; overflow: visible; }
.lobby-globe-ring { fill: none; stroke: rgba(97, 234, 255, .7); stroke-width: 1.2; stroke-dasharray: 9 8; transform-box: fill-box; transform-origin: center; animation: lobby-ring-spin 26s linear infinite; }
.lobby-globe-ring-two { animation-duration: 18s; animation-direction: reverse; }.lobby-globe-ring-three { animation-duration: 34s; }
.lobby-globe-grid { fill: none; stroke: rgba(63, 215, 255, .45); stroke-width: 1; }.lobby-globe-arc { fill: none; stroke: rgba(177, 251, 255, .9); stroke-width: 1.4; stroke-dasharray: 3 11; animation: lobby-data-flow 5s linear infinite; }
.lobby-globe-nodes circle { fill: #c9fdff; stroke: #38d9ff; stroke-width: 3; filter: drop-shadow(0 0 5px #38d9ff); animation: lobby-node-pulse 2.8s ease-in-out infinite alternate; }.lobby-globe-nodes circle:nth-child(2n) { animation-delay: -1.1s; }
.lobby-globe-particle { width: 5px; height: 5px; border-radius: 50%; background: #9df8ff; box-shadow: 0 0 14px 4px rgba(56, 217, 255, .8); animation: lobby-orbit-particle 9s linear infinite; }.lobby-globe-particle-one { top: 28%; left: 12%; }.lobby-globe-particle-two { top: 72%; right: 8%; animation-delay: -3s; animation-duration: 12s; }.lobby-globe-particle-three { top: 8%; right: 29%; animation-delay: -6s; animation-duration: 14s; }

.lobby-workstation { left: 50%; bottom: 19%; width: min(62vw, 760px); height: 34%; transform: translateX(-50%) translateZ(140px); }
.lobby-monitor { bottom: 20%; width: 27%; height: 54%; transform-origin: bottom center; filter: drop-shadow(0 0 12px rgba(35, 191, 226, .24)); }
.lobby-monitor-left { left: 3%; transform: rotateY(16deg) rotateZ(-2deg); }.lobby-monitor-centre { left: 36.5%; bottom: 27%; width: 30%; height: 65%; z-index: 2; }.lobby-monitor-right { right: 3%; transform: rotateY(-16deg) rotateZ(2deg); }
.lobby-monitor-frame { position: absolute; inset: 0; display: block; overflow: hidden; border: 2px solid rgba(78, 202, 231, .72); border-radius: 4px; background: linear-gradient(145deg, rgba(5, 26, 44, .96), rgba(2, 10, 23, .98)); box-shadow: inset 0 0 22px rgba(38, 211, 255, .16), 0 0 16px rgba(38, 211, 255, .16); }
.lobby-monitor-frame::before { position: absolute; inset: 7%; content: ""; border: 1px solid rgba(80, 213, 237, .2); background: radial-gradient(circle at 65% 38%, rgba(51, 221, 255, .24), transparent 18%), linear-gradient(140deg, rgba(12, 67, 91, .26), transparent 42%); }
.lobby-monitor-frame::after { position: absolute; left: 0; right: 0; top: 16%; height: 1px; content: ""; background: rgba(147, 246, 255, .65); box-shadow: 0 22px rgba(147, 246, 255, .15), 0 53px rgba(147, 246, 255, .12); animation: lobby-monitor-scanline 4.8s linear infinite; }
.lobby-monitor > b { top: 100%; left: 46%; width: 8%; height: 20%; background: #123b51; box-shadow: 0 4px 0 8px rgba(3, 15, 27, .9); }
.monitor-map { position: absolute; z-index: 1; top: 25%; left: 18%; width: 38%; height: 30%; border: 1px solid rgba(77, 222, 246, .55); border-radius: 50%; transform: rotate(-22deg); background: repeating-linear-gradient(34deg, transparent 0 7px, rgba(72, 215, 242, .5) 8px 9px); }
.monitor-trace { position: absolute; z-index: 1; left: 12%; right: 12%; bottom: 18%; height: 20%; border-top: 2px solid #49eaff; border-radius: 50%; transform: skewY(-12deg); }.monitor-globe { position: absolute; z-index: 1; top: 21%; left: 27%; width: 44%; aspect-ratio: 1; border: 1px solid rgba(142, 249, 255, .85); border-radius: 50%; box-shadow: inset 11px 0 rgba(48, 210, 240, .1), 0 0 14px rgba(46, 212, 250, .3); }.monitor-globe::before,.monitor-globe::after { position: absolute; inset: 12% -5%; content: ""; border: 1px solid rgba(94, 223, 247, .62); border-radius: 50%; }.monitor-globe::after { transform: rotate(90deg); }.monitor-readout { position: absolute; z-index: 1; left: 12%; right: 12%; bottom: 15%; height: 3px; background: linear-gradient(90deg, #44e7ff 22%, transparent 22% 28%, #44e7ff 28% 76%, transparent 76%); }.monitor-terminal { position: absolute; z-index: 1; inset: 18% 12% 25%; background: repeating-linear-gradient(180deg, rgba(120, 242, 255, .74) 0 2px, transparent 2px 9px); opacity: .68; }.monitor-terminal-line { position: absolute; z-index: 2; left: 12%; right: 30%; bottom: 16%; height: 2px; background: #c2fcff; box-shadow: 0 0 7px #38d9ff; }
.monitor-scan { position: absolute; z-index: 3; left: 0; right: 0; top: -20%; height: 20%; background: linear-gradient(180deg, transparent, rgba(108, 245, 255, .26), transparent); animation: lobby-screen-scan 3.8s linear infinite; }
.lobby-console { left: 11%; right: 11%; bottom: 11%; height: 8%; display: flex; gap: 5%; align-items: center; padding: 0 5%; border: 1px solid rgba(67, 195, 224, .36); background: rgba(3, 24, 39, .9); transform: perspective(300px) rotateX(22deg); }.lobby-console i { width: 8px; height: 3px; border-radius: 50%; background: #55f4c5; box-shadow: 0 0 8px #55f4c5; animation: lobby-node-pulse 2.3s ease-in-out infinite; }.lobby-console i:nth-child(2n) { background: #ffd36a; box-shadow: 0 0 8px #ffd36a; animation-delay: -.8s; }
.lobby-desk-surface { left: 0; right: 0; bottom: 0; height: 14%; border: 1px solid rgba(63, 177, 211, .3); background: linear-gradient(180deg, rgba(14, 46, 63, .92), rgba(2, 12, 23, .96)); clip-path: polygon(7% 0, 93% 0, 100% 100%, 0 100%); box-shadow: 0 -14px 30px rgba(24, 205, 238, .13); }

.lobby-operator { left: 50%; bottom: 10%; width: 22%; height: 32%; transform: translateX(-50%) translateZ(180px); filter: drop-shadow(0 0 16px rgba(0, 0, 0, .85)); }.lobby-operator-head { top: 0; left: 42%; width: 16%; aspect-ratio: .82; border-radius: 48% 48% 42% 42%; background: linear-gradient(100deg, #02070e, #0a1c2b); box-shadow: 0 0 14px rgba(21, 137, 173, .24); }.lobby-operator-body { top: 20%; left: 23%; width: 54%; height: 72%; border-radius: 45% 45% 8% 8%; background: linear-gradient(90deg, #02070f, #0d2332 48%, #02070f); clip-path: polygon(32% 0, 68% 0, 100% 25%, 87% 100%, 13% 100%, 0 25%); }.lobby-operator-shoulder { top: 29%; left: 4%; width: 92%; height: 20%; border-radius: 50%; border-top: 2px solid rgba(46, 133, 165, .33); }
.lobby-floor-grid { left: -10%; right: -10%; bottom: -29%; height: 42%; transform: perspective(430px) rotateX(60deg); transform-origin: center top; background-image: linear-gradient(rgba(36, 174, 213, .18) 1px, transparent 1px), linear-gradient(90deg, rgba(36, 174, 213, .14) 1px, transparent 1px); background-size: 70px 42px; opacity: .65; mask-image: linear-gradient(180deg, #000, transparent 86%); }.lobby-floor-grid i { top: 2%; width: 24%; height: 2px; background: linear-gradient(90deg, transparent, rgba(88, 229, 255, .6), transparent); animation: lobby-floor-flow 9s linear infinite; }.lobby-floor-grid i:nth-child(1) { left: 4%; }.lobby-floor-grid i:nth-child(2) { left: 22%; animation-delay: -1.2s; }.lobby-floor-grid i:nth-child(3) { left: 40%; animation-delay: -2.4s; }.lobby-floor-grid i:nth-child(4) { left: 58%; animation-delay: -3.6s; }.lobby-floor-grid i:nth-child(5) { left: 76%; animation-delay: -4.8s; }.lobby-floor-grid i:nth-child(6) { left: 94%; animation-delay: -6s; }
.lobby-foreground-console { right: 7%; bottom: 23%; display: grid; gap: .35rem; min-width: 110px; padding: .6rem .7rem; border-left: 1px solid rgba(75, 218, 245, .5); color: rgba(142, 227, 244, .7); font: .5rem monospace; letter-spacing: .1em; background: linear-gradient(90deg, rgba(4, 28, 45, .54), transparent); }.lobby-foreground-console i { display: inline-block; width: 18px; height: 2px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: lobby-console-blink 2s ease-in-out infinite; }.lobby-foreground-console i:nth-of-type(2) { animation-delay: -.6s; }.lobby-foreground-console i:nth-of-type(3) { animation-delay: -1.2s; }.lobby-foreground-console b { color: #6affc4; font-weight: 500; }

@keyframes lobby-light-pulse { 0%, 100% { opacity: .42; } 50% { opacity: 1; } }
@keyframes lobby-horizon-breathe { to { opacity: .45; transform: scale(1.12); } }
@keyframes lobby-rack-flicker { 0%, 87%, 100% { opacity: .7; } 90% { opacity: .22; } }
@keyframes lobby-rail-travel { from { transform: translateX(0); } to { transform: translateX(calc(100vw - 20vw)); } }
@keyframes lobby-globe-float { 0%, 100% { margin-top: 0; } 50% { margin-top: -12px; } }
@keyframes lobby-ring-spin { to { transform: rotate(360deg); } }
@keyframes lobby-data-flow { to { stroke-dashoffset: -56; } }
@keyframes lobby-node-pulse { from { opacity: .45; transform: scale(.8); } to { opacity: 1; transform: scale(1.15); } }
@keyframes lobby-orbit-particle { from { transform: rotate(0deg) translateX(148px) rotate(0deg); } to { transform: rotate(360deg) translateX(148px) rotate(-360deg); } }
@keyframes lobby-monitor-scanline { from { transform: translateY(0); } to { transform: translateY(260px); } }
@keyframes lobby-screen-scan { from { transform: translateY(0); } to { transform: translateY(700%); } }
@keyframes lobby-floor-flow { from { transform: translateX(-30%); opacity: 0; } 25%, 75% { opacity: .8; } to { transform: translateX(30%); opacity: 0; } }
@keyframes lobby-console-blink { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

@media (max-width: 760px) {
    .lobby-ceiling-grid { left: -30%; right: -30%; opacity: .7; }
    .lobby-wall-panels { inset: 17% -25% 26%; }
    .lobby-server-rack { top: 25%; bottom: 26%; width: 76px; opacity: .7; }
    .lobby-server-rack-left { left: -2%; }.lobby-server-rack-right { right: -2%; }
    .lobby-globe { top: 22%; width: 245px; opacity: .82; transform: translateX(-50%) translateZ(40px); }
    .lobby-workstation { bottom: 24%; width: 124%; height: 29%; }
    .lobby-monitor { height: 49%; }.lobby-monitor-centre { height: 59%; }
    .lobby-operator { bottom: 14%; width: 31%; height: 27%; }
    .lobby-foreground-console { right: 3%; bottom: 27%; transform: scale(.82); transform-origin: right bottom; }
    .lobby-floor-grid { bottom: -20%; }
}

@media (min-width: 901px) and (max-width: 1100px) {
    .lobby-actions { bottom: 6.5rem; width: min(68%, 520px); }
    .lobby-hud { right: 1rem; bottom: 1rem; width: min(30vw, 270px); }
}

@media (prefers-reduced-motion: reduce) {
    .lobby-ceiling-grid i, .lobby-ceiling-lights i, .lobby-horizon-glow, .lobby-server-rack b,
    .lobby-rail-lights i, .lobby-globe, .lobby-globe-ring, .lobby-globe-arc, .lobby-globe-nodes circle,
    .lobby-globe-particle, .monitor-scan, .monitor-scanline, .lobby-console i, .lobby-floor-grid i,
    .lobby-foreground-console i { animation: none; }
}

/* Final lobby operator composition overrides older operator/globe rules. */
.lobby-environment-near .lobby-globe {
    display: none;
}

.lobby-environment-near .lobby-operator {
    bottom: 3.5%;
    width: clamp(190px, 18vw, 270px);
    height: 38%;
    transform: translateX(-50%) translateZ(190px);
    animation: lobby-operator-breathe 4.2s ease-in-out infinite;
}

.lobby-environment-near .lobby-operator-head {
    top: 0;
    left: 50%;
    width: 24%;
    aspect-ratio: auto;
    height: 19%;
    border-radius: 46% 46% 52% 52%;
    transform: translateX(-50%);
}

.lobby-environment-near .lobby-operator-body {
    top: 24%;
    left: 50%;
    width: 54%;
    height: 48%;
    border-radius: 35% 35% 12% 12%;
    clip-path: polygon(18% 0, 82% 0, 100% 24%, 90% 100%, 10% 100%, 0 24%);
    transform: translateX(-50%);
}

.lobby-environment-near .lobby-operator-shoulder {
    top: 27%;
    left: 50%;
    width: 82%;
    height: 18%;
    transform: translateX(-50%);
}

@media (max-width: 760px) {
    .lobby-environment-near .lobby-operator {
        bottom: 9%;
        width: clamp(150px, 38vw, 210px);
        height: 34%;
    }
}

/* Reference composition: centered title, floating mission controls, full-width telemetry rail. */
/* Reference-exact command-centre composition */
.dashboard-header {
    position: absolute;
    z-index: 30;
    top: 0;
    left: 0;
    right: 0;
    height: 108px;
    padding: 27px 28px 0 34px;
    background: linear-gradient(180deg, rgba(5, 15, 32, .32), transparent);
}

.dashboard-header-brand {
    align-items: flex-start;
}

.dashboard-sidebar-toggle {
    display: none;
}

.dashboard-game-brand {
    gap: 10px;
    margin-top: 0;
    color: #b9d2e5;
    font-size: 12px;
    letter-spacing: .18em;
    line-height: 1.15;
}

.dashboard-brand-icon {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 1px solid rgba(76, 221, 255, .75);
    border-radius: 50%;
    color: #63e1ff;
    font-size: 15px;
}

.dashboard-game-brand strong {
    display: block;
    margin-top: 2px;
    color: #6e90aa;
    font-size: 8px;
    letter-spacing: .28em;
}

.dashboard-profile-trigger {
    min-width: 320px;
    height: 58px;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.dashboard-profile-trigger-copy {
    align-items: flex-end;
    margin-left: auto;
    text-align: right;
}

.dashboard-profile-trigger-copy strong {
    color: #eef8ff;
    font-size: 14px;
}

.dashboard-profile-trigger-copy small {
    color: #87a5c1;
    font-size: 10px;
}

.dashboard-profile-menu {
    margin-left: auto;
}

.dashboard-profile-trigger .dashboard-avatar {
    order: 2;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(174, 246, 255, .62);
    background: #7ae7ff;
    color: #08243a;
    font-weight: 800;
}

.dashboard-profile-chevron {
    order: 3;
}

.dashboard-sidebar {
    top: 278px;
    left: 18px;
    width: 168px;
    background: rgba(3, 12, 28, .78);
}

/* Command-centre-only chrome must not cover the routed detail pages. */
body[data-active-screen]:not([data-active-screen="dashboard"]) #dashboard-sidebar,
body[data-active-screen]:not([data-active-screen="dashboard"]) .dashboard-game-brand {
    display: none !important;
}

.dashboard-return-command {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin-top: .75rem;
    padding: .7rem 1rem;
    border: 1px solid rgba(56, 217, 255, .4);
    border-radius: 4px;
    background: rgba(7, 28, 47, .86);
    color: #8feaff;
    font-family: 'Orbitron', sans-serif;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .08em;
    cursor: pointer;
}

.dashboard-return-command:hover,
.dashboard-return-command:focus-visible {
    border-color: #56ddff;
    background: rgba(16, 75, 101, .72);
    color: #e2fbff;
}

.dashboard-nav {
    gap: 8px;
}

.dashboard-nav-item {
    min-height: 34px;
    padding: 7px 12px;
    border: 0;
    border-radius: 0;
    background: rgba(4, 15, 32, .12);
    color: #95abc2;
    font-size: 12px;
    letter-spacing: .13em;
}

.dashboard-nav-item.active {
    border-left: 2px solid #50dcff;
    background: linear-gradient(90deg, rgba(20, 99, 145, .5), rgba(9, 31, 55, .08));
    color: #d6edff;
}

.dashboard-nav-item[data-dashboard-route="achievements"] {
    order: 3;
}

.dashboard-nav-item[data-dashboard-route="levels"] {
    order: 4;
}

.dashboard-nav-item[data-dashboard-route="settings"] {
    order: 5;
}

.dashboard-nav-icon {
    width: 22px;
    color: #75a8c5;
    font-size: 14px;
}

.dashboard-content.dashboard-lobby {
    height: 768px;
    min-height: 768px;
    background:
        linear-gradient(90deg, rgba(3, 12, 27, .42), transparent 22%, transparent 78%, rgba(2, 9, 21, .38)),
        linear-gradient(180deg, #08182e 0%, #0c2a48 58%, #071120 100%);
}

.dashboard-content.dashboard-lobby::before {
    z-index: 3;
    opacity: .11;
    background-size: 45px 45px;
}

.dashboard-content.dashboard-lobby::after {
    z-index: 5;
    background:
        linear-gradient(180deg, rgba(2, 8, 19, .08), transparent 30%, transparent 72%, rgba(2, 8, 18, .82)),
        linear-gradient(90deg, rgba(2, 8, 18, .28), transparent 20%, transparent 82%, rgba(2, 8, 18, .24));
}

.lobby-stage {
    z-index: 2;
    background:
        radial-gradient(ellipse at 50% 53%, rgba(29, 150, 195, .24), transparent 45%),
        linear-gradient(180deg, rgba(18, 48, 82, .9) 0%, rgba(7, 27, 49, .98) 65%, #08111f 100%);
}

.lobby-welcome {
    z-index: 15;
    top: 104px;
    left: 50%;
    width: 520px;
    transform: translateX(-50%);
    text-align: center;
}

.lobby-welcome .dashboard-eyebrow {
    display: none;
}

.lobby-welcome h1 {
    gap: 0;
    margin: 0;
    color: #f0fbff;
    font-family: 'Russo One', sans-serif;
    font-size: 68px;
    font-weight: 700;
    line-height: .98;
    letter-spacing: .05em;
    text-shadow: 0 4px 22px rgba(3, 21, 38, .7);
}

.lobby-welcome h1 span:last-child {
    color: #63dfff;
}

.lobby-hero-tagline {
    margin: 24px 0 0;
    color: #68a9c7;
    font-size: 16px;
    letter-spacing: .24em;
}

.lobby-welcome > p:last-child {
    margin: 8px 0 0;
    color: #bacddd;
    font-size: 17px;
}

.lobby-actions {
    z-index: 20;
    top: 360px;
    bottom: auto;
    width: 520px;
    height: 46px;
    gap: 12px;
}

.lobby-action-button {
    height: 46px;
    min-height: 46px;
    border-radius: 4px;
    font-size: 14px;
    letter-spacing: .09em;
}

.lobby-action-button.dashboard-primary-button {
    background: linear-gradient(120deg, #8deafa, #5fcfe8);
    color: #08212d;
    box-shadow: 0 8px 24px rgba(70, 206, 238, .16);
}

.lobby-action-button.dashboard-secondary-button {
    border: 1px solid rgba(88, 206, 242, .55);
    background: rgba(8, 39, 66, .72);
    color: #e3f7ff;
}

.lobby-hud {
    z-index: 25;
    right: 28px;
    bottom: 20px;
    left: 28px;
    width: auto;
    height: 52px;
    align-items: end;
    justify-content: space-between;
}

.lobby-hud-item {
    position: relative;
    width: 430px;
}

.lobby-hud-xp {
    margin-left: auto;
    text-align: right;
}

.lobby-hud-heading {
    display: flex;
    justify-content: space-between;
}

.lobby-hud-xp .lobby-hud-heading {
    justify-content: flex-end;
    gap: 12px;
}

.lobby-hud-label {
    color: #789aae;
    font-size: 11px;
}

.lobby-hud-item strong {
    color: #70b6d2;
    font-size: 10px;
}

.lobby-hud-detail {
    display: none;
}

.lobby-hud-track {
    width: 100%;
    height: 6px;
    margin-top: 8px;
    border: 1px solid rgba(77, 167, 207, .32);
    background: rgba(18, 74, 108, .32);
}

.ref-ceiling {
    position: absolute;
    z-index: 1;
    top: -68px;
    left: 0;
    right: 0;
    height: 220px;
    transform: perspective(500px) rotateX(-58deg);
    transform-origin: bottom;
    background:
        repeating-linear-gradient(90deg, transparent 0 98px, rgba(92, 186, 222, .13) 99px 102px),
        repeating-linear-gradient(0deg, transparent 0 56px, rgba(92, 186, 222, .1) 57px 60px);
}

.ref-ceiling i {
    position: absolute;
    top: 45px;
    width: 180px;
    height: 4px;
    background: #7fdcff;
    box-shadow: 0 0 16px #37bfe9;
    transform: skewX(-18deg);
}

.ref-ceiling i:nth-child(1) { left: 20%; }.ref-ceiling i:nth-child(2) { left: 48%; }.ref-ceiling i:nth-child(3) { right: 11%; }.ref-ceiling i:nth-child(4) { left: 5%; }

.ref-wall {
    position: absolute;
    z-index: 1;
    inset: 105px 0 170px;
}

.ref-wall i {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 19%;
    border: 1px solid rgba(66, 143, 180, .13);
    background: linear-gradient(90deg, rgba(3, 16, 31, .28), rgba(24, 65, 94, .2));
}

.ref-wall i:nth-child(1) { left: -6%; }.ref-wall i:nth-child(2) { left: 16%; }.ref-wall i:nth-child(3) { left: 40.5%; width: 19%; }.ref-wall i:nth-child(4) { right: 16%; }.ref-wall i:nth-child(5) { right: -6%; }

.ref-rack {
    position: absolute;
    z-index: 3;
    top: 315px;
    bottom: 142px;
    width: 150px;
    border: 1px solid rgba(70, 155, 193, .22);
    background: linear-gradient(90deg, rgba(3, 15, 31, .95), rgba(12, 43, 67, .72));
}

.ref-rack-left { left: 224px; }.ref-rack-right { right: 224px; }

.ref-rack b {
    position: absolute;
    left: 14px;
    right: 14px;
    height: 18px;
    border-top: 1px solid rgba(92, 196, 229, .16);
    background: repeating-linear-gradient(90deg, rgba(105, 210, 238, .22) 0 3px, transparent 3px 8px);
}

.ref-rack b:nth-child(1) { top: 42px; }.ref-rack b:nth-child(2) { top: 75px; }.ref-rack b:nth-child(3) { top: 108px; }.ref-rack b:nth-child(4) { top: 141px; }.ref-rack b:nth-child(5) { top: 174px; }.ref-rack b:nth-child(6) { top: 207px; }

.ref-workstation {
    position: absolute;
    z-index: 7;
    left: 50%;
    bottom: 142px;
    width: 630px;
    height: 235px;
    transform: translateX(-50%);
}

.ref-monitor {
    position: absolute;
    bottom: 85px;
    width: 174px;
    height: 128px;
    border: 2px solid rgba(87, 176, 209, .62);
    border-bottom-width: 8px;
    background: linear-gradient(145deg, #081927, #06101d);
    box-shadow: 0 0 18px rgba(40, 173, 215, .12);
    overflow: hidden;
}

.ref-monitor-left { left: 28px; transform: perspective(500px) rotateY(8deg); }.ref-monitor-centre { left: 228px; bottom: 102px; width: 174px; height: 140px; z-index: 3; }.ref-monitor-right { right: 28px; transform: perspective(500px) rotateY(-8deg); }

.ref-monitor-title {
    position: absolute;
    z-index: 4;
    top: 8px;
    left: 9px;
    color: #65b4cc;
    font-size: 6px;
    letter-spacing: .08em;
}

.ref-bars {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 28px;
    height: 42px;
    background: repeating-linear-gradient(0deg, transparent 0 12px, rgba(82, 205, 238, .24) 13px 14px);
    border-left: 1px solid rgba(82, 205, 238, .38);
}

.ref-bars::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    height: 22px;
    clip-path: polygon(0 70%, 12% 55%, 24% 72%, 38% 28%, 54% 64%, 70% 35%, 82% 48%, 100% 12%, 100% 100%, 0 100%);
    background: #3db4dc;
}

.ref-map {
    position: absolute;
    left: 38px;
    top: 30px;
    width: 92px;
    height: 68px;
    border: 1px solid rgba(82, 211, 244, .32);
    background:
        radial-gradient(circle at 50% 50%, rgba(74, 210, 240, .3) 0 3px, transparent 4px),
        radial-gradient(circle at 50% 50%, transparent 0 30px, rgba(75, 211, 242, .42) 31px 32px, transparent 33px),
        linear-gradient(rgba(77, 196, 226, .12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(77, 196, 226, .12) 1px, transparent 1px);
    background-size: auto, auto, 12px 12px, 12px 12px;
}

.ref-readout {
    position: absolute;
    left: 16px;
    right: 16px;
    bottom: 14px;
    height: 3px;
    background: linear-gradient(90deg, #55d8ef 30%, transparent 30% 34%, #55d8ef 34% 67%, transparent 67%);
}

.ref-log,
.ref-terminal {
    position: absolute;
    left: 14px;
    right: 14px;
    height: 38px;
}

.ref-log {
    top: 28px;
    background: repeating-linear-gradient(180deg, rgba(114, 215, 239, .72) 0 2px, transparent 2px 9px);
}

.ref-terminal {
    bottom: 18px;
    height: 22px;
    border-left: 2px solid #75dff1;
}

.ref-desk {
    position: absolute;
    z-index: 8;
    left: 0;
    right: 0;
    bottom: 30px;
    height: 78px;
    border: 1px solid rgba(76, 173, 207, .36);
    clip-path: polygon(8% 0, 92% 0, 100% 100%, 0 100%);
    background: linear-gradient(180deg, rgba(11, 55, 78, .92), rgba(3, 17, 31, .96));
    box-shadow: 0 -12px 24px rgba(50, 187, 220, .08);
}

.ref-console {
    position: absolute;
    z-index: 9;
    left: 110px;
    right: 110px;
    bottom: 54px;
    height: 22px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border: 1px solid rgba(71, 180, 213, .28);
    background: #061622;
}

.ref-console i {
    width: 24px;
    height: 3px;
    background: #70b3c9;
}

.ref-operator {
    position: absolute;
    z-index: 12;
    left: 50%;
    bottom: 74px;
    width: 190px;
    height: 248px;
    transform: translateX(-50%);
}

.ref-head,
.ref-neck,
.ref-torso,
.ref-shoulders,
.ref-arm,
.ref-chair-back,
.ref-chair-seat {
    position: absolute;
    display: block;
}

.ref-head {
    z-index: 6;
    top: 0;
    left: 76px;
    width: 38px;
    height: 46px;
    border: 1px solid rgba(99, 195, 223, .28);
    border-radius: 48%;
    background: linear-gradient(145deg, #15384b, #02070d 70%);
}

.ref-neck {
    z-index: 5;
    top: 38px;
    left: 82px;
    width: 26px;
    height: 22px;
    background: #07131e;
}

.ref-torso {
    z-index: 4;
    top: 52px;
    left: 48px;
    width: 94px;
    height: 118px;
    border: 1px solid rgba(91, 182, 213, .32);
    border-radius: 42% 42% 8% 8%;
    background: linear-gradient(90deg, #07121d, #102738 48%, #061019);
    clip-path: polygon(20% 0, 80% 0, 100% 28%, 86% 100%, 14% 100%, 0 28%);
}

.ref-shoulders {
    z-index: 6;
    top: 58px;
    left: 25px;
    width: 140px;
    height: 30px;
    border-top: 2px solid rgba(75, 176, 208, .28);
    border-radius: 50%;
}

.ref-arm {
    z-index: 7;
    top: 82px;
    width: 24px;
    height: 82px;
    border: 1px solid rgba(70, 165, 198, .26);
    border-radius: 999px;
    background: linear-gradient(90deg, #091722, #102938);
}

.ref-arm-left { left: 29px; transform: rotate(-18deg); }.ref-arm-right { right: 29px; transform: rotate(18deg); }

.ref-chair-back {
    z-index: 3;
    left: 20px;
    bottom: 0;
    width: 150px;
    height: 150px;
    border: 2px solid rgba(76, 169, 201, .32);
    border-radius: 44% 44% 8% 8%;
    background: linear-gradient(145deg, #0b2030, #02070d 76%);
}

.ref-chair-seat {
    z-index: 2;
    left: 8px;
    bottom: -26px;
    width: 174px;
    height: 54px;
    border-radius: 50%;
    background: #02070d;
    box-shadow: 0 12px 18px rgba(0, 0, 0, .75);
}

.ref-floor {
    position: absolute;
    z-index: 6;
    left: 0;
    right: 0;
    bottom: -95px;
    height: 330px;
    transform: perspective(470px) rotateX(58deg);
    transform-origin: top;
    background:
        linear-gradient(90deg, transparent 49.7%, rgba(62, 177, 215, .22) 50%, transparent 50.3%),
        repeating-linear-gradient(90deg, transparent 0 74px, rgba(65, 180, 217, .16) 75px 76px),
        repeating-linear-gradient(0deg, transparent 0 42px, rgba(65, 180, 217, .18) 43px 44px);
    mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .7) 55%, transparent 100%);
}

.lobby-hero-tagline,
.lobby-supporting-copy {
    position: relative;
}

@media (max-width: 760px) {
.dashboard-sidebar {
    top: 30%;
    left: clamp(1rem, 2vw, 2rem);
    width: 205px;
}

.dashboard-nav-item {
    min-height: 42px;
    padding: .55rem .65rem;
    border-left: 1px solid rgba(122, 196, 220, .25);
    border-radius: 0 4px 4px 0;
    background: linear-gradient(90deg, rgba(4, 19, 37, .3), transparent);
    font-size: .62rem;
    letter-spacing: .12em;
}

.dashboard-nav-item:hover,
.dashboard-nav-item.active {
    border-left: 2px solid #62efff;
    background: linear-gradient(90deg, rgba(30, 177, 217, .22), transparent);
    box-shadow: 0 0 22px rgba(39, 199, 232, .12), inset 10px 0 20px rgba(32, 187, 223, .06);
}

.dashboard-content.dashboard-lobby::after {
    background:
        linear-gradient(180deg, rgba(2, 8, 19, .4), transparent 25%, rgba(2, 8, 19, .08) 63%, rgba(2, 8, 19, .82)),
        linear-gradient(90deg, rgba(2, 8, 19, .48), transparent 25%, transparent 76%, rgba(2, 8, 19, .38));
}

.lobby-welcome {
    top: clamp(5.25rem, 10vh, 6.75rem);
    left: 0;
    right: 0;
    width: min(58vw, 760px);
    margin-inline: auto;
    text-align: center;
}

.lobby-welcome .dashboard-eyebrow { margin-bottom: .3rem; }

.lobby-welcome h1 {
    display: grid;
    gap: .02em;
    color: #f0fcff;
    font-size: clamp(2.4rem, 6.15vw, 5rem);
    line-height: .98;
    letter-spacing: .1em;
    white-space: normal;
    text-shadow: 0 5px 24px rgba(37, 196, 229, .2);
}

.lobby-welcome h1 span { display: block; }
.lobby-welcome h1 span:first-child { color: #f1fbff; }
.lobby-welcome h1 span:last-child {
    color: #4fdcff;
    text-shadow: 0 0 30px rgba(37, 206, 255, .46);
}

.lobby-hero-tagline {
    margin-top: .8rem;
    font-size: clamp(.65rem, 1.08vw, .92rem);
    letter-spacing: .24em;
}

.lobby-welcome > p:last-child {
    margin-top: .48rem;
    color: #d2e4ee;
    font-size: clamp(.72rem, .98vw, .9rem);
}

.lobby-actions {
    top: 40.5%;
    bottom: auto;
    width: min(48vw, 540px);
    gap: .8rem;
}

.lobby-action-button {
    min-height: 48px;
    border-radius: 2px 12px 2px 12px;
    font-size: .66rem;
    letter-spacing: .2em;
    backdrop-filter: blur(8px);
}

.lobby-actions .dashboard-secondary-button {
    border: 1px solid rgba(67, 221, 255, .8);
    background: rgba(4, 35, 55, .75);
    box-shadow: inset 0 0 18px rgba(32, 198, 232, .08), 0 0 18px rgba(31, 190, 229, .12);
}

.lobby-actions .dashboard-primary-button {
    background: linear-gradient(105deg, #8df6ff, #23c5e9);
    color: #052238;
    box-shadow: 0 0 24px rgba(45, 212, 244, .28), inset 0 1px rgba(255, 255, 255, .7);
}

.lobby-hud {
    right: 2.2%;
    bottom: .9rem;
    left: 2.2%;
    display: grid;
    grid-template-columns: 1.03fr 1fr;
    align-items: end;
    gap: clamp(1rem, 3.5vw, 3.5rem);
    width: auto;
    padding: .55rem 0 .1rem;
    border-top: 1px solid rgba(91, 208, 235, .3);
    background: linear-gradient(180deg, rgba(3, 16, 31, .2), rgba(3, 16, 31, .58));
    font-family: 'Rajdhani', monospace;
}

.lobby-hud-item { display: grid; gap: .28rem; }
.lobby-hud-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .7rem; }
.lobby-hud-label { color: #8daab9; font-size: .62rem; letter-spacing: .2em; }
.lobby-hud-heading strong { color: #e7faff; font-size: .78rem; font-weight: 600; letter-spacing: .09em; white-space: nowrap; }
.lobby-hud-detail { color: #9db8c8; font-size: .61rem; letter-spacing: .08em; }
.lobby-hud-xp .lobby-hud-detail:first-of-type { color: #82d9eb; text-transform: uppercase; }
.lobby-hud-track { display: block; width: 100%; height: 7px; overflow: hidden; border: 1px solid rgba(65, 179, 214, .32); border-radius: 0; background: repeating-linear-gradient(90deg, rgba(29, 82, 104, .6) 0 14px, rgba(4, 20, 34, .9) 14px 19px); }
.lobby-hud-track span { display: block; height: 100%; background: linear-gradient(90deg, #34c9ec, #a5fbff); box-shadow: 0 0 12px rgba(60, 221, 250, .64); transition: width .45s ease; }
.lobby-hud-xp .lobby-hud-track span { background: linear-gradient(90deg, #26c8e8, #9bf7ff); }
}

@media (max-width: 760px) {
    .dashboard-sidebar { top: 4.6rem; left: .75rem; width: min(250px, calc(100vw - 1.5rem)); }
    .lobby-welcome { top: 6.2rem; width: calc(100% - 2rem); }
    .lobby-welcome h1 { font-size: clamp(2.05rem, 9vw, 3rem); letter-spacing: .08em; }
    .lobby-hero-tagline { max-width: 100%; letter-spacing: .13em; }
    .lobby-actions { top: 49%; bottom: auto; width: calc(100% - 2rem); flex-direction: column; gap: .5rem; }
    .lobby-action-button { min-height: 42px; }
    .lobby-hud { right: .8rem; bottom: .55rem; left: .8rem; grid-template-columns: 1fr 1fr; gap: .75rem; padding-top: .45rem; }
    .lobby-hud-label { font-size: .5rem; letter-spacing: .11em; }
    .lobby-hud-heading strong { font-size: .63rem; }
    .lobby-hud-detail { font-size: .5rem; letter-spacing: .02em; }
    .lobby-hud-track { height: 6px; }
}

@media (max-width: 390px) {
    .lobby-hud { gap: .45rem; }
    .lobby-hud-label { font-size: .46rem; }
    .lobby-hud-detail { font-size: .46rem; }
}

@media (min-width: 761px) and (max-width: 1100px) and (max-height: 680px) {
    .lobby-welcome { top: 3.8rem; }
    .lobby-welcome h1 { font-size: clamp(2rem, 5vw, 3rem); }
    .lobby-actions { top: 43%; }
    .lobby-hud { bottom: .45rem; }
}

@media (min-width: 761px) {
    .dashboard-layout,
    .dashboard-main {
        display: block;
        width: 100%;
        height: 768px;
        margin: 0;
        padding: 0;
    }

    .lobby-welcome {
        position: fixed !important;
        top: 104px !important;
        right: auto !important;
        left: 424px !important;
        margin: 0 !important;
        width: 520px !important;
        transform: none !important;
        text-align: center;
    }

    .lobby-welcome h1 {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .lobby-welcome h1 span {
        display: block;
        width: 100%;
    }

    .lobby-actions {
        position: fixed;
        top: 360px !important;
        right: auto !important;
        left: 50% !important;
        margin-left: -260px !important;
        bottom: auto !important;
        width: 520px;
        transform: none;
    }

    .lobby-hud {
        right: 28px !important;
        bottom: 20px !important;
        left: 28px !important;
    }
}

/* Helpdesk Escape Room lobby refinements */
.dashboard-game-brand {
    align-items: center;
    gap: .65rem;
    color: #e8f8ff;
    font-size: clamp(.65rem, .9vw, .82rem);
    font-weight: 800;
    letter-spacing: .12em;
}

.dashboard-game-brand > .dashboard-brand-icon:not(svg) { display: none; }
.dashboard-game-brand .dashboard-game-logo {
    display: block;
    flex: 0 0 auto;
    width: clamp(30px, 3vw, 42px);
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: #54ddff;
    filter: drop-shadow(0 0 9px rgba(56, 217, 255, .45));
}

.dashboard-game-brand strong {
    margin-top: .18rem;
    color: #79cde4;
    font-size: .72em;
    letter-spacing: .2em;
}

.dashboard-sidebar {
    width: clamp(205px, 18vw, 240px);
}

.dashboard-nav-item {
    grid-template-columns: 1.35rem minmax(0, 1fr);
    min-width: 0;
    min-height: 40px;
    padding: .5rem .55rem;
    font-size: clamp(.56rem, .72vw, .68rem);
    letter-spacing: .075em;
}

.dashboard-nav-label {
    overflow: visible;
    text-overflow: clip;
}

.lobby-command-label {
    margin: 0 0 .55rem;
    color: #67dfff;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(.58rem, .85vw, .78rem);
    font-weight: 700;
    letter-spacing: .3em;
}

.lobby-welcome #lobby-greeting { display: none; }

.lobby-welcome {
    position: fixed !important;
    top: clamp(84px, 12vh, 112px) !important;
    right: 1rem !important;
    left: 50% !important;
    width: min(56vw, 690px) !important;
    max-width: calc(100vw - 250px);
    margin: 0 !important;
    transform: translateX(-50%) !important;
    text-align: center;
}

.lobby-welcome h1 {
    display: grid;
    justify-items: center;
    gap: 0;
    color: #f1fbff;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2rem, 4.3vw, 4rem);
    font-weight: 800;
    line-height: .98;
    letter-spacing: .08em;
    text-shadow: 0 4px 25px rgba(3, 21, 38, .75), 0 0 26px rgba(56, 217, 255, .18);
}

.lobby-welcome h1 span,
.lobby-welcome h1 span:first-child,
.lobby-welcome h1 span:last-child {
    width: 100%;
    color: #f1fbff;
}

.lobby-welcome h1 span:last-child { color: #58dcff; }

.lobby-hero-tagline {
    margin: clamp(.6rem, 1.1vh, .9rem) 0 0;
    color: #b3e8f4;
    font-size: clamp(.68rem, 1.05vw, .9rem);
    font-weight: 700;
    letter-spacing: .2em;
}

.lobby-supporting-copy {
    max-width: 46rem;
    margin: .4rem auto 0;
    color: #a9bfce;
    font-size: clamp(.68rem, .9vw, .82rem);
    letter-spacing: .035em;
    line-height: 1.35;
    text-align: center;
}

.lobby-actions {
    position: fixed !important;
    top: auto !important;
    right: clamp(1rem, 3vw, 2.5rem) !important;
    bottom: clamp(94px, 12vh, 112px) !important;
    left: auto !important;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    width: clamp(190px, 19vw, 232px);
    height: auto;
    margin: 0 !important;
    transform: none !important;
}

.lobby-action-button {
    width: 100%;
    min-height: 46px;
    padding: .65rem .8rem;
    font-size: clamp(.58rem, .72vw, .7rem);
    letter-spacing: .1em;
    backdrop-filter: blur(8px);
}

.ref-monitor-aux {
    bottom: 165px;
    width: 112px;
    height: 76px;
    border-width: 1px;
    border-bottom-width: 4px;
    opacity: .92;
}

.ref-monitor-aux-left { left: 108px; }
.ref-monitor-aux-right { right: 108px; }

.ref-monitor-aux::after {
    position: absolute;
    z-index: 2;
    top: 24px;
    left: 0;
    width: 100%;
    height: 1px;
    content: "";
    background: rgba(147, 246, 255, .72);
    box-shadow: 0 0 8px rgba(86, 223, 255, .8);
    animation: helpdesk-monitor-sweep 3.8s ease-in-out infinite alternate;
}

.ref-ticket-queue {
    position: absolute;
    top: 26px;
    right: 9px;
    left: 9px;
    height: 34px;
    background: repeating-linear-gradient(180deg, rgba(102, 220, 242, .68) 0 2px, transparent 2px 8px);
    animation: helpdesk-data-flicker 4s ease-in-out infinite;
}

.ref-alert-pulse {
    position: absolute;
    top: 32px;
    left: 50%;
    width: 25px;
    height: 25px;
    border: 1px solid rgba(103, 228, 255, .8);
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 0 8px rgba(46, 193, 231, .08), 0 0 16px rgba(46, 193, 231, .34);
    animation: helpdesk-alert-pulse 2.8s ease-out infinite;
}

.ref-head {
    border-color: rgba(125, 192, 214, .45);
    background:
        radial-gradient(ellipse at 32% 37%, rgba(116, 174, 196, .34), transparent 28%),
        linear-gradient(100deg, #07121c 4%, #19384a 46%, #0b1c29 78%, #03090f);
    box-shadow: inset -5px 0 8px rgba(0, 0, 0, .5), 0 0 14px rgba(24, 108, 138, .15);
}

.ref-head::before {
    position: absolute;
    top: -2px;
    left: 2px;
    width: 34px;
    height: 17px;
    border-radius: 55% 55% 20% 20%;
    content: "";
    background: linear-gradient(110deg, #02070d, #172937 55%, #07111a);
}

.ref-torso {
    background:
        linear-gradient(90deg, transparent 47%, rgba(106, 187, 213, .19) 49%, transparent 52%),
        radial-gradient(ellipse at 50% 2%, rgba(71, 137, 163, .38), transparent 48%),
        linear-gradient(90deg, #050c13, #152c3a 36%, #0b1d29 68%, #03090f);
    box-shadow: inset 0 14px 12px rgba(91, 177, 205, .07), 0 0 18px rgba(9, 47, 65, .26);
}

.ref-shoulders {
    height: 37px;
    border-top: 3px solid rgba(87, 167, 196, .38);
    background: radial-gradient(ellipse at 50% 0, rgba(76, 139, 163, .2), transparent 70%);
}

.ref-arm {
    background: linear-gradient(90deg, #050d14, #17303d 48%, #091722);
    box-shadow: inset 0 3px 7px rgba(101, 175, 197, .12), 0 0 8px rgba(0, 0, 0, .35);
}

.ref-operator { animation: helpdesk-operator-breathe 5.5s ease-in-out infinite; }

@keyframes helpdesk-monitor-sweep {
    from { transform: translateY(0); opacity: .35; }
    to { transform: translateY(34px); opacity: .9; }
}

@keyframes helpdesk-data-flicker {
    0%, 100% { opacity: .58; }
    48% { opacity: 1; }
    53% { opacity: .72; }
}

@keyframes helpdesk-alert-pulse {
    0% { opacity: .9; box-shadow: 0 0 0 2px rgba(46, 193, 231, .22); }
    100% { opacity: .35; box-shadow: 0 0 0 15px rgba(46, 193, 231, 0); }
}

@keyframes helpdesk-operator-breathe {
    0%, 100% { translate: 0 0; }
    50% { translate: 0 -2px; }
}

@media (max-width: 760px) {
    .dashboard-sidebar {
        width: min(280px, 84vw);
        padding: 1.1rem .9rem;
    }

    .dashboard-nav-item {
        grid-template-columns: 1.5rem minmax(0, 1fr);
        justify-items: stretch;
        min-height: 46px;
        padding: .55rem .65rem;
        font-size: .7rem;
        letter-spacing: .1em;
        text-align: left;
    }

    .lobby-welcome {
        top: clamp(84px, 12vh, 108px) !important;
        right: 1rem !important;
        left: 50% !important;
        width: calc(100% - 2rem) !important;
        max-width: 560px;
    }

    .lobby-welcome h1 { font-size: clamp(1.8rem, 7vw, 3rem); }
    .lobby-hero-tagline { letter-spacing: .12em; }
    .lobby-actions {
        right: .8rem !important;
        bottom: 6.4rem !important;
        width: min(205px, calc(100vw - 1.6rem));
    }

    .lobby-action-button { min-height: 42px; font-size: .58rem; }
    .ref-workstation { transform: translateX(-50%) scale(.78); transform-origin: center bottom; }
    .ref-operator { transform: translateX(-50%) scale(.86); transform-origin: center bottom; }
}

@media (max-width: 430px) {
    .lobby-welcome { top: 80px !important; }
    .lobby-welcome h1 { font-size: clamp(1.5rem, 7.5vw, 2rem); }
    .lobby-command-label { font-size: .54rem; }
    .lobby-supporting-copy { max-width: 28rem; margin-inline: auto; font-size: .64rem; }
    .ref-workstation { transform: translateX(-50%) scale(.61); }
    .ref-operator { transform: translateX(-50%) scale(.72); }
    .ref-monitor-aux { display: none; }
    .lobby-actions { right: .65rem !important; bottom: 6.25rem !important; width: 182px; }
}

@media (prefers-reduced-motion: reduce) {
    .ref-operator,
    .ref-monitor-aux::after,
    .ref-ticket-queue,
    .ref-alert-pulse { animation: none; }
}

/* Keep every player route on one viewport frame; route content scrolls within it. */
.dashboard-layout {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

.dashboard-main {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
}

body[data-active-screen="dashboard"] .dashboard-main {
    overflow: hidden;
}

body[data-active-screen="dashboard"] .dashboard-route-screen {
    animation-name: dashboard-route-fade;
}

@keyframes dashboard-route-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

.dashboard-content.dashboard-lobby {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
}

.dashboard-route-screen:not(#dashboard-screen) {
    width: 100%;
    max-width: 1440px;
    min-height: 100dvh;
    margin: 0 auto;
    padding: clamp(5.75rem, 10vh, 7rem) clamp(1rem, 3vw, 2.5rem) 2rem;
}

/* Compact access and account pages to fit common desktop viewports. */
.portal-shell {
    width: min(100%, 820px);
    padding: clamp(.75rem, 2vh, 1.35rem) clamp(1rem, 2.5vw, 2rem);
}

.portal-screen .intro-header,
.portal-screen .intro-footer {
    gap: .5rem 1.25rem;
    font-size: clamp(.55rem, .68vw, .68rem);
    line-height: 1.35;
}

.portal-card {
    width: min(100%, 500px);
    padding: clamp(1rem, 2vw, 1.5rem);
}

.portal-heading { margin-bottom: .85rem; }

.portal-heading .intro-eyebrow { margin-bottom: .4rem; }

.portal-title {
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    line-height: 1.15;
}

.portal-description { margin-top: .35rem; }

.portal-form { gap: .45rem; }

.portal-field { gap: .25rem; }

.portal-field input {
    min-height: 42px;
    padding: .5rem .7rem;
}

.portal-toggle-button {
    min-height: 42px;
    min-width: 58px;
}

.portal-check-row { min-height: 34px; }

.portal-submit-btn {
    min-height: 46px;
    margin-top: .1rem;
}

.portal-links { margin-top: .35rem; }

.portal-link-button { min-height: 36px; }

.portal-guest-button {
    min-height: 46px;
    margin-top: .4rem;
}

.portal-note {
    margin-top: .45rem;
    line-height: 1.35;
}

.portal-card .intro-emblem {
    width: 2.75rem;
    height: 2.75rem;
    margin-bottom: .55rem;
    border-radius: 12px;
    font-size: 1.5rem;
}

@media (max-width: 600px) {
    .portal-shell {
        padding: .8rem clamp(.8rem, 4vw, 1.25rem);
    }

    .portal-card { padding: 1rem; }

    .portal-screen .intro-header,
    .portal-screen .intro-footer { font-size: .56rem; }

    .portal-title { font-size: clamp(1.3rem, 6vw, 1.8rem); }
}

/* Fit the level roadmap and its side panels on common desktop-height screens. */
@media (min-width: 761px) and (max-height: 920px) {
    .game-container:has(#welcome-screen[style*="display: block"]) {
        padding: 14px clamp(16px, 1.6vw, 24px);
    }

    #welcome-screen {
        padding: 10px 0 4px;
    }

    #welcome-screen .hero-icon {
        width: 58px;
        height: 58px;
        margin-bottom: 12px;
    }

    #welcome-screen h1 {
        margin: .3rem 0;
        font-size: clamp(1.55rem, 2.5vw, 2.1rem);
    }

    #welcome-screen .hero-description {
        margin: .55rem auto .75rem;
        font-size: .9rem;
        line-height: 1.35;
    }

    #welcome-screen .mission-stats {
        margin: .7rem 0;
        padding: .55rem 5px;
    }

    #welcome-screen .difficulty-section { margin: .6rem 0; }

    #welcome-screen .difficulty-options { gap: .5rem; }

    #welcome-screen .difficulty-btn {
        min-height: 42px;
        padding: .45rem .55rem;
    }

    #welcome-screen .bottom-note { margin-top: .55rem; }

    .game-container:has(#level-screen[style*="display: block"]) {
        padding: 14px clamp(16px, 1.6vw, 24px);
    }

    .game-container:has(#level-screen[style*="display: block"]) .console-top {
        padding-bottom: 6px;
    }

    .game-container:has(#level-screen[style*="display: block"]) .console-bottom {
        margin-top: 6px;
        padding-top: 6px;
    }

    #level-screen {
        padding: 12px 0 4px;
    }

    #level-screen .hero-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 12px;
        border-radius: 14px;
        font-size: 1.6rem;
    }

    #level-screen .eyebrow { margin-bottom: 7px; }

    #level-screen .roadmap-title {
        margin: .25rem 0 .4rem;
        font-size: clamp(1.2rem, 2.15vw, 1.65rem);
        line-height: 1.2;
    }

    #level-screen .roadmap-description {
        margin: 0 auto .55rem;
        font-size: clamp(.8rem, .95vw, .92rem);
        line-height: 1.35;
    }

    #level-screen .roadmap-stats {
        padding: .48rem .7rem;
        font-size: .66rem;
    }

    #level-screen .level-selection-section {
        margin: .65rem auto;
    }

    #level-screen .level-roadmap { margin-top: .4rem; }

    #level-screen .level-chip {
        min-height: 56px;
        gap: .15rem;
        padding: .3rem .15rem;
        font-size: .68rem;
    }

    #level-screen .level-chip small { font-size: .6rem; }

    #level-screen .secondary-btn {
        min-height: 46px;
        margin-top: .35rem;
        font-size: .62rem;
    }
}

/* One desktop viewport frame for the game entry, roadmap, gameplay and results. */
@media (min-width: 761px) {
    body[data-active-screen="game-entry"],
    body[data-active-screen="roadmap"],
    body[data-active-screen="gameplay"],
    body[data-active-screen="results"] {
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        padding: clamp(66px, 8vh, 84px) clamp(12px, 2vw, 30px) clamp(42px, 5vh, 58px);
        overflow: hidden;
        overflow-x: clip;
    }

    body[data-active-screen="game-entry"] .game-layout,
    body[data-active-screen="roadmap"] .game-layout,
    body[data-active-screen="gameplay"] .game-layout,
    body[data-active-screen="results"] .game-layout {
        grid-template-columns: minmax(145px, 1fr) minmax(0, 4fr) minmax(145px, 1fr);
        grid-template-areas: "left game right";
        align-items: stretch;
        gap: clamp(10px, 1.2vw, 20px);
        width: min(100%, 1600px);
        height: 100%;
        min-height: 0;
        margin: 0 auto;
    }

    body[data-active-screen="game-entry"] .game-container,
    body[data-active-screen="roadmap"] .game-container,
    body[data-active-screen="gameplay"] .game-container,
    body[data-active-screen="results"] .game-container {
        width: 100%;
        max-width: 900px;
        max-height: 100%;
        min-height: 0;
        align-self: stretch;
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-gutter: auto;
    }

    body[data-active-screen="game-entry"] .panel-column,
    body[data-active-screen="roadmap"] .panel-column,
    body[data-active-screen="gameplay"] .panel-column,
    body[data-active-screen="results"] .panel-column {
        min-height: 0;
    }

    body[data-active-screen="game-entry"] .hud,
    body[data-active-screen="roadmap"] .hud,
    body[data-active-screen="gameplay"] .hud,
    body[data-active-screen="results"] .hud {
        min-width: 0;
        padding: clamp(.55rem, 1vw, .9rem);
        font-size: clamp(.58rem, .72vw, .7rem);
    }
}

/* Keep the command centre artwork anchored to the current viewport. */
body[data-active-screen="dashboard"] .dashboard-screen,
body.player-app-active .dashboard-screen {
    width: 100%;
    height: 100dvh;
}

@media (min-width: 761px) and (max-width: 900px) {
    body[data-active-screen="game-entry"] .game-layout,
    body[data-active-screen="roadmap"] .game-layout,
    body[data-active-screen="gameplay"] .game-layout,
    body[data-active-screen="results"] .game-layout {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: minmax(0, 1fr) auto;
        grid-template-areas:
            "game game"
            "left right";
        gap: 10px;
    }

    body[data-active-screen="game-entry"] .panel-column,
    body[data-active-screen="roadmap"] .panel-column,
    body[data-active-screen="gameplay"] .panel-column,
    body[data-active-screen="results"] .panel-column {
        flex-direction: row;
        align-items: stretch;
        gap: 10px;
    }

    body[data-active-screen="game-entry"] .panel-column > *,
    body[data-active-screen="roadmap"] .panel-column > *,
    body[data-active-screen="gameplay"] .panel-column > *,
    body[data-active-screen="results"] .panel-column > * {
        flex: 1 1 0;
        min-width: 0;
    }
}

@media (max-width: 760px) {
    html:has(body[data-active-screen="game-entry"]),
    html:has(body[data-active-screen="roadmap"]) {
        overflow: hidden;
    }

    body[data-active-screen="game-entry"],
    body[data-active-screen="roadmap"],
    body[data-active-screen="gameplay"],
    body[data-active-screen="results"] {
        overflow-x: hidden;
    }

    body[data-active-screen="game-entry"] .game-layout,
    body[data-active-screen="roadmap"] .game-layout,
    body[data-active-screen="gameplay"] .game-layout,
    body[data-active-screen="results"] .game-layout {
        width: 100%;
        min-width: 0;
    }

    body[data-active-screen="game-entry"] .game-container,
    body[data-active-screen="roadmap"] .game-container,
    body[data-active-screen="gameplay"] .game-container,
    body[data-active-screen="results"] .game-container {
        min-width: 0;
    }

    body[data-active-screen="game-entry"],
    body[data-active-screen="roadmap"] {
        height: 100vh;
        height: 100dvh;
        min-height: 0;
        padding-bottom: 42px;
        overflow: hidden;
    }

    body[data-active-screen="game-entry"] .game-layout,
    body[data-active-screen="roadmap"] .game-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        grid-template-areas: "game";
        height: 100%;
        min-height: 0;
        margin: 0;
    }

    body[data-active-screen="game-entry"] .panel-column,
    body[data-active-screen="roadmap"] .panel-column {
        display: none;
    }

    body[data-active-screen="game-entry"] .game-container,
    body[data-active-screen="roadmap"] .game-container {
        max-height: 100%;
        padding: 14px clamp(12px, 4vw, 24px);
        overflow-x: hidden;
        overflow-y: auto;
    }

    #welcome-screen,
    #level-screen {
        padding: 12px 0 4px;
    }

    #welcome-screen .hero-icon,
    #level-screen .hero-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 10px;
        border-radius: 14px;
        font-size: 1.45rem;
    }

    #welcome-screen h1,
    #level-screen .roadmap-title {
        margin: .3rem 0;
        font-size: clamp(1.2rem, 5.5vw, 1.7rem);
        line-height: 1.2;
    }

    #welcome-screen .hero-description,
    #level-screen .roadmap-description {
        margin: .5rem auto .65rem;
        font-size: .82rem;
        line-height: 1.35;
    }

    #welcome-screen .mission-stats { margin: .6rem 0; padding: .5rem 4px; }
    #welcome-screen .mission-stats small { font-size: .5rem; }
    #welcome-screen .difficulty-section { margin: .5rem 0; }
    #welcome-screen .difficulty-options { gap: .4rem; }
    #welcome-screen .difficulty-btn { min-height: 40px; padding: .4rem; }
    #welcome-screen .bottom-note { margin-top: .45rem; }
    #level-screen .level-chip { min-height: 48px; }
    #level-screen .level-selection-section { margin: .5rem auto; }
    #level-screen .secondary-btn { min-height: 42px; margin-top: .35rem; }

    .lobby-hud-item {
        width: auto;
        min-width: 0;
    }
}

body[data-active-screen="game-entry"] .game-container::before,
body[data-active-screen="roadmap"] .game-container::before,
body[data-active-screen="gameplay"] .game-container::before,
body[data-active-screen="results"] .game-container::before {
    top: 0;
    left: 0;
}

body[data-active-screen="game-entry"] .game-container::after,
body[data-active-screen="roadmap"] .game-container::after,
body[data-active-screen="gameplay"] .game-container::after,
body[data-active-screen="results"] .game-container::after {
    right: 0;
    bottom: 0;
}

/* Paused mission controls */
html:has(body.mission-pause-open),
body.mission-pause-open {
    overflow: hidden !important;
}

.mission-header {
    flex-wrap: wrap;
}

.mission-pause-btn {
    flex: 0 0 auto;
    min-height: 38px;
    padding: .45rem .75rem;
    border: 1px solid rgba(56, 217, 255, .48);
    border-radius: 5px;
    color: #bfefff;
    background: rgba(8, 31, 51, .9);
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(.62rem, .75vw, .72rem);
    font-weight: 700;
    letter-spacing: .08em;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.mission-pause-btn span {
    margin-right: .3rem;
    color: var(--cyan);
}

.mission-pause-btn:hover,
.mission-pause-btn:focus-visible {
    border-color: var(--cyan);
    background: rgba(13, 59, 83, .96);
    box-shadow: 0 0 16px rgba(56, 217, 255, .18);
}

.mission-pause-overlay {
    position: fixed;
    z-index: 12000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: clamp(12px, 3vw, 28px);
    background: rgba(2, 8, 18, .68);
    -webkit-backdrop-filter: blur(7px) brightness(.55);
    backdrop-filter: blur(7px) brightness(.55);
}

.mission-pause-overlay[hidden],
.mission-pause-confirmation[hidden],
.mission-pause-actions[hidden] {
    display: none !important;
}

.mission-pause-panel {
    width: min(100%, 500px);
    max-height: min(90dvh, 720px);
    overflow-y: auto;
    padding: clamp(1.25rem, 4vw, 2rem);
    border: 1px solid rgba(56, 217, 255, .55);
    border-radius: 12px;
    background:
        linear-gradient(145deg, rgba(12, 31, 53, .99), rgba(5, 13, 28, .99));
    box-shadow:
        0 0 0 1px rgba(56, 217, 255, .08),
        0 24px 80px rgba(0, 0, 0, .58),
        0 0 38px rgba(56, 217, 255, .12);
    text-align: center;
    animation: missionPauseEnter .2s ease-out both;
}

.mission-pause-eyebrow {
    color: var(--cyan);
    font-family: monospace;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .18em;
}

.mission-pause-panel h2 {
    margin: .6rem 0 .45rem;
    color: #e7f3ff;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    letter-spacing: .08em;
}

.mission-pause-panel > p,
.mission-pause-confirmation > p {
    max-width: 38rem;
    margin: 0 auto 1.25rem;
    color: #a8bfd2;
    font-size: .94rem;
    line-height: 1.55;
}

.mission-pause-actions,
.mission-pause-confirmation-actions {
    display: grid;
    gap: .65rem;
}

.mission-pause-action {
    width: 100%;
    min-height: 48px;
    padding: .7rem 1rem;
    border: 1px solid rgba(56, 217, 255, .34);
    border-radius: 6px;
    color: #c6d9e9;
    background: rgba(12, 31, 51, .88);
    font-family: 'Orbitron', sans-serif;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .06em;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.mission-pause-action:hover,
.mission-pause-action:focus-visible {
    border-color: var(--cyan);
    background: rgba(21, 69, 96, .9);
    transform: translateY(-1px);
}

.mission-pause-resume {
    border-color: rgba(56, 217, 255, .78);
    color: #041321;
    background: linear-gradient(105deg, #21a9dc, #48dbef);
}

.mission-pause-resume:hover,
.mission-pause-resume:focus-visible {
    color: #041321;
    background: linear-gradient(105deg, #31b8e9, #5be4f3);
}

.mission-pause-restart {
    color: #ffd591;
    border-color: rgba(255, 190, 96, .35);
}

.mission-pause-confirmation {
    margin-top: 1.2rem;
}

.mission-pause-confirmation > p {
    margin-bottom: 1rem;
}

.mission-pause-confirm {
    color: #07131d;
    border-color: rgba(255, 190, 96, .8);
    background: linear-gradient(105deg, #e8a43a, #ffd078);
}

@keyframes missionPauseEnter {
    from { opacity: 0; transform: translateY(8px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 600px) {
    .mission-header {
        flex-wrap: wrap;
    }

    .mission-pause-btn {
        min-height: 36px;
        margin-left: auto;
        padding: .4rem .6rem;
    }

    .mission-pause-panel {
        padding: 1.25rem 1rem;
    }

    .mission-pause-action {
        min-height: 46px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mission-pause-panel {
        animation: none;
    }
}

/* Mission HUD hierarchy: timer left, question count and pause control prominent. */
#mission-screen .mission-header {
    display: grid;
    grid-template-columns: minmax(155px, 180px) minmax(0, 1fr) auto auto;
    align-items: center;
    gap: clamp(.5rem, 1vw, .9rem);
}

#mission-screen .mission-header .timer-panel {
    grid-column: auto;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: .5rem .75rem;
    justify-self: start;
    background: linear-gradient(145deg, rgba(11, 39, 58, .8), rgba(7, 24, 39, .68));
    border-color: rgba(56, 217, 255, .38);
}

#mission-screen .mission-header > div:nth-child(2) {
    justify-self: end;
    text-align: right;
    opacity: .58;
}

#mission-screen .mission-header > div:nth-child(2) .eyebrow {
    font-size: .62rem;
    letter-spacing: .16em;
}

#mission-screen .mission-header > div:nth-child(2) h2 {
    color: #a9c0d2;
    font-size: clamp(.78rem, .9vw, .94rem);
    letter-spacing: .04em;
}

#mission-screen .mission-header .mission-number {
    min-width: 150px;
    padding: .45rem 0 .45rem .8rem;
    border: 0;
    border-left: 2px solid rgba(56, 217, 255, .42);
    border-radius: 0;
    color: #65e7ff;
    background: transparent;
    box-shadow: none;
    font-size: clamp(.78rem, .95vw, .94rem);
    font-weight: 800;
    letter-spacing: .07em;
    text-align: right;
}

#mission-screen .mission-pause-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: .58rem;
    min-width: 118px;
    min-height: 44px;
    padding: .35rem .72rem .35rem .4rem;
    overflow: hidden;
    border: 1px solid #a6f5ff;
    border-left: 3px solid #e2fdff;
    border-radius: 7px;
    color: #041a28;
    background: linear-gradient(125deg, #6aeafa 0%, #36cfe6 55%, #16a9ca 100%);
    box-shadow:
        inset 0 1px rgba(255, 255, 255, .54),
        inset 0 -2px rgba(3, 55, 73, .16),
        0 4px 0 rgba(2, 70, 91, .65),
        0 7px 18px rgba(0, 0, 0, .28);
    font-size: .68rem;
    letter-spacing: .13em;
    text-align: left;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

#mission-screen .mission-pause-icon {
    display: inline-grid;
    flex: 0 0 29px;
    grid-template-columns: repeat(2, 3px);
    align-content: center;
    justify-content: center;
    gap: 4px;
    width: 29px;
    height: 29px;
    margin: 0;
    border: 1px solid rgba(2, 36, 51, .5);
    border-radius: 5px;
    background: linear-gradient(145deg, #073247, #041b2b);
    box-shadow: inset 0 1px rgba(255, 255, 255, .15), 0 1px 3px rgba(0, 0, 0, .28);
}

#mission-screen .mission-pause-icon i {
    display: block;
    width: 3px;
    height: 10px;
    border-radius: 1px;
    background: #71efff;
    box-shadow: 0 0 7px rgba(56, 217, 255, .74);
}

#mission-screen .mission-pause-label {
    margin: 0;
    color: inherit;
    font-size: inherit;
    font-weight: 900;
    line-height: 1;
}

#mission-screen .mission-pause-btn::after {
    margin-left: auto;
    color: rgba(4, 26, 40, .72);
    font-size: 1.15rem;
    line-height: .8;
}

#mission-screen .mission-pause-btn:hover,
#mission-screen .mission-pause-btn:focus-visible {
    border-color: #d8fcff;
    color: #031521;
    background: linear-gradient(125deg, #9af5ff 0%, #57dced 55%, #29c3df 100%);
    box-shadow:
        inset 0 1px rgba(255, 255, 255, .78),
        0 0 24px rgba(56, 217, 255, .36),
        0 4px 0 rgba(2, 70, 91, .65),
        0 7px 18px rgba(0, 0, 0, .28);
    transform: translateY(-1px);
}

#mission-screen .mission-pause-btn:focus-visible {
    outline: 2px solid #b2f8ff;
    outline-offset: 3px;
}

#mission-screen .mission-pause-btn:active {
    transform: translateY(0) scale(.98);
}

@media (max-width: 800px) {
    #mission-screen .mission-header {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: .55rem;
    }

    #mission-screen .mission-header .timer-panel {
        grid-column: 1;
        grid-row: 1;
        width: min(100%, 180px);
        margin: 0;
    }

    #mission-screen .mission-header > div:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
        justify-self: start;
        text-align: left;
    }

    #mission-screen .mission-header .mission-number {
        grid-column: 2;
        grid-row: 2;
        min-width: 142px;
        padding: .45rem 0 .45rem .55rem;
    }

    #mission-screen .mission-pause-btn {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }
}

@media (max-width: 420px) {
    #mission-screen .mission-header {
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: .4rem;
    }

    #mission-screen .mission-header .timer-panel {
        width: min(100%, 152px);
        padding: .42rem .45rem;
    }

    #mission-screen .mission-header .mission-number {
        min-width: 132px;
        font-size: .72rem;
        letter-spacing: .04em;
    }

    #mission-screen .mission-pause-btn {
        min-height: 40px;
        padding: .42rem .55rem;
    }
}

/* Keep the complete mission and its next action visible at standard desktop zoom. */
@media (min-width: 1181px) and (min-height: 700px) and (max-height: 1300px) {
    .game-container:has(#mission-screen[style*="display: block"]) {
        padding: 6px 18px;
    }

    .game-container:has(#mission-screen[style*="display: block"]) .console-top {
        padding-bottom: 5px;
    }

    .game-container:has(#mission-screen[style*="display: block"]) .console-bottom {
        margin-top: 3px;
        padding-top: 4px;
    }

    #mission-screen {
        padding: 3px 0 0;
    }

    #mission-screen .mission-header .timer-panel {
        padding: .25rem .5rem;
    }

    #mission-timer {
        font-size: 1.25rem;
        line-height: 1.1;
    }

    .progress-track {
        margin: 2px 0;
    }

    .mission-tracker {
        margin: 0 0 5px;
    }

    .compact-roadmap .level-chip {
        min-height: 24px;
        padding: .1rem .05rem;
    }

    .incident-panel {
        padding: 6px 10px;
    }

    .question-area {
        margin: 5px 0 3px;
    }

    .question-area .eyebrow {
        margin-bottom: 3px;
    }

    .question-area h3 {
        font-size: clamp(.9rem, calc(.84rem + .25vw), 1rem);
        line-height: 1.2;
    }

    .answer-list {
        gap: 4px;
    }

    .answer-btn {
        min-height: 42px;
        padding: .3rem .65rem;
    }

    .option-text {
        font-size: clamp(.8rem, calc(.76rem + .2vw), .9rem);
    }

    .feedback {
        min-height: 16px;
        margin-top: 2px;
    }

    .clearance-status {
        margin: 3px 0;
        padding: 5px 8px;
    }

    #mission-screen > .mission-footer {
        margin-top: 3px;
        padding-top: 4px;
    }

    #mission-screen > #next-btn {
        min-height: 42px;
        margin-top: 2px;
    }
}

/* Lobby composition: keep the welcome clear of the workstation at desktop zoom. */
body[data-active-screen="dashboard"] .dashboard-main {
    scrollbar-gutter: auto;
    background: #061323;
}

body[data-active-screen="dashboard"] .dashboard-content.dashboard-lobby {
    width: 100%;
    max-width: none;
    overflow: hidden;
    background: #071629;
}

body[data-active-screen="dashboard"] .dashboard-content.dashboard-lobby::after {
    background:
        linear-gradient(180deg, rgba(3, 10, 22, .2), transparent 24%, transparent 70%, rgba(3, 10, 22, .62)),
        radial-gradient(ellipse at 50% 48%, transparent 0 48%, rgba(2, 9, 20, .2) 100%);
}

body[data-active-screen="dashboard"] .lobby-welcome {
    top: clamp(76px, 10vh, 104px) !important;
    right: auto !important;
    left: 50% !important;
    width: min(76vw, 900px) !important;
    max-width: calc(100vw - 2rem);
    margin: 0 !important;
    transform: translateX(-50%) !important;
    animation: none !important;
    text-align: center !important;
}

body[data-active-screen="dashboard"] .lobby-command-label,
body[data-active-screen="dashboard"] .lobby-hero-tagline,
body[data-active-screen="dashboard"] .lobby-supporting-copy {
    width: 100%;
    text-align: center;
}

body[data-active-screen="dashboard"] #dashboard-heading {
    display: grid;
    width: 100%;
    margin: 0;
    justify-items: center;
    text-align: center;
}

body[data-active-screen="dashboard"] #dashboard-heading > span {
    display: block;
    width: 100%;
    text-align: center;
}

body[data-active-screen="dashboard"] .lobby-command-label {
    margin-bottom: clamp(.25rem, .7vh, .55rem);
    font-size: clamp(.58rem, .82vw, .76rem);
}

body[data-active-screen="dashboard"] .lobby-welcome h1 {
    font-size: clamp(1.85rem, min(4.25vw, 7.2vh), 4rem);
    line-height: .98;
    letter-spacing: .075em;
}

body[data-active-screen="dashboard"] .lobby-hero-tagline {
    margin-top: clamp(.38rem, .8vh, .68rem);
    font-size: clamp(.62rem, .95vw, .82rem);
    letter-spacing: .18em;
}

body[data-active-screen="dashboard"] .lobby-supporting-copy {
    max-width: 42rem;
    margin-top: .32rem;
    font-size: clamp(.65rem, .83vw, .78rem);
}

/* A soft, distant world map adds depth without competing with monitor content. */
body[data-active-screen="dashboard"] .ref-globe {
    position: absolute;
    z-index: 4;
    top: clamp(13%, 20vh, 22%);
    left: 50%;
    width: clamp(260px, 31vw, 470px);
    aspect-ratio: 1;
    opacity: .43;
    filter: blur(1.4px) saturate(.82);
    transform: translateX(-50%);
    animation: lobby-globe-drift 16s ease-in-out infinite alternate;
}

body[data-active-screen="dashboard"] .ref-globe svg {
    display: block;
    width: 100%;
    height: 100%;
}

@keyframes lobby-globe-drift {
    from { translate: 0 0; opacity: .36; }
    to { translate: 0 -7px; opacity: .46; }
}

/* The navigation reads as a lit room rail instead of a separate dark card. */
body[data-active-screen="dashboard"] #dashboard-sidebar {
    top: clamp(160px, 18vh, 205px);
    bottom: clamp(116px, 14vh, 150px);
    left: clamp(.7rem, 1.5vw, 1.5rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: clamp(190px, 18vw, 248px);
    padding: .7rem .55rem;
    border-right: 1px solid rgba(87, 199, 232, .16);
    background: linear-gradient(90deg, rgba(5, 21, 38, .58), rgba(5, 21, 38, .24) 76%, transparent);
    box-shadow: inset 1px 0 rgba(84, 217, 247, .08);
    backdrop-filter: blur(7px);
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 7%, #000 93%, transparent);
    mask-image: linear-gradient(180deg, transparent, #000 7%, #000 93%, transparent);
}

body[data-active-screen="dashboard"] #dashboard-navigation {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-evenly;
    gap: .25rem;
}

body[data-active-screen="dashboard"] .dashboard-nav-item {
    min-height: clamp(42px, 6.2vh, 56px);
    padding-inline: .65rem;
    border-left: 1px solid rgba(108, 199, 225, .2);
    background: linear-gradient(90deg, rgba(5, 25, 43, .24), transparent 92%);
    font-size: clamp(.58rem, .72vw, .69rem);
    letter-spacing: .055em;
    transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}

body[data-active-screen="dashboard"] .dashboard-nav-item:hover,
body[data-active-screen="dashboard"] .dashboard-nav-item:focus-visible {
    border-left: 2px solid #68eaff;
    background: linear-gradient(90deg, rgba(32, 174, 213, .2), rgba(32, 174, 213, .025) 90%);
    color: #ecfbff;
    transform: translateX(3px);
}

body[data-active-screen="dashboard"] .dashboard-nav-item.active {
    border-left: 2px solid #68eaff;
    background: linear-gradient(90deg, rgba(31, 187, 222, .24), rgba(31, 187, 222, .035) 90%);
    box-shadow: inset 0 0 22px rgba(40, 191, 224, .07), 0 0 18px rgba(32, 187, 223, .08);
    color: #f1fcff;
}

/* Give the operator a clear seated silhouette, shaped shoulders and chair support. */
body[data-active-screen="dashboard"] .ref-operator {
    width: 220px;
    height: 270px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .38));
    animation: helpdesk-operator-breathe 5.4s ease-in-out infinite;
}

body[data-active-screen="dashboard"] .ref-head {
    left: 90px;
    width: 40px;
    height: 48px;
    border-radius: 46% 48% 44% 46%;
    background:
        radial-gradient(ellipse at 36% 42%, rgba(145, 193, 206, .38), transparent 25%),
        linear-gradient(90deg, #07121c 7%, #244657 45%, #112a3b 74%, #030a12 100%);
}

body[data-active-screen="dashboard"] .ref-head::before {
    position: absolute;
    top: -4px;
    left: -2px;
    width: 42px;
    height: 22px;
    border-radius: 55% 48% 20% 20%;
    background: linear-gradient(110deg, #03080f, #1b3341 55%, #060d14);
    content: "";
}

body[data-active-screen="dashboard"] .ref-head::after {
    position: absolute;
    top: 22px;
    right: -2px;
    width: 6px;
    height: 12px;
    border: 1px solid rgba(96, 202, 226, .35);
    border-left: 0;
    border-radius: 0 8px 8px 0;
    content: "";
}

body[data-active-screen="dashboard"] .ref-neck { left: 97px; }

body[data-active-screen="dashboard"] .ref-torso {
    left: 50px;
    width: 120px;
    height: 135px;
    border-radius: 44% 44% 12% 12%;
    background:
        linear-gradient(90deg, transparent 47%, rgba(126, 191, 207, .15) 49%, rgba(1, 8, 14, .12) 52%, transparent 55%),
        radial-gradient(ellipse at 50% 4%, rgba(120, 174, 192, .18), transparent 42%),
        linear-gradient(90deg, #06111b, #183243 42%, #0a1b28 70%, #030b13);
}

body[data-active-screen="dashboard"] .ref-shoulders {
    top: 59px;
    left: 26px;
    width: 170px;
    height: 42px;
    border-top: 3px solid rgba(91, 180, 207, .3);
    border-radius: 50% 50% 12% 12%;
    background: linear-gradient(180deg, rgba(24, 55, 72, .34), transparent 70%);
}

body[data-active-screen="dashboard"] .ref-arm {
    top: 93px;
    width: 29px;
    height: 96px;
    border-color: rgba(89, 174, 202, .33);
    background: linear-gradient(90deg, #07131e, #1a3545 48%, #081824);
}

body[data-active-screen="dashboard"] .ref-arm-left { left: 28px; transform: rotate(-23deg); }
body[data-active-screen="dashboard"] .ref-arm-right { right: 28px; transform: rotate(23deg); }

body[data-active-screen="dashboard"] .ref-chair-back {
    left: 24px;
    width: 172px;
    height: 164px;
    border: 3px solid rgba(77, 160, 188, .25);
    border-radius: 48% 48% 12% 12%;
    background:
        linear-gradient(90deg, transparent 49%, rgba(88, 163, 188, .14) 50%, transparent 52%),
        radial-gradient(ellipse at 50% 8%, rgba(49, 99, 120, .55), transparent 56%),
        linear-gradient(135deg, #0c2638, #071723 64%, #02080e);
    box-shadow: inset 0 8px 22px rgba(81, 177, 204, .12), 0 12px 24px rgba(0, 0, 0, .42);
}

body[data-active-screen="dashboard"] .ref-chair-back::before {
    position: absolute;
    top: 12px;
    left: 50%;
    width: 48px;
    height: 14px;
    border: 1px solid rgba(97, 180, 203, .23);
    border-radius: 999px;
    background: rgba(32, 77, 95, .36);
    content: "";
    transform: translateX(-50%);
}

body[data-active-screen="dashboard"] .ref-chair-seat {
    left: 16px;
    bottom: -23px;
    width: 190px;
    height: 58px;
    border: 1px solid rgba(79, 157, 182, .28);
    background: linear-gradient(180deg, #0b1d2a, #02070c 75%);
}

body[data-active-screen="dashboard"] .ref-chair-seat::before {
    position: absolute;
    bottom: -23px;
    left: 50%;
    width: 13px;
    height: 24px;
    background: linear-gradient(90deg, #06111a, #34596a 48%, #06111a);
    content: "";
    transform: translateX(-50%);
}

body[data-active-screen="dashboard"] .ref-chair-seat::after {
    position: absolute;
    bottom: -29px;
    left: 50%;
    width: 94px;
    height: 9px;
    border: 1px solid rgba(79, 157, 182, .28);
    border-radius: 50%;
    background: linear-gradient(180deg, #183445, #040b11);
    content: "";
    transform: translateX(-50%);
}

@media (max-width: 760px) {
    body[data-active-screen="dashboard"] #dashboard-sidebar {
        top: auto;
        right: .65rem;
        bottom: clamp(132px, 21vh, 190px);
        left: .65rem;
        width: auto;
        padding: .3rem;
        border: 1px solid rgba(87, 199, 232, .14);
        background: linear-gradient(90deg, rgba(5, 21, 38, .68), rgba(5, 21, 38, .4));
        -webkit-mask-image: none;
        mask-image: none;
    }

    body[data-active-screen="dashboard"] #dashboard-navigation {
        flex-direction: row;
        justify-content: space-around;
        gap: .15rem;
    }

    body[data-active-screen="dashboard"] .dashboard-nav-item {
        grid-template-columns: 1fr;
        justify-items: center;
        min-height: 42px;
        padding: .35rem .2rem;
        border: 0;
        background: transparent;
        font-size: .5rem;
        letter-spacing: .015em;
        text-align: center;
    }

    body[data-active-screen="dashboard"] .dashboard-nav-item > span {
        grid-row: auto;
        font-size: .9rem;
    }

    body[data-active-screen="dashboard"] .dashboard-nav-label { white-space: nowrap; }
    body[data-active-screen="dashboard"] .lobby-welcome {
        top: clamp(76px, 12vh, 100px) !important;
        right: auto !important;
        left: 50% !important;
        width: calc(100% - 1.3rem) !important;
        max-width: none;
        transform: translateX(-50%) !important;
    }
    body[data-active-screen="dashboard"] .lobby-welcome h1 { font-size: clamp(1.5rem, 7vw, 2.65rem); }
    body[data-active-screen="dashboard"] .ref-globe { top: 28%; width: min(72vw, 330px); }
    body[data-active-screen="dashboard"] .ref-operator { transform: translateX(-50%) scale(.82); transform-origin: center bottom; }
}

@media (max-height: 700px) and (min-width: 761px) {
    body[data-active-screen="dashboard"] .lobby-welcome { top: 66px !important; }
    body[data-active-screen="dashboard"] .lobby-welcome h1 { font-size: clamp(1.8rem, min(4vw, 6.6vh), 3.4rem); }
    body[data-active-screen="dashboard"] .ref-globe { top: 18%; }
}

@media (prefers-reduced-motion: reduce) {
    body[data-active-screen="dashboard"] .ref-globe,
    body[data-active-screen="dashboard"] .ref-operator { animation: none; }
}

/* Keep the lobby title on one alignment axis even while the route shell changes. */
.dashboard-content.dashboard-lobby {
    position: relative;
}

.dashboard-content.dashboard-lobby .lobby-welcome {
    position: absolute !important;
    top: clamp(76px, 10vh, 104px) !important;
    right: 0 !important;
    left: 0 !important;
    width: min(90vw, 900px) !important;
    max-width: calc(100% - 2rem) !important;
    margin: 0 auto !important;
    transform: none !important;
    animation: none !important;
    text-align: center !important;
}

.dashboard-content.dashboard-lobby #dashboard-heading {
    position: static !important;
    inset: auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    justify-items: stretch !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    transform: none !important;
    text-align: center !important;
}

.dashboard-content.dashboard-lobby #dashboard-heading > span {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    text-align: center !important;
}

.dashboard-content.dashboard-lobby .lobby-command-label,
.dashboard-content.dashboard-lobby .lobby-hero-tagline,
.dashboard-content.dashboard-lobby .lobby-supporting-copy {
    width: 100%;
    margin-right: auto;
    margin-left: auto;
    text-align: center !important;
}

.dashboard-content.dashboard-lobby .ref-operator-art {
    position: absolute;
    z-index: 1;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

@media (max-width: 760px) {
    .dashboard-content.dashboard-lobby .lobby-welcome {
        top: clamp(76px, 12vh, 100px) !important;
        width: calc(100% - 1.3rem) !important;
        max-width: none !important;
    }
}

/* Navigation labels stay readable; outlined controls remain clear on the room backdrop. */
body[data-active-screen="dashboard"] #dashboard-sidebar {
    width: clamp(208px, 18vw, 256px);
}

body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-item {
    display: grid;
    grid-template-columns: 1.35rem minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: center;
    justify-items: stretch;
    width: 100%;
    min-width: 0;
    min-height: clamp(44px, 6.2vh, 58px);
    padding: .55rem .7rem;
    overflow: visible;
    clip-path: none;
    border: 1px solid rgba(99, 196, 222, .24);
    border-left: 2px solid rgba(99, 196, 222, .32);
    border-radius: 5px 10px 5px 10px;
    background: transparent;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .012);
    color: rgba(205, 230, 242, .86);
    font-size: clamp(.54rem, .64vw, .67rem);
    letter-spacing: .045em;
    line-height: 1.12;
    text-align: left;
    transition: border-color .2s ease, color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-icon {
    grid-column: 1;
    grid-row: 1;
    display: grid;
    place-items: center;
    min-width: 0;
    color: #55dfff;
}

body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-icon svg {
    display: block;
    width: clamp(15px, 1.15vw, 19px);
    height: clamp(15px, 1.15vw, 19px);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-label {
    grid-column: 2;
    grid-row: 1;
    display: block;
    min-width: 0;
    overflow: visible;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    text-overflow: clip;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    letter-spacing: inherit;
}

body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-item:hover,
body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-item:focus-visible {
    border-color: rgba(105, 229, 250, .78);
    border-left-color: #66eaff;
    background: transparent;
    box-shadow: inset 3px 0 #66eaff, 0 0 16px rgba(48, 200, 231, .16);
    color: #f1fcff;
    outline: none;
}

body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-item.active {
    border-color: rgba(105, 229, 250, .72);
    border-left: 3px solid #66eaff;
    background: transparent;
    box-shadow: inset 3px 0 #66eaff, 0 0 18px rgba(48, 200, 231, .12);
    color: #f1fcff;
}

@media (max-width: 760px) {
    body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-item {
        flex: 1 1 0;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
        justify-items: center;
        gap: .2rem;
        min-width: 0;
        min-height: 50px;
        padding: .3rem .12rem;
        font-size: clamp(.4rem, 1.8vw, .53rem);
        line-height: 1.08;
        text-align: center;
    }

    body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-icon {
        grid-column: 1;
        grid-row: 1;
    }

    body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-icon svg {
        width: clamp(14px, 3.8vw, 17px);
        height: clamp(14px, 3.8vw, 17px);
    }

    body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-label {
        grid-column: 1;
        grid-row: 2;
        overflow-wrap: anywhere;
        text-align: center;
    }
}

/* Shared asymmetric corner treatment for every interactive button. */
:where(button, input[type="button"], input[type="submit"], input[type="reset"], [role="button"]) {
    border-radius: 5px 10px 5px 10px !important;
}

/* =========================================
   LEVEL TOPIC DISPLAY
   ========================================= */

/* 1. Gameplay header — current level topic */
#mission-screen .mission-header > div:nth-child(2) {
    opacity: 1;
}

#mission-screen .mission-topic {
    max-width: 30rem;
    min-width: 0;
    margin-top: .3rem;
    color: #55dfff;
    font-size: clamp(.7rem, .85vw, .88rem);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: .025em;
    overflow-wrap: anywhere;
}

/* 2. Command Centre — all 10 topics per difficulty */
.levels-overview-map {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem .65rem;
}

.levels-overview-item {
    display: flex;
    align-items: flex-start;
    min-width: 0;
    gap: .5rem;
}

.levels-overview-marker {
    flex: 0 0 30px;
    min-height: 30px;
}

.levels-overview-topic {
    min-width: 0;
    padding-top: .2rem;
    color: #c3d5e5;
    font-size: .72rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* 3. Level Selection — all 10 topic names */
#level-screen #level-selection {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
}

#level-screen .level-chip {
    min-height: 82px;
    padding: .55rem .45rem;
    gap: .3rem;
}

#level-screen .level-chip-topic {
    color: #c5d9e9;
    font-size: .7rem;
    font-weight: 500;
    line-height: 1.35;
    text-align: center;
    overflow-wrap: anywhere;
}

#level-screen .level-chip small {
    line-height: 1.3;
}

@media (max-width: 600px) {
    #level-screen #level-selection {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #level-screen .level-chip {
        min-height: 88px;
        padding: .5rem .35rem;
    }

    .levels-overview-topic {
        font-size: .7rem;
    }
}
/* =========================================================
   CAMPAIGN CHAPTERS + MISSION ROUTE (Levels redesign)
   ========================================================= */

.lobby-play-button {
    flex: 0 0 auto;
    width: min(100%, 340px);
    max-width: 340px;
    min-height: 52px;
    align-self: center;
}

/* ---------- Chapter cards ---------- */

.chapters-overview-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(.8rem, 1.6vw, 1.2rem);
}

.chapter-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .55rem;
    min-width: 0;
    padding: clamp(1rem, 1.8vw, 1.5rem);
    border: 1px solid rgba(56, 217, 255, .22);
    border-radius: 8px;
    background:
        radial-gradient(ellipse at 100% 0%, rgba(38, 140, 255, .14), transparent 60%),
        linear-gradient(160deg, rgba(10, 26, 48, .95), rgba(5, 13, 26, .95));
    overflow: hidden;
}

.chapter-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    opacity: .7;
}

.chapter-card.is-locked {
    border-color: rgba(130, 155, 181, .18);
    background:
        repeating-linear-gradient(135deg, rgba(130, 155, 181, .04) 0 10px, transparent 10px 20px),
        rgba(7, 14, 26, .92);
}

.chapter-card.is-locked::before {
    background: linear-gradient(90deg, transparent, rgba(130, 155, 181, .5), transparent);
    opacity: .5;
}

.chapter-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
}

.chapter-card-kicker {
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-label);
    letter-spacing: .14em;
    color: var(--cyan);
}

.chapter-state-badge {
    padding: .2rem .55rem;
    border: 1px solid;
    border-radius: 3px;
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-micro);
    letter-spacing: .1em;
}

.chapter-state-badge.unlocked {
    border-color: rgba(77, 255, 181, .5);
    color: var(--green);
    background: rgba(77, 255, 181, .08);
}

.chapter-state-badge.locked {
    border-color: rgba(130, 155, 181, .35);
    color: #8fa6bd;
}

.chapter-card h3 {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.05rem, 1rem + .4vw, 1.35rem);
    letter-spacing: .05em;
    color: #f2fbff;
}

.chapter-card.is-locked h3 {
    color: #9fb2c4;
}

.chapter-card-summary {
    margin: 0;
    color: var(--muted);
    font-size: var(--type-reading);
    line-height: 1.5;
}

.chapter-card-detail {
    margin: .2rem 0 0;
    font-family: monospace;
    font-size: var(--type-small);
    letter-spacing: .08em;
    color: #b9d6e6;
}

.chapter-card-note {
    color: #6f8aa3;
}

.chapter-progress-track {
    margin-top: .1rem;
}

.chapter-card-action {
    margin-top: auto;
    width: 100%;
    min-height: 46px;
    font-size: var(--type-micro);
}

.chapter-card-action:disabled {
    cursor: not-allowed;
    opacity: .6;
}

/* ---------- Chapter view header actions ---------- */

.chapter-view-heading p:not(.dashboard-eyebrow) {
    max-width: 62ch;
}

.chapter-view-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

/* ---------- Mission zones ---------- */

.chapter-view-zones {
    display: grid;
    gap: clamp(1rem, 2vw, 1.4rem);
}

.mission-zone {
    --zone-accent: var(--cyan);
    --zone-accent-soft: rgba(56, 217, 255, .18);
    position: relative;
    min-width: 0;
    padding: clamp(1rem, 1.8vw, 1.5rem);
    border: 1px solid var(--zone-accent-soft);
    border-radius: 8px;
    background:
        radial-gradient(ellipse at 0% 0%, color-mix(in srgb, var(--zone-accent) 10%, transparent), transparent 55%),
        linear-gradient(180deg, rgba(9, 22, 40, .94), rgba(5, 13, 26, .96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.mission-zone.zone-easy {
    --zone-accent: #4dffb5;
    --zone-accent-soft: rgba(77, 255, 181, .2);
}

.mission-zone.zone-medium {
    --zone-accent: #38d9ff;
    --zone-accent-soft: rgba(56, 217, 255, .2);
}

.mission-zone.zone-hard {
    --zone-accent: #ff6d8a;
    --zone-accent-soft: rgba(255, 109, 138, .2);
}

.mission-zone-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: .8rem 1.2rem;
}

.mission-zone-kicker {
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-micro);
    letter-spacing: .16em;
    color: var(--zone-accent);
}

.mission-zone-title-group h3 {
    margin: .2rem 0 .15rem;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.1rem, 1rem + .5vw, 1.45rem);
    letter-spacing: .06em;
    color: #f2fbff;
}

.mission-zone-description {
    margin: 0;
    color: var(--muted);
    font-size: var(--type-reading);
}

.mission-zone-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.mission-zone-stats strong {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.2rem, 1.1rem + .6vw, 1.6rem);
    color: var(--zone-accent);
}

.mission-zone-xp {
    margin-top: .25rem;
    color: #b9d6e6 !important;
}

.mission-zone-stats span {
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: .1em;
    color: var(--muted);
}

.mission-zone > .chapter-progress-track {
    margin: 1rem 0 0;
}

/* ---------- Route: nodes + glowing connectors ---------- */

.zone-route {
    display: flex;
    gap: 0;
    /* Keep the orb glow inside the horizontal scroller's vertical clip. */
    margin: -4.8rem 0 -6rem;
    padding: 6.6rem .2rem 6.4rem;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: thin;
}

.zone-node {
    position: relative;
    flex: 1 1 0;
    min-width: 74px;
    display: flex;
    justify-content: center;
}

/* connector from this node's orb to the next node's orb */
.zone-node:not(:last-child)::before {
    content: "";
    position: absolute;
    top: 21px;
    left: calc(50% + 26px);
    width: calc(100% - 52px);
    height: 2px;
    border-radius: 2px;
    background: rgba(130, 155, 181, .22);
    transition: background .4s ease, box-shadow .4s ease;
}

.zone-node.is-linked:not(:last-child)::before {
    background: linear-gradient(90deg, var(--zone-accent), var(--cyan));
    box-shadow: 0 0 10px var(--zone-accent), 0 0 22px color-mix(in srgb, var(--zone-accent) 35%, transparent);
}

.zone-node-button {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
    text-align: center;
}

.zone-node-button.is-disabled {
    cursor: not-allowed;
}

.zone-node-orb {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(130, 155, 181, .28);
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, rgba(30, 50, 74, .95), rgba(7, 16, 30, .98));
    font-family: 'Orbitron', sans-serif;
    font-size: .72rem;
    font-weight: 700;
    color: #6f8aa3;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.zone-node-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .2rem;
    max-width: 100%;
}

.zone-node-state {
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: .08em;
    color: #6f8aa3;
    white-space: nowrap;
}

.zone-node-topic {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 14ch;
    font-size: var(--type-small);
    line-height: 1.25;
    color: #a9bfd1;
}

/* node states */
.zone-node.completed .zone-node-orb {
    border-color: var(--green);
    background: radial-gradient(circle at 35% 30%, rgba(77, 255, 181, .35), rgba(8, 40, 32, .98));
    color: #eafff6;
    box-shadow: 0 0 14px rgba(77, 255, 181, .45);
}

.zone-node.completed .zone-node-state {
    color: var(--green);
}

.zone-node.unlocked .zone-node-orb {
    border-color: rgba(56, 217, 255, .6);
    color: var(--cyan);
    box-shadow: 0 0 10px rgba(56, 217, 255, .25);
}

.zone-node.unlocked .zone-node-state {
    color: var(--cyan);
}

.zone-node.current .zone-node-orb,
.zone-node.retry .zone-node-orb {
    width: 52px;
    height: 52px;
    margin: -4px 0;
    border: 2px solid var(--zone-accent);
    color: #f2fbff;
    background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--zone-accent) 40%, transparent), rgba(6, 18, 32, .98));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--zone-accent) 14%, transparent), 0 0 22px var(--zone-accent);
    animation: zone-node-pulse 2.4s ease-in-out infinite;
}

.zone-node.current .zone-node-state {
    color: var(--zone-accent);
}

.zone-node.retry .zone-node-orb {
    border-color: #ff6d8a;
    box-shadow: 0 0 0 4px rgba(255, 109, 138, .14), 0 0 20px #ff6d8a;
}

.zone-node.retry .zone-node-state {
    color: #ff9aaf;
}

.zone-node.locked .zone-node-orb {
    border-style: dashed;
    opacity: .6;
}

.zone-node.locked .zone-node-topic {
    color: #5d7389;
}

.zone-node-button:not(.is-disabled):hover .zone-node-orb,
.zone-node-button:not(.is-disabled):focus-visible .zone-node-orb {
    transform: translateY(-2px) scale(1.06);
    border-color: var(--zone-accent);
}

.zone-node-button:focus-visible {
    outline: 2px solid #d6f8ff;
    outline-offset: 4px;
    border-radius: 6px;
}

@keyframes zone-node-pulse {
    0%, 100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--zone-accent) 14%, transparent), 0 0 18px var(--zone-accent); }
    50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--zone-accent) 6%, transparent), 0 0 30px var(--zone-accent); }
}

/* ---------- Zone footer ---------- */

.mission-zone-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 1rem;
}

.mission-zone-roadmap {
    min-height: 44px;
    padding: .6rem 1.1rem;
    border: 1px solid var(--zone-accent-soft);
    border-radius: 4px;
    background: rgba(4, 16, 30, .7);
    color: var(--zone-accent);
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-micro);
    letter-spacing: .08em;
    cursor: pointer;
    transition: box-shadow .2s ease, border-color .2s ease;
}

.mission-zone-roadmap:hover,
.mission-zone-roadmap:focus-visible {
    border-color: var(--zone-accent);
    box-shadow: 0 0 18px var(--zone-accent-soft);
    outline: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
    .chapters-overview-list {
        grid-template-columns: 1fr;
    }
}

/* Phones: route becomes a vertical path */
@media (max-width: 600px) {
    .zone-route {
        flex-direction: column;
        margin: 1.2rem 0 0;
        overflow: visible;
        padding: .2rem 0;
    }

    .zone-node {
        min-width: 0;
        min-height: 60px;
        justify-content: flex-start;
        padding-bottom: 8px;
    }

    .zone-node:not(:last-child)::before {
        top: 44px;
        left: 21px;
        width: 2px;
        height: calc(100% - 44px);
        background: rgba(130, 155, 181, .22);
    }

    .zone-node.is-linked:not(:last-child)::before {
        background: linear-gradient(180deg, var(--zone-accent), var(--cyan));
    }

    .zone-node-button {
        flex-direction: row;
        justify-content: flex-start;
        gap: .85rem;
        text-align: left;
    }

    .zone-node.current .zone-node-orb,
    .zone-node.retry .zone-node-orb {
        margin: -4px 0;
    }

    .zone-node-copy {
        align-items: flex-start;
    }

    .zone-node-topic {
        max-width: none;
        -webkit-line-clamp: 3;
    }

    .zone-node-state {
        white-space: normal;
    }

    .mission-zone-stats {
        align-items: flex-start;
    }

    .mission-zone-footer .mission-zone-roadmap {
        width: 100%;
    }

    .chapter-card-action {
        min-height: 48px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .zone-node.current .zone-node-orb,
    .zone-node.retry .zone-node-orb {
        animation: none;
    }

    .zone-node:not(:last-child)::before,
    .zone-node-orb {
        transition: none;
    }
}

/* ---------- Sidebar navigation: solid, readable option panels ---------- */
body[data-active-screen="dashboard"] #dashboard-sidebar {
    background: linear-gradient(180deg, rgba(8, 24, 44, .97), rgba(5, 14, 28, .96));
    box-shadow: inset -1px 0 0 rgba(56, 217, 255, .12), 12px 0 30px rgba(0, 0, 0, .35);
}
body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav {
    gap: .6rem;
}
body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-item {
    min-height: clamp(48px, 6.4vh, 60px);
    padding: .6rem .8rem;
    border: 1px solid rgba(86, 204, 232, .34);
    border-left: 3px solid rgba(86, 204, 232, .5);
    border-radius: 8px;
    background: linear-gradient(95deg, rgba(20, 56, 88, .78), rgba(10, 30, 52, .78));
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .05);
    color: #d6eef8;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(.62rem, .7vw, .74rem);
    font-weight: 600;
    letter-spacing: .08em;
    column-gap: .75rem;
}
body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: rgba(56, 217, 255, .14);
    border: 1px solid rgba(56, 217, 255, .32);
}
body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-item:hover,
body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-item:focus-visible {
    background: linear-gradient(95deg, rgba(30, 88, 128, .9), rgba(14, 44, 72, .9));
    border-color: rgba(105, 229, 250, .8);
    border-left-color: #66eaff;
    color: #ffffff;
    transform: translateX(3px);
}
body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-item.active {
    background: linear-gradient(95deg, rgba(56, 217, 255, .34), rgba(38, 140, 255, .18));
    border-color: rgba(105, 229, 250, .9);
    border-left: 3px solid #66eaff;
    box-shadow: 0 0 22px rgba(56, 217, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .1);
    color: #ffffff;
}
body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-item.active .dashboard-nav-icon {
    background: rgba(56, 217, 255, .3);
    box-shadow: 0 0 12px rgba(56, 217, 255, .6);
}

/* ---------- Mission node labels: no collisions ---------- */
.zone-node {
    min-width: 84px;
}

.zone-node-state,
.zone-node-best {
    display: block;
    font-size: .58rem;
    letter-spacing: .06em;
    white-space: nowrap;
}

.zone-node-best {
    font-family: monospace;
    color: #8fb3c6;
}

/* ---------- Sidebar option interiors: lighter, luminous panels ---------- */
body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-item {
    background: linear-gradient(100deg, rgba(40, 116, 168, .62), rgba(22, 74, 118, .55));
    border-color: rgba(120, 220, 245, .5);
    color: #ffffff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}
body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-item:hover,
body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-item:focus-visible {
    background: linear-gradient(100deg, rgba(56, 150, 205, .8), rgba(32, 100, 150, .72));
}
body[data-active-screen="dashboard"] #dashboard-sidebar .dashboard-nav-item.active {
    background: linear-gradient(100deg, rgba(70, 180, 230, .85), rgba(38, 130, 190, .75));
}

/* ---------- Inner pages (Levels, Statistics, Achievements, Profile, Settings): lit backdrop ---------- */
body.player-app-active:not([data-active-screen="dashboard"]) .dashboard-main {
    background:
        radial-gradient(ellipse 70% 45% at 85% 0%, rgba(56, 217, 255, .16), transparent 70%),
        radial-gradient(ellipse 60% 50% at 0% 100%, rgba(38, 140, 255, .14), transparent 70%),
        linear-gradient(180deg, #0c2440 0%, #081a31 45%, #061325 100%);
    background-attachment: fixed;
}

body.player-app-active:not([data-active-screen="dashboard"]) .dashboard-main::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(86, 204, 232, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(86, 204, 232, .07) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 85%);
}

body.player-app-active:not([data-active-screen="dashboard"]) .dashboard-main > :not(.dashboard-header) {
    position: relative;
    z-index: 1;
}

/* ---------- Incident log: clean scrolling edges ---------- */
.incident-log .log-header {
    position: relative;
    z-index: 2;
}

.incident-log .log-content {
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
    mask-image: linear-gradient(180deg, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%);
    padding-top: 1.1rem;
    padding-bottom: 1rem;
}

/* ---------- Gameplay panel: footer sits at the bottom instead of leaving a void ---------- */
#mission-screen[style*="block"] {
    display: flex !important;
    flex-direction: column;
}

#mission-screen[style*="block"] > .mission-footer {
    margin-top: auto;
}

/* ---------- Log minimize button: keep label on one line ---------- */
.incident-log .log-header {
    gap: .5rem;
}

.incident-log .log-header > span {
    min-width: 0;
    line-height: 1.3;
}

.incident-log .log-toggle {
    flex: 0 0 auto;
    white-space: nowrap;
    line-height: 1;
    letter-spacing: .04em;
    padding: .4rem .6rem;
}

/* =========================================================
   STATISTICS CHARTS
   ========================================================= */

.stats-visual-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(.85rem, 1.6vw, 1.2rem);
    margin: 1.2rem 0;
}

.stats-visual-wide {
    grid-column: span 2;
}

.stats-visual-panel {
    min-width: 0;
}

.stats-visual-body {
    margin-top: .8rem;
}

.stats-visual-note {
    margin: .9rem 0 0;
    color: var(--muted);
    font-size: var(--type-small);
}

.stats-visual-empty {
    margin: .5rem 0;
    color: var(--muted);
    font-size: var(--type-reading);
}

/* Donut + legend */
.stats-donut-layout {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.2rem 1.6rem;
}

.stats-donut {
    width: min(200px, 60vw);
    height: auto;
    overflow: visible;
}

.stats-donut-value {
    fill: #f2fbff;
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
    font-weight: 700;
}

.stats-donut-label {
    fill: var(--muted);
    font-family: monospace;
    font-size: 9px;
    letter-spacing: .12em;
}

.stats-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1 1 200px;
    display: grid;
    gap: .55rem;
}

.stats-legend li {
    display: grid;
    grid-template-columns: 12px 1fr auto auto;
    align-items: center;
    gap: .55rem;
    font-family: monospace;
    font-size: var(--type-small);
}

.stats-legend strong {
    color: #f2fbff;
}

.stats-legend small {
    color: var(--muted);
    min-width: 3ch;
    text-align: right;
}

.stats-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

/* Mode rings */
.stats-ring-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .8rem;
    margin-top: .8rem;
}

.stats-ring-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    text-align: center;
}

.stats-ring-card svg {
    width: min(110px, 100%);
    height: auto;
}

.stats-ring-value {
    fill: #f2fbff;
    font-family: 'Orbitron', sans-serif;
    font-size: 15px;
    font-weight: 700;
}

.stats-ring-card strong {
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-small);
    letter-spacing: .08em;
    color: #e7f4ff;
}

.stats-ring-card small {
    font-family: monospace;
    font-size: var(--type-micro);
    letter-spacing: .08em;
    color: var(--muted);
}

/* Level heatmap */
.stats-route-row {
    display: grid;
    grid-template-columns: minmax(70px, 96px) 1fr;
    align-items: center;
    gap: .6rem;
    margin-bottom: .6rem;
}

.stats-route-label {
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-micro);
    letter-spacing: .08em;
    color: #cfe9f5;
}

.stats-route-cells {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: .3rem;
}

.stats-route-cell {
    display: grid;
    place-items: center;
    min-height: 34px;
    border: 1px solid rgba(130, 155, 181, .18);
    border-radius: 4px;
    font-family: monospace;
    font-size: var(--type-micro);
    color: #e7f4ff;
    cursor: default;
}

.stats-route-cell.locked {
    color: #5d7389;
    border-style: dashed;
}

.stats-route-cell.passed {
    border-color: rgba(77, 255, 181, .55);
}

.stats-route-cell.not-passed {
    border-color: rgba(255, 73, 108, .55);
}

.stats-route-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.1rem;
    margin-top: .8rem;
    font-family: monospace;
    font-size: var(--type-micro);
    color: var(--muted);
}

.stats-route-legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: .35rem;
    border-radius: 2px;
    vertical-align: middle;
}

/* Rank bars */
.stats-rank-row {
    display: grid;
    gap: .35rem;
    margin-bottom: .9rem;
}

.stats-rank-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: monospace;
    font-size: var(--type-small);
}

.stats-rank-head strong {
    font-family: 'Orbitron', sans-serif;
    font-size: var(--type-micro);
    letter-spacing: .08em;
}

.stats-rank-head span {
    color: #cfe9f5;
}

.stats-rank-track {
    height: 10px;
    border-radius: 999px;
    background: rgba(130, 155, 181, .14);
    overflow: hidden;
}

.stats-rank-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38d9ff, #4dffb5);
    box-shadow: 0 0 12px rgba(56, 217, 255, .45);
}

.stats-rank-row small {
    font-family: monospace;
    font-size: var(--type-micro);
    color: var(--muted);
}

/* Responsive */
@media (max-width: 800px) {
    .stats-visual-grid {
        grid-template-columns: 1fr;
    }

    .stats-visual-wide {
        grid-column: auto;
    }
}

@media (max-width: 600px) {
    .stats-ring-row {
        grid-template-columns: 1fr;
    }

    .stats-route-row {
        grid-template-columns: 1fr;
    }

    .stats-route-cells {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* =========================================================
   MOTION: statistics, mission route, gameplay feedback
   (every effect is decorative; reduced-motion settings switch them off)
   ========================================================= */

/* Statistics: arcs and bars ease to their values */
.stats-rank-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.stats-ring-card,
.stats-route-cell {
    animation: stats-fade-up .5s ease both;
}

.stats-ring-card {
    animation-delay: calc(var(--i, 0) * 120ms + 120ms);
}

.stats-route-cell {
    animation-delay: calc(var(--i, 0) * 22ms + 200ms);
}

@keyframes stats-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* Mission route: nodes rise in, passed links carry a travelling packet */
.zone-node {
    animation: zone-node-in .5s ease both;
    animation-delay: calc(var(--i, 0) * 70ms);
}

@keyframes zone-node-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}

.zone-node.is-linked:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 18px;
    left: calc(50% + 26px);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #eafff6;
    box-shadow: 0 0 8px var(--zone-accent), 0 0 14px var(--zone-accent);
    z-index: 2;
    animation: packet-travel-x 2.6s linear infinite;
    animation-delay: calc(var(--i, 0) * 0.35s);
}

@keyframes packet-travel-x {
    0% { left: calc(50% + 26px); opacity: 0; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    100% { left: calc(150% - 32px); opacity: 0; }
}

/* Gameplay: timer drain bar */
.timer-drain {
    display: block;
    height: 4px;
    margin-top: .45rem;
    border-radius: 999px;
    background: rgba(130, 155, 181, .18);
    overflow: hidden;
}

.timer-drain i {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #38d9ff, #4dffb5);
    transform-origin: left center;
    transform: scaleX(1);
    transition: transform .25s linear, background .3s ease;
}

#mission-timer.warning ~ .timer-drain i {
    background: linear-gradient(90deg, #ff496c, #ffb36b);
}

/* Gameplay: answer feedback */
.answer-btn.correct-answer {
    animation: answer-pulse .6s ease;
}

.answer-btn.wrong-answer {
    animation: answer-shake .45s ease;
}

@keyframes answer-pulse {
    0% { box-shadow: 0 0 0 0 rgba(77, 255, 181, .6); }
    60% { box-shadow: 0 0 0 12px rgba(77, 255, 181, 0); }
    100% { box-shadow: none; }
}

@keyframes answer-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(3px); }
}

/* Reduced motion: OS setting or the in-game toggle */
body.app-reduced-motion .stats-arc,
body.app-reduced-motion .stats-rank-fill,
body.app-reduced-motion .zone-node,
body.app-reduced-motion .stats-ring-card,
body.app-reduced-motion .stats-route-cell,
body.app-reduced-motion .answer-btn.correct-answer,
body.app-reduced-motion .answer-btn.wrong-answer,
body.app-reduced-motion .timer-drain i {
    animation: none !important;
    transition: none !important;
}

body.app-reduced-motion .zone-node.is-linked:not(:last-child)::after {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .stats-arc,
    .stats-rank-fill,
    .zone-node,
    .stats-ring-card,
    .stats-route-cell,
    .answer-btn.correct-answer,
    .answer-btn.wrong-answer,
    .timer-drain i {
        animation: none !important;
        transition: none !important;
    }

    .zone-node.is-linked:not(:last-child)::after {
        display: none;
    }
}

/* Mission route on phones is vertical, so the packet travels downwards */
@media (max-width: 600px) {
    .zone-node.is-linked:not(:last-child)::after {
        top: 44px;
        left: 18px;
        animation: packet-travel-y 2.6s linear infinite;
        animation-delay: calc(var(--i, 0) * 0.35s);
    }
}

@keyframes packet-travel-y {
    0% { top: 44px; opacity: 0; }
    12% { opacity: 1; }
    88% { opacity: 1; }
    100% { top: calc(100% - 6px); opacity: 0; }
}

/* ---------- Game logo ---------- */
.logo-mark {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: middle;
    overflow: visible;
    filter: drop-shadow(0 0 8px rgba(56, 217, 255, .45));
}

.inline-logo {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
}

.inline-logo svg {
    width: 1.35em;
    height: 1.35em;
    flex: 0 0 auto;
}

.intro-emblem .logo-mark {
    width: clamp(64px, 9vw, 96px);
    height: clamp(64px, 9vw, 96px);
}

.dashboard-game-brand .dashboard-game-logo {
    width: 44px;
    height: 44px;
}

/* ---------- Wide PNG logo (assets/helpdesk-logo.png) ---------- */
img.logo-mark,
img.brand-icon {
    width: auto;
    height: auto;
    max-width: 100%;
}
.inline-logo img {
    height: 1.9em;
    width: auto;
    flex: 0 0 auto;
}
.intro-emblem img.logo-mark {
    width: min(78vw, 440px);
    height: auto;
}
.dashboard-game-brand img.dashboard-game-logo {
    width: 168px;
    height: auto;
}
img.brand-icon {
    width: 150px;
}
@media (max-width: 600px) {
    .dashboard-game-brand img.dashboard-game-logo {
        width: 132px;
    }
}
/* Wide logo sits without the square frame used by the old emblem */
.intro-emblem:has(img.logo-mark) {
    width: auto;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

/* Header logo spots use the full logo, sized by height so the whole artwork stays intact. */
.top-bar .brand img.brand-icon {
    width: auto;
    height: 46px;
    max-width: none;
    margin-right: .75rem;
    vertical-align: middle;
}
.inline-logo img {
    height: 34px;
    width: auto;
}
.dashboard-game-brand img.dashboard-game-logo {
    display: block;
    width: auto;
    height: 58px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    filter: drop-shadow(0 0 8px rgba(56, 217, 255, .5));
}
@media (max-width: 600px) {
    .dashboard-game-brand img.dashboard-game-logo {
        height: 44px;
    }
    .top-bar .brand img.brand-icon {
        height: 36px;
    }
}
/* Welcome screen: the logo already carries the wordmark, so the big duplicate title is kept for screen readers only. */
.welcome-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Shield emblem in the header spots: fixed square boxes. */
.top-bar .brand img.brand-icon { width: 46px; height: 46px; max-width: none; margin-right: .75rem; vertical-align: middle; }
.inline-logo img[src*="shield-logo"] { width: 34px; height: 34px; }
.dashboard-game-brand img.dashboard-game-logo { width: 58px; height: 58px; }
@media (max-width: 600px) {
    .top-bar .brand img.brand-icon { width: 36px; height: 36px; }
    .dashboard-game-brand img.dashboard-game-logo { width: 44px; height: 44px; }
}

/* Boot screen overrides (final): smaller shield, heading hidden visually but kept for screen readers. */
.boot-screen .boot-emblem img.logo-mark {
    width: clamp(120px, 24vh, 190px) !important;
    height: auto !important;
    max-width: 60vw !important;
}
.boot-screen h1.boot-heading {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Boot and welcome screens (final): shield emblem scaled to the viewport, game name shown, boot heading kept for screen readers only. */
.boot-screen .boot-emblem img.logo-mark,
.welcome-intro .welcome-emblem img.logo-mark {
    width: clamp(120px, 24vh, 190px) !important;
    height: auto !important;
    max-width: 60vw !important;
}
.boot-game-name {
    margin: 0 0 6px;
    text-align: center;
    font-size: clamp(16px, 2.6vw, 26px);
    font-weight: 700;
    letter-spacing: .22em;
    color: #eaf8ff;
}
.boot-screen h1.boot-heading {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.welcome-intro h1.welcome-title {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 0 8px !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
    font-size: clamp(16px, 2.6vw, 26px);
    letter-spacing: .22em;
    color: #eaf8ff;
    text-align: center;
}

/* Game name typography (final): same font and colours as the Command Centre title. */
.boot-game-name {
    font-family: 'Russo One', sans-serif !important;
    font-size: clamp(28px, 4.2vw, 56px) !important;
    font-weight: 700 !important;
    letter-spacing: .05em !important;
    line-height: .98 !important;
    color: #f1fbff !important;
    text-shadow: 0 4px 22px rgba(3, 21, 38, .7) !important;
}
.boot-game-name span {
    color: #4fdcff !important;
    text-shadow: 0 0 30px rgba(37, 206, 255, .46) !important;
}
.welcome-intro h1.welcome-title {
    font-family: 'Russo One', sans-serif !important;
    font-size: clamp(2.4rem, 6.15vw, 5rem) !important;
    font-weight: 700 !important;
    line-height: .98 !important;
    letter-spacing: .05em !important;
    color: #f0fcff !important;
    text-shadow: 0 5px 24px rgba(37, 196, 229, .2) !important;
}
.welcome-intro h1.welcome-title span {
    color: #4fdcff !important;
    text-shadow: 0 0 30px rgba(37, 206, 255, .46) !important;
}
.dashboard-game-brand,
.dashboard-game-brand span {
    font-family: 'Russo One', sans-serif;
}
.dashboard-game-brand strong {
    color: #4fdcff;
}

/* One font for the game name and title on every screen. */
#dashboard-heading,
#dashboard-heading > span,
.lobby-welcome h1,
.lobby-welcome h1 span,
.boot-game-name,
.welcome-intro h1.welcome-title,
.welcome-intro h1.welcome-title span,
.dashboard-game-brand,
.dashboard-game-brand span,
.dashboard-game-brand strong {
    font-family: 'Russo One', sans-serif !important;
}

/* =========================================================
   COMMAND CENTRE POLISH (round: real screens, lights, play button)
   ========================================================= */

/* Ceiling light strips: evenly spaced across the room */
.ref-ceiling i { top: 45px; width: 150px; left: auto; right: auto; transform: translateX(-50%) skewX(-18deg); }
.ref-ceiling i:nth-child(1) { left: 12.5% !important; }
.ref-ceiling i:nth-child(2) { left: 37.5% !important; }
.ref-ceiling i:nth-child(3) { left: 62.5% !important; }
.ref-ceiling i:nth-child(4) { left: 87.5% !important; }

/* Real-looking terminal output on the monitors */
.ref-screen {
    position: absolute;
    left: 9px;
    right: 9px;
    top: 28px;
    bottom: 8px;
    margin: 0;
    overflow: hidden;
    color: #7fd6ea;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 8.5px;
    line-height: 1.45;
    white-space: pre;
    text-shadow: 0 0 6px rgba(80, 200, 235, .45);
}
.ref-monitor-centre .ref-screen,
.ref-monitor-right .ref-screen { font-size: 9.5px; }
.ref-monitor-aux .ref-screen { font-size: 8px; }

.ref-live-time {
    position: absolute;
    z-index: 4;
    top: 8px;
    right: 9px;
    color: #9fe7f7;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 8px;
    letter-spacing: .04em;
    white-space: nowrap;
}

/* Operator chair tag */
.ref-chair-tag {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 36px;
    transform: translateX(-50%) rotate(-4deg);
    padding: 2px 8px;
    border: 1px solid rgba(255, 196, 77, .7);
    border-radius: 3px;
    background: rgba(40, 24, 4, .82);
    color: #ffd37a;
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    white-space: nowrap;
    box-shadow: 0 0 12px rgba(255, 180, 60, .35);
    pointer-events: none;
}

/* Play button: sidebar-style bordered button with icon box, glow and shine */
.lobby-play-button {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    padding: .7rem .9rem .7rem 1.1rem;
    border: 1px solid rgba(56, 217, 255, .55) !important;
    border-radius: 5px 10px 5px 10px !important;
    background: linear-gradient(90deg, rgba(56, 217, 255, .16), rgba(56, 217, 255, .04)) !important;
    color: #eaf9ff !important;
    font-family: 'Orbitron', sans-serif !important;
    font-size: .95rem !important;
    font-weight: 700;
    letter-spacing: .18em;
    box-shadow: 0 0 18px rgba(56, 217, 255, .22), inset 0 0 14px rgba(56, 217, 255, .08);
    transition: box-shadow .25s ease, border-color .25s ease, transform .2s ease;
}
.lobby-play-button::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .28), transparent);
    transform: skewX(-20deg);
    animation: play-shine 3.6s ease-in-out infinite;
    pointer-events: none;
}
.lobby-play-button:hover,
.lobby-play-button:focus-visible {
    border-color: #7fe9ff !important;
    box-shadow: 0 0 28px rgba(56, 217, 255, .5), inset 0 0 18px rgba(56, 217, 255, .14);
    transform: translateY(-1px);
}
.lobby-play-button .dashboard-mission-action-arrow {
    display: inline-grid;
    place-items: center;
    width: 2.1rem;
    height: 2.1rem;
    border: 1px solid rgba(56, 217, 255, .6);
    border-radius: 3px;
    background: rgba(56, 217, 255, .12);
    color: #7fe9ff;
    font-size: 1.1rem;
    animation: play-arrow-nudge 1.6s ease-in-out infinite;
}
@keyframes play-shine {
    0%, 55% { left: -60%; }
    100% { left: 120%; }
}
@keyframes play-arrow-nudge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

/* Sidebar options: calmer brightness */
.dashboard-nav-item { color: #7d93a8 !important; }
.dashboard-nav-item > span { color: #4f9fb8 !important; opacity: .85; }
.dashboard-nav-item.active { color: #c4d6e6 !important; border-color: rgba(56, 217, 255, .14) !important; background: rgba(56, 217, 255, .05) !important; }

@media (prefers-reduced-motion: reduce) {
    .lobby-play-button::after,
    .lobby-play-button .dashboard-mission-action-arrow { animation: none !important; }
}
body.app-reduced-motion .lobby-play-button::after,
body.app-reduced-motion .lobby-play-button .dashboard-mission-action-arrow { animation: none !important; }

/* Layout fix: aux screens sit above the main monitor row, no overlaps */
.ref-monitor-aux { width: 150px; height: 98px; bottom: 232px; }
.ref-monitor-aux-left { left: 52px; right: auto; transform: none; }
.ref-monitor-aux-right { right: 52px; left: auto; transform: none; }
.ref-monitor-left .ref-screen { bottom: 24px; }
.ref-monitor-left .ref-live-time { top: auto; bottom: 6px; right: 9px; }
.ref-chair-tag { top: 150px; }

/* Hide leftover decorative bars inside the aux screens; real text replaces them */
.ref-monitor-aux > i { display: none; }
.ref-monitor-left .ref-screen { line-height: 1.3; bottom: 26px; }
.dashboard-nav-item { color: #6f8799 !important; }

/* Aux screens: drop the decorative stripe that cut through the text */
.ref-monitor-aux::after { display: none !important; }

/* Live date and time: shown inside the bottom bezel of monitor 01 */
.ref-monitor-left .ref-screen { bottom: 16px; }
.ref-monitor-left .ref-live-time { top: auto; bottom: 3px; right: 8px; font-size: 7px; color: #7fd6ea; }

/* Terminal tabs on the monitors */
.ref-tabs {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 6px;
    display: flex;
    gap: 3px;
    overflow: hidden;
    z-index: 3;
}
.ref-tabs span {
    padding: 0 4px;
    border: 1px solid rgba(92, 196, 229, .25);
    border-radius: 2px;
    color: #5f8fa3;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 7px;
    line-height: 12px;
    white-space: nowrap;
}
.ref-tabs span.on {
    border-color: rgba(127, 233, 255, .7);
    background: rgba(56, 217, 255, .14);
    color: #d6f8ff;
}
.ref-screen .ref-out {
    position: absolute;
    left: 9px;
    right: 9px;
    top: 24px;
    bottom: 8px;
    margin: 0;
    overflow: hidden;
    color: #7fd6ea;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 8.5px;
    line-height: 1.4;
    white-space: pre;
    text-shadow: 0 0 6px rgba(80, 200, 235, .45);
}
.ref-monitor-centre .ref-out,
.ref-monitor-right .ref-out { font-size: 9.5px; }
.ref-monitor-aux .ref-out { font-size: 8px; }
.ref-monitor-left .ref-out { bottom: 16px; }

/* Background globe: slow, subtle drift so it reads as turning */
.globe-spin { animation: globe-drift 26s ease-in-out infinite alternate; }
@keyframes globe-drift {
    from { transform: translateX(-28px); }
    to { transform: translateX(28px); }
}
@media (prefers-reduced-motion: reduce) {
    .globe-spin { animation: none; }
}
body.app-reduced-motion .globe-spin { animation: none; }

/* IT DUDE chair tag: playful rounded font, white text on cyan badge */
.ref-chair-tag {
    border: 1px solid rgba(127, 233, 255, .85);
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(56, 217, 255, .9), rgba(20, 120, 170, .9));
    color: #04131f;
    font-family: 'Fredoka', 'Trebuchet MS', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    box-shadow: 0 0 14px rgba(56, 217, 255, .5);
    transform: translateX(-50%) rotate(-5deg);
}

/* Play button + sidebar buttons: cyan badge styling to match the IT DUDE tag */
.lobby-play-button {
    background: linear-gradient(90deg, rgba(56, 217, 255, .95), rgba(20, 120, 170, .95)) !important;
    color: #04131f !important;
    border-color: rgba(127, 233, 255, .9) !important;
    box-shadow: 0 0 22px rgba(56, 217, 255, .45), inset 0 0 14px rgba(255, 255, 255, .18) !important;
}
.lobby-play-button:hover,
.lobby-play-button:focus-visible {
    box-shadow: 0 0 34px rgba(56, 217, 255, .75), inset 0 0 18px rgba(255, 255, 255, .24) !important;
}
.lobby-play-button .dashboard-mission-action-arrow {
    border-color: rgba(4, 19, 31, .55);
    background: rgba(4, 19, 31, .14);
    color: #04131f;
}
.lobby-play-button::after {
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
}

.dashboard-nav-item {
    background: linear-gradient(90deg, rgba(20, 120, 170, .28), rgba(4, 19, 37, .4)) !important;
    border: 1px solid rgba(56, 217, 255, .22) !important;
    border-left: 3px solid rgba(127, 233, 255, .75) !important;
    box-shadow: inset 0 0 12px rgba(56, 217, 255, .06);
    transition: box-shadow .25s ease, border-color .25s ease, color .25s ease;
}
.dashboard-nav-item:hover:not(:disabled) {
    border-color: rgba(127, 233, 255, .6) !important;
    box-shadow: 0 0 18px rgba(56, 217, 255, .3), inset 0 0 12px rgba(56, 217, 255, .12);
    color: #e6fbff !important;
}
.dashboard-nav-item.active {
    background: linear-gradient(90deg, rgba(56, 217, 255, .9), rgba(20, 120, 170, .9)) !important;
    border-color: rgba(127, 233, 255, .9) !important;
    color: #04131f !important;
    box-shadow: 0 0 22px rgba(56, 217, 255, .45);
}
.dashboard-nav-item.active > span { color: #04131f !important; opacity: 1; }

/* ===== Command Centre fill: radar, particles, shift card, ticker (subtle) ===== */
.ref-radar {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 14%;
    width: 360px;
    height: 360px;
    transform: translateX(-50%);
    pointer-events: none;
}
.ref-radar i { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(92, 196, 229, .14); }
.ref-radar i:nth-child(2) { inset: 18%; border-style: dashed; border-color: rgba(92, 196, 229, .1); }
.ref-radar::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(56, 217, 255, 0) 0deg, rgba(56, 217, 255, .16) 40deg, rgba(56, 217, 255, 0) 60deg);
    animation: radar-sweep 9s linear infinite;
}
@keyframes radar-sweep { to { transform: rotate(360deg); } }

.ref-particles { position: absolute; z-index: 2; inset: 0; pointer-events: none; overflow: hidden; }
.ref-particles span {
    position: absolute;
    bottom: -20px;
    color: rgba(127, 233, 255, .35);
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    animation-name: particle-rise;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}
@keyframes particle-rise {
    0% { transform: translateY(0); opacity: 0; }
    15% { opacity: .9; }
    85% { opacity: .6; }
    100% { transform: translateY(-110vh); opacity: 0; }
}

.ref-shift-card {
    position: absolute;
    z-index: 6;
    right: 3%;
    top: 24%;
    width: 170px;
    padding: 12px 14px;
    border: 1px solid rgba(127, 233, 255, .4);
    border-radius: 5px 12px 5px 12px;
    background: linear-gradient(160deg, rgba(10, 40, 62, .82), rgba(4, 14, 26, .86));
    box-shadow: 0 0 18px rgba(56, 217, 255, .15);
    color: #cfeffa;
    font-family: 'Orbitron', sans-serif;
    pointer-events: none;
}
.ref-shift-label { display: block; font-size: 9px; letter-spacing: .18em; color: #7fe9ff; }
.ref-shift-card strong { display: block; margin: 4px 0 2px; font-size: 20px; letter-spacing: .06em; color: #fff; }
.ref-shift-date { display: block; font-family: 'Consolas', monospace; font-size: 10px; color: #8fb8c9; }
.ref-shift-card ul { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px solid rgba(127, 233, 255, .2); }
.ref-shift-card li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; font-size: 9px; letter-spacing: .08em; }
.ref-shift-card li span { color: #7d98a8; }
.ref-shift-card li b { color: #7fe9ff; font-weight: 700; }

.ref-ticker {
    position: absolute;
    z-index: 8;
    left: 0;
    right: 0;
    bottom: 0;
    height: 22px;
    overflow: hidden;
    border-top: 1px solid rgba(127, 233, 255, .18);
    background: rgba(3, 12, 22, .7);
    pointer-events: none;
}
.ref-ticker span {
    position: absolute;
    top: 4px;
    left: 0;
    white-space: nowrap;
    color: #6fd3ea;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 11px;
    letter-spacing: .08em;
    animation: ticker-scroll 38s linear infinite;
}
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ref-ticker span { padding-right: 0; }

@media (max-width: 900px) {
    .ref-shift-card, .ref-radar { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .ref-radar::before, .ref-ticker span, .ref-particles span { animation: none !important; }
    .ref-ticker span { transform: none; }
}
body.app-reduced-motion .ref-radar::before, body.app-reduced-motion .ref-ticker span, body.app-reduced-motion .ref-particles span { animation: none !important; }

/* Round 2 fixes: operator sits lower so the centre monitor reads, press feedback, clock moved to shift card */
.ref-operator { bottom: 34px; }
.ref-monitor-left .ref-live-time { display: none; }
.lobby-play-button:active { transform: scale(.98); }

/* Radar: drop its own rings (they doubled up with the globe outline); keep a faint sweep only */
.ref-radar i { display: none; }
.ref-radar::before { background: conic-gradient(from 0deg, rgba(56, 217, 255, 0) 0deg, rgba(56, 217, 255, .08) 40deg, rgba(56, 217, 255, 0) 60deg); }

/* ===== Main game panel cleanup ===== */
/* Decorative HUD panels: keep them, but quieter */
.hud-left,
.hud-right { opacity: .32 !important; filter: saturate(.6); transition: opacity .3s ease; }
.hud-left:hover,
.hud-right:hover { opacity: .6 !important; }

/* Level 1-10 small boxes removed from gameplay (top header already shows level) */
#mission-roadmap,
.mission-tracker .compact-roadmap { display: none !important; }

/* Game-adaptive scrollbars (cyan thumb, dark track) instead of the default white bar */
.game-layout *,
.game-container,
.game-container * {
    scrollbar-width: thin;
    scrollbar-color: rgba(56, 217, 255, .6) rgba(4, 14, 26, .7);
}
.game-layout *::-webkit-scrollbar,
.game-container::-webkit-scrollbar,
.game-container *::-webkit-scrollbar { width: 8px; height: 8px; }
.game-layout *::-webkit-scrollbar-track,
.game-container::-webkit-scrollbar-track,
.game-container *::-webkit-scrollbar-track { background: rgba(4, 14, 26, .7); border-left: 1px solid rgba(56, 217, 255, .12); }
.game-layout *::-webkit-scrollbar-thumb,
.game-container::-webkit-scrollbar-thumb,
.game-container *::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #38d9ff, #1a7fb0);
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(56, 217, 255, .5);
}
.game-layout *::-webkit-scrollbar-button,
.game-container::-webkit-scrollbar-button,
.game-container *::-webkit-scrollbar-button { display: none; }

/* Next Question button: centre the label and arrow on one line */
#next-btn:not([style*="none"]) {
    display: flex;
}
#next-btn {
    align-items: center;
    justify-content: center;
    gap: .6rem;
    line-height: 1;
}
#next-btn::before,
#next-btn::after { content: none !important; }

/* Mission screen: fill the panel height so the answers sit centred and the footer stays at the bottom */
.game-container { display: flex; flex-direction: column; }
#mission-screen { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
#mission-screen > .answer-list,
#mission-screen .answer-list { flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center; }
#mission-screen .mission-footer { margin-top: auto; }
#mission-screen #next-btn { margin-top: 12px; }

/* Options fill the vertical space; footer stays pinned to the bottom of the panel */
#mission-screen .answer-list { flex: 1 1 auto; justify-content: space-evenly; gap: 14px; }
#mission-screen .answer-btn { flex: 0 0 auto; }
#mission-screen .question-area { flex: 0 0 auto; }
#mission-screen > .feedback,
#mission-screen > .clearance-status,
#mission-screen > .danger-alert { flex: 0 0 auto; }
#mission-screen .mission-footer { flex: 0 0 auto; margin-top: 10px; }

/* Options grouped under the question; taller buttons instead of wide spacing; footer stays at the bottom */
#mission-screen .answer-list { justify-content: flex-start; gap: 14px; margin-top: 10px; }
#mission-screen .answer-btn { min-height: 84px; }
#mission-screen .mission-footer { margin-top: auto; }

/* Compact gameplay: options sit right under the question, no stretched gap; panel ends after the footer */
.game-container { align-self: start; }
#mission-screen .answer-list { justify-content: flex-start; gap: 10px; margin-top: 8px; }
#mission-screen .answer-btn { min-height: 0; }
#mission-screen .mission-footer { margin-top: 18px; }
#mission-screen { flex: 0 0 auto; }
.game-container { height: auto !important; min-height: 0 !important; }

/* Uniform gameplay font: the whole mission panel text uses Orbitron (monospace labels stay as they are) */
#mission-screen,
#mission-screen .answer-btn,
#mission-screen .option-text,
#mission-screen .incident-panel p,
#mission-screen #mission-description,
#mission-screen #mission-question,
#mission-screen #mission-topic,
#mission-screen #mission-title,
#mission-screen .mission-pause-label {
    font-family: 'Orbitron', sans-serif !important;
}
#mission-screen .option-text { font-weight: 600; }

/* ===== Incident visual stage: one 3D-style device per question ===== */
.iv-stage {
    position: relative;
    height: 200px;
    perspective: 700px;
    border-radius: 6px;
    overflow: hidden;
    background: radial-gradient(ellipse at 50% 80%, rgba(56, 217, 255, .12), transparent 70%), rgba(3, 12, 22, .6);
}
.iv-grid {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(90deg, rgba(56, 217, 255, .07) 0 1px, transparent 1px 22px),
        repeating-linear-gradient(0deg, rgba(56, 217, 255, .07) 0 1px, transparent 1px 22px);
    transform: rotateX(58deg) translateY(-30%);
    transform-origin: bottom;
    animation: iv-grid-scroll 6s linear infinite;
}
@keyframes iv-grid-scroll { from { background-position: 0 0; } to { background-position: 0 22px; } }
.iv-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 150px;
    height: 150px;
    margin: -75px 0 0 -75px;
    border-radius: 50%;
    border: 1px dashed rgba(56, 217, 255, .3);
    animation: iv-spin 14s linear infinite;
}
@keyframes iv-spin { to { transform: rotate(360deg); } }
.iv-device {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 200px;
    height: 140px;
    margin: -70px 0 0 -100px;
    transform-style: preserve-3d;
    animation: iv-float 5s ease-in-out infinite;
}
.iv-device svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .55)) drop-shadow(0 0 10px rgba(56, 217, 255, .25));
}
@keyframes iv-float {
    0%, 100% { transform: rotateX(8deg) rotateY(-14deg) translateY(0); }
    50% { transform: rotateX(8deg) rotateY(14deg) translateY(-6px); }
}
.iv-body { fill: #0c2236; stroke: #4fd0ef; stroke-width: 1.6; }
.iv-screen { fill: #071a2c; stroke: #7fe9ff; stroke-width: 1.2; animation: iv-screen-glow 2.4s ease-in-out infinite; }
.iv-paper { fill: #d9f5ff; stroke: #4fd0ef; stroke-width: 1.2; }
.iv-band { fill: none; stroke: #4fd0ef; stroke-width: 4; stroke-linecap: round; }
.iv-line { fill: none; stroke: #7fe9ff; stroke-width: 2; stroke-linecap: round; opacity: .7; }
.iv-wave { fill: none; stroke: #7fe9ff; stroke-width: 2; stroke-linecap: round; animation: iv-wave 1.6s ease-out infinite; }
.iv-keys rect { fill: #123a55; stroke: #4fd0ef; stroke-width: 1; }
.iv-ports rect { fill: #071a2c; stroke: #4fd0ef; stroke-width: 1; }
.iv-led { fill: #ff4d6d; animation: iv-blink 1.2s steps(2, start) infinite; }
.iv-scan { stroke: #7fe9ff; stroke-width: 2; animation: iv-scan 2.2s ease-in-out infinite; }
@keyframes iv-screen-glow { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }
@keyframes iv-blink { to { opacity: .2; } }
@keyframes iv-wave { 0% { opacity: 0; transform: scale(.85); } 40% { opacity: 1; } 100% { opacity: 0; transform: scale(1.1); } }
@keyframes iv-scan { 0%, 100% { transform: translateY(-14px); } 50% { transform: translateY(14px); } }
.iv-badge {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    padding: 4px 12px;
    border: 1px solid rgba(255, 77, 109, .75);
    border-radius: 999px;
    background: rgba(40, 6, 16, .85);
    color: #ff7d93;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .1em;
    white-space: nowrap;
    box-shadow: 0 0 12px rgba(255, 77, 109, .35);
    animation: iv-badge-pulse 2s ease-in-out infinite;
}
@keyframes iv-badge-pulse { 50% { box-shadow: 0 0 20px rgba(255, 77, 109, .6); } }
.iv-tag {
    position: absolute;
    left: 10px;
    top: 8px;
    color: #7fe9ff;
    font-family: monospace;
    font-size: 10px;
    letter-spacing: .12em;
}
@media (prefers-reduced-motion: reduce) {
    .iv-grid, .iv-ring, .iv-device, .iv-screen, .iv-wave, .iv-led, .iv-scan, .iv-badge { animation: none !important; }
}
body.app-reduced-motion .iv-grid, body.app-reduced-motion .iv-ring, body.app-reduced-motion .iv-device, body.app-reduced-motion .iv-screen, body.app-reduced-motion .iv-wave, body.app-reduced-motion .iv-led, body.app-reduced-motion .iv-scan, body.app-reduced-motion .iv-badge { animation: none !important; }

/* Short landscape viewports prioritize the mission console and keep it scrollable. */
@media (orientation: landscape) and (max-width: 1100px) and (max-height: 600px) {
    body[data-active-screen="game-entry"],
    body[data-active-screen="roadmap"],
    body[data-active-screen="gameplay"],
    body[data-active-screen="results"] {
        height: 100dvh;
        min-height: 0;
        padding: 65px 10px 8px;
        overflow: hidden;
    }

    body[data-active-screen="game-entry"] .game-layout,
    body[data-active-screen="roadmap"] .game-layout,
    body[data-active-screen="gameplay"] .game-layout,
    body[data-active-screen="results"] .game-layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        grid-template-areas: "game";
        gap: 0;
        width: 100%;
        height: 100%;
        min-height: 0;
        margin: 0;
    }

    body[data-active-screen="game-entry"] .panel-column,
    body[data-active-screen="roadmap"] .panel-column,
    body[data-active-screen="gameplay"] .panel-column,
    body[data-active-screen="results"] .panel-column,
    body[data-active-screen="game-entry"] .footer-status,
    body[data-active-screen="roadmap"] .footer-status,
    body[data-active-screen="gameplay"] .footer-status,
    body[data-active-screen="results"] .footer-status {
        display: none;
    }

    body[data-active-screen="game-entry"] .game-container,
    body[data-active-screen="roadmap"] .game-container,
    body[data-active-screen="gameplay"] .game-container,
    body[data-active-screen="results"] .game-container {
        align-self: stretch;
        width: 100%;
        max-width: none;
        max-height: 100%;
        height: 100% !important;
        min-height: 0;
        padding: 8px clamp(12px, 2vw, 20px);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    body[data-active-screen="game-entry"] .game-container:has(#welcome-screen[style*="display: block"]),
    body[data-active-screen="roadmap"] .game-container:has(#level-screen[style*="display: block"]),
    body[data-active-screen="gameplay"] .game-container:has(#mission-screen[style*="display: block"]),
    body[data-active-screen="results"] .game-container:has(#result-screen[style*="display: block"]) {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    body[data-active-screen="gameplay"] .game-container:has(#mission-screen[style*="display: block"]) .console-bottom {
        display: none;
    }

    body[data-active-screen="gameplay"] #mission-screen {
        flex: 0 0 auto;
        padding-top: 4px;
    }

    body[data-active-screen="gameplay"] #mission-screen .mission-tracker {
        margin-bottom: 5px;
    }

    body[data-active-screen="gameplay"] #mission-screen .incident-panel {
        padding: .5rem .65rem;
    }

    body[data-active-screen="gameplay"] #mission-screen .question-area {
        margin: 6px 0;
    }

    body[data-active-screen="gameplay"] #mission-screen .answer-list {
        gap: 6px;
        margin-top: 6px;
    }

    body[data-active-screen="gameplay"] #mission-screen .answer-btn {
        min-height: 42px;
        padding: .4rem .6rem;
    }
}

/* Keep console corner accents attached to the frame, not the scrolling content. */
.game-container {
    background-image:
        linear-gradient(var(--cyan), var(--cyan)),
        linear-gradient(var(--cyan), var(--cyan)),
        linear-gradient(var(--cyan), var(--cyan)),
        linear-gradient(var(--cyan), var(--cyan));
    background-position: left top, left top, right bottom, right bottom;
    background-size: 28px 2px, 2px 28px, 28px 2px, 2px 28px;
    background-repeat: no-repeat;
    background-origin: border-box;
    background-attachment: scroll;
}

.game-container::before,
.game-container::after {
    content: none;
}

/* Incident visual: smaller, lighter stage */
.iv-stage { height: 150px; }
.iv-device { width: 150px; height: 105px; margin: -52px 0 0 -75px; }
.iv-ring { width: 112px; height: 112px; margin: -56px 0 0 -56px; }
.iv-badge { bottom: 8px; font-size: 9px; padding: 3px 9px; }
.iv-tag { font-size: 9px; top: 6px; left: 8px; }

/* Welcome page: small product credit under the game title, with one-time shine */
.welcome-intro .welcome-product {
    position: relative;
    display: block;
    width: fit-content;
    margin: .9rem auto 0;
    overflow: hidden;
    color: #ffffff;
    font-family: 'Russo One', sans-serif !important;
    font-size: .78rem;
    font-weight: 400;
    letter-spacing: .3em;
    text-align: center;
    white-space: nowrap;
}
.welcome-intro .welcome-product span {
    color: #38d9ff;
    text-shadow: 0 0 10px rgba(56, 217, 255, .55);
}
.welcome-intro .welcome-product::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -60%;
    width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent);
    transform: skewX(-20deg);
    animation: product-shine-once 1.6s ease-in-out .5s 1 both;
    pointer-events: none;
}
@keyframes product-shine-once {
    0% { left: -60%; }
    100% { left: 120%; }
}
@media (prefers-reduced-motion: reduce) {
    .welcome-intro .welcome-product::after { animation: none; display: none; }
}
body.app-reduced-motion .welcome-intro .welcome-product::after { animation: none; display: none; }

@media (min-width: 761px) {
    .dashboard-content.dashboard-lobby .lobby-welcome {
        top: clamp(60px, 8vh, 84px) !important;
    }

    .ref-monitor-aux {
        bottom: 212px;
    }
}

@media (min-width: 431px) and (max-width: 760px) {
    .dashboard-content.dashboard-lobby .lobby-welcome {
        top: clamp(50px, 8vh, 68px) !important;
    }

    .ref-monitor-aux {
        bottom: 212px;
    }
}

body[data-active-screen="levels"] .dashboard-header .dashboard-game-brand,
body[data-active-screen="statistics"] .dashboard-header .dashboard-game-brand,
body[data-active-screen="achievements"] .dashboard-header .dashboard-game-brand,
body[data-active-screen="settings"] .dashboard-header .dashboard-game-brand,
body[data-active-screen="profile"] .dashboard-header .dashboard-game-brand {
    display: flex !important;
}

body[data-active-screen="levels"] #levels-screen,
body[data-active-screen="statistics"] #statistics-screen,
body[data-active-screen="achievements"] #achievements-screen,
body[data-active-screen="settings"] #settings-screen,
body[data-active-screen="profile"] #profile-screen {
    padding-top: clamp(7rem, 14vh, 8rem);
}

@media (min-width: 761px) and (max-width: 1100px) {
    .dashboard-content.dashboard-lobby .lobby-welcome {
        top: clamp(112px, 14vh, 132px) !important;
    }
}

.dashboard-profile-trigger,
.dashboard-profile-trigger:hover,
.dashboard-profile-trigger[aria-expanded="true"] {
    background: transparent !important;
    box-shadow: none;
    backdrop-filter: none;
}
