@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

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

body {
    font-family: 'Press Start 2P', 'Courier New', monospace;
    background: #0a0e27;
    color: #00ff88;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.08),
        rgba(0, 0, 0, 0.08) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 1000;
}

.container {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.hud {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 800px;
    text-align: center;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.label {
    font-size: 12px;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
    letter-spacing: 2px;
}

.value {
    font-size: 24px;
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff, 0 0 20px #ff00ff;
}

#gameCanvas {
    background: linear-gradient(180deg, #1a1f3a 0%, #0f1628 100%);
    border: 3px solid #00ff88;
    box-shadow: 0 0 20px #00ff88, inset 0 0 20px rgba(0, 255, 136, 0.1);
    display: block;
    max-width: 100%;
    max-height: 70vh;
    aspect-ratio: 800 / 600;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

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

.overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    animation: pulse 1s infinite;
}

.overlay-content h1 {
    font-size: 48px;
    color: #00ff88;
    text-shadow: 0 0 20px #00ff88, 0 0 40px #00ffff;
    margin-bottom: 30px;
    letter-spacing: 3px;
    font-weight: bold;
    text-align: center;
    word-wrap: break-word;
}

.overlay-content p {
    font-size: 16px;
    color: #ffff00;
    text-shadow: 0 0 10px #ffff00;
    margin-top: 30px;
    letter-spacing: 1px;
}

.score-display {
    font-size: 20px;
    color: #ff00ff;
    text-shadow: 0 0 15px #ff00ff;
    margin: 20px 0;
    line-height: 1.8;
    letter-spacing: 2px;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@media (max-width: 1024px) {
    .hud {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        margin-bottom: 20px;
    }

    .label {
        font-size: 10px;
    }

    .value {
        font-size: 18px;
    }

    #gameCanvas {
        border-width: 2px;
    }
}

@media (max-width: 600px) {
    .hud {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin-bottom: 15px;
    }

    .label {
        font-size: 8px;
    }

    .value {
        font-size: 14px;
    }

    .overlay-content h1 {
        font-size: 32px;
        margin-bottom: 20px;
    }

    .overlay-content p {
        font-size: 12px;
    }

    #gameCanvas {
        border-width: 2px;
    }
}
