* {
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

:root {
    --soil-0: #4f3624;
    --soil-1: #6d4a30;
    --soil-2: #8c6240;
    --grass-0: #7ea74b;
    --grass-1: #a5d66a;
    --cream: #f9ecd3;
    --ink: #3a2617;
    --panel: #f3dfbc;
    --design-width: 430px;
    --design-height: 932px;
    --app-scale: 1;
    --safe-vw: 100vw;
    --safe-vh: 100dvh;
    --app-visible-height: 932px;
    --viewport-crop-top: 0px;
    --viewport-crop-bottom: 0px;
    --home-ui-scale: 1;
    --header-h: 16px;
    --canvas-top-gap: 78px;
    --hud-bottom-h: 49px;
    --content-pad-x: 0px;
    --font-display: "ZCOOL KuaiLe", "Nunito", "Microsoft YaHei", sans-serif;
    --font-body: "Nunito", "Microsoft YaHei", "PingFang SC", sans-serif;
    --font-ui-clean: "Nunito", "Microsoft YaHei", "PingFang SC", sans-serif;

    --asset-home-bg: none;
    --asset-home-sprite: none;
    --asset-ui1-sprite: none;
    --asset-ui2-sprite: none;
    --asset-panel: none;
    --asset-button: none;
    --asset-card: none;
    --asset-home-cave-panel: none;
    --asset-home-panel-large: none;
    --asset-home-title-logo: none;
    --asset-home-title-logo-en: none;
    --asset-home-btn-start: none;
    --asset-home-btn-settings: none;
    --asset-home-btn-rank: none;
    --asset-home-btn-skin: none;
    --asset-home-btn-checkin: none;
    --asset-home-btn-logout: none;
    --asset-home-btn-support: none;
    --asset-home-snake-up: none;
    --asset-home-snake-down: none;
}

.site-compliance-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 22;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 24px;
    padding: 4px max(10px, env(safe-area-inset-left)) calc(4px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right));
    background: rgba(18, 29, 23, 0.56);
    color: rgba(255, 255, 255, 0.82);
    font: 12px/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    pointer-events: auto;
}

.site-compliance-footer a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
}

.site-compliance-footer a:hover {
    text-decoration: underline;
}

html,
body {
    margin: 0;
    width: var(--safe-vw);
    height: var(--safe-vh);
    min-height: var(--safe-vh);
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
    background: radial-gradient(circle at 24% 6%, #95c666 0%, #739f4c 30%, #5a7c3d 46%, #3d5a2d 100%);
}

body {
    position: relative;
    font-family: var(--font-body);
}

button,
input,
select,
textarea {
    font-family: inherit;
}

button {
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
}

.app-container {
    position: absolute;
    left: 50%;
    top: 0;
    width: var(--design-width);
    height: var(--design-height);
    transform: translateX(-50%) scale(var(--app-scale));
    transform-origin: top center;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(119, 168, 72, 0.52) 0%, rgba(106, 151, 62, 0.4) 22%, rgba(104, 73, 45, 0.6) 34%, rgba(75, 48, 31, 0.82) 100%),
        var(--asset-home-bg) center top / cover no-repeat;
    box-shadow: 0 16px 48px rgba(22, 15, 10, 0.42);
}

.app-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: var(--viewport-crop-bottom);
    height: var(--hud-bottom-h);
    z-index: 10;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(98, 63, 40, 0.12) 0%, rgba(80, 51, 33, 0.86) 42%, rgba(68, 44, 29, 0.96) 100%);
    border-top: 1px solid rgba(255, 219, 167, 0.2);
}

.app-container.menu-mode {
    background: var(--asset-home-bg) center top / cover no-repeat;
}

.app-container.menu-mode::after {
    display: none;
}

html.arrow-fast-first-run .app-container {
    background: linear-gradient(180deg, #6fa248 0%, #567c3a 44%, #2f4425 100%);
}

html.arrow-fast-first-run #menuOverlay {
    display: none;
}

.app-container.menu-mode .wechat-header,
.app-container.menu-mode .background-pattern,
.app-container.menu-mode .game-container {
    display: none;
}

.hidden {
    display: none !important;
}

.pixel-icon {
    image-rendering: auto;
}

.wechat-header {
    position: relative;
    z-index: 30;
    height: var(--header-h);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15px;
    pointer-events: none;
}

.wechat-header {
    display: none;
}

.wechat-title {
    font-family: var(--font-display);
    color: #fff4dc;
    font-size: 33px;
    line-height: 1;
    letter-spacing: 1px;
    text-shadow: 0 3px 0 rgba(82, 49, 29, 0.8), 0 8px 20px rgba(29, 18, 11, 0.36);
}

.background-pattern {
    position: absolute;
    inset: var(--header-h) 0 0;
    pointer-events: none;
    opacity: 0.18;
    mix-blend-mode: soft-light;
    background-image:
        radial-gradient(circle at 8px 8px, rgba(255, 238, 208, 0.28) 2px, transparent 2px),
        radial-gradient(circle at 18px 18px, rgba(255, 212, 153, 0.22) 2px, transparent 2px);
    background-size: 24px 24px;
}

.game-container {
    position: absolute;
    inset: var(--header-h) 0 0;
    z-index: 5;
}

.canvas-wrapper {
    position: absolute;
    inset:
        calc(var(--canvas-top-gap) + var(--viewport-crop-top))
        var(--content-pad-x)
        calc(var(--hud-bottom-h) + var(--viewport-crop-bottom))
        var(--content-pad-x);
    border-radius: 20px;
    overflow: hidden;
    background: transparent;
    border: 0;
    box-shadow: none;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
}

#hud {
    position: absolute;
    inset: 0;
    z-index: 25;
    pointer-events: none;
}

.perf-diagnostics-panel {
    position: fixed;
    left: 8px;
    bottom: 8px;
    z-index: 9999;
    min-width: 220px;
    max-width: calc(100vw - 16px);
    padding: 8px 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(15, 18, 28, 0.82);
    color: #d9f7ff;
    font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre;
    pointer-events: none;
    user-select: none;
    text-shadow: none;
}

.hud-top {
    position: absolute;
    top: calc(var(--header-h) + 8px);
    left: 0;
    width: 100%;
    height: 76px;
}

.hud-settings-btn {
    position: absolute;
    right: 8px;
    top: -4px;
    width: 46px;
    height: 46px;
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    overflow: hidden;
    background-image: var(--asset-ui2-sprite);
    background-color: transparent;
    background-repeat: no-repeat;
    background-size: 206px 292px;
    background-position: -141px -167px;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    cursor: pointer;
    transition: transform 120ms ease, filter 120ms ease;
    z-index: 7;
}

.hud-settings-btn:active {
    transform: scale(0.92);
    filter: brightness(0.9);
}

.hud-settings-icon {
    width: 43px;
    height: 43px;
    display: block;
    filter: none;
    pointer-events: none;
}

.coin-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(249, 221, 168, 0.6);
    background: linear-gradient(180deg, rgba(255, 247, 228, 0.94) 0%, rgba(237, 200, 134, 0.94) 100%);
    box-shadow: inset 0 -1px 0 rgba(123, 83, 48, 0.24), 0 4px 10px rgba(45, 29, 18, 0.24);
}

.coin-chip.coin-chip-fly-focus {
    z-index: 96 !important;
}

.coin-chip-icon {
    width: 16px;
    height: 16px;
    display: block;
    flex: 0 0 auto;
    background-image: var(--asset-ui2-sprite);
    background-repeat: no-repeat;
    background-size: 106px 150px;
    background-position: -73px -107px;
    filter: drop-shadow(0 1px 1px rgba(82, 52, 29, 0.3));
}

.coin-chip-value {
    color: #6a4124;
    font-size: 18px;
    line-height: 1;
    font-weight: 900;
    font-family: var(--font-ui-clean);
}

.hud-coin-chip {
    position: absolute;
    right: 72px;
    top: 4px;
    pointer-events: none;
    z-index: 7;
}

.hud-center {
    position: absolute;
    left: 50%;
    top: 0;
    width: min(244px, calc(100% - 156px));
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 0;
}

.hud-score-pulse {
    position: absolute;
    left: 50%;
    top: calc(var(--header-h) + 62px);
    width: min(188px, calc(100% - 168px));
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 6;
}

.hud-score-value {
    --score-base-scale: 1;
    transform: scale(var(--score-base-scale));
    transform-origin: center top;
    min-height: 28px;
    max-width: 100%;
    padding: 0 6px;
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.25px;
    color: #e6f4d4;
    text-shadow: 0 2px 0 rgba(45, 30, 20, 0.58), 0 6px 12px rgba(38, 23, 16, 0.28);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    font-variant-numeric: tabular-nums;
    transition: color 120ms linear, text-shadow 120ms linear, transform 220ms ease;
}

.hud-score-gain {
    margin-top: 0;
    min-height: 16px;
    padding: 0 6px;
    font-family: var(--font-ui-clean);
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    color: #fff4cf;
    text-shadow: 0 1px 0 rgba(39, 24, 16, 0.56), 0 5px 10px rgba(34, 20, 14, 0.3);
}

.hud-status-row {
    margin-top: 4px;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: visible;
}

.hud-level {
    color: #fff3df;
    font-family: var(--font-display);
    font-size: 17px;
    line-height: 1;
    letter-spacing: 0.35px;
    text-shadow: 0 2px 0 rgba(66, 40, 22, 0.62);
    margin-top: 0;
    margin-bottom: 2px;
    text-align: center;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#levelInfo {
    display: block;
}

.hud-lives {
    min-height: 26px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.hud-lives.hud-lives-placeholder {
    visibility: hidden;
}

.heart {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.heart-icon {
    width: 20px;
    height: 20px;
    background: url('../assets/ui/shared/icons/icon_energy.webp') center / contain no-repeat;
}

.heart.empty {
    opacity: 0.3;
    filter: grayscale(1);
}

.hud-timer {
    position: relative;
    width: min(168px, 100%);
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.hud-timer-track {
    position: relative;
    width: 100%;
    height: 14px;
    border-radius: 999px;
    border: 0;
    background-color: transparent;
    background-image: var(--asset-ui2-sprite);
    background-repeat: no-repeat;
    background-size: 168px 239px;
    background-position: 0 -196px;
    box-shadow: none;
    overflow: hidden;
}

.hud-timer-fill {
    position: absolute;
    left: calc(26.5% - 5px);
    right: 4.8%;
    top: 34%;
    bottom: 35%;
    transform-origin: left center;
    transform: scaleX(1);
    border-radius: 0 999px 999px 0;
    background: linear-gradient(90deg, #ffe58c 0%, #ffb34f 46%, #ff6e53 100%);
    transition: transform 80ms linear, filter 120ms ease;
}

.hud-timer-label {
    color: #fff5e3;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
    text-shadow: 0 1px 0 rgba(35, 22, 15, 0.5);
}

.hud-timer.timer-danger .hud-timer-label {
    color: #ffd4df;
}

.hud-timer.timer-danger .hud-timer-fill {
    background: linear-gradient(90deg, #ffb0ba 0%, #ff5f88 45%, #eb2c61 100%);
    filter: saturate(1.1);
}

.hud-timer.timer-last10 {
    gap: 0;
}

.hud-timer.timer-last10 .hud-timer-label {
    font-size: 42px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0.6px;
    transform: translateY(-1px) scale(1);
    animation: hud-last10-pulse 620ms ease-in-out infinite;
}

.hud-timer.timer-gain .hud-timer-fill {
    filter: brightness(1.25) saturate(1.12);
}

@keyframes hud-last10-pulse {
    0% {
        transform: translateY(-1px) scale(1);
        text-shadow: 0 1px 0 rgba(35, 22, 15, 0.5), 0 0 0 rgba(255, 113, 148, 0.1);
    }
    55% {
        transform: translateY(-1px) scale(1.14);
        text-shadow: 0 2px 0 rgba(55, 22, 26, 0.62), 0 0 14px rgba(255, 113, 148, 0.55);
    }
    100% {
        transform: translateY(-1px) scale(1);
        text-shadow: 0 1px 0 rgba(35, 22, 15, 0.5), 0 0 0 rgba(255, 113, 148, 0.1);
    }
}

.hud-combo {
    min-width: 0;
    max-width: 190px;
    height: 42px;
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 4px;
    flex-wrap: nowrap;
    white-space: nowrap;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 22px;
    line-height: 1;
    letter-spacing: 0.5px;
    text-align: right;
    color: #ffeec5;
    pointer-events: none;
    user-select: none;
    text-shadow: 0 2px 0 rgba(73, 43, 25, 0.68), 0 6px 16px rgba(26, 15, 9, 0.44);
    transform: translateY(10px);
}

.hud-combo.combo-reward-progress {
    align-items: center;
    justify-content: flex-end;
    font-family: var(--font-ui);
    font-size: 13px;
    letter-spacing: 0;
    line-height: 1.05;
    color: #fff0c2;
    text-align: right;
    white-space: nowrap;
}

.hud-combo-count {
    display: inline-block;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.4px;
}

.hud-combo-label {
    display: inline-block;
    font-size: 0.82em;
    letter-spacing: 0.7px;
    transform: translateY(-1px);
}

.hud-combo.combo-tier-1 {
    color: #ffeec5;
}

.hud-combo.combo-tier-2 {
    color: #ffeec5;
}

.hud-combo.combo-tier-3 {
    color: #ff6a63;
}

.hud-combo.combo-tier-4 {
    color: #ffd6a8;
}

.hud-reward-toast {
    position: absolute;
    left: 50%;
    top: 112px;
    width: min(336px, calc(100% - 24px));
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -24px) scale(0.92);
    z-index: 8;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 242, 188, 0.96) 0%, rgba(246, 206, 136, 0.96) 100%);
    box-shadow:
        0 10px 22px rgba(78, 41, 20, 0.34),
        0 0 0 2px rgba(145, 90, 46, 0.28) inset,
        0 2px 0 rgba(255, 255, 255, 0.36) inset;
}

.hud-reward-toast.is-playing {
    animation: reward-toast-top 2.2s cubic-bezier(0.22, 0.74, 0.22, 1) forwards;
}

.hud-reward-toast-image {
    width: 100%;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(77, 20, 4, 0.52));
}

.hud-reward-toast-text {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 1.4px;
    color: #ffeec7;
    text-shadow:
        0 3px 0 rgba(128, 45, 20, 0.88),
        0 0 10px rgba(255, 161, 71, 0.9),
        0 0 24px rgba(255, 91, 33, 0.72);
    animation: combo-flame 230ms ease-in-out infinite alternate;
}

@keyframes reward-toast-top {
    0% {
        opacity: 0;
        transform: translate(-50%, -26px) scale(0.86);
    }
    14% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -10px) scale(0.92);
    }
}
.hud-energy-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.hud-energy-orb {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 28%, #fff7da 0%, #ffe380 38%, #ffa447 74%, #ff6a3a 100%);
    box-shadow: 0 0 8px rgba(255, 177, 73, 0.7), 0 0 14px rgba(255, 95, 52, 0.36);
    transform: translate(-50%, -50%) scale(0.8);
}

.hud-timer-gain-pop {
    position: absolute;
    z-index: 8;
    color: #fff2c5;
    font-family: var(--font-display);
    font-size: 20px;
    line-height: 1;
    white-space: nowrap;
    text-shadow: 0 2px 0 rgba(89, 53, 31, 0.75), 0 0 10px rgba(255, 174, 86, 0.54);
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.hud-timer-gain-pop-bar {
    left: 82%;
    top: 7px;
    transform: translate(calc(-50% - 110px), calc(-50% + 10px));
}

@keyframes combo-flame {
    from {
        transform: translateY(0) scale(1);
        text-shadow:
            0 2px 0 rgba(151, 46, 25, 0.72),
            0 0 10px rgba(255, 170, 88, 0.58),
            0 0 20px rgba(255, 96, 58, 0.48);
    }
    to {
        transform: translateY(-1px) scale(1.02);
        text-shadow:
            0 2px 0 rgba(171, 52, 27, 0.78),
            0 0 14px rgba(255, 202, 112, 0.72),
            0 0 24px rgba(255, 104, 61, 0.64);
    }
}

.hud-bottom {
    position: absolute;
    left: 0;
    bottom: calc(var(--viewport-crop-bottom) + max(12px, env(safe-area-inset-bottom)));
    width: 100%;
    padding: 0 30px;
    pointer-events: auto;
}

#hud.tutorial-hud .hud-coin-chip,
#hud.tutorial-hud .hud-center,
#hud.tutorial-hud .hud-bottom,
#hud.tutorial-hud #comboDisplay,
#hud.tutorial-hud #rewardUnlockToast,
#hud.tutorial-hud #timer,
#hud.tutorial-hud #lives,
#hud.tutorial-hud #levelInfo {
    display: none !important;
}

.tutorial-tap-guide {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 70;
    pointer-events: none;
}

.tutorial-tap-hand {
    position: absolute;
    left: var(--tutorial-hand-x, 50%);
    top: var(--tutorial-hand-y, 50%);
    width: clamp(54px, 14vw, 86px);
    aspect-ratio: 82 / 108;
    background: url('../assets/ui/reward-guide-hand.webp') center / contain no-repeat;
    filter: drop-shadow(0 10px 18px rgba(44, 25, 11, 0.28));
    transform: translate(-12%, calc(4% - 10px)) rotate(-14deg);
    animation: tutorial-tap-hand 1.05s ease-in-out infinite;
}

.tutorial-tap-hand::after {
    content: '';
    position: absolute;
    left: 12%;
    top: 14%;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.92);
    opacity: 0;
    animation: tutorial-tap-ripple 1.05s ease-out infinite;
}

@keyframes tutorial-tap-hand {
    0%, 100% {
        transform: translate(-12%, calc(4% - 10px)) rotate(-14deg) scale(1);
    }
    46% {
        transform: translate(-20%, calc(-5% - 10px)) rotate(-18deg) scale(0.92);
    }
}

@keyframes tutorial-tap-ripple {
    0%, 18% {
        opacity: 0;
        transform: scale(0.55);
    }
    38% {
        opacity: 0.95;
        transform: scale(0.95);
    }
    72%, 100% {
        opacity: 0;
        transform: scale(1.45);
    }
}

.items-container {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.item-btn {
    position: relative;
    width: 56px;
    height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    transition: transform 110ms ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.item-btn:active {
    transform: translateY(2px);
}

.item-btn.item-btn-armed {
    box-shadow:
        0 0 0 3px rgba(255, 225, 128, 0.9),
        0 8px 14px rgba(92, 56, 27, 0.34);
}

.item-btn:disabled,
.item-btn.item-btn-disabled {
    cursor: default;
    filter: none;
    opacity: 1;
    transform: none;
}

.item-btn:disabled:active,
.item-btn.item-btn-disabled:active {
    transform: none;
}

.item-btn:disabled .item-icon-img,
.item-btn.item-btn-disabled .item-icon-img {
    filter: grayscale(0.55) saturate(0.72) brightness(0.9);
    opacity: 0.9;
}

.item-icon-img {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 1;
    object-fit: contain;
    border-radius: 0;
}

.badge-plus {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(180deg, #88d96e, #5db74e);
    border: 1px solid #fff5e3;
    color: #fff;
    font-size: 7px;
    font-weight: 900;
    font-family: var(--font-ui-clean);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.badge-plus.is-empty {
    background: linear-gradient(180deg, #b9c1bf, #8f9796);
    color: #f2f2f2;
}

.overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: var(--app-visible-height);
    z-index: 35;
}

.reward-fly-layer {
    position: absolute;
    inset: 0;
    z-index: 72;
    overflow: hidden;
    pointer-events: none;
}

.reward-fly-coin {
    position: absolute;
    width: 28px;
    height: 28px;
    transform: translate(-50%, -50%);
    background-image: var(--asset-ui2-sprite);
    background-repeat: no-repeat;
    background-size: 186px 263px;
    background-position: -128px -187px;
    filter: drop-shadow(0 4px 7px rgba(82, 46, 13, 0.24));
    will-change: transform, opacity;
}

.boot-preload-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: var(--app-visible-height);
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(39, 24, 14, 0.8) 0%, rgba(25, 15, 9, 0.88) 100%);
    backdrop-filter: blur(2px);
}

.boot-preload-panel {
    width: min(84%, 318px);
    padding: 18px 18px 16px;
    border-radius: 18px;
    border: 2px solid rgba(241, 206, 156, 0.6);
    background: linear-gradient(180deg, rgba(248, 231, 199, 0.96) 0%, rgba(237, 202, 149, 0.96) 100%);
    box-shadow: 0 10px 24px rgba(16, 10, 6, 0.34);
}

.boot-preload-title {
    color: #6f4728;
    font-family: var(--font-display);
    font-size: 28px;
    line-height: 1;
}

.boot-preload-tip {
    margin-top: 8px;
    color: #7a5737;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}

.boot-preload-track {
    margin-top: 12px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(133, 88, 56, 0.6);
    background: rgba(255, 255, 255, 0.4);
    overflow: hidden;
}

.boot-preload-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #87c55a 0%, #f2cb57 100%);
    transition: width 120ms linear;
}

.boot-preload-text {
    margin-top: 10px;
    color: #6f4728;
    font-family: var(--font-display);
    font-size: 24px;
    line-height: 1;
    text-align: right;
}

.menu-content-v2 {
    position: absolute;
    left: 50%;
    top: 0;
    width: var(--design-width);
    height: var(--design-height);
    display: flex;
    flex-direction: column;
    padding: calc(var(--header-h) + 12px) 16px 18px;
    gap: 14px;
    transform: translateX(-50%) scale(var(--home-ui-scale));
    transform-origin: top center;
}

.menu-top-zone {
    display: grid;
    grid-template-columns: 1fr 172px;
    gap: 12px;
    align-items: stretch;
}

.brand-stack {
    background: var(--asset-panel) center / cover no-repeat;
    border: 2px solid rgba(255, 235, 196, 0.56);
    border-radius: 20px;
    padding: 14px 14px 10px;
    text-align: center;
    box-shadow: 0 8px 22px rgba(43, 27, 17, 0.35);
}

.logo-arrow,
.logo-clear {
    line-height: 1;
    font-family: var(--font-display);
    letter-spacing: 2px;
}

.logo-arrow {
    font-size: 42px;
    color: #fff4dd;
    text-shadow: -2px -2px 0 #7f5131, 2px -2px 0 #7f5131, -2px 2px 0 #7f5131, 2px 2px 0 #7f5131, 5px 5px 0 #5f3923;
}

.logo-clear {
    margin-top: 2px;
    font-size: 36px;
    color: #ffc784;
    text-shadow: -2px -2px 0 #7f5131, 2px -2px 0 #7f5131, -2px 2px 0 #7f5131, 2px 2px 0 #7f5131, 5px 5px 0 #5f3923;
}

.logo-line {
    width: 128px;
    height: 9px;
    margin: 8px auto 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, #ffd89f, #ffb16d);
    border: 2px solid rgba(106, 63, 35, 0.72);
}

.account-panel {
    border-radius: 20px;
    border: 2px solid rgba(255, 235, 196, 0.56);
    background: linear-gradient(180deg, rgba(244, 223, 189, 0.95) 0%, rgba(230, 186, 131, 0.95) 100%);
    padding: 12px;
    box-shadow: 0 8px 22px rgba(43, 27, 17, 0.35);
}

.account-title {
    color: #6a4326;
    font-family: var(--font-display);
    font-size: 20px;
    line-height: 1;
}

.account-subtitle {
    margin-top: 4px;
    color: #7c5637;
    font-size: 12px;
    font-weight: 700;
}

.resource-row {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.resource-pill {
    border-radius: 14px;
    background: rgba(92, 61, 39, 0.88);
    color: #fff5dc;
    padding: 6px 6px 8px;
    text-align: center;
}

.resource-pill span {
    display: block;
    font-size: 18px;
    line-height: 1;
    font-weight: 900;
}

.resource-pill small {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    line-height: 1;
    opacity: 0.9;
}

.resource-icon {
    width: 18px;
    height: 18px;
    display: block;
    margin: 0 auto 4px;
}

.menu-middle-zone {
    flex: 1;
    display: flex;
    align-items: center;
}

.hero-panel {
    width: 100%;
    border-radius: 24px;
    border: 2px solid rgba(255, 235, 196, 0.62);
    padding: 20px 16px 22px;
    text-align: center;
    background:
        linear-gradient(180deg, rgba(255, 245, 225, 0.94) 0%, rgba(239, 210, 167, 0.94) 100%),
        var(--asset-panel) center / cover no-repeat;
    box-shadow: 0 12px 30px rgba(32, 20, 12, 0.35);
}

.hero-title {
    color: #704728;
    font-family: var(--font-display);
    font-size: 38px;
    line-height: 1.02;
}

.hero-subtitle {
    margin-top: 8px;
    color: #805737;
    font-size: 14px;
    font-weight: 800;
}

.play-area {
    margin-top: 16px;
    text-align: center;
}

.btn-play,
.current-level-tag,
.btn-popup-primary,
.btn-popup-secondary,
.level-btn,
.panel-back-btn,
.locale-chip {
    border: 0;
    border-radius: 18px;
    cursor: pointer;
}

.btn-play {
    width: 254px;
    height: 72px;
    background: var(--asset-button) center / 100% 100% no-repeat;
    color: #6a3e20;
    font-family: var(--font-display);
    font-size: 36px;
    letter-spacing: 1px;
    box-shadow: 0 7px 14px rgba(53, 35, 21, 0.3);
}

.current-level-tag {
    margin-top: 14px;
    width: 172px;
    height: 50px;
    background: linear-gradient(180deg, #f4e1c0, #e4bd83);
    border: 2px solid #d9ab69;
    color: #704828;
    font-family: var(--font-display);
    font-size: 24px;
}

.menu-bottom-zone {
    border-radius: 20px;
    border: 0;
    background: transparent;
    padding: 10px 12px 12px;
    box-shadow: none;
}

.menu-feature-title {
    text-align: center;
    color: #f5debb;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.4px;
    margin-bottom: 10px;
}

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

.feature-card {
    position: relative;
    height: 94px;
    border: 2px solid rgba(255, 228, 186, 0.64);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 244, 225, 0.95) 0%, rgba(231, 196, 139, 0.95) 100%),
        var(--asset-card) center / cover no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #674022;
    box-shadow: inset 0 -2px 0 rgba(116, 77, 46, 0.2), 0 4px 10px rgba(0, 0, 0, 0.2);
}

.feature-card[data-feature-id='checkin'] {
    grid-column: 1 / 3;
}

.feature-card[data-feature-id='exit'] {
    grid-column: 3 / 4;
}

.feature-icon {
    width: 28px;
    height: 28px;
}

.feature-label {
    font-family: var(--font-display);
    font-size: 16px;
    line-height: 1;
}

.feature-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    border: 2px solid #fff3de;
    background: linear-gradient(180deg, #ff6d75 0%, #d6455b 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 900;
}

.entry-red-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid #fff3de;
    background: linear-gradient(180deg, #ff7078 0%, #da4057 100%);
    box-shadow: 0 3px 8px rgba(131, 30, 46, 0.35);
    pointer-events: none;
    z-index: 3;
}

#btnCheckin .entry-red-dot {
    top: 10px;
    right: 10px;
}

/* Home V2 (concept B) layout override */
.menu-content-v2 {
    padding: 24px 14px 20px;
    gap: 14px;
    justify-content: space-between;
}

.menu-home-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.menu-home-title {
    margin: 52px 0 0;
    max-width: 96%;
    text-align: center;
    color: #fff8ea;
    font-family: var(--font-display);
    font-size: 68px;
    line-height: 0.96;
    letter-spacing: 1px;
    text-shadow:
        -3px -3px 0 rgba(109, 67, 39, 0.98),
        3px -3px 0 rgba(109, 67, 39, 0.98),
        -3px 3px 0 rgba(109, 67, 39, 0.98),
        3px 3px 0 rgba(109, 67, 39, 0.98),
        0 8px 0 rgba(78, 46, 26, 0.9);
}

.play-area-v2 {
    margin-top: auto;
    padding-bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.btn-play {
    width: 248px;
    height: 92px;
    color: #623b1f;
    font-size: 47px;
    text-shadow: 0 2px 0 rgba(255, 239, 211, 0.5);
}

.current-level-tag {
    margin-top: 0;
    width: 164px;
    min-height: 64px;
    padding: 8px 10px;
    border-radius: 18px;
    border: 2px solid #d3a56b;
    background: linear-gradient(180deg, #f5e2c1 0%, #e7c28b 100%);
    color: #6f4728;
    font-size: 24px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    box-shadow: 0 4px 10px rgba(53, 33, 20, 0.26);
}

.current-level-tag .level-tag-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(96, 61, 37, 0.45);
    background: radial-gradient(circle at 35% 35%, #fff4d8 0%, #f2cc75 52%, #d39f49 100%);
}

.current-level-tag .level-tag-label {
    font-family: var(--font-display);
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.3px;
    color: #704728;
    opacity: 0.9;
}

.current-level-tag .level-tag-value {
    font-family: var(--font-display);
    font-size: 17px;
    line-height: 1;
    letter-spacing: 0.3px;
    color: #633a20;
}

.menu-bottom-zone-v2 {
    border-radius: 24px;
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

.menu-feature-grid-v2 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.feature-card {
    height: 132px;
    border: 2px solid rgba(198, 158, 114, 0.56);
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(255, 251, 243, 0.97) 0%, rgba(248, 239, 221, 0.97) 100%),
        var(--asset-card) center / cover no-repeat;
    box-shadow: 0 4px 10px rgba(51, 30, 18, 0.16);
}

.feature-card[data-feature-id='checkin'],
.feature-card[data-feature-id='exit'] {
    grid-column: auto;
}

.feature-icon {
    width: 40px;
    height: 40px;
}

.feature-label {
    font-size: 16px;
}

.feature-card-placeholder {
    opacity: 0.9;
    filter: saturate(0.82);
}

.feature-card:disabled {
    cursor: default;
}

.menu-panel-overlay {
    background: rgba(22, 14, 8, 0.4);
    backdrop-filter: blur(2px);
}

#checkinOverlay {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    padding: 0;
}

.panel-shell {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(90%, 360px);
    max-height: 78vh;
    border-radius: 24px;
    border: 2px solid rgba(255, 232, 198, 0.72);
    background:
        linear-gradient(180deg, rgba(255, 244, 221, 0.96) 0%, rgba(242, 214, 172, 0.94) 100%),
        var(--asset-panel) center / cover no-repeat;
    box-shadow: inset 0 -4px 0 rgba(143, 94, 58, 0.22), 0 16px 34px rgba(55, 33, 19, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-shell-sm {
    width: min(86%, 330px);
}

.panel-shell-levels {
    width: min(90%, 380px);
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 14px 10px;
    border-bottom: 1px solid rgba(123, 84, 53, 0.2);
}

.panel-title {
    margin: 0;
    color: #6f4527;
    font-family: var(--font-display);
    font-size: 34px;
    letter-spacing: 1px;
    line-height: 1;
}

.panel-back-btn {
    height: 34px;
    min-width: 74px;
    border: 2px solid #d9ab69;
    padding: 0 10px;
    background: linear-gradient(180deg, #f4e1c0, #e4bd83);
    color: #704828;
    font-family: var(--font-display);
    font-size: 16px;
}

.panel-body {
    padding: 12px 14px 16px;
    overflow: auto;
}

.support-author-body,
.profile-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.support-author-thankyou {
    margin: 0;
    color: #6f4527;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

.support-author-counter-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 12px;
    border: 1px solid rgba(139, 95, 60, 0.28);
    background: rgba(255, 250, 241, 0.75);
    padding: 10px 12px;
    color: #704727;
    font-size: 13px;
    font-weight: 800;
}

.support-author-count {
    color: #456d26;
    font-size: 20px;
    font-family: var(--font-display);
    line-height: 1;
}

.support-author-badge-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 10px;
    border: 1px dashed rgba(139, 95, 60, 0.32);
    background: rgba(255, 247, 228, 0.84);
    padding: 8px 12px;
    color: #6f4527;
    font-size: 13px;
    font-weight: 800;
}

.support-author-badge-count {
    color: #8a5a19;
    font-size: 18px;
    font-family: var(--font-display);
    line-height: 1;
}

.support-author-watch-btn,
.profile-save-btn {
    min-height: 42px;
}

.profile-body .field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #6f4527;
    font-size: 13px;
    font-weight: 800;
}

.setting-row {
    border-radius: 16px;
    background: rgba(255, 252, 246, 0.72);
    border: 1px solid rgba(138, 97, 64, 0.2);
    padding: 10px;
    margin-bottom: 10px;
}

.settings-reset-btn {
    margin-top: 10px;
    width: 100%;
    height: 44px;
    border: 2px solid #dba88e;
    border-radius: 14px;
    background: linear-gradient(180deg, #f7d0c0 0%, #e7aa95 100%);
    color: #6f3f2a;
    font-family: var(--font-display);
    font-size: 22px;
    letter-spacing: 0.4px;
}

.settings-end-run-btn {
    margin-top: 10px;
    width: 100%;
    height: 44px;
    border: 2px solid #d18a73;
    border-radius: 14px;
    background: linear-gradient(180deg, #f6c3b0 0%, #e9977d 100%);
    color: #6b3624;
    font-family: var(--font-display);
    font-size: 22px;
    letter-spacing: 0.4px;
}

.setting-title {
    color: #6a4628;
    font-family: var(--font-display);
    font-size: 23px;
    line-height: 1;
}

.setting-desc {
    margin-top: 4px;
    color: #7f5b3d;
    font-size: 12px;
    font-weight: 700;
}

.setting-control {
    margin-top: 10px;
}

.audio-stack {
    display: grid;
    gap: 8px;
}

.audio-row {
    position: relative;
    display: grid;
    grid-template-columns: 58px 1fr 52px;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 5px 8px;
    border-radius: 12px;
    border: 1px solid rgba(133, 90, 55, 0.24);
    background: rgba(255, 248, 232, 0.66);
    color: #6e482a;
    font-size: 15px;
    font-weight: 900;
    --audio-fill-ratio: 0;
}

.audio-row::before {
    content: '';
    position: absolute;
    left: 92px;
    top: 50%;
    width: calc(100% - 178px);
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f4a640 0%, #ffd36a 100%);
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
    box-shadow: 0 0 0 1px rgba(92, 48, 20, 0.2) inset;
    clip-path: inset(0 calc((1 - var(--audio-fill-ratio)) * 100% + 16px) 0 0 round 999px);
}

.audio-row input[type='range'] {
    width: 100%;
    min-height: 28px;
    accent-color: #8f5d39;
    touch-action: pan-x;
    position: relative;
    z-index: 2;
}

.audio-row input[type='range']::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
}

.audio-row input[type='range']::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border: 0;
}

@media (pointer: coarse) {
    .audio-row {
        min-height: 46px;
        padding: 8px 10px;
    }

    .audio-row input[type='range'] {
        min-height: 40px;
        margin: -6px 0;
    }

    .audio-row input[type='range']::-webkit-slider-thumb {
        width: 28px;
        height: 28px;
    }

    .audio-row input[type='range']::-moz-range-thumb {
        width: 28px;
        height: 28px;
    }
}

.audio-row strong {
    position: relative;
    z-index: 4;
    text-align: right;
    font-size: 13px;
    letter-spacing: 0.01em;
    color: #6b4426;
}

.locale-switch {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}

.locale-chip {
    height: 34px;
    padding: 0 12px;
    border: 2px solid #d9ab69;
    background: linear-gradient(180deg, #f8e7c9, #e7c18a);
    color: #6f4729;
    font-size: 13px;
    font-weight: 900;
}

.locale-chip.active {
    border-color: #6db34d;
    color: #2f4d1e;
    box-shadow: 0 0 0 2px rgba(117, 187, 84, 0.2) inset;
}

.rank-list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(128, 87, 58, 0.2);
}

#leaderboardOverlay .panel-shell {
    max-height: min(84vh, 760px);
}

.leaderboard-panel-body {
    overflow: hidden;
    overflow-x: hidden;
    overscroll-behavior: contain;
    touch-action: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.leaderboard-panel-body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

#leaderboardOverlay .rank-list:not(.rank-list-self) {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    touch-action: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    -webkit-overflow-scrolling: touch;
}

#leaderboardOverlay .rank-list:not(.rank-list-self).is-drag-scrolling {
    cursor: grabbing;
    user-select: none;
}

#leaderboardOverlay .rank-list:not(.rank-list-self)::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.leaderboard-mode-switch {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.leaderboard-mode-chip {
    min-height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(133, 90, 54, 0.32);
    background: rgba(255, 247, 229, 0.75);
    color: #7a4d2b;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.leaderboard-mode-chip.active {
    border-color: rgba(177, 119, 42, 0.58);
    background: linear-gradient(180deg, rgba(255, 238, 181, 0.96), rgba(250, 217, 134, 0.92));
    color: #6a3f1f;
}

.rank-list li {
    display: grid;
    grid-template-columns: 52px 1fr 72px;
    gap: 8px;
    padding: 8px 10px;
    color: #6e4728;
    font-weight: 800;
    background: rgba(255, 252, 246, 0.72);
}

.rank-list li:nth-child(even) {
    background: rgba(250, 241, 225, 0.9);
}

.rank-list li.is-self {
    background: linear-gradient(180deg, rgba(255, 245, 210, 0.96), rgba(255, 236, 178, 0.92));
    box-shadow: inset 0 0 0 1px rgba(194, 142, 54, 0.28);
}

.rank-self-section {
    margin-top: 12px;
    display: grid;
    gap: 8px;
}

.rank-self-label {
    padding-left: 4px;
    font-size: 12px;
    font-weight: 900;
    color: #875529;
    letter-spacing: 0.06em;
}

.rank-list.rank-list-self {
    border-style: dashed;
    overflow: visible;
}

.rank-list.rank-list-self li,
.rank-list.rank-list-self li:nth-child(even) {
    background: linear-gradient(180deg, rgba(255, 249, 231, 0.98), rgba(255, 240, 193, 0.94));
}

.skin-center-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    overflow: visible;
}

.skin-coin-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(190, 137, 80, 0.42);
    background: linear-gradient(180deg, rgba(255, 247, 227, 0.92), rgba(242, 214, 168, 0.92));
    color: #6f4527;
    font-weight: 900;
}

.skin-coin-icon {
    width: 16px;
    height: 16px;
    display: block;
    flex: 0 0 auto;
    background-image: var(--asset-ui2-sprite);
    background-repeat: no-repeat;
    background-size: 106px 150px;
    background-position: -73px -107px;
    filter: drop-shadow(0 1px 1px rgba(82, 52, 29, 0.3));
}

.skin-coin-value {
    font-size: 18px;
    line-height: 1;
}

.skin-rate {
    color: #7b5333;
    font-size: 12px;
    font-weight: 800;
}

.skin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.skin-grid::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.skin-card {
    min-height: 90px;
    border-radius: 14px;
    border: 1px solid rgba(214, 170, 110, 0.8);
    background: linear-gradient(180deg, rgba(255, 247, 232, 0.95), rgba(242, 214, 168, 0.93));
    padding: 8px 10px;
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.skin-card.skin-card-selected {
    border-color: #75b954;
    box-shadow: 0 0 0 2px rgba(117, 185, 84, 0.2) inset;
}

.skin-card.skin-card-locked {
    opacity: 0.92;
}

.skin-preview {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 12px;
    border: 1px solid rgba(186, 140, 92, 0.45);
    background: rgba(255, 253, 248, 0.78);
    box-shadow: inset 0 -1px 0 rgba(156, 112, 69, 0.2);
}

.skin-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.skin-name {
    margin: 0;
    color: #6e4628;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 900;
}

.skin-desc {
    margin: 0;
    color: #846140;
    font-size: 11px;
    line-height: 1.25;
}

.skin-status {
    margin: 0;
    color: #755033;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.2;
}

.skin-action-btn {
    height: 36px;
    min-width: 92px;
    border-radius: 11px;
    border: 1px solid #c6945c;
    background: linear-gradient(180deg, #fff2d1 0%, #efcd98 100%);
    color: #634024;
    font-size: 12px;
    font-weight: 900;
    padding: 0 10px;
    touch-action: manipulation;
}

.skin-action-btn:disabled {
    opacity: 0.62;
}

.checkin-grid {
    position: absolute;
    inset: 0;
    width: 980px;
    height: 760px;
    margin: 0;
}

.checkin-scene {
    position: relative;
    width: 980px;
    height: 760px;
    margin: 0;
    transform-origin: center center;
}

.checkin-back-btn {
    position: absolute;
    left: 16px;
    top: 16px;
    z-index: 50;
    margin-left: 0;
    margin-bottom: 0;
    height: 42px;
    min-width: 88px;
    padding: 0 14px;
    border-width: 2px;
    border-radius: 16px;
    font-size: 18px;
}

.checkin-card-notebook {
    position: relative;
    width: 980px;
    height: 760px;
    margin: 0 auto;
    border: 0 !important;
    background: transparent;
    box-shadow: none;
    border-radius: 0 !important;
    padding: 126px 0 0;
    overflow: visible;
}

.checkin-card-notebook::before {
    content: "";
    position: absolute;
    inset: 0;
    background: center / 100% 100% no-repeat url('../assets/ui/checkin/checkin_sheet_cut.webp');
    pointer-events: none;
    z-index: 0;
}

.checkin-card-notebook::after {
    display: none;
}

.checkin-card-notebook > * {
    position: relative;
    z-index: 2;
}

.checkin-card-notebook > .checkin-back-btn {
    position: absolute;
    z-index: 50;
}

.checkin-ribbon {
    position: absolute;
    left: 230px;
    top: 40px;
    width: 520px;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: center / 100% 100% no-repeat url('../assets/ui/checkin/checkin_ribbon_cut.webp');
    z-index: 2;
    pointer-events: none;
}

.checkin-ribbon-title {
    margin-top: -4px;
    color: #8a5427;
    font-family: var(--font-display);
    font-size: 60px;
    line-height: 1;
    font-weight: 900;
}

.checkin-day {
    position: absolute;
    width: 137px;
    height: 154px;
    border-radius: 18px;
    border: 0;
    background: center / 100% 100% no-repeat url('../assets/ui/checkin/checkin_day_card_solid.webp');
    color: #75472a;
    box-shadow: none;
    user-select: none;
    overflow: visible;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    z-index: 3;
}

.checkin-day.is-claimed:not(.day-7) {
    background: center / 100% 100% no-repeat url('../assets/ui/checkin/checkin_day_card_claimed_solid.webp');
}

.checkin-day.is-next {
    box-shadow: 0 0 0 6px rgba(248, 213, 143, 0.86), 0 8px 18px rgba(186, 121, 58, 0.24);
}

.checkin-day.is-claimed {
    box-shadow: none;
}

.checkin-day.is-clickable {
    cursor: pointer;
    touch-action: manipulation;
}

.checkin-day.is-clickable:focus-visible {
    outline: 3px solid rgba(244, 187, 88, 0.9);
    outline-offset: 4px;
}

.checkin-day.day-7 {
    left: 264px;
    top: 531px;
    width: 329px;
    height: 154px;
    border-radius: 18px;
    background: center / 100% 100% no-repeat url('../assets/ui/checkin/checkin_day7_panel.webp');
    align-items: flex-start;
}

.checkin-day-title {
    position: absolute;
    left: 14px;
    top: 12px;
    width: 109px;
    margin: 0;
    font-size: 16px;
    line-height: 1;
    font-weight: 900;
    color: #8a5427;
    text-shadow: 0 1px 0 rgba(255, 248, 233, 0.8);
    pointer-events: none;
}

.checkin-day.day-7 .checkin-day-title {
    left: 24px;
    top: 18px;
    width: 120px;
    font-size: 28px;
}

.checkin-reward-cover {
    display: none;
}

.checkin-day.day-7 .checkin-reward-cover {
    display: none;
}

.checkin-reward-amount-cover {
    display: none;
}

.checkin-day.day-7 .checkin-reward-amount-cover {
    display: none;
}

.checkin-reward-icon {
    position: absolute;
    left: 50%;
    top: 78px;
    width: 46px;
    height: 46px;
    transform: translate(-50%, -50%);
    object-fit: contain;
    image-rendering: auto;
    filter: drop-shadow(0 2px 3px rgba(84, 55, 25, 0.18));
    pointer-events: none;
}

.checkin-day.day-7 .checkin-reward-icon {
    left: 190px;
    top: 73px;
    width: 60px;
    height: 60px;
    transform: translate(-50%, -50%);
}

.checkin-reward-amount {
    position: absolute;
    left: 50%;
    top: 120px;
    transform: translate(-50%, -50%);
    font-size: 17px;
    font-weight: 900;
    line-height: 1;
    color: #6f4629;
    text-shadow: 0 1px 0 rgba(255, 248, 233, 0.9);
    pointer-events: none;
}

.checkin-day.day-7 .checkin-reward-amount {
    left: 259px;
    top: 115px;
    transform: translate(-50%, -50%);
    font-size: 23px;
}

.checkin-claimed-badge {
    position: absolute;
    left: 50%;
    top: 78px;
    width: 28px;
    height: 28px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    background: linear-gradient(180deg, #8bd85b 0%, #4ca13f 100%);
    border: 2px solid #f5efc4;
    box-shadow: 0 3px 7px rgba(58, 101, 42, 0.28);
    color: #ffffff;
    font-size: 16px;
    font-weight: 900;
    line-height: 24px;
    text-align: center;
    pointer-events: none;
}

.checkin-day.day-7 .checkin-claimed-badge {
    left: 190px;
    top: 73px;
    transform: translate(-50%, -50%);
}

.checkin-day-claim-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid #fff3de;
    background: linear-gradient(180deg, #ff7078 0%, #da4057 100%);
    box-shadow: 0 3px 8px rgba(131, 30, 46, 0.35);
    pointer-events: none;
    z-index: 5;
}

.checkin-day.day-7 .checkin-day-claim-dot {
    top: 10px;
    right: 10px;
}

.checkin-reward-tooltip {
    position: absolute;
    min-width: 180px;
    max-width: 250px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 2px solid rgba(168, 114, 61, 0.9);
    background: linear-gradient(180deg, rgba(255, 247, 229, 0.98) 0%, rgba(246, 226, 187, 0.98) 100%);
    box-shadow: 0 12px 26px rgba(73, 42, 20, 0.22);
    color: #724425;
    z-index: 6;
    pointer-events: none;
}

.checkin-reward-tooltip.hidden {
    display: none;
}

.checkin-reward-tooltip-title {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 900;
    color: #8a5427;
}

.checkin-reward-tooltip-desc {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: #6b4b2f;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.checkin-reward-tooltip-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkin-reward-tooltip-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.checkin-reward-tooltip-item img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex: 0 0 auto;
}

.checkin-reward-tooltip-item-text {
    min-width: 0;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
    word-break: break-word;
}

#checkinStatus {
    display: none;
}

.checkin-mascot-snake {
    display: none;
    position: absolute;
    left: 565px;
    top: 506px;
    width: 132px;
    height: 176px;
    object-fit: contain;
    pointer-events: none;
}

.online-countdown {
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 900;
    color: #6e4628;
}

.online-tier-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.online-tier-item {
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid rgba(191, 141, 87, 0.4);
    background: rgba(255, 255, 255, 0.75);
    color: #6a462b;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
}

.online-tier-item.is-current {
    border-color: rgba(234, 156, 76, 0.9);
    background: rgba(255, 236, 205, 0.85);
}

.online-tier-item.is-claimed {
    border-color: rgba(106, 153, 61, 0.7);
    background: rgba(221, 243, 201, 0.85);
    color: #3f6221;
}

.online-reward-dock {
    position: absolute;
    right: 0;
    top: 48%;
    transform: translateY(-50%);
    z-index: 44;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    pointer-events: auto;
}

.online-reward-chest {
    position: relative;
    width: 88px;
    height: 88px;
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    display: grid;
    place-items: center;
    padding: 0;
}

.online-reward-entry-dot {
    top: 3px;
    right: 5px;
}

.online-reward-chest img {
    width: 82px;
    height: 82px;
    image-rendering: auto;
    filter: drop-shadow(0 1px 1px rgba(22, 16, 12, 0.25));
}

.online-reward-text {
    margin-top: -12px;
    margin-right: 6px;
    min-width: 64px;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid rgba(187, 140, 89, 0.65);
    background: rgba(255, 248, 233, 0.95);
    color: #6a462b;
    font-size: 11px;
    font-weight: 900;
    text-align: center;
    line-height: 1.2;
}

.online-reward-preview {
    position: absolute;
    right: 102px;
    top: 0;
    transform: translateY(6px);
    display: flex;
    gap: 6px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid rgba(187, 140, 89, 0.75);
    background: rgba(255, 250, 241, 0.97);
    box-shadow: 0 10px 20px rgba(30, 22, 15, 0.22);
    white-space: nowrap;
}

.online-reward-preview.hidden {
    display: none;
}

.online-reward-preview-item {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    border: 1px solid rgba(194, 150, 104, 0.7);
    background: rgba(255, 255, 255, 0.88);
    display: grid;
    place-items: center;
    position: relative;
}

.online-reward-preview-item img {
    width: 20px;
    height: 20px;
    image-rendering: pixelated;
}

.online-reward-preview-item .amount {
    position: absolute;
    right: 2px;
    bottom: 1px;
    font-size: 10px;
    font-weight: 900;
    color: #5d3c23;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.online-settle-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.online-settle-item {
    border: 1px solid rgba(190, 146, 96, 0.6);
    border-radius: 10px;
    background: rgba(255, 248, 235, 0.95);
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 800;
    color: #6a452a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.online-settle-icon {
    width: 18px;
    height: 18px;
    image-rendering: pixelated;
}

#checkinRewardSettleOverlay {
    z-index: 68;
}

.checkin-settle-shell {
    width: min(86%, 348px);
}

.checkin-settle-coin-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 10px 0 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(195, 146, 92, 0.55);
    background: linear-gradient(180deg, rgba(255, 250, 240, 0.96) 0%, rgba(246, 223, 183, 0.96) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.checkin-settle-coin-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(109, 72, 32, 0.16));
}

.checkin-settle-coin-amount {
    color: #7a4a23;
    font-size: 28px;
    line-height: 1;
    font-weight: 900;
}

.exit-desc {
    margin: 0;
    color: #6f4a2d;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

.exit-actions {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.empty-state {
    margin: 10px 2px 0;
    color: #7e5838;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
}

.popup-box {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(86%, 352px);
    padding: 24px;
    border-radius: 26px;
    border: 2px solid rgba(255, 232, 198, 0.72);
    background:
        linear-gradient(180deg, rgba(255, 244, 221, 0.96) 0%, rgba(242, 214, 172, 0.94) 100%),
        var(--asset-panel) center / cover no-repeat;
    box-shadow: inset 0 -4px 0 rgba(143, 94, 58, 0.22), 0 16px 34px rgba(55, 33, 19, 0.28);
    text-align: center;
    z-index: 45;
    overflow: visible;
}

.popup-box.is-perfect {
    border-color: rgba(255, 204, 132, 0.92);
    box-shadow: inset 0 -4px 0 rgba(160, 106, 38, 0.28), 0 20px 42px rgba(92, 45, 18, 0.32);
}

.popup-title {
    margin: 0 0 12px;
    color: #6f4527;
    font-family: var(--font-display);
    font-size: 42px;
    letter-spacing: 1px;
}

.popup-perfect-stamp {
    position: absolute;
    top: 16px;
    right: 14px;
    min-width: 84px;
    padding: 6px 10px;
    border: 4px solid rgba(191, 26, 26, 0.92);
    border-radius: 999px;
    color: rgba(167, 18, 18, 0.92);
    font-size: 24px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 2px;
    transform: rotate(16deg) scale(1.06);
    background: rgba(255, 243, 243, 0.86);
    box-shadow: 0 8px 18px rgba(107, 18, 18, 0.24);
    pointer-events: none;
}

.popup-perfect-stamp.is-stamping {
    transform-origin: 50% 50%;
    animation: perfect-stamp-impact 520ms cubic-bezier(0.18, 0.9, 0.22, 1.2) both;
}

@keyframes perfect-stamp-impact {
    0% {
        opacity: 0;
        transform: translate(34px, -64px) rotate(28deg) scale(2.65);
        filter: blur(1px);
    }
    46% {
        opacity: 1;
        transform: translate(0, 0) rotate(16deg) scale(0.88);
        filter: blur(0);
        box-shadow:
            0 2px 0 rgba(110, 18, 18, 0.34),
            0 0 0 12px rgba(191, 26, 26, 0.12),
            0 12px 26px rgba(107, 18, 18, 0.34);
    }
    64% {
        transform: translate(0, 0) rotate(16deg) scale(1.12);
    }
    82% {
        transform: translate(0, 0) rotate(16deg) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translate(0, 0) rotate(16deg) scale(1.06);
        filter: blur(0);
        box-shadow: 0 8px 18px rgba(107, 18, 18, 0.24);
    }
}

.popup-score {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    color: #855736;
    font-size: 26px;
    font-weight: 800;
}

.popup-score-label {
    font-size: 24px;
}

.popup-score-value {
    min-width: 2ch;
    font-size: 48px;
    line-height: 1;
    letter-spacing: 0.5px;
}

.popup-score-multiplier {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 9px 3px;
    min-width: max-content;
    border: 2px solid rgba(141, 61, 9, 0.52);
    border-radius: 999px;
    background:
        radial-gradient(circle at 32% 18%, rgba(255, 255, 255, 0.78), transparent 32%),
        linear-gradient(180deg, #fff0a6 0%, #ffc14c 48%, #ff7c24 100%);
    box-shadow:
        0 4px 0 rgba(126, 54, 9, 0.38),
        0 8px 14px rgba(223, 93, 18, 0.32),
        0 0 14px rgba(255, 206, 76, 0.62);
    color: #7a3000;
    font-size: 24px;
    font-weight: 950;
    line-height: 1;
    letter-spacing: 0.2px;
    text-shadow:
        0 1px 0 rgba(255, 251, 204, 0.9),
        0 -1px 0 rgba(110, 43, 0, 0.24);
    white-space: nowrap;
    transform: translateY(-4px) rotate(-3deg);
    opacity: 0;
}

.popup-score-multiplier.is-visible {
    opacity: 1;
    animation: settle-multiplier-pop 220ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.popup-combo {
    margin-top: 6px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    color: #7b4f27;
    font-size: 18px;
    font-weight: 800;
}

.popup-combo-label {
    font-size: 18px;
}

.popup-combo-value {
    display: inline-block;
    min-width: 1.5ch;
    font-size: 30px;
    line-height: 1;
}

.popup-combo-value.is-emphasis {
    animation: settle-combo-emphasis 360ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.popup-bonus {
    margin-top: 4px;
    color: #8a6432;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
    display: none;
}

.popup-coins {
    margin-top: 4px;
    color: #6c8f3f;
    font-size: 18px;
    font-weight: 800;
}

.popup-buttons {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.popup-action-row {
    display: flex;
    gap: 10px;
}

.popup-action-row > button {
    flex: 1 1 0;
    min-width: 0;
}

@keyframes settle-combo-emphasis {
    0% {
        transform: scale(1);
    }
    35% {
        transform: scale(1.28);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes settle-multiplier-pop {
    0% {
        transform: translateY(-4px) rotate(-3deg) scale(0.68);
        filter: brightness(1.16) saturate(1.2);
    }
    56% {
        transform: translateY(-7px) rotate(-4deg) scale(1.16);
        filter: brightness(1.22) saturate(1.28);
    }
    100% {
        transform: translateY(-4px) rotate(-3deg) scale(1);
        filter: brightness(1) saturate(1);
    }
}

.reward-guide-overlay {
    z-index: 82;
    background: rgba(20, 12, 7, 0.45);
}

.gameplay-guide-overlay {
    z-index: 83;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(20, 12, 7, 0.42);
    backdrop-filter: blur(1.5px);
}

.gameplay-guide-panel {
    width: min(86%, 338px);
    padding: 18px 18px 16px;
    border: 2px solid rgba(114, 75, 44, 0.45);
    border-radius: 18px;
    background: linear-gradient(180deg, #fff6df 0%, #f0cf91 100%);
    box-shadow: 0 16px 36px rgba(35, 21, 12, 0.36), inset 0 0 0 2px rgba(255, 255, 255, 0.34);
    text-align: center;
    pointer-events: auto;
}

.gameplay-guide-text {
    margin: 0;
    color: #57351f;
    font-family: var(--font-ui-clean);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.42;
}

.gameplay-guide-keyword {
    color: #c4442e;
    text-shadow: 0 1px 0 rgba(255, 247, 220, 0.72);
}

.gameplay-guide-ok {
    min-width: 148px;
    height: 48px;
    margin-top: 16px;
    border: 2px solid rgba(113, 75, 46, 0.42);
    border-radius: 999px;
    background: linear-gradient(180deg, #ffd979 0%, #f4a93a 100%);
    color: #52311d;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
    box-shadow: inset 0 2px 0 rgba(255, 248, 204, 0.58), 0 5px 0 rgba(156, 96, 42, 0.5), 0 10px 18px rgba(89, 54, 26, 0.24);
    cursor: pointer;
}

.gameplay-guide-ok:active {
    transform: translateY(3px);
    box-shadow: inset 0 2px 0 rgba(255, 248, 204, 0.5), 0 2px 0 rgba(156, 96, 42, 0.5), 0 6px 12px rgba(89, 54, 26, 0.2);
}

[lang='en'] .gameplay-guide-text,
[lang='en-US'] .gameplay-guide-text {
    font-size: 16px;
}

[lang='en'] .gameplay-guide-ok,
[lang='en-US'] .gameplay-guide-ok {
    font-family: var(--font-ui-clean);
    font-size: 19px;
}

.reward-guide-content {
    position: absolute;
    left: 50%;
    top: calc(23% + 200px);
    transform: translateX(-50%);
    width: min(88%, 340px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    pointer-events: none;
}

.reward-guide-swipe {
    width: 244px;
    height: 132px;
    border-radius: 999px;
    border: 2px dashed rgba(255, 240, 205, 0.85);
    background: rgba(255, 247, 229, 0.18);
    position: relative;
    overflow: hidden;
}

.reward-guide-hand {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 82px;
    height: 108px;
    background: url('../assets/ui/reward-guide-hand.webp') center / contain no-repeat;
    filter: drop-shadow(0 10px 18px rgba(44, 25, 11, 0.28));
    transform: translate(-50%, -50%);
    animation: reward-guide-swipe 1.45s ease-in-out infinite;
}

.reward-guide-hand::after {
    content: '';
    position: absolute;
    left: 10px;
    top: 12px;
    transform: translate(-50%, -50%) scale(0.52);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    opacity: 0;
    animation: reward-guide-press 1.45s ease-out infinite;
}

.reward-guide-finger {
    display: none;
}

.reward-guide-text {
    margin: 0;
    padding: 9px 14px;
    border-radius: 14px;
    border: 1px solid rgba(223, 188, 136, 0.9);
    background: rgba(255, 245, 223, 0.95);
    color: #6f4423;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 900;
    text-align: center;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

@keyframes reward-guide-swipe {
    0% { transform: translate(calc(-50% - 68px), calc(-50% - 6px)) scale(1); }
    16% { transform: translate(calc(-50% - 10px), calc(-50% - 34px)) scale(0.94); }
    38% { transform: translate(calc(-50% + 62px), calc(-50% - 8px)) scale(1); }
    62% { transform: translate(calc(-50% + 16px), calc(-50% + 30px)) scale(0.96); }
    84% { transform: translate(calc(-50% - 60px), calc(-50% + 10px)) scale(1); }
    100% { transform: translate(calc(-50% - 68px), calc(-50% - 6px)) scale(1); }
}

@keyframes reward-guide-press {
    0%, 8% { opacity: 0; transform: translate(-50%, -50%) scale(0.52); }
    28% { opacity: 0.95; transform: translate(-50%, -50%) scale(1); }
    55% { opacity: 0; transform: translate(-50%, -50%) scale(1.32); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.32); }
}

.btn-popup-primary,
.btn-popup-secondary {
    height: 50px;
    border: 2px solid #e7c38f;
    background:
        radial-gradient(circle at 20% 22%, rgba(255, 248, 231, 0.9) 0%, rgba(255, 248, 231, 0) 36%),
        linear-gradient(180deg, #fff0d0 0%, #f8d8a2 56%, #e7b576 100%);
    box-shadow: inset 0 -3px 0 rgba(117, 76, 44, 0.28), 0 7px 14px rgba(53, 35, 21, 0.3);
    border-radius: 19px;
    font-family: var(--font-display);
    font-size: 27px;
    letter-spacing: 1px;
}

.btn-popup-primary {
    color: #6b4125;
}

.btn-popup-secondary {
    color: #3f5d26;
}

.level-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 2px 0 6px;
}

.level-btn {
    height: 52px;
    border: 2px solid #e7c38f;
    border-radius: 16px;
    color: #7a4c2b;
    font-family: var(--font-display);
    font-size: 23px;
    letter-spacing: 1px;
    background:
        radial-gradient(circle at 20% 22%, rgba(255, 248, 231, 0.9) 0%, rgba(255, 248, 231, 0) 36%),
        linear-gradient(180deg, #fff0d0 0%, #f8d8a2 56%, #e7b576 100%);
    box-shadow: inset 0 -2px 0 rgba(117, 76, 44, 0.2);
    transition: transform 80ms ease, filter 120ms ease, box-shadow 120ms ease;
}

.level-btn:active {
    transform: translateY(1px) scale(0.98);
}

.level-btn.unlocked {
    filter: saturate(1.02);
}

.level-btn.current {
    border-color: #7eb653;
    color: #355a1f;
    box-shadow: inset 0 -2px 0 rgba(68, 109, 39, 0.3), 0 0 0 2px rgba(128, 184, 79, 0.2);
}

.level-btn.completed {
    filter: hue-rotate(16deg) saturate(1.12) brightness(0.98);
    color: #3e5a28;
}

.level-btn.locked {
    opacity: 0.52;
    cursor: default;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    filter: grayscale(0.22);
}

.level-lock-icon {
    width: 16px;
    height: 16px;
}

.error-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
}

.error-vignette.active {
    animation: flash 0.34s ease-out;
}

@keyframes menu-rise {
    0% {
        opacity: 0;
        transform: translateY(24px) scale(0.98);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes flash {
    0% {
        opacity: 1;
        box-shadow: inset 0 0 140px rgba(255, 112, 139, 0.54);
    }

    100% {
        opacity: 0;
        box-shadow: inset 0 0 110px rgba(255, 112, 139, 0);
    }
}

@keyframes home-dance-frames {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 100% 0;
    }
}

/* Componentized Home layout */
#menuOverlay {
    pointer-events: auto;
    background-color: #3f2a18;
    background-image: var(--asset-home-bg);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center top;
}

#menuOverlay .home-bg-layer {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    background-repeat: no-repeat;
    background-size: 100% 100%;
}

#menuOverlay .home-bg-panel-large {
    display: none;
    left: 24px;
    top: 737px;
    width: 198px;
    height: 143px;
    background-image: var(--asset-home-panel-large);
}

#menuOverlay .home-bg-snake-up {
    display: none;
    left: 156px;
    top: 362px;
    width: 126px;
    height: 44px;
    background-image: var(--asset-home-snake-up);
}

#menuOverlay .home-bg-snake-down {
    display: none;
    left: 224px;
    top: 274px;
    width: 154px;
    height: 95px;
    background-image: var(--asset-home-snake-down);
}

#menuOverlay .home-bg-cave-panel {
    display: none;
    left: 16px;
    top: 42px;
    width: 138px;
    height: 308px;
    background-image: var(--asset-home-cave-panel);
}

#menuOverlay .menu-content-v2 {
    position: absolute;
    left: 50%;
    top: 0;
    width: var(--design-width);
    height: var(--design-height);
    z-index: 80;
    padding: 0;
    gap: 0;
    animation: none;
    transform: translateX(-50%) scale(var(--home-ui-scale));
    transform-origin: top center;
}

#menuOverlay .menu-coin-chip {
    position: absolute;
    right: 12px;
    top: 18px;
    z-index: auto;
    width: 150px;
    height: 57px;
    min-height: 0;
    padding: 0 12px 0 58px;
    gap: 0;
    border: 0;
    border-radius: 0;
    background: var(--asset-home-sprite) -75px -436px / 227px 495px no-repeat;
    box-shadow: none;
    pointer-events: none;
}

.menu-coin-chip .coin-chip-icon,
#menuOverlay .menu-coin-chip .coin-chip-icon {
    display: none;
}

.menu-coin-chip .coin-chip-value,
#menuOverlay .menu-coin-chip .coin-chip-value {
    min-width: 58px;
    color: #f8df8a;
    font-size: 22px;
    line-height: 1;
    text-align: center;
    text-shadow:
        0 2px 0 #5d3216,
        0 -1px 0 rgba(255, 255, 207, 0.6),
        0 3px 7px rgba(34, 18, 8, 0.35);
}

.menu-coin-chip.coin-chip-fly-focus {
    padding: 0 12px 0 58px;
    gap: 0;
    border: 0;
    border-radius: 0;
    background: var(--asset-home-sprite) -75px -436px / 227px 495px no-repeat;
    box-shadow: none;
}

#menuOverlay .home-sprite-surface {
    background-image: var(--asset-home-sprite);
    background-repeat: no-repeat;
}

#menuOverlay .menu-home-hero {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: auto;
}

#menuOverlay .menu-home-title {
    position: absolute;
    left: 50%;
    top: 160px;
    width: 304px;
    height: 104px;
    margin: 0;
    transform: translateX(-50%);
    text-indent: -9999px;
    overflow: hidden;
    white-space: nowrap;
    background: var(--asset-home-sprite) -35px -198px / 382px 835px no-repeat;
    pointer-events: none;
}

html[lang='en-US'] #menuOverlay .menu-home-title,
html[lang='en'] #menuOverlay .menu-home-title {
    top: 42px;
    width: 268px;
    height: 191px;
    background-position: -42px -1px;
}

#menuOverlay .home-dance-mascot {
    position: absolute;
    display: block;
    overflow: hidden;
    pointer-events: none;
    z-index: auto;
}

#menuOverlay .home-dance-mascot-canvas,
#menuOverlay .home-dance-mascot-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

#menuOverlay .home-dance-mascot-video {
    z-index: 1;
    opacity: 0;
}

#menuOverlay .home-dance-mascot-canvas {
    z-index: 2;
}

#menuOverlay .home-dance-mascot-sprite {
    display: none !important;
}

#menuOverlay .play-area-v2 {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--design-width);
    height: var(--design-height);
    margin: 0;
    padding: 0;
    gap: 0;
    z-index: auto;
    pointer-events: none;
    overflow: visible;
    display: block;
}

#menuOverlay .build-version-tag {
    position: absolute;
    right: 14px;
    bottom: 12px;
    z-index: auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(25, 18, 12, 0.62);
    color: #ffe8bf;
    font-family: var(--font-ui-clean);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.2px;
    pointer-events: auto;
    touch-action: none;
    user-select: none;
}

#menuOverlay .btn-play {
    position: absolute;
    left: 24px;
    top: 323px;
    z-index: auto;
    display: block;
    width: 224px;
    height: 163px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 42px;
    appearance: none;
    -webkit-appearance: none;
    background: var(--asset-home-sprite) 0 -310px / 382px 835px no-repeat;
    box-shadow: none;
    color: #3f2818;
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.02em;
    text-align: center;
    text-shadow:
        0 2px 0 rgba(255, 246, 220, 0.95),
        0 -1px 0 rgba(255, 246, 220, 0.8);
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    transition: transform 90ms ease, filter 90ms ease;
}

#menuOverlay .start-button-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    pointer-events: none;
}

[lang='en'] #menuOverlay .btn-play,
[lang='en-US'] #menuOverlay .btn-play {
    font-size: 22px;
}

#menuOverlay .btn-play::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: transparent;
    transition: background-color 90ms ease;
    pointer-events: none;
}

#menuOverlay .btn-play:active {
    transform: scale(0.98);
    filter: brightness(0.94);
}

#menuOverlay .btn-play:active::after {
    background: rgba(39, 24, 13, 0.08);
}

#menuOverlay .current-level-tag {
    position: absolute;
    left: 274px;
    top: 343px;
    z-index: auto;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 122px;
    height: 110px;
    padding: 0;
    gap: 0;
    margin: 0;
    border: 0;
    border-radius: 22px;
    background: var(--asset-home-sprite) -1px -724px / 382px 835px no-repeat;
    box-shadow: none;
    pointer-events: auto;
}

#menuOverlay .current-level-tag .level-tag-icon {
    display: none;
}

#menuOverlay .current-level-tag .level-tag-label {
    display: none;
}

#menuOverlay .current-level-tag .level-tag-value {
    position: absolute;
    right: 16px;
    bottom: 10px;
    min-width: 28px;
    font-size: 18px;
    font-family: var(--font-ui-clean);
    font-weight: 900;
    color: #fff0bb;
    text-align: center;
    text-shadow: 0 2px 0 #4e2a15, 0 3px 5px rgba(36, 18, 9, 0.45);
}

#menuOverlay .menu-bottom-zone-v2 {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--design-width);
    height: var(--design-height);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
    z-index: auto;
}

#menuOverlay .menu-feature-grid-v2 {
    position: relative;
    width: 100%;
    height: 100%;
}

#menuOverlay .feature-card {
    position: absolute;
    width: 107px;
    height: 110px;
    border: 0;
    border-radius: 0;
    background-image: var(--asset-home-sprite);
    background-repeat: no-repeat;
    background-size: 382px 835px;
    box-shadow: none;
    outline: 0;
    padding: 0;
}

#menuOverlay .feature-card[data-feature-id='settings'] {
    left: 48px;
    top: 552px;
    background-position: -11px -478px;
}

#menuOverlay .feature-card[data-feature-id='leaderboard'] {
    left: 161px;
    top: 552px;
    width: 108px;
    background-position: -134px -478px;
}

#menuOverlay .feature-card[data-feature-id='skins'] {
    left: 274px;
    top: 552px;
    width: 108px;
    background-position: -258px -478px;
}

#menuOverlay .feature-card[data-feature-id='checkin'] {
    left: 161px;
    top: 677px;
    width: 108px;
    height: 111px;
    background-position: -258px -609px;
}

#menuOverlay .feature-card[data-feature-id='exit'] {
    left: 274px;
    top: 677px;
    width: 108px;
    height: 112px;
    background-position: -134px -608px;
}

#menuOverlay .feature-card[data-feature-id='support-author'] {
    left: 48px;
    top: 677px;
    height: 112px;
    background-position: -10px -608px;
}

#menuOverlay .feature-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: transparent;
    transition: background 90ms ease;
}

#menuOverlay .feature-card:active::after {
    background: rgba(71, 45, 25, 0.12);
}

#menuOverlay .feature-icon {
    opacity: 0;
}

#menuOverlay .feature-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    pointer-events: none;
}

#menuOverlay .feature-card[data-feature-id='leaderboard'] .feature-label,
#menuOverlay .feature-card[data-feature-id='support-author'] .feature-label {
    font-size: 21px;
}

[lang='en'] #menuOverlay .feature-label,
[lang='en-US'] #menuOverlay .feature-label {
    bottom: 22px;
    font-size: 18px;
    line-height: 1.05;
}

[lang='en'] #menuOverlay .feature-card[data-feature-id='leaderboard'] .feature-label,
[lang='en-US'] #menuOverlay .feature-card[data-feature-id='leaderboard'] .feature-label,
[lang='en'] #menuOverlay .feature-card[data-feature-id='support-author'] .feature-label,
[lang='en-US'] #menuOverlay .feature-card[data-feature-id='support-author'] .feature-label {
    font-size: 16px;
}

#menuOverlay .feature-badge {
    display: none !important;
}

#menuOverlay .feature-card-placeholder {
    opacity: 0;
    filter: none;
}

#menuOverlay .menu-profile-entry {
    position: absolute;
    left: 18px;
    top: 100px;
    z-index: 8;
    width: 44px;
    height: 44px;
    border: 2px solid rgba(133, 91, 55, 0.62);
    border-radius: 999px;
    padding: 0;
    background: linear-gradient(180deg, rgba(248, 232, 194, 0.98) 0%, rgba(221, 181, 111, 0.98) 100%);
    box-shadow: 0 4px 9px rgba(46, 28, 15, 0.26);
    overflow: hidden;
}

#menuOverlay .menu-profile-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#menuOverlay .menu-avatar-login-link {
    position: absolute;
    left: 8px;
    top: 146px;
    z-index: 8;
    width: 64px;
    border: 0;
    background: transparent;
    color: rgba(93, 62, 36, 0.92);
    text-align: center;
    font-family: var(--font-ui-clean);
    font-size: 14px;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 2px 4px;
    pointer-events: auto;
    cursor: pointer;
}

/* New single-sheet home art. Keep this block after the editable home layout rules:
   the live layout editor writes inline positions, so these sprite slices must win. */
#menuOverlay .home-bg-panel-large,
#menuOverlay .home-bg-snake-up,
#menuOverlay .home-bg-snake-down,
#menuOverlay .home-bg-cave-panel {
    display: none !important;
}

#menuOverlay .menu-content-v2 {
    left: 50% !important;
    top: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: var(--design-width) !important;
    height: var(--design-height) !important;
    transform: translateX(-50%) scale(var(--home-ui-scale)) !important;
    transform-origin: top center !important;
}

#menuOverlay .play-area-v2,
#menuOverlay .menu-bottom-zone-v2 {
    left: 0 !important;
    top: 0 !important;
    right: auto !important;
    bottom: auto !important;
    width: var(--design-width) !important;
    height: var(--design-height) !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

#menuOverlay .play-area-v2 {
    display: block !important;
    pointer-events: none !important;
}

#menuOverlay .menu-home-title {
    left: 50% !important;
    top: 160px !important;
    width: 304px !important;
    height: 104px !important;
    transform: translateX(-50%) !important;
    background: var(--asset-home-sprite) -35px -198px / 382px 835px no-repeat !important;
}

html[lang='en-US'] #menuOverlay .menu-home-title,
html[lang='en'] #menuOverlay .menu-home-title {
    top: 42px !important;
    width: 268px !important;
    height: 191px !important;
    background-position: -42px -1px !important;
}

#menuOverlay .btn-play {
    left: 24px !important;
    top: 323px !important;
    width: 224px !important;
    height: 163px !important;
    display: block !important;
    background: var(--asset-home-sprite) 0 -310px / 382px 835px no-repeat !important;
    pointer-events: auto !important;
}

#menuOverlay .start-button-label,
#menuOverlay .feature-label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
}

#menuOverlay .current-level-tag {
    left: 274px !important;
    top: 343px !important;
    width: 122px !important;
    height: 110px !important;
    display: inline-flex !important;
    padding: 0 !important;
    background: var(--asset-home-sprite) -1px -724px / 382px 835px no-repeat !important;
    border: 0 !important;
    box-shadow: none !important;
    pointer-events: auto !important;
}

#menuOverlay .current-level-tag .level-tag-icon {
    display: none !important;
}

#menuOverlay .current-level-tag .level-tag-label {
    display: none !important;
}

#menuOverlay .current-level-tag .level-tag-value {
    position: absolute !important;
    right: 16px !important;
    bottom: 10px !important;
    left: auto !important;
    top: auto !important;
    width: 28px !important;
    height: 22px !important;
    display: block !important;
    color: #fff0bb !important;
    font-size: 18px !important;
    line-height: 22px !important;
    text-align: center !important;
    text-shadow: 0 2px 0 #4e2a15, 0 3px 5px rgba(36, 18, 9, 0.45) !important;
}

#menuOverlay .menu-coin-chip {
    left: auto !important;
    right: 12px !important;
    top: 18px !important;
    width: 150px !important;
    height: 57px !important;
    display: inline-flex !important;
    padding: 0 12px 0 58px !important;
    background: var(--asset-home-sprite) -75px -436px / 227px 495px no-repeat !important;
    border: 0 !important;
    box-shadow: none !important;
}

#menuOverlay .menu-coin-chip .coin-chip-icon {
    display: none !important;
}

#menuOverlay .feature-card {
    background-image: var(--asset-home-sprite) !important;
    background-repeat: no-repeat !important;
    background-size: 382px 835px !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

#menuOverlay .feature-card[data-feature-id='settings'] {
    left: 48px !important;
    top: 552px !important;
    width: 107px !important;
    height: 110px !important;
    background-position: -11px -478px !important;
}

#menuOverlay .feature-card[data-feature-id='leaderboard'] {
    left: 161px !important;
    top: 552px !important;
    width: 108px !important;
    height: 110px !important;
    background-position: -134px -478px !important;
}

#menuOverlay .feature-card[data-feature-id='skins'] {
    left: 274px !important;
    top: 552px !important;
    width: 108px !important;
    height: 110px !important;
    background-position: -258px -478px !important;
}

#menuOverlay .feature-card[data-feature-id='support-author'] {
    left: 48px !important;
    top: 677px !important;
    width: 107px !important;
    height: 112px !important;
    background-position: -10px -608px !important;
}

#menuOverlay .feature-card[data-feature-id='checkin'] {
    left: 161px !important;
    top: 677px !important;
    width: 108px !important;
    height: 111px !important;
    background-position: -258px -609px !important;
}

#menuOverlay .feature-card[data-feature-id='exit'] {
    left: 274px !important;
    top: 677px !important;
    width: 108px !important;
    height: 112px !important;
    background-position: -134px -608px !important;
}

.app-container.menu-mode .online-reward-dock {
    left: auto !important;
    right: 8px !important;
    top: 486px !important;
    width: 96px !important;
    height: 96px !important;
    transform: none !important;
    display: block !important;
}

.app-container.menu-mode .online-reward-chest {
    width: 96px !important;
    height: 74px !important;
    display: block !important;
    background: var(--asset-home-sprite) -148px -223px / 248px 543px no-repeat !important;
}

.app-container.menu-mode .online-reward-chest img {
    display: none !important;
}

.app-container.menu-mode .online-reward-text {
    position: absolute !important;
    left: 18px !important;
    top: 61px !important;
    min-width: 60px !important;
    height: 28px !important;
    margin: 0 !important;
    padding: 4px 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #fff4d2 !important;
    text-shadow: 0 2px 0 #5b331b, 0 3px 5px rgba(31, 17, 9, 0.5) !important;
}

/* Unified settings panel style */
#settingsOverlay .panel-shell {
    width: min(92%, 372px);
    max-height: min(86vh, 720px);
    border-radius: 26px;
    border: 2px solid rgba(255, 235, 198, 0.72);
    background:
        linear-gradient(180deg, rgba(251, 241, 218, 0.97) 0%, rgba(240, 215, 170, 0.95) 100%),
        var(--asset-panel) center / cover no-repeat;
    box-shadow: inset 0 -3px 0 rgba(130, 87, 54, 0.2), 0 16px 34px rgba(55, 33, 19, 0.3);
}

#settingsOverlay .panel-head {
    padding: 14px 14px 10px;
}

#settingsOverlay .panel-title {
    display: block;
    font-size: 44px;
}

#settingsOverlay #btnBackFromSettings {
    min-width: 78px;
    height: 34px;
    border: 2px solid #d9ab69;
    border-radius: 999px;
    padding: 0 10px;
    background: linear-gradient(180deg, #f4e1c0, #e4bd83);
    color: #704828;
    font-family: var(--font-display);
    font-size: 16px;
}

#settingsOverlay .panel-body {
    position: relative;
    height: auto;
    max-height: calc(min(86vh, 720px) - 62px);
    padding: 12px 14px 16px;
    overflow: auto;
    pointer-events: auto;
}

#settingsOverlay .setting-row {
    border-radius: 16px;
    border: 1px solid rgba(138, 97, 64, 0.24);
    background: rgba(255, 252, 246, 0.72);
    margin: 0 0 12px;
    padding: 10px 12px;
}

#settingsOverlay .setting-row:last-child {
    margin-bottom: 0;
}

#settingsOverlay .setting-title,
#settingsOverlay .setting-desc {
    display: block;
}

#settingsOverlay .setting-title {
    font-size: 34px;
}

#settingsOverlay .setting-desc {
    font-size: 12px;
}

#settingsOverlay .locale-switch {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

#settingsOverlay .locale-chip {
    width: 100%;
    height: 42px;
    border: 2px solid #d9ab69;
    border-radius: 14px;
    background: linear-gradient(180deg, #f8e7c9, #e7c18a);
    color: #6f4729;
    font-size: 16px;
    font-weight: 900;
    font-family: var(--font-body);
    padding: 0 10px;
}

#settingsOverlay .locale-chip.active {
    border-color: #6db34d;
    color: #2f4d1e;
    box-shadow: 0 0 0 2px rgba(117, 187, 84, 0.2) inset;
}

#settingsOverlay .setting-row-reset {
    position: static;
    width: auto;
    height: auto;
    pointer-events: auto;
}

#settingsOverlay .setting-row-reset .setting-desc {
    margin-bottom: 8px;
}

#settingsOverlay .setting-row-reset .settings-reset-btn {
    margin: 0;
    width: 100%;
    height: 44px;
    border: 2px solid rgba(140, 77, 61, 0.36);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(246, 190, 175, 0.98) 0%, rgba(226, 143, 119, 0.98) 100%);
    box-shadow: inset 0 -2px 0 rgba(111, 62, 43, 0.24), 0 2px 6px rgba(72, 40, 24, 0.2);
    color: #6f3f2a;
    font-family: var(--font-display);
    font-size: 25px;
    letter-spacing: 0.3px;
    pointer-events: auto;
}

#settingsOverlay .setting-row-end-run .settings-end-run-btn {
    margin: 0;
    width: 100%;
    height: 44px;
    border: 2px solid rgba(139, 64, 52, 0.42);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(239, 179, 158, 0.98) 0%, rgba(219, 118, 96, 0.96) 100%);
    box-shadow: inset 0 -2px 0 rgba(111, 62, 43, 0.24), 0 2px 6px rgba(72, 40, 24, 0.2);
    color: #6a3222;
    font-family: var(--font-display);
    font-size: 25px;
    letter-spacing: 0.3px;
    pointer-events: auto;
}

#settingsOverlay .panel-title,
#settingsOverlay .panel-back-btn,
#settingsOverlay .setting-title,
#settingsOverlay .setting-desc,
#settingsOverlay .locale-chip,
#settingsOverlay .audio-row,
#settingsOverlay .audio-row span,
#settingsOverlay .settings-reset-btn,
#settingsOverlay .settings-end-run-btn {
    font-family: var(--font-ui-clean);
}

#settingsOverlay .panel-title,
#settingsOverlay .setting-title {
    font-weight: 900;
}

#settingsOverlay .setting-desc {
    font-weight: 800;
}

/* Level select style alignment for concept version */
#levelSelectOverlay .panel-shell-levels {
    width: min(92%, 378px);
    max-height: min(84vh, 690px);
    border-radius: 26px;
    border: 2px solid rgba(255, 235, 198, 0.72);
    background:
        linear-gradient(180deg, rgba(251, 241, 218, 0.97) 0%, rgba(240, 215, 170, 0.95) 100%),
        var(--asset-panel) center / cover no-repeat;
    box-shadow: inset 0 -3px 0 rgba(130, 87, 54, 0.2), 0 16px 34px rgba(55, 33, 19, 0.3);
}

#levelSelectOverlay .panel-body {
    padding: 12px 14px 14px;
}

#levelSelectOverlay .level-select-meta {
    padding: 10px 11px;
    border-radius: 14px;
    border: 1px solid rgba(132, 90, 57, 0.24);
    background: rgba(255, 248, 232, 0.68);
    margin-bottom: 10px;
}

#levelSelectOverlay .level-select-start {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

#levelSelectOverlay .level-select-label {
    color: #744c2c;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.2;
}

#levelSelectOverlay .level-select-value {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 2px solid rgba(113, 74, 46, 0.35);
    background: linear-gradient(180deg, rgba(245, 233, 193, 0.98) 0%, rgba(224, 190, 118, 0.96) 100%);
    color: #5f3c21;
    font-family: var(--font-display);
    font-size: 17px;
    line-height: 26px;
    white-space: nowrap;
}

#levelSelectOverlay .level-select-tip {
    margin: 7px 0 0;
    color: #7e5838;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
}

#levelSelectOverlay .panel-title,
#levelSelectOverlay .panel-back-btn,
#levelSelectOverlay .level-select-label,
#levelSelectOverlay .level-select-value,
#levelSelectOverlay .level-select-tip,
#levelSelectOverlay .level-btn {
    font-family: var(--font-ui-clean);
}

/* UI_1 art refresh: single transparent sprite sheet from assets/ui/UI_1.png. */
.menu-panel-overlay .panel-shell:not(.panel-shell-levels),
#levelCompleteOverlay .popup-box,
#gameOverOverlay .popup-box {
    border: 0 !important;
    border-radius: 0 !important;
    background-image: var(--asset-ui1-sprite) !important;
    background-size: 154.022989% 208.375209% !important;
    background-position: 0 5.100464% !important;
    background-repeat: no-repeat !important;
    box-shadow: none !important;
}

#levelSelectOverlay .panel-shell-levels {
    border: 0 !important;
    border-radius: 0 !important;
    background-image: var(--asset-ui1-sprite) !important;
    background-size: 325.945946% 210.135135% !important;
    background-position: 97.966507% 6.595092% !important;
    background-repeat: no-repeat !important;
    box-shadow: none !important;
}

#skinsOverlay .panel-shell {
    background-image: var(--asset-ui1-sprite) !important;
    background-size: 325.945946% 210.135135% !important;
    background-position: 97.966507% 6.595092% !important;
    background-repeat: no-repeat !important;
}

#levelSelectOverlay .panel-body {
    padding: 12px 24px 14px !important;
    overflow: visible !important;
}

#levelSelectOverlay .level-grid {
    align-content: start;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding-right: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#levelSelectOverlay .level-grid::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

#skinsOverlay .panel-body {
    overflow-x: hidden !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#skinsOverlay .panel-body::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.panel-back-btn,
#settingsOverlay #btnBackFromSettings,
.checkin-back-btn,
.menu-panel-overlay button[data-i18n='common.back'],
.menu-panel-overlay button[data-i18n='common.close'] {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background-image: var(--asset-ui1-sprite) !important;
    background-size: 701.162791% 813.071895% !important;
    background-position: 78.433269% 99.908341% !important;
    background-repeat: no-repeat !important;
    box-shadow: none !important;
    pointer-events: auto !important;
    z-index: 120 !important;
    color: transparent !important;
    font-size: 0 !important;
    text-shadow: none !important;
    overflow: hidden;
}

#settingsOverlay .locale-chip,
.locale-chip {
    border: 0 !important;
    border-radius: 0 !important;
    background-image: var(--asset-ui1-sprite) !important;
    background-size: 304.545455% 921.481481% !important;
    background-position: 94.444444% 64.833183% !important;
    background-repeat: no-repeat !important;
    box-shadow: none !important;
    color: #744923 !important;
}

#settingsOverlay .locale-chip.active,
.locale-chip.active {
    border: 0 !important;
    background-image: var(--asset-ui1-sprite) !important;
    background-size: 304.545455% 914.705882% !important;
    background-position: 40.123457% 64.891697% !important;
    background-repeat: no-repeat !important;
    color: #2f4d1e !important;
    box-shadow: none !important;
}

.btn-popup-primary,
.btn-popup-secondary {
    border: 0 !important;
    border-radius: 0 !important;
    background-image: var(--asset-ui1-sprite) !important;
    background-repeat: no-repeat !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

.btn-popup-primary {
    background-size: 304.545455% 914.705882% !important;
    background-position: 40.123457% 64.891697% !important;
    color: #2f4d1e !important;
}

.btn-popup-secondary,
#btnDoubleCoinAd,
#btnSettleSkins,
#btnContinueByAd,
#btnExitCancel,
#btnResetProgressCancel,
#btnSupportAuthorWatchAd {
    background-size: 304.545455% 921.481481% !important;
    background-position: 94.444444% 64.833183% !important;
    color: #744923 !important;
}

#gameOverOverlay #btnMenuFromOver {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background-image: var(--asset-ui1-sprite) !important;
    background-size: 701.162791% 813.071895% !important;
    background-position: 78.433269% 99.908341% !important;
    background-repeat: no-repeat !important;
    box-shadow: none !important;
    pointer-events: auto !important;
    z-index: 120 !important;
    color: transparent !important;
    font-size: 0 !important;
    text-shadow: none !important;
    overflow: hidden;
}

.audio-row input[type='range'] {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    accent-color: auto;
    --audio-fill-percent: 0%;
    position: relative;
    z-index: 2;
}

.audio-row input[type='range']::-webkit-slider-runnable-track {
    height: 20px;
    border: 0;
    border-radius: 0;
    background-image:
        linear-gradient(90deg, #f5b64a 0%, #ffd76b 100%),
        var(--asset-ui1-sprite);
    background-size:
        max(0px, calc(var(--audio-fill-percent) - 16px)) 8px,
        242.168675% 1269.387755%;
    background-position:
        18px center,
        2.966102% 81.588133%;
    background-repeat:
        no-repeat,
        no-repeat;
}

.audio-row input[type='range']::-moz-range-track {
    height: 20px;
    border: 0;
    border-radius: 0;
    background-image: var(--asset-ui1-sprite);
    background-size: 242.168675% 1269.387755%;
    background-position: 2.966102% 81.588133%;
    background-repeat: no-repeat;
}

.audio-row input[type='range']::-moz-range-progress {
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #f5b64a 0%, #ffd76b 100%);
}

.audio-row input[type='range']::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px !important;
    height: 26px !important;
    margin-top: -3px;
    border: 0;
    border-radius: 0;
    background-image: var(--asset-ui1-sprite);
    background-size: 1194.059406% 1120.720721%;
    background-position: 53.665158% 81.553398%;
    background-repeat: no-repeat;
    box-shadow: none;
}

.audio-row input[type='range']::-moz-range-thumb {
    width: 24px !important;
    height: 26px !important;
    border: 0;
    border-radius: 0;
    background-image: var(--asset-ui1-sprite);
    background-size: 1194.059406% 1120.720721%;
    background-position: 53.665158% 81.553398%;
    background-repeat: no-repeat;
    box-shadow: none;
}

#settingsOverlay .setting-row-end-run .settings-end-run-btn,
#btnEndRun,
#btnExitConfirm,
#btnResetProgress,
#btnResetProgressConfirm {
    border: 0 !important;
    border-radius: 0 !important;
    background-image: var(--asset-ui1-sprite) !important;
    background-size: 304.545455% 921.481481% !important;
    background-position: 94.938272% 82.506763% !important;
    background-repeat: no-repeat !important;
    box-shadow: none !important;
    color: #66351f !important;
}

#levelSelectOverlay .level-btn,
.level-btn {
    min-width: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background-image: var(--asset-ui1-sprite) !important;
    background-size: 648.387097% 637.948718% !important;
    background-position: 5% 64.537655% !important;
    background-repeat: no-repeat !important;
    box-shadow: none !important;
    color: #744923 !important;
}

#levelSelectOverlay .level-btn.current,
.level-btn.current {
    color: #355a1f !important;
    filter: saturate(1.16) brightness(1.04);
}

#levelSelectOverlay .level-btn.locked,
.level-btn.locked {
    filter: grayscale(0.38) brightness(0.76) !important;
}

.perf-debug-panel {
    position: absolute;
    inset: 0;
    z-index: 92;
    pointer-events: none;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 12px;
}

.perf-debug-card {
    width: min(86vw, 360px);
    border-radius: 12px;
    border: 1px solid rgba(177, 218, 255, 0.45);
    background: rgba(8, 18, 34, 0.88);
    color: #e7f4ff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
}

.perf-debug-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(177, 218, 255, 0.25);
    font-size: 13px;
    font-weight: 800;
}

.perf-debug-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.perf-debug-head button {
    border: 1px solid rgba(177, 218, 255, 0.4);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #e7f4ff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    cursor: pointer;
}

.perf-debug-text {
    margin: 0;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.user-auth-shell {
    position: relative;
    width: min(92%, 380px);
    max-height: min(88vh, 760px);
}

#userAuthOverlay {
    z-index: 95;
}

.user-auth-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-auth-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border-radius: 14px;
    border: 1px solid rgba(138, 97, 64, 0.24);
    background: rgba(255, 252, 246, 0.72);
}

.user-auth-group h3 {
    margin: 0;
    color: #6f4527;
    font-size: 14px;
    line-height: 1.2;
}

.user-auth-input {
    width: 100%;
    min-height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(147, 102, 66, 0.32);
    background: rgba(255, 255, 255, 0.82);
    color: #5d3b22;
    font-size: 14px;
    font-weight: 700;
    padding: 8px 10px;
}

.user-auth-btn {
    width: 100%;
    min-height: 40px;
}

.user-auth-actions-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.user-auth-actions-row .hidden {
    display: none;
}

.user-auth-group-temp {
    align-items: stretch;
}

.user-auth-build-version {
    position: absolute;
    right: 14px;
    bottom: 12px;
    color: rgba(106, 72, 44, 0.78);
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.3px;
    pointer-events: none;
}

.rank-player {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-player-name {
    min-width: 0;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-self-tag {
    color: #b26618;
    font-size: 12px;
    font-weight: 900;
    flex: 0 0 auto;
}

.rank-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(116, 75, 43, 0.32);
    object-fit: cover;
    flex: 0 0 auto;
}

.rank-level {
    text-align: right;
}
