@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700;900&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #000000;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    overflow: auto; /* Allow scrolling on small screens */
    font-weight: 400;
    letter-spacing: -0.02em;
    padding: 20px;
}

/* Subtle grid pattern like this.nl */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 1;
}

.arcade-cabinet {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 40px;
    position: relative;
    z-index: 2;
    max-width: 100%;
    width: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-header {
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 20px;
    width: 100%;
    max-width: 800px;
}

.game-header h1 {
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.game-header h1::before {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    background: url('This-triangle-black.svg') no-repeat center;
    background-size: contain;
    filter: invert(1);
}

.score-board {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.7;
}

.score-board div {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.score span, .hi-score span, .lives span {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.1em;
    opacity: 1;
}

#gameCanvas {
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
    background: #000000;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    margin: 0 auto 30px;
    max-width: 100%;
    height: auto;
}

.game-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 10;
    pointer-events: none;
}

.start-screen, .game-over {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 60px 80px;
    min-width: 500px;
    backdrop-filter: blur(20px);
    background: rgba(0, 0, 0, 0.95);
}

.start-screen h2, .game-over h2 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 30px;
    letter-spacing: -0.03em;
}

.blink {
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 40px 0;
    opacity: 0.8;
    animation: subtle-blink 2s ease-in-out infinite;
}

@keyframes subtle-blink {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 0.3;
    }
}

.instructions {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.instructions p {
    font-size: 0.875rem;
    margin: 12px 0;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    letter-spacing: 0.02em;
}

.instructions p::before {
    content: '→ ';
    margin-right: 10px;
    opacity: 0.5;
}

.game-over p {
    font-size: 1rem;
    margin: 20px 0;
    font-weight: 400;
}

#finalScore {
    color: #ffffff;
    font-weight: 700;
    font-size: 1.5em;
}

/* Hover effects */
.start-screen:hover, .game-over:hover {
    border-color: rgba(255, 255, 255, 0.3);
    transition: border-color 0.3s ease;
}

/* Clean focus styles */
:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Mobile responsiveness */
@media (max-width: 900px) {
    body {
        padding: 10px;
    }

    .arcade-cabinet {
        padding: 15px;
    }

    .game-header h1 {
        font-size: 1.5rem;
    }

    .game-header h1::before {
        width: 25px;
        height: 25px;
    }

    .score-board {
        font-size: 0.7rem;
        gap: 8px;
    }

    .start-screen, .game-over {
        padding: 30px 20px;
        min-width: auto;
        width: 85vw;
        max-width: 400px;
    }
}

/* Small height screens */
@media (max-height: 700px) {
    .arcade-cabinet {
        padding: 20px;
    }

    .game-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .game-header h1 {
        font-size: 1.75rem;
        margin-bottom: 10px;
    }
}

/* Performance optimization */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}