/**
 * Project: RSK World Sudoku Game
 * Developer: Molla Samser (Founder - RSK World)
 * Website: https://rskworld.in
 * Email: help@rskworld.in | support@rskworld.in
 * Phone: +91 93305 39277
 * Address: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147
 * Copyright © 2026 RSK World. All rights reserved.
 */

:root {
    --primary-color: #6a5acd;
    --secondary-color: #a0d2eb;
    --background-color: #f4f4f4;
    --text-color: #333;
}

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

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    touch-action: manipulation;
    overscroll-behavior: contain;
}

.sudoku-game {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    perspective: 1000px;
}

.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 2px;
    max-width: 500px;
    margin: 0 auto;
    background-color: white;
    border: 3px solid var(--primary-color);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transform: rotateX(10deg);
    transition: all 0.5s ease;
}

.sudoku-cell {
    width: 100%;
    aspect-ratio: 1/1;
    border: 1px solid #ddd;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    font-weight: bold;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sudoku-cell::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sudoku-cell:hover::before {
    opacity: 1;
}

.sudoku-cell.pre-filled {
    background-color: #f0f0f0;
    cursor: not-allowed;
    color: #666;
}

.sudoku-cell.selected {
    background-color: var(--secondary-color);
    border: 2px solid var(--primary-color);
    transform: scale(1.05);
    z-index: 10;
}

.solved-cell {
    animation: solve-cell-reveal 0.5s ease;
    background-color: rgba(0, 255, 0, 0.1);
    color: #28a745;
    font-weight: bold;
}

@keyframes solve-cell-reveal {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.hint-cell {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    font-weight: bold;
    animation: hint-pulse 1s ease-in-out infinite;
}

@keyframes hint-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.number-pad {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.number-button {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.number-button:hover {
    background-color: #8a7ce0;
    transform: scale(1.1);
}

.game-controls .btn {
    margin: 0 5px;
    transition: all 0.3s ease;
}

.game-controls .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.top-nav-buttons .btn {
    background-color: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #007bff;
    transition: all 0.3s ease;
}

.top-nav-buttons .btn:hover {
    background-color: rgba(0, 123, 255, 0.1);
    transform: scale(1.1);
}

.top-nav-buttons .btn i {
    font-size: 1.2rem;
}

#error-display {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1050;
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px;
    text-align: center;
    animation: slideDown 0.5s ease;
    display: none;
}

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

#hint-game {
    transition: all 0.3s ease;
}

#hint-game:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#solve-game:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .sudoku-cell {
        font-size: 1rem;
    }

    .number-pad {
        gap: 5px;
    }

    .number-button {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse-animation {
    animation: pulse 1s infinite;
}

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

.slide-in {
    animation: slideIn 0.5s ease forwards;
}

@keyframes solve-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.solved-animation {
    animation: solve-pulse 1s infinite;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

#game-feedback .alert {
    margin: 10px auto;
    max-width: 600px;
    animation: slideIn 0.5s ease;
}

.error-cell {
    background-color: rgba(255, 0, 0, 0.1);
    border: 2px solid red;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

@keyframes level-up {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.level-up-animation {
    animation: level-up 1s ease-in-out;
}