:root{
    --cell-size: 150px;
    --cell-gap: 10px;
    --board-padding: 10px;
}

body {
    font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, 
        #667eea 0%, 
        #764ba2 15%, 
        #f093fb 30%, 
        #4facfe 45%, 
        #43e97b 60%, 
        #fa709a 75%, 
        #fee140 90%, 
        #667eea 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

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

h1 {
    color: #ffffff;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-size: 2.5em;
}

.game-container {
    text-align: center;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, var(--cell-size));
    grid-template-rows: repeat(3, var(--cell-size));
    gap: var(--cell-gap);
    margin: 28px auto;
    background-color: rgba(255, 255, 255, 0.2);
    padding: var(--board-padding);
    border-radius: 14px;
    width: fit-content;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.cell {
    background-color: rgba(255, 255, 255, 0.95);
    border: none;
    font-size: 3.5rem;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    color: #333;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cell:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 1);
    transform: scale(1.05);
}

.cell:disabled {
    cursor: not-allowed;
}

.status {
    font-size: 1.6rem;
    margin: 20px 0;
    color: #ffffff;
    min-height: 40px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.reset-btn {
    padding: 10px 30px;
    font-size: 1rem;
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
    border: 2px solid white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.reset-btn:hover {
    background-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.winner {
    color: #ffeb3b;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

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

.score {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 36px;
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 8px;
    min-width: 120px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.player-label {
    font-size: 1em;
    color: #ffffff;
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.score-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes glow {
    0%, 100% {
        background-color: #ff6b6b;
        box-shadow: 0 0 10px #ff6b6b, 0 0 20px #ff6b6b, 0 0 30px #ff6b6b;
        transform: scale(1);
    }
    50% {
        background-color: #ffd93d;
        box-shadow: 0 0 15px #ffd93d, 0 0 30px #ffd93d, 0 0 45px #ffd93d;
        transform: scale(1.05);
    }
}

.winning-cell {
    animation: glow 1s ease-in-out infinite;
    color: #fff !important;
}

.glitter {
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    animation: sparkle 1.5s ease-out forwards;
    box-shadow: 0 0 10px white;
}

@keyframes sparkle {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0) rotate(360deg);
    }
}
