:root {
    --bg: #0c0e10;
    --panel: #14181c;
    --text: #e6e4de;
    --muted: #8a8a82;
    --neon: #9ab08a;
    --pink: #c4a060;
    --danger: #c05040;
    --ok: #7aaa5a;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#app {
    width: min(100vw, 1000px);
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.55rem 0.7rem;
    gap: 0.35rem;
}

.bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.5rem;
}
.back {
    color: var(--neon);
    text-decoration: none;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.35rem 0.55rem;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 8px;
    background: rgba(0, 240, 255, 0.06);
}
.title {
    text-align: center;
    font-weight: 900;
    letter-spacing: 0.14em;
    font-size: clamp(0.85rem, 2.8vw, 1.05rem);
    color: var(--neon);
    text-shadow: 0 0 18px rgba(0, 240, 255, 0.45);
}
.build-tag {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.15rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    vertical-align: middle;
    color: #041018;
    background: linear-gradient(90deg, #b6ff3b, #00f0ff);
    border-radius: 6px;
    box-shadow: 0 0 12px rgba(182, 255, 59, 0.45);
    animation: build-pulse 1.6s ease-in-out infinite;
}
@keyframes build-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(182, 255, 59, 0.35); }
    50% { box-shadow: 0 0 18px rgba(0, 240, 255, 0.7); }
}
.build-banner {
    display: block;
    margin: 0 auto 0.65rem;
    padding: 0.45rem 0.85rem;
    width: fit-content;
    max-width: 100%;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #041018;
    background: linear-gradient(90deg, #b6ff3b, #00f0ff 55%, #ff2d95);
    border-radius: 999px;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.35);
}
.stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--muted);
    line-height: 1.35;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.3rem 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.stats span { color: var(--text); }

main {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#gameCanvas {
    display: block;
    width: 100%;
    max-width: 960px;
    height: auto;
    max-height: min(58vh, 540px);
    border-radius: 12px;
    border: 1px solid rgba(0, 240, 255, 0.25);
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.08), 0 16px 40px rgba(0, 0, 0, 0.45);
    background: #05050c;
    cursor: crosshair;
}

.hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 12px;
}
.hud.hidden { display: none; }

.crosshair {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 1.5px solid rgba(220, 220, 200, 0.85);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
    transition: opacity 0.12s ease;
}
.crosshair::before,
.crosshair::after {
    content: "";
    position: absolute;
    background: rgba(0, 240, 255, 0.9);
}
.crosshair::before {
    left: 50%; top: -7px; width: 1.5px; height: 32px; margin-left: -0.75px;
}
.crosshair::after {
    top: 50%; left: -7px; height: 1.5px; width: 32px; margin-top: -0.75px;
}

.bars {
    position: absolute;
    left: 12px;
    bottom: 12px;
    width: min(220px, 42%);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.bar-row {
    display: grid;
    grid-template-columns: 40px 1fr;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--muted);
}
.meter {
    height: 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.meter i {
    display: block;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #3f3, var(--ok));
    transform-origin: left center;
    transform: scaleX(1);
    transition: transform 0.08s linear;
}
.meter.heat i {
    background: linear-gradient(90deg, var(--neon), var(--pink));
}

.wave-banner {
    position: absolute;
    left: 50%;
    top: 14%;
    transform: translateX(-50%);
    font-weight: 900;
    letter-spacing: 0.12em;
    font-size: clamp(0.95rem, 3vw, 1.35rem);
    color: var(--neon);
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.6);
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
}
.wave-banner.show { opacity: 1; }

.kill-feed {
    position: absolute;
    right: 12px;
    top: 12px;
    text-align: right;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--pink);
    text-shadow: 0 0 10px rgba(255, 45, 149, 0.5);
    min-height: 1.2em;
}

.hint-keys {
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.weapon-hud {
    position: absolute;
    right: 12px;
    bottom: 12px;
    text-align: right;
    min-width: 120px;
}
.weapon-name {
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    color: #e8e8f0;
    text-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
    margin-bottom: 0.2rem;
}
.grenade-hud {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #c4b080;
    margin-bottom: 0.3rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.weapon-slots {
    display: flex;
    gap: 0.2rem;
    justify-content: flex-end;
    flex-wrap: wrap;
    max-width: 280px;
}
.weapon-slots .slot {
    min-width: 1.6rem;
    padding: 0.15rem 0.28rem;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.45);
    color: rgba(255, 255, 255, 0.35);
}
.weapon-slots .slot.owned {
    color: rgba(255, 255, 255, 0.75);
    border-color: rgba(255, 210, 122, 0.35);
}
.weapon-slots .slot.active {
    color: #041018;
    background: linear-gradient(90deg, #ffd27a, #ffe8a0);
    border-color: transparent;
}

.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 4, 10, 0.72);
    backdrop-filter: blur(4px);
    border-radius: 12px;
    padding: 1rem;
}
.overlay.hidden { display: none; }

.panel {
    width: min(400px, 100%);
    background: linear-gradient(165deg, #141424, #0c0c16);
    border: 1px solid rgba(0, 240, 255, 0.28);
    border-radius: 16px;
    padding: 1.4rem 1.2rem 1.3rem;
    text-align: center;
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.1), 0 20px 50px rgba(0, 0, 0, 0.5);
}
.panel-wide {
    width: min(580px, 100%);
    max-height: min(94vh, 720px);
    overflow-y: auto;
}
.menu-msg { font-size: 0.88rem !important; }

.mode-row {
    display: flex;
    gap: 0.45rem;
    justify-content: center;
    margin: 0 0 0.35rem;
    flex-wrap: wrap;
}
.mode {
    font: inherit;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 45, 149, 0.35);
    background: rgba(255, 45, 149, 0.08);
    color: var(--muted);
    cursor: pointer;
}
.mode.is-active {
    color: #041018;
    background: linear-gradient(90deg, var(--pink), #ff8ec8);
    border-color: transparent;
}
.mode-note {
    font-size: 0.78rem !important;
    margin-bottom: 0.65rem !important;
}

/* Online multiplayer lobby */
.online-panel {
    margin: 0.35rem 0 0.75rem;
    padding: 0.65rem 0.7rem;
    border-radius: 12px;
    border: 1px solid rgba(0, 240, 255, 0.25);
    background: rgba(0, 240, 255, 0.05);
    text-align: left;
}
.online-panel.hidden { display: none; }
.online-row { margin-bottom: 0.45rem; }
.online-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
}
.online-input {
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(0, 0, 0, 0.4);
    color: var(--text);
    outline: none;
    min-width: 0;
}
.online-input:focus { border-color: rgba(0, 240, 255, 0.5); }
.online-code {
    width: 5.5rem;
    text-align: center;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-weight: 900;
}
.online-or {
    font-size: 0.72rem;
    color: var(--muted);
    font-weight: 700;
}
.cta-sm {
    font-size: 0.78rem !important;
    padding: 0.45rem 0.85rem !important;
    letter-spacing: 0.06em !important;
}
.online-status {
    font-size: 0.75rem !important;
    color: var(--muted) !important;
    margin: 0 0 0.35rem !important;
}
.room-code-display {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--neon);
    margin: 0.25rem 0 0.4rem;
    letter-spacing: 0.06em;
}
.room-code-display.hidden { display: none; }
.room-code-display strong {
    font-size: 1.25rem;
    letter-spacing: 0.2em;
    color: #fff;
    background: rgba(0, 240, 255, 0.12);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(0, 240, 255, 0.35);
}
.lobby-list {
    list-style: none;
    margin: 0.35rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.lobby-list li {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.45rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.lobby-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    flex-shrink: 0;
}
.lobby-slot {
    color: var(--muted);
    font-size: 0.7rem;
    min-width: 1.6rem;
}
.lobby-you { color: var(--neon); margin-left: auto; font-size: 0.68rem; }
.lobby-host { color: #ffd27a; margin-left: auto; font-size: 0.68rem; }

.levels-label {
    margin: 0.5rem 0 0.4rem !important;
    font-size: 0.72rem !important;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--neon) !important;
}
.level-count {
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--muted);
    text-transform: none;
    margin-left: 0.35rem;
}

/* Map selector chips */
.map-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: center;
    margin-bottom: 0.35rem;
}
.map-chip {
    font: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.4);
    color: var(--muted);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
}
.map-chip:hover:not(:disabled) {
    border-color: rgba(0, 240, 255, 0.45);
    color: var(--text);
}
.map-chip.is-active {
    color: #041018;
    background: linear-gradient(90deg, var(--neon), #7af0ff);
    border-color: transparent;
}
.map-chip.locked {
    opacity: 0.35;
    cursor: not-allowed;
}
.mc-icon { font-size: 0.9rem; line-height: 1; }
.mc-name { letter-spacing: 0.02em; }
.map-blurb {
    font-size: 0.75rem !important;
    color: var(--muted) !important;
    margin: 0 0 0.55rem !important;
    min-height: 1.2em;
}

.levels-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.15rem;
}
.levels-head .levels-label { margin: 0 !important; }
.level-search {
    font: inherit;
    font-size: 0.78rem;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.45);
    color: var(--text);
    width: min(160px, 42vw);
    outline: none;
}
.level-search:focus {
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.12);
}
.level-search::placeholder { color: var(--muted); }

.level-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.45rem;
    text-align: left;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 0.15rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 240, 255, 0.35) transparent;
}
@media (max-width: 520px) {
    .level-grid { grid-template-columns: repeat(2, 1fr); max-height: 200px; }
}
.level-card {
    font: inherit;
    text-align: left;
    padding: 0.4rem 0.45rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.35);
    color: var(--text);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}
.level-card:hover:not(:disabled) {
    border-color: rgba(0, 240, 255, 0.45);
}
.level-card.is-active {
    border-color: var(--neon);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
    background: rgba(0, 240, 255, 0.08);
}
.level-card.is-boss {
    border-color: rgba(255, 176, 64, 0.45);
    background: rgba(255, 100, 40, 0.08);
}
.level-card.is-boss.is-active {
    border-color: #ffb040;
    box-shadow: 0 0 16px rgba(255, 140, 40, 0.3);
}
.level-card.locked {
    opacity: 0.4;
    cursor: not-allowed;
}
.lc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
}
.lc-icon { font-size: 0.95rem; }
.lc-num {
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--muted);
    letter-spacing: 0.04em;
}
.lc-name {
    font-size: 0.75rem;
    font-weight: 800;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lc-meta { font-size: 0.62rem; color: var(--muted); }
.level-blurb {
    font-size: 0.75rem !important;
    margin-bottom: 0.75rem !important;
    min-height: 2.2em;
}

.obj-hud {
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #ffe8a0;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.4);
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 210, 122, 0.3);
}

/* Finale boss health bar */
.boss-hud {
    position: absolute;
    left: 50%;
    top: 42px;
    transform: translateX(-50%);
    width: min(420px, 72%);
    z-index: 5;
    pointer-events: none;
}
.boss-hud.hidden { display: none; }
.boss-hud-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #ffd27a;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
    margin-bottom: 0.2rem;
}
.boss-meter {
    height: 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 176, 64, 0.45);
    overflow: hidden;
    box-shadow: 0 0 14px rgba(255, 100, 40, 0.25);
}
.boss-meter i {
    display: block;
    height: 100%;
    width: 100%;
    transform-origin: left center;
    transform: scaleX(1);
    background: linear-gradient(90deg, #ff4060, #ffb040 55%, #ffe08a);
    transition: transform 0.12s ease-out;
}
.boss-hud.is-enrage .boss-hud-label { color: #ff6040; }
.boss-hud.is-enrage .boss-meter {
    border-color: rgba(255, 64, 64, 0.7);
    box-shadow: 0 0 18px rgba(255, 40, 40, 0.45);
}
.boss-hud.is-enrage .boss-meter i {
    background: linear-gradient(90deg, #ff2020, #ff8040 60%, #ffc060);
}

.meter.p2 i {
    background: linear-gradient(90deg, #ff2d95, #ff8ec8);
}
.p2-bar.hidden { display: none; }

/* Big award splash */
.award {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 4, 12, 0.82);
    border-radius: 12px;
    z-index: 20;
    padding: 1rem;
    animation: award-in 0.45s ease;
}
.award.hidden { display: none; }
@keyframes award-in {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: scale(1); }
}
.award-card {
    width: min(420px, 100%);
    text-align: center;
    padding: 1.6rem 1.3rem 1.4rem;
    border-radius: 18px;
    border: 2px solid rgba(255, 210, 122, 0.55);
    background:
        radial-gradient(ellipse at 50% 0%, rgba(255, 210, 122, 0.18), transparent 55%),
        linear-gradient(165deg, #1a1428, #0a0a14);
    box-shadow: 0 0 60px rgba(255, 180, 60, 0.25), 0 24px 50px rgba(0, 0, 0, 0.55);
}
.award-eyebrow {
    margin: 0 0 0.4rem;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    color: #ffd27a;
}
.award-stars {
    font-size: 2.4rem;
    letter-spacing: 0.15em;
    color: #ffd27a;
    text-shadow: 0 0 24px rgba(255, 200, 80, 0.6);
    margin-bottom: 0.35rem;
}
.award-stars.gold {
    color: #ffe566;
    animation: pulse-gold 1.2s ease infinite;
}
@keyframes pulse-gold {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}
.award-card h2 {
    margin: 0 0 0.35rem;
    font-size: 1.55rem;
    letter-spacing: 0.06em;
    color: #fff;
}
.award-sub {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.9rem;
}
.award-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.35rem;
    margin-bottom: 1rem;
}
.award-stats div {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 10px;
    padding: 0.45rem 0.2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.award-stats b {
    display: block;
    font-size: 1.05rem;
    color: var(--neon);
}
.award-stats span {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.award-list {
    list-style: none;
    margin: 0 0 1.1rem;
    padding: 0;
    text-align: left;
}
.award-list li {
    font-size: 0.85rem;
    padding: 0.45rem 0.55rem;
    margin-bottom: 0.3rem;
    border-radius: 8px;
    background: rgba(255, 45, 149, 0.1);
    border: 1px solid rgba(255, 45, 149, 0.25);
    color: #f0e8f0;
}
.award-list strong { color: #ff8ec8; }
.award-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}
.cta-ghost {
    background: transparent !important;
    color: var(--neon) !important;
    border: 1px solid rgba(0, 240, 255, 0.45);
    box-shadow: none !important;
}
.eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--pink);
}
.panel h1 {
    margin: 0 0 0.6rem;
    font-size: 1.7rem;
    letter-spacing: 0.08em;
    color: var(--neon);
    text-shadow: 0 0 24px rgba(0, 240, 255, 0.4);
}
.panel p {
    margin: 0 0 0.85rem;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.4;
}

.diff-row {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
}
.diff {
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    cursor: pointer;
}
.diff.is-active {
    color: #041018;
    background: linear-gradient(90deg, var(--neon), #7ff);
    border-color: transparent;
}
.diff-note {
    font-size: 0.78rem !important;
    margin-bottom: 1rem !important;
}

.cta {
    font: inherit;
    font-size: 1.05rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.7rem 1.8rem;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    color: #041018;
    background: linear-gradient(90deg, var(--pink), #ff6eb4);
    box-shadow: 0 0 24px rgba(255, 45, 149, 0.35);
}
.cta:active { transform: translateY(2px); }

.controls {
    margin: 0.9rem 0 0 !important;
    font-size: 0.75rem !important;
    opacity: 0.7;
}

.bottom {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: center;
}
.yard-link {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}
.yard-link:hover { color: var(--neon); }

.touch {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}
.stick {
    position: relative;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(0, 240, 255, 0.25);
    flex-shrink: 0;
}
.knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border-radius: 50%;
    background: rgba(0, 240, 255, 0.45);
    pointer-events: none;
}
.stick span {
    position: absolute;
    left: 0; right: 0; bottom: -1.1rem;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--muted);
}
.act {
    font: inherit;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    cursor: pointer;
    flex-shrink: 0;
}
.act.fire {
    width: 72px;
    height: 72px;
    background: rgba(255, 45, 149, 0.35);
    border-color: rgba(255, 45, 149, 0.6);
    color: #fff;
}
.act:active { transform: scale(0.96); }

@media (hover: none), (max-width: 860px) {
    .touch { display: flex; }
    #gameCanvas { max-height: min(46vh, 420px); }
    .hint-keys { display: none; }
}
