/* Lights Out Game Styles */
.game-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

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

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

.header-content h1 {
    color: #2d3748;
    margin-bottom: 10px;
}

.game-subtitle {
    color: #4a5568;
    font-size: 16px;
    margin-bottom: 0;
}

.game-controls {
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

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

.control-group label {
    font-weight: 600;
    color: #2d3748;
}

select {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    transition: all 0.2s ease;
}

select:focus {
    outline: none;
    border-color: #4299e1;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

/* Game Instructions */
.game-instructions {
    margin: 20px 0;
}

.instructions-toggle {
    text-align: center;
    margin-bottom: 15px;
}

.instructions-button {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.instructions-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(66, 153, 225, 0.4);
}

.instructions-content {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    margin-top: 15px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.instructions-grid {
    display: grid;
    gap: 15px;
    text-align: left;
}

.instruction-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.instruction-icon {
    font-size: 20px;
    min-width: 24px;
}

.instruction-item strong {
    color: #2d3748;
}

.game-board {
    display: inline-block;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.grid {
    display: grid;
    gap: 8px;
    margin: 0 auto;
}

.grid.size-3 { 
    grid-template-columns: repeat(3, 1fr); 
}

.grid.size-4 { 
    grid-template-columns: repeat(4, 1fr); 
}

.grid.size-5 { 
    grid-template-columns: repeat(5, 1fr); 
}

.lights {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    border: 3px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

.lights::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.lights:hover::before {
    transform: translateX(100%);
}

.lights.on {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #92400e;
    border-color: #d97706;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.lights.off {
    background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    color: #9ca3af;
    border-color: #4b5563;
}

.lights:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.lights:active {
    transform: scale(0.95);
}

.game-stats {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    flex-wrap: wrap;
    gap: 20px;
}

.stat-item {
    background: white;
    padding: 15px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    min-width: 120px;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #1f2937;
}

.game-message {
    margin: 20px 0;
    padding: 15px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.game-message.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 2px solid #10b981;
}

.game-message.info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 2px solid #3b82f6;
}

.game-message.hidden {
    opacity: 0;
    transform: translateY(-10px);
}

.achievement {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    border: 2px solid #6366f1;
    color: #3730a3;
    padding: 15px;
    border-radius: 12px;
    margin: 10px 0;
    font-weight: 600;
    animation: slideInUp 0.5s ease;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

@media (max-width: 600px) {
    .game-container {
        padding: 10px;
    }

    .lights {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .game-controls {
        flex-direction: column;
        gap: 15px;
    }

    .control-group {
        justify-content: center;
    }

    .game-stats {
        justify-content: center;
    }

    .stat-item {
        min-width: 100px;
        padding: 10px 15px;
    }

    .button-group {
        flex-direction: column;
        align-items: center;
    }

    .button-group .button {
        width: 200px;
    }

    .instructions-grid {
        grid-template-columns: 1fr;
    }

    .instruction-item {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.celebrate {
    animation: celebrate 0.6s ease;
}

@keyframes celebrate {
    0%, 100% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.1); 
    }
}

.pulse {
    animation: pulse 1s infinite;
}

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