* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    overscroll-behavior: none;
    overscroll-behavior-y: none;
}
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
    font-family: "Segoe UI", "PingFang SC", "Roboto", sans-serif;
    background: #0a0e1a;
    color: #e8eaf0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

body.yx-host-scroll-lock {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: none;
    overscroll-behavior-y: none;
}

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

#game-container {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: auto;
}

#game-screen {
    touch-action: none;
}

#level-select {
    touch-action: pan-y;
}

.screen {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.screen.hidden {
    display: none;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 8, 20, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(10px);
}

.overlay.hidden {
    display: none;
}

.overlay-box {
    background: linear-gradient(165deg, #1a1f35 0%, #12182a 100%);
    border-radius: 20px;
    padding: 26px 28px;
    max-width: 90%;
    text-align: center;
    border: 1px solid rgba(100, 120, 255, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.overlay-box h2 {
    color: #fff;
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.complete-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.stars-display {
    font-size: 1.8rem;
    color: #ffd54f;
    letter-spacing: 6px;
    margin: 10px 0;
}

.moves-info {
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    margin-bottom: 8px;
}

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

.btn {
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 15px;
    border-radius: 14px;
    padding: 12px 20px;
}

.btn-primary {
    background: linear-gradient(180deg, #5c6bc0 0%, #3949ab 100%);
    color: #fff;
    box-shadow: 0 4px 0 #283593;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e0e4ff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-back, .btn-page {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    padding: 8px 14px;
    border-radius: 10px;
}

#main-menu {
    background: #030510;
    align-items: center;
    justify-content: center;
}

.menu-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

/*
 * 动态星空：容器自带一层「大星点」底图（避免 1px 渐变在高 DPI 下看不见）；
 * 子层 display:block + 漂移/闪烁叠加。主菜单 / 游戏 / 选关共用 .sc-animated-sky
 */
.sc-animated-sky {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    background-color: #030510;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-image:
        radial-gradient(circle 2.5px at 6% 9%, rgba(255, 255, 255, 0.95), transparent 4px),
        radial-gradient(circle 2px at 14% 16%, rgba(200, 225, 255, 0.9), transparent 3.5px),
        radial-gradient(circle 2.5px at 23% 7%, rgba(255, 255, 255, 0.88), transparent 4px),
        radial-gradient(circle 2px at 34% 19%, rgba(255, 255, 255, 0.75), transparent 3.5px),
        radial-gradient(circle 3px at 44% 11%, rgba(255, 248, 220, 0.92), transparent 4.5px),
        radial-gradient(circle 2px at 53% 24%, rgba(255, 255, 255, 0.7), transparent 3.5px),
        radial-gradient(circle 2.5px at 62% 8%, rgba(190, 210, 255, 0.95), transparent 4px),
        radial-gradient(circle 2px at 71% 21%, rgba(255, 255, 255, 0.82), transparent 3.5px),
        radial-gradient(circle 2.5px at 81% 13%, rgba(255, 255, 255, 0.78), transparent 4px),
        radial-gradient(circle 2px at 91% 26%, rgba(220, 235, 255, 0.88), transparent 3.5px),
        radial-gradient(circle 2.5px at 4% 34%, rgba(255, 255, 255, 0.65), transparent 4px),
        radial-gradient(circle 2px at 17% 41%, rgba(255, 255, 255, 0.55), transparent 3.5px),
        radial-gradient(circle 3px at 29% 38%, rgba(255, 255, 255, 0.9), transparent 4.5px),
        radial-gradient(circle 2px at 40% 48%, rgba(255, 255, 255, 0.5), transparent 3.5px),
        radial-gradient(circle 2.5px at 51% 42%, rgba(180, 205, 255, 0.85), transparent 4px),
        radial-gradient(circle 2px at 63% 52%, rgba(255, 255, 255, 0.72), transparent 3.5px),
        radial-gradient(circle 2.5px at 74% 46%, rgba(255, 255, 255, 0.68), transparent 4px),
        radial-gradient(circle 2px at 86% 39%, rgba(255, 255, 255, 0.6), transparent 3.5px),
        radial-gradient(circle 2.5px at 96% 48%, rgba(200, 220, 255, 0.8), transparent 4px),
        radial-gradient(circle 2px at 9% 56%, rgba(255, 255, 255, 0.58), transparent 3.5px),
        radial-gradient(circle 2.5px at 21% 63%, rgba(255, 255, 255, 0.85), transparent 4px),
        radial-gradient(circle 2px at 33% 58%, rgba(255, 255, 255, 0.45), transparent 3.5px),
        radial-gradient(circle 3px at 46% 66%, rgba(255, 255, 255, 0.92), transparent 4.5px),
        radial-gradient(circle 2px at 57% 61%, rgba(255, 255, 255, 0.55), transparent 3.5px),
        radial-gradient(circle 2.5px at 68% 72%, rgba(190, 215, 255, 0.88), transparent 4px),
        radial-gradient(circle 2px at 79% 68%, rgba(255, 255, 255, 0.62), transparent 3.5px),
        radial-gradient(circle 2.5px at 88% 58%, rgba(255, 255, 255, 0.7), transparent 4px),
        radial-gradient(circle 2px at 97% 67%, rgba(255, 255, 255, 0.52), transparent 3.5px),
        radial-gradient(circle 2.5px at 11% 78%, rgba(255, 255, 255, 0.8), transparent 4px),
        radial-gradient(circle 2px at 24% 84%, rgba(220, 235, 255, 0.75), transparent 3.5px),
        radial-gradient(circle 3px at 37% 79%, rgba(255, 255, 255, 0.94), transparent 4.5px),
        radial-gradient(circle 2px at 49% 88%, rgba(255, 255, 255, 0.48), transparent 3.5px),
        radial-gradient(circle 2.5px at 59% 82%, rgba(255, 255, 255, 0.76), transparent 4px),
        radial-gradient(circle 2px at 72% 91%, rgba(255, 255, 255, 0.58), transparent 3.5px),
        radial-gradient(circle 2.5px at 84% 86%, rgba(200, 220, 255, 0.82), transparent 4px),
        radial-gradient(circle 2px at 93% 78%, rgba(255, 255, 255, 0.65), transparent 3.5px),
        radial-gradient(circle 2.5px at 3% 91%, rgba(255, 255, 255, 0.72), transparent 4px),
        radial-gradient(circle 2px at 18% 96%, rgba(255, 255, 255, 0.5), transparent 3.5px),
        radial-gradient(circle 2.5px at 55% 5%, rgba(255, 255, 255, 0.68), transparent 4px),
        radial-gradient(circle 2px at 66% 33%, rgba(255, 255, 255, 0.55), transparent 3.5px),
        radial-gradient(circle 2.5px at 39% 27%, rgba(255, 255, 255, 0.78), transparent 4px),
        radial-gradient(circle 2px at 76% 14%, rgba(255, 255, 255, 0.62), transparent 3.5px),
        radial-gradient(ellipse 130% 75% at 50% -18%, rgba(48, 88, 210, 0.5), transparent 56%),
        radial-gradient(ellipse 75% 55% at 102% 58%, rgba(110, 55, 195, 0.2), transparent 46%),
        radial-gradient(ellipse 65% 50% at -5% 55%, rgba(35, 95, 195, 0.18), transparent 52%);
}

.sc-sky-nebula {
    display: block;
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 130% 75% at 50% -18%, rgba(48, 88, 210, 0.42), transparent 56%),
        radial-gradient(ellipse 75% 55% at 102% 58%, rgba(110, 55, 195, 0.14), transparent 46%),
        radial-gradient(ellipse 65% 50% at -5% 55%, rgba(35, 95, 195, 0.12), transparent 52%);
    animation: sc-sky-nebula 18s ease-in-out infinite alternate;
}

.sc-sky-stars {
    display: block;
    position: absolute;
    left: -10%;
    top: -10%;
    width: 120%;
    height: 120%;
    will-change: transform, filter, opacity;
}

.sc-sky-stars--a {
    background-image:
        radial-gradient(circle 2.5px at 12% 18%, rgba(255, 255, 255, 0.9), transparent 4px),
        radial-gradient(circle 2px at 28% 12%, rgba(200, 220, 255, 0.85), transparent 3.5px),
        radial-gradient(circle 2.5px at 48% 22%, rgba(255, 255, 255, 0.75), transparent 4px),
        radial-gradient(circle 2px at 68% 16%, rgba(255, 255, 255, 0.65), transparent 3.5px),
        radial-gradient(circle 3px at 86% 24%, rgba(255, 248, 200, 0.88), transparent 4.5px),
        radial-gradient(circle 2.5px at 8% 44%, rgba(255, 255, 255, 0.55), transparent 4px),
        radial-gradient(circle 2px at 38% 52%, rgba(180, 205, 255, 0.8), transparent 3.5px),
        radial-gradient(circle 2.5px at 58% 48%, rgba(255, 255, 255, 0.7), transparent 4px),
        radial-gradient(circle 2px at 78% 56%, rgba(255, 255, 255, 0.5), transparent 3.5px),
        radial-gradient(circle 2.5px at 18% 72%, rgba(255, 255, 255, 0.82), transparent 4px),
        radial-gradient(circle 2px at 42% 84%, rgba(220, 235, 255, 0.72), transparent 3.5px),
        radial-gradient(circle 3px at 64% 78%, rgba(255, 255, 255, 0.9), transparent 4.5px),
        radial-gradient(circle 2.5px at 88% 88%, rgba(255, 255, 255, 0.62), transparent 4px),
        radial-gradient(circle 2px at 52% 36%, rgba(255, 255, 255, 0.58), transparent 3.5px),
        radial-gradient(circle 2.5px at 22% 92%, rgba(200, 215, 255, 0.78), transparent 4px);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    opacity: 0.92;
    animation:
        sc-sky-drift-a 110s ease-in-out infinite,
        sc-sky-twinkle 5.8s ease-in-out infinite alternate;
}

.sc-sky-stars--b {
    background-image:
        radial-gradient(circle 2px at 16% 26%, rgba(255, 255, 255, 0.65), transparent 3.5px),
        radial-gradient(circle 2.5px at 36% 18%, rgba(255, 255, 255, 0.8), transparent 4px),
        radial-gradient(circle 2px at 56% 30%, rgba(210, 225, 255, 0.7), transparent 3.5px),
        radial-gradient(circle 2.5px at 74% 22%, rgba(255, 255, 255, 0.72), transparent 4px),
        radial-gradient(circle 2px at 92% 14%, rgba(255, 255, 255, 0.55), transparent 3.5px),
        radial-gradient(circle 2.5px at 10% 50%, rgba(255, 255, 255, 0.5), transparent 4px),
        radial-gradient(circle 2px at 46% 58%, rgba(255, 255, 255, 0.62), transparent 3.5px),
        radial-gradient(circle 3px at 62% 50%, rgba(190, 210, 255, 0.85), transparent 4.5px),
        radial-gradient(circle 2.5px at 82% 62%, rgba(255, 255, 255, 0.58), transparent 4px),
        radial-gradient(circle 2px at 28% 68%, rgba(255, 255, 255, 0.52), transparent 3.5px),
        radial-gradient(circle 2.5px at 54% 90%, rgba(255, 255, 255, 0.68), transparent 4px),
        radial-gradient(circle 2px at 72% 82%, rgba(220, 235, 255, 0.65), transparent 3.5px),
        radial-gradient(circle 2.5px at 6% 82%, rgba(255, 255, 255, 0.6), transparent 4px),
        radial-gradient(circle 2px at 96% 42%, rgba(255, 255, 255, 0.48), transparent 3.5px);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    opacity: 0.82;
    animation:
        sc-sky-drift-b 150s ease-in-out infinite,
        sc-sky-twinkle 8.2s ease-in-out infinite alternate-reverse;
}

@keyframes sc-sky-nebula {
    from { opacity: 0.86; transform: scale(1); }
    to { opacity: 1; transform: scale(1.045); }
}

@keyframes sc-sky-drift-a {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(-2.8%, -2.2%, 0); }
}

@keyframes sc-sky-drift-b {
    0%, 100% { transform: translate3d(0, 0, 0); }
    50% { transform: translate3d(2.4%, -1.6%, 0); }
}

@keyframes sc-sky-twinkle {
    from { filter: brightness(0.9); opacity: 0.78; }
    to { filter: brightness(1.14); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .sc-sky-nebula {
        animation: none;
        opacity: 0.94;
        transform: none;
    }
    .sc-sky-stars--a,
    .sc-sky-stars--b {
        animation: none;
        opacity: 0.9;
        transform: none;
        filter: none;
    }
}

.menu-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 24px;
}

.logo-icon {
    font-size: 64px;
    filter: drop-shadow(0 0 20px rgba(255, 213, 79, 0.5));
}

.game-title {
    font-size: 2.2rem;
    color: #fff;
    text-shadow: 0 0 24px rgba(100, 150, 255, 0.6);
    margin-top: 8px;
}

.menu-buttons {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: center;
}

.menu-buttons .btn {
    min-width: 220px;
}

.menu-buttons .btn-primary {
    background: linear-gradient(180deg, #5c7cfa 0%, #3d5afe 45%, #283593 100%);
    box-shadow:
        0 0 24px rgba(100, 150, 255, 0.45),
        0 4px 0 #1a237e,
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.menu-buttons .btn-secondary {
    background: linear-gradient(165deg, rgba(60, 80, 140, 0.9), rgba(30, 40, 90, 0.95));
    border: 1px solid rgba(140, 170, 255, 0.35);
    box-shadow: 0 0 16px rgba(80, 120, 255, 0.2);
}

.sc-lang-group {
    position: fixed;
    top: calc(8px + env(safe-area-inset-top, 0px));
    right: calc(8px + env(safe-area-inset-right, 0px));
    z-index: 400;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: min(200px, 46vw);
    gap: 6px;
}

.sc-lang-group.in-hud {
    position: static;
    margin-top: 6px;
    justify-content: center;
}

.sc-lang-group.in-level-select {
    position: static;
    margin: 0;
    justify-content: flex-end;
    z-index: 1;
    max-width: 100%;
    gap: 8px;
}

.sc-lang-btn {
    min-width: 44px;
    height: 40px;
    border-radius: 10px;
    background: rgba(30, 40, 80, 0.85);
    color: #dde3ff;
    border: 1px solid rgba(120, 140, 255, 0.35);
    font-weight: 800;
    font-size: 12px;
}

.sc-lang-btn.active {
    border-color: #7e57c2;
    background: rgba(126, 87, 194, 0.35);
    color: #fff;
}

#level-select {
    position: relative;
    background: #030510;
    min-height: 0;
}

.level-select-sky {
    position: absolute;
    inset: 0;
    z-index: 0;
}

#level-select > .screen-header,
#level-select > .level-grid {
    position: relative;
    z-index: 1;
}

.screen-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px;
    background: linear-gradient(165deg, rgba(18, 28, 62, 0.62), rgba(8, 14, 34, 0.82));
    border-bottom: 1px solid rgba(125, 165, 255, 0.24);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.screen-header h2 {
    flex: 1 1 auto;
    text-align: center;
    font-size: 1rem;
    color: #d4deff;
    letter-spacing: 0.06em;
    text-shadow: 0 2px 8px rgba(48, 96, 255, 0.35);
}

.level-toolbar {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px 4px;
}

.page-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e7eeff;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(24, 36, 82, 0.65);
    border: 1px solid rgba(142, 175, 255, 0.28);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.level-grid {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 12px 14px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
    gap: 10px;
    align-content: start;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

@media (min-width: 480px) {
    .level-grid {
        grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    }
}

.level-btn {
    aspect-ratio: 1;
    border-radius: 14px;
    border: 1px solid rgba(138, 170, 255, 0.3);
    background:
        radial-gradient(circle at 28% 20%, rgba(255, 255, 255, 0.22) 0%, transparent 40%),
        linear-gradient(155deg, rgba(52, 68, 126, 0.92) 0%, rgba(25, 36, 78, 0.94) 58%, rgba(16, 24, 50, 0.96) 100%);
    color: #f2f5ff;
    font-weight: 800;
    font-size: 1rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(6, 10, 30, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.16);
    transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.level-btn::after {
    content: '';
    position: absolute;
    left: -30%;
    top: -60%;
    width: 70%;
    height: 180%;
    background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.25) 50%, transparent 100%);
    transform: rotate(12deg);
    pointer-events: none;
}

.level-btn:not(.locked):hover {
    transform: translateY(-1px);
    border-color: rgba(170, 198, 255, 0.6);
    box-shadow: 0 10px 22px rgba(8, 15, 40, 0.55), 0 0 18px rgba(100, 150, 255, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.level-btn.locked {
    opacity: 0.58;
    cursor: not-allowed;
    filter: grayscale(0.28);
}

.level-btn.current {
    border-color: rgba(255, 214, 95, 0.9);
    box-shadow: 0 0 0 2px rgba(255, 214, 95, 0.7), 0 10px 24px rgba(20, 14, 4, 0.55), 0 0 18px rgba(255, 214, 95, 0.28);
}

.level-btn .stars-mini {
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 10px;
    letter-spacing: 0.06em;
    color: #ffe082;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.level-btn .level-lock {
    position: absolute;
    right: 8px;
    top: 7px;
    font-size: 14px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.sc-playfield {
    position: relative;
    overflow: hidden;
    background: #030510;
}

/* 触屏宿主底部横幅可能叠在 iframe 下缘；横屏大宽度设备也要预留 */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
    #game-screen.sc-playfield {
        padding-bottom: 0;
    }
}
@media (max-width: 900px) and (orientation: landscape), (hover: none) and (pointer: coarse) and (orientation: landscape) {
    #game-screen.sc-playfield {
        padding-bottom: 0;
    }
}

/* 全屏时通常没有宿主底部广告，移除预留避免退出全屏后布局卡在偏小状态。 */
body.sc-host-fullscreen #game-screen.sc-playfield {
    padding-bottom: 0 !important;
}

.sc-starfield {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.sc-high-bar,
.sc-top-bar,
.sc-powers,
.power-hint,
.sc-game-row {
    position: relative;
    z-index: 1;
}

.sc-high-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin: 4px 8px 0;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
    flex-shrink: 0;
}

.sc-high-lbl {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.03em;
    color: #fff3c4;
    font-family: "Segoe UI", "PingFang SC", "Roboto", sans-serif;
    text-shadow:
        0 0 2px #5d4037,
        2px 2px 0 #3e2723,
        -1px -1px 0 #3e2723,
        0 0 18px rgba(255, 213, 79, 0.55),
        0 3px 6px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

/* 参考图：半透明暗槽 + 银亮玻璃描边，填充亮青，端点黄白燃烧感（整体限制在条高内） */
.sc-high-track {
    flex: 0 1 auto;
    width: clamp(168px, 44vw, 260px);
    min-width: 132px;
    height: 28px;
    border-radius: 999px;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(4, 10, 28, 0.5) 0%, rgba(2, 6, 18, 0.35) 100%);
    border: 2px solid rgba(210, 230, 255, 0.45);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.2),
        0 0 12px rgba(140, 200, 255, 0.2),
        inset 0 2px 6px rgba(0, 0, 0, 0.55),
        inset 0 -1px 0 rgba(255, 255, 255, 0.12);
}

.sc-high-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    border-radius: 999px;
    overflow: visible;
    background: linear-gradient(180deg, #e4fbff 0%, #5ce1f5 32%, #00b8d9 58%, #0088c6 100%);
    box-shadow:
        inset 0 4px 0 rgba(255, 255, 255, 0.65),
        inset 0 -5px 12px rgba(0, 50, 110, 0.4),
        0 0 14px rgba(0, 230, 255, 0.65),
        0 0 26px rgba(0, 180, 255, 0.35);
    transition: width 0.35s ease-out;
}

.sc-high-fill::before {
    content: '';
    position: absolute;
    left: 5%;
    right: 18px;
    top: 4px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.85) 50%, transparent 100%);
    opacity: 0.9;
    pointer-events: none;
}

/* 进度条右端：黄白热点 + 火星，高度控制在轨道内 */
.sc-high-tip {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(50%, -50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
    z-index: 2;
}

.sc-high-tip-core {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: radial-gradient(
        circle at 44% 40%,
        rgba(255, 255, 255, 1) 0%,
        rgba(255, 252, 220, 0.98) 28%,
        rgba(255, 210, 70, 0.65) 55%,
        rgba(255, 140, 30, 0.22) 75%,
        transparent 88%
    );
    box-shadow:
        0 0 6px rgba(255, 255, 255, 1),
        0 0 14px rgba(255, 230, 120, 0.9),
        0 0 22px rgba(255, 170, 50, 0.45);
    animation: sc-high-tip-pulse 0.75s ease-in-out infinite alternate;
}

.sc-high-spark {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    margin: -1.5px 0 0 -1.5px;
    opacity: 0;
    box-shadow: 0 0 4px currentColor, 0 0 8px currentColor;
}

.sc-hs-1 {
    color: #fff;
    background: #fff;
    animation: sc-high-spark-1 1.6s ease-out infinite;
}

.sc-hs-2 {
    color: #ffeb3b;
    background: #fff9c4;
    animation: sc-high-spark-2 1.6s ease-out infinite 0.2s;
}

.sc-hs-3 {
    color: #ffc107;
    background: #ffe082;
    animation: sc-high-spark-3 1.6s ease-out infinite 0.45s;
}

.sc-hs-4 {
    color: #ff9800;
    background: #ffcc80;
    animation: sc-high-spark-4 1.6s ease-out infinite 0.65s;
}

.sc-hs-5 {
    color: #ff5722;
    background: #ffab91;
    animation: sc-high-spark-5 1.6s ease-out infinite 0.85s;
}

@keyframes sc-high-tip-pulse {
    0% { transform: scale(0.92); opacity: 0.88; }
    100% { transform: scale(1.08); opacity: 1; }
}

@keyframes sc-high-spark-1 {
    0% { transform: translate(0, 0) scale(0.35); opacity: 0; filter: blur(0); }
    12% { opacity: 1; }
    100% { transform: translate(5px, -7px) scale(0.15); opacity: 0; filter: blur(0.5px); }
}

@keyframes sc-high-spark-2 {
    0% { transform: translate(0, 0) scale(0.4); opacity: 0; }
    10% { opacity: 0.98; }
    100% { transform: translate(7px, 4px) scale(0.12); opacity: 0; filter: blur(1px); }
}

@keyframes sc-high-spark-3 {
    0% { transform: translate(0, 0) scale(0.45); opacity: 0; }
    12% { opacity: 1; }
    100% { transform: translate(-5px, -6px) scale(0.18); opacity: 0; }
}

@keyframes sc-high-spark-4 {
    0% { transform: translate(0, 0) scale(0.35); opacity: 0; }
    15% { opacity: 0.95; }
    100% { transform: translate(-6px, 5px) scale(0.1); opacity: 0; filter: blur(1.2px); }
}

@keyframes sc-high-spark-5 {
    0% { transform: translate(0, 0) scale(0.3); opacity: 0; }
    18% { opacity: 0.9; }
    100% { transform: translate(4px, 7px) scale(0.08); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .sc-high-tip-core,
    .sc-hs-1, .sc-hs-2, .sc-hs-3, .sc-hs-4, .sc-hs-5 {
        animation: none;
    }
    .sc-high-tip-core {
        opacity: 0.95;
        transform: scale(1);
    }
    /* 火花动画关闭时仍保留少量静态亮点 */
    .sc-high-tip .sc-hs-1 {
        opacity: 0.65;
        transform: translate(5px, -11px) scale(0.28);
        filter: blur(0.4px);
    }
    .sc-high-tip .sc-hs-2 {
        opacity: 0.55;
        transform: translate(10px, 4px) scale(0.22);
        filter: blur(0.6px);
    }
    .sc-high-tip .sc-hs-3 {
        opacity: 0.6;
        transform: translate(-6px, -9px) scale(0.26);
    }
    .sc-high-tip .sc-hs-4 {
        opacity: 0.5;
        transform: translate(-9px, 6px) scale(0.18);
        filter: blur(0.8px);
    }
    .sc-high-tip .sc-hs-5 {
        opacity: 0.45;
        transform: translate(4px, 10px) scale(0.16);
    }
}

.sc-high-shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(
        105deg,
        transparent 0%,
        transparent 40%,
        rgba(255, 255, 255, 0.22) 50%,
        transparent 60%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: sc-high-sheen 2.4s linear infinite;
    mix-blend-mode: screen;
}

@keyframes sc-high-sheen {
    0% { background-position: 120% 0; }
    100% { background-position: -120% 0; }
}

.sc-high-num {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 900;
    color: #fff3c4;
    text-shadow:
        0 0 2px #5d4037,
        2px 2px 0 #3e2723,
        -1px -1px 0 #3e2723,
        0 0 16px rgba(255, 213, 79, 0.7),
        0 2px 5px rgba(0, 0, 0, 0.55);
    z-index: 3;
    pointer-events: none;
}

.sc-glass-bar {
    margin: 4px 8px 0;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 10px;
    border-radius: 16px;
    background: linear-gradient(165deg, rgba(25, 35, 70, 0.55), rgba(12, 18, 45, 0.72));
    border: 1px solid rgba(130, 170, 255, 0.22);
    box-shadow:
        0 0 28px rgba(80, 140, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.sc-top-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.sc-top-left, .sc-top-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.sc-top-center {
    flex: 1;
    text-align: center;
    min-width: 0;
}

.sc-hud-text {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.sc-hud-target {
    font-size: 12px;
    color: rgba(200, 210, 255, 0.9);
}

.sc-hud-score {
    font-size: 24px;
    font-weight: 900;
    color: #fff;
    line-height: 1.1;
    text-shadow:
        0 0 18px rgba(120, 200, 255, 0.55),
        0 0 40px rgba(80, 140, 255, 0.25);
}

.sc-star-pill {
    font-size: 13px;
    font-weight: 800;
    color: #ffe082;
    background: linear-gradient(165deg, rgba(40, 30, 10, 0.65), rgba(20, 15, 8, 0.85));
    padding: 5px 10px;
    border-radius: 14px;
    border: 1px solid rgba(255, 213, 79, 0.35);
    box-shadow: 0 0 14px rgba(255, 200, 80, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.sc-plus-ad {
    min-width: 64px;
    height: 38px;
    padding: 0 10px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: linear-gradient(180deg, #4caf50 0%, #2e7d32 55%, #1b5e20 100%);
    color: #fff;
    border: 1px solid rgba(180, 255, 200, 0.35);
    box-shadow:
        0 0 18px rgba(76, 175, 80, 0.45),
        0 3px 0 #145214,
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.sc-plus-ad:active {
    transform: translateY(2px);
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.35), inset 0 2px 6px rgba(0, 0, 0, 0.2);
}

.sc-plus-txt {
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.3px;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.sc-plus-ad-tag {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 18px;
    padding: 0 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.4px;
    color: #fff;
    background: linear-gradient(180deg, rgba(34, 42, 60, 0.92), rgba(16, 22, 34, 0.96));
    border: 1px solid rgba(180, 205, 255, 0.52);
    pointer-events: none;
    box-shadow:
        0 0 6px rgba(180, 220, 255, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.sc-icon-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.4) 0%, transparent 42%),
        linear-gradient(165deg, rgba(70, 100, 200, 0.75), rgba(25, 40, 100, 0.9));
    color: #fff;
    border: 1px solid rgba(160, 200, 255, 0.45);
    font-size: 17px;
    box-shadow:
        0 0 16px rgba(100, 160, 255, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.sc-icon-btn:active {
    transform: scale(0.94);
}

.sc-powers {
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 10px 12px 24px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.sc-power {
    --bubble-size: 64px;
    position: relative;
    width: var(--bubble-size);
    height: var(--bubble-size);
    border-radius: 50%;
    padding: 0;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    filter: drop-shadow(0 0 16px rgba(200, 230, 255, 0.55))
        drop-shadow(0 0 28px rgba(100, 170, 255, 0.2))
        drop-shadow(0 5px 10px rgba(0, 0, 0, 0.5));
    transition: transform 0.12s ease, filter 0.12s ease;
    margin-bottom: 24px;
}

.sc-power:active {
    transform: scale(0.92);
    filter: drop-shadow(0 0 10px rgba(200, 230, 255, 0.45))
        drop-shadow(0 3px 6px rgba(0, 0, 0, 0.55));
}

.sc-power.sc-power-trio-free .sc-power-bubble {
    box-shadow:
        0 0 0 2px rgba(180, 220, 255, 0.9),
        0 0 20px rgba(130, 200, 255, 0.45),
        0 0 34px rgba(95, 170, 255, 0.2),
        inset 0 2px 12px rgba(255, 255, 255, 0.32),
        inset 0 -6px 14px rgba(20, 50, 120, 0.38);
}

.sc-power-bubble {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.2) 24%, transparent 44%),
        radial-gradient(circle at 50% 112%, rgba(84, 190, 255, 0.46) 0%, transparent 50%),
        linear-gradient(168deg, rgba(168, 214, 255, 0.46) 0%, rgba(66, 126, 214, 0.42) 55%, rgba(22, 56, 130, 0.62) 100%);
    border: 1.6px solid rgba(230, 245, 255, 0.68);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.42),
        0 0 18px rgba(187, 225, 255, 0.52),
        0 0 30px rgba(95, 173, 255, 0.28),
        inset 0 2px 12px rgba(255, 255, 255, 0.28),
        inset 0 -7px 16px rgba(25, 55, 120, 0.4);
    pointer-events: none;
}

.sc-power-slot {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 13px;
    border-radius: 3px;
    background: linear-gradient(180deg, #546e7a 0%, #37474f 100%);
    border: 1px solid rgba(180, 210, 225, 0.45);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.28),
        inset 0 1px 2px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    z-index: 2;
    opacity: 0.96;
}

/* Decorative slot removed per latest UI request */
.sc-power-slot {
    display: none;
}

.sc-power-icon {
    position: relative;
    z-index: 3;
    width: 82%;
    height: 82%;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.sc-power-label {
    position: absolute;
    left: 50%;
    bottom: -20px;
    transform: translateX(-50%);
    font-size: 9px;
    font-weight: 800;
    color: #edf4ff;
    white-space: normal;
    line-height: 1;
    text-align: center;
    width: 62px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    pointer-events: none;
}

.sc-pwr-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 1.5px 3px rgba(0, 0, 0, 0.42));
}

.sc-pwr-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    pointer-events: none;
    user-select: none;
}

.sc-power--active .sc-power-icon {
    animation: sc-power-icon-pulse 0.78s ease-in-out infinite alternate;
    transform-origin: center center;
}

@keyframes sc-power-icon-pulse {
    0% { transform: scale(0.88); }
    100% { transform: scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
    .sc-power--active .sc-power-icon {
        animation: none;
        transform: scale(1.04);
    }
}

@media (min-width: 400px) {
    .sc-power {
        --bubble-size: 72px;
    }
}

.power-hint {
    text-align: center;
    padding: 10px 16px;
    margin: 0 14px 6px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    border-radius: 14px;
    flex-shrink: 0;
    background: linear-gradient(165deg, rgba(40, 55, 100, 0.65), rgba(15, 22, 50, 0.82));
    border: 1px solid rgba(150, 190, 255, 0.28);
    box-shadow: 0 0 20px rgba(80, 140, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.power-hint.hidden {
    display: none;
}

.sc-game-row {
    flex: 1;
    display: flex;
    align-items: stretch;
    min-height: 0;
    padding: 0 6px 8px;
    gap: 6px;
    position: relative;
}

.sc-canvas-wrap {
    flex: 1;
    min-width: 0;
    min-height: 0;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}

.sc-game-fx {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
    border-radius: 16px;
}

.sc-level-intro {
    position: absolute;
    inset: 0;
    z-index: 35;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.sc-level-intro.hidden {
    display: none;
}

.sc-level-intro-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 45%, rgba(8, 16, 48, 0.55), rgba(3, 6, 18, 0.82));
    opacity: 0;
    transition: opacity 0.45s ease-out;
}

.sc-level-intro-card {
    position: relative;
    text-align: center;
    padding: 28px 36px 32px;
    border-radius: 22px;
    background: linear-gradient(165deg, rgba(35, 50, 110, 0.92), rgba(12, 20, 55, 0.96));
    border: 1px solid rgba(140, 190, 255, 0.35);
    box-shadow:
        0 0 40px rgba(80, 140, 255, 0.25),
        0 16px 48px rgba(0, 0, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: scale(0.72) translateY(16px);
    opacity: 0;
    filter: blur(4px);
    transition:
        transform 0.55s cubic-bezier(0.22, 1, 0.36, 1),
        opacity 0.45s ease-out,
        filter 0.5s ease-out;
}

.sc-level-intro--show .sc-level-intro-backdrop {
    opacity: 1;
}

.sc-level-intro--show .sc-level-intro-card {
    transform: scale(1) translateY(0);
    opacity: 1;
    filter: blur(0);
}

.sc-level-intro-glow {
    position: absolute;
    left: 50%;
    top: -40%;
    width: 140%;
    height: 80%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(120, 200, 255, 0.22), transparent 68%);
    pointer-events: none;
    animation: sc-intro-glow 2.2s ease-in-out infinite alternate;
}

@keyframes sc-intro-glow {
    from { opacity: 0.65; transform: translateX(-50%) scale(0.95); }
    to { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

.sc-level-intro-level {
    position: relative;
    font-size: clamp(1.35rem, 4.5vw, 1.85rem);
    font-weight: 900;
    letter-spacing: 0.06em;
    color: #fff;
    text-shadow:
        0 0 20px rgba(120, 200, 255, 0.55),
        0 2px 0 rgba(0, 0, 0, 0.45);
    margin-bottom: 12px;
}

.sc-level-intro-target {
    position: relative;
    font-size: clamp(1rem, 3.4vw, 1.25rem);
    font-weight: 800;
    color: #ffe082;
    text-shadow:
        0 0 14px rgba(255, 213, 79, 0.45),
        0 1px 2px rgba(0, 0, 0, 0.5);
}

@media (prefers-reduced-motion: reduce) {
    .sc-level-intro-glow {
        animation: none;
        opacity: 0.85;
    }
    .sc-level-intro-card {
        transition-duration: 0.15s;
        filter: none;
    }
}

.sc-combo-toast {
    position: absolute;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%);
    z-index: 4;
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.sc-combo-toast.sc-combo-show {
    opacity: 1;
}

.sc-combo-toast.hidden {
    display: none;
}

.sc-combo-praise {
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1.15;
    color: #fff8e1;
    text-shadow:
        0 0 3px #6d4c41,
        2px 2px 0 #3e2723,
        -1px -1px 0 #3e2723,
        0 0 22px rgba(255, 213, 79, 0.55),
        0 4px 14px rgba(0, 0, 0, 0.45);
    margin-bottom: 6px;
    animation: sc-combo-praise-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sc-combo-praise.hidden {
    display: none;
}

.sc-combo-praise--t1 { font-size: 1.28rem; }
.sc-combo-praise--t2 { font-size: 1.38rem; }
.sc-combo-praise--t3 { font-size: 1.52rem; }
.sc-combo-praise--t4 { font-size: 1.64rem; }
.sc-combo-praise--t5 { font-size: 1.78rem; }
.sc-combo-praise--t6 { font-size: 1.92rem; }
.sc-combo-praise--t7 { font-size: 2.06rem; }
.sc-combo-praise--t8 { font-size: 2.18rem; color: #fff59d; }
.sc-combo-praise--t9 { font-size: 2.32rem; color: #ffee58; }
.sc-combo-praise--t10 {
    font-size: clamp(1.85rem, 7vw, 2.55rem);
    color: #fff176;
    text-shadow:
        0 0 6px #e65100,
        2px 2px 0 #3e2723,
        -1px -1px 0 #3e2723,
        0 0 28px rgba(255, 235, 59, 0.85),
        0 0 48px rgba(255, 152, 0, 0.45);
    animation: sc-combo-praise-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both, sc-combo-praise-pulse 1.1s ease-in-out infinite alternate;
}

@keyframes sc-combo-praise-in {
    from {
        transform: scale(0.65);
        opacity: 0;
        filter: blur(3px);
    }
    to {
        transform: scale(1);
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes sc-combo-praise-pulse {
    from { filter: brightness(1); }
    to { filter: brightness(1.12); }
}

.sc-combo-line {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65), 0 0 20px rgba(120, 200, 255, 0.35);
}

@media (prefers-reduced-motion: reduce) {
    .sc-combo-praise {
        animation: none;
    }
    .sc-combo-praise--t10 {
        animation: none;
    }
}

.sc-particle-star {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: #ffd54f;
    text-shadow: 0 0 6px rgba(255, 213, 79, 0.9);
    animation: sc-part-pop 0.55s ease-out forwards;
    pointer-events: none;
}

@keyframes sc-part-pop {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translate(var(--dx, 0px), var(--dy, -40px)) scale(0.35) rotate(220deg);
    }
}

.sc-float-pts {
    position: absolute;
    transform: translate(-50%, -50%);
    font-size: 13px;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.8), 0 2px 4px rgba(0, 0, 0, 0.5);
    animation: sc-float-up 0.85s ease-out forwards;
    pointer-events: none;
}

@keyframes sc-float-up {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-42px) scale(1.15);
    }
}

.sc-side {
    width: 44px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 4px;
}

.sc-side-tools {
    justify-content: flex-start;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    border-radius: 16px;
    background: rgba(3, 5, 16, 0.22);
    border: 1px solid rgba(100, 160, 255, 0.18);
    box-shadow:
        0 0 32px rgba(60, 120, 220, 0.12),
        inset 0 0 40px rgba(0, 0, 0, 0.25);
}

.btn.hidden {
    display: none;
}

.sc-start-boost-overlay {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(4, 10, 28, 0.55);
}

.sc-boost-panel {
    max-width: 92vw;
    width: 360px;
    margin: auto;
    padding: 0 14px 20px;
    border-radius: 22px;
    background: linear-gradient(180deg, #b8e0ff 0%, #8ec8f5 35%, #6eb8eb 100%);
    box-shadow:
        0 16px 40px rgba(0, 30, 80, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.65);
    border: 2px solid rgba(255, 255, 255, 0.55);
    text-align: center;
    position: relative;
}

.sc-boost-ribbon {
    margin: -6px auto 12px;
    max-width: 88%;
    padding: 10px 20px 14px;
    background: linear-gradient(180deg, #2196f3 0%, #1565c0 55%, #0d47a1 100%);
    border-radius: 0 0 18px 18px;
    box-shadow:
        0 6px 0 rgba(13, 71, 161, 0.35),
        0 8px 20px rgba(0, 40, 100, 0.35);
    border: 2px solid rgba(100, 180, 255, 0.5);
    border-top: none;
}

.sc-boost-ribbon-text {
    display: block;
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    color: #fff;
    text-shadow:
        0 2px 0 #0d47a1,
        0 -1px 0 rgba(255, 255, 255, 0.35);
}

.sc-boost-double-flag {
    display: inline-block;
    margin-bottom: 8px;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(90deg, #ff6f00, #ff4081);
    box-shadow: 0 2px 8px rgba(255, 64, 129, 0.45);
}

.sc-boost-double-flag.hidden {
    display: none;
}

.sc-boost-main {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 200px;
}

.sc-boost-rail {
    flex: 0 0 32px;
    position: relative;
    min-height: 100%;
}

.sc-boost-rail-line {
    position: absolute;
    left: 50%;
    top: 12%;
    bottom: 12%;
    width: 5px;
    margin-left: -2.5px;
    border-radius: 4px;
    background: linear-gradient(180deg, rgba(100, 160, 220, 0.85), rgba(60, 120, 200, 0.65));
    box-shadow: inset 0 0 4px rgba(255, 255, 255, 0.4);
}

.sc-boost-rail-nub {
    position: absolute;
    left: 50%;
    top: 84%;
    width: 0;
    height: 0;
    margin-left: 2px;
    border-style: solid;
    border-width: 11px 0 11px 16px;
    border-color: transparent transparent transparent #ff7043;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
    transform: translate(-50%, -50%);
    transition: top 0.2s ease;
    pointer-events: none;
}

.sc-boost-rows {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.sc-boost-row {
    flex: 1;
    display: block;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border-radius: 16px;
    border: 3px solid transparent;
    background: rgba(255, 255, 255, 0.35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.sc-boost-row:hover {
    background: rgba(255, 255, 255, 0.48);
}

.sc-boost-row:active {
    transform: scale(0.99);
}

.sc-boost-row--active {
    border-color: #3949ab;
    box-shadow:
        0 0 0 1px rgba(57, 73, 171, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.55);
}

.sc-boost-row-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 14px;
    pointer-events: none;
}

.sc-boost-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.sc-boost-bub {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0.15) 35%, transparent 45%),
        linear-gradient(165deg, rgba(180, 220, 255, 0.55), rgba(80, 140, 220, 0.45));
    border: 2px solid rgba(255, 255, 255, 0.65);
    box-shadow:
        0 4px 10px rgba(30, 80, 160, 0.25),
        inset 0 -4px 10px rgba(50, 100, 180, 0.2);
}

.sc-boost-bub .sc-pwr-svg {
    width: 68%;
    height: 68%;
    pointer-events: none;
}

.sc-boost-bub .sc-pwr-img {
    width: 78%;
    height: 78%;
}

.sc-boost-mult {
    font-size: 13px;
    font-weight: 900;
    color: #ffc107;
    text-shadow:
        0 0 6px rgba(255, 193, 7, 0.6),
        0 1px 2px rgba(0, 0, 0, 0.45);
}

.sc-boost-footnote {
    font-size: 0.78rem;
    line-height: 1.45;
    color: rgba(20, 50, 90, 0.88);
    margin: 0 4px 6px;
    text-align: center;
}

.sc-boost-footnote strong {
    color: #c62828;
    font-weight: 900;
}

.sc-boost-footnote-sub {
    font-size: 0.72rem;
    color: rgba(20, 50, 90, 0.75);
    margin-bottom: 14px;
}

.sc-boost-claim {
    width: 100%;
    max-width: 280px;
    margin: 0 auto 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-size: 1.05rem;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(180deg, #ff5252 0%, #d32f2f 45%, #b71c1c 100%);
    box-shadow:
        0 4px 0 #7f0000,
        0 8px 24px rgba(183, 28, 28, 0.45);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.sc-boost-buy {
    width: 100%;
    max-width: 280px;
    margin: 0 auto 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 18px;
    border-radius: 999px;
    font-weight: 900;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #fff;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.sc-boost-buy-star {
    filter: drop-shadow(0 2px 6px rgba(255, 220, 120, 0.45));
}

.sc-boost-buy-price {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffe082;
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.sc-boost-claim:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #7f0000, 0 4px 16px rgba(183, 28, 28, 0.4);
}

.sc-boost-claim-film {
    width: 22px;
    height: 16px;
    border-radius: 4px;
    background: linear-gradient(180deg, #37474f, #263238);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
    position: relative;
}

.sc-boost-claim-film::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-40%, -50%);
    border-style: solid;
    border-width: 4px 0 4px 7px;
    border-color: transparent transparent transparent #fff;
}

.sc-boost-skip-link {
    display: block;
    margin: 0 auto;
    padding: 6px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 700;
    color: rgba(25, 60, 120, 0.85);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sc-power-ad-tag {
    position: absolute;
    left: -2px;
    top: -2px;
    z-index: 5;
    min-width: 22px;
    height: 16px;
    padding: 0 5px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.5px;
    line-height: 16px;
    text-align: center;
    color: #fff;
    background: linear-gradient(180deg, rgba(34, 42, 60, 0.95), rgba(16, 22, 34, 0.98));
    border: 1px solid rgba(180, 205, 255, 0.55);
    pointer-events: none;
    box-shadow:
        0 0 6px rgba(180, 220, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: background 0.2s ease, color 0.2s ease;
}

.sc-power-ad-tag--free {
    background: linear-gradient(180deg, #43a047 0%, #2e7d32 100%);
    border-color: rgba(180, 255, 200, 0.55);
    box-shadow:
        0 0 6px rgba(76, 175, 80, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.sc-power-token-badge {
    position: absolute;
    right: -2px;
    top: -2px;
    z-index: 4;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ff7043 0%, #e64a19 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 8px rgba(255, 112, 67, 0.6), 0 1px 0 rgba(0, 0, 0, 0.3);
    pointer-events: none;
}

.sc-power-token-badge.hidden {
    display: none;
}

/* ── Power balance pill ──────────────────────────────────────────── */
.sc-power-pill .sc-power-pill-lbl {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
    opacity: 0.92;
}

.sc-power-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    height: 28px;
    padding: 0 9px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(180deg, rgba(100, 60, 200, 0.85), rgba(60, 20, 140, 0.92));
    border: 1px solid rgba(200, 160, 255, 0.45);
    box-shadow:
        0 0 10px rgba(160, 100, 255, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

/* ── Shop HUD button ─────────────────────────────────────────────── */
.sc-shop-hud-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    font-size: 16px;
    background: linear-gradient(180deg, rgba(80, 50, 160, 0.88), rgba(40, 20, 100, 0.94));
    border: 1px solid rgba(200, 160, 255, 0.5);
    color: #fff;
    box-shadow:
        0 0 14px rgba(140, 90, 255, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sc-shop-hud-btn:active {
    transform: scale(0.92);
}

/* ── Shop overlay ─────────────────────────────────────────────────── */
.sc-shop-overlay {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 10, 30, 0.82);
    backdrop-filter: blur(4px);
}

.sc-shop-panel {
    position: relative;
    width: min(96vw, 360px);
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 22px;
    padding: 22px 18px 24px;
    background: linear-gradient(160deg, rgba(22, 30, 70, 0.98) 0%, rgba(10, 18, 48, 0.99) 100%);
    border: 1.5px solid rgba(160, 120, 255, 0.45);
    box-shadow:
        0 0 60px rgba(120, 80, 255, 0.3),
        0 8px 32px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sc-shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.sc-shop-title {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 1px;
    color: #e8d8ff;
    text-shadow: 0 0 14px rgba(180, 130, 255, 0.6);
}

.sc-shop-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    color: #ccc;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: background 0.15s;
}
.sc-shop-close:hover { background: rgba(255, 255, 255, 0.2); }

.sc-shop-subtitle {
    font-size: 11px;
    color: rgba(200, 180, 255, 0.7);
    margin: 0 0 18px;
    text-align: center;
    letter-spacing: 0.3px;
}

.sc-shop-cards {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: stretch;
    margin-bottom: 14px;
}

.sc-shop-card {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px 12px;
    border-radius: 16px;
    background: linear-gradient(160deg, rgba(40, 30, 90, 0.9), rgba(20, 15, 55, 0.95));
    border: 1.5px solid rgba(140, 100, 255, 0.35);
    box-shadow: 0 0 20px rgba(100, 60, 200, 0.2);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.sc-shop-card:active { transform: scale(0.97); }

.sc-shop-card--mid {
    border-color: rgba(200, 160, 255, 0.6);
    background: linear-gradient(160deg, rgba(70, 40, 140, 0.95), rgba(40, 20, 100, 0.98));
    box-shadow: 0 0 28px rgba(150, 90, 255, 0.35);
    transform: scale(1.04);
}
.sc-shop-card--mid:active { transform: scale(0.98); }

.sc-shop-card-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(90deg, #b06aff, #7c3aed);
    color: #fff;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.5px;
    padding: 2px 10px;
    border-radius: 99px;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(120, 60, 200, 0.4);
}

.sc-shop-card-icon {
    font-size: 30px;
    line-height: 1;
}

.sc-shop-card-name {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.8px;
    color: #d8c8ff;
    text-transform: uppercase;
}

.sc-shop-card-qty {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.sc-shop-buy-btn {
    margin-top: 4px;
    width: 100%;
    height: 34px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 900;
    padding: 0 6px;
    background: linear-gradient(180deg, #7c3aed 0%, #4c1d95 100%);
    color: #fff;
    border: 1px solid rgba(200, 160, 255, 0.4);
    box-shadow: 0 3px 0 #2e1065, 0 0 12px rgba(120, 60, 200, 0.3);
    transition: transform 0.1s, box-shadow 0.1s;
}
.sc-shop-buy-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 #2e1065, 0 0 8px rgba(120, 60, 200, 0.2);
}
.sc-shop-buy-btn--mid {
    background: linear-gradient(180deg, #a855f7 0%, #7c3aed 100%);
    box-shadow: 0 3px 0 #4c1d95, 0 0 16px rgba(160, 90, 255, 0.4);
}

.sc-shop-price {
    font-size: 13px;
    font-weight: 900;
}

.sc-shop-note {
    font-size: 10px;
    color: rgba(180, 160, 220, 0.6);
    text-align: center;
    margin: 0;
    line-height: 1.4;
}

.sc-shop-toast {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(160, 190, 255, 0.35);
    background: linear-gradient(165deg, rgba(25, 34, 72, 0.88), rgba(15, 22, 48, 0.94));
    color: #e9f0ff;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    box-shadow: 0 0 14px rgba(80, 120, 220, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.sc-shop-toast.hidden {
    display: none;
}

.sc-shop-toast--ok {
    border-color: rgba(145, 255, 180, 0.42);
    background: linear-gradient(165deg, rgba(20, 70, 55, 0.9), rgba(14, 48, 40, 0.94));
    color: #dcffe8;
}

.sc-shop-toast--err {
    border-color: rgba(255, 170, 170, 0.45);
    background: linear-gradient(165deg, rgba(86, 38, 50, 0.9), rgba(62, 24, 34, 0.95));
    color: #ffe3e3;
}

@media (max-width: 900px), (hover: none) and (pointer: coarse) {
    #level-select.screen {
        padding-bottom: max(
            calc(env(safe-area-inset-bottom, 0px) + 12px),
            clamp(96px, 15vh, 168px)
        );
    }

    #level-select .level-grid {
        padding-bottom: max(
            14px,
            calc(env(safe-area-inset-bottom, 0px) + clamp(132px, 20vh, 220px))
        );
    }

    .sc-high-bar {
        margin: 2px 6px 0;
        padding: calc(6px + env(safe-area-inset-top, 0px)) 8px 6px;
        gap: 8px;
    }

    .sc-high-track {
        width: min(58vw, 240px);
        min-width: 118px;
    }

    .sc-glass-bar {
        margin: 2px 6px 0;
        padding: 8px 8px 8px;
        border-radius: 14px;
    }

    .sc-top-bar {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "left center"
            "right right";
        align-items: center;
        row-gap: 7px;
        column-gap: 8px;
    }

    .sc-top-left {
        grid-area: left;
        min-width: 0;
    }

    .sc-top-center {
        grid-area: center;
        min-width: 0;
    }

    .sc-top-right {
        grid-area: right;
        justify-content: flex-end;
        width: 100%;
        min-width: 0;
        flex-wrap: wrap;
        gap: 6px;
    }
}
@media (max-width: 900px) and (orientation: landscape), (hover: none) and (pointer: coarse) and (orientation: landscape) {
    #level-select.screen {
        padding-bottom: max(
            calc(env(safe-area-inset-bottom, 0px) + 6px),
            clamp(64px, 10vh, 112px)
        );
    }

    #level-select .level-grid {
        padding-bottom: max(
            14px,
            calc(env(safe-area-inset-bottom, 0px) + clamp(96px, 15vh, 160px))
        );
    }
}

body.sc-host-fullscreen #level-select.screen {
    padding-bottom: 0 !important;
}

body.sc-host-fullscreen #level-select .level-grid {
    padding-bottom: 14px !important;
}

@media (max-width: 640px) {
    .sc-hud-text {
        font-size: 12px;
    }

    .sc-hud-target {
        font-size: 11px;
    }

    .sc-hud-score {
        font-size: 20px;
    }

    .sc-power-pill,
    .sc-star-pill {
        height: 26px;
        padding: 0 8px;
        border-radius: 13px;
        font-size: 12px;
    }

    .sc-plus-ad {
        min-width: 0;
        height: 32px;
        padding: 0 8px;
        border-radius: 11px;
    }

    .sc-plus-txt {
        font-size: 12px;
    }

    .sc-plus-ad-tag {
        min-width: 22px;
        height: 16px;
        padding: 0 5px;
        border-radius: 7px;
        font-size: 9px;
    }

    .sc-shop-hud-btn {
        width: 32px;
        height: 32px;
        font-size: 15px;
    }
}

@media (max-width: 430px) {
    .sc-top-bar {
        column-gap: 6px;
        row-gap: 6px;
    }

    .sc-top-left {
        gap: 4px;
    }

    .sc-top-right {
        gap: 4px;
    }

    .sc-icon-btn {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }

    .sc-hud-score {
        font-size: 18px;
    }

    .sc-power-pill,
    .sc-star-pill {
        font-size: 11px;
        padding: 0 7px;
    }

    .sc-plus-ad {
        height: 30px;
        padding: 0 7px;
    }

    .sc-plus-txt {
        font-size: 11px;
    }

    .sc-plus-ad-tag {
        min-width: 20px;
    }
}