*, *::before, *::after {
        box-sizing: border-box;
}

html {
        height: 100%;
}

body {
        display: grid;
        align-content: center;
        justify-content: center;
        min-height: 100%;
        margin: 0;
    color: #f2ead8;
    background-color: #3a4a63;
        font: 1.2rem/1.2 'Roboto', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* 等比缩放由 JS syncLayers() 显式计算，CSS 不做独立维度的 max 压缩 */
canvas.matrix-render {
        border: 3px solid #1d2531;
        border-radius: 6px;
        display: block;
}

#fx-layer {
        position: fixed;
        left: 0;
        top: 0;
        width: 768px;
        height: 1216px;
        pointer-events: none;
        z-index: 5;
}

.table-decor {
        position: fixed;
        left: 0;
        top: 0;
        width: 768px;
        height: 1216px;
        pointer-events: none;
        z-index: 4;
}

.hud {
        position: fixed;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 14px;
        padding: 6px 16px;
        background: rgba(29, 37, 49, 0.92);
        border: 1px solid #4a5b78;
        border-radius: 12px;
        z-index: 20;
        white-space: nowrap;
}

.hud-block {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
}

.hud-label {
        font-size: 0.62rem;
        letter-spacing: 0.1em;
        opacity: 0.75;
}

.hud-value {
        font-size: 1.05rem;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
}

.hud-value.accent {
        color: #f5b940;
}

.combo-banner {
        position: fixed;
        top: 74px;
        left: 50%;
        transform: translateX(-50%);
        padding: 4px 16px;
        background: rgba(245, 185, 64, 0.16);
        border: 1px solid #f5b940;
        border-radius: 999px;
        color: #f5b940;
        font-size: 0.95rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        opacity: 0;
        transition: opacity 0.25s;
        pointer-events: none;
        z-index: 20;
}

.combo-banner.visible {
        opacity: 1;
}

.launch-btn {
        position: fixed;
        right: 14px;
        bottom: 44px;
        width: 84px;
        height: 84px;
        border-radius: 50%;
        border: 3px solid #f5b940;
        background: rgba(181, 68, 60, 0.9);
        color: #f2ead8;
        font: 700 1.05rem 'PingFang SC', 'Microsoft YaHei', sans-serif;
        z-index: 20;
        touch-action: none;
        user-select: none;
        -webkit-user-select: none;
}

.launch-btn:active {
        background: rgba(245, 185, 64, 0.85);
        color: #1d2531;
}

.power-bar {
        position: fixed;
        right: 14px;
        bottom: 136px;
        width: 84px;
        height: 12px;
        border: 2px solid #f5b940;
        border-radius: 8px;
        overflow: hidden;
        z-index: 20;
        background: rgba(29, 37, 49, 0.8);
}

.power-fill {
        width: 0%;
        height: 100%;
        background: linear-gradient(90deg, #f5b940, #e8604c);
}

.gameover-overlay {
        position: fixed;
        inset: 0;
        background: rgba(29, 37, 49, 0.82);
        display: grid;
        place-items: center;
        z-index: 30;
}

.gameover-overlay[hidden] {
        display: none;
}

.gameover-card {
        text-align: center;
        padding: 28px 40px;
        background: #2b3a55;
        border: 2px solid #f5b940;
        border-radius: 14px;
}

.gameover-card h2 {
        margin: 0 0 10px;
        font-size: 1.5rem;
        letter-spacing: 0.2em;
}

.go-final strong {
        color: #f5b940;
        font-size: 2rem;
}

.go-sub {
        opacity: 0.8;
        font-size: 0.85rem;
}

#restart-btn {
        margin-top: 14px;
        padding: 10px 34px;
        font: 700 1rem 'PingFang SC', 'Microsoft YaHei', sans-serif;
        border: none;
        border-radius: 999px;
        background: #f5b940;
        color: #1d2531;
        cursor: pointer;
}

html, body {
        touch-action: none;
        -webkit-user-select: none;
        user-select: none;
}

.hint {
        position: fixed;
        bottom: 8px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.6rem;
        letter-spacing: 0.06em;
        color: rgba(242, 234, 216, 0.55);
        white-space: nowrap;
        z-index: 20;
}
