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

body {
    font-family: 'Orbitron', monospace;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    max-width: 800px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 30px;
    text-align: center;
}

.game-header {
    margin-bottom: 30px;
}

.game-header h1 {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(45deg, #00ff88, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 255, 136, 0.3);
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.stat {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.stat .label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-right: 10px;
}

.stat .value {
    font-size: 1.2rem;
    font-weight: 700;
    color: #00ff88;
}

.game-area {
    position: relative;
    margin: 30px auto;
    display: inline-block;
}

#game-canvas {
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 15px;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3a 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.game-over-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 40px;
    border-radius: 15px;
    border: 2px solid #ff4757;
    display: none;
    text-align: center;
    backdrop-filter: blur(10px);
}

.game-over-screen h2 {
    color: #ff4757;
    font-size: 2rem;
    margin-bottom: 20px;
    animation: pulse 1s infinite;
}

.game-over-screen p {
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.restart-btn {
    background: linear-gradient(45deg, #ff4757, #ff3742);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    transition: all 0.3s ease;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
}

.controls {
    margin: 20px 0;
}

.mobile-controls {
    display: none;
    margin-bottom: 20px;
}

.control-row {
    display: flex;
    justify-content: center;
    margin: 5px 0;
}

.control-btn {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    margin: 5px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #00ff88;
    transform: scale(1.1);
}

.control-btn:active {
    transform: scale(0.95);
}

.keyboard-hint {
    opacity: 0.8;
}

.keyboard-hint p {
    margin-bottom: 10px;
}

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

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

.key {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.game-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.game-btn {
    padding: 12px 24px;
    font-size: 1rem;
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.start-btn {
    background: linear-gradient(45deg, #00ff88, #00d4aa);
    color: #000;
}

.pause-btn {
    background: linear-gradient(45deg, #ffa726, #ff9800);
    color: #000;
}

.reset-btn {
    background: linear-gradient(45deg, #ff4757, #ff3742);
    color: #fff;
}

.clear-cache-btn {
    background: linear-gradient(45deg, #747d8c, #57606f);
    color: #fff;
    font-size: 0.9rem;
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.game-btn:active {
    transform: translateY(0);
}

.instructions {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    margin-top: 30px;
    text-align: left;
}

.instructions h3 {
    color: #00ff88;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.3rem;
}

.instructions ul {
    list-style: none;
    padding-left: 0;
}

.instructions li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    padding-left: 20px;
}

.instructions li:before {
    content: "▸";
    color: #00ff88;
    position: absolute;
    left: 0;
}

.instructions li:last-child {
    border-bottom: none;
}

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

@media (max-width: 768px) {
    .game-container {
        padding: 20px;
    }
    
    .game-header h1 {
        font-size: 2.5rem;
    }
    
    #game-canvas {
        width: 100%;
        height: auto;
        max-width: 400px;
    }
    
    .mobile-controls {
        display: block;
    }
    
    .keyboard-hint {
        display: none;
    }
    
    .game-stats {
        gap: 15px;
    }
    
    .stat {
        padding: 8px 15px;
    }
    
    .game-buttons {
        gap: 10px;
    }
    
    .game-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .game-container {
        padding: 15px;
    }
    
    .game-header h1 {
        font-size: 2rem;
    }
    
    .game-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    #game-canvas {
        max-width: 300px;
    }
}
