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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

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

.game-header h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.game-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.game-stats > div {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#game-canvas {
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    background: #1a1a1a;
    margin: 20px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.game-controls {
    display: grid;
    grid-template-columns: 1fr 1fr 200px;
    align-items: flex-start;
    margin-top: 20px;
    gap: 20px;
}

.instructions {
    flex: 1;
    text-align: left;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.instructions h3 {
    margin-bottom: 10px;
    color: #ffd700;
}

.instructions p {
    margin: 5px 0;
    font-size: 0.9em;
}

.game-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn.primary {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.btn.primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

.btn.secondary {
    background: linear-gradient(45deg, #74b9ff, #0984e3);
    color: white;
    box-shadow: 0 4px 15px rgba(116, 185, 255, 0.4);
}

.btn.secondary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(116, 185, 255, 0.6);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.game-over {
    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 #ffd700;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.game-over h2 {
    color: #ffd700;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.final-stats {
    margin: 20px 0;
    font-size: 1.2em;
}

.final-stats p {
    margin: 8px 0;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.game-settings {
    text-align: left;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.game-settings h3 {
    margin-bottom: 15px;
    color: #ffd700;
    font-size: 1.1em;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item:last-child {
    margin-bottom: 0;
}

.setting-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.9em;
}

#speed-slider {
    width: 100%;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
}

#speed-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffd700;
    cursor: pointer;
}

#speed-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffd700;
    cursor: pointer;
    border: none;
}

#speed-value {
    font-size: 0.8em;
    color: #ffd700;
    font-weight: bold;
}

#difficulty-select {
    width: 100%;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9em;
}

#difficulty-select option {
    background: #2a2a2a;
    color: white;
}

@media (max-width: 768px) {
    .game-container {
        padding: 15px;
        margin: 10px;
    }
    
    #game-canvas {
        width: 100%;
        max-width: 100%;
        height: auto;
    }
    
    .game-controls {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .game-stats {
        flex-direction: column;
        gap: 10px;
    }
}