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

body {
    background-color: #020602;
    color: #34d399;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 15px;
    overflow: hidden;
}

.arcade-cabinet {
    position: relative;
    background-color: #051208;
    border: 4px solid #059669;
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.45), inset 0 0 25px rgba(0, 0, 0, 0.9);
    border-radius: 12px;
    padding: 16px;
    max-width: 840px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.arcade-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 8px;
}

.game-title {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 4px;
    color: #34d399;
    text-shadow: 0 0 8px #34d399, 0 0 16px rgba(52, 211, 153, 0.6);
}

.hud-panel {
    display: flex;
    gap: 20px;
}

.hud-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.hud-label {
    font-size: 10px;
    letter-spacing: 1px;
    color: #059669;
}

.hud-value {
    font-size: 18px;
    font-weight: bold;
    color: #6ee7b7;
    text-shadow: 0 0 6px #34d399;
}

.canvas-container {
    position: relative;
    width: 800px;
    height: 520px;
    background-color: #000802;
    border: 3px solid #10b981;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.95), 0 0 15px rgba(16, 185, 129, 0.3);
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* CRT Scanlines Overlay */
.crt-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.22) 0px,
        rgba(0, 0, 0, 0.22) 1.5px,
        transparent 1.5px,
        transparent 3px
    ), radial-gradient(circle at center, transparent 65%, rgba(0, 0, 0, 0.6) 100%);
    mix-blend-mode: multiply;
}

.overlay-screen {
    position: absolute;
    inset: 0;
    background: rgba(0, 8, 2, 0.88);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 20;
    text-align: center;
    padding: 20px;
}

.overlay-screen.hidden {
    display: none;
}

.overlay-title {
    font-size: 42px;
    font-weight: bold;
    letter-spacing: 6px;
    color: #34d399;
    text-shadow: 0 0 12px #34d399, 0 0 25px #10b981;
    margin-bottom: 15px;
}

.overlay-subtitle {
    font-size: 16px;
    color: #6ee7b7;
    letter-spacing: 2px;
    margin-bottom: 25px;
    animation: blink 1.2s infinite alternate;
}

.overlay-instructions {
    font-size: 13px;
    color: #a7f3d0;
    line-height: 1.8;
    max-width: 460px;
}

@keyframes blink {
    from { opacity: 0.3; }
    to { opacity: 1; }
}

.controls-legend {
    margin-top: 10px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #6ee7b7;
    padding: 0 8px;
}

.key-badge {
    background: #042f1a;
    border: 1px solid #10b981;
    border-radius: 3px;
    padding: 2px 6px;
    color: #ffffff;
    font-weight: bold;
}

/* Touch controls for mobile / pointer */
.touch-controls {
    display: none;
    width: 100%;
    margin-top: 10px;
    justify-content: space-between;
}

.touch-cluster {
    display: grid;
    grid-template-columns: repeat(3, 44px);
    grid-template-rows: repeat(2, 44px);
    gap: 6px;
}

.touch-btn {
    background: #042f1a;
    border: 2px solid #10b981;
    border-radius: 6px;
    color: #34d399;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    cursor: pointer;
}

.touch-btn:active {
    background: #10b981;
    color: #000000;
}

.touch-fire {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #7f1d1d;
    border: 3px solid #ef4444;
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    cursor: pointer;
}

.touch-fire:active {
    background: #ef4444;
}

@media (max-width: 840px) {
    .canvas-container {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
    }
    .touch-controls {
        display: flex;
    }
}
