/* imp/web-canvas/style.css — derived from web-canvas.dsr */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --world-bg-x: 0px;
    --world-bg-y: 0px;
    --world-mist-far-x: 0px;
    --world-mist-far-y: 0px;
    --world-mist-near-x: 0px;
    --world-mist-near-y: 0px;
    --world-mist-far-scale: 980px 760px;
    --world-mist-near-scale: 720px 560px;
    --world-bg-alpha: 0.13;
    --world-haze-top-alpha: 0.09;
    --world-haze-bottom-alpha: 0.27;
    --join-radius: 8px;
    --joystick-footprint-default-size: clamp(212px, 35vw, 340px); /* @ds:6896cdc6 */
    --joystick-footprint-max-size: 61vmin; /* @ds:6896cdc6 */
    --joystick-footprint-size: min(var(--joystick-footprint-default-size), var(--joystick-footprint-max-size)); /* @ds:6896cdc6 */
    --joystick-knob-size: 42px;
    --joystick-size: calc(var(--joystick-footprint-size) - var(--joystick-knob-size)); /* @ds:6896cdc6 */
    --bottom-info-bar-height: 54px;
    --top-info-panel-top: 0px;
    --top-info-panel-height: 68px;
    --top-info-panel-gap: 10px;
    --hud-row-top-padding: 30px; /* @fix:6a7b8c9d */
    --hud-row-right-padding: 28px; /* @fix:6a7b8c9d */
    --hud-control-gap: 18px; /* @fix:6a7b8c9d */
    --player-metrics-radius: 26px; /* @fix:zen-mode */
    --viewport-scale-widget-height: 164px;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #04263b;
    font-family: system-ui, -apple-system, sans-serif;
    overscroll-behavior: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* The game surface is operated by touch/click gestures rather than text selection. */
body,
body * {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* Keep the join name editable while the game UI remains selection-free. */
#join-form input[type="text"],
#join-form textarea {
    user-select: text;
    -webkit-user-select: text;
    -webkit-touch-callout: default;
}

img,
svg,
object,
canvas {
    -webkit-user-drag: none;
}

button,
[role="button"],
select {
    -webkit-tap-highlight-color: transparent;
}

button:focus,
button:focus-visible,
[role="button"]:focus,
[role="button"]:focus-visible,
select:focus,
select:focus-visible {
    outline: none;
}

/* @ds:2b3e71e0 @ia:3983084a @fix:4bbc0692 */
body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
}

body::before {
    z-index: 0;
    background-image: url("./assets/back.png");
    background-position: var(--world-bg-x) var(--world-bg-y);
    background-repeat: repeat;
    opacity: var(--world-bg-alpha);
}

/* @ds:a43de7ec */
body::after {
    z-index: 1;
    background: linear-gradient(
        180deg,
        rgba(210, 240, 255, var(--world-haze-top-alpha)),
        rgba(210, 240, 255, 0) 42%,
        rgba(1, 12, 24, var(--world-haze-bottom-alpha))
    );
}

#world-mist-far,
#world-mist-near {
    position: fixed;
    z-index: 1;
    inset: -20%;
    pointer-events: none;
    will-change: background-position;
}

#world-mist-far {
    background-image:
        radial-gradient(ellipse 52% 34% at 14% 22%, rgba(69, 177, 204, 0.18), transparent 72%),
        radial-gradient(ellipse 44% 30% at 78% 66%, rgba(34, 138, 173, 0.14), transparent 74%),
        radial-gradient(ellipse 36% 25% at 42% 88%, rgba(101, 204, 221, 0.10), transparent 76%);
    background-position:
        var(--world-mist-far-x) var(--world-mist-far-y),
        var(--world-mist-far-x) var(--world-mist-far-y),
        var(--world-mist-far-x) var(--world-mist-far-y);
    background-repeat: repeat;
    background-size: var(--world-mist-far-scale);
    filter: blur(16px);
    opacity: 0.2;
}

#world-mist-near {
    background-image:
        radial-gradient(ellipse 48% 36% at 72% 18%, rgba(84, 193, 217, 0.14), transparent 70%),
        radial-gradient(ellipse 58% 32% at 18% 72%, rgba(21, 107, 143, 0.16), transparent 73%),
        radial-gradient(ellipse 32% 24% at 84% 84%, rgba(96, 197, 214, 0.10), transparent 76%);
    background-position:
        var(--world-mist-near-x) var(--world-mist-near-y),
        var(--world-mist-near-x) var(--world-mist-near-y),
        var(--world-mist-near-x) var(--world-mist-near-y);
    background-repeat: repeat;
    background-size: var(--world-mist-near-scale);
    /* filter: blur(22px); */
    opacity: 0.2;
}

#game {
    position: fixed;
    inset: 0;
    z-index: 2;
    display: block;
    width: 100vw;
    height: 100vh;
    background: transparent;
    cursor: crosshair;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* @ds:7f1a2c63 @ds:b6e39d14 */
#startup-splash {
    position: fixed;
    z-index: 9;
    inset: 0;
    pointer-events: none;
    background-color: #04263b;
    background-image: url("./assets/start.png");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: 0;
    transform: scale(1.05);
    transform-origin: center;
    animation: startupSplashReveal 900ms ease both;
    will-change: opacity, transform;
}

#startup-splash.is-game {
    animation: startupSplashHide 650ms ease forwards;
}

@keyframes startupSplashReveal {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes startupSplashHide {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    #startup-splash {
        animation: none;
        opacity: 1;
        transform: none;
    }

    #startup-splash.is-game {
        animation: none;
        opacity: 0;
        transform: scale(1);
    }
}

#hud {
    z-index: 3;
    position: fixed;
    top: var(--top-info-panel-top);
    left: 0;
    right: 0;
    height: var(--top-info-panel-height);
    display: block;
    color: #cdeeff;
    font-size: 14px;
    letter-spacing: 0;
    pointer-events: none;
    padding: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    user-select: none;
    -webkit-user-select: none;
}

#hud .hud-row {
    display: grid;
    grid-template-columns: 48px 1fr 76px;
    gap: 14px;
    align-items: center;
    height: 100%;
    padding: 0 16px;
}

#hud .hud-row > #player-metrics {
    grid-column: 2;
}

/* @fix:6a7b8c9d */
#hud-right-controls {
    position: fixed;
    z-index: 4;
    top: calc(var(--top-info-panel-top) + var(--hud-row-top-padding));
    right: max(var(--hud-row-right-padding), env(safe-area-inset-right));
    display: flex;
    flex: 0 0 auto;
    min-width: 0;
    min-height: 0;
    max-height: calc(100vh - var(--top-info-panel-top) - var(--hud-row-top-padding) - 8px);
    max-height: calc(100dvh - var(--top-info-panel-top) - var(--hud-row-top-padding) - 8px);
    flex-direction: column;
    align-items: flex-end;
    gap: var(--hud-control-gap);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 0 6px;
    pointer-events: auto;
    touch-action: pan-y;
    scrollbar-width: none;
    overscroll-behavior: contain;
}

#hud-right-controls::-webkit-scrollbar,
#viewport-control-tools::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

#hud-right-controls > button {
    flex: 0 0 auto;
    grid-column: auto;
}

#user-fish-metrics {
    justify-self: center;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 32px;
    min-width: 0;
    color: rgba(217, 245, 255, 0.58);
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
}

#eaten {
    color: #ffffff;
    font-weight: 800;
}

#lifetime {
    width: min(42vw, 180px);
    height: 18px;
    border: 2px solid rgba(237, 248, 255, 0.68);
    background: rgba(4, 38, 59, 0.56);
    overflow: hidden;
}

#lifetime-bar {
    display: block;
    width: 100%;
    height: 100%;
    background: #7bd88f;
    transform-origin: left center;
    transform: scaleX(1);
}

#hud .toggle {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: #edf8ff;
}

#hud .toggle input {
    width: 16px;
    height: 16px;
    accent-color: #6ed7ef;
}

/* @ds:58200142 @ia:3983084a */
#join {
    z-index: 10;
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background:
        linear-gradient(180deg, rgba(3, 41, 58, 0.62), rgba(2, 22, 35, 0.82)),
        repeating-linear-gradient(135deg, rgba(142, 190, 202, 0.045) 0 2px, transparent 2px 18px),
        url("./assets/start.png") center / cover no-repeat;
    user-select: auto;
    -webkit-user-select: auto;
}

#join[hidden] {
    display: none;
}

#join {
    background: transparent;
}

#leave-game[hidden],
#game-menu-toggle[hidden],
#world-map-toggle[hidden],
#flow-map-toggle[hidden],
#control-modes[hidden],
#control-help[hidden],
#player-metrics[hidden] {
    display: none;
}

#join-form {
    position: relative;
    display: grid;
    gap: 16px;
    width: min(430px, calc(100vw - 36px));
    padding: 22px;
    border: 2px solid rgba(205, 238, 255, 0.56);
    border-radius: var(--join-radius);
    background:
        radial-gradient(circle at 100% 0, rgba(132, 170, 184, 0.16), transparent 34%),
        linear-gradient(180deg, rgba(7, 45, 64, 0.96), rgba(2, 29, 45, 0.98));
    box-shadow:
        0 22px 60px rgba(0, 0, 0, 0.46),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 -5px 0 rgba(0, 0, 0, 0.18);
    color: #edf8ff;
    overflow: hidden;
}

#join-form::before,
#join-form::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

#join-form::before {
    right: -32px;
    top: -34px;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 28px 28px, rgba(221, 238, 244, 0.16) 0 9px, transparent 10px),
        radial-gradient(circle at 76px 26px, rgba(221, 238, 244, 0.14) 0 13px, transparent 14px),
        radial-gradient(circle at 42px 82px, rgba(221, 238, 244, 0.12) 0 17px, transparent 18px),
        radial-gradient(circle at 98px 88px, rgba(221, 238, 244, 0.12) 0 11px, transparent 12px),
        rgba(86, 137, 155, 0.18);
    opacity: 0.7;
}

.join-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding-bottom: 4px;
}

.join-header strong,
.join-header span {
    display: block;
    letter-spacing: 0;
}

.join-header strong {
    color: #ffffff;
    font-size: 22px;
    line-height: 1;
}

.join-header > div:last-child > span {
    margin-top: 4px;
    color: rgba(237, 248, 255, 0.72);
    font-size: 13px;
}

.join-header > div:last-child {
    min-width: 0;
}

.join-bait {
    position: relative;
    flex: 0 0 auto;
    width: 76px;
    height: 72px;
}

.join-bait object {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 7px 8px rgba(0, 0, 0, 0.26));
    pointer-events: none;
}

#join-form label {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 8px;
    color: rgba(237, 248, 255, 0.76);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

#join-form input[type="text"] {
    width: 100%;
    min-height: 46px;
    border: 2px solid rgba(205, 238, 255, 0.48);
    border-radius: var(--join-radius);
    background: rgba(2, 28, 44, 0.82);
    color: #edf8ff;
    padding: 9px 12px;
    font: inherit;
    font-size: 20px;
    font-weight: 800;
    text-transform: none;
    outline: none;
    box-shadow: inset 0 4px 0 rgba(0, 0, 0, 0.14);
    user-select: text;
    -webkit-user-select: text;
}

#join-form input[type="text"]:focus {
    border-color: #d3b06a;
    box-shadow:
        0 0 0 3px rgba(211, 176, 106, 0.16),
        inset 0 4px 0 rgba(0, 0, 0, 0.14);
}

#join-form input[type="color"] {
    width: 70px;
    height: 48px;
    border: 2px solid rgba(237, 248, 255, 0.7);
    border-radius: var(--join-radius);
    background: #dbe8ee;
    padding: 4px;
    cursor: pointer;
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.22);
}

#join-form .toggle {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
    width: fit-content;
    min-height: 42px;
    padding: 8px 12px;
    border: 2px solid rgba(169, 197, 215, 0.34);
    border-radius: var(--join-radius);
    background: rgba(35, 54, 84, 0.72);
    color: #edf8ff;
    cursor: pointer;
    text-transform: none;
}

#join-form .toggle input {
    width: 20px;
    height: 20px;
    accent-color: #d3b06a;
}

#join-form button,
#game-menu-toggle,
#world-map-toggle,
#debug-mode-toggle,
#leave-game,
#control-modes button {
    border: 1px solid rgba(205, 238, 255, 0.36);
    background: rgba(110, 215, 239, 0.18);
    color: #edf8ff;
    padding: 7px 10px;
    cursor: pointer;
}

#join-form button {
    position: relative;
    z-index: 1;
    min-height: 50px;
    border: 2px solid rgba(205, 238, 255, 0.58);
    border-radius: var(--join-radius);
    background: transparent;
    color: #edf8ff;
    font-size: 18px;
    font-weight: 900;
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.24),
        inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

#join-form button:hover {
    border-color: rgba(230, 206, 146, 0.82);
    color: #ffffff;
    box-shadow:
        0 10px 24px rgba(0, 0, 0, 0.24),
        inset 0 0 0 1px rgba(230, 206, 146, 0.18);
}

#join-form button:active {
    transform: translateY(1px);
    box-shadow:
        0 6px 16px rgba(0, 0, 0, 0.22),
        inset 0 0 0 1px rgba(230, 206, 146, 0.18);
}

/* @ds:277a51d7 */
#join {
    display: grid;
    align-items: center;
    justify-items: start;
    padding: clamp(28px, 7vw, 120px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: transparent;
}

#join-form {
    width: min(420px, 100%);
    gap: 0;
    padding: 34px;
    border: 1px solid rgba(203, 237, 255, 0.20);
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(5, 53, 76, 0.05), rgba(2, 36, 61, 0.05));
    /* background: linear-gradient(145deg, rgba(5, 53, 76, 0.84), rgba(2, 36, 61, 0.90)); */
    box-shadow: 0 24px 70px rgba(0, 8, 24, 0.44), inset 0 1px 0 rgba(255, 255, 255, 0.09);
    backdrop-filter: blur(4px);
}

#join-form::before,
#join-form::after {
    display: none;
}

#join-form > :not(.join-corner-decoration) {
    position: relative;
    z-index: 1;
}

.join-corner-decoration {
    position: absolute;
    top: -48px;
    right: -74px;
    width: 222px;
    height: 315px;
    opacity: 0.72;
    pointer-events: none;
}

.join-header {
    margin-bottom: 42px;
}

.join-header strong {
    font-size: 22px;
    font-weight: 760;
    letter-spacing: -0.045em;
    line-height: 0.84;
}

.join-header > div:last-child > span {
    margin-top: 7px;
    color: #b5deec;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.join-bait {
    width: 48px;
    height: 48px;
}

.join-intro {
    display: block;
    margin-bottom: 28px;
}

.join-intro p {
    margin: 0 0 9px;
    color: #a4e7f6;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.join-intro h1 {
    margin: 0;
    color: #f5fbff;
    font-size: 32px;
    font-weight: 680;
    letter-spacing: -0.045em;
    line-height: 1.1;
}

.join-intro > span {
    display: block;
    max-width: 300px;
    margin-top: 12px;
    color: #b5deec;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
    text-transform: none;
}

#join-form .join-field {
    gap: 8px;
    margin-bottom: 22px;
    color: #f5fbff;
    font-size: 13px;
    font-weight: 620;
    letter-spacing: 0;
    text-transform: none;
}

#join-form input[type="text"] {
    min-height: 50px;
    padding: 0 14px;
    border: 1px solid rgba(204, 240, 255, 0.39);
    border-radius: 10px;
    background: rgba(2, 30, 49, 0.62);
    color: #f5fbff;
    font-size: 16px;
    font-weight: 500;
    box-shadow: none;
}

#join-form input[type="text"]:focus {
    border-color: #a9eaf5;
    box-shadow: 0 0 0 3px rgba(110, 215, 239, 0.17);
}

#join-form .join-colour {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
    padding: 12px;
    border: 1px solid rgba(203, 237, 255, 0.17);
    border-radius: 12px;
    background: rgba(3, 41, 61, 0.52);
    color: #f5fbff;
    text-transform: none;
}

.join-fish-preview {
    display: grid;
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    place-items: center;
    overflow: visible;
    background: transparent;
    box-shadow: none;
}

.join-fish-preview object {
    display: block;
    width: 54px;
    height: auto;
    filter: drop-shadow(0 5px 4px rgba(0, 13, 44, 0.35));
    transform: scaleX(-1);
    pointer-events: none;
}

.join-colour-copy strong,
.join-colour-copy small {
    display: block;
}

.join-colour-copy strong {
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 650;
}

.join-colour-copy small {
    color: #b5deec;
    font-size: 12px;
    font-weight: 400;
}

.join-colour-swatch {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    box-shadow: 0 0 0 2px var(--join-swatch-ring, rgba(229, 244, 255, 0.9));
}

.join-colour-swatch > span {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: var(--join-swatch-color, #72d9ef);
}

#join-form .join-colour-swatch input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.join-tiers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 0 0 25px;
    padding: 0;
    border: 0;
}

.join-tiers legend {
    width: 100%;
    margin-bottom: 8px;
    color: #f5fbff;
    font-size: 13px;
    font-weight: 620;
}

#join-form .join-tier-card {
    position: relative;
    display: block;
    min-height: 84px;
    padding: 12px;
    border: 1px solid rgba(203, 237, 255, 0.20);
    border-radius: 11px;
    background: rgba(2, 30, 49, 0.42);
    color: #f5fbff;
    cursor: pointer;
    letter-spacing: 0;
    text-transform: none;
}

.join-tier-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    overflow: hidden;
    white-space: nowrap;
}

.join-tier-card:has(input:checked) {
    border-color: #8edfeb;
    background: rgba(42, 138, 165, 0.16);
    box-shadow: inset 0 0 0 1px rgba(142, 223, 235, 0.12);
}

.join-tier-card:has(input:checked)::after {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 7px;
    height: 7px;
    content: "";
    border-radius: 50%;
    background: #8edfeb;
    box-shadow: 0 0 0 3px rgba(142, 223, 235, 0.16);
}

.join-tier-card--free:has(input:checked) {
    border-color: #62e0b3;
    background: linear-gradient(145deg, rgba(53, 193, 150, 0.24), rgba(8, 81, 87, 0.28));
    box-shadow: inset 0 0 0 1px rgba(141, 245, 207, 0.22), 0 8px 18px rgba(15, 148, 113, 0.12);
}

.join-tier-card--free:has(input:checked)::after {
    background: #8df5cf;
    box-shadow: 0 0 0 4px rgba(141, 245, 207, 0.18);
}

.join-tier-card--paid:has(input:checked) {
    border-color: #df92ff;
    background: linear-gradient(145deg, rgba(168, 81, 205, 0.27), rgba(79, 36, 120, 0.30));
    box-shadow: inset 0 0 0 1px rgba(240, 180, 255, 0.24), 0 8px 18px rgba(163, 73, 205, 0.14);
}

.join-tier-card--paid:has(input:checked)::after {
    background: #efb5ff;
    box-shadow: 0 0 0 4px rgba(239, 181, 255, 0.18);
}

.join-tier-card:has(input:focus-visible) {
    outline: 3px solid #d3f6ff;
    outline-offset: 2px;
}

.join-tier-card strong,
.join-tier-card small {
    display: block;
}

.join-tier-card strong {
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 660;
}

.join-tier-card small {
    color: #b5deec;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.35;
}

#join-form button {
    min-height: 52px;
    border: 0;
    border-radius: 10px;
    background: #8edfeb;
    color: #043047;
    font-size: 15px;
    font-weight: 720;
    box-shadow: 0 8px 20px rgba(0, 11, 45, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

#join-form button:hover {
    border: 0;
    background: #b1ebf4;
    color: #043047;
    box-shadow: 0 8px 20px rgba(0, 11, 45, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

.join-note {
    margin: 13px 0 0;
    color: #91c5d6;
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
}

@media (max-width: 720px) {
    #join {
        align-items: start;
        justify-items: center;
        padding: 28px 16px;
        overflow-y: auto;
    }

    #join-form { padding: 27px 23px; }
}

#leave-game {
    pointer-events: auto;
    font-size: 12px;
}

#game-menu-toggle {
    pointer-events: auto;
    display: inline-grid;
    place-items: center;
    gap: 3px;
    width: 48px;
    height: 48px;
    padding: 7px;
    touch-action: manipulation;
    justify-self: start;
}

#game-menu-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: currentColor;
}

#world-map-toggle {
    pointer-events: auto;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 9px;
    justify-self: end;
    touch-action: manipulation;
}

#world-map-toggle span {
    position: relative;
    display: block;
    width: 26px;
    height: 22px;
    border: 2px solid currentColor;
    border-radius: 5px;
    transform: skewY(-8deg);
    opacity: 0.92;
}

#world-map-toggle span::before,
#world-map-toggle span::after {
    content: "";
    position: absolute;
    top: -2px;
    display: block;
    width: 2px;
    height: 22px;
    background: currentColor;
    transform: skewY(8deg);
}

#world-map-toggle span::before { left: 7px; }
#world-map-toggle span::after { left: 15px; }

#world-map-toggle[aria-pressed="true"] {
    background: rgba(110, 215, 239, 0.34);
    border-color: rgba(205, 238, 255, 0.72);
}

/* @ds:f3a1c7d9 @ds:3a980720 */
#world-map-toggle,
#sync-segments-toggle,
#flow-map-toggle,
#flow-vectors-toggle,
#danger-map-toggle,
#info-panel-toggle,
#decorative-sparks-test-toggle { grid-column-start: 3; }
#sync-segments-toggle,
#flow-map-toggle,
#flow-vectors-toggle,
#danger-map-toggle,
#info-panel-toggle,
#decorative-sparks-test-toggle { pointer-events: auto; display: grid; place-items: center; justify-self: end; width: 38px; height: 38px; padding: 7px; border: 1px solid rgba(205, 238, 255, .36); border-radius: 12px; background: rgba(110, 215, 239, .18); color: #edf8ff; cursor: pointer; }
#sync-segments-toggle svg,
#flow-map-toggle svg,
#flow-vectors-toggle svg,
#danger-map-toggle svg,
#info-panel-toggle svg,
#decorative-sparks-test-toggle svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#sync-segments-toggle[aria-pressed="true"],
#flow-map-toggle[aria-pressed="true"],
#flow-vectors-toggle[aria-pressed="true"],
#danger-map-toggle[aria-pressed="true"],
#info-panel-toggle[aria-pressed="true"],
#decorative-sparks-test-toggle[aria-pressed="true"] { background: rgba(110, 215, 239, .34); border-color: rgba(205, 238, 255, .72); }

#control-modes {
    pointer-events: auto;
    gap: 6px;
    touch-action: none;
}

#control-modes button {
    font-size: 12px;
    padding: 5px 8px;
}

#debug-mode-toggle[aria-pressed="true"],
#control-modes button[aria-pressed="true"] {
    background: rgba(255, 228, 92, 0.22);
    border-color: rgba(255, 228, 92, 0.55);
}

#control-help {
    opacity: 0.6;
    font-size: 12px;
    max-width: min(80vw, 520px);
    margin: 0;
}

/* @ds:2e91f6d4 @ds:b9136c2e @ds:c5a92431 */
#player-metrics {
    position: fixed;
    z-index: 3;
    left: 50%;
    top: calc(var(--top-info-panel-top) + var(--top-info-panel-height) + var(--top-info-panel-gap));
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    gap: 18px;
    min-width: 0;
    padding: 10px 14px;
    border-radius: var(--player-metrics-radius);
    color: #edf8ff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
    pointer-events: auto;
    user-select: none;
    cursor: ns-resize;
    touch-action: none;
    -webkit-user-select: none;
}

#player-life {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
}

#player-name {
    max-width: min(42vw, 180px);
    overflow: hidden;
    color: #edf8ff;
    font-size: 26px;
    font-weight: 800;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#player-size {
    display: grid;
    grid-template-columns: auto;
    gap: 1px;
    min-width: 72px;
    white-space: nowrap;
}

#player-size-label {
    color: rgba(237, 248, 255, 0.68);
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
}

#player-size-value {
    color: #ffffff;
    font-size: 30px;
    font-weight: 800;
    line-height: 0.95;
    font-variant-numeric: tabular-nums;
}

/* @ds:c656f0ec */
#player-speed-metric {
    position: absolute;
    z-index: 4;
    left: 50%;
    top: 50%;
    display: block;
    color: #7bd88f;
    font-weight: 800;
    letter-spacing: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.62);
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 180ms ease;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

#player-speed-metric.is-visible {
    opacity: 1;
}

#player-speed-percent {
    font-size: 52px;
    line-height: 0.95;
    font-variant-numeric: tabular-nums;
}

#player-speed-real {
    color: rgba(217, 245, 255, 0.84);
    font-variant-numeric: tabular-nums;
}

/* @ds:e42a7c19 @fix:b8c4d9e2 */
#world-info {
    position: fixed;
    z-index: 3;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--bottom-info-bar-height);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(5px, 1.25vw, 12px);
    padding: 3px 8px calc(3px + env(safe-area-inset-bottom));
    color: #d9f5ff;
    font-size: 8px;
    line-height: 1.25;
    letter-spacing: 0;
    background: rgba(4, 38, 59, 0.26);
    border-top: 1px solid rgba(205, 238, 255, 0.24);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

#world-info .world-info-item {
    display: grid;
    grid-template-columns: auto;
    gap: 1px;
    align-items: center;
    justify-items: start;
    min-width: 24px;
}

#world-info .world-info-item span {
    color: rgba(217, 245, 255, 0.72);
    font-weight: 400;
}

#world-info strong,
#world-info em {
    font-style: normal;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    text-align: left;
}

#world-info em {
    color: rgba(217, 245, 255, 0.78);
}

#world-info[hidden],
#flow-info-panel[hidden],
#records-panel[hidden],
#info-panel-toggle[hidden] {
    display: none;
}

.diagnostic-info-panel {
    position: fixed;
    z-index: 3;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: var(--bottom-info-bar-height);
    box-sizing: border-box;
    padding: 7px 12px calc(7px + env(safe-area-inset-bottom));
    color: #d9f5ff;
    background: rgba(4, 38, 59, 0.84);
    border-top: 1px solid rgba(205, 238, 255, 0.24);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

.diagnostic-info-panel header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px;
    color: rgba(217, 245, 255, 0.76);
    font-size: 9px;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.diagnostic-info-panel header span {
    color: rgba(217, 245, 255, 0.46);
    font-size: 8px;
    letter-spacing: 0.04em;
    text-transform: none;
}

.diagnostic-info-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.diagnostic-info-grid span {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding-right: 8px;
    border-right: 1px solid rgba(217, 245, 255, 0.13);
}

.diagnostic-info-grid span:last-child { border-right: 0; }

.diagnostic-info-panel em,
.diagnostic-info-panel strong {
    font-style: normal;
    font-variant-numeric: tabular-nums;
}

.diagnostic-info-grid em {
    color: rgba(181, 222, 236, 0.58);
    font-size: 7px;
    font-weight: 740;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.diagnostic-info-grid strong {
    color: #edf8ff;
    font-size: 13px;
    font-weight: 760;
}

.records-info-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    max-height: min(34vh, 300px);
    overflow: auto;
    pointer-events: auto;
}

.records-block { min-width: 0; }

.records-block header { margin-bottom: 4px; }

.records-block table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 10px;
}

.records-block th,
.records-block td {
    padding: 2px 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.records-block th:first-child,
.records-block td:first-child { text-align: left; }

.records-block th {
    color: rgba(181, 222, 236, 0.58);
    font-size: 7px;
    font-weight: 740;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.records-block td {
    color: #edf8ff;
    border-top: 1px solid rgba(217, 245, 255, 0.1);
}

#game-menu {
    position: fixed;
    z-index: 4;
    left: 28px;
    top: calc(var(--top-info-panel-top) + var(--top-info-panel-height) + 8px);
    width: min(640px, calc(100vw - 56px));
    display: grid;
    gap: 8px;
    padding: 10px;
    color: #edf8ff;
    font-size: 12px;
    background: rgba(4, 38, 59, 0.78);
    border: 1px solid rgba(205, 238, 255, 0.34);
    pointer-events: auto;
}

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

#world-map[hidden] {
    display: none;
}

#game-menu .menu-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

#game-menu .menu-meta {
    justify-content: flex-start;
}

#debug-mode-toggle {
    justify-self: end;
    width: 76px;
    min-height: 36px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
    pointer-events: auto;
    touch-action: manipulation;
}

/* @ds:e001d967 */
#viewport-fish-capacity {
    align-items: center;
}

#viewport-fish-capacity span {
    color: rgba(237, 248, 255, 0.76);
    font-weight: 700;
}

#viewport-fish-capacity-select {
    min-width: 84px;
    border: 1px solid rgba(205, 238, 255, 0.34);
    background: rgba(4, 38, 59, 0.68);
    color: #edf8ff;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 8px;
}

/* @fix:6a7b8c9d */
#viewport-left-controls {
    position: fixed;
    z-index: 4;
    top: calc(var(--top-info-panel-top) + var(--hud-row-top-padding));
    left: 32px;
    display: flex;
    flex: 0 0 auto;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--hud-control-gap);
    max-height: calc(100vh - var(--top-info-panel-top) - var(--hud-row-top-padding) - 8px);
    max-height: calc(100dvh - var(--top-info-panel-top) - var(--hud-row-top-padding) - 8px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 0 6px;
    pointer-events: auto;
    scrollbar-width: none;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

#viewport-left-controls > #game-menu-toggle {
    flex: 0 0 auto;
    align-self: flex-start;
}

#viewport-left-controls > #viewport-scale-widget,
#viewport-left-controls > #viewport-control-tools {
    flex: 0 0 auto;
}

#viewport-left-controls[hidden] {
    display: none;
}

#viewport-left-controls::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

/* @fix:394756ee */
#viewport-scale-widget {
    position: relative;
    z-index: auto;
    top: auto;
    left: auto;
    display: flex;
    width: 42px;
    min-height: 164px;
    transform: none;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 10px 7px;
    border: 1px solid rgba(185, 231, 249, 0.24);
    border-radius: 18px;
    background: rgba(4, 38, 59, 0.46);
    box-shadow: 0 8px 24px rgba(0, 8, 24, 0.16), inset 0 1px 0 rgba(226, 248, 255, 0.08);
    color: rgba(225, 246, 255, 0.74);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.04em;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
}

#viewport-scale-widget[hidden] {
    display: none;
}

#viewport-control-tools[hidden] {
    display: none;
}

#viewport-control-tools {
    position: relative;
    z-index: auto;
    top: auto;
    left: auto;
    display: grid;
    gap: var(--hud-control-gap);
    max-height: none;
    overflow: visible;
    padding-right: 0;
    pointer-events: auto;
    scrollbar-width: none;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

#viewport-control-tools button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 7px;
    border: 1px solid rgba(205, 238, 255, .36);
    border-radius: 12px;
    background: rgba(110, 215, 239, .18);
    color: #edf8ff;
    cursor: pointer;
}

#viewport-control-tools button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#viewport-control-tools button[aria-pressed="true"],
#viewport-control-tools button.is-active {
    background: rgba(110, 215, 239, .34);
    border-color: rgba(205, 238, 255, .72);
}

#control-layout-toast {
    position: absolute;
    left: calc(100% + 10px);
    top: 19px;
    color: #edf8ff;
    font-size: 16px;
    font-weight: 650;
    letter-spacing: 0.02em;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) translateX(-5px);
    transition: opacity 160ms ease, transform 160ms ease;
    white-space: nowrap;
}

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

.viewport-scale-label {
    text-transform: lowercase;
}

.viewport-scale-track {
    position: relative;
    width: 3px;
    flex: 1;
    margin: 15px 0;
    border-radius: 999px;
    background: linear-gradient(to bottom, rgba(112, 191, 222, 0.28), rgba(83, 158, 194, 0.7), rgba(112, 191, 222, 0.28));
    box-shadow: 0 0 8px rgba(75, 180, 226, 0.2);
}

#viewport-scale-marker {
    position: absolute;
    left: 50%;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(220, 246, 255, 0.94);
    border-radius: 50%;
    background: rgba(51, 143, 178, 0.94);
    box-shadow: 0 0 0 3px rgba(90, 190, 228, 0.18), 0 0 12px rgba(75, 189, 235, 0.42);
    transform: translate(-50%, -50%);
    cursor: ns-resize;
}

/* @ds:cff27cd5 */
#burst-endurance-panel {
    max-height: min(42vh, 320px);
    overflow: auto;
    border: 1px solid rgba(205, 238, 255, 0.16);
    background: rgba(1, 20, 31, 0.22);
}

#burst-endurance-table {
    width: 100%;
    border-collapse: collapse;
    color: #d9f5ff;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

#burst-endurance-table th,
#burst-endurance-table td {
    padding: 3px 7px;
    border-bottom: 1px solid rgba(205, 238, 255, 0.09);
    text-align: right;
    white-space: nowrap;
}

#burst-endurance-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    color: rgba(237, 248, 255, 0.72);
    font-weight: 700;
    background: rgba(4, 38, 59, 0.92);
}

#burst-endurance-table th:first-child,
#burst-endurance-table td:first-child {
    text-align: left;
}

#burst-endurance-table .is-available td:last-child {
    color: #7bd88f;
}

#burst-endurance-table .is-locked {
    color: rgba(217, 245, 255, 0.42);
}

/* @ds:cd1c5776 */
#joystick-panel {
    position: fixed;
    z-index: 3;
    left: 24px;
    right: 24px;
    bottom: calc(var(--bottom-info-bar-height) + 24px);
    height: var(--joystick-size);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

#joystick-panel[hidden] {
    display: none;
}

#joystick-base {
    position: absolute;
    right: 0;
    bottom: 0;
    width: var(--joystick-size);
    height: var(--joystick-size);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(4, 38, 59, 0.42), rgba(4, 38, 59, 0.58));
    touch-action: none;
    pointer-events: auto;
}

#joystick-base::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--cruise-base-diameter, 31.63%);
    aspect-ratio: 1;
    border-radius: 50%;
    background: rgba(3, 35, 60, 0.9);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
}

#joystick-burst-base {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--burst-base-diameter, 0%);
    aspect-ratio: 1;
    border: 7px solid rgba(111, 96, 79, 0.62);
    border-radius: 50%;
    background: rgba(75, 72, 67, 0.72);
    box-sizing: border-box;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

#joystick-burst-rings {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

.joystick-burst-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--burst-ring-diameter, 0%);
    aspect-ratio: 1;
    border: var(--burst-ring-width, 1px) solid var(--burst-ring-color, rgba(150, 158, 164, 0.07));
    border-radius: 50%;
    box-sizing: border-box;
    transform: translate(-50%, -50%);
}

#joystick-current-burst-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--current-burst-diameter, 0%);
    aspect-ratio: 1;
    border: 2px solid var(--current-burst-color, rgba(255, 228, 92, 0));
    border-radius: 50%;
    box-sizing: border-box;
    opacity: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 3;
}

#joystick-current-burst-ring.is-visible {
    opacity: 1;
}

#joystick-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(237, 248, 255, 0.6);
    background: rgba(110, 215, 239, 0.28);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5;
    opacity: 1;
    transition: opacity 200ms ease;
}

#joystick-base.is-keyboard-control #joystick-knob {
    opacity: 0;
}

/* @fix:dual-right-grip */
#dual-right-joystick-panel {
    position: fixed;
    z-index: 3;
    right: max(24px, env(safe-area-inset-right));
    bottom: calc(var(--bottom-info-bar-height) + max(24px, env(safe-area-inset-bottom)));
    width: min(200px, 30vmin);
    height: min(200px, 30vmin);
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

#dual-right-joystick-panel[hidden] {
    display: none;
}

#dual-right-joystick-base {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(25, 104, 155, 0.28);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(25, 104, 155, 0) 31.25%, rgba(25, 104, 155, 0.22) 100%);
    touch-action: none;
    pointer-events: auto;
}

#dual-right-joystick-vector {
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--dual-right-vector-length, 0px);
    height: 1px;
    background: rgba(245, 245, 245, 0.78);
    transform-origin: 0 50%;
    transform: rotate(var(--dual-right-vector-angle, 0rad));
    pointer-events: none;
}

#dual-right-joystick-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 40px;
    height: 40px;
    border: 2px solid #f5f5f5;
    border-radius: 50%;
    box-sizing: border-box;
    background: rgba(25, 104, 155, 0.8);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* @fix:dual-burst-grip */
#dual-burst-panel {
    position: fixed;
    z-index: 3;
    left: max(24px, env(safe-area-inset-left));
    bottom: calc(var(--bottom-info-bar-height) + max(24px, env(safe-area-inset-bottom)));
    width: min(207px, 30vmin);
    height: auto;
    aspect-ratio: 207 / 171;
    --burst-ui-scale: 1;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

#dual-burst-panel[hidden] {
    display: none;
}

#dual-burst-surface {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: auto;
    touch-action: none;
}

#dual-burst-arc-muted {
    fill: #283c48;
    display: none;
}

#dual-burst-arc-base {
    fill: url(#dual-burst-active-gradient);
}

#dual-burst-pin-line {
    stroke: #3b4040;
    stroke-width: 3;
    opacity: 0;
}

#dual-burst-number {
    position: absolute;
    left: 0;
    top: calc(106px * var(--burst-ui-scale));
    width: calc(72px * var(--burst-ui-scale));
    min-width: calc(72px * var(--burst-ui-scale));
    color: #11b8ee;
    font-family: Inter, system-ui, sans-serif;
    font-style: normal;
    font-size: calc(54px * var(--burst-ui-scale));
    font-weight: 900;
    line-height: calc(65px * var(--burst-ui-scale));
    text-align: left;
    text-shadow: none;
    pointer-events: none;
}

#dual-burst-preview-marker {
    position: absolute;
    left: 0;
    top: 0;
    width: calc(40px * var(--burst-ui-scale));
    height: calc(40px * var(--burst-ui-scale));
    border: 2px solid #f5f5f5;
    border-radius: 50%;
    box-sizing: border-box;
    background: #ffffff;
    transform: translate(-50%, -50%);
    display: none;
    pointer-events: none;
}

#dual-burst-handle {
    position: absolute;
    left: calc(187px * var(--burst-ui-scale));
    top: calc(151px * var(--burst-ui-scale));
    width: calc(40px * var(--burst-ui-scale));
    height: calc(40px * var(--burst-ui-scale));
    border: 2px solid #f5f5f5;
    border-radius: 50%;
    box-sizing: border-box;
    background: rgba(25, 104, 155, 0.8);
    color: #eaf8ff;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    pointer-events: none;
}

#dual-burst-handle-level {
    font-family: Inter, system-ui, sans-serif;
    font-size: calc(16px * var(--burst-ui-scale));
    font-weight: 700;
    line-height: 1;
}

#dual-burst-handle-level:empty {
    display: none;
}

/* @ds:2e91f6d4 @ds:b9136c2e @ds:c5a92431 @ds:e42a7c19 @ds:ab1e4f02 @ia:32288dfb */
#hud {
    top: 0;
    height: 124px;
    text-shadow: none;
}

    #hud .hud-row {
        grid-template-columns: 76px minmax(0, 1fr) 76px;
        gap: 18px;
        align-items: center;
        height: auto;
        padding: var(--hud-row-top-padding) var(--hud-row-right-padding) 0 32px;
}

#game-menu-toggle,
#world-map-toggle {
    appearance: none;
    -webkit-appearance: none;
    width: 76px;
    height: 76px;
    align-content: center;
    padding: 0;
    border: 0;
    outline: 0;
    border-radius: 22px;
    background: rgba(5, 57, 81, 0.72);
    box-shadow: 0 8px 22px rgba(0, 8, 24, 0.14);
}

#game-menu-toggle span {
    width: 34px;
    height: 4px;
    border-radius: 4px;
}

#world-map-toggle {
    justify-self: end;
}

#world-map-toggle svg {
    width: 34px;
    height: 34px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-miterlimit: 10;
    stroke-width: 32px;
}

#world-map-toggle span,
#world-map-toggle span::before,
#world-map-toggle span::after {
    display: none;
}

#player-metrics {
    position: static;
    transform: none;
    display: grid;
    grid-template-columns: 42px minmax(170px, 1fr) auto auto;
    align-items: center;
    gap: 18px;
    min-width: 0;
    min-height: 94px;
    padding: 14px 20px;
    border: 0;
    border-radius: var(--player-metrics-radius);
    background: linear-gradient(100deg, rgba(5, 53, 76, 0.52), rgba(2, 36, 61, 0.58));
    box-shadow: 0 8px 22px rgba(0, 8, 24, 0.14);
    backdrop-filter: blur(5px);
}

#player-color-indicator {
    width: 38px;
    height: 38px;
    border: 4px solid rgba(237, 248, 255, 0.9);
    border-radius: 50%;
    background: var(--player-color, #75d4e6);
    box-shadow: 0 0 16px color-mix(in srgb, var(--player-color, #75d4e6) 55%, transparent);
}

#player-life {
    gap: 0;
}

#player-name {
    max-width: none;
    font-size: 30px;
    font-weight: 760;
    letter-spacing: -0.03em;
}

#lifetime {
    width: 100%;
    height: 9px;
    margin-top: 11px;
    border: 0;
    border-radius: 9px;
    background: rgba(217, 245, 255, 0.17);
}

#player-size,
#eaten-metric {
    display: grid;
    grid-template-columns: auto;
    gap: 2px;
    min-width: 74px;
    padding-left: 20px;
    border-left: 2px solid rgba(217, 245, 255, 0.2);
    white-space: nowrap;
}

#player-size-label,
#eaten-metric > span {
    color: rgba(181, 222, 236, 0.58);
    font-size: 17px;
    font-weight: 760;
    line-height: 1;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

#player-size-value,
#eaten {
    color: #edf8ff;
    font-size: 34px;
    font-weight: 760;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

#world-info {
    left: 0;
    right: auto;
    bottom: calc(24px + env(safe-area-inset-bottom));
    box-sizing: border-box;
    width: min(340px, calc(100vw - 16px));
    min-width: min(290px, calc(100vw - 16px));
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    justify-content: stretch;
    justify-items: stretch;
    padding: 5px 7px;
    border: 0;
    border-radius: 8px;
    background: rgba(3, 35, 58, 0.25);
    box-shadow: none;
    backdrop-filter: blur(3px);
    text-shadow: none;
}

#world-info .world-info-item {
    display: flex;
    grid-template-columns: none;
    align-items: baseline;
    justify-content: space-between;
    justify-items: initial;
    gap: 4px;
    min-width: 0;
    min-height: 22px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(217, 245, 255, 0.13);
}

#world-info .world-info-item > span {
    flex: 0 0 auto;
    white-space: nowrap;
}

#world-info .world-info-item > strong,
#world-info .world-info-item > em {
    margin-left: auto;
    white-space: nowrap;
}

#world-info .world-info-item:last-child {
    border-bottom: 0;
}

#world-info .world-info-item span {
    color: rgba(181, 222, 236, 0.58);
    font-size: 7px;
    font-weight: 740;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#world-info strong,
#world-info em {
    color: #edf8ff;
    font-size: 12px;
    font-weight: 740;
    letter-spacing: -0.04em;
    text-align: left;
}

#game-menu {
    top: 136px;
}

/* @ds:cd1c5776 @ds:0eef2d19 @ds:e41821af @ds:6896cdc6 */
#joystick-panel {
    left: auto;
    right: max(24px, env(safe-area-inset-right));
    bottom: calc(var(--bottom-info-bar-height) + max(4px, env(safe-area-inset-bottom)));
    width: var(--joystick-footprint-size);
    height: var(--joystick-footprint-size);
}

#joystick-base {
    right: calc(var(--joystick-knob-size) / 2);
    bottom: calc(var(--joystick-knob-size) / 2);
    width: var(--joystick-size);
    height: var(--joystick-size);
    background: radial-gradient(circle, rgba(4, 38, 59, 0.34), rgba(4, 38, 59, 0.54));
}

#joystick-base::before {
    background: rgba(3, 35, 60, 0.9);
}

.joystick-burst-ring {
    opacity: 1;
}

#joystick-current-burst-ring {
    border-width: 2px;
    box-shadow: 0 0 12px color-mix(in srgb, var(--current-burst-color) 24%, transparent);
}

#joystick-knob {
    width: var(--joystick-knob-size);
    height: var(--joystick-knob-size);
    border: 2px solid rgba(237, 248, 255, 0.72);
    background: rgba(110, 215, 239, 0.31);
    box-shadow: 0 5px 16px rgba(0, 8, 24, 0.32);
}

#player-speed-metric {
    z-index: 4;
    color: #d7f6ff;
    text-shadow: none;
}

#player-speed-percent {
    font-size: clamp(30px, 5.35vw, 52px);
    letter-spacing: -0.06em;
}

#touch-speed-metric {
    position: fixed;
    z-index: 4;
    right: 24px;
    bottom: calc(var(--bottom-info-bar-height) + 24px);
    display: grid;
    min-width: 64px;
    padding: 8px 12px;
    border: 1px solid rgba(205, 238, 255, 0.42);
    border-radius: 14px;
    background: rgba(4, 38, 59, 0.64);
    box-shadow: 0 5px 16px rgba(0, 8, 24, 0.28);
    color: #d7f6ff;
    text-align: center;
    pointer-events: none;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#touch-speed-metric[hidden] { display: none; }

#touch-speed-metric strong {
    color: #11b8ee;
    font-size: 28px;
    font-weight: 800;
    line-height: 0.95;
    font-variant-numeric: tabular-nums;
}

#touch-speed-metric span {
    color: rgba(217, 245, 255, 0.74);
    font-size: 8px;
    font-weight: 760;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
}

#touch-speed-metric.is-editable {
    cursor: move;
    outline: 2px solid rgba(205, 238, 255, 0.56);
}

@media (max-width: 720px) {
    :root {
        --joystick-knob-size: 48px;
        --hud-row-top-padding: 15px;
        --hud-row-right-padding: 15px;
        --hud-control-gap: 10px;
    }

    #hud {
        height: 73px;
    }

    #hud .hud-row {
        grid-template-columns: 46px minmax(0, 1fr) 46px;
        gap: 10px;
        padding: var(--hud-row-top-padding) var(--hud-row-right-padding) 0 16px;
    }

    #hud-right-controls {
        gap: var(--hud-control-gap);
        right: max(15px, env(safe-area-inset-right));
    }

    #game-menu-toggle,
    #world-map-toggle {
        width: 46px;
        height: 46px;
        border-radius: 14px;
    }

    #game-menu-toggle {
        grid-template-rows: repeat(3, 3px);
        gap: 5px;
    }

    #world-map-toggle svg {
        width: 21px;
        height: 21px;
    }

    #game-menu-toggle span {
        width: 21px;
        height: 3px;
    }

    #player-metrics {
        grid-template-columns: 20px minmax(66px, 1fr) auto auto;
        gap: 8px;
        min-height: 58px;
        padding: 8px 10px;
        --player-metrics-radius: 17px;
    }

    #player-color-indicator {
        width: 20px;
        height: 20px;
        border-width: 2px;
    }

    #player-name {
        font-size: 15px;
    }

    #lifetime {
        height: 5px;
        margin-top: 6px;
    }

    #player-size,
    #eaten-metric {
        min-width: 44px;
        padding-left: 8px;
        border-left-width: 1px;
    }

    #player-size-label,
    #eaten-metric > span {
        font-size: 9px;
    }

    #player-size-value,
    #eaten {
        font-size: 18px;
    }

    #world-info {
        left: 10px;
        bottom: calc(15px + env(safe-area-inset-bottom));
        width: min(170px, calc(100vw - 12px));
        min-width: min(150px, calc(100vw - 12px));
        padding: 4px 7px;
        border-radius: 8px;
    }

    .diagnostic-info-panel {
        left: 10px;
        right: auto;
        bottom: calc(15px + env(safe-area-inset-bottom));
        width: min(340px, calc(100vw - 20px));
        min-height: 0;
        padding: 7px 8px;
        border: 0;
        border-radius: 8px;
        background: rgba(3, 35, 58, 0.72);
        backdrop-filter: blur(5px);
    }

    .diagnostic-info-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px 8px;
    }

    .diagnostic-info-grid span:nth-child(2n) { border-right: 0; }

    .records-info-panel {
        max-height: min(48vh, 360px);
        overflow: auto;
    }

    #world-info .world-info-item {
        min-height: 18px;
        padding: 3px 0;
        border-bottom-width: 1px;
    }

    #world-info .world-info-item span {
        font-size: 7px;
    }

    #world-info strong,
    #world-info em {
        font-size: 12px;
    }

    #world-info .world-info-area {
        display: none;
    }

    #game-menu {
        top: 83px;
    }

    #joystick-panel {
        right: max(15px, env(safe-area-inset-right));
        bottom: calc(var(--bottom-info-bar-height) + max(15px, env(safe-area-inset-bottom)));
    }

    #dual-right-joystick-panel {
        right: max(15px, env(safe-area-inset-right));
        bottom: calc(var(--bottom-info-bar-height) + max(15px, env(safe-area-inset-bottom)));
    }

    #dual-burst-panel {
        left: max(15px, env(safe-area-inset-left));
        bottom: calc(var(--bottom-info-bar-height) + max(15px, env(safe-area-inset-bottom)));
    }

    #touch-speed-metric {
        right: max(15px, env(safe-area-inset-right));
        bottom: calc(var(--bottom-info-bar-height) + max(15px, env(safe-area-inset-bottom)));
    }

    #viewport-left-controls {
        left: max(16px, env(safe-area-inset-left));
    }
}

@media (max-width: 380px) {
    :root {
        --joystick-knob-size: 42px;
    }

    #world-info {
        width: min(110px, calc(100vw - 12px));
    }
}

@media (orientation: portrait) {
    #viewport-left-controls {
        left: clamp(16px, 2vw, 32px);
    }

    #world-info,
    .diagnostic-info-panel {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        min-width: 0;
        max-width: none;
        max-height: 33.333vh;
        overflow: auto;
        border-radius: 0;
    }
}

@media (orientation: landscape) and (max-height: 900px) {
    :root {
        --top-info-panel-height: clamp(58px, 12vh, 96px);
        --top-info-panel-gap: clamp(5px, 1vh, 10px);
        --hud-row-top-padding: clamp(8px, 3vh, 24px);
        --hud-row-right-padding: clamp(14px, 2vw, 28px);
        --hud-control-gap: clamp(8px, 1.8vh, 18px);
    }

    #hud {
        height: var(--top-info-panel-height);
    }

    #hud .hud-row {
        grid-template-columns: clamp(46px, 9vh, 68px) minmax(0, 1fr) clamp(46px, 9vh, 68px);
        gap: clamp(8px, 1.8vw, 18px);
        padding: var(--hud-row-top-padding) var(--hud-row-right-padding) 0;
    }

    #hud-right-controls {
        gap: var(--hud-control-gap);
        right: max(var(--hud-row-right-padding), env(safe-area-inset-right));
    }

    #viewport-left-controls {
        left: clamp(16px, 2vw, 28px);
    }

    #game-menu-toggle,
    #world-map-toggle {
        width: clamp(46px, 9vh, 68px);
        height: clamp(46px, 9vh, 68px);
        border-radius: clamp(14px, 2.8vh, 22px);
    }

    #game-menu-toggle {
        grid-template-rows: repeat(3, clamp(3px, 0.5vh, 4px));
        gap: clamp(5px, 1vh, 8px);
    }

    #world-map-toggle svg {
        width: clamp(21px, 4.5vh, 34px);
        height: clamp(21px, 4.5vh, 34px);
    }

    #game-menu-toggle span {
        width: clamp(21px, 4.5vh, 34px);
        height: clamp(3px, 0.5vh, 4px);
    }

    #player-metrics {
        grid-template-columns: clamp(20px, 5vh, 38px) minmax(100px, 1fr) auto auto;
        gap: clamp(8px, 1.8vh, 18px);
        min-height: clamp(54px, 11vh, 94px);
        padding: clamp(8px, 1.8vh, 14px) clamp(10px, 2vw, 20px);
        --player-metrics-radius: clamp(16px, 3.2vh, 26px);
    }

    #player-color-indicator {
        width: clamp(20px, 5vh, 38px);
        height: clamp(20px, 5vh, 38px);
        border-width: clamp(2px, 0.5vh, 4px);
    }

    #player-name {
        font-size: clamp(15px, 3.9vh, 30px);
    }

    #lifetime {
        height: clamp(5px, 1.2vh, 9px);
        margin-top: clamp(6px, 1.4vh, 11px);
    }

    #player-size,
    #eaten-metric {
        min-width: clamp(44px, 9vh, 74px);
        padding-left: clamp(8px, 2vh, 20px);
        border-left-width: clamp(1px, 0.25vh, 2px);
    }

    #player-size-label,
    #eaten-metric > span {
        font-size: clamp(9px, 2.2vh, 17px);
    }

    #player-size-value,
    #eaten {
        font-size: clamp(18px, 4.4vh, 34px);
    }

    #game-menu {
        top: calc(var(--top-info-panel-height) + 8px);
        max-height: calc(100dvh - var(--top-info-panel-height) - var(--bottom-info-bar-height) - 16px);
        overflow-y: auto;
    }

    /* @fix:3196de1d */
    #join {
        align-items: center;
        padding: max(12px, env(safe-area-inset-top)) max(16px, 5vw) max(16px, env(safe-area-inset-bottom));
    }

    #join-form {
        width: min(420px, calc(100vw - 32px));
        max-height: calc(100dvh - max(12px, env(safe-area-inset-top)) - max(16px, env(safe-area-inset-bottom)));
        overflow-y: auto;
        padding: clamp(18px, 3.2vh, 28px) clamp(18px, 2.4vw, 28px);
        gap: 0;
    }

    .join-header {
        margin-bottom: clamp(18px, 3vh, 28px);
    }

    .join-intro {
        margin-bottom: clamp(16px, 2.4vh, 22px);
    }

    .join-intro h1 {
        font-size: clamp(25px, 4.2vh, 32px);
    }

    #join-form .join-field,
    #join-form .join-colour {
        margin-bottom: clamp(14px, 2vh, 20px);
    }

    .join-tiers {
        margin-bottom: clamp(16px, 2.2vh, 22px);
    }

    #join-form .join-tier-card {
        min-height: 72px;
        padding: 10px;
    }

    #join-form button {
        min-height: 46px;
    }

    #world-info {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        min-width: 0;
        height: auto;
        display: grid;
        grid-template-columns: repeat(8, minmax(0, 1fr));
        gap: clamp(2px, 0.45vw, 6px);
        align-items: stretch;
        padding: 1px 4px max(1px, env(safe-area-inset-bottom));
        border-top: 1px solid rgba(205, 238, 255, 0.24);
        border-radius: 0;
        background: rgba(4, 38, 59, 0.82);
        backdrop-filter: blur(8px);
    }

    .diagnostic-info-panel {
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: min(28vh, 220px);
        min-height: 0;
        border-top: 1px solid rgba(205, 238, 255, 0.24);
        border-radius: 0;
        background: rgba(4, 38, 59, 0.82);
        backdrop-filter: blur(8px);
    }

    .diagnostic-info-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: clamp(2px, 0.45vw, 6px);
    }

    .diagnostic-info-grid span:nth-child(2n) { border-right: 1px solid rgba(217, 245, 255, 0.13); }

    .diagnostic-info-grid em { font-size: clamp(4px, 0.4vw, 5px); }
    .diagnostic-info-grid strong { font-size: clamp(6px, 0.7vw, 8px); }

    .records-block table { font-size: clamp(6px, 0.7vw, 8px); }
    .records-block th { font-size: clamp(4px, 0.4vw, 5px); }

    #world-info .world-info-item {
        display: grid;
        grid-template-columns: auto;
        justify-items: start;
        align-content: center;
        gap: 1px;
        min-height: 0;
        padding: 0 1px;
        border-bottom: 0;
        border-right: 1px solid rgba(217, 245, 255, 0.13);
    }

    #world-info .world-info-item:last-child {
        border-right: 0;
    }

    #world-info .world-info-item > strong,
    #world-info .world-info-item > em {
        margin-left: 0;
    }

    #world-info .world-info-item span {
        font-size: clamp(4px, 0.4vw, 5px);
        letter-spacing: 0.03em;
    }

    #world-info strong,
    #world-info em {
        font-size: clamp(6px, 0.7vw, 8px);
        text-align: left;
    }
}

/* @fix:zen-mode */
#hud-right-controls,
#viewport-left-controls {
    transition:
        transform 440ms cubic-bezier(.16, 1, .3, 1),
        opacity 440ms cubic-bezier(.16, 1, .3, 1);
    will-change: transform, opacity;
}

#player-metrics {
    transition: border-radius 480ms cubic-bezier(.16, 1, .3, 1);
    will-change: border-radius;
}

#game-menu {
    transition:
        transform 440ms cubic-bezier(.16, 1, .3, 1),
        opacity 440ms cubic-bezier(.16, 1, .3, 1);
    will-change: transform, opacity;
}

#world-info,
#flow-info-panel,
#records-panel {
    transition: opacity 440ms cubic-bezier(.16, 1, .3, 1);
    will-change: opacity;
}

body.is-zen-mode #hud-right-controls {
    opacity: 0;
    pointer-events: none;
    transform: translateX(50%);
}

body.is-zen-mode #viewport-left-controls {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
}

body.is-zen-mode #game-menu {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
}

body.is-zen-mode #world-info,
body.is-zen-mode #flow-info-panel,
body.is-zen-mode #records-panel {
    opacity: 0;
    pointer-events: none;
}

body.is-zen-mode #player-metrics {
    position: fixed;
    z-index: 6;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    transform: none;
    border-radius: 0;
    cursor: pointer;
}

body.is-zen-mode #player-metrics.is-zen-leaving {
    border-radius: var(--player-metrics-radius);
}

#player-metrics {
    cursor: pointer;
}

#player-metrics.is-zen-entering {
    animation: zenMetricsEnter 480ms cubic-bezier(.16, 1, .3, 1) both;
}

#player-metrics.is-zen-leaving {
    animation: zenMetricsLeave 480ms cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes zenMetricsEnter {
    from {
        position: fixed;
        left: var(--zen-start-left);
        right: auto;
        top: var(--zen-start-top);
        width: var(--zen-start-width);
        transform: var(--zen-start-transform);
    }
    to {
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        width: 100%;
        transform: none;
    }
}

@keyframes zenMetricsLeave {
    from {
        position: fixed;
        left: 0;
        right: 0;
        top: 0;
        width: 100%;
        transform: none;
    }
    to {
        position: fixed;
        left: var(--zen-end-left);
        right: auto;
        top: var(--zen-end-top);
        width: var(--zen-end-width);
        transform: var(--zen-end-transform);
    }
}

@media (prefers-reduced-motion: reduce) {
    #hud-right-controls,
    #viewport-left-controls,
    #game-menu,
    #world-info,
    #flow-info-panel,
    #records-panel,
    #player-metrics {
        transition-duration: 1ms;
        animation-duration: 1ms !important;
    }
}
