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

body {
    background-color: #05050d;
    color: #ffffff;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.arcade-cabinet {
    background-color: #101020;
    border: 4px solid #ff0077;
    box-shadow: 0 0 25px rgba(255, 0, 119, 0.4), inset 0 0 15px rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    padding: 20px;
    max-width: 760px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.arcade-header {
    width: 100%;
    text-align: center;
    margin-bottom: 15px;
}

.game-title {
    font-size: 36px;
    font-weight: 900;
    letter-spacing: 4px;
    color: #ffaa00;
    text-shadow: 0 0 10px #ffaa00, 3px 3px 0 #ff0077;
    margin-bottom: 10px;
}

.hud {
    display: flex;
    justify-content: space-around;
    background: #000000;
    border: 2px solid #00f0ff;
    padding: 8px 15px;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

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

.hud-label {
    font-size: 11px;
    color: #00f0ff;
    letter-spacing: 1px;
}

.hud-value {
    font-size: 20px;
    font-weight: bold;
    color: #ffff00;
    text-shadow: 0 0 5px #ffff00;
}

.canvas-container {
    position: relative;
    width: 700px;
    height: 600px;
    margin: 10px 0;
    background-color: #000000;
    border: 3px solid #333366;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.9);
}

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

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10;
}

.overlay.hidden {
    display: none;
}

.overlay-title {
    font-size: 38px;
    font-weight: bold;
    color: #ff0077;
    text-shadow: 0 0 15px #ff0077;
    margin-bottom: 15px;
}

.overlay-subtitle {
    font-size: 16px;
    color: #00ffff;
    letter-spacing: 2px;
    animation: blink 1s infinite alternate;
}

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

.controls-panel {
    width: 100%;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.controls-legend {
    text-align: center;
    font-size: 12px;
    color: #aaaaff;
    line-height: 1.5;
}

.key-group strong {
    color: #ffff00;
}

.dpad-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    max-width: 400px;
}

.dpad-btn {
    background: #1a1a38;
    color: #00ffff;
    border: 2px solid #00f0ff;
    border-radius: 6px;
    padding: 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
    transition: all 0.1s ease;
    user-select: none;
}

.dpad-btn:active, .dpad-btn.active {
    background: #00f0ff;
    color: #000000;
    box-shadow: 0 0 15px #00f0ff;
    transform: scale(0.96);
}

@media (max-width: 740px) {
    .canvas-container {
        width: 100%;
        height: auto;
        aspect-ratio: 7 / 6;
    }
    
    .game-title {
        font-size: 28px;
    }

    .hud-value {
        font-size: 16px;
    }
}