* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: #000;
    color: #39ff14;
    /* Neon Phosphor Green */
    font-family: 'Press Start 2P', monospace;
    overflow: hidden;
    /* No scrolling in arcade mode */
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-size: 14px;
}

/* CRT Scanline Effect (same as main site) */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.2) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    z-index: 50;
}

.game-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    z-index: 10;
    width: min(96vw, 540px);
}

.hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 0;
    border-bottom: 2px solid #39ff14;
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
}

.hud-left {
    text-align: left;
    white-space: nowrap;
}

.hud-center {
    text-align: center;
    font-size: 8px;
    line-height: 1.5;
    color: #ff00ff;
    text-shadow: 0 0 8px rgba(255, 0, 255, 0.6);
}

.hud-right {
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 560px) {
    .hud {
        font-size: 10px;
    }

    .hud-center {
        font-size: 7px;
    }
}

/* ---------- cabinet (canvas + overlays) ---------- */
.cabinet {
    position: relative;
    width: 100%;
}

canvas {
    background-color: #050505;
    border: 2px solid #39ff14;
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.2);
    display: block;
    width: 100%;
    height: auto;
    image-rendering: pixelated;
    touch-action: none;
    /* no scroll/zoom gestures on the playfield */
}

/* ---------- select screen ---------- */
#select {
    position: absolute;
    inset: 2px;
    /* inside the canvas border */
    background: rgba(2, 4, 2, 0.94);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 22px;
    z-index: 20;
}

#select.hidden {
    display: none;
}

.cartridge {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 2px solid rgba(57, 255, 20, 0.35);
    background: rgba(57, 255, 20, 0.04);
    padding: 14px 16px;
    cursor: pointer;
    transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
    user-select: none;
}

.cartridge.sel,
.cartridge:hover {
    border-color: #39ff14;
    background: rgba(57, 255, 20, 0.12);
    transform: translateX(6px);
    box-shadow: -6px 0 0 #ff00ff;
}

.cart-num {
    font-size: 20px;
    color: rgba(57, 255, 20, 0.45);
}

.cartridge.sel .cart-num {
    color: #39ff14;
}

.cart-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.cart-title {
    font-size: 12px;
    color: #39ff14;
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
}

.tag {
    font-style: normal;
    font-size: 7px;
    padding: 2px 5px;
    vertical-align: middle;
    margin-left: 6px;
}

.tag-new {
    background: #ff00ff;
    color: #000;
    animation: blink 1s infinite;
}

.tag-old {
    background: rgba(0, 255, 255, 0.25);
    color: #00ffff;
}

.cart-desc {
    font-family: 'VT323', 'Press Start 2P', monospace;
    font-size: 15px;
    color: rgba(180, 255, 180, 0.65);
    line-height: 1.25;
}

.cart-key {
    margin-left: auto;
    color: rgba(57, 255, 20, 0.4);
    font-size: 10px;
}

.cartridge.sel .cart-key {
    color: #39ff14;
}

.select-hint {
    text-align: center;
    font-size: 8px;
    color: rgba(57, 255, 20, 0.45);
    letter-spacing: 0.1em;
}

/* ---------- in-game overlay (snake) ---------- */
.overlay {
    position: absolute;
    inset: 2px;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 20;
}

.overlay h1 {
    font-size: 16px;
    margin-bottom: 20px;
    line-height: 1.5;
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.6);
}

.overlay p {
    font-size: 12px;
    color: #ff00ff;
    text-shadow: 0 0 8px rgba(255, 0, 255, 0.6);
}

/* Utils */
.hidden {
    display: none !important;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.blink {
    animation: blink 1s infinite;
}
