:root {
    --midnight: #0f1728;
    --midnight-2: #17223b;
    --storm: #24365a;
    --parchment: #f2e3b0;
    --parchment-dim: rgba(242, 227, 176, 0.78);
    --gold: #f4bf46;
    --gold-2: #ffdf87;
    --ember: #f28d35;
    --ice: #89bcff;
    --fur: #4d79d8;
    --fur-deep: #274a9f;
    --panel: rgba(15, 23, 40, 0.86);
    --panel-strong: rgba(12, 18, 32, 0.96);
    --border: rgba(244, 191, 70, 0.28);
    --shadow: rgba(0, 0, 0, 0.34);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body.goldknight-body {
    font-family: "Trebuchet MS", Verdana, sans-serif;
    background:
        radial-gradient(circle at top, rgba(244, 191, 70, 0.12), transparent 28%),
        linear-gradient(180deg, #10182b 0%, #08111e 100%);
    color: #f7f0d5;
    overflow-x: hidden;
}

.goldknight-atmosphere {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.mist,
.sigil {
    position: absolute;
    border-radius: 999px;
    filter: blur(70px);
    opacity: 0.18;
}

.mist-a {
    width: 32rem;
    height: 32rem;
    top: -10rem;
    left: -8rem;
    background: rgba(82, 126, 255, 0.42);
    animation: drift-a 18s ease-in-out infinite alternate;
}

.mist-b {
    width: 28rem;
    height: 28rem;
    right: -6rem;
    bottom: -10rem;
    background: rgba(242, 141, 53, 0.3);
    animation: drift-b 16s ease-in-out infinite alternate;
}

.sigil-a,
.sigil-b {
    width: 16rem;
    height: 16rem;
    background: rgba(244, 191, 70, 0.22);
}

.sigil-a {
    top: 12%;
    right: 16%;
    animation: pulse-a 8s ease-in-out infinite;
}

.sigil-b {
    left: 10%;
    bottom: 18%;
    animation: pulse-b 9s ease-in-out infinite;
}

.goldknight-shell {
    position: relative;
    z-index: 1;
    max-width: 1380px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 3.5rem;
}

.goldknight-hero {
    text-align: center;
    padding: 1rem 0 2rem;
}

.runner-login-notice {
    background: #1a2035; border: 1px solid #3a3f55; border-radius: 12px;
    padding: 40px; text-align: center; color: #8b8fa8;
    max-width: 520px; margin: 0 auto;
}
.runner-login-notice a { color: #efb53c; text-decoration: none; }
.runner-login-notice a:hover { text-decoration: underline; }

.hero-title-link {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.hero-title-link:hover h1 {
    opacity: 0.8;
}

.hero-kicker,
.overlay-kicker,
.card-ribbon span,
.stat-label {
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-kicker {
    color: var(--gold-2);
    font-size: 0.75rem;
    margin: 0 0 0.9rem;
}

.goldknight-hero h1,
.side-card h2,
.overlay-panel h2,
.stage-card .card-ribbon {
    font-family: "Book Antiqua", "Palatino Linotype", Garamond, serif;
}


.wolf-editor-card {
    margin-top: 1.2rem;
    padding: 1.2rem;
    border-radius: 1.6rem;
    background: linear-gradient(180deg, rgba(16, 25, 42, 0.96), rgba(8, 14, 25, 0.98));
    border: 1px solid var(--border);
    box-shadow: 0 1.4rem 3rem var(--shadow);
}

.wolf-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.wolf-editor-header h2,
.wolf-editor-panel h3 {
    margin: 0;
    color: #fff2c3;
    font-family: "Book Antiqua", "Palatino Linotype", Garamond, serif;
}

.wolf-editor-copy {
    max-width: 52rem;
    margin: 0.45rem 0 0;
    color: var(--parchment-dim);
    line-height: 1.6;
}

.wolf-editor-status {
    margin: 0;
    padding: 0.72rem 0.95rem;
    border-radius: 999px;
    background: rgba(244, 191, 70, 0.12);
    border: 1px solid rgba(255, 223, 135, 0.16);
    color: #fff1b7;
    font-size: 0.88rem;
    white-space: nowrap;
}

.wolf-editor-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(18rem, 0.95fr) repeat(2, minmax(0, 1fr));
}

.wolf-editor-panel {
    padding: 1rem;
    border-radius: 1.2rem;
    background: linear-gradient(180deg, rgba(20, 29, 49, 0.95), rgba(12, 18, 32, 0.98));
    border: 1px solid rgba(255, 223, 135, 0.12);
}

.wolf-editor-panel h3 {
    margin-bottom: 0.9rem;
}

.wolf-editor-row {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 0.8rem;
}

.wolf-editor-row label,
.wolf-control span {
    color: #fff1c0;
    font-size: 0.88rem;
}

.wolf-editor-row input,
.wolf-editor-row select {
    width: 100%;
    min-width: 0;
    padding: 0.82rem 0.95rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(255, 223, 135, 0.18);
    background: rgba(6, 10, 20, 0.68);
    color: #fff5dc;
    font: inherit;
}

.wolf-editor-row input:focus,
.wolf-editor-row select:focus,
.wolf-control input:focus {
    outline: 2px solid rgba(137, 188, 255, 0.38);
    border-color: rgba(137, 188, 255, 0.55);
}

.wolf-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.wolf-editor-primary {
    margin-top: 0;
}

.wolf-editor-panel--preview {
    display: grid;
    align-content: start;
}

.wolf-preview-frame {
    position: relative;
    overflow: hidden;
    border-radius: 1.1rem;
    border: 1px solid rgba(255, 223, 135, 0.14);
    background:
        radial-gradient(circle at 50% 20%, rgba(137, 188, 255, 0.22), transparent 38%),
        linear-gradient(180deg, rgba(20, 34, 61, 0.96), rgba(9, 15, 27, 0.98));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#wolfEditorPreviewCanvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 27 / 32;
}

.wolf-preview-copy {
    margin: 0.8rem 0 0;
    color: var(--parchment-dim);
    line-height: 1.55;
    font-size: 0.92rem;
}
.wolf-editor-controls {
    display: grid;
    gap: 0.85rem;
}

.wolf-control {
    display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem 0.75rem;
    align-items: center;
}

.wolf-control output {
    color: #a9cfff;
    font-variant-numeric: tabular-nums;
}

.wolf-control input {
    grid-column: 1 / -1;
    width: 100%;
    accent-color: var(--gold);
}
.goldknight-hero h1 {

    .wolf-editor-grid {
        grid-template-columns: 1fr;
    }
    margin: 0;
    font-size: clamp(2.3rem, 4.8vw, 4.6rem);
    color: #fff4cc;
    text-shadow: 0 0.1em 0.5em rgba(0, 0, 0, 0.3);

    .wolf-editor-grid {
        grid-template-columns: 1fr;
    }

    .wolf-editor-header {
        flex-direction: column;
    }
}

.gold-title-glow {
    display: inline-block;
    color: #fff6cb;
    text-shadow:
        0 0 10px rgba(255, 214, 105, 0.48),
        0 0 24px rgba(244, 191, 70, 0.34),
        0 0 42px rgba(242, 141, 53, 0.18),
        0 0.1em 0.5em rgba(0, 0, 0, 0.3);
    filter: drop-shadow(0 0 0.35rem rgba(255, 208, 96, 0.28));

    .wolf-editor-actions {
        flex-direction: column;
    }

    .wolf-editor-status {
        white-space: normal;
    }
    animation: gold-title-pulse 3.8s ease-in-out infinite;
}

.gold-title-glow--hero {
    background: linear-gradient(180deg, #fff9de 0%, #ffe9a7 32%, #f4bf46 68%, #fff1bb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gold-title-glow--overlay,
.gold-title-glow--ribbon {
    color: #ffe9a8;
}

.gold-title-glow--ribbon {
    font-weight: 700;
    letter-spacing: 0.16em;
}

.hero-copy {
    max-width: 52rem;
    margin: 1rem auto 1.4rem;
    color: var(--parchment-dim);
    line-height: 1.7;
    font-size: 1.04rem;
}

.hero-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.hero-badges span {
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 223, 135, 0.18);
    background: rgba(18, 30, 54, 0.72);
    color: #fff1bf;
    font-size: 0.82rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.goldknight-grid {
    display: grid;
    gap: 1.2rem;
    align-items: start;
    grid-template-columns: minmax(0, 1.75fr) minmax(18rem, 0.92fr);
}

.stage-card,
.side-card {
    background: linear-gradient(180deg, rgba(17, 25, 42, 0.98), rgba(9, 15, 28, 0.96));
    border: 1px solid var(--border);
    box-shadow: 0 1.6rem 3.2rem var(--shadow);
}

.stage-card {
    border-radius: 1.6rem;
    overflow: hidden;
}

.visual-legend {
    padding: 1rem 1.1rem 1.15rem;
    border-top: 1px solid rgba(255, 223, 135, 0.1);
    background: linear-gradient(180deg, rgba(13, 20, 35, 0.98), rgba(9, 15, 28, 0.98));
}

.visual-legend__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.visual-legend__header h2 {
    margin: 0;
    color: #fff2c3;
    font-size: 1.18rem;
}

.visual-legend__kicker {
    margin: 0 0 0.2rem;
    color: #d9c081;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.visual-legend__grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.visual-legend__card {
    display: grid;
    align-content: start;
    padding: 0.75rem 0.8rem 0.85rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.visual-legend__label {
    display: block;
    margin-bottom: 0.55rem;
    color: #fff2c3;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.visual-legend__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    gap: 0.45rem;
}

.visual-legend__item {
    display: grid;
    gap: 0.35rem;
    align-content: start;
}

.visual-legend__item-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 4.5rem;
    padding: 0.3rem;
    border-radius: 0.85rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.visual-legend__item-canvas {
    display: block;
    width: 100%;
    max-width: 4.75rem;
    height: auto;
}

.visual-legend__item-label {
    display: block;
    color: rgba(233, 240, 252, 0.88);
    font-size: 0.68rem;
    line-height: 1.3;
    text-align: center;
}

.card-ribbon {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(90deg, rgba(244, 191, 70, 0.12), rgba(73, 121, 216, 0.12));
    border-bottom: 1px solid rgba(255, 223, 135, 0.12);
    font-size: 0.82rem;
    color: #fff3cb;
}

.canvas-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #050c17;
}

#goldKnightCanvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: manipulation;
    background: linear-gradient(180deg, #1c2947 0%, #0a1220 100%);
}

.game-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: linear-gradient(180deg, rgba(4, 9, 18, 0.18), rgba(4, 9, 18, 0.56));
    transition: opacity 180ms ease, visibility 180ms ease;
}

.game-overlay.is-hidden {
    opacity: 0;
    visibility: hidden;
}

.overlay-panel {
    width: min(92%, 30rem);
    padding: 1.4rem 1.5rem 1.5rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 223, 135, 0.24);
    background: rgba(10, 16, 28, 0.9);
    box-shadow: 0 1.4rem 3rem rgba(0, 0, 0, 0.38);
    text-align: center;
}

.overlay-panel h2 {
    margin: 0.3rem 0 0.7rem;
    font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.overlay-panel p {
    margin: 0;
    color: var(--parchment-dim);
    line-height: 1.6;
}

.htp-panel {
    width: min(92%, 34rem);
    text-align: left;
}

.htp-panel h2 {
    text-align: center;
}

.htp-list {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
    display: grid;
    gap: 0.55rem;
}

.htp-list li {
    color: var(--parchment-dim);
    line-height: 1.6;
}

.htp-panel .overlay-button {
    display: block;
    width: 100%;
    margin-top: 1.25rem;
}

.overlay-button,
#saveScoreButton,
.ghost-button {
    appearance: none;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font: inherit;
}

.overlay-button,
#saveScoreButton {
    margin-top: 1rem;
    padding: 0.9rem 1.25rem;
    background: linear-gradient(135deg, #f4bf46, #f5dd94);
    color: #1a2134;
    font-weight: 700;
    box-shadow: 0 0.8rem 1.8rem rgba(244, 191, 70, 0.24);
}

.overlay-button:hover,
#saveScoreButton:hover {
    transform: translateY(-1px);
}

.side-card {
    border-radius: 1.6rem;
    padding: 1rem;
    display: grid;
    gap: 1rem;
}

.stats-card,
.player-card,
.leaderboard-card,
.lore-card {
    border-radius: 1.25rem;
    padding: 1rem;
    background: linear-gradient(180deg, rgba(20, 29, 49, 0.95), rgba(12, 18, 32, 0.98));
    border: 1px solid rgba(255, 223, 135, 0.12);
}

.side-card h2 {
    margin: 0 0 0.85rem;
    color: #fff2c3;
    font-size: 1.28rem;
}

.player-card label {
    display: block;
    margin-bottom: 0.55rem;
    color: #fff2c3;
    font-size: 0.92rem;
}

.player-select {
    width: 100%;
    min-width: 0;
    padding: 0.85rem 1rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(255, 223, 135, 0.18);
    background: rgba(6, 10, 20, 0.68);
    color: #fff5dc;
    font: inherit;
}

.player-select:focus {
    outline: 2px solid rgba(137, 188, 255, 0.38);
    border-color: rgba(137, 188, 255, 0.55);
}

.player-select-hint {
    margin: 0.8rem 0 0;
    color: var(--parchment-dim);
    line-height: 1.55;
    font-size: 0.92rem;
}

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

.stat-box {
    padding: 0.9rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-label {
    display: block;
    font-size: 0.68rem;
    color: #c7d2ea;
    margin-bottom: 0.45rem;
}

.stat-box strong {
    font-size: clamp(1.05rem, 3vw, 1.55rem);
    color: #fff6d8;
}

.capture-overlay-panel {
    width: min(92%, 26rem);
    padding: 1.4rem 1.5rem 1.5rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 223, 135, 0.24);
    background: rgba(10, 16, 28, 0.9);
    box-shadow: 0 1.4rem 3rem rgba(0, 0, 0, 0.38);
    text-align: center;
}

.capture-overlay-panel h2 {
    margin: 0.2rem 0 0.8rem;
    font-family: "Book Antiqua", "Palatino Linotype", Garamond, serif;
    font-size: clamp(1.5rem, 2.4vw, 2rem);
}

.capture-overlay-panel #captureSummary {
    margin: 0 0 0.9rem;
    color: var(--parchment-dim);
    line-height: 1.55;
    font-size: 0.88rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.capture-overlay-panel form {
    text-align: left;
}

.capture-overlay-panel #playAgainButton {
    display: block;
    width: 100%;
    margin-top: 0.65rem;
}

.capture-row #saveScoreButton {
    margin-top: 0;
    align-self: stretch;
}

.leaderboard-card p,
.lore-card li {
    color: var(--parchment-dim);
    line-height: 1.55;
}

#scoreForm label {
    display: block;
    margin-bottom: 0.55rem;
    color: #fff2c3;
    font-size: 0.92rem;
}

.capture-row {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: minmax(0, 1fr) auto;
}

#runnerName {
    width: 100%;
    min-width: 0;
    padding: 0.85rem 1rem;
    border-radius: 0.95rem;
    border: 1px solid rgba(255, 223, 135, 0.18);
    background: rgba(6, 10, 20, 0.68);
    color: #fff5dc;
    font: inherit;
}

#runnerName:focus {
    outline: 2px solid rgba(137, 188, 255, 0.38);
    border-color: rgba(137, 188, 255, 0.55);
}

.capture-feedback {
    min-height: 1.35rem;
    margin: 0.8rem 0 0;
    font-size: 0.92rem;
}

.capture-feedback.is-error {
    color: #ffb4a5;
}

@keyframes gold-title-pulse {
    0%,
    100% {
        text-shadow:
            0 0 10px rgba(255, 214, 105, 0.42),
            0 0 24px rgba(244, 191, 70, 0.28),
            0 0 42px rgba(242, 141, 53, 0.14),
            0 0.1em 0.5em rgba(0, 0, 0, 0.3);
        filter: drop-shadow(0 0 0.35rem rgba(255, 208, 96, 0.24));
    }
    50% {
        text-shadow:
            0 0 14px rgba(255, 224, 142, 0.72),
            0 0 32px rgba(244, 191, 70, 0.46),
            0 0 54px rgba(242, 141, 53, 0.24),
            0 0.1em 0.5em rgba(0, 0, 0, 0.3);
        filter: drop-shadow(0 0 0.55rem rgba(255, 217, 128, 0.36));
    }
}

.capture-feedback.is-success {
    color: #c0f0b1;
}

.ghost-button {
    padding: 0.82rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    color: #fff1be;
    border: 1px solid rgba(255, 223, 135, 0.16);
}

.ghost-button.small {
    padding: 0.6rem 0.9rem;
    font-size: 0.88rem;
}

.leaderboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.leaderboard-header h2 {
    margin-bottom: 0.2rem;
}

.leaderboard-header p {
    margin: 0;
}

.leaderboard-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.55rem;
}

.leaderboard-item,
.leaderboard-empty {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: center;
    padding: 0.78rem 0.85rem;
    border-radius: 0.95rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-empty {
    grid-template-columns: 1fr;
    color: var(--parchment-dim);
}

.leaderboard-rank {
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(244, 191, 70, 0.12);
    color: #ffdf95;
    font-weight: 700;
}

.leaderboard-name {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    min-width: 0;
}

.leaderboard-name strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff5d0;
}

.leaderboard-name span {
    font-size: 0.74rem;
    color: #c4cfeb;
}

.leaderboard-score {
    color: #fff0a1;
    font-weight: 700;
}

.lore-card ul {
    margin: 0;
    padding-left: 1.15rem;
    display: grid;
    gap: 0.55rem;
}

@media (max-width: 1040px) {
    .goldknight-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .goldknight-shell {
        padding-inline: 0.8rem;
    }

    .visual-legend__grid {
        grid-template-columns: 1fr;
    }

    .stats-grid,
    .capture-row {
        grid-template-columns: 1fr;
    }

    .leaderboard-item {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .leaderboard-score {
        grid-column: 2;
    }

    .overlay-panel {
        padding: 0.85rem 1rem 1rem;
    }

    .overlay-panel h2 {
        font-size: 1.25rem;
        margin: 0.2rem 0 0.45rem;
    }

    .overlay-kicker {
        font-size: 0.65rem;
        margin-bottom: 0.2rem;
    }

    .overlay-panel p {
        font-size: 0.82rem;
        line-height: 1.45;
    }

    .overlay-button {
        margin-top: 0.7rem;
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }
}

/* ── Mobile touch controls ───────────────────────────────── */

.mobile-controls {
    display: none;
}

.htp-mobile-hint {
    display: none;
}

@media (pointer: coarse) {
    .mobile-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
        background: rgba(9, 15, 28, 0.96);
        border-top: 1px solid rgba(255, 223, 135, 0.10);
    }

    .mobile-controls__toolbar {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

    .mobile-controls__label {
        color: rgba(244, 234, 203, 0.78);
        font-size: 0.78rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .mobile-layout-toggle {
        appearance: none;
        border: 1px solid rgba(255, 223, 135, 0.18);
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.04);
        color: #f4eacb;
        cursor: pointer;
        font: inherit;
        font-size: 0.84rem;
        font-weight: 700;
        padding: 0.45rem 0.85rem;
        transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
    }

    .mobile-layout-toggle[aria-pressed="true"] {
        background: rgba(244, 191, 70, 0.18);
        border-color: rgba(244, 191, 70, 0.38);
    }

    .htp-mobile-hint {
        display: list-item;
    }

    .mobile-btn {
        order: 1;
        appearance: none;
        border: 0;
        border-radius: 1.25rem;
        cursor: pointer;
        font: inherit;
        font-weight: 700;
        font-size: 1.1rem;
        padding: 1rem 0.5rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0.3rem;
        user-select: none;
        -webkit-user-select: none;
        touch-action: manipulation;
        transition: transform 80ms ease, opacity 80ms ease;
    }

    .mobile-btn:active {
        transform: scale(0.94);
        opacity: 0.85;
    }

    .mobile-btn__icon {
        font-size: 1.8rem;
        line-height: 1;
    }

    .mobile-btn--jump {
        background: linear-gradient(135deg, #4979d8, #274a9f);
        color: #e8f0ff;
        box-shadow: 0 0.6rem 1.4rem rgba(73, 121, 216, 0.32);
    }

    .mobile-btn--attack {
        order: 2;
        background: linear-gradient(135deg, #f4bf46, #e8981e);
        color: #1a2134;
        box-shadow: 0 0.6rem 1.4rem rgba(244, 191, 70, 0.28);
    }

    .mobile-controls[data-layout="left"] .mobile-btn--jump {
        order: 2;
    }

    .mobile-controls[data-layout="left"] .mobile-btn--attack {
        order: 1;
    }
}

@keyframes drift-a {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(5rem, 2rem, 0); }
}

@keyframes drift-b {
    from { transform: translate3d(0, 0, 0); }
    to { transform: translate3d(-3rem, -2rem, 0); }
}

@keyframes pulse-a {
    0%, 100% { transform: scale(1); opacity: 0.13; }
    50% { transform: scale(1.08); opacity: 0.24; }
}

@keyframes pulse-b {
    0%, 100% { transform: scale(0.95); opacity: 0.15; }
    50% { transform: scale(1.05); opacity: 0.26; }
}