:root {
    color-scheme: dark;
    --ink: #f5fbff;
    --muted: #a9bdd0;
    --surface: rgba(8, 18, 32, 0.92);
    --surface-strong: #091522;
    --surface-soft: rgba(13, 31, 51, 0.82);
    --line: rgba(149, 210, 255, 0.2);
    --accent: #53f4eb;
    --accent-rgb: 83, 244, 235;
    --accent-2: #ffc45c;
    --success: #76f5a7;
    --danger: #ff7d91;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --stage-image: none;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: #050b13;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 0%, rgba(var(--accent-rgb), 0.14), transparent 32rem),
        radial-gradient(circle at 100% 25%, rgba(84, 108, 255, 0.12), transparent 34rem),
        linear-gradient(145deg, #050b13 0%, #081421 55%, #060c15 100%);
}

button,
textarea,
input {
    font: inherit;
}

button {
    min-height: 44px;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 3px solid var(--accent-2);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100;
    padding: 10px 14px;
    color: #06131e;
    background: var(--accent-2);
    border-radius: 10px;
    font-weight: 800;
    transform: translateY(-160%);
    transition: transform 160ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.prototype-app,
.app-shell {
    width: min(1540px, 100%);
    margin: 0 auto;
    padding: clamp(16px, 2.4vw, 34px);
}

.prototype-header,
.finale-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.agent-mark {
    display: grid;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    place-items: center;
    color: #06131e;
    background: linear-gradient(145deg, var(--accent), #8bfff8);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    box-shadow: 0 0 34px rgba(var(--accent-rgb), 0.28);
    font-weight: 950;
    letter-spacing: -0.04em;
}

.eyebrow {
    margin: 0 0 3px;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.prototype-header h1,
.finale-header h1 {
    overflow: hidden;
    margin: 0;
    font-size: clamp(1.25rem, 2.25vw, 2rem);
    line-height: 1.08;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-actions,
.controls,
.button-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.prototype-badge,
.concept-chip,
.chip {
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    color: #d9f8ff;
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.prototype-badge::before,
.chip.live::before {
    width: 7px;
    height: 7px;
    content: "";
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--accent);
}

.workspace,
.finale-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.52fr) minmax(330px, 0.72fr);
    gap: clamp(16px, 2vw, 26px);
    align-items: start;
}

.stage-column,
.authoring-column {
    display: grid;
    min-width: 0;
    gap: 16px;
}

.glass-card,
.stage-card,
.editor-card,
.console-card,
.briefing-card,
.check-card {
    overflow: hidden;
    background: linear-gradient(155deg, rgba(14, 31, 49, 0.96), rgba(7, 16, 28, 0.96));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(5, 13, 23, 0.56);
    border-bottom: 1px solid var(--line);
}

.card-heading h2,
.card-heading h3 {
    margin: 0;
    font-size: 0.92rem;
    letter-spacing: 0.02em;
}

.game-stage {
    position: relative;
    isolation: isolate;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #071522;
}

.stage-background,
.stage-image {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: #0b1f36;
    background-image: var(--stage-image);
    background-position: center;
    background-size: cover;
    object-fit: cover;
    user-select: none;
}

.stage-overlay,
.stage-vignette {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(3, 10, 18, 0.26), transparent 30%, transparent 66%, rgba(3, 10, 18, 0.62)),
        radial-gradient(ellipse at center, transparent 46%, rgba(1, 7, 14, 0.38) 100%);
}

.turtle-target,
.turtle-layer,
#turtle-stage,
#turtle {
    position: absolute;
    z-index: 3;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: transparent;
}

/* Skulpt legt mehrere gleich grosse Canvas-Schichten an. Absolutes Stapeln
   bewahrt die Transparenz, ohne den von Skulpt gesetzten display-Wert zu ändern. */
.turtle-target canvas,
.turtle-layer canvas,
#turtle-stage canvas,
#turtle canvas {
    position: absolute !important;
    inset: 0 auto auto 0;
    width: 100%;
    height: 100%;
    margin: 0 !important;
    background: transparent !important;
}

.stage-objects,
.stage-svg {
    position: absolute;
    z-index: 2;
    pointer-events: none;
    inset: 0;
    width: 100%;
    height: 100%;
}

.stage-svg .glow,
.stage-objects .glow {
    filter: drop-shadow(0 0 8px var(--accent)) drop-shadow(0 0 18px rgba(var(--accent-rgb), 0.55));
}

.stage-svg .danger-glow {
    filter: drop-shadow(0 0 7px var(--danger));
}

.stage-hud {
    position: absolute;
    z-index: 5;
    display: flex;
    top: clamp(10px, 2vw, 18px);
    right: clamp(10px, 2vw, 18px);
    left: clamp(10px, 2vw, 18px);
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    pointer-events: none;
}

.hud-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hud-card,
.hud-pill {
    min-width: 110px;
    padding: 9px 11px;
    color: var(--ink);
    background: rgba(4, 13, 23, 0.78);
    border: 1px solid rgba(184, 225, 255, 0.24);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(10px);
}

.hud-label {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.hud-value {
    display: block;
    overflow: hidden;
    font-size: 0.9rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hud-value.online,
.status-online {
    color: var(--success);
    text-shadow: 0 0 14px rgba(118, 245, 167, 0.5);
}

.energy-meter,
.progress-track {
    width: min(170px, 22vw);
    height: 8px;
    margin-top: 6px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
}

.energy-fill,
.progress-fill {
    width: var(--value, 66%);
    height: 100%;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
    border-radius: inherit;
    box-shadow: 0 0 14px rgba(var(--accent-rgb), 0.45);
    transition: width 420ms ease;
}

.stage-caption,
.mission-strip {
    position: absolute;
    z-index: 5;
    right: 14px;
    bottom: 14px;
    left: 14px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    pointer-events: none;
}

.stage-caption p,
.mission-strip p {
    max-width: 54ch;
    margin: 0;
    color: #e8f7ff;
    font-size: clamp(0.72rem, 1.25vw, 0.88rem);
    font-weight: 650;
    text-shadow: 0 2px 12px #000;
}

.panel-body,
.briefing-body,
.editor-body,
.console-body {
    padding: 16px;
}

.briefing-card h2,
.briefing-card h3 {
    margin: 0 0 8px;
}

.briefing-card p,
.briefing-card li {
    color: #c2d2df;
    line-height: 1.55;
}

.briefing-card ul,
.briefing-card ol {
    padding-left: 1.35rem;
}

.concept-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.concept-chip {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    border-color: var(--line);
    letter-spacing: 0;
}

.concept-chip.is-active,
.concept-chip.is-complete {
    color: #07141d;
    background: var(--success);
    border-color: transparent;
}

.editor-card textarea {
    width: 100%;
    min-height: 300px;
}

.CodeMirror {
    height: clamp(300px, 39vh, 480px);
    min-height: 280px;
    color: #f4f8fc;
    background: #07111c;
    border: 1px solid rgba(180, 222, 255, 0.16);
    border-radius: 12px;
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: clamp(0.84rem, 1.15vw, 0.98rem);
    line-height: 1.55;
}

.CodeMirror-gutters {
    background: #091723 !important;
    border-right-color: rgba(255, 255, 255, 0.08) !important;
}

.CodeMirror-focused {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.16);
}

.console-output,
#console-output {
    min-height: 116px;
    max-height: 220px;
    overflow: auto;
    margin: 0;
    padding: 14px;
    color: #bfffd8;
    background: #030a10;
    border: 1px solid rgba(133, 255, 180, 0.16);
    border-radius: 12px;
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.86rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.console-output.is-error,
#console-output.is-error {
    color: #ffd0d7;
    border-color: rgba(255, 125, 145, 0.45);
}

.btn,
.control-button,
.primary-button,
.secondary-button,
.icon-button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 15px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(196, 228, 255, 0.22);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 800;
    text-decoration: none;
    transition: transform 150ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.primary-button,
.btn-primary,
.run-button {
    color: #06131e;
    background: linear-gradient(135deg, var(--accent), #a1fff9);
    border-color: transparent;
    box-shadow: 0 8px 26px rgba(var(--accent-rgb), 0.22);
}

.danger-button {
    color: #ffdbe1;
    border-color: rgba(255, 125, 145, 0.36);
}

.btn:hover,
.control-button:hover,
.primary-button:hover,
.secondary-button:hover,
.icon-button:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(var(--accent-rgb), 0.55);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
    transform: translateY(-1px);
}

.primary-button:hover,
.btn-primary:hover,
.run-button:hover {
    color: #06131e;
    background: linear-gradient(135deg, #80fff8, #c6fffb);
}

button:disabled,
.btn[aria-disabled="true"] {
    cursor: wait;
    opacity: 0.52;
    transform: none;
}

.check-list {
    display: grid;
    margin: 0;
    padding: 0;
    gap: 8px;
    list-style: none;
}

.check-item {
    display: flex;
    min-height: 40px;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid transparent;
    border-radius: 10px;
}

.check-item::before {
    display: grid;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    content: "·";
    place-items: center;
    color: var(--muted);
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    font-weight: 900;
}

.check-item.is-passed {
    color: #ddffea;
    background: rgba(118, 245, 167, 0.08);
    border-color: rgba(118, 245, 167, 0.2);
}

.check-item.is-passed::before {
    content: "✓";
    color: #06140d;
    background: var(--success);
    border-color: transparent;
}

.prototype-note {
    margin: 12px 0 0;
    color: #8ea5b9;
    font-size: 0.78rem;
    line-height: 1.5;
}

body.presentation-mode,
body.is-presenting {
    overflow: hidden;
}

.presentation-mode .prototype-app,
.presentation-mode .app-shell,
.is-presenting .prototype-app,
.is-presenting .app-shell {
    width: 100%;
    max-width: none;
    height: 100vh;
    padding: 12px;
}

.presentation-mode .prototype-header,
.presentation-mode .finale-header,
.is-presenting .prototype-header,
.is-presenting .finale-header {
    margin-bottom: 10px;
}

.presentation-mode .workspace,
.presentation-mode .finale-workspace,
.is-presenting .workspace,
.is-presenting .finale-workspace {
    display: block;
}

.presentation-mode .authoring-column,
.presentation-mode .briefing-card,
.presentation-mode .authoring-only,
.is-presenting .authoring-column,
.is-presenting .briefing-card,
.is-presenting .authoring-only {
    display: none !important;
}

.presentation-mode .stage-card,
.is-presenting .stage-card {
    max-width: calc((100vh - 96px) * 16 / 9);
    margin: 0 auto;
}

.presentation-mode .game-stage,
.is-presenting .game-stage {
    max-height: calc(100vh - 96px);
}

@media (max-width: 899px) {
    .prototype-app,
    .app-shell {
        padding: 14px;
    }

    .prototype-header,
    .finale-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
    }

    .header-actions > * {
        flex: 1 1 auto;
    }

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

    .authoring-column {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
    }

    .editor-card {
        grid-column: 1 / -1;
    }

    .CodeMirror {
        height: 340px;
    }
}

@media (max-width: 599px) {
    .prototype-app,
    .app-shell {
        padding: 10px;
    }

    .agent-mark {
        flex-basis: 42px;
        width: 42px;
        height: 42px;
    }

    .prototype-header h1,
    .finale-header h1 {
        font-size: 1.18rem;
        white-space: normal;
    }

    .header-actions,
    .controls,
    .button-row {
        display: grid;
        width: 100%;
        grid-template-columns: 1fr 1fr;
    }

    .header-actions > *,
    .controls > *,
    .button-row > * {
        width: 100%;
    }

    .game-stage {
        min-height: 245px;
        aspect-ratio: 4 / 3;
    }

    .stage-background,
    .stage-image {
        object-position: center;
    }

    .stage-hud {
        align-items: stretch;
        flex-direction: column;
    }

    .hud-group {
        flex-wrap: nowrap;
    }

    .hud-card,
    .hud-pill {
        min-width: 0;
        padding: 7px 9px;
    }

    .energy-meter,
    .progress-track {
        width: min(120px, 32vw);
    }

    .stage-caption,
    .mission-strip {
        right: 9px;
        bottom: 9px;
        left: 9px;
    }

    .stage-caption .concept-chip,
    .mission-strip .concept-chip {
        display: none;
    }

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

    .panel-body,
    .briefing-body,
    .editor-body,
    .console-body {
        padding: 12px;
    }

    .CodeMirror {
        height: 320px;
        min-height: 280px;
        font-size: 0.82rem;
    }

    .presentation-mode .prototype-header .brand-block,
    .presentation-mode .finale-header .brand-block,
    .is-presenting .prototype-header .brand-block,
    .is-presenting .finale-header .brand-block {
        display: none;
    }

    .presentation-mode .game-stage,
    .is-presenting .game-stage {
        height: calc(100vh - 76px);
        min-height: 0;
        max-height: none;
        aspect-ratio: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --------------------------------------------------------------------------
   Markup der zwei unverlinkten Endprototypen
   -------------------------------------------------------------------------- */

.pico-theme {
    --accent: #55f6ff;
    --accent-rgb: 85, 246, 255;
    --accent-2: #ffc667;
}

.museum-theme {
    --accent: #ff78f3;
    --accent-rgb: 255, 120, 243;
    --accent-2: #66ecff;
    --success: #8dffcf;
}

.prototype-page {
    --radius-xl: 34px;
    --radius-lg: 24px;
    --prototype-glass-border: rgba(235, 248, 255, 0.17);
    --prototype-glass-surface: linear-gradient(145deg, rgba(13, 30, 48, 0.78), rgba(5, 14, 25, 0.7));
    --prototype-glass-shadow: inset 0 1px rgba(255, 255, 255, 0.1), 0 24px 70px rgba(0, 0, 0, 0.38);
}

.prototype-page .skip-link {
    z-index: 1300;
}

.prototype-nav-dock {
    position: fixed;
    z-index: 1200;
    top: max(16px, env(safe-area-inset-top));
    left: max(16px, env(safe-area-inset-left));
    display: inline-flex;
    min-height: 54px;
    align-items: center;
    gap: 5px;
    padding: 4px;
    border: 1px solid rgba(235, 248, 255, 0.2);
    border-radius: 19px;
    background: linear-gradient(145deg, rgba(8, 23, 39, 0.76), rgba(4, 12, 23, 0.68));
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.1), 0 14px 38px rgba(0, 0, 0, 0.28);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
    backdrop-filter: blur(18px) saturate(145%);
}

.prototype-home-link,
.prototype-path-token {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
}

.prototype-home-link {
    padding: 5px 10px;
    text-decoration: none;
}

.prototype-home-link:hover {
    background: rgba(255, 255, 255, 0.065);
}

.prototype-home-link img {
    display: block;
    width: 174px;
    height: auto;
}

.prototype-path-token {
    gap: 9px;
    padding: 9px 15px;
    border: 1px solid rgba(235, 248, 255, 0.11);
    background: rgba(255, 255, 255, 0.055);
    box-shadow: none;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 750;
}

.prototype-path-icon {
    color: var(--accent);
    font-size: 1.08rem;
    line-height: 1;
}

.prototype-header,
.prototype-main {
    width: min(1540px, calc(100% - 40px));
    margin-right: auto;
    margin-left: auto;
}

.prototype-header {
    margin-top: calc(max(16px, env(safe-area-inset-top)) + 72px);
    padding: clamp(16px, 2vw, 22px);
    border: 1px solid var(--prototype-glass-border);
    border-top-color: rgba(var(--accent-rgb), 0.31);
    border-radius: 28px;
    background: var(--prototype-glass-surface);
    box-shadow: var(--prototype-glass-shadow);
    -webkit-backdrop-filter: blur(18px) saturate(138%);
    backdrop-filter: blur(18px) saturate(138%);
}

.prototype-header > div:first-child {
    min-width: 0;
}

.prototype-header p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: clamp(0.85rem, 1.3vw, 1rem);
}

.prototype-kicker {
    display: block;
    margin-bottom: 7px;
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.path-badge {
    display: inline-flex;
    flex: 0 0 auto;
    min-height: 40px;
    align-items: center;
    gap: 9px;
    padding: 8px 13px;
    color: #e9fbff;
    background: rgba(var(--accent-rgb), 0.1);
    border: 1px solid rgba(var(--accent-rgb), 0.36);
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.04em;
}

.path-badge-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--accent);
}

.prototype-main {
    padding-bottom: 38px;
}

.prototype-main > .briefing-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
    padding: clamp(16px, 2vw, 24px);
}

.briefing-card h2 {
    margin: 3px 0 7px;
    color: var(--ink);
    font-size: clamp(1.15rem, 2vw, 1.55rem);
}

.briefing-card p {
    max-width: 72ch;
    margin: 0;
}

.concept-strip {
    display: flex;
    flex: 0 1 520px;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.concept-strip li {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 6px 11px;
    color: #dffbff;
    background: rgba(var(--accent-rgb), 0.08);
    border: 1px solid rgba(var(--accent-rgb), 0.27);
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
}

.concept-strip .bonus-chip {
    color: #fff4bf;
    background: rgba(255, 199, 92, 0.08);
    border-color: rgba(255, 199, 92, 0.34);
}

.workspace-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.52fr) minmax(370px, 0.76fr);
    gap: clamp(16px, 2vw, 26px);
    align-items: start;
}

.game-column,
.code-column {
    display: grid;
    min-width: 0;
    gap: 14px;
}

.game-column {
    scroll-margin-block-start: 86px;
}

.section-heading {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.section-heading h2 {
    margin: 2px 0 0;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
}

.autosave-note {
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 700;
    text-align: right;
}

.run-status {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 5px 10px;
    color: #d5e5f0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 850;
}

.run-status::before {
    width: 7px;
    height: 7px;
    margin-right: 7px;
    content: "";
    background: #8192a1;
    border-radius: 50%;
}

.run-status.is-running::before {
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
    animation: hud-pulse 900ms ease-in-out infinite alternate;
}

.run-status.is-success::before { background: var(--success); }
.run-status.is-warning::before { background: var(--accent-2); }
.run-status.is-error::before { background: var(--danger); }

.game-shell,
.editor-card,
.console-card,
.result-panel,
.creative-card {
    overflow: hidden;
    border: 1px solid var(--prototype-glass-border);
    border-top-color: rgba(var(--accent-rgb), 0.31);
    border-radius: var(--radius-lg);
    background: var(--prototype-glass-surface);
    box-shadow: var(--prototype-glass-shadow);
    -webkit-backdrop-filter: blur(18px) saturate(138%);
    backdrop-filter: blur(18px) saturate(138%);
}

.prototype-main > .briefing-card {
    border: 1px solid var(--prototype-glass-border);
    border-top-color: rgba(var(--accent-rgb), 0.31);
    border-radius: var(--radius-xl);
    background: var(--prototype-glass-surface);
    box-shadow: var(--prototype-glass-shadow);
    -webkit-backdrop-filter: blur(18px) saturate(138%);
    backdrop-filter: blur(18px) saturate(138%);
}

.path-badge,
.concept-strip li,
.run-status {
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 10px 30px rgba(0, 0, 0, 0.2);
    -webkit-backdrop-filter: blur(14px) saturate(132%);
    backdrop-filter: blur(14px) saturate(132%);
}

.game-shell {
    padding: 7px;
}

.mobile-target-legend {
    display: none;
    margin: 0;
    padding: 0;
    list-style: none;
}

.game-stage {
    border: 1px solid rgba(210, 237, 255, 0.16);
    border-radius: calc(var(--radius-lg) - 6px);
}

.scene-image {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    user-select: none;
}

.scene-shade {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(2, 8, 16, 0.42), transparent 28%, transparent 69%, rgba(2, 8, 16, 0.58)),
        radial-gradient(ellipse at center, transparent 48%, rgba(1, 5, 12, 0.28) 100%);
}

.alarm-flash {
    position: absolute;
    z-index: 3;
    pointer-events: none;
    inset: 0;
    opacity: 0;
    background:
        linear-gradient(180deg, rgba(255, 30, 58, 0.55), transparent 24%),
        radial-gradient(ellipse at center, transparent 42%, rgba(255, 16, 48, 0.34));
    mix-blend-mode: screen;
}

.alarm-active .alarm-flash,
.alarm-failed .alarm-flash {
    animation: alarm-flash 0.78s ease-in-out infinite alternate;
}

svg.stage-overlay {
    z-index: 2;
    width: 100%;
    height: 100%;
    background: none;
}

.suggested-route {
    fill: none;
    opacity: 0.22;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 3 14;
    animation: route-flow 4s linear infinite;
}

.program-running .suggested-route {
    opacity: 0.08;
}

.program-running .turtle-target canvas {
    filter: drop-shadow(0 0 4px rgba(var(--accent-rgb), 0.9));
}

.target-pulse {
    fill: rgba(var(--accent-rgb), 0.08);
    stroke: var(--accent);
    stroke-width: 2;
    stroke-dasharray: 4 7;
    transform-box: fill-box;
    transform-origin: center;
    animation: target-pulse 1.8s ease-out infinite;
}

.elevator-pulse {
    fill: rgba(255, 198, 103, 0.08);
    stroke: #ffc667;
}

.energy-cell-pulse {
    fill: rgba(119, 248, 255, 0.12);
    stroke: #77f8ff;
}

.pico-energy-cell-graphic {
    opacity: 1;
    transition: opacity 300ms ease, filter 300ms ease;
}

.pico-energy-cell-graphic rect:first-child {
    fill: rgba(9, 42, 62, 0.95);
    stroke: #8bfbff;
    stroke-width: 2;
}

.pico-energy-cell-graphic .energy-cell-cap {
    fill: #d5ffff;
    stroke: #55f6ff;
    stroke-width: 1.5;
}

.pico-energy-cell-graphic path {
    fill: #ffe083;
    stroke: #fff3b7;
    stroke-width: 1;
}

.stage-label {
    position: absolute;
    z-index: 4;
    display: inline-flex;
    min-height: 28px;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    color: #f3fbff;
    background: rgba(3, 11, 21, 0.76);
    border: 1px solid rgba(210, 237, 255, 0.28);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
    font-size: clamp(0.56rem, 1vw, 0.72rem);
    font-weight: 850;
    pointer-events: none;
    backdrop-filter: blur(8px);
}

.elevator-label { top: 38%; left: 3%; }
.pico-cell-label { top: 67%; left: 3%; }
.beacon-label { top: 41%; right: 7%; }
.keycard-label { top: 34%; left: 16%; }
.artifact-label { top: 47%; left: 2%; }
.alarm-console-label { top: 61%; right: 8%; }
.portal-label { top: 22%; left: 50%; transform: translateX(-50%); }

.energy-cell-collected .pico-energy-cell-graphic {
    opacity: 0.22;
    filter: saturate(0.35);
}

.energy-cell-collected .energy-cell-pulse {
    stroke: var(--success);
}

.energy-cell-collected .pico-cell-label {
    color: var(--success);
    border-color: rgba(118, 245, 167, 0.45);
}

.energy-depleted #energy-fill {
    background: linear-gradient(90deg, #ff756b, var(--danger));
    box-shadow: 0 0 12px var(--danger);
}

.museum-scene-recovered {
    opacity: 0;
    transition: opacity 420ms ease;
}

.artifact-secured .museum-scene-recovered {
    opacity: 1;
}

.stage-hud > * {
    min-width: 112px;
    padding: 8px 10px;
    background: rgba(3, 11, 21, 0.76);
    border: 1px solid rgba(210, 237, 255, 0.23);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(10px);
}

.stage-hud small {
    display: block;
    margin-bottom: 3px;
    color: #a8bdcc;
    font-size: 0.56rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.stage-hud strong {
    font-size: clamp(0.68rem, 1.1vw, 0.86rem);
}

.agent-id {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agent-avatar {
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    color: #06131e;
    background: linear-gradient(145deg, var(--accent), #d6ffff);
    border-radius: 9px;
    font-weight: 950;
    box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.35);
}

.meter-block {
    flex: 1 1 180px;
    max-width: 250px;
}

.meter-label {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
    color: #dceef7;
    font-size: 0.68rem;
}

.meter-track {
    height: 7px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

.meter-track span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-2), var(--accent));
    border-radius: inherit;
    box-shadow: 0 0 12px var(--accent);
    transition: width 350ms ease;
}

.signal-block strong,
.exit-block strong {
    color: var(--accent);
}

.pico-result-message {
    position: absolute;
    z-index: 7;
    top: 50%;
    left: 50%;
    max-width: min(82%, 520px);
    padding: 14px 22px;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: clamp(1rem, 2.5vw, 1.7rem);
    font-weight: 950;
    letter-spacing: 0.07em;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.82);
}

.rescue-success .pico-result-message,
.rescue-failed .pico-result-message {
    opacity: 1;
    animation: escape-success 0.46s ease-out both;
}

.rescue-success .pico-result-message {
    color: #062d1a;
    background: rgba(118, 245, 167, 0.96);
    border-color: #d8ffe7;
    box-shadow: 0 0 38px rgba(80, 255, 156, 0.68);
}

.rescue-failed .pico-result-message {
    color: #fff;
    background: rgba(100, 8, 26, 0.94);
    border-color: var(--danger);
    box-shadow: 0 0 38px rgba(255, 82, 102, 0.68);
}

.museum-overlay .laser-grid path {
    fill: none;
    opacity: 0.72;
    stroke: #ff5eea;
    stroke-width: 2.4;
    stroke-linecap: round;
    animation: laser-flicker 1.6s ease-in-out infinite alternate;
}

.museum-overlay .route-nodes circle {
    fill: rgba(var(--accent-rgb), 0.08);
    stroke: var(--accent);
    stroke-width: 2;
    stroke-dasharray: 4 6;
    animation: target-pulse 2s ease-out infinite;
}

.portal-gate {
    opacity: 0;
    transition: opacity 220ms ease;
}

.portal-gate .portal-seal {
    fill: rgba(112, 26, 168, 0.58);
    stroke: #ff78f3;
    stroke-width: 4;
    filter: drop-shadow(0 0 12px #cc4dff);
}

.portal-gate path {
    fill: none;
    stroke: #f39cff;
    stroke-width: 5;
    stroke-linecap: round;
    filter: drop-shadow(0 0 7px #ba32ff);
}

.portal-locked .portal-gate {
    opacity: 1;
    animation: portal-lock-pulse 1.15s ease-in-out infinite alternate;
}

.portal-locked .portal-label,
.portal-locked .exit-block {
    color: #ff9af5;
    border-color: rgba(255, 86, 235, 0.65);
    box-shadow: 0 0 24px rgba(190, 44, 255, 0.34);
}

.portal-open .portal-label,
.portal-open .exit-block {
    color: var(--success);
    border-color: rgba(118, 245, 167, 0.48);
}

.museum-warning {
    position: absolute;
    z-index: 7;
    top: 48%;
    left: 50%;
    padding: 12px 20px;
    color: #fff;
    background: rgba(84, 3, 36, 0.92);
    border: 2px solid #ff78f3;
    border-radius: 12px;
    box-shadow: 0 0 36px rgba(255, 63, 220, 0.72);
    font-size: clamp(1rem, 2.4vw, 1.65rem);
    font-weight: 950;
    letter-spacing: 0.08em;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.8);
}

.portal-trapped .museum-warning {
    opacity: 1;
    animation: trapped-warning 0.42s ease-out both;
}

.museum-success {
    position: absolute;
    z-index: 7;
    top: 48%;
    left: 50%;
    padding: 14px 22px;
    color: #062d1a;
    background: rgba(118, 245, 167, 0.96);
    border: 2px solid #d8ffe7;
    border-radius: 12px;
    box-shadow: 0 0 38px rgba(80, 255, 156, 0.68);
    font-size: clamp(1rem, 2.4vw, 1.65rem);
    font-weight: 950;
    letter-spacing: 0.06em;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.82);
}

.escape-success .museum-success {
    opacity: 1;
    animation: escape-success 0.46s ease-out both;
}

.museum-hud { align-items: stretch; }
.alarm-block,
.exit-block { flex: 0 0 auto; }
.inventory-block { flex: 1 1 240px; max-width: 390px; }

.alarm-dots {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.alarm-dots i {
    width: 12px;
    height: 4px;
    background: rgba(255, 255, 255, 0.17);
    border-radius: 999px;
}

.alarm-dots i.is-active {
    background: var(--danger);
    box-shadow: 0 0 9px var(--danger);
}

.alarm-active .alarm-block {
    border-color: rgba(255, 82, 102, 0.62);
    box-shadow: 0 0 24px rgba(255, 82, 102, 0.25);
}

.alarm-disabled .alarm-console-label {
    color: var(--success);
    border-color: rgba(118, 245, 167, 0.5);
}

.alarm-failed .alarm-block,
.alarm-failed .alarm-console-label {
    color: #fff;
    background: rgba(102, 7, 24, 0.9);
    border-color: var(--danger);
    box-shadow: 0 0 28px rgba(255, 82, 102, 0.45);
}

.artifact-secured .artifact-label {
    color: var(--success);
    border-color: rgba(118, 245, 167, 0.5);
}

.inventory-items {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.inventory-items span {
    padding: 3px 7px;
    color: #f4e7ff;
    background: rgba(var(--accent-rgb), 0.13);
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 800;
}

.result-panel {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(250px, 1.2fr);
    gap: 16px;
    padding: 16px;
}

.result-panel h3 { margin: 3px 0 5px; font-size: 1rem; }
.result-panel p { margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.5; }

.checks-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.checks-list > li {
    display: flex;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 750;
}

.checks-list .check-item { flex-wrap: wrap; }
.checks-list .check-item small { flex-basis: 100%; padding-left: 32px; color: var(--accent-2); font-size: 0.58rem; }
.checks-list .check-item.is-pending { color: var(--ink); border-color: rgba(var(--accent-rgb), 0.28); }

.editor-card { padding: 10px; }
.editor-card .CodeMirror { margin-bottom: 10px; }

.control-bar {
    display: grid;
    grid-template-columns: minmax(170px, 1.35fr) repeat(2, minmax(120px, 1fr));
    gap: 8px;
}

.primary-action,
.secondary-action {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 13px;
    border: 1px solid rgba(196, 228, 255, 0.22);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 850;
    transition: transform 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.primary-action {
    color: #06131e;
    background: linear-gradient(135deg, var(--accent), #c2fffb);
    border-color: transparent;
    box-shadow: 0 8px 24px rgba(var(--accent-rgb), 0.23);
}

.secondary-action { color: var(--ink); background: rgba(255, 255, 255, 0.06); }

.primary-action:hover,
.secondary-action:hover {
    border-color: rgba(var(--accent-rgb), 0.55);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.26);
    transform: translateY(-1px);
}

.primary-action:disabled,
.secondary-action:disabled { cursor: wait; opacity: 0.55; transform: none; }

.button-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(4, 15, 25, 0.28);
    border-top-color: #06131e;
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.console-card { padding: 10px; }

.console-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 4px 9px;
    color: #d7e8f2;
    font-size: 0.72rem;
    font-weight: 850;
}

.console-light {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--success);
}

.creative-card {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 14px;
    color: #dcecf5;
}

.creative-card > span {
    display: grid;
    flex: 0 0 31px;
    width: 31px;
    height: 31px;
    place-items: center;
    color: #06131e;
    background: var(--accent-2);
    border-radius: 9px;
}

.creative-card strong { font-size: 0.82rem; }
.creative-card p { margin: 4px 0 0; color: var(--muted); font-size: 0.74rem; line-height: 1.5; }

.validation-passed .result-panel {
    border-color: rgba(118, 245, 167, 0.4);
    box-shadow: 0 20px 60px rgba(25, 160, 99, 0.15);
}

.mission-complete .beacon-pulse,
.mission-complete .museum-overlay .route-nodes circle:last-child {
    fill: rgba(118, 245, 167, 0.23);
    stroke: var(--success);
}

.presentation-controls {
    position: fixed;
    z-index: 1300;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    display: none;
    align-items: stretch;
    gap: 8px;
    max-width: calc(100vw - 24px);
    padding: 6px;
    border: 1px solid rgba(196, 228, 255, 0.22);
    border-radius: 18px;
    background: #071522;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.38);
}

.presentation-controls button {
    min-height: 44px;
    min-width: 0;
    padding: 10px 14px;
    border-radius: 12px;
    cursor: pointer;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 900;
}

.exit-presentation {
    display: none;
    color: var(--ink);
    background: #0a1b2a;
    border: 1px solid rgba(196, 228, 255, 0.22);
}

.presentation-mode .presentation-controls,
.presentation-controls .exit-presentation {
    display: flex;
    align-items: center;
    justify-content: center;
}

.presentation-mode .prototype-header,
.presentation-mode .prototype-nav-dock,
.presentation-mode .progress-container,
.presentation-mode .prototype-main > .briefing-card,
.presentation-mode .code-column,
.presentation-mode .result-panel,
.presentation-mode .game-column > .section-heading { display: none !important; }

.presentation-mode {
    --presentation-top-space: max(84px, calc(env(safe-area-inset-top) + 72px));
    --presentation-bottom-space: max(12px, env(safe-area-inset-bottom));
    --presentation-stage-height: calc(100dvh - var(--presentation-top-space) - var(--presentation-bottom-space) - 16px);
}

.presentation-mode .prototype-main,
body.presentation-mode #main-content.prototype-main {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
    padding: var(--presentation-top-space) 12px var(--presentation-bottom-space);
}

.presentation-mode .workspace-grid { display: block; height: 100%; }
.presentation-mode .game-column,
.presentation-mode .game-shell { display: block; height: auto; }

.presentation-mode .game-shell {
    width: min(100%, calc(var(--presentation-stage-height) * 16 / 9 + 16px));
    margin: 0 auto;
    padding: 7px;
}

.presentation-mode .game-stage {
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: 16 / 9;
}

@media (max-width: 640px) {
    .presentation-mode .learning-nav-dock {
        display: none;
    }
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    clip-path: inset(50%) !important;
}

@keyframes route-flow { to { stroke-dashoffset: -68; } }
@keyframes target-pulse {
    0% { opacity: 0.72; transform: scale(0.78); }
    75%, 100% { opacity: 0; transform: scale(1.28); }
}
@keyframes laser-flicker { from { opacity: 0.42; } to { opacity: 0.9; } }
@keyframes alarm-flash { from { opacity: 0.08; } to { opacity: 0.68; } }
@keyframes portal-lock-pulse { from { opacity: 0.62; } to { opacity: 1; } }
@keyframes trapped-warning {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    55% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes escape-success {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.72); }
    70% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes hud-pulse { from { opacity: 0.55; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
    .workspace-grid { grid-template-columns: minmax(0, 1fr); }
    .code-column { grid-template-columns: minmax(0, 1fr) minmax(260px, 0.48fr); align-items: start; }
    .code-column > .section-heading,
    .code-column > .editor-card,
    .code-column > .creative-card { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .prototype-nav-dock {
        top: max(12px, env(safe-area-inset-top));
        left: max(12px, env(safe-area-inset-left));
    }
    .prototype-home-link { padding-inline: 4px; }
    .prototype-home-link img { width: 108px; }
    .prototype-path-token { padding-inline: 11px; }
    .prototype-header,
    .prototype-main { width: min(100% - 24px, 1540px); }
    .prototype-header { align-items: flex-start; flex-direction: column; }
    .prototype-header h1 { overflow: visible; white-space: normal; }
    .prototype-main > .briefing-card { align-items: flex-start; flex-direction: column; }
    .concept-strip { flex: none; justify-content: flex-start; }
    .code-column,
    .result-panel { grid-template-columns: minmax(0, 1fr); }
    .code-column > * { grid-column: 1; }
    .control-bar { grid-template-columns: 1fr 1fr; }
    .control-bar .primary-action { grid-column: 1 / -1; }
    .CodeMirror { height: clamp(320px, 52vh, 430px); }
    .prototype-header,
    .prototype-main > .briefing-card,
    .game-shell,
    .editor-card,
    .console-card,
    .result-panel,
    .creative-card {
        -webkit-backdrop-filter: blur(14px) saturate(128%);
        backdrop-filter: blur(14px) saturate(128%);
    }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .prototype-nav-dock,
    .prototype-header,
    .prototype-main > .briefing-card,
    .game-shell,
    .editor-card,
    .console-card,
    .result-panel,
    .creative-card {
        background: rgba(7, 18, 31, 0.96);
    }
}

@media (forced-colors: active) {
    .prototype-nav-dock,
    .prototype-header,
    .prototype-main > .briefing-card,
    .game-shell,
    .editor-card,
    .console-card,
    .result-panel,
    .creative-card {
        border: 2px solid CanvasText;
        background: Canvas;
        color: CanvasText;
        box-shadow: none;
    }
}

@media (max-width: 560px) {
    .game-stage { min-height: 0; aspect-ratio: 16 / 9; }
    .stage-label { display: none; }
    .mobile-target-legend {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin-top: 8px;
    }
    .mobile-target-legend li {
        min-width: 0;
        padding: 7px 8px;
        color: #e8f7ff;
        background: rgba(var(--accent-rgb), 0.08);
        border: 1px solid rgba(var(--accent-rgb), 0.24);
        border-radius: 9px;
        font-size: 0.7rem;
        font-weight: 800;
        line-height: 1.25;
    }
    .mobile-target-legend span { color: var(--muted); white-space: nowrap; }
    .stage-hud {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch;
        gap: 5px;
        top: 6px;
        right: 6px;
        left: 6px;
    }
    .stage-hud > * { min-width: 0; padding: 5px 6px; }
    .stage-hud small,
    .agent-avatar { display: none; }
    .meter-block,
    .inventory-block { max-width: none; }
    .stage-hud strong,
    .inventory-items span { font-size: 0.65rem; }
    .control-bar { grid-template-columns: minmax(0, 1fr); }
    .control-bar .primary-action { grid-column: auto; }
    .checks-list { grid-template-columns: minmax(0, 1fr); }
}
