:root {
    color-scheme: dark;
    --bg: #10161d;
    --panel: rgba(14, 22, 31, 0.88);
    --panel-strong: rgba(13, 19, 27, 0.97);
    --line: rgba(255, 255, 255, 0.12);
    --text: #f4f7fb;
    --muted: #aab7c5;
    --accent: #67d6ff;
    --accent-2: #7bf1a8;
    --danger: #ff6b72;
    --warning: #ffd166;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    --mobile-bottom-inset: max(12px, env(safe-area-inset-bottom, 0px));
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

button {
    font: inherit;
    -webkit-user-drag: none;
}

input,
textarea,
select,
[contenteditable="true"],
[role="textbox"] {
    user-select: text;
    -webkit-user-select: text;
}

#game-shell {
    position: relative;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    min-height: 520px;
    overflow: hidden;
    background: #87b66f;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    -webkit-user-drag: none;
}

.glass-panel,
.hud-card {
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
}

#hud {
    position: absolute;
    top: 14px;
    left: 14px;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 28px));
    pointer-events: none;
}

.hud-card {
    border-radius: 14px;
    padding: 11px 13px;
}

.identity-card {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.player-profile {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

.player-profile-text {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.player-avatar-wrap {
    position: relative;
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    overflow: hidden;
    place-items: center;
    border: 1px solid rgba(103, 214, 255, 0.58);
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(103, 214, 255, 0.9), rgba(255, 207, 103, 0.9));
    box-shadow: 0 0 0 2px rgba(8, 14, 19, 0.42);
}

.player-avatar-wrap[hidden],
.player-avatar[hidden],
.player-avatar-fallback[hidden] {
    display: none;
}

.player-avatar {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.identity-card strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
}

.identity-card span {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.identity-card .player-avatar-fallback {
    color: #07161c;
    font-size: 13px;
    font-weight: 950;
    line-height: 1;
}

#seedLabel {
    flex: 0 0 auto;
}

.stats-card {
    display: grid;
    gap: 8px;
}

.combat-card {
    display: grid;
    gap: 7px;
}

.role-progress-card {
    display: grid;
    gap: 6px;
    width: 100%;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    pointer-events: auto;
    background:
        linear-gradient(135deg, rgba(111, 214, 255, 0.16), rgba(255, 209, 102, 0.09)),
        var(--panel);
}

.role-progress-card:hover {
    filter: brightness(1.08);
}

.role-progress-card span {
    min-width: 0;
}

.role-progress-card > span:first-child {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.role-progress-card strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-progress-card #roleProgressMeta {
    color: var(--muted);
    font-size: 11px;
}

.role-progress-card i {
    display: block;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.role-progress-card b {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #ffd166);
    transition: width 180ms ease;
}

.combat-row,
.wanted-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
}

.combat-row span {
    color: var(--text);
    font-weight: 800;
}

.combat-row strong {
    color: var(--warning);
    font-variant-numeric: tabular-nums;
}

.wanted-row > span {
    color: var(--muted);
}

.wanted-stars {
    color: rgba(255, 255, 255, 0.3);
    font-size: 17px;
    line-height: 1;
    white-space: nowrap;
}

.wanted-stars b {
    color: #ffd45f;
    font-weight: 800;
    text-shadow: 0 0 9px rgba(255, 190, 55, 0.5);
}

.wanted-stars span {
    color: rgba(255, 255, 255, 0.3);
}

.wanted-stars[data-level="1"],
.wanted-stars[data-level="2"],
.wanted-stars[data-level="3"],
.wanted-stars[data-level="4"],
.wanted-stars[data-level="5"] {
    color: #ffd45f;
    text-shadow: 0 0 9px rgba(255, 190, 55, 0.5);
}

.reload-track {
    height: 3px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.reload-track i {
    display: block;
    width: 0;
    height: 100%;
    background: var(--accent);
}

.sync-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 10px;
}

.sync-row strong {
    max-width: 210px;
    overflow: hidden;
    color: var(--accent-2);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-row {
    display: grid;
    grid-template-columns: 74px 1fr 66px;
    gap: 8px;
    align-items: center;
    font-size: 12px;
}

.stat-row strong {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.bar {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.bar-fill {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    transition: width 160ms ease;
}

.bar-fill.health {
    background: linear-gradient(90deg, #ff646d, #ff9c72);
}

.bar-fill.energy {
    background: linear-gradient(90deg, #51d6ff, #79f0b1);
}

.money-row {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 13px;
}

.money-row strong {
    color: var(--text);
}

.primary-button,
.secondary-button,
.action-button,
.buy-button,
.use-button {
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    transition: transform 120ms ease, filter 120ms ease, opacity 120ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.action-button:hover,
.buy-button:hover,
.use-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.primary-button:active,
.secondary-button:active,
.action-button:active,
.buy-button:active,
.use-button:active {
    transform: translateY(0);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none !important;
    filter: none !important;
}

.primary-button {
    pointer-events: auto;
    padding: 11px 14px;
    color: #07161c;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    font-weight: 800;
    box-shadow: var(--shadow);
}

#hud .secondary-button {
    pointer-events: auto;
}

.iren-menu-button,
.auth-button,
.profile-button {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.secondary-button {
    padding: 11px 14px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid var(--line);
    font-weight: 700;
}

.cyber-systems-button {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    min-height: 44px;
    text-align: left;
}

.cyber-button-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(103, 214, 255, 0.58);
    border-radius: 5px;
    color: #07161c;
    background: var(--accent);
    font-size: 10px;
    font-weight: 950;
}

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

.cyber-button-short {
    display: none;
}

.cyber-systems-button strong {
    color: var(--accent-2);
    font-size: 12px;
}

#cyberSystemsModal {
    position: fixed;
    width: 100vw;
    height: 100dvh;
}

.cyber-systems-card.modal-wide {
    width: min(980px, 100%);
    max-height: calc(100dvh - 24px);
    border-radius: 8px;
}

.cyber-resource-summary {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin: 16px 0 4px;
}

.cyber-resource {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.045);
}

.cyber-resource span,
.cyber-resource strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cyber-resource span {
    color: var(--muted);
    font-size: 10px;
    text-transform: uppercase;
}

.cyber-resource strong {
    margin-top: 4px;
    font-size: 13px;
}

.cyber-resource i {
    display: block;
    height: 4px;
    margin-top: 7px;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.09);
}

.cyber-resource i b {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.cyber-resource.is-warning i b {
    background: #ff6672;
}

.cyber-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cyber-panel {
    margin: 14px 0 18px;
}

.cyber-panel.hidden {
    display: none;
}

.cyber-panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.cyber-panel-toolbar h3 {
    margin: 0;
    font-size: 15px;
}

.cyber-panel-toolbar select,
.cyber-select {
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    background: #121a23;
}

.cyber-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.cyber-body-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.cyber-slot-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 9px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--cyber-color, rgba(255, 255, 255, 0.18));
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.04);
}

.cyber-slot-card.is-installed {
    background: linear-gradient(135deg, rgba(103, 214, 255, 0.08), rgba(255, 255, 255, 0.035));
}

.cyber-slot-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(103, 214, 255, 0.34);
    border-radius: 5px;
    color: #07161c;
    background: var(--cyber-color, var(--accent));
    font-size: 10px;
    font-weight: 950;
}

.cyber-slot-card strong,
.cyber-slot-card span,
.cyber-slot-card small {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cyber-slot-card strong {
    font-size: 12px;
}

.cyber-slot-card span,
.cyber-slot-card small {
    color: var(--muted);
    font-size: 10px;
}

.cyber-slot-card small {
    margin-top: 3px;
    white-space: normal;
}

.cyber-slot-load {
    display: flex;
    grid-column: 1 / -1;
    flex-wrap: wrap;
    gap: 5px;
}

.cyber-slot-load span {
    padding: 3px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.18);
    color: var(--text);
    font-size: 9px;
    font-weight: 800;
}

.cyber-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--cyber-color, var(--accent));
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.045);
}

.cyber-card.is-deployed {
    box-shadow: inset 0 0 0 1px rgba(95, 242, 178, 0.28);
}

.cyber-card.is-destroyed {
    opacity: 0.68;
}

.cyber-card-head,
.cyber-card-meta,
.cyber-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.cyber-card-head > div {
    min-width: 0;
}

.cyber-card-head strong,
.cyber-card-head span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cyber-card-head strong {
    font-size: 13px;
}

.cyber-card-head span,
.cyber-card-meta,
.cyber-card-description {
    color: var(--muted);
    font-size: 11px;
}

.cyber-card-description {
    min-height: 30px;
    margin: 8px 0;
    line-height: 1.4;
}

.cyber-badge {
    flex: 0 0 auto;
    padding: 4px 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    color: var(--text);
    background: rgba(0, 0, 0, 0.16);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.cyber-stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    margin: 9px 0;
}

.cyber-stat-grid span {
    min-width: 0;
    padding: 5px;
    border-radius: 4px;
    color: var(--muted);
    background: rgba(0, 0, 0, 0.17);
    font-size: 9px;
    text-align: center;
}

.cyber-stat-grid b {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    color: var(--text);
    font-size: 11px;
    text-overflow: ellipsis;
}

.cyber-system-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin: 8px 0;
}

.cyber-system-grid span {
    padding: 4px 5px;
    border-left: 2px solid hsl(calc(var(--system-health, 100) * 1.2), 72%, 55%);
    color: var(--muted);
    background: rgba(0, 0, 0, 0.16);
    font-size: 9px;
}

.cyber-system-grid b {
    float: right;
    color: var(--text);
}

.cyber-order-row,
.cyber-module-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
}

.cyber-card-actions {
    margin-top: 9px;
}

.cyber-action {
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
    font-size: 10px;
    font-weight: 800;
}

.cyber-action.primary {
    color: #07161c;
    border-color: transparent;
    background: var(--accent-2);
}

.cyber-action.danger {
    color: #ff9aa2;
}

.cyber-empty {
    padding: 24px 12px;
    border: 1px dashed var(--line);
    border-radius: 6px;
    color: var(--muted);
    text-align: center;
}

.wide {
    width: 100%;
}

#eventPanel {
    position: absolute;
    left: 14px;
    bottom: 14px;
    width: min(390px, calc(100vw - 28px));
    padding: 12px 14px;
    border-radius: 14px;
}

#eventPanel h2,
#miniMapPanel h2 {
    margin: 0;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

#eventLog {
    display: grid;
    gap: 5px;
    margin: 9px 0 0;
    padding-left: 21px;
    max-height: 112px;
    overflow: hidden;
    color: #e9eff6;
    font-size: 12px;
    line-height: 1.35;
}

#eventLog li::marker {
    color: var(--accent);
}

#miniMapPanel {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 290px;
    padding: 12px 14px;
    border-radius: 14px;
    transition: opacity 0.18s ease;
}

#miniMapPanel.is-world-object-overlap {
    opacity: 0.18;
}

#miniMapPanel.is-world-object-overlap:hover,
#miniMapPanel.is-world-object-overlap:focus-within {
    opacity: 0.96;
}

.panel-title-row,
.modal-title-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

#cityClock {
    color: var(--muted);
    font-size: 11px;
}

#miniMap {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 9px;
    border-radius: 9px;
    background: #6f985f;
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 10px;
}

#game-shell.mission-active #miniMapPanel {
    width: min(280px, calc(100vw - 20px));
}

#game-shell.mission-active .map-legend {
    display: none;
}

.mission-ui-toggle {
    position: absolute;
    top: 248px;
    right: 14px;
    z-index: 16;
    display: none;
    width: min(152px, calc(100vw - 28px));
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid rgba(103, 214, 255, 0.36);
    border-radius: 8px;
    color: var(--text);
    background: rgba(10, 18, 27, 0.9);
    box-shadow: var(--shadow);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0;
    cursor: pointer;
    pointer-events: auto;
}

.mission-ui-toggle[hidden] {
    display: none;
}

#game-shell.mission-desktop-focus .mission-ui-toggle {
    display: grid;
    place-items: center;
}

#game-shell.mission-desktop-focus:not(.mission-ui-expanded) #eventPanel,
#game-shell.mission-desktop-focus:not(.mission-ui-expanded) #combatControl,
#game-shell.mission-desktop-focus:not(.mission-ui-expanded) #missionTracker,
#game-shell.mission-desktop-focus:not(.mission-ui-expanded) #worldEventBadge,
#game-shell.mission-desktop-focus:not(.mission-ui-expanded) #interactionPrompt,
#game-shell.mission-desktop-focus:not(.mission-ui-expanded) #toast,
#game-shell.mission-desktop-focus:not(.mission-ui-expanded) #helpPanel {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

#game-shell.mission-desktop-focus:not(.mission-ui-expanded) #hud {
    width: min(292px, calc(100vw - 28px));
}

#game-shell.mission-desktop-focus:not(.mission-ui-expanded) #hud > :not(.stats-card),
#game-shell.mission-desktop-focus:not(.mission-ui-expanded) #hud .stats-card > :not(.stat-row:first-child) {
    display: none;
}

#game-shell.mission-desktop-focus:not(.mission-ui-expanded) #hud .stats-card {
    gap: 0;
    padding: 10px 12px;
    border-color: rgba(255, 100, 109, 0.34);
    background: rgba(10, 18, 27, 0.86);
}

#game-shell.mission-desktop-focus:not(.mission-ui-expanded) #hud .stats-card .stat-row:first-child {
    grid-template-columns: 74px minmax(84px, 1fr) 66px;
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.map-legend i {
    width: 8px;
    height: 8px;
    border-radius: 2px;
}

.legend-player {
    background: #fff14a;
}

.legend-faction-mission {
    border: 2px solid #ffd166;
    background: #6fd6ff;
}

.legend-shop {
    background: #f39cff;
}

.legend-weapon-shop {
    background: #ffcf67;
}

.legend-iren-shop {
    background: #67d6e9;
}

.legend-owned-shop {
    background: #65d88a;
}

.legend-delivery {
    border-radius: 50% !important;
    background: #67d6e9;
}

.legend-reputation {
    background: #f4c95d;
}

.legend-services {
    background: #65d88a;
}

.legend-content {
    background: #67d6e9;
}

.legend-exhibition {
    background: #e5d2a9;
}

.legend-iren-specialist {
    border: 2px solid #67d6e9;
    border-radius: 50% !important;
    background: #14313b;
}

.legend-project {
    background: #f4c95d;
}

.legend-project-finance {
    background: #ff9b59;
}

.legend-park {
    background: #43b65c;
}

.legend-police {
    background: #52a8ff;
}

.legend-bandit {
    background: #ff5e64;
}

.legend-transport {
    background: #ffb347;
}

.legend-train {
    background: #d4a94d;
}

#interactionPrompt {
    position: absolute;
    left: 50%;
    bottom: 38px;
    transform: translateX(-50%) translateY(16px);
    opacity: 0;
    pointer-events: none;
    padding: 11px 16px;
    border-radius: 999px;
    color: #06151b;
    background: rgba(245, 251, 255, 0.94);
    box-shadow: var(--shadow);
    font-size: 13px;
    font-weight: 800;
    transition: opacity 140ms ease, transform 140ms ease;
    white-space: nowrap;
}

#interactionPrompt.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#toast {
    position: absolute;
    left: 50%;
    top: 22px;
    z-index: 30;
    transform: translateX(-50%) translateY(-20px);
    opacity: 0;
    pointer-events: none;
    max-width: min(640px, calc(100vw - 30px));
    padding: 11px 15px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    color: var(--text);
    background: rgba(13, 20, 29, 0.94);
    box-shadow: var(--shadow);
    text-align: center;
    font-size: 13px;
    transition: opacity 150ms ease, transform 150ms ease;
}

#toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.combat-control {
    position: fixed;
    left: auto;
    right: 14px;
    top: 50%;
    z-index: 14;
    display: grid;
    gap: 8px;
    width: min(280px, calc(100vw - 28px));
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(10, 17, 24, 0.9);
    box-shadow: var(--shadow);
    transform: translateY(-50%);
    backdrop-filter: blur(10px);
    pointer-events: auto;
}

.combat-mode-button {
    min-height: 46px;
    padding: 10px 14px;
    border: 0;
    border-radius: 6px;
    color: #1a090b;
    background: #ff6b72;
    font-weight: 900;
    cursor: pointer;
}

.difficulty-control {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
}

.difficulty-control button {
    min-width: 0;
    padding: 8px 4px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.difficulty-control button.active {
    color: #07161c;
    border-color: #7bf1a8;
    background: #7bf1a8;
}

.combat-control.combat-active {
    top: 50%;
    right: 14px;
    width: auto;
    min-width: 210px;
    padding: 0;
    border: 0;
    background: transparent;
    transform: translateY(-50%);
    backdrop-filter: none;
}

.combat-control.combat-active .difficulty-control {
    display: none;
}

.combat-control.combat-active .combat-mode-button {
    min-height: 38px;
    color: #f7fbff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(132, 28, 38, 0.92);
    box-shadow: var(--shadow);
    font-size: 12px;
}

.world-event-badge {
    position: absolute;
    left: 50%;
    top: 62px;
    z-index: 13;
    max-width: min(520px, calc(100vw - 28px));
    padding: 8px 12px;
    border: 1px solid rgba(255, 209, 102, 0.35);
    border-radius: 6px;
    color: #fff2c4;
    background: rgba(57, 28, 18, 0.9);
    box-shadow: var(--shadow);
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.world-event-badge[hidden] {
    display: none;
}

.mission-tracker {
    position: absolute;
    left: 388px;
    right: 318px;
    top: 14px;
    z-index: 13;
    display: grid;
    gap: 8px;
    width: auto;
    max-width: 430px;
    padding: 10px 12px;
    border-radius: 10px;
    transform: none;
    pointer-events: none;
}

.mission-tracker[hidden] {
    display: none;
}

.mission-tracker-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mission-tracker-title strong {
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mission-tracker-title span {
    flex: 0 0 auto;
    color: var(--accent);
    font-size: 11px;
    font-weight: 900;
}

.mission-tracker-stats,
.mission-tracker-objectives {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mission-tracker-pill,
.mission-objective-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 5px 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.045);
    font-size: 10px;
    font-weight: 800;
}

.mission-tracker-pill strong,
.mission-objective-pill strong {
    color: var(--text);
}

.mission-objective-pill.completed {
    color: rgba(244, 247, 251, 0.62);
    text-decoration: line-through;
}

.mission-objective-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

#helpPanel {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: grid;
    gap: 8px;
    width: 252px;
    padding: 11px 13px;
    border-radius: 14px;
    color: var(--muted);
    font-size: 11px;
}

#helpPanel strong {
    color: var(--text);
    font-size: 12px;
}

.help-panel-title {
    line-height: 1.15;
}

.help-panel-subtitle,
.help-panel-footer {
    color: rgba(220, 230, 240, 0.66);
    font-size: 10px;
    line-height: 1.25;
}

.help-panel-rows,
.help-panel-tips {
    display: grid;
    gap: 5px;
}

.help-panel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.help-panel-row b {
    flex: 0 0 auto;
    color: rgba(220, 230, 240, 0.62);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.help-panel-row span {
    min-width: 0;
    color: var(--text);
    font-weight: 800;
    text-align: right;
    overflow-wrap: anywhere;
}

.help-panel-tip {
    position: relative;
    padding-left: 10px;
    line-height: 1.28;
}

.help-panel-tip::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.48em;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
}

.help-panel-tip.warning {
    color: #ffd166;
}

.help-panel-tip.warning::before {
    background: #ffd166;
}

.help-panel-footer {
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.onboarding-panel {
    position: absolute;
    right: 14px;
    bottom: 148px;
    z-index: 14;
    display: grid;
    gap: 8px;
    width: min(340px, calc(100vw - 28px));
    padding: 11px 12px 12px;
    border-radius: 12px;
    color: var(--text);
    pointer-events: auto;
}

.onboarding-panel[hidden] {
    display: none;
}

.onboarding-panel-head,
.onboarding-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.onboarding-panel-head span {
    color: #ffd166;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#onboardingSkipButton {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    line-height: 1;
}

.onboarding-progress-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
}

.onboarding-progress-track i {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ffd166, #7bf1a8, #67d6ff);
    transition: width 180ms ease;
}

.onboarding-progress-meta strong {
    min-width: 0;
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.onboarding-progress-meta span {
    color: var(--accent);
    font-size: 11px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

#onboardingDescription {
    margin: 0;
    color: rgba(232, 240, 248, 0.82);
    font-size: 11px;
    line-height: 1.35;
}

.onboarding-steps {
    display: grid;
    gap: 5px;
}

.onboarding-step {
    display: grid;
    grid-template-columns: 18px 1fr auto;
    gap: 7px;
    align-items: center;
    min-height: 30px;
    padding: 5px 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

.onboarding-step i {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: #09131a;
    background: rgba(255, 255, 255, 0.2);
    font-size: 11px;
    font-style: normal;
}

.onboarding-step strong {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.onboarding-step span {
    color: rgba(232, 240, 248, 0.72);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.onboarding-step.completed i {
    background: #7bf1a8;
}

.onboarding-step.active {
    border-color: rgba(255, 209, 102, 0.42);
    background: rgba(255, 209, 102, 0.08);
}

.onboarding-step.active i {
    background: #ffd166;
}

.onboarding-reward {
    padding-top: 7px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffdca0;
    font-size: 10px;
    font-weight: 900;
    line-height: 1.25;
}

.onboarding-modal-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0 20px;
}

.onboarding-modal-step {
    min-height: 118px;
    padding: 13px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.onboarding-modal-step b {
    display: block;
    margin-bottom: 6px;
    color: #ffd166;
    font-size: 12px;
    text-transform: uppercase;
}

.onboarding-modal-step strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
}

.onboarding-modal-step span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.modal {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(4, 8, 12, 0.68);
    backdrop-filter: blur(6px);
}

.modal.hidden {
    display: none;
}

.modal-card {
    position: relative;
    width: min(520px, 100%);
    max-height: min(760px, calc(100vh - 36px));
    overflow: auto;
    padding: 25px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel-strong);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
}

.modal-card.modal-wide {
    width: min(820px, 100%);
}

.mission-result-card {
    width: min(920px, 100%);
}

.pause-menu-card {
    width: min(420px, 100%);
}

.onboarding-card.modal-wide {
    width: min(820px, calc(100vw - 36px));
    max-width: calc(100vw - 16px);
}

.role-progress-modal-card.modal-wide {
    width: min(980px, calc(100vw - 36px));
}

.role-progress-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0 16px;
}

.role-progress-stat {
    min-width: 0;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.role-progress-stat span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.role-progress-stat strong {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-progress-columns {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr);
    gap: 16px;
}

.role-progress-section {
    min-width: 0;
}

.role-progress-section h3 {
    margin: 10px 0 9px;
    font-size: 14px;
}

.role-faction-list,
.role-style-list,
.role-progress-log {
    display: grid;
    gap: 8px;
}

.role-faction-row,
.role-style-row,
.role-log-row {
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
}

.role-faction-row {
    display: grid;
    grid-template-columns: minmax(120px, 0.9fr) minmax(130px, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.role-faction-title {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}

.role-faction-dot {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    box-shadow: 0 0 14px currentColor;
}

.role-faction-name,
.role-style-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.role-faction-meter,
.role-style-meter {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
}

.role-faction-meter i,
.role-style-meter i {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff5b67, #ffd166, #78e6a0);
}

.role-style-meter i {
    background: linear-gradient(90deg, #6fd6ff, #ffd166);
}

.role-relation-pill {
    min-width: 94px;
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    white-space: nowrap;
}

.role-relation-pill[data-tone="ally"],
.role-relation-pill[data-tone="good"] {
    color: #17331f;
    background: #78e6a0;
}

.role-relation-pill[data-tone="warning"] {
    color: #291d05;
    background: #ffd166;
}

.role-relation-pill[data-tone="danger"] {
    color: #fff;
    background: #ff5b67;
}

.role-style-row {
    display: grid;
    gap: 7px;
}

.role-style-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.role-style-head span {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.role-style-row p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.role-log-row {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.role-log-row[data-tone="positive"],
.role-log-row[data-tone="level"] {
    color: #9df0b6;
}

.role-log-row[data-tone="negative"] {
    color: #ff9aa2;
}

.role-log-empty {
    margin: 0;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
}

.pause-settings {
    display: grid;
    gap: 10px;
    margin: 22px 0 18px;
}

#pauseProgressButton {
    margin-bottom: 10px;
}

#pausePartyButton {
    margin-bottom: 10px;
}

.setting-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
    color: var(--text);
    font-weight: 800;
}

.setting-toggle input {
    width: 21px;
    height: 21px;
    accent-color: var(--accent);
}

.setting-toggle:has(input:disabled) {
    opacity: 0.48;
}

.multiplayer-party-panel {
    display: grid;
    gap: 8px;
    margin-bottom: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.055);
}

.multiplayer-party-panel[hidden] {
    display: none;
}

.multiplayer-party-head,
.multiplayer-party-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.multiplayer-party-head strong,
.multiplayer-party-row strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.multiplayer-party-row {
    min-height: 32px;
    padding: 7px 8px;
    border-radius: 6px;
    background: rgba(8, 14, 19, 0.28);
}

.multiplayer-party-row span,
.multiplayer-party-empty,
.multiplayer-party-note {
    color: var(--muted);
    font-size: 12px;
}

.multiplayer-party-actions {
    display: flex;
    gap: 8px;
}

.multiplayer-party-actions button {
    flex: 1 1 0;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.modal-kicker {
    margin-bottom: 5px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.modal h2 {
    margin: 0;
    font-size: clamp(24px, 4vw, 34px);
}

.modal-subtitle {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.dialog-line {
    margin: 20px 0;
    padding: 14px 16px;
    border-left: 3px solid var(--accent);
    border-radius: 0 10px 10px 0;
    color: #edf5fb;
    background: rgba(255, 255, 255, 0.05);
    line-height: 1.55;
}

.action-list {
    display: grid;
    gap: 10px;
    margin: 0 0 16px;
}

.action-button {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    width: 100%;
    padding: 13px 14px;
    color: var(--text);
    background: rgba(103, 214, 255, 0.1);
    border: 1px solid rgba(103, 214, 255, 0.22);
    text-align: left;
}

.action-button small {
    color: var(--muted);
    font-weight: 700;
}

.wallet-badge {
    flex: 0 0 auto;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.05);
    font-size: 12px;
}

.mission-result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
    gap: 8px;
    margin: 18px 0 14px;
}

.mission-result-stat {
    display: grid;
    gap: 4px;
    min-height: 58px;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
}

.mission-result-stat span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.mission-result-stat strong {
    color: var(--text);
    font-size: 17px;
}

.mission-result-death {
    display: grid;
    gap: 5px;
    margin: 0 0 14px;
    padding: 14px 16px;
    border: 1px solid color-mix(in srgb, var(--faction-color, #ff5b67) 58%, transparent);
    border-left: 4px solid var(--faction-color, #ff5b67);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(255, 91, 103, 0.18), rgba(255, 255, 255, 0.05));
    box-shadow: 0 0 0 1px rgba(255, 91, 103, 0.1) inset;
}

.mission-result-death[hidden] {
    display: none;
}

.mission-result-death-label {
    display: block;
    color: #ffb5bd;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.mission-result-death-name,
.mission-result-death strong {
    display: block;
    color: #fff2f4;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.18;
}

.mission-result-death-detail,
.mission-result-death small {
    display: block;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.mission-result-combat {
    display: grid;
    gap: 10px;
    margin-top: 4px;
}

.mission-result-judgment {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(103, 214, 255, 0.26);
    border-radius: 10px;
    background: rgba(103, 214, 255, 0.075);
}

.mission-result-grade {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(103, 214, 255, 0.42);
    border-radius: 8px;
    color: var(--accent);
    background: rgba(5, 12, 18, 0.42);
    font-size: 24px;
    font-weight: 950;
}

.mission-result-judgment-body {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.mission-result-judgment-body b {
    color: var(--text);
    font-size: 14px;
}

.mission-result-judgment-body span,
.mission-result-judgment-body small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.mission-result-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.mission-result-badges span {
    display: inline-grid;
    gap: 1px;
    min-width: 92px;
    padding: 7px 9px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
}

.mission-result-badges b {
    color: var(--text);
    font-size: 12px;
}

.mission-result-badges small {
    color: var(--muted);
    font-size: 11px;
}

.mission-result-section-title {
    margin: 0;
    color: var(--text);
    font-size: 15px;
}

.mission-result-faction-list {
    display: grid;
    gap: 8px;
    max-height: min(38vh, 340px);
    overflow: auto;
    padding-right: 2px;
}

.mission-result-faction {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 60px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--faction-color, #67d6ff) 42%, var(--line));
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.055);
}

.mission-result-faction-text {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.mission-result-faction-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--faction-color, #67d6ff);
    box-shadow: 0 0 14px var(--faction-color, #67d6ff);
}

.mission-result-faction-name,
.mission-result-faction strong {
    display: block;
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
}

.mission-result-faction-details,
.mission-result-faction small,
.mission-result-empty {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.mission-result-faction-count,
.mission-result-faction b {
    display: block;
    min-width: 34px;
    color: var(--faction-color, #67d6ff);
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
    text-align: right;
}

.mission-result-empty {
    margin: 0;
    padding: 12px;
    border: 1px dashed var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
}

.mission-result-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 14px;
}

.mission-result-actions .secondary-button {
    display: grid;
    place-items: center;
    min-height: 44px;
    text-align: center;
    text-decoration: none;
}

.wallet-badge strong {
    color: var(--text);
}

.event-banner {
    margin: 18px 0;
    padding: 13px 15px;
    border-radius: 12px;
    color: #1b1606;
    background: linear-gradient(135deg, #ffe199, #ffd166);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.mission-section-title {
    margin: 18px 0 9px;
    color: var(--text);
    font-size: 14px;
}

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

.mission-choice {
    display: grid;
    gap: 7px;
    min-height: 136px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.045);
    cursor: pointer;
    text-align: left;
}

.mission-ship-card {
    display: grid;
    gap: 8px;
}

.mission-ship-card .mission-choice {
    width: 100%;
}

.mission-ship-sell-button {
    min-height: 38px;
    padding: 9px 11px;
    border-color: rgba(255, 107, 114, 0.36);
    color: #ffd5d8;
    font-size: 12px;
}

.mission-choice.selected {
    border-color: rgba(103, 214, 255, 0.92);
    background: rgba(103, 214, 255, 0.13);
    box-shadow: inset 0 0 0 1px rgba(103, 214, 255, 0.36);
}

.mission-choice.faction-contract-choice {
    border-left: 4px solid var(--faction-color, var(--accent));
}

.mission-choice.faction-contract-choice.selected {
    border-color: var(--faction-color, var(--accent));
    background: color-mix(in srgb, var(--faction-color, var(--accent)) 14%, transparent);
}

.mission-choice strong {
    font-size: 14px;
}

.mission-choice span,
.mission-choice small,
.mission-summary {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.mission-summary {
    display: grid;
    gap: 8px;
    margin: 16px 0;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
}

.mission-choice-meta {
    color: #9fdfff;
    font-weight: 850;
}

.mission-summary-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
}

.mission-summary-row b {
    color: var(--text);
    font-size: 11px;
    text-transform: uppercase;
}

.mission-summary-row span {
    min-width: 0;
}

.product-card,
.inventory-item {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.045);
}

.product-card {
    display: grid;
    gap: 8px;
    padding: 14px;
}

.product-card h3,
.inventory-item h3 {
    margin: 0;
    font-size: 15px;
}

.product-card p,
.inventory-item p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.product-footer,
.inventory-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-top: 3px;
}

.price {
    font-weight: 900;
}

.old-price {
    margin-right: 6px;
    color: var(--muted);
    font-size: 11px;
    text-decoration: line-through;
}

.buy-button,
.use-button {
    padding: 8px 11px;
    color: #07161c;
    background: var(--accent-2);
    font-size: 12px;
    font-weight: 900;
}

.inventory-list {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.inventory-list.hidden,
.arsenal-list.hidden,
.weapon-slots-list.hidden,
.equipment-list.hidden,
.ship-loadout-list.hidden {
    display: none;
}

.inventory-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.inventory-tabs button {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.045);
    font-size: 12px;
    font-weight: 900;
}

.inventory-tabs button.active {
    color: #06151b;
    border-color: transparent;
    background: var(--accent);
}

.inventory-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 14px;
}

.equipment-list,
.ship-loadout-list {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}

.equipment-summary,
.equipment-card,
.ship-loadout-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
}

.equipment-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
}

.equipment-summary span,
.equipment-stat,
.ship-loadout-stat {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.equipment-summary small,
.equipment-stat small,
.ship-loadout-stat small,
.ship-slot-row label,
.ship-loadout-meta {
    color: var(--muted);
    font-size: 10px;
}

.equipment-summary strong,
.equipment-stat strong,
.ship-loadout-stat strong {
    font-size: 12px;
}

.equipment-card,
.ship-loadout-card {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.equipment-card-header,
.ship-loadout-header,
.ship-slot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.equipment-card-title,
.ship-loadout-title {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.equipment-card-title strong,
.ship-loadout-title strong {
    font-size: 13px;
}

.equipment-card-title small,
.ship-loadout-title small {
    color: var(--muted);
    font-size: 10px;
}

.equipment-color-swatch,
.ship-color-swatch {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 50%;
}

.equipment-stats,
.ship-loadout-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.equipment-stat,
.ship-loadout-stat {
    padding: 7px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.18);
}

.ship-loadout-slots {
    display: grid;
    gap: 7px;
}

.ship-slot-row label {
    flex: 0 0 90px;
    font-weight: 800;
}

.ship-slot-select {
    min-width: 0;
    width: 100%;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    background: #151e28;
}

.inventory-item.ally-item {
    border-color: rgba(103, 214, 255, 0.38);
    background: rgba(103, 214, 255, 0.065);
}

.inventory-item.elite-ally-item {
    border-color: rgba(255, 215, 0, 0.72);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.18), rgba(123, 241, 168, 0.07));
    box-shadow: 0 0 0 1px rgba(255, 247, 168, 0.16), 0 0 24px rgba(255, 215, 0, 0.18);
}

.inventory-item-content {
    display: grid;
    gap: 5px;
}

.item-quantity {
    color: var(--accent);
    font-size: 12px;
    font-weight: 900;
}

.arsenal-list,
.weapon-slots-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.weapon-card {
    display: grid;
    gap: 11px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
}

.weapon-slot-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 11px;
    align-items: center;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
}

.weapon-slot-index {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    color: #07161c;
    background: var(--accent);
    font-size: 18px;
    font-weight: 950;
}

.weapon-slot-content {
    min-width: 0;
    display: grid;
    gap: 7px;
}

.weapon-slot-content h3 {
    margin: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weapon-slot-content small {
    color: var(--muted);
    font-size: 11px;
}

.weapon-slot-select {
    width: 100%;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: rgba(8, 15, 22, 0.82);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
}

.weapon-card.locked {
    opacity: 0.58;
}

.weapon-card-header,
.weapon-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.weapon-card-title {
    min-width: 0;
}

.weapon-card h3 {
    margin: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weapon-card small {
    color: var(--muted);
    font-size: 11px;
}

.rarity-pill {
    flex: 0 0 auto;
    padding: 4px 7px;
    border-radius: 999px;
    color: #06151b;
    font-size: 10px;
    font-weight: 900;
}

.weapon-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.weapon-stat {
    display: grid;
    gap: 2px;
    padding: 7px 8px;
    border-radius: 8px;
    background: rgba(8, 15, 22, 0.45);
}

.weapon-stat span {
    color: var(--muted);
    font-size: 10px;
}

.weapon-stat strong {
    color: var(--text);
    font-size: 12px;
}

.weapon-progress {
    display: grid;
    gap: 5px;
}

.weapon-progress-label {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 10px;
}

.weapon-progress-track {
    height: 6px;
    overflow: hidden;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
}

.weapon-progress-track i {
    display: block;
    width: 0;
    height: 100%;
    background: var(--accent);
}

.weapon-modifier-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    min-height: 18px;
    color: #c9f3ff;
    font-size: 10px;
    line-height: 1.45;
}

.weapon-modifier-chip {
    min-width: 0;
    padding: 3px 6px;
    border: 1px solid color-mix(in srgb, var(--modifier-color, var(--accent)) 70%, transparent);
    border-radius: 5px;
    color: var(--modifier-color, var(--accent));
    background: color-mix(in srgb, var(--modifier-color, var(--accent)) 12%, transparent);
    font-size: 9px;
    font-weight: 900;
}

.weapon-card-footer {
    flex-wrap: wrap;
}

.dismantle-button,
.weapon-choice-button {
    border: 1px solid rgba(255, 209, 102, 0.36);
    color: #ffe7a6;
    background: rgba(255, 209, 102, 0.09);
}

.weapon-evolution-card {
    width: min(680px, calc(100vw - 24px));
}

.weapon-evolution-choices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.weapon-evolution-choice {
    display: grid;
    gap: 8px;
    min-height: 142px;
    padding: 14px;
    border: 1px solid var(--line);
    border-top: 3px solid var(--modifier-color, var(--accent));
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.045);
    text-align: left;
}

.weapon-evolution-choice strong {
    font-size: 14px;
}

.weapon-evolution-choice span {
    color: var(--modifier-color, var(--accent));
    font-size: 11px;
    font-weight: 900;
}

.weapon-evolution-choice small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
}

.upgrade-button {
    padding: 8px 11px;
    color: #07161c;
    background: var(--accent-2);
    font-size: 12px;
    font-weight: 900;
}

.upgrade-button:disabled {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.07);
    cursor: not-allowed;
}

.use-button:disabled {
    color: var(--muted);
    background: rgba(255, 255, 255, 0.07);
    cursor: not-allowed;
}

.empty-state {
    padding: 28px 16px;
    border: 1px dashed var(--line);
    border-radius: 14px;
    color: var(--muted);
    text-align: center;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#mobileControls {
    position: absolute;
    left: 50%;
    bottom: 0;
    z-index: 12;
    display: none;
    grid-template-columns: 124px 108px 124px;
    align-items: end;
    justify-content: space-between;
    width: min(100%, 760px);
    min-height: 166px;
    padding: 12px max(10px, env(safe-area-inset-right, 0px)) var(--mobile-bottom-inset) max(10px, env(safe-area-inset-left, 0px));
    transform: translateX(-50%);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.mobile-stick {
    position: relative;
    width: 124px;
    height: 124px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(11, 19, 27, 0.66);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.32), inset 0 0 0 12px rgba(255, 255, 255, 0.025);
    backdrop-filter: blur(8px);
    pointer-events: auto;
    touch-action: none;
    transition: transform 120ms ease, opacity 120ms ease, border-color 120ms ease;
    will-change: transform;
}

.mobile-stick::after {
    content: "";
    position: absolute;
    inset: 26px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.mobile-stick-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    margin: -30px 0 0 -30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #0b151c;
    background: rgba(226, 240, 248, 0.92);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.35);
    font-size: 23px;
    font-weight: 900;
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

.mobile-stick-active {
    border-color: rgba(103, 214, 255, 0.58);
    background: rgba(11, 19, 27, 0.78);
}

.aim-stick {
    justify-self: end;
    border-color: rgba(255, 161, 91, 0.38);
}

.aim-stick .mobile-stick-knob {
    color: #371407;
    background: rgba(255, 171, 96, 0.95);
}

#game-shell:not(.combat-enabled) .aim-stick {
    opacity: 0.42;
    filter: grayscale(0.7);
}

.mobile-action-cluster {
    display: grid;
    grid-template-columns: repeat(2, 48px);
    gap: 9px 7px;
    align-self: center;
    justify-content: center;
    pointer-events: auto;
}

.mobile-action-cluster button {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.23);
    border-radius: 50%;
    color: #f5f8fb;
    background: rgba(12, 21, 29, 0.82);
    box-shadow: 0 5px 16px rgba(0, 0, 0, 0.32);
    font-size: 16px;
    font-weight: 900;
    touch-action: manipulation;
}

#mobileRollButton {
    border-color: rgba(103, 214, 255, 0.48);
    color: #07161c;
    background: rgba(103, 214, 255, 0.92);
    box-shadow: 0 8px 22px rgba(103, 214, 255, 0.22);
    font-size: 20px;
}

#mobilePauseButton {
    border-color: rgba(255, 209, 102, 0.48);
    color: #1f1808;
    background: rgba(255, 209, 102, 0.92);
}

#game-shell.mobile-assist #mobileControls {
    min-height: 222px;
}

.mobile-action-cluster button:active {
    color: #07161c;
    background: var(--accent);
    transform: scale(0.94);
}

.weapon-quick-panel {
    position: absolute;
    left: 50%;
    bottom: calc(var(--mobile-bottom-inset) + 116px);
    z-index: 15;
    display: grid;
    grid-template-columns: repeat(5, 44px);
    gap: 6px;
    width: max-content;
    max-width: calc(100vw - 24px);
    padding: 8px;
    border: 1px solid rgba(126, 221, 177, 0.32);
    border-radius: 12px;
    background: rgba(10, 18, 26, 0.9);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
    backdrop-filter: blur(10px);
    transform: translateX(-50%);
    pointer-events: auto;
}

.weapon-quick-panel.hidden {
    display: none;
}

.weapon-quick-button {
    display: grid;
    grid-template-rows: 14px 1fr 10px;
    align-items: center;
    justify-items: center;
    width: 44px;
    height: 48px;
    padding: 4px 3px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    color: #ecf7fb;
    background: rgba(22, 35, 47, 0.9);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
    font: inherit;
    text-align: center;
    touch-action: manipulation;
}

.weapon-quick-button strong {
    font-size: 12px;
    line-height: 1;
}

.weapon-quick-button span {
    max-width: 100%;
    overflow: hidden;
    color: var(--muted);
    font-size: 8px;
    font-weight: 800;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.weapon-quick-button em {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 8px currentColor;
}

.weapon-quick-button.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(38, 75, 65, 0.94);
}

.weapon-quick-button.locked {
    opacity: 0.45;
    filter: grayscale(0.75);
}

@media (max-width: 760px), (hover: none) and (pointer: coarse) {
    :root {
        /* Android Chrome can report a zero safe-area inset above the system navigation bar. */
        --mobile-bottom-inset: max(32px, env(safe-area-inset-bottom, 0px));
    }

    #game-shell {
        min-height: 0;
    }

    #mobileControls {
        display: grid;
    }

    .weapon-quick-panel {
        grid-template-columns: repeat(5, minmax(38px, 1fr));
        width: min(292px, calc(100vw - 24px));
    }

    .weapon-quick-button {
        width: 100%;
        min-width: 0;
    }

    #helpPanel {
        display: none;
    }

    .combat-control.combat-active {
        top: 112px;
        right: 8px;
        min-width: 176px;
        transform: none;
    }

    .combat-control:not(.combat-active) {
        top: 112px;
        right: 8px;
        width: min(230px, calc(100vw - 16px));
        transform: none;
    }

    .world-event-badge {
        top: 154px;
    }

    .mission-tracker {
        left: 8px;
        top: 118px;
        width: min(360px, calc(100vw - 16px));
        gap: 5px;
        padding: 6px 8px;
        transform: none;
    }

    .mission-tracker-title {
        gap: 7px;
    }

    .mission-tracker-title strong {
        font-size: 11px;
    }

    .mission-tracker-title span {
        font-size: 10px;
    }

    .mission-tracker-stats {
        gap: 4px;
    }

    .mission-tracker-objectives {
        display: none;
    }

    .mission-tracker-pill {
        padding: 3px 5px;
        font-size: 8px;
    }
}

@media (max-width: 920px) {
    #miniMapPanel {
        width: 225px;
    }

    .mission-tracker {
        right: 247px;
        max-width: 360px;
    }

    #helpPanel {
        display: none;
    }

    .onboarding-panel {
        right: 8px;
        bottom: 14px;
        width: min(320px, calc(100vw - 16px));
    }

    #eventPanel {
        width: min(360px, calc(100vw - 28px));
    }
}

@media (max-width: 680px) {
    #hud {
        width: calc(100vw - 28px);
    }

    .role-progress-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .role-faction-row {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .role-relation-pill {
        width: max-content;
    }

    .identity-card {
        padding-right: 10px;
    }

    .stats-card {
        padding: 9px 11px;
    }

    #miniMapPanel {
        top: auto;
        right: 10px;
        bottom: 184px;
        width: 150px;
        padding: 8px;
    }

    #miniMapPanel .panel-title-row,
    .map-legend {
        display: none;
    }

    #miniMap {
        margin-top: 0;
    }

    #eventPanel {
        left: 10px;
        bottom: 184px;
        width: calc(100vw - 180px);
        min-width: 150px;
        padding: 9px 10px;
    }

    #eventLog {
        max-height: 72px;
        font-size: 10px;
    }

    #interactionPrompt {
        bottom: 174px;
        max-width: min(300px, calc(100vw - 96px));
        padding: 8px 11px;
        font-size: 11px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .onboarding-panel {
        left: 10px;
        right: auto;
        bottom: calc(var(--mobile-bottom-inset) + 132px);
        width: min(330px, calc(100vw - 20px));
        padding: 9px 10px;
    }

    .onboarding-steps {
        display: none;
    }

    .onboarding-modal-steps {
        grid-template-columns: 1fr;
    }

    .onboarding-card .modal-title-row {
        display: grid;
    }

    .onboarding-card.modal-wide {
        position: fixed;
        left: 12px;
        right: auto;
        top: 40px;
        width: min(342px, calc(100vw - 24px)) !important;
        max-width: calc(100vw - 24px) !important;
        max-height: calc(100vh - 80px);
        transform: none;
        overflow-x: hidden;
    }

    .onboarding-card * {
        min-width: 0;
        max-width: 100%;
    }

    .onboarding-card .wallet-badge,
    .onboarding-card .modal-subtitle,
    .onboarding-modal-step span {
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .mission-tracker {
        left: 8px;
        top: 124px;
        width: calc(100vw - 16px);
    }

    .mission-tracker-title strong {
        font-size: 12px;
    }

    .mission-tracker-pill,
    .mission-objective-pill {
        padding: 3px 5px;
        font-size: 8px;
    }

    .modal {
        padding: 8px;
    }

    .modal-card {
        width: min(100%, calc(100vw - 16px));
        max-height: calc(100vh - 16px);
        min-width: 0;
        padding: 20px 15px 15px;
        border-radius: 16px;
    }

    .modal-card.modal-wide {
        width: min(100%, calc(100vw - 16px));
    }

    .modal-title-row {
        align-items: flex-start;
    }

    .modal-title-row > * {
        min-width: 0;
    }

    .role-progress-overview,
    .role-progress-columns {
        grid-template-columns: 1fr;
    }

    .product-grid,
    .mission-choice-grid,
    .arsenal-list,
    .weapon-slots-list,
    .weapon-evolution-choices {
        grid-template-columns: 1fr;
    }

    .weapon-evolution-choice {
        min-height: 112px;
    }

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

}

@media (max-height: 650px) {
    #eventPanel {
        display: none;
    }

    #miniMapPanel {
        width: 210px;
    }
}

@media (max-width: 680px) and (max-height: 650px) {
    #mobileControls {
        grid-template-columns: 98px 96px 98px;
        min-height: 132px;
        padding-bottom: var(--mobile-bottom-inset);
    }

    .mobile-stick {
        width: 98px;
        height: 98px;
    }

    .mobile-stick-knob {
        width: 50px;
        height: 50px;
        margin: -25px 0 0 -25px;
    }

    #miniMapPanel {
        bottom: 140px;
        width: 112px;
    }

    #interactionPrompt {
        bottom: 116px;
        max-width: min(260px, calc(100vw - 110px));
    }

    .onboarding-panel {
        bottom: calc(var(--mobile-bottom-inset) + 104px);
        width: calc(100vw - 20px);
    }

    #onboardingDescription,
    .onboarding-reward {
        display: none;
    }
}

.mobile-hud-toggle {
    display: none;
}

@media (max-width: 760px), (hover: none) and (pointer: coarse) {
    .mobile-hud-toggle {
        position: absolute;
        top: 0;
        right: 0;
        z-index: 12;
        display: grid;
        place-items: center;
        width: 48px;
        height: 48px;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: 14px;
        color: var(--text);
        background: var(--panel-strong);
        box-shadow: var(--shadow);
        font-size: 25px;
        line-height: 1;
        pointer-events: auto;
        touch-action: manipulation;
    }

    #game-shell.mobile-hud-expanded #hud {
        max-height: calc(100dvh - 188px);
        padding-top: 116px;
        padding-right: 4px;
        padding-bottom: 8px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        pointer-events: auto;
        scrollbar-width: thin;
    }

    #game-shell.mobile-assist.mobile-hud-expanded #hud {
        max-height: calc(100dvh - 244px);
    }

    #game-shell.mobile-hud-expanded .mobile-hud-toggle {
        position: fixed;
        top: 14px;
        right: 14px;
    }

    #hud > .identity-card,
    #hud > .role-progress-card,
    #hud > .primary-button,
    #hud > .secondary-button,
    .stats-card .stat-row:nth-child(n + 2),
    .stats-card .money-row,
    .combat-card .wanted-row,
    .combat-card .reload-track,
    .combat-card .sync-row,
    #eventPanel,
    #miniMapPanel {
        display: none;
    }

    #hud > .cyber-systems-button {
        position: fixed;
        top: 72px;
        right: 14px;
        z-index: 12;
        display: grid;
        grid-template-columns: 1fr;
        width: 68px;
        height: 48px;
        min-height: 48px;
        padding: 0 7px;
        border-radius: 14px;
        text-align: center;
        pointer-events: auto;
        touch-action: manipulation;
    }

    #hud > .cyber-systems-button .cyber-button-icon,
    #hud > .cyber-systems-button .cyber-button-label,
    #hud > .cyber-systems-button strong {
        display: none;
    }

    #hud > .cyber-systems-button .cyber-button-short {
        display: block;
        font-size: 11px;
        font-weight: 900;
    }

    .stats-card {
        width: calc(100% - 58px);
        min-height: 48px;
        margin-right: 58px;
    }

    .combat-card {
        width: calc(100% - 78px);
        min-height: 48px;
        margin-right: 78px;
    }

    .stats-card {
        padding: 9px 11px;
    }

    #game-shell.mobile-hud-expanded #hud > .identity-card,
    #game-shell.mobile-hud-expanded #hud > .role-progress-card {
        display: flex;
        margin-right: 0;
    }

    #game-shell.mobile-hud-expanded #hud > .role-progress-card {
        display: grid;
    }

    #game-shell.mobile-hud-expanded #hud > .identity-card {
        order: -3;
    }

    #game-shell.mobile-hud-expanded #hud > .auth-button,
    #game-shell.mobile-hud-expanded #hud > .profile-button:not([hidden]) {
        order: -2;
        margin-right: 0;
    }

    #game-shell.mobile-hud-expanded #hud > .primary-button,
    #game-shell.mobile-hud-expanded #hud > .iren-menu-button,
    #game-shell.mobile-hud-expanded #hud > .auth-button,
    #game-shell.mobile-hud-expanded #hud > .profile-button:not([hidden]) {
        display: block;
    }

    #game-shell.mobile-hud-expanded .stats-card,
    #game-shell.mobile-hud-expanded .combat-card {
        width: 100%;
        margin-right: 0;
    }

    #game-shell.mobile-hud-expanded .stats-card .stat-row {
        display: grid;
    }

    #game-shell.mobile-hud-expanded .stats-card .money-row,
    #game-shell.mobile-hud-expanded .combat-card .wanted-row {
        display: flex;
    }

    #game-shell.mobile-hud-expanded .combat-card .reload-track,
    #game-shell.mobile-hud-expanded #eventPanel,
    #game-shell.mobile-hud-expanded #miniMapPanel {
        display: block;
    }

    #game-shell.mobile-hud-expanded .combat-card .sync-row {
        display: flex;
    }

    #game-shell.mobile-hud-expanded #hud > .combat-control,
    #game-shell.mobile-hud-expanded #hud > .combat-control.combat-active {
        position: static;
        display: grid;
        width: 100%;
        min-width: 0;
        padding: 10px;
        border: 1px solid rgba(255, 255, 255, 0.18);
        background: rgba(10, 17, 24, 0.9);
        transform: none;
        backdrop-filter: blur(10px);
    }

    #game-shell.mobile-hud-expanded #hud > .combat-control.combat-active .difficulty-control {
        display: none;
    }

    #game-shell.mobile-hud-expanded #hud > .combat-control.combat-active .combat-mode-button {
        min-height: 42px;
    }

    .equipment-summary,
    .equipment-stats,
    .ship-loadout-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ship-slot-row {
        align-items: stretch;
        flex-direction: column;
        gap: 4px;
    }

    .ship-slot-row label {
        flex: 0 0 auto;
    }

    .cyber-systems-card.modal-wide {
        width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
        padding: 18px 12px 12px;
    }

    .cyber-resource-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cyber-grid {
        grid-template-columns: 1fr;
    }

    .cyber-body-grid {
        grid-template-columns: 1fr;
    }

    .cyber-panel-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .cyber-card-actions {
        align-items: stretch;
        flex-direction: column;
    }

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