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

body {
    font-family: 'Press Start 2P', cursive;
    background: #0a0a0a;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100vh;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

#gameCanvas {
    background: #000;
    border: 3px solid #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5), inset 0 0 20px rgba(0, 255, 0, 0.1);
    border-radius: 8px;
    max-width: 100%;
    max-height: 70vh;
}

#ui-layer {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 460px;
    z-index: 10;
}

#score-board {
    display: flex;
    justify-content: space-between;
    color: #00ff00;
    font-size: clamp(8px, 2.5vw, 12px);
    text-shadow: 0 0 10px #00ff00;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #00ff00;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 20;
    text-align: center;
    padding: 20px;
}

.screen.hidden {
    display: none;
}

.screen h1 {
    font-size: clamp(24px, 8vw, 48px);
    color: #00ff00;
    text-shadow: 0 0 20px #00ff00, 0 0 40px #00ff00;
    margin-bottom: 30px;
    letter-spacing: 4px;
}

.screen p {
    font-size: clamp(10px, 3vw, 14px);
    color: #fff;
    margin: 10px 0;
}

.blink {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.controls-info {
    margin-top: 30px;
    color: #888 !important;
    font-size: clamp(8px, 2vw, 10px) !important;
    line-height: 2;
}

#mobile-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 400px;
    padding: 0 20px;
}

.d-pad {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.d-pad-row {
    display: flex;
    gap: 5px;
}

.mobile-btn {
    width: clamp(50px, 15vw, 70px);
    height: clamp(50px, 15vw, 70px);
    background: rgba(0, 255, 0, 0.2);
    border: 2px solid #00ff00;
    border-radius: 10px;
    color: #00ff00;
    font-size: clamp(16px, 5vw, 24px);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.1s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

.mobile-btn:active {
    background: rgba(0, 255, 0, 0.5);
    transform: scale(0.95);
}

@media (min-width: 768px) {
    #mobile-controls {
        display: none;
    }
}

@media (max-width: 400px) {
    #gameCanvas {
        border-width: 2px;
    }
    
    #score-board {
        font-size: 8px;
        padding: 6px 8px;
    }
}
