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

html {
        height: 100%;
}

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

/* 等比缩放由 JS syncLayers() 计算，CSS 不做独立维度压缩 */
canvas.matrix-render {
        border: 3px solid #151b25;
        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: 6px;
        z-index: 20;
}

.hud-block {
        background: rgba(21, 27, 37, 0.9);
        border: 1px solid #495a75;
        border-radius: 8px;
        padding: 6px 14px;
        text-align: center;
}

.hud-label {
        display: block;
        font-size: 0.65rem;
        color: #8fa1b8;
        letter-spacing: 0.1em;
}

.hud-value {
        font-size: 1.25rem;
        font-weight: 700;
}

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

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

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

.shake {
        animation: boardshake 0.12s;
}

@keyframes boardshake {
        0% { transform: translate(0, 0); }
        33% { transform: translate(-3px, 1px); }
        66% { transform: translate(3px, -1px); }
        100% { transform: translate(0, 0); }
}

.launch-btn {
        position: fixed;
        right: 14px;
        bottom: 56px;
        width: 84px;
        height: 84px;
        border-radius: 50%;
        border: 3px solid #f5b940;
        background: #b5443c;
        color: #f2ead8;
        font: 700 1rem 'PingFang SC', 'Microsoft YaHei', sans-serif;
        z-index: 20;
        touch-action: none;
}

.launch-btn:active {
        background: #8f2f2f;
}

.power-bar {
        position: fixed;
        right: 14px;
        bottom: 150px;
        width: 84px;
        height: 10px;
        border: 1px solid #495a75;
        border-radius: 5px;
        overflow: hidden;
        z-index: 20;
}

.power-fill {
        height: 100%;
        width: 0%;
        background: #f5b940;
}

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

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

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

.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.04em;
        color: rgba(232, 236, 243, 0.55);
        white-space: nowrap;
        z-index: 20;
}
