/* 俄罗斯方块 */

.game-root--tetris { gap: 6px; }

.tetris-hud {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 14px;
    padding: 4px 6px 8px;
    font-size: 10px;
    letter-spacing: .1em;
    color: #6f9a7d;
    border-bottom: 1px solid rgba(141, 240, 161, .14);
}

.tetris-hud b { font-size: 13px; color: #c8f5d0; }

.tetris-hud__cart {
    margin-left: auto;
    font-size: 8px;
    letter-spacing: .2em;
    color: #436b52;
}

.tetris-wrap {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 14px;
    padding: 6px 0;
}

.tetris-main { position: relative; }

#tr-canvas {
    display: block;
    width: min(100%, 260px);
    aspect-ratio: 1 / 2;
    height: auto;
    background: #05050c;
    border: 2px solid #2a3558;
    border-radius: 3px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    box-shadow:
        0 0 0 1px #0c121c,
        0 0 34px rgba(59, 130, 246, .08),
        inset 0 0 24px #000;
    touch-action: none;
}

.tetris-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tetris-panel {
    width: 120px;
    padding: 8px;
    background: linear-gradient(180deg, rgba(16, 22, 40, .96), rgba(6, 10, 20, .98));
    border: 2px solid #2a3558;
    border-radius: 4px;
}

.tetris-panel h3 {
    margin: 0 0 6px;
    font-size: 9px;
    letter-spacing: .2em;
    color: #5b74df;
    text-align: center;
}

#tr-next, #tr-hold {
    display: block;
    width: 100%;
    height: auto;
    background: #05050c;
    border-radius: 2px;
    image-rendering: pixelated;
}

.tetris-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    background: radial-gradient(circle at 50% 45%, rgba(4, 6, 14, .68), rgba(2, 4, 10, .92));
    transition: opacity .25s ease, visibility .25s;
}

.tetris-overlay.is-off {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.tetris-overlay__box {
    width: min(300px, 100%);
    padding: 16px 18px;
    text-align: center;
    background: linear-gradient(180deg, rgba(16, 22, 40, .96), rgba(6, 10, 20, .98));
    border: 2px solid #2a3558;
    border-radius: 8px;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, .05), 0 18px 40px rgba(0, 0, 0, .7);
}

.tetris-overlay__kicker {
    margin: 0 0 4px;
    font-size: 8.5px;
    letter-spacing: .28em;
    color: #5b74df;
}

.tetris-overlay h2 {
    margin: 0 0 8px;
    font-family: var(--font-hei);
    font-size: 22px;
    font-weight: 900;
    letter-spacing: .14em;
    color: #7ee787;
    text-shadow: 0 0 22px rgba(126, 231, 135, .25);
}

.tetris-overlay p {
    margin: 0 0 12px;
    font-size: 10.5px;
    line-height: 1.8;
    color: #8f9aa0;
}

.tetris-overlay__tip {
    margin: 10px 0 0 !important;
    font-size: 8.5px !important;
    letter-spacing: .06em;
    color: #5b6b8a !important;
}

.tetris-overlay .pixel-btn { font-size: 11px; }

.tetris-touch {
    display: none;
    justify-content: center;
    padding: 4px 6px 2px;
}

.tetris-dpad {
    display: grid;
    grid-template-columns: repeat(5, 42px);
    gap: 4px;
}

.tetris-dpad button {
    font-family: var(--font-pixel);
    color: var(--cream);
    background: #0f1a33;
    border: 1px solid #2a3558;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    touch-action: manipulation;
}

.tetris-dpad button:active { background: #1b2a54; }

@media (hover: none), (pointer: coarse) {
    .tetris-touch { display: flex; }
}

@media (max-width: 480px) {
    .tetris-wrap { gap: 8px; }
    .tetris-side { gap: 6px; }
    .tetris-panel { width: 80px; padding: 6px; }
    .tetris-dpad { grid-template-columns: repeat(5, 36px); }
}
