@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: 'VT323', 'Courier New', monospace;
    color: #0f0;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    font-size: 20px;
}

#gameContainer {
    text-align: center;
    position: relative;
}

#gameContainer.fullscreen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
}

#gameContainer.fullscreen canvas {
    width: auto;
    height: 80vh;
    max-width: 90vw;
}

#startScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#startScreen h1 {
    font-family: 'VT323', monospace;
    font-size: 72px;
    margin-bottom: 20px;
    color: #0f0;
    text-shadow: 0 0 20px #0f0;
    animation: pulse 2s infinite;
    letter-spacing: 4px;
}

.copyright-text {
    font-family: 'VT323', monospace;
    font-size: 24px;
    color: #0f0;
    margin-top: 30px;
    letter-spacing: 2px;
    opacity: 0.8;
    text-shadow: 0 0 5px #0f0;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

#startButton {
    background: #000;
    color: #0f0;
    border: 3px solid #0f0;
    padding: 20px 40px;
    font-size: 28px;
    font-family: 'VT323', monospace;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#startButton:hover {
    background: #0f0;
    color: #000;
    box-shadow: 0 0 30px #0f0;
    transform: scale(1.1);
}

#gameInfo {
    margin-bottom: 10px;
    font-family: 'VT323', monospace;
    font-size: 28px;
    color: #0f0;
    text-shadow: 0 0 5px #0f0;
    letter-spacing: 2px;
    background: #000;
    padding: 5px;
}

canvas {
    border: 2px solid #0f0;
    box-shadow: 0 0 20px #0f0;
    display: block;
    background: #000;
    touch-action: none; /* Prevent default touch behaviors */
}

/* Game wrapper for touch controls */
#gameWrapper {
    position: relative;
    display: inline-block;
}

/* Touch control overlay */
.touch-controls {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: none; /* Hidden by default */
}

/* Show when has-touch class is added */
.touch-controls.has-touch {
    display: flex;
}

.touch-zone {
    flex: 1;
    position: relative;
    pointer-events: auto;
}

.touch-left {
    border-right: 2px dashed rgba(0, 255, 0, 0.2);
}

.touch-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: rgba(0, 255, 0, 0.3);
    font-family: 'VT323', monospace;
    pointer-events: none;
    user-select: none;
}

.touch-indicator span {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.touch-indicator p {
    font-size: 18px;
    opacity: 0.7;
}

/* Responsive design for tablets and mobile */
@media (max-width: 1366px) {
    canvas {
        width: 100%;
        height: auto;
        max-width: 1000px;
    }
    
    #controls {
        font-size: 16px;
    }
    
    #gameInfo {
        font-size: 24px;
    }
}

#controls {
    margin-top: 10px;
    font-family: 'VT323', monospace;
    font-size: 20px;
    color: #0f0;
    letter-spacing: 1px;
    background: #000;
    padding: 5px;
    text-shadow: 0 0 3px #0f0;
}

.hidden {
    display: none !important;
}

#fullscreenBtn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #000;
    color: #0f0;
    border: 2px solid #0f0;
    padding: 10px 20px;
    font-family: 'VT323', monospace;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 50;
    font-size: 20px;
    letter-spacing: 1px;
    text-shadow: 0 0 3px #0f0;
}

#fullscreenBtn:hover {
    background: #0f0;
    color: #000;
    box-shadow: 0 0 15px #0f0;
}

#menuBtn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #000;
    color: #0f0;
    border: 2px solid #0f0;
    padding: 10px 20px;
    font-family: 'VT323', monospace;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 50;
    font-size: 20px;
    letter-spacing: 1px;
    text-shadow: 0 0 3px #0f0;
}

#menuBtn:hover {
    background: #0f0;
    color: #000;
    box-shadow: 0 0 15px #0f0;
}

.difficulty-selector {
    margin: 20px 0;
}

.difficulty-btn {
    background: #000;
    color: #0f0;
    border: 2px solid #0f0;
    padding: 15px 30px;
    font-size: 24px;
    font-family: 'VT323', monospace;
    cursor: pointer;
    margin: 0 10px;
    transition: all 0.3s;
    letter-spacing: 2px;
}

.difficulty-btn:hover {
    background: #0f0;
    color: #000;
    box-shadow: 0 0 20px #0f0;
}

.difficulty-btn.selected {
    background: #0f0;
    color: #000;
}

#highScoreScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#highScoreScreen h2 {
    font-size: 36px;
    margin-bottom: 30px;
    color: #0f0;
    text-shadow: 0 0 10px #0f0;
    letter-spacing: 3px;
}

.score-entry {
    margin: 20px 0;
}

.score-entry input {
    background: #000;
    color: #0f0;
    border: 2px solid #0f0;
    padding: 10px;
    font-size: 24px;
    font-family: 'Courier New', monospace;
    width: 100px;
    text-align: center;
    text-transform: uppercase;
}

.retro-text {
    font-family: 'VT323', monospace;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 2px 2px 0px rgba(0, 255, 0, 0.3);
}