/* Tic Tac Toe — page-specific styles */

.ttt-stage {
    max-width: 480px;
    margin: 0 auto 4rem;
    padding: 2rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    text-align: center;
}
.ttt-stage::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--grad-start), var(--grad-end));
}

.ttt-status {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--bg-soft);
    border-radius: 12px;
    color: var(--text);
}
.ttt-status.x { color: var(--grad-start); }
.ttt-status.o { color: var(--grad-end); }

.ttt-scores {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.ttt-score {
    background: var(--bg-soft);
    padding: 0.7rem;
    border-radius: 12px;
    border-top: 3px solid;
}
.ttt-score.x    { border-color: var(--grad-start); }
.ttt-score.o    { border-color: var(--grad-end); }
.ttt-score.draw { border-color: var(--text-muted); }
.ttt-score span {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 600;
}
.ttt-score b {
    font-size: 1.6rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.ttt-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin: 0 auto 1.5rem;
    aspect-ratio: 1;
    max-width: 360px;
}

.ttt-cell {
    background: linear-gradient(135deg, var(--bg-soft), #fff);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 800;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all var(--t-fast) var(--ease);
    color: var(--text);
    min-height: 80px;
}
.ttt-cell:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--grad-start);
    box-shadow: var(--shadow-sm);
}
.ttt-cell:disabled { cursor: not-allowed; }
.ttt-cell.x {
    color: var(--grad-start);
    animation: pop 0.3s var(--ease);
}
.ttt-cell.o {
    color: var(--grad-end);
    animation: pop 0.3s var(--ease);
}
.ttt-cell.win {
    background: linear-gradient(135deg, var(--grad-start), var(--grad-end));
    color: white;
    border-color: transparent;
    animation: win-pulse 0.8s ease infinite alternate;
}
@keyframes pop {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}
@keyframes win-pulse {
    from { box-shadow: 0 0 0 0 rgba(124,58,237,0.4); }
    to   { box-shadow: 0 0 0 12px rgba(124,58,237,0); }
}

.ttt-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

@media (max-width: 540px) {
    .ttt-stage { margin: 0 1rem 2rem; padding: 1.5rem; }
}
