/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    min-height: 100vh;
    overflow-x: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px 0;
}

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1rem;
    color: #b0b0b0;
    font-weight: 300;
}

/* Controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn.primary {
    background: linear-gradient(45deg, #00ff88, #00cc6a);
    border: none;
    color: #000000;
    font-weight: 600;
}

.btn.primary:hover {
    background: linear-gradient(45deg, #00cc6a, #00aa55);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.4);
}

/* Sliders */
.slider {
    width: 100px;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00ff88;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00ff88;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

label {
    color: #b0b0b0;
    font-size: 0.9rem;
    min-width: 80px;
}

#speedValue, #sizeValue {
    color: #00ff88;
    font-weight: 600;
    min-width: 25px;
    text-align: center;
}

/* Game Container */
.game-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#gameCanvas {
    border: 2px solid #00ff88;
    border-radius: 10px;
    background: #000000;
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.2);
    cursor: crosshair;
}

/* Info Section */
.info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.stats {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 5px 0;
}

.stat-label {
    color: #b0b0b0;
}

.stat-value {
    color: #00ff88;
    font-weight: 600;
}

#generation, #livingCells {
    color: #00ff88;
    font-weight: 600;
}

.rules {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.rules h3 {
    color: #00ff88;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.rules ul {
    list-style: none;
    margin-bottom: 15px;
}

.rules li {
    margin-bottom: 8px;
    padding-left: 15px;
    position: relative;
    color: #d0d0d0;
    font-size: 0.9rem;
}

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

.tip {
    color: #b0b0b0;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 15px;
    padding: 10px;
    background: rgba(0, 255, 136, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 136, 0.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .control-group {
        justify-content: center;
    }
    
    .info {
        grid-template-columns: 1fr;
    }
    
    #gameCanvas {
        max-width: 100%;
        height: auto;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .slider {
        width: 80px;
    }
} 