body {
    margin: 0;
    padding: 0;
    color: rgba(255, 255, 255, 0.87);
    background-color: #000000;
}

#app {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
    --app-controls-inset: 12px;
    --app-controls-trigger-size: 40px;
    --app-controls-trigger-gap: 8px;
    --ui-shadow-color: rgba(0, 0, 0, 0.52);
    --ui-text-shadow: 0 1px 2px var(--ui-shadow-color);
    --ui-drop-shadow: drop-shadow(0 1px 2px var(--ui-shadow-color));
    --ui-box-shadow: 0 1px 2px var(--ui-shadow-color);
}

.game-interface {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#game-interface[hidden] {
    display: none;
}

#pixi-container {
    width: 100%;
    height: 100%;
}

.leaderboard {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    min-width: 180px;
    max-width: 260px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
    font-family: "Pixel Code", monospace;
}

.leaderboard__title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    text-shadow: var(--ui-text-shadow);
}

.leaderboard__list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.leaderboard__entry {
    display: grid;
    grid-template-columns: 2.5rem 1fr auto;
    gap: 8px;
    align-items: baseline;
    padding: 4px 0;
    border-left: 3px solid transparent;
    font-size: 14px;
    line-height: 1.3;
    --leaderboard-accent: rgba(255, 255, 255, 0.87);
}

.leaderboard__entry + .leaderboard__entry {
    margin-top: 2px;
}

.leaderboard__entry--local {
    border-left-color: var(--leaderboard-accent);
}

.leaderboard__entry--moving {
    position: relative;
    z-index: 1;
}

.leaderboard__rank {
    color: rgba(255, 255, 255, 0.55);
    font-variant-numeric: tabular-nums;
    text-align: right;
    text-shadow: var(--ui-text-shadow);
}

.leaderboard__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--leaderboard-accent);
    text-shadow: var(--ui-text-shadow);
}

.leaderboard__score {
    display: inline-block;
    min-width: 3.5rem;
    padding-right: 4px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    text-align: right;
    color: var(--leaderboard-accent);
    text-shadow: var(--ui-text-shadow);
}

@keyframes leaderboard-score-highlight {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }

    45% {
        transform: scale(1.12);
        filter: brightness(1.35);
    }

    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

.leaderboard__score--changed {
    animation: leaderboard-score-highlight 300ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
    .leaderboard__score--changed {
        animation: none;
    }
}

.leaderboard__empty {
    margin: 0;
    font-size: 13px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.55);
    text-shadow: var(--ui-text-shadow);
}

.hud {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    width: auto;
    max-width: calc(100vw - 24px);
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    pointer-events: none;
    font-family: "Pixel Code", monospace;
    --hud-accent: rgba(255, 255, 255, 0.87);
    --ui-warning-red: #ff0000;
    --ui-meter-track-fill: rgba(255, 255, 255, 0.12);
    --ui-meter-track-outline: rgba(255, 255, 255, 0.08);
    --energy-meter-track-height: 14px;
    --health-heart-wrap-height: 26px;
    --health-heart-outline-width: 2px;
    --health-heart-stroke: var(--ui-meter-track-outline);
    --energy-accent: var(--hud-accent);
    --health-accent: var(--hud-accent);
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
}

.hud .energy-meter,
.hud .health-panel {
    position: static;
    top: auto;
    left: auto;
    z-index: auto;
    width: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
}

.hud .energy-meter {
    flex: 1 1 auto;
    min-width: 160px;
}

.hud .health-panel {
    flex: 0 0 auto;
    padding-left: 0;
    border-left: none;
    margin-top: calc(
        (var(--energy-meter-track-height) - var(--health-heart-wrap-height)) /
            2
    );
}

.health-panel__hearts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hud .health-panel__hearts {
    flex-wrap: nowrap;
}

.health-panel__hearts--impact {
    animation: health-hearts-impact 0.42s ease-out;
}

.health-panel__heart-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
}

.health-panel__heart-wrap--exploding::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--health-accent);
    opacity: 0.85;
    transform: translate(-50%, -50%) scale(0.2);
    animation: health-heart-flash 0.55s ease-out forwards;
    pointer-events: none;
}

.health-panel__heart-wrap--exploding::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 18px;
    height: 18px;
    border: 2px solid var(--health-accent);
    border-radius: 50%;
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.35);
    animation: health-heart-ring 0.62s ease-out forwards;
    pointer-events: none;
}

.health-panel__heart-burst {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.health-panel__heart-burst__particle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--health-accent);
    box-shadow: 0 0 6px color-mix(in srgb, var(--health-accent) 70%, white);
    opacity: 0;
    transform: translate(-50%, -50%) rotate(var(--burst-angle)) translateY(0)
        scale(1);
}

.health-panel__heart-wrap--exploding .health-panel__heart-burst__particle {
    animation: health-heart-particle 0.58s ease-out forwards;
}

.health-panel__heart-wrap--exploding .health-panel__heart-burst__particle:nth-child(1) {
    animation-delay: 0ms;
}
.health-panel__heart-wrap--exploding .health-panel__heart-burst__particle:nth-child(2) {
    animation-delay: 15ms;
}
.health-panel__heart-wrap--exploding .health-panel__heart-burst__particle:nth-child(3) {
    animation-delay: 30ms;
}
.health-panel__heart-wrap--exploding .health-panel__heart-burst__particle:nth-child(4) {
    animation-delay: 45ms;
}
.health-panel__heart-wrap--exploding .health-panel__heart-burst__particle:nth-child(5) {
    animation-delay: 20ms;
}
.health-panel__heart-wrap--exploding .health-panel__heart-burst__particle:nth-child(6) {
    animation-delay: 35ms;
}
.health-panel__heart-wrap--exploding .health-panel__heart-burst__particle:nth-child(7) {
    animation-delay: 50ms;
}
.health-panel__heart-wrap--exploding .health-panel__heart-burst__particle:nth-child(8) {
    animation-delay: 10ms;
}

.health-panel__heart {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    font-family:
        system-ui,
        -apple-system,
        "Segoe UI",
        sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    filter: var(--ui-drop-shadow);
}

.health-panel__heart-wrap:has(.health-panel__heart--empty)::before {
    content: "♥";
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    font-family:
        system-ui,
        -apple-system,
        "Segoe UI",
        sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1;
    color: var(--ui-meter-track-fill);
    -webkit-text-fill-color: var(--ui-meter-track-fill);
    -webkit-text-stroke: var(--health-heart-outline-width) var(--health-heart-stroke);
    paint-order: stroke fill;
    transform: translate(-50%, -50%);
    filter: var(--ui-drop-shadow);
    pointer-events: none;
}

.health-panel__heart--empty {
    color: transparent;
    filter: none;
}

.health-panel__heart--filled {
    color: var(--health-accent);
}

.health-panel--game-over {
    animation: health-heart-empty-game-over-flash 0.3s steps(2, jump-none)
        infinite;
}

@keyframes health-heart-empty-game-over-flash {
    0% {
        --health-heart-stroke: var(--ui-meter-track-outline);
    }

    50% {
        --health-heart-stroke: var(--ui-warning-red);
    }
}

.health-panel--critical .health-panel__heart--filled {
    animation: health-heart-critical-flash 0.3s steps(2, jump-none) infinite;
}

@keyframes health-heart-critical-flash {
    0% {
        color: var(--health-accent);
    }

    50% {
        color: var(--ui-warning-red);
    }
}

@keyframes health-hearts-impact {
    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-3px);
    }

    40% {
        transform: translateX(3px);
    }

    60% {
        transform: translateX(-2px);
    }

    80% {
        transform: translateX(2px);
    }
}

@keyframes health-heart-flash {
    0% {
        opacity: 0.95;
        transform: translate(-50%, -50%) scale(0.2);
    }

    25% {
        opacity: 0.75;
        transform: translate(-50%, -50%) scale(1.8);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2.6);
    }
}

@keyframes health-heart-ring {
    0% {
        opacity: 0.95;
        transform: translate(-50%, -50%) scale(0.35);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(2.8);
    }
}

@keyframes health-heart-particle {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) rotate(var(--burst-angle))
            translateY(0) scale(1.2);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) rotate(var(--burst-angle))
            translateY(-22px) scale(0.15);
    }
}

@keyframes health-heart-lost {
    0% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
        filter: brightness(1);
    }

    18% {
        transform: scale(1.75) rotate(-10deg);
        opacity: 1;
        filter: brightness(2)
            drop-shadow(0 0 10px var(--health-accent));
    }

    45% {
        transform: scale(1.35) rotate(8deg);
        opacity: 0.85;
        filter: brightness(1.4)
            drop-shadow(0 0 6px var(--health-accent));
    }

    100% {
        transform: scale(0.35) rotate(0deg);
        opacity: 0.25;
        filter: brightness(0.7);
    }
}

.health-panel__heart--lost {
    color: var(--health-accent);
    animation: health-heart-lost 0.62s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@media (prefers-reduced-motion: reduce) {
    .health-panel__hearts--impact,
    .health-panel__heart--lost,
    .health-panel--critical .health-panel__heart--filled,
    .health-panel__heart-wrap--exploding::before,
    .health-panel__heart-wrap--exploding::after,
    .health-panel__heart-wrap--exploding .health-panel__heart-burst__particle {
        animation: none;
    }

    .health-panel--critical .health-panel__heart--filled {
        color: var(--ui-warning-red);
    }

    .health-panel--game-over {
        animation: none;
        --health-heart-stroke: var(--ui-warning-red);
    }
}

.energy-meter__track {
    position: relative;
    height: 14px;
    border-radius: 999px;
    background: var(--ui-meter-track-fill);
    box-shadow: inset 0 0 0 1px var(--ui-meter-track-outline);
    filter: var(--ui-drop-shadow);
}

.energy-meter__fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    height: 100%;
    min-width: var(--energy-meter-track-height);
    border-radius: 999px;
    pointer-events: none;
    transition: none;
}

.energy-meter__fill--current {
    z-index: 1;
    background: var(--energy-accent);
    animation: energy-meter-pulse 2.4s ease-in-out infinite;
}

.energy-meter__fill--predicted {
    z-index: 2;
    background: var(--energy-accent);
    animation: none;
}

.energy-meter--preview-active .energy-meter__fill--current {
    animation: none;
    background: color-mix(in srgb, var(--energy-accent) 46%, black);
}

.energy-meter--preview-insufficient .energy-meter__fill--predicted {
    background: var(--ui-warning-red);
}

.energy-meter--critical .energy-meter__value {
    animation: energy-meter-value-critical-flash 0.3s steps(2, jump-none)
        infinite;
}

.energy-meter--attention-insufficient .energy-meter__fill--current {
    animation: energy-meter-fill-critical-flash 0.3s steps(2, jump-none)
        infinite;
}

.energy-meter__labels {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.72);
    text-shadow: var(--ui-text-shadow);
}

.energy-meter__value {
    color: rgba(255, 255, 255, 0.92);
}

.energy-meter__separator,
.energy-meter__max {
    color: rgba(255, 255, 255, 0.48);
}

@keyframes energy-meter-value-critical-flash {
    0% {
        color: rgba(255, 255, 255, 0.92);
    }

    50% {
        color: var(--ui-warning-red);
    }
}

@keyframes energy-meter-fill-critical-flash {
    0% {
        background: var(--energy-accent);
        filter: none;
    }

    50% {
        background: var(--ui-warning-red);
        filter: drop-shadow(0 0 6px rgba(255, 0, 0, 0.75));
    }
}

@keyframes energy-meter-pulse {
    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.12);
    }
}

.energy-meter--shake {
    animation: energy-meter-shake 0.45s ease-in-out;
}

@keyframes energy-meter-shake {
    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-7px);
    }

    40% {
        transform: translateX(7px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .energy-meter__fill {
        animation: none;
        transition: none;
    }

    .energy-meter--preview-active .energy-meter__fill--current {
        animation: none;
    }

    .energy-meter--shake {
        animation: none;
        outline: 2px solid rgba(255, 0, 0, 0.85);
        outline-offset: 2px;
    }

    .energy-meter--critical .energy-meter__value {
        animation: none;
        color: var(--ui-warning-red);
    }

    .energy-meter--preview-insufficient .energy-meter__fill--predicted,
    .energy-meter--attention-insufficient .energy-meter__fill--current {
        animation: none;
        background: var(--ui-warning-red);
    }
}

.game-over {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(1px);
    pointer-events: auto;
    font-family: "Pixel Code", monospace;
}

.game-over--enter {
    animation: game-over-overlay-in 0.45s ease-out both;
}

.game-over--enter .game-over__card {
    animation: game-over-card-in 0.5s ease-out 0.06s both;
}

.game-over[hidden] {
    display: none;
}

@keyframes game-over-overlay-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes game-over-card-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .game-over--enter,
    .game-over--enter .game-over__card {
        animation: none;
    }
}

.game-over__card {
    position: relative;
    width: min(100%, 320px);
    padding: 28px 24px 24px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 12px;
    background: rgba(10, 14, 22, 0.94);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    text-align: center;
}

.game-over__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.game-over__close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
}

.game-over__title {
    margin: 0 0 12px;
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
}

.game-over__score {
    margin: 0 0 20px;
    font-size: 16px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.78);
}

.game-over__play-again {
    min-width: 160px;
    padding: 10px 18px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
    font: inherit;
    font-size: 15px;
    letter-spacing: 0.03em;
    cursor: pointer;
}

.game-over__play-again:hover {
    background: rgba(255, 255, 255, 0.18);
}

.settings-anchor,
.app-controls-anchor {
    position: fixed;
    bottom: var(--app-controls-inset);
    left: var(--app-controls-inset);
    z-index: 150;
    font-family: "Pixel Code", monospace;
}

.settings-anchor__trigger,
.app-controls-anchor__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--app-controls-trigger-size);
    height: var(--app-controls-trigger-size);
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background: rgba(8, 12, 18, 0.78);
    backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, 0.88);
    cursor: pointer;
    font: inherit;
}

.app-controls-anchor__triggers {
    display: inline-flex;
    align-items: center;
    gap: var(--app-controls-trigger-gap);
}

.settings-anchor__trigger:hover,
.app-controls-anchor__trigger:hover {
    background: rgba(8, 12, 18, 0.92);
    color: rgba(255, 255, 255, 0.98);
}

.settings-anchor__trigger:focus-visible,
.app-controls-anchor__trigger:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

.settings-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: min(300px, calc(100vw - 24px));
    padding: 10px 12px 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(8, 12, 18, 0.92);
    backdrop-filter: blur(6px);
    box-shadow: var(--ui-box-shadow);
    font-family: "Pixel Code", monospace;
    color: rgba(255, 255, 255, 0.9);
}

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

.settings-panel__close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.settings-panel__close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
}

.settings-panel__title {
    margin: 0 0 10px;
    padding-right: 24px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.settings-panel__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    cursor: pointer;
}

.settings-panel__row--volume-toggle {
    margin-bottom: 8px;
    cursor: default;
}

.settings-panel__row--volume-toggle .settings-panel__label {
    flex: 0 0 52px;
}

.settings-panel__row--volume-toggle .settings-panel__volume {
    flex: 1;
    min-width: 0;
}

.settings-panel__toggle-wrap {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    cursor: pointer;
}

.settings-panel__row--select {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.settings-panel__label {
    color: rgba(255, 255, 255, 0.86);
}

.settings-panel__toggle {
    width: 16px;
    height: 16px;
    accent-color: #f15b6c;
    cursor: pointer;
}

.settings-panel__volume {
    width: 100%;
    margin: 0;
    accent-color: #f15b6c;
    cursor: pointer;
}

.settings-panel__select {
    width: 100%;
    margin: 0;
    padding: 6px 8px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.settings-panel__select:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

.world-map-host {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    overflow: visible;
    pointer-events: none;
}

.world-map__chrome {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    pointer-events: auto;
}

.world-map__controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    width: min(220px, calc(100vw - 24px));
}

.world-map__drag-handle.ui-panel-drag-handle {
    visibility: hidden;
    pointer-events: none;
}

.world-map__chrome:hover .world-map__drag-handle,
.world-map-host--dragging .world-map__drag-handle {
    visibility: visible;
    pointer-events: auto;
}

.world-map__chrome:hover .world-map__drag-handle:hover,
.world-map-host--dragging .world-map__drag-handle {
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(0, 0, 0, 0.56);
    color: rgba(255, 255, 255, 0.92);
}

.world-map-host--dragging .world-map__drag-handle {
    cursor: grabbing;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.72);
    color: rgba(255, 255, 255, 0.95);
}

.world-map__body {
    position: relative;
    flex: 0 0 auto;
    width: min(220px, calc(100vw - 24px));
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.45);
    box-shadow: var(--ui-drop-shadow);
    overflow: hidden;
    cursor: crosshair;
}

.world-map-host--collapsed .world-map__body {
    display: none;
}

.world-map__toggle {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.42);
    color: rgba(255, 255, 255, 0.62);
    cursor: pointer;
    appearance: none;
    text-shadow: var(--ui-text-shadow);
}

.world-map__toggle:hover {
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(0, 0, 0, 0.56);
    color: rgba(255, 255, 255, 0.92);
}

.world-map__toggle:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

.world-map__toggle-icon {
    display: block;
    width: 0;
    height: 0;
    border-top: 4px solid transparent;
    border-bottom: 4px solid currentColor;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    transform: translateY(-1px);
    transition: transform 140ms ease;
}

.world-map-host--collapsed .world-map__toggle-icon {
    transform: rotate(-135deg) translateY(-1px);
}

.world-map__terrain,
.world-map__overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.world-map__terrain {
    opacity: 0;
    transition: opacity 180ms ease;
}

.world-map-host--terrain-ready .world-map__terrain {
    opacity: 1;
}

.world-map__overlay {
    pointer-events: none;
}

.help-panel {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    z-index: 1;
    box-sizing: border-box;
    width: min(480px, calc(100vw - 24px));
    max-height: min(60vh, 420px);
    padding: 10px 12px 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(8, 12, 18, 0.92);
    backdrop-filter: blur(6px);
    box-shadow: var(--ui-box-shadow);
    pointer-events: auto;
    text-align: left;
    font-family: "Pixel Code", monospace;
}

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

.help-panel__close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.help-panel__close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
}

.help-panel__title {
    margin: 0 0 10px;
    padding-right: 24px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.help-panel__body {
    margin: 0;
    overflow: auto;
    max-height: min(40vh, 280px);
    font-size: 13px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.92);
}

.help-panel__footer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
    height: 24px;
}

.help-panel__position,
.help-panel__nav {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    height: 24px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 13px;
    line-height: 1;
    text-align: center;
    color: rgba(255, 255, 255, 0.82);
}

.help-panel__position {
    min-width: 3.5rem;
    color: rgba(255, 255, 255, 0.72);
    font-variant-numeric: tabular-nums;
}

.help-panel__nav {
    width: 24px;
    cursor: pointer;
    appearance: none;
}

.help-panel__nav:hover {
    color: rgba(255, 255, 255, 0.98);
}

.help-panel__nav:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

.help-panel__binding,
.hints-overlay__binding {
    color: #f15b6c;
    font-weight: 600;
}

.hints-overlay__binding {
    text-shadow: var(--ui-text-shadow);
}

.hints-overlay {
    position: absolute;
    top: 33%;
    left: 50%;
    z-index: 110;
    width: min(720px, calc(100vw - 48px));
    transform: translateX(-50%);
    pointer-events: none;
    text-align: center;
    font-family: "Pixel Code", monospace;
}

.hints-overlay[hidden] {
    display: none;
}

.hints-overlay__stage {
    position: relative;
    overflow: hidden;
}

.hints-overlay__pane {
    margin: 0;
    font-size: 17.5px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: var(--ui-text-shadow);
}

.hints-overlay__pane--exit {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
    animation: hints-overlay-pane-exit 420ms ease-in-out forwards;
    pointer-events: none;
}

.hints-overlay__pane--enter {
    animation: hints-overlay-pane-enter 420ms ease-in-out forwards;
}

@keyframes hints-overlay-pane-exit {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

@keyframes hints-overlay-pane-enter {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hints-overlay__pane--exit,
    .hints-overlay__pane--enter {
        animation: none;
    }
}

.game-console {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    z-index: 1;
    box-sizing: border-box;
    width: min(480px, calc(100vw - 24px));
    padding: 10px 12px 12px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(8, 12, 18, 0.92);
    backdrop-filter: blur(6px);
    box-shadow: var(--ui-box-shadow);
    font-family: "Pixel Code", monospace;
    pointer-events: auto;
}

.game-console[hidden] {
    display: none;
}

.game-console__close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.game-console__close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
}

.game-console__title {
    margin: 0 0 10px;
    padding-right: 24px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.game-console__form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.game-console__prompt {
    color: rgba(255, 255, 255, 0.72);
    font-size: 14px;
    line-height: 1;
}

.game-console__input {
    flex: 1;
    min-width: 0;
    padding: 0;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    font: inherit;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
}

.game-console__output {
    min-height: 1.4em;
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.network-stats-panel {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 3;
    max-width: min(320px, calc(100% - 24px));
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
    pointer-events: none;
    font-family: "Pixel Code", monospace;
}

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

.network-stats-panel__content {
    margin: 0;
    color: rgba(255, 255, 255, 0.92);
    font: inherit;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-line;
    text-shadow: var(--ui-text-shadow);
}

.skills-hotbar {
    position: absolute;
    left: 50%;
    bottom: 20px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transform: translateX(-50%);
    pointer-events: auto;
    font-family: "Pixel Code", monospace;
}

.skills-hotbar__handle-row {
    display: flex;
    justify-content: flex-end;
}

.skills-hotbar__slots {
    display: flex;
    gap: 10px;
}

.skills-hotbar__drag-handle.ui-panel-drag-handle {
    visibility: hidden;
    pointer-events: none;
}

.skills-hotbar:hover .skills-hotbar__drag-handle,
.skills-hotbar--dragging .skills-hotbar__drag-handle {
    visibility: visible;
    pointer-events: auto;
}

.skills-hotbar:hover .skills-hotbar__drag-handle:hover,
.skills-hotbar--dragging .skills-hotbar__drag-handle {
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(0, 0, 0, 0.56);
    color: rgba(255, 255, 255, 0.92);
}

.skills-hotbar--dragging .skills-hotbar__drag-handle {
    cursor: grabbing;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.72);
    color: rgba(255, 255, 255, 0.95);
}

.skills-hotbar__slot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.42);
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    overflow: hidden;
    text-shadow: var(--ui-text-shadow);
    transition:
        transform 80ms ease-out,
        border-color 80ms ease-out,
        background-color 80ms ease-out,
        box-shadow 80ms ease-out;
}

.skills-hotbar__slot--pressed {
    transform: scale(0.9);
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.72);
    box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.62);
}

.skills-hotbar__slot--activate {
    animation: skills-hotbar-slot-activate 0.42s ease-out;
}

@keyframes skills-hotbar-slot-activate {
    0% {
        transform: scale(0.92);
        border-color: rgba(255, 255, 255, 0.55);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35);
    }

    35% {
        transform: scale(1.1);
        border-color: rgba(255, 255, 255, 0.78);
        box-shadow: 0 0 14px 2px rgba(255, 255, 255, 0.28);
    }

    100% {
        transform: scale(1);
        border-color: rgba(255, 255, 255, 0.18);
        box-shadow: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .skills-hotbar__slot {
        transition: none;
    }

    .skills-hotbar__slot--activate {
        animation: none;
        border-color: rgba(255, 255, 255, 0.65);
    }
}

.skills-hotbar__slot--empty {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.24);
    cursor: default;
}

.skills-hotbar__slot--cooldown {
    opacity: 0.72;
}

.skills-hotbar__slot--disabled,
.skills-hotbar__slot:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.skills-hotbar__key {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 10px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.55);
}

.skills-hotbar__icon {
    font-size: 32px;
    line-height: 1;
}

.skills-hotbar__cooldown {
    position: absolute;
    inset: 0;
    background: conic-gradient(
        from -90deg,
        rgba(0, 0, 0, 0.55) calc((1 - var(--cooldown-progress, 1)) * 360deg),
        transparent 0
    );
    pointer-events: none;
}

.skills-hotbar__slot:not(.skills-hotbar__slot--empty):not(:disabled):hover {
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(0, 0, 0, 0.56);
}

.virtual-keyboard {
    position: absolute;
    left: calc(50% - 144px);
    bottom: 110px;
    z-index: 2;
    pointer-events: auto;
    font-family: "Pixel Code", monospace;
}

.ui-panel-drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.42);
    color: rgba(255, 255, 255, 0.62);
    cursor: grab;
    touch-action: none;
    text-shadow: var(--ui-text-shadow);
}

.ui-panel-drag-handle::before {
    content: "⠿";
    font-size: 11px;
    line-height: 1;
}

.virtual-keyboard__row--handle {
    justify-content: flex-end;
}

.virtual-keyboard__drag-handle {
    visibility: hidden;
    pointer-events: none;
}

.virtual-keyboard:hover .virtual-keyboard__drag-handle,
.virtual-keyboard--dragging .virtual-keyboard__drag-handle {
    visibility: visible;
    pointer-events: auto;
}

.virtual-keyboard:hover .virtual-keyboard__drag-handle:hover,
.virtual-keyboard--dragging .virtual-keyboard__drag-handle {
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(0, 0, 0, 0.56);
    color: rgba(255, 255, 255, 0.92);
}

.virtual-keyboard--dragging .virtual-keyboard__drag-handle {
    cursor: grabbing;
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.72);
    color: rgba(255, 255, 255, 0.95);
}

.virtual-keyboard__grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.virtual-keyboard__row {
    display: flex;
    gap: 8px;
}

.virtual-keyboard__spacer {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
}

.virtual-keyboard__slot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.42);
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    overflow: hidden;
    text-shadow: var(--ui-text-shadow);
    transition:
        transform 80ms ease-out,
        border-color 80ms ease-out,
        background-color 80ms ease-out,
        box-shadow 80ms ease-out;
}

.virtual-keyboard__slot--pressed {
    transform: scale(0.9);
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.72);
    box-shadow: inset 0 3px 10px rgba(0, 0, 0, 0.62);
}

.virtual-keyboard__slot--activate {
    animation: virtual-keyboard-slot-activate 0.42s ease-out;
}

@keyframes virtual-keyboard-slot-activate {
    0% {
        transform: scale(0.92);
        border-color: rgba(255, 255, 255, 0.55);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.35);
    }

    35% {
        transform: scale(1.1);
        border-color: rgba(255, 255, 255, 0.78);
        box-shadow: 0 0 14px 2px rgba(255, 255, 255, 0.28);
    }

    100% {
        transform: scale(1);
        border-color: rgba(255, 255, 255, 0.18);
        box-shadow: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .virtual-keyboard__slot {
        transition: none;
    }

    .virtual-keyboard__slot--activate {
        animation: none;
        border-color: rgba(255, 255, 255, 0.65);
    }
}

.virtual-keyboard__slot--disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.virtual-keyboard__key {
    position: absolute;
    top: 3px;
    left: 5px;
    font-size: 9px;
    line-height: 1;
    color: rgba(255, 255, 255, 0.55);
}

.virtual-keyboard__icon {
    font-size: 22px;
    line-height: 1;
}

.virtual-keyboard__slot:not(.virtual-keyboard__slot--disabled):hover {
    border-color: rgba(255, 255, 255, 0.34);
    background: rgba(0, 0, 0, 0.56);
}

