:root {
    color-scheme: light;
    --paper: #e8e3d8;
    --paper-deep: #d7d0c1;
    --ink: #17201d;
    --ink-muted: #5f6964;
    --line: rgba(23, 32, 29, 0.18);
    --line-strong: rgba(23, 32, 29, 0.32);
    --signal: #e1262f;
    --signal-dark: #ae111d;
    --panel: rgba(17, 24, 22, 0.94);
    --panel-line: rgba(255, 255, 255, 0.13);
    --panel-text: #f4f3ee;
    --panel-muted: #a8b1ac;
    --focus: #ff3341;
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: "Segoe UI", Arial, sans-serif;
}

button,
input {
    font: inherit;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 5000;
    padding: 10px 14px;
    color: #fff;
    background: var(--ink);
    border-radius: 4px;
    transform: translateY(-160%);
    transition: transform 180ms ease-out;
}

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

.cursor-page {
    --focus-pressure-opacity: 0;
    --damage-x: 50%;
    --damage-y: 35%;
    --damage-tilt: 0deg;
    position: relative;
    width: 100vw;
    height: 100dvh;
    min-height: 100vh;
    overflow: hidden;
    isolation: isolate;
    cursor: none;
    user-select: none;
    background:
        radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.66) 0, rgba(255, 255, 255, 0) 47%),
        repeating-linear-gradient(0deg, rgba(23, 32, 29, 0.025) 0, rgba(23, 32, 29, 0.025) 1px, transparent 1px, transparent 4px),
        var(--paper);
}

.cursor-page::before,
.cursor-page::after {
    content: "";
    position: fixed;
    z-index: 0;
    pointer-events: none;
}

.cursor-page::before {
    inset: 0;
    background:
        linear-gradient(90deg, transparent calc(50% - 0.5px), rgba(23, 32, 29, 0.08) 50%, transparent calc(50% + 0.5px)),
        linear-gradient(transparent calc(50% - 0.5px), rgba(23, 32, 29, 0.08) 50%, transparent calc(50% + 0.5px));
}

.cursor-page::after {
    inset: 10px;
    border: 1px solid rgba(23, 32, 29, 0.12);
    box-shadow: inset 0 0 80px rgba(53, 48, 38, 0.08);
}

.cursor-page * {
    cursor: none;
}

[data-cursor-ui],
[data-cursor-ui] * {
    cursor: auto;
    user-select: auto;
}

.range-intro {
    position: fixed;
    top: clamp(24px, 4vw, 56px);
    left: clamp(24px, 5vw, 72px);
    z-index: 3;
    max-width: 430px;
    pointer-events: none;
}

.range-intro__eyebrow {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 0 14px;
    color: var(--signal-dark);
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.range-intro__eyebrow span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 0 4px rgba(225, 38, 47, 0.12);
}

.range-intro h1 {
    margin: 0;
    font-size: clamp(31px, 4.1vw, 64px);
    line-height: 0.96;
    letter-spacing: -0.055em;
    text-transform: uppercase;
}

.range-intro > p:not(.range-intro__eyebrow) {
    max-width: 360px;
    margin: 14px 0 0;
    color: var(--ink-muted);
    font-size: clamp(14px, 1.2vw, 17px);
    line-height: 1.5;
}

.range-status {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: 22px;
    color: var(--ink-muted);
    font-family: Consolas, "Courier New", monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.range-status__line {
    width: 42px;
    height: 1px;
    background: var(--ink);
}

.target-grid {
    position: absolute;
    inset: clamp(180px, 24vh, 245px) clamp(28px, 5vw, 78px) clamp(30px, 6vh, 64px);
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid var(--line-strong);
    background: var(--line-strong);
}

.target-card {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    overflow: hidden;
    background: rgba(245, 242, 234, 0.56);
}

.target-card::before,
.target-card::after,
.target-card__crosshair::before,
.target-card__crosshair::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    border: 1px solid var(--line);
    border-radius: 50%;
}

.target-card::before {
    width: clamp(74px, 8vw, 126px);
    aspect-ratio: 1;
}

.target-card::after {
    width: clamp(43px, 4.5vw, 72px);
    aspect-ratio: 1;
}

.target-card__crosshair {
    position: absolute;
    inset: 50% auto auto 50%;
    width: clamp(100px, 11vw, 165px);
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
}

.target-card__crosshair::before {
    width: 1px;
    height: 100%;
    border: 0;
    border-radius: 0;
    background: var(--line);
}

.target-card__crosshair::after {
    width: 100%;
    height: 1px;
    border: 0;
    border-radius: 0;
    background: var(--line);
}

.target-card__number {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: clamp(26px, 2.2vw, 36px);
    aspect-ratio: 1;
    color: var(--paper);
    background: var(--ink);
    border-radius: 50%;
    font-family: Consolas, "Courier New", monospace;
    font-size: clamp(9px, 0.78vw, 12px);
    font-weight: 700;
}

.target-card__coordinate {
    position: absolute;
    right: 10px;
    bottom: 8px;
    color: rgba(23, 32, 29, 0.4);
    font-family: Consolas, "Courier New", monospace;
    font-size: 8px;
    letter-spacing: 0.08em;
}

.effect-layer {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.projectile-layer {
    z-index: 1000;
}

.trajectory-layer {
    z-index: 950;
}

.impact-layer {
    z-index: 1100;
}

.cursor-layer {
    z-index: 2000;
    overflow: visible;
}

.cursor-dot,
.cursor-ring,
.reload-indicator,
.projectile,
.impact {
    position: fixed;
    top: 0;
    left: 0;
    will-change: transform;
    pointer-events: none;
}

.cursor-dot {
    z-index: 2001;
    width: 10px;
    height: 10px;
    opacity: 0;
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 0 2px rgba(174, 17, 29, 0.18), 0 0 12px rgba(225, 38, 47, 0.5);
    transition: opacity 100ms ease-out;
}

.cursor-ring {
    z-index: 2000;
    width: 48px;
    height: 48px;
    opacity: 0;
    border: 2px solid var(--signal);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.28), inset 0 0 10px rgba(225, 38, 47, 0.08);
    transition: opacity 100ms ease-out;
}

.cursor-ring::before,
.cursor-ring::after {
    content: "";
    position: absolute;
    background: var(--signal);
}

.cursor-ring::before {
    top: 50%;
    left: -7px;
    width: calc(100% + 14px);
    height: 1px;
    transform: translateY(-50%);
    background: linear-gradient(to right, var(--signal) 0 7px, transparent 7px calc(100% - 7px), var(--signal) calc(100% - 7px));
}

.cursor-ring::after {
    top: -7px;
    left: 50%;
    width: 1px;
    height: calc(100% + 14px);
    transform: translateX(-50%);
    background: linear-gradient(to bottom, var(--signal) 0 7px, transparent 7px calc(100% - 7px), var(--signal) calc(100% - 7px));
}

.cursor-dot.is-visible,
.cursor-ring.is-visible {
    opacity: 1;
}

.cursor-page[data-focus-state="strained"] .cursor-ring {
    border-style: dashed;
}

.cursor-page[data-focus-state="unsteady"] .cursor-ring,
.cursor-page[data-focus-state="breaking"] .cursor-ring {
    border-style: dashed;
    box-shadow:
        -3px 0 0 rgba(225, 38, 47, 0.34),
        3px 0 0 rgba(14, 104, 115, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.34);
}

.cursor-page[data-focus-state="breaking"] .cursor-dot {
    border-radius: 2px;
    box-shadow: -3px 0 rgba(225, 38, 47, 0.55), 3px 0 rgba(14, 104, 115, 0.48);
}

.reload-indicator {
    --reload-progress: 0;
    z-index: 2002;
    display: grid;
    grid-template-columns: 58px auto;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 100ms ease-out;
}

.reload-indicator.is-visible {
    opacity: 1;
}

.reload-indicator__track {
    display: block;
    height: 5px;
    overflow: hidden;
    background: rgba(23, 32, 29, 0.32);
    border: 1px solid rgba(247, 244, 236, 0.88);
    box-shadow: 0 1px 5px rgba(23, 32, 29, 0.2);
}

.reload-indicator__fill {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--signal);
    transform: scaleX(var(--reload-progress));
    transform-origin: left center;
    will-change: transform;
}

.reload-indicator__value {
    min-width: 28px;
    color: var(--ink);
    font-family: Consolas, "Courier New", monospace;
    font-size: 8px;
    font-weight: 800;
    line-height: 1;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.86);
}

.projectile {
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.94);
    border-radius: 50%;
    background:
        radial-gradient(circle at 33% 27%, #fff 0, #fff 8%, #f3f2ed 27%, #d4d3ce 57%, #8e918d 82%, #5f6461 100%);
    box-shadow:
        inset -8px -10px 20px rgba(38, 44, 42, 0.24),
        inset 7px 6px 15px rgba(255, 255, 255, 0.72),
        0 9px 20px rgba(13, 18, 16, 0.22);
    transform-origin: center;
}

.trajectory-path {
    fill: none;
    stroke: rgba(225, 38, 47, 0.55);
    stroke-width: 1;
    stroke-linecap: round;
    stroke-dasharray: 2 7;
    animation: trajectory-fade 540ms ease-out forwards;
}

.impact {
    width: 0;
    height: 0;
}

.impact__marker,
.impact__spark {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.impact__marker {
    width: var(--impact-size);
    height: var(--impact-size);
    border: 2px solid var(--signal);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.65), 0 0 10px rgba(225, 38, 47, 0.32);
    animation: impact-settle var(--impact-lifetime) ease-out forwards;
}

.impact__marker::after {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--signal);
    transform: translate(-50%, -50%);
}

.impact__spark {
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--signal);
    transform: translate(-50%, -50%);
    animation: impact-spark 210ms ease-out forwards;
}

.debug-panel {
    position: fixed;
    top: max(20px, env(safe-area-inset-top));
    right: max(20px, env(safe-area-inset-right));
    z-index: 3000;
    width: min(298px, calc(100vw - 40px));
    max-height: calc(100dvh - 40px);
    overflow: hidden;
    color: var(--panel-text);
    background: var(--panel);
    border: 1px solid var(--panel-line);
    border-radius: 3px;
    box-shadow: 0 18px 50px rgba(16, 20, 18, 0.2);
    backdrop-filter: blur(16px);
    transition: width 220ms ease-out, box-shadow 220ms ease-out;
}

.debug-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 11px 11px 11px 15px;
    border-bottom: 1px solid var(--panel-line);
}

.debug-panel__heading {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.debug-panel__heading p,
.debug-panel__heading span,
.shot-data h2,
.shot-data p {
    margin: 0;
}

.debug-panel__heading p {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.debug-panel__heading > div > span {
    display: block;
    margin-top: 3px;
    color: var(--panel-muted);
    font-family: Consolas, "Courier New", monospace;
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.debug-panel__indicator {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 0 4px rgba(225, 38, 47, 0.12);
}

.icon-button {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--panel-text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 2px;
    transition: background-color 180ms ease-out, border-color 180ms ease-out;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--panel-line);
}

.icon-button:focus-visible,
.text-button:focus-visible,
.home-link:focus-visible,
.toggle-control input:focus-visible + .toggle-control__track,
.range-control input:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.icon-button svg,
.home-link svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 220ms ease-out;
}

.debug-panel__content {
    max-height: calc(100dvh - 105px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.control-list {
    display: grid;
    gap: 15px;
    padding: 16px 15px 18px;
}

.range-control {
    display: grid;
    gap: 9px;
    color: var(--panel-muted);
    font-size: 11px;
}

.range-control > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.range-control output {
    color: var(--panel-text);
    font-family: Consolas, "Courier New", monospace;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
}

.range-control input {
    width: 100%;
    height: 24px;
    margin: 0;
    background: transparent;
    appearance: none;
}

.range-control input::-webkit-slider-runnable-track {
    height: 2px;
    background: rgba(255, 255, 255, 0.22);
}

.range-control input::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
    margin-top: -6px;
    border: 2px solid var(--panel);
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 0 1px var(--signal);
    appearance: none;
}

.range-control input::-moz-range-track {
    height: 2px;
    background: rgba(255, 255, 255, 0.22);
}

.range-control input::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 2px solid var(--panel);
    border-radius: 50%;
    background: var(--signal);
    box-shadow: 0 0 0 1px var(--signal);
}

.toggle-control {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 10px 15px;
    border-top: 1px solid var(--panel-line);
    border-bottom: 1px solid var(--panel-line);
}

.toggle-control strong,
.toggle-control small {
    display: block;
}

.toggle-control strong {
    font-size: 11px;
    font-weight: 600;
}

.toggle-control small {
    margin-top: 4px;
    color: var(--panel-muted);
    font-size: 9px;
}

.toggle-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.toggle-control__track {
    position: relative;
    flex: 0 0 auto;
    width: 38px;
    height: 22px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    transition: background-color 180ms ease-out, border-color 180ms ease-out;
}

.toggle-control__track::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--panel-muted);
    transition: transform 180ms ease-out, background-color 180ms ease-out;
}

.toggle-control input:checked + .toggle-control__track {
    border-color: var(--signal);
    background: rgba(225, 38, 47, 0.2);
}

.toggle-control input:checked + .toggle-control__track::after {
    background: var(--signal);
    transform: translateX(16px);
}

.shot-data {
    padding: 16px 15px;
}

.shot-data__title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
}

.shot-data h2 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.shot-data__title span {
    color: var(--panel-muted);
    font-family: Consolas, "Courier New", monospace;
    font-size: 8px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.shot-data dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    margin: 0;
    background: var(--panel-line);
    border: 1px solid var(--panel-line);
}

.shot-data dl > div {
    min-width: 0;
    padding: 8px 9px;
    background: rgba(255, 255, 255, 0.025);
}

.shot-data dt {
    margin-bottom: 4px;
    color: var(--panel-muted);
    font-size: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.shot-data dd {
    margin: 0;
    overflow: hidden;
    color: var(--panel-text);
    font-family: Consolas, "Courier New", monospace;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.debug-panel__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 15px 15px;
}

.text-button,
.home-link {
    min-height: 44px;
    color: var(--panel-muted);
    background: transparent;
    border: 0;
    font-size: 10px;
    text-decoration: none;
    transition: color 180ms ease-out;
}

.text-button {
    padding: 0;
}

.home-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.home-link svg {
    width: 14px;
    height: 14px;
}

.text-button:hover,
.home-link:hover {
    color: var(--panel-text);
}

.debug-panel.is-collapsed {
    width: 66px;
    box-shadow: 0 10px 30px rgba(16, 20, 18, 0.16);
}

.debug-panel.is-collapsed .debug-panel__header {
    justify-content: center;
    padding: 10px;
    border-bottom-color: transparent;
}

.debug-panel.is-collapsed .debug-panel__heading,
.debug-panel.is-collapsed .debug-panel__content {
    display: none;
}

.debug-panel.is-collapsed .icon-button svg {
    transform: rotate(180deg);
}

.touch-message,
.noscript-message {
    position: fixed;
    z-index: 4000;
    right: 16px;
    bottom: 16px;
    left: 16px;
    display: none;
    margin: 0;
    padding: 12px 14px;
    color: var(--panel-text);
    background: var(--panel);
    border: 1px solid var(--panel-line);
    font-size: 13px;
    text-align: center;
}

.noscript-message {
    display: block;
}

@keyframes trajectory-fade {
    0%, 48% { opacity: 0.68; }
    100% { opacity: 0; }
}

@keyframes impact-settle {
    0% { opacity: 1; transform: translate(-50%, -50%) scale(1.65); }
    12% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    62% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.86); }
}

@keyframes impact-spark {
    0% { opacity: 0.9; transform: translate(-50%, -50%) translate(0, 0) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) translate(var(--spark-x), var(--spark-y)) scale(0.25); }
}

@media (max-width: 900px) {
    .target-grid {
        right: 28px;
        left: 28px;
    }

    .range-intro {
        left: 28px;
    }
}

@media (max-width: 700px) {
    .range-intro {
        top: 24px;
        left: 20px;
    }

    .range-intro > p:not(.range-intro__eyebrow),
    .range-status {
        display: none;
    }

    .target-grid {
        inset: 128px 20px 24px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: repeat(4, minmax(0, 1fr));
    }

    .debug-panel {
        top: 18px;
        right: 18px;
        max-height: calc(100dvh - 36px);
    }
}

@media (max-width: 480px) {
    .range-intro__eyebrow {
        margin-bottom: 10px;
    }

    .range-intro h1 {
        max-width: 230px;
    }

    .target-grid {
        top: 132px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(6, minmax(0, 1fr));
    }

    .target-card::before {
        width: 64px;
    }

    .target-card::after {
        width: 36px;
    }

    .target-card__crosshair {
        width: 84px;
    }
}

@media (pointer: coarse) {
    .cursor-page,
    .cursor-page * {
        cursor: auto;
    }

    .cursor-layer {
        display: none;
    }

    .touch-message {
        display: block;
    }
}

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

    .impact__marker {
        animation: none !important;
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Cursor roguelike screens */
[hidden] {
    display: none !important;
}

.game-overlay {
    position: fixed;
    inset: 0;
    z-index: 3200;
    display: grid;
    place-items: center;
    padding: clamp(14px, 3vw, 40px);
    overflow: auto;
    color: var(--panel-text);
    background:
        linear-gradient(rgba(10, 14, 13, 0.84), rgba(10, 14, 13, 0.94)),
        repeating-linear-gradient(90deg, transparent 0 79px, rgba(255, 255, 255, 0.025) 80px),
        var(--ink);
    cursor: auto;
}

.game-overlay__frame {
    width: min(1120px, 100%);
    margin: auto;
    background: rgba(19, 27, 24, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.17);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.48);
}

.game-overlay__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 76px;
    padding: 16px clamp(18px, 3vw, 34px);
    border-bottom: 1px solid var(--panel-line);
}

.game-overlay__header > div {
    display: grid;
    gap: 3px;
}

.game-overlay__header span,
.game-panel small,
.game-panel dt,
.upgrade-card header,
.weapon-card > div > span {
    color: var(--panel-muted);
    font-family: Consolas, "Courier New", monospace;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.game-overlay__header strong {
    color: #fff;
    font-size: clamp(22px, 3vw, 38px);
    line-height: 1;
    letter-spacing: -0.035em;
    text-transform: uppercase;
}

#gameScreenEyebrow {
    color: #ff7279;
}

.game-panel {
    min-height: 420px;
    padding: clamp(22px, 4vw, 48px);
    outline: 0;
}

.menu-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 380px);
    gap: clamp(28px, 6vw, 84px);
    align-items: end;
    min-height: 360px;
}

.menu-hero > p {
    max-width: 670px;
    margin: 0;
    color: #f4f3ee;
    font-size: clamp(32px, 6vw, 76px);
    font-weight: 800;
    line-height: 0.96;
    letter-spacing: -0.06em;
    text-transform: uppercase;
}

.menu-actions,
.screen-actions,
.shop-utilities {
    display: grid;
    gap: 10px;
}

.screen-actions {
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, max-content);
    justify-content: end;
    margin-top: 28px;
}

.game-button,
.choice-card,
.map-node {
    min-height: 48px;
    padding: 12px 16px;
    color: var(--panel-text);
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid var(--panel-line);
    border-radius: 2px;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.045em;
    text-align: left;
    text-transform: uppercase;
    transition: background-color 160ms ease-out, border-color 160ms ease-out, transform 160ms ease-out;
}

.game-button:hover:not(:disabled),
.choice-card:hover:not(:disabled),
.map-node:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.36);
    transform: translateY(-2px);
}

.game-button:focus-visible,
.choice-card:focus-visible,
.map-node:focus-visible,
.settings-list select:focus-visible,
.settings-list input:focus-visible {
    outline: 2px solid #ff5863;
    outline-offset: 3px;
}

.game-button:disabled {
    opacity: 0.36;
}

.game-button--primary {
    color: #fff;
    background: var(--signal-dark);
    border-color: #ff5863;
}

.game-button--primary:hover:not(:disabled) {
    background: var(--signal);
}

.game-button--danger {
    color: #ff959a;
    border-color: rgba(255, 88, 99, 0.48);
}

.menu-record {
    grid-column: 2;
    display: flex;
    justify-content: space-between;
    padding-top: 14px;
    color: var(--panel-muted);
    border-top: 1px solid var(--panel-line);
    font-family: Consolas, "Courier New", monospace;
    font-size: 10px;
    text-transform: uppercase;
}

.menu-record strong {
    color: #fff;
}

.loadout-grid,
.upgrade-grid,
.mastery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.weapon-card,
.upgrade-card,
.mastery-card {
    display: grid;
    align-content: start;
    gap: 18px;
    min-width: 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid var(--panel-line);
    box-shadow: inset 3px 0 0 rgba(255, 255, 255, 0.06);
}

.weapon-card:nth-child(4),
.weapon-card:nth-child(5) {
    grid-column: span 1;
}

.weapon-card h2,
.upgrade-card h2,
.mastery-card h2,
.stage-intro h2,
.boss-brief h2 {
    margin: 3px 0 0;
    color: #fff;
    font-size: 22px;
    line-height: 1.05;
    text-transform: uppercase;
}

.weapon-card p,
.upgrade-card p {
    min-height: 38px;
    margin: 7px 0 0;
    color: var(--panel-muted);
    font-size: 11px;
    line-height: 1.5;
}

.weapon-card details {
    color: var(--panel-muted);
    font-size: 10px;
}

.weapon-card summary {
    min-height: 32px;
    padding-top: 8px;
}

.stat-bars,
.detail-stats,
.mastery-card dl {
    display: grid;
    gap: 7px;
    margin: 0;
}

.stat-bars > div,
.detail-stats > div,
.mastery-card dl > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.stat-bars dd,
.detail-stats dd,
.mastery-card dd {
    margin: 0;
    color: #fff;
    font-family: Consolas, "Courier New", monospace;
}

.stat-bars dd {
    color: #ff6d75;
    letter-spacing: 0.08em;
}

.upgrade-card {
    position: relative;
    min-height: 260px;
    grid-template-rows: auto auto 1fr auto auto;
    overflow: hidden;
}

.upgrade-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--rarity, #b6bcb9);
}

.upgrade-card--common { --rarity: #b6bcb9; }
.upgrade-card--uncommon { --rarity: #65c68e; }
.upgrade-card--rare { --rarity: #69a9ff; }
.upgrade-card--legendary { --rarity: #ffb74e; }
.upgrade-card--evolution { --rarity: #f35cff; }

.upgrade-card--rare,
.upgrade-card--legendary,
.upgrade-card--evolution {
    background-image: repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--rarity) 8%, transparent) 14px 15px);
}

.upgrade-card header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.upgrade-card header > span {
    color: var(--rarity);
}

.upgrade-card__comparison,
.unlock-note {
    color: #f5d17d;
    font-family: Consolas, "Courier New", monospace;
    font-size: 10px;
}

.upgrade-card.is-purchased {
    min-height: 150px;
    opacity: 0.54;
}

.stage-intro,
.boss-brief,
.encounter-brief,
.event-copy {
    display: flex;
    align-items: center;
    gap: clamp(22px, 5vw, 64px);
    min-height: 290px;
    padding: clamp(24px, 5vw, 56px);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--panel-line);
}

.stage-intro__number,
.encounter-brief > strong {
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 88, 99, 0.75);
    font-size: clamp(74px, 16vw, 190px);
    font-weight: 900;
    line-height: 0.8;
}

.stage-intro p,
.encounter-brief p,
.event-copy p,
.boss-brief p {
    color: var(--panel-muted);
    line-height: 1.6;
}

.encounter-brief {
    display: grid;
    grid-template-columns: max-content 1fr;
}

.encounter-brief p {
    grid-column: 2;
    margin: -30px 0 0;
}

.encounter-stakes {
    display: grid;
    grid-template-columns: 1.4fr repeat(5, minmax(0, 1fr));
    margin-top: 12px;
    border: 1px solid rgba(255, 98, 107, 0.5);
    background:
        repeating-linear-gradient(135deg, rgba(225, 38, 47, 0.06) 0 6px, transparent 6px 12px),
        rgba(174, 17, 29, 0.1);
}

.encounter-stakes > * {
    display: grid;
    align-content: center;
    min-height: 58px;
    padding: 10px 12px;
    border-left: 1px solid var(--panel-line);
    font-family: Consolas, "Courier New", monospace;
    font-size: 9px;
    text-transform: uppercase;
}

.encounter-stakes > strong {
    color: #fff;
    border-left: 0;
    font-size: 11px;
}

.encounter-stakes b {
    display: block;
    margin-bottom: 3px;
    color: #ff7780;
}

.route-progress {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    margin-bottom: 30px;
}

.route-progress span {
    position: relative;
    min-height: 38px;
    color: var(--panel-muted);
    border-bottom: 2px solid var(--panel-line);
    font-family: Consolas, "Courier New", monospace;
    font-size: 10px;
    text-align: center;
}

.route-progress span::after {
    content: "";
    position: absolute;
    right: calc(50% - 5px);
    bottom: -6px;
    width: 10px;
    height: 10px;
    background: #222c29;
    border: 2px solid var(--panel-muted);
    border-radius: 50%;
}

.route-progress .is-complete,
.route-progress .is-current {
    color: #fff;
    border-color: var(--signal);
}

.route-progress .is-complete::after,
.route-progress .is-current::after {
    background: var(--signal);
    border-color: #ff8b91;
}

.map-choices,
.choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.map-node,
.choice-card {
    display: grid;
    align-content: center;
    gap: 8px;
    min-height: 156px;
    border-left: 4px solid var(--node, #88928d);
}

.map-node--elite { --node: #ff9d49; }
.map-node--challenge { --node: #77b9ff; }
.map-node--shop { --node: #73ce8f; }
.map-node--event { --node: #c68cff; }
.map-node--rest { --node: #f1d16e; }
.map-node--boss { --node: #ff4f5a; }

.map-node > span {
    color: var(--node);
    font-family: Consolas, "Courier New", monospace;
    font-size: 9px;
}

.map-node > strong,
.choice-card > strong {
    color: #fff;
    font-size: 18px;
}

.map-node > small,
.choice-card > span {
    color: var(--panel-muted);
    line-height: 1.4;
    text-transform: none;
}

.route-history {
    margin: 24px 0 0;
    color: var(--panel-muted);
    font-family: Consolas, "Courier New", monospace;
    font-size: 9px;
}

.shop-utilities {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 18px;
}

.settings-list {
    display: grid;
    max-width: 760px;
    margin: 0 auto;
    border-top: 1px solid var(--panel-line);
}

.settings-list label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 88px;
    padding: 16px;
    border-bottom: 1px solid var(--panel-line);
}

.settings-list label > span {
    display: grid;
    gap: 5px;
}

.settings-list small {
    max-width: 520px;
    line-height: 1.45;
    text-transform: none;
}

.settings-list select {
    min-width: 150px;
    min-height: 44px;
    padding: 0 12px;
    color: #fff;
    background: #171e1c;
    border: 1px solid var(--panel-line);
    color-scheme: dark;
}

.settings-list input {
    width: 24px;
    height: 24px;
    accent-color: var(--signal);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--panel-line);
    border-left: 1px solid var(--panel-line);
}

.summary-grid section {
    display: grid;
    gap: 5px;
    padding: 16px;
    border-right: 1px solid var(--panel-line);
    border-bottom: 1px solid var(--panel-line);
}

.summary-grid span {
    color: var(--panel-muted);
    font-size: 9px;
    text-transform: uppercase;
}

.summary-grid strong {
    color: #fff;
    font-size: 19px;
}

.build-summary {
    margin-top: 22px;
}

.build-summary h2 {
    font-size: 13px;
    text-transform: uppercase;
}

.build-summary ol {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    padding: 1px;
    background: var(--panel-line);
    list-style: none;
}

.build-summary li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 11px;
    background: #171f1c;
    font-size: 10px;
}

.run-hud {
    position: fixed;
    top: 20px;
    left: 50%;
    z-index: 1650;
    display: grid;
    grid-template-columns: minmax(190px, 1fr) auto minmax(190px, 0.9fr) minmax(210px, 1fr);
    width: min(1040px, calc(100vw - 48px));
    min-height: 70px;
    color: var(--panel-text);
    background: rgba(17, 24, 22, 0.94);
    border: 1px solid var(--panel-line);
    box-shadow: 0 12px 34px rgba(17, 24, 22, 0.2);
    transform: translateX(-50%);
}

.run-hud > div {
    min-width: 0;
    padding: 11px 15px;
}

.focus-meter,
.run-hud__location,
.danger-meter,
.run-hud__resources {
    display: grid;
    align-content: center;
    gap: 4px;
}

.run-hud__location {
    min-width: 180px;
    border-right: 1px solid var(--panel-line);
    border-left: 1px solid var(--panel-line);
    text-align: center;
}

.run-hud__resources {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.danger-meter {
    border-right: 1px solid var(--panel-line);
}

.danger-meter strong {
    color: #f5d17d;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.danger-meter small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.danger-meter__track {
    overflow: hidden;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
}

.danger-meter__track > span {
    display: block;
    width: 100%;
    height: 100%;
    background: #f5d17d;
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 100ms linear;
}

.danger-meter[data-state="clear"] strong {
    color: #8bd4af;
}

.danger-meter[data-state="pressure"] strong,
.danger-meter[data-state="critical"] strong {
    color: #ff626b;
}

.danger-meter[data-state="pressure"] .danger-meter__track > span,
.danger-meter[data-state="critical"] .danger-meter__track > span {
    background:
        repeating-linear-gradient(90deg, #ff626b 0 8px, #fff 8px 10px);
}

.run-hud span,
.run-hud small {
    color: var(--panel-muted);
    font-family: Consolas, "Courier New", monospace;
    font-size: 8px;
    text-transform: uppercase;
}

.run-hud strong {
    font-family: Consolas, "Courier New", monospace;
    font-size: 16px;
}

.focus-meter__track,
.boss-hud__track {
    overflow: hidden;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
}

.focus-meter__track > span,
.boss-hud__track > span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--signal);
    transform-origin: left center;
    transition: transform 180ms ease-out;
}

.run-hud.is-critical .focus-meter strong {
    color: #ff626b;
}

#focusStatusValue {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.run-hud[data-focus-state="strained"] #focusStatusValue {
    color: #f5d17d;
}

.run-hud[data-focus-state="unsteady"] #focusStatusValue,
.run-hud[data-focus-state="breaking"] #focusStatusValue,
.run-hud[data-focus-state="broken"] #focusStatusValue {
    color: #ff7780;
    font-weight: 900;
}

.boss-hud {
    position: fixed;
    top: 104px;
    left: 50%;
    z-index: 1640;
    width: min(600px, calc(100vw - 60px));
    padding: 10px 14px;
    color: #fff;
    background: rgba(17, 24, 22, 0.92);
    border: 1px solid rgba(255, 74, 85, 0.5);
    transform: translateX(-50%);
}

.boss-hud > div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 8px;
    font-size: 10px;
    text-transform: uppercase;
}

.combat-notice {
    position: fixed;
    top: 154px;
    left: 50%;
    z-index: 1700;
    max-width: min(600px, calc(100vw - 40px));
    margin: 0;
    padding: 8px 12px;
    color: #fff;
    background: rgba(174, 17, 29, 0.94);
    border: 1px solid #ff7780;
    font-family: Consolas, "Courier New", monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0;
    transform: translate(-50%, -8px);
    transition: opacity 160ms ease-out, transform 160ms ease-out;
    pointer-events: none;
}

.combat-notice.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.focus-pressure,
.damage-vignette {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.focus-pressure {
    z-index: 690;
    background:
        radial-gradient(circle at 50% 48%, transparent 0 28%, rgba(23, 5, 7, 0.16) 60%, rgba(70, 3, 10, 0.72) 100%),
        repeating-linear-gradient(0deg, transparent 0 4px, rgba(174, 17, 29, 0.07) 4px 5px);
    opacity: var(--focus-pressure-opacity);
    mix-blend-mode: multiply;
    transition: opacity 240ms ease-out;
}

.damage-vignette {
    z-index: 1690;
    display: grid;
    grid-auto-rows: max-content;
    place-items: center;
    align-content: center;
    gap: 6px;
    color: #fff;
    border: 12px solid rgba(225, 38, 47, 0.9);
    background:
        radial-gradient(circle at var(--damage-x) var(--damage-y), rgba(255, 244, 229, 0.9) 0 1%, rgba(255, 66, 78, 0.58) 2%, transparent 27%),
        repeating-linear-gradient(0deg, rgba(72, 0, 8, 0.08) 0 3px, rgba(255, 77, 88, 0.08) 3px 4px);
    box-shadow: inset 0 0 150px 42px rgba(109, 0, 10, 0.62);
    opacity: 0;
}

.damage-vignette::before,
.damage-vignette::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.damage-vignette::before {
    inset: 0;
    background: linear-gradient(90deg, transparent 0 46%, rgba(255, 255, 255, 0.34) 50%, transparent 54%);
    transform: rotate(var(--damage-tilt)) scaleX(0.08);
}

.damage-vignette::after {
    top: var(--damage-y);
    left: var(--damage-x);
    width: min(34vw, 420px);
    aspect-ratio: 1;
    border: 2px dashed rgba(255, 255, 255, 0.78);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.damage-vignette__signal,
.damage-vignette__label {
    position: relative;
    z-index: 1;
    font-family: Consolas, "Courier New", monospace;
    font-weight: 900;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.damage-vignette__signal {
    padding: 4px 7px;
    color: #ffd8db;
    background: rgba(52, 0, 5, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.62);
    font-size: 9px;
}

.damage-vignette__label {
    margin: 0;
    padding: 8px 12px;
    background: rgba(174, 17, 29, 0.94);
    border: 1px solid #ff9ca3;
    font-size: clamp(13px, 2vw, 22px);
}

.damage-vignette[data-severity="major"] {
    border-width: 18px;
    box-shadow: inset 0 0 190px 58px rgba(109, 0, 10, 0.76);
}

.cursor-page.is-damaged .damage-vignette {
    animation: focus-hit 440ms ease-out both;
}

.cursor-page.is-damaged .target-layer,
.cursor-page.is-damaged .projectile-layer,
.cursor-page.is-damaged .impact-layer {
    animation: damage-signal-separation 320ms ease-out both;
}

@keyframes focus-hit {
    0% { opacity: 0; transform: scale(1.02); }
    12% { opacity: 1; transform: scale(1); }
    36% { opacity: 0.82; }
    100% { opacity: 0; transform: scale(1); }
}

@keyframes damage-signal-separation {
    0% { filter: none; }
    18% { filter: drop-shadow(-5px 0 rgba(225, 38, 47, 0.7)) drop-shadow(5px 0 rgba(14, 104, 115, 0.58)) contrast(1.18); }
    100% { filter: none; }
}

.pause-run {
    position: fixed;
    top: 102px;
    right: 24px;
    z-index: 1650;
    min-height: 40px;
    padding: 0 12px;
    color: var(--panel-text);
    background: rgba(17, 24, 22, 0.9);
    border: 1px solid var(--panel-line);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.pause-run kbd {
    margin-left: 7px;
    color: var(--panel-muted);
}

.cursor-page.is-run-active .range-intro,
.cursor-page.is-run-active:not(.has-developer-mode) .debug-panel {
    display: none;
}

.cursor-page.is-run-active .score-board {
    top: 104px;
    right: 24px;
    bottom: auto;
    left: auto;
    width: 292px;
    transform: none;
}

.developer-tools {
    display: grid;
    gap: 12px;
    padding: 16px 15px;
    border-bottom: 1px solid var(--panel-line);
}

.developer-tools h2,
.developer-tools p {
    margin: 0;
}

.developer-tools p {
    margin-top: 4px;
    color: var(--panel-muted);
    font-size: 9px;
}

.developer-tools__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.developer-tools__actions button {
    min-height: 42px;
    color: #ffced1;
    background: rgba(225, 38, 47, 0.1);
    border: 1px solid rgba(225, 38, 47, 0.38);
    font-size: 9px;
}

.developer-tools__actions label {
    display: grid;
    gap: 5px;
    color: var(--panel-muted);
    font-size: 8px;
    text-transform: uppercase;
}

.developer-tools__actions input {
    min-width: 0;
    min-height: 42px;
    padding: 0 9px;
    color: #fff;
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid var(--panel-line);
}

.modifier-debug {
    margin-top: 22px;
}

.modifier-debug h2 {
    font-size: 12px;
    text-transform: uppercase;
}

.modifier-line {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    padding: 10px 0;
    color: var(--panel-muted);
    border-bottom: 1px solid var(--panel-line);
    font-family: Consolas, "Courier New", monospace;
    font-size: 9px;
}

.modifier-line strong,
.modifier-line b {
    color: #fff;
}

.run-history {
    margin-top: 24px;
}

.run-history h2 {
    font-size: 12px;
    text-transform: uppercase;
}

.run-history ol {
    padding: 0;
    border-top: 1px solid var(--panel-line);
    list-style: none;
}

.run-history li {
    display: grid;
    grid-template-columns: 1.2fr 0.7fr 0.7fr 1fr;
    gap: 12px;
    padding: 11px 4px;
    border-bottom: 1px solid var(--panel-line);
    font-size: 10px;
}

.run-history small {
    text-align: right;
}

/* Enemy role language: silhouettes, line styles, and badges remain readable without color. */
.range-target__threat {
    position: absolute;
    inset: -9px;
    border-radius: 50%;
    background: conic-gradient(var(--signal) calc(var(--threat-progress, 0) * 1turn), transparent 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
    mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 0);
    opacity: 0.7;
}

.range-target__threat-label {
    position: absolute;
    top: calc(100% + 9px);
    left: 50%;
    display: none;
    padding: 3px 6px;
    color: #fff;
    background: var(--signal-dark);
    border: 1px solid #fff;
    font-family: Consolas, "Courier New", monospace;
    font-size: 8px;
    font-weight: 900;
    letter-spacing: 0.12em;
    transform: translateX(-50%);
}

.range-target.is-warning .range-target__threat-label:not(:empty) {
    display: block;
}

.range-target.is-warning .range-target__threat {
    opacity: 1;
}

.range-target.is-warning {
    filter: drop-shadow(0 0 9px rgba(225, 38, 47, 0.7));
}

.range-target--runner {
    border-radius: 16% 50% 16% 50%;
}

.range-target--heavy {
    border-width: 5px;
    box-shadow: 0 0 0 4px var(--paper), 0 0 0 7px var(--ink), 0 10px 22px rgba(23, 32, 29, 0.3);
}

.range-target--spinner .range-target__rings {
    border-style: dashed;
}

.range-target--dasher::before {
    border: 3px double var(--signal);
    border-right-color: transparent;
}

.range-target--shield .range-target__rings {
    border-style: double;
    border-width: calc(var(--target-size) * 0.14);
}

.range-target--splitter .range-target__core::after,
.range-target--medic .range-target__core::after {
    content: "+";
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    color: #fff;
    font-weight: 900;
}

.range-target--splitter .range-target__core::after {
    content: "×";
}

.range-target--berserker {
    border-style: dashed;
}

.range-target--mimic {
    border-radius: 5px;
    background: repeating-linear-gradient(135deg, rgba(14, 104, 115, 0.14) 0 5px, transparent 5px 10px), #f7f4ec;
}

.range-target--elite::after {
    content: "ELITE";
    position: absolute;
    bottom: -21px;
    left: 50%;
    padding: 2px 5px;
    color: #fff;
    background: #8c3214;
    border: 1px solid #ffad62;
    font-family: Consolas, "Courier New", monospace;
    font-size: 7px;
    font-weight: 900;
    letter-spacing: 0.08em;
    transform: translateX(-50%);
}

.range-target--priority {
    outline: 3px solid var(--signal-dark);
    outline-offset: 5px;
}

.range-target--priority .range-target__score::before {
    content: "PRIORITY / ";
    color: #ff8b91;
}

.range-target.is-shielded {
    opacity: 0.72;
    filter: grayscale(0.45);
}

.range-target.is-blocked {
    filter: brightness(1.8) drop-shadow(0 0 6px #fff);
}

.range-target.is-healed {
    filter: drop-shadow(0 0 10px #4cdb8a);
}

.range-target.is-dashing {
    filter: drop-shadow(8px 0 0 rgba(225, 38, 47, 0.3));
}

@media (max-width: 900px) {
    .loadout-grid,
    .upgrade-grid,
    .mastery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .menu-hero {
        grid-template-columns: 1fr;
    }

    .menu-record {
        grid-column: 1;
    }

    .run-hud {
        grid-template-columns: 1fr 1fr;
    }

    .danger-meter,
    .run-hud__resources {
        grid-column: auto;
        border-top: 1px solid var(--panel-line);
    }

    .danger-meter {
        border-right: 1px solid var(--panel-line);
    }

    .boss-hud {
        top: 160px;
    }

    .combat-notice,
    .cursor-page.is-run-active .score-board {
        top: 210px;
    }

}

@media (max-width: 640px) {
    .game-overlay {
        display: block;
        padding: 0;
    }

    .game-overlay__frame {
        min-height: 100dvh;
        border: 0;
    }

    .game-overlay__header {
        align-items: flex-start;
    }

    #gameScreenMeta {
        max-width: 120px;
        text-align: right;
    }

    .game-panel {
        min-height: 0;
        padding: 20px 16px 36px;
    }

    .menu-hero {
        min-height: 0;
    }

    .loadout-grid,
    .upgrade-grid,
    .mastery-grid,
    .map-choices,
    .choice-grid,
    .shop-utilities,
    .summary-grid,
    .build-summary ol {
        grid-template-columns: 1fr;
    }

    .screen-actions {
        grid-auto-flow: row;
        grid-auto-columns: 1fr;
    }

    .stage-intro,
    .boss-brief,
    .encounter-brief,
    .event-copy {
        display: grid;
        min-height: 0;
        padding: 24px 18px;
    }

    .encounter-brief p {
        grid-column: auto;
        margin: 0;
    }

    .encounter-stakes {
        grid-template-columns: 1fr 1fr;
    }

    .encounter-stakes > strong {
        grid-column: span 2;
    }

    .run-hud {
        top: 8px;
        width: calc(100vw - 16px);
    }

    .run-hud__location {
        min-width: 0;
    }

    .boss-hud { top: 160px; }

    .combat-notice { top: 210px; }

    .cursor-page.is-run-active .score-board {
        display: none;
    }

    .pause-run {
        top: auto;
        right: 10px;
        bottom: 166px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .game-button,
    .choice-card,
    .map-node,
    .combat-notice,
    .focus-meter__track > span,
    .focus-pressure,
    .danger-meter__track > span,
    .boss-hud__track > span {
        transition: none !important;
    }

    .cursor-page.is-damaged .damage-vignette {
        opacity: 1;
        animation: none;
    }

    .cursor-page.is-damaged .target-layer,
    .cursor-page.is-damaged .projectile-layer,
    .cursor-page.is-damaged .impact-layer {
        animation: none;
    }

    .cursor-page[data-focus-state="strained"] .focus-pressure { opacity: 0.04; }
    .cursor-page[data-focus-state="unsteady"] .focus-pressure { opacity: 0.08; }
    .cursor-page[data-focus-state="breaking"] .focus-pressure { opacity: 0.12; }
}

/* Cursor V2: weapon playground and scored target range */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.target-layer {
    z-index: 700;
    overflow: visible;
}

.range-target,
.score-popup {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    will-change: transform;
}

.range-target {
    width: var(--target-size);
    height: var(--target-size);
    border: 2px solid rgba(23, 32, 29, 0.82);
    border-radius: 50%;
    background: #f7f4ec;
    box-shadow:
        0 0 0 3px rgba(247, 244, 236, 0.72),
        0 8px 18px rgba(23, 32, 29, 0.2);
    transition: opacity 180ms ease-out, filter 180ms ease-out;
}

.range-target::before {
    content: "";
    position: absolute;
    inset: -12px;
    border: 1px dashed transparent;
    border-radius: 50%;
}

.target-layer.show-hitboxes .range-target::before {
    border-color: rgba(225, 38, 47, 0.75);
}

.range-target__rings,
.range-target__core {
    position: absolute;
    inset: 50% auto auto 50%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.range-target__rings {
    width: 66%;
    height: 66%;
    border: calc(var(--target-size) * 0.1) solid var(--signal);
    background: var(--paper);
    box-shadow: inset 0 0 0 1px rgba(23, 32, 29, 0.28);
}

.range-target__core {
    width: 19%;
    height: 19%;
    background: var(--ink);
    box-shadow: 0 0 0 2px var(--paper);
}

.range-target__score,
.range-target__health {
    position: absolute;
    display: grid;
    place-items: center;
    min-width: 29px;
    min-height: 18px;
    padding: 2px 5px;
    color: var(--panel-text);
    background: var(--ink);
    border: 1px solid rgba(255, 255, 255, 0.28);
    font-family: Consolas, "Courier New", monospace;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.range-target__score {
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
}

.range-target__health {
    right: -7px;
    bottom: -5px;
    min-width: 18px;
    padding: 2px;
    color: var(--ink);
    background: var(--paper);
    border-color: var(--ink);
    border-radius: 50%;
}

.range-target__health:empty {
    display: none;
}

.range-target--horizontal::after,
.range-target--vertical::after,
.range-target--diagonal::after,
.range-target--chaotic::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: -1;
    width: calc(var(--target-size) + 26px);
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(23, 32, 29, 0.26), transparent);
    transform: translate(-50%, -50%);
}

.range-target--vertical::after {
    transform: translate(-50%, -50%) rotate(90deg);
}

.range-target--diagonal::after {
    transform: translate(-50%, -50%) rotate(42deg);
}

.range-target--chaotic::after {
    height: calc(var(--target-size) + 26px);
    background: none;
    border: 1px dashed rgba(23, 32, 29, 0.32);
    border-radius: 50%;
}

.range-target--friendly {
    border-style: dashed;
    border-radius: 5px;
    background:
        repeating-linear-gradient(135deg, rgba(14, 104, 115, 0.14) 0 5px, transparent 5px 10px),
        #f7f4ec;
}

.range-target--friendly .range-target__rings {
    border-color: #0e6873;
    border-radius: 4px;
}

.range-target--friendly .range-target__core {
    display: grid;
    place-items: center;
    width: 30%;
    height: 30%;
    color: #fff;
    background: #0e6873;
    border-radius: 2px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 9px;
    font-weight: 900;
}

.range-target--friendly .range-target__score {
    color: #fff;
    background: #0b5660;
}

.range-target.is-hit .range-target__rings {
    animation: target-hit 190ms ease-out;
}

.range-target.is-critical,
.range-target.is-bullseye {
    filter: drop-shadow(0 0 8px rgba(225, 38, 47, 0.72));
}

.range-target.is-destroyed {
    opacity: 0;
    filter: blur(2px);
    transform: scale(1.24);
}

.score-popup {
    z-index: 3;
    color: var(--signal-dark);
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    font-weight: 800;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
    animation: score-rise 720ms ease-out forwards;
}

.score-popup--critical,
.score-popup--bullseye {
    font-size: 16px;
}

.score-popup--friendly {
    color: #0b5660;
    font-size: 16px;
}

.score-board {
    position: fixed;
    top: max(26px, env(safe-area-inset-top));
    left: 50%;
    z-index: 850;
    display: flex;
    align-items: stretch;
    width: min(448px, calc(100vw - 780px));
    min-width: 390px;
    color: var(--panel-text);
    background: rgba(17, 24, 22, 0.9);
    border: 1px solid var(--panel-line);
    box-shadow: 0 12px 32px rgba(16, 20, 18, 0.14);
    transform: translateX(-50%);
    pointer-events: none;
}

.score-board__score {
    display: grid;
    align-content: center;
    min-width: 116px;
    padding: 12px 15px;
    border-right: 1px solid var(--panel-line);
}

.score-board__score span,
.score-board dt,
.weapon-hud > div > span {
    color: var(--panel-muted);
    font-family: Consolas, "Courier New", monospace;
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.score-board__score span {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.score-board__score span b {
    color: #ff737b;
    font: inherit;
    letter-spacing: 0.04em;
}

.score-board__score strong {
    margin-top: 2px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 24px;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.score-board dl {
    display: grid;
    flex: 1;
    grid-template-columns: repeat(3, 1fr);
    margin: 0;
}

.score-board dl > div {
    display: grid;
    align-content: center;
    min-width: 0;
    padding: 7px 9px;
    border-right: 1px solid var(--panel-line);
    border-bottom: 1px solid var(--panel-line);
}

.score-board dl > div:nth-child(3n) {
    border-right: 0;
}

.score-board dl > div:nth-last-child(-n + 3) {
    border-bottom: 0;
}

.score-board dt {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.score-board dd {
    margin: 3px 0 0;
    font-family: Consolas, "Courier New", monospace;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.score-board.has-streak #streakValue {
    color: #ff6a72;
}

.weapon-hud {
    position: fixed;
    bottom: max(26px, env(safe-area-inset-bottom));
    left: clamp(24px, 5vw, 72px);
    z-index: 1200;
    display: flex;
    align-items: center;
    min-height: 58px;
    color: var(--panel-text);
    background: rgba(17, 24, 22, 0.92);
    border: 1px solid var(--panel-line);
    box-shadow: 0 12px 30px rgba(16, 20, 18, 0.18);
}

.weapon-hud > div {
    display: grid;
    align-content: center;
    min-width: 126px;
    min-height: 58px;
    padding: 9px 13px;
}

.weapon-hud > div + div {
    min-width: 92px;
    border-left: 1px solid var(--panel-line);
}

.weapon-hud strong {
    margin-top: 3px;
    font-size: 11px;
    letter-spacing: 0.03em;
}

.weapon-hud__ammo strong {
    font-family: Consolas, "Courier New", monospace;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.weapon-hud__ammo small {
    padding: 0 4px;
    color: var(--panel-muted);
    font-size: 10px;
}

.weapon-hud button {
    align-self: stretch;
    min-width: 92px;
    min-height: 56px;
    padding: 0 12px;
    color: var(--panel-text);
    background: rgba(255, 255, 255, 0.035);
    border: 0;
    border-left: 1px solid var(--panel-line);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    transition: background-color 180ms ease-out, color 180ms ease-out;
}

.weapon-hud button:hover {
    color: #fff;
    background: rgba(225, 38, 47, 0.2);
}

.weapon-hud button:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: -4px;
}

.weapon-hud kbd {
    margin-left: 5px;
    padding: 2px 5px;
    color: var(--panel-muted);
    border: 1px solid var(--panel-line);
    border-radius: 2px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 8px;
}

.weapon-hud.is-reloading #weaponState {
    color: #ff6a72;
}

.impact--hit .impact__marker {
    border-color: #f6f4ed;
    background: rgba(225, 38, 47, 0.18);
}

.impact--friendly .impact__marker {
    border-color: #dffcff;
    background: rgba(14, 104, 115, 0.28);
}

.debug-panel {
    width: min(370px, calc(100vw - 40px));
}

.debug-panel__heading > div > span.is-error {
    color: #ff8c92;
}

.preset-control,
.target-controls,
.json-console {
    padding: 16px 15px;
    border-bottom: 1px solid var(--panel-line);
}

.preset-control > div,
.target-controls > div:first-child,
.json-console > div:first-child {
    margin-bottom: 12px;
}

.preset-control h2,
.target-controls h2,
.json-console h2,
.preset-control p,
.target-controls p,
.json-console p {
    margin: 0;
}

.preset-control h2,
.target-controls h2,
.json-console h2 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.preset-control p,
.target-controls p,
.json-console p,
.workspace-json > p {
    margin-top: 4px;
    color: var(--panel-muted);
    font-size: 9px;
    line-height: 1.45;
}

.preset-control select,
.select-control select {
    width: 100%;
    min-height: 44px;
    padding: 0 36px 0 11px;
    color: var(--panel-text);
    background: #171e1c;
    border: 1px solid var(--panel-line);
    border-radius: 2px;
    color-scheme: dark;
}

.preset-control select option,
.select-control select option {
    color: #f4f3ee;
    background: #171e1c;
}

.select-control {
    display: grid;
    gap: 7px;
    color: var(--panel-muted);
    font-size: 10px;
}

.control-group {
    border-bottom: 1px solid var(--panel-line);
}

.control-group > summary,
.workspace-json > summary {
    position: relative;
    min-height: 48px;
    padding: 16px 42px 14px 15px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    list-style: none;
}

.control-group > summary::-webkit-details-marker,
.workspace-json > summary::-webkit-details-marker {
    display: none;
}

.control-group > summary::after,
.workspace-json > summary::after {
    content: "+";
    position: absolute;
    top: 50%;
    right: 18px;
    color: var(--panel-muted);
    font-family: Consolas, "Courier New", monospace;
    font-size: 15px;
    transform: translateY(-50%);
}

.control-group[open] > summary::after,
.workspace-json[open] > summary::after {
    content: "−";
}

.control-group > summary:focus-visible,
.workspace-json > summary:focus-visible,
.preset-control select:focus-visible,
.select-control select:focus-visible,
.range-control__editor button:focus-visible,
.target-controls__actions button:focus-visible,
.json-console button:focus-visible,
.json-console textarea:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.control-group__content {
    display: grid;
    gap: 17px;
    padding: 2px 15px 18px;
}

.range-control {
    gap: 8px;
}

.range-control__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.range-control__editor {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;
}

.range-control__editor button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--panel-text);
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid var(--panel-line);
    border-radius: 2px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 16px;
    transition: background-color 180ms ease-out, border-color 180ms ease-out;
}

.range-control__editor button:hover {
    background: rgba(225, 38, 47, 0.16);
    border-color: rgba(225, 38, 47, 0.72);
}

.range-control__editor input {
    min-width: 0;
}

.range-control > .range-control__bounds {
    display: block;
    color: rgba(168, 177, 172, 0.72);
    font-family: Consolas, "Courier New", monospace;
    font-size: 8px;
    line-height: 1.3;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.target-controls {
    display: grid;
    gap: 13px;
}

.target-controls > div:first-child {
    margin-bottom: 0;
}

.target-controls__actions,
.json-console__actions,
.default-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.target-controls__actions button,
.json-console button {
    min-height: 44px;
    padding: 8px 10px;
    color: var(--panel-text);
    background: rgba(255, 255, 255, 0.045);
    border: 1px solid var(--panel-line);
    border-radius: 2px;
    font-size: 9px;
    font-weight: 700;
    transition: background-color 180ms ease-out, border-color 180ms ease-out;
}

.target-controls__actions button:hover,
.json-console button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.28);
}

.target-controls .toggle-control {
    margin: 0 -15px;
    border-bottom: 0;
}

.json-console {
    display: grid;
    gap: 12px;
}

.json-console > div:first-child {
    margin-bottom: 0;
}

.json-console textarea {
    width: 100%;
    resize: vertical;
    padding: 10px;
    color: #dce4df;
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid var(--panel-line);
    border-radius: 2px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 9px;
    line-height: 1.5;
    tab-size: 2;
}

.workspace-json {
    margin: 0 -15px;
    border-top: 1px solid var(--panel-line);
    border-bottom: 1px solid var(--panel-line);
}

.workspace-json > p,
.workspace-json > textarea {
    width: calc(100% - 30px);
    margin-right: 15px;
    margin-left: 15px;
}

.workspace-json > textarea {
    margin-bottom: 15px;
}

.default-actions {
    grid-template-columns: 1fr 1fr 1fr;
}

.default-actions button:first-child {
    color: #fff;
    background: var(--signal-dark);
    border-color: var(--signal);
}

.debug-panel__footer {
    padding-top: 12px;
}

.debug-panel__footer > span {
    color: var(--panel-muted);
    font-family: Consolas, "Courier New", monospace;
    font-size: 8px;
    line-height: 1.4;
    text-transform: uppercase;
}

@keyframes target-hit {
    0% { transform: translate(-50%, -50%) scale(1); }
    45% { transform: translate(-50%, -50%) scale(0.78); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes score-rise {
    0% { opacity: 0; margin-top: 4px; }
    18% { opacity: 1; }
    100% { opacity: 0; margin-top: -38px; }
}

@media (max-width: 1180px) {
    .score-board {
        top: auto;
        right: auto;
        bottom: 24px;
        left: 28px;
        width: 268px;
        min-width: 0;
        transform: none;
    }

    .score-board__score {
        min-width: 104px;
    }

    .score-board dl {
        grid-template-columns: repeat(2, 1fr);
    }

    .score-board dl > div:nth-child(n + 5) {
        display: none;
    }

    .score-board dl > div:nth-child(2n) {
        border-right: 0;
    }

    .score-board dl > div:nth-child(3) {
        border-bottom: 0;
    }

    .weapon-hud {
        left: 320px;
    }
}

@media (max-width: 760px) {
    .score-board {
        right: 18px;
        bottom: 18px;
        left: 18px;
        width: auto;
    }

    .weapon-hud {
        right: 18px;
        bottom: 96px;
        left: 18px;
    }

    .weapon-hud > div {
        flex: 1;
        min-width: 0;
    }

    .weapon-hud button {
        min-width: 82px;
    }

    .debug-panel {
        width: min(370px, calc(100vw - 36px));
    }
}

@media (max-width: 480px) {
    .score-board dl > div:nth-child(n + 3) {
        display: none;
    }

    .score-board__score {
        flex: 1;
    }

    .score-board dl {
        flex: 1.25;
        grid-template-columns: 1fr 1fr;
    }

    .score-board dl > div {
        border-bottom: 0;
    }

    .weapon-hud > div:first-child {
        display: none;
    }

    .default-actions {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .range-target,
    .score-popup,
    .reload-indicator {
        transition: none !important;
        animation: none !important;
    }
}
