
/* ============================================
   Tic-Tac-Toe Game Styles
   ============================================ */

.tictactoe-game {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.tictactoe-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.tictactoe-header h2 {
    font-size: 1.75rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-xs);
}

.tictactoe-instruction {
    font-size: 1rem;
    color: var(--color-text-dark);
    opacity: 0.8;
    margin: 0 0 var(--spacing-sm) 0;
}

.tictactoe-status {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-secondary);
    margin-top: var(--spacing-sm);
}

/* Tic-Tac-Toe Board */
.tictactoe-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
    max-width: 350px;
    margin: 0 auto var(--spacing-lg);
    padding: var(--spacing-md);
    background: linear-gradient(135deg, #FFFFFF, #F0F8F9);
    border-radius: 16px;
    box-shadow: 0 8px 24px var(--color-shadow-teal);
    border: 2px solid rgba(77, 184, 196, 0.3);
}

/* Cell */
.tictactoe-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 12px;
    font-size: 3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 200ms ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    user-select: none;
}

.tictactoe-cell:hover:not(.filled) {
    background: linear-gradient(135deg, rgba(77, 184, 196, 0.1), rgba(45, 138, 153, 0.1));
    transform: scale(1.05);
}

.tictactoe-cell:active:not(.filled) {
    transform: scale(0.95);
}

/* Filled cells */
.tictactoe-cell.filled {
    cursor: not-allowed;
    animation: cellPop 300ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cellPop {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
    }
}

/* X and O colors */
.tictactoe-cell.x {
    color: var(--color-primary);
}

.tictactoe-cell.o {
    color: var(--color-secondary);
}

/* Winner highlight */
.tictactoe-cell.winner {
    background: linear-gradient(135deg, rgba(26, 188, 156, 0.2), rgba(22, 160, 133, 0.2));
    animation: winnerPulse 800ms ease infinite;
}

@keyframes winnerPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(26, 188, 156, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 16px rgba(26, 188, 156, 0.6);
    }
}

/* Reset Button */
.tictactoe-reset {
    display: block;
    margin: 0 auto var(--spacing-lg);
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms ease;
    box-shadow: 0 4px 12px rgba(77, 184, 196, 0.3);
}

.tictactoe-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(77, 184, 196, 0.4);
}

.tictactoe-reset:active {
    transform: translateY(0);
}

/* Success Message */
.tictactoe-success {
    text-align: center;
    padding: var(--spacing-lg);
    background: rgba(26, 188, 156, 0.1);
    border-radius: 16px;
    margin-top: var(--spacing-md);
    opacity: 1;
    transform: scale(1);
    transition: all 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tictactoe-success.hidden {
    opacity: 0;
    transform: scale(0.8);
    display: none;
}

.tictactoe-success h3 {
    font-size: 1.5rem;
    color: var(--color-secondary);
    margin-bottom: var(--spacing-md);
}

.success-text {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--color-text-dark);
}

/* Responsive */
@media (max-width: 768px) {
    .tictactoe-board {
        max-width: 300px;
        gap: 8px;
    }
    
    .tictactoe-cell {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .tictactoe-board {
        max-width: 280px;
    }
    
    .tictactoe-cell {
        font-size: 2rem;
    }
}
