@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

body {
    background-color: #050a05;
    color: #00ff66;
    font-family: 'Press+Start+2P', monospace, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: relative;
    margin: 0;
    padding: 10px;
}

.crt-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at center, rgba(0,255,102,0.05) 0%, rgba(0,0,0,0.85) 90%);
    pointer-events: none;
    z-index: 100;
}

.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 101;
}

.game-container {
    width: 100%;
    max-width: min(650px, 98vw);
    max-height: 98vh;
    background: #0a140a;
    border: 4px solid #00ff66;
    box-shadow: 0 0 35px rgba(0, 255, 102, 0.4), inset 0 0 20px rgba(0, 255, 102, 0.2);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.game-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 11px;
}

.title {
    font-size: 15px;
    text-shadow: 0 0 10px #00ff66;
    letter-spacing: 1px;
}

.status-bar {
    font-size: 10px;
    color: #88ffbb;
    margin-bottom: 10px;
    text-transform: uppercase;
    text-align: center;
}

.viewport-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 500px; 
    border: 3px solid #00ff66;
    background: #020502;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
}

.overlay-screen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(2, 5, 2, 0.92);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 25px;
    z-index: 10;
}

.overlay-screen.hidden {
    display: none;
}

.overlay-screen h2 {
    font-size: 20px;
    margin-bottom: 16px;
    color: #00ff66;
    text-shadow: 0 0 12px #00ff66;
}

.overlay-screen p {
    font-size: 10px;
    line-height: 1.8;
    color: #aaffcc;
    margin-bottom: 24px;
}

.touch-controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 12px;
    gap: 6px;
}

.control-row {
    display: flex;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.control-btn {
    font-family: 'Press+Start+2P', monospace;
    background: #0b2614;
    color: #00ff66;
    border: 2px solid #00ff66;
    width: 75px;
    height: 54px;
    font-size: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0,255,102,0.3);
    border-radius: 8px;
}

.control-btn:active {
    background: #00ff66;
    color: #050a05;
    transform: scale(0.95);
}

button {
    font-family: 'Press+Start+2P', monospace;
    background: #00ff66;
    color: #050a05;
    border: none;
    padding: 12px 24px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 0 12px rgba(0,255,102,0.6);
    transition: transform 0.1s, background 0.1s;
    border-radius: 4px;
}

button:active {
    transform: scale(0.95);
    background: #00cc52;
}

.game-footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: 8px;
}

.sound-btn {
    background: transparent;
    color: #00ff66;
    border: 1px solid #00ff66;
    padding: 6px 10px;
    font-size: 8px;
    box-shadow: none;
}