:root {
    --primary-color: #4a90e2;
    --secondary-color: #f5f5f5;
    --border-color: #ddd;
    --grid-border-color: #333;
    --text-color: #333;
    --cell-size: 50px;
    --animation-duration: 20s;
}

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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG var(--animation-duration) ease infinite;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255,255,255,0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: float 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0);
    }
    50% {
        transform: translate(10px, 10px);
    }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin-top: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    animation: titleFloat 3s ease-in-out infinite;
}

@keyframes titleFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.controls {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    margin: 0 10px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

button:hover {
    background-color: #357abd;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0,0,0,0.2);
}

button:active {
    transform: translateY(0);
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.sudoku-grid {
    display: grid;
    grid-template-columns: repeat(9, var(--cell-size));
    grid-template-rows: repeat(9, var(--cell-size));
    gap: 1px;
    background-color: var(--border-color);
    border: 3px solid var(--grid-border-color);
    margin-bottom: 20px;
    padding: 2px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.cell {
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    min-width: var(--cell-size);
    min-height: var(--cell-size);
    position: relative;
}

.cell:hover {
    background-color: #f0f8ff;
    transform: scale(1.05);
}

/* Add thicker borders for 3x3 sections */
.cell:nth-child(3n) {
    border-right: 2px solid var(--grid-border-color);
}

.cell:nth-child(9n) {
    border-right: none;
}

.cell:nth-child(n+19):nth-child(-n+27),
.cell:nth-child(n+46):nth-child(-n+54) {
    border-bottom: 2px solid var(--grid-border-color);
}

.cell input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: inherit;
    background: transparent;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.cell input:focus {
    outline: none;
    background-color: #e6f7ff;
    transform: scale(1.1);
}

.cell.fixed {
    background-color: #e8f4ff;
    font-weight: bold;
    color: #1a73e8;
    animation: popIn 0.5s ease-out;
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.cell.error {
    color: red;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.timer {
    font-size: 1.2em;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.highscores {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    backdrop-filter: blur(5px);
}

.highscores h2 {
    color: var(--primary-color);
    margin-bottom: 15px;
    text-align: center;
}

#highscoresList {
    display: grid;
    gap: 10px;
}

.highscore-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.highscore-item:hover {
    transform: translateX(5px);
    background-color: rgba(255, 255, 255, 0.95);
}

.number-palette {
    display: grid;
    grid-template-columns: repeat(9, var(--cell-size));
    gap: 5px;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.number {
    width: var(--cell-size);
    height: var(--cell-size);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #4a90e2;
    color: white;
    border-radius: 50%;
    font-size: 1.2em;
    cursor: move;
    transition: all 0.3s ease;
    user-select: none;
}

.number:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

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

.cell.drag-over {
    background-color: #e6f7ff;
    transform: scale(1.05);
}

.cell.drag-over::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px dashed #4a90e2;
    border-radius: 4px;
    animation: pulse 1s infinite;
}

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

@media (max-width: 600px) {
    :root {
        --cell-size: 35px;
    }
    
    .container {
        padding: 10px;
    }
    
    button {
        padding: 8px 15px;
        font-size: 0.9em;
    }
} 