/* 贪吃蛇 */

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

.snake-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);
}

.snake-hud b { font-size: 13px; color: #c8f5d0; }
.snake-hud b:last-of-type { color: var(--gold); }

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

.snake-wrap {
    position: relative;
    display: grid;
    place-items: center;
    padding: 6px 0;
}

#sn-canvas {
    display: block;
    width: min(100%, 480px);
    aspect-ratio: 4 / 3;
    height: auto;
    background: #050805;
    border: 2px solid #1f5b32;
    border-radius: 3px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    box-shadow:
        0 0 0 1px #0c130d,
        0 0 34px rgba(34, 197, 94, .08),
        inset 0 0 24px #000;
    touch-action: none;
}

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

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

.snake-overlay__box {
    width: min(320px, 100%);
    padding: 18px 20px;
    text-align: center;
    background: linear-gradient(180deg, rgba(16, 30, 20, .96), rgba(6, 12, 8, .98));
    border: 2px solid #22c55e;
    border-radius: 8px;
    box-shadow: 0 0 0 4px rgba(34, 197, 94, .05), 0 18px 40px rgba(0, 0, 0, .7);
}

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

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

.snake-overlay p {
    margin: 0 0 14px;
    font-size: 10.5px;
    line-height: 1.8;
    color: #9db8a5;
}

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

.snake-overlay__tip {
    margin: 12px 0 0 !important;
    font-size: 8.5px !important;
    letter-spacing: .06em;
    color: #5c7a65 !important;
}

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

.snake-dpad {
    display: grid;
    gap: 2px;
    justify-items: center;
}

.snake-dpad button {
    width: 44px;
    height: 44px;
    font-family: var(--font-pixel);
    color: var(--cream);
    background: #18251c;
    border: 1px solid #33513d;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    touch-action: manipulation;
}

.snake-dpad button:active { background: #2c4633; }
.snake-dpad__row { display: flex; gap: 2px; }

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

@media (max-width: 480px) {
    .snake-overlay h2 { font-size: 20px; }
    .snake-dpad button { width: 40px; height: 40px; }
}
