/* ===== Tic-Tac-Toe Loading Overlay ===== */

.ttt-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.97);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
}

.ttt-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Close button (only visible in fun/sidebar mode) */
.ttt-close {
    position: absolute;
    top: 24px;
    right: 32px;
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.1s;
}

.ttt-close:hover {
    color: var(--text-primary);
}

/* Container */
.ttt-container {
    width: 320px;
    text-align: center;
}

/* Header */
.ttt-header {
    margin-bottom: 20px;
}

.ttt-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Loading indicator */
.ttt-loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.ttt-loading-dot {
    width: 4px;
    height: 4px;
    background: var(--text-tertiary);
    border-radius: 2px;
    animation: ttt-pulse 1.2s ease-in-out infinite;
}

.ttt-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.ttt-loading-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes ttt-pulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

.ttt-loading-text {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-left: 6px;
}

/* Scoreboard */
.ttt-scoreboard {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 20px;
}

.ttt-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.ttt-score-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

.ttt-score-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Game board */
.ttt-board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 240px;
    height: 240px;
    margin: 0 auto 16px;
    border: 1px solid var(--border-default);
}

.ttt-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-right: 1px solid var(--border-default);
    border-bottom: 1px solid var(--border-default);
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.1s;
    padding: 0;
    line-height: 1;
    font-family: inherit;
}

.ttt-cell:nth-child(3n) { border-right: none; }
.ttt-cell:nth-child(n+7) { border-bottom: none; }

.ttt-cell:hover:not(.taken) {
    background: var(--bg-row-hover);
}

.ttt-cell:focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: -2px;
}

.ttt-cell.taken {
    cursor: default;
}

.ttt-cell.x {
    color: var(--text-primary);
}

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

.ttt-cell.winner {
    background: var(--accent-primary);
    color: var(--accent-text-on-primary);
}

/* Status line */
.ttt-status {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    min-height: 20px;
}

/* Claude quip */
.ttt-quip {
    font-size: 12px;
    color: var(--text-tertiary);
    font-style: italic;
    min-height: 18px;
    margin-top: 4px;
}

/* Responsive */
@media (max-width: 768px) {
    .ttt-container {
        width: 280px;
    }
    .ttt-board {
        width: 210px;
        height: 210px;
    }
    .ttt-cell {
        font-size: 28px;
    }
    .ttt-close {
        top: 16px;
        right: 16px;
    }
}
