* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

#game-container {
    position: relative;
    background: #000;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    text-align: center;
    color: white;
    padding: 2rem;
    max-width: 90%;
}

.overlay-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.overlay-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    color: #ff6b6b;
}

.overlay-content p {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.controls-info {
    margin-top: 2rem;
    text-align: left;
    display: inline-block;
}

.controls-info p {
    margin-bottom: 0.3rem;
    font-size: 1rem;
}

kbd {
    background: #333;
    border: 1px solid #555;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 0.9em;
    font-family: monospace;
}

.btn {
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4);
    border: none;
    color: white;
    padding: 12px 24px;
    margin: 8px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn:active {
    transform: translateY(0);
}

#start-btn {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    font-size: 1.3rem;
    padding: 15px 30px;
    margin: 1rem 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

#start-btn:hover {
    background: linear-gradient(45deg, #44a08d, #4ecdc4);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.score-display {
    margin: 1.5rem 0;
    font-size: 1.3rem;
}

.score-display p {
    margin-bottom: 0.5rem;
}

.mobile-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 5;
    display: none;
    transition: all 0.3s ease;
}

.mobile-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    #game-container {
        width: 100%;
        max-width: 500px;
        height: auto;
        aspect-ratio: 16/9;
    }
    
    .overlay-content h1 {
        font-size: 2rem;
    }
    
    .overlay-content h2 {
        font-size: 1.8rem;
    }
    
    .overlay-content p {
        font-size: 1rem;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    #start-btn {
        padding: 12px 24px;
        font-size: 1.1rem;
    }
    
    .mobile-btn {
        display: block;
    }
}

@media (max-width: 480px) {
    .overlay-content {
        padding: 1rem;
    }
    
    .overlay-content h1 {
        font-size: 1.5rem;
    }
    
    .overlay-content h2 {
        font-size: 1.3rem;
    }
    
    .controls-info {
        font-size: 0.9rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.9rem;
        margin: 4px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none;
    }
    
    .mobile-btn:hover {
        transform: none;
    }
}
