body {
    background: linear-gradient(135deg, #F8FAFC 0%, #FFFFFF 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    /* font-family: 'Cairo', sans-serif; */
}

.game-container {
    text-align: center;
    max-width: 600px;
    width: 100%;
    animation: fadeIn 0.6s ease;
    margin-top: 75px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.game-header {
    margin-bottom: 40px;
}

.game-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #DBAD2B, #F5D876);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 2rem;
    box-shadow: 0 15px 40px rgba(219, 173, 43, 0.3);
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.game-header h1 {
    font-size: 2rem;
    font-weight: 900;
    color: #1e293b;
    margin-bottom: 10px;
}

.game-header p {
    font-size: 1.2rem;
    color: #64748b;
}

/* Turn Indicator */
.turn-indicator {
    background: white;
    border-radius: 20px;
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    border: 2px solid rgba(219, 173, 43, 0.1);
}

.turn-text {
    font-size: 1rem;
    font-weight: 900;
    color: #1e293b;
}

.current-player {
    font-size: 1.7rem;
    font-weight: 900;
    padding: 0px 15px;
    border-radius: 15px;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.current-player.x {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
}

.current-player.o {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
}

/* Board */
.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
    background: white;
    padding: 20px;
    border-radius: 25px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
    border: 3px solid rgba(219, 173, 43, 0.2);
}

.cell {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #F8FAFC, #FFFFFF);
    border: 3px solid rgba(219, 173, 43, 0.2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.cell::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(219, 173, 43, 0.1), rgba(245, 216, 118, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.cell:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(219, 173, 43, 0.3);
    border-color: #DBAD2B;
}

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

.cell.taken:hover {
    transform: none;
}

.cell.x {
    color: #EF4444;
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.cell.o {
    color: #10B981;
    animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes popIn {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.cell.winning {
    background: linear-gradient(135deg, #DBAD2B, #F5D876);
    animation: winPulse 0.6s ease-in-out infinite;
}

@keyframes winPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 10px 30px rgba(219, 173, 43, 0.5);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 40px rgba(219, 173, 43, 0.7);
    }
}

/* Buttons */
.game-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-game {
    padding: 18px 40px;
    border: none;
    border-radius: 50px;
    font-size: 1.2rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-reset {
    background: linear-gradient(135deg, #DBAD2B, #F5D876);
    color: white;
    box-shadow: 0 10px 30px rgba(219, 173, 43, 0.3);
}

.btn-reset:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(219, 173, 43, 0.4);
}

.btn-back {
    background: white;
    color: #64748b;
    border: 2px solid rgba(219, 173, 43, 0.2);
}

.btn-back:hover {
    background: #F8FAFC;
    border-color: #DBAD2B;
    color: #DBAD2B;
}

/* Winner Modal */
.winner-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.winner-modal.show {
    display: flex;
}

.winner-content {
    background: white;
    border-radius: 30px;
    padding: 50px 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    animation: zoomIn 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.winner-icon {
    font-size: 8rem;
    margin-bottom: 20px;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.winner-content h2 {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 15px;
    color: #1e293b;
}

.winner-name {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 30px;
    padding: 15px 30px;
    border-radius: 20px;
    display: inline-block;
}

.winner-name.x {
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
}

.winner-name.o {
    background: linear-gradient(135deg, #10B981, #059669);
    color: white;
}

.winner-name.draw {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
}

.btn-play-again {
    background: linear-gradient(135deg, #DBAD2B, #F5D876);
    color: white;
    padding: 18px 50px;
    border: none;
    border-radius: 50px;
    font-size: 1.3rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(219, 173, 43, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-play-again:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(219, 173, 43, 0.4);
}

/* Score Board */
.score-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.score-item {
    background: white;
    border-radius: 15px;
    padding: 5px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border: 2px solid rgba(219, 173, 43, 0.1);
}

.score-label {
    font-size: 1rem;
    color: #64748b;
    font-weight: 700;
    margin-bottom: 8px;
}

.score-value {
    font-size: 2.5rem;
    font-weight: 900;
}

.score-item.x .score-value {
    color: #EF4444;
}

.score-item.o .score-value {
    color: #10B981;
}

.score-item.draw .score-value {
    color: #F59E0B;
}

/* Responsive */
@media (max-width: 768px) {
    .game-header h1 {
        font-size: 2.2rem;
    }

    .cell {
        font-size: 3rem;
    }

    .winner-icon {
        font-size: 6rem;
    }

    .winner-content h2 {
        font-size: 2rem;
    }

    .winner-name {
        font-size: 1.5rem;
    }
    .btn-play-again{
        padding: 10px 19px;
        font-size: 1rem;
    }
}
