/**
 * Funquizo Games - Tic Tac Toe Styling
 * Responsive, modern styling for 3x3 grid, X/O markers, mode tabs, and HUD.
 */

/* Breadcrumbs spacing */
.breadcrumb-container.gh-breadcrumbs {
    margin-bottom: 2rem !important;
}

.ttt-container {
    max-width: 580px;
    margin: 1.5rem auto 3rem auto;
    padding: 0 1rem;
}

/* Mode Switcher Tabs */
.ttt-mode-switch {
    display: flex;
    background: #f1f5f9;
    border-radius: 16px;
    padding: 4px;
    margin-bottom: 1.75rem;
    gap: 4px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.04);
}

.ttt-mode-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 0.92rem;
    font-weight: 850;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.ttt-mode-tab:hover {
    color: #1e293b;
}

.ttt-mode-tab.is-active {
    background: #ffffff;
    color: #4f46e5;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}

/* Multiplayer Lobby Bar */
.ttt-lobby-bar {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

/* Solo HUD */
.ttt-solo-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 18px;
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.ttt-solo-player {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.ttt-badge-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.2rem;
}

.ttt-badge-icon--x {
    background: #fee2e2;
    color: #dc2626;
}

.ttt-badge-icon--o {
    background: #e0f2fe;
    color: #0284c7;
}

.ttt-solo-name {
    font-size: 0.95rem;
    font-weight: 850;
    color: #1e293b;
    display: block;
}

.ttt-solo-score {
    font-size: 0.75rem;
    font-weight: 750;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ttt-solo-score-val {
    font-size: 1.5rem;
    font-weight: 950;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
}

.ttt-solo-vs {
    font-size: 0.85rem;
    font-weight: 900;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Turn Status Indicator */
.ttt-status-banner {
    text-align: center;
    margin-bottom: 1.25rem;
}

.ttt-turn-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 1.15rem;
    border-radius: 9999px;
    font-size: 0.88rem;
    font-weight: 850;
    transition: all 0.25s ease;
}

.ttt-turn-chip--my-turn {
    background: #ecfdf5;
    color: #059669;
    border: 1.5px solid #a7f3d0;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.15);
    animation: tttPulse 2s infinite ease-in-out;
}

.ttt-turn-chip--opp-turn {
    background: #f8fafc;
    color: #64748b;
    border: 1.5px solid #e2e8f0;
}

@keyframes tttPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* 3x3 Board Grid */
.ttt-board-wrap {
    background: #ffffff;
    border-radius: 24px;
    padding: 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1.5px solid #e2e8f0;
    margin-bottom: 1.5rem;
}

.ttt-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    aspect-ratio: 1 / 1;
    max-width: 440px;
    margin: 0 auto;
}

.ttt-cell {
    aspect-ratio: 1 / 1;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    font-weight: 950;
    font-family: inherit;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    padding: 0;
    outline: none;
    position: relative;
}

.ttt-cell:hover:not(:disabled):not(.is-filled) {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.ttt-cell:active:not(:disabled):not(.is-filled) {
    transform: translateY(0);
}

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

/* X Symbol */
.ttt-symbol--x {
    color: #ef4444;
    animation: tttPopIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* O Symbol */
.ttt-symbol--o {
    color: #0284c7;
    animation: tttPopIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes tttPopIn {
    0% { transform: scale(0.3); opacity: 0; }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* Winning Line Highlight */
.ttt-cell.is-winner {
    background: #fef08a !important;
    border-color: #eab308 !important;
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.45);
    animation: tttWinGlow 1.2s infinite alternate ease-in-out;
}

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

/* Solo Quick Controls */
.ttt-solo-controls {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.ttt-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    border-radius: 14px;
    font-size: 0.88rem;
    font-weight: 850;
    border: none;
    cursor: pointer;
    background: #f1f5f9;
    color: #334155;
    transition: all 0.2s ease;
}

.ttt-btn-action:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.ttt-btn-action--primary {
    background: var(--fq-1v1-btn-create-bg, rgb(5, 150, 105));
    color: var(--fq-1v1-btn-create-color, #ffffff);
}

.ttt-btn-action--primary:hover {
    background: var(--fq-1v1-btn-create-bg, rgb(5, 150, 105));
    color: var(--fq-1v1-btn-create-color, #ffffff);
    transform: none;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.2);
}

/* Responsive */
@media (max-width: 480px) {
    .ttt-grid {
        gap: 8px;
    }
    .ttt-cell {
        font-size: 2.75rem;
        border-radius: 14px;
    }
    .ttt-board-wrap {
        padding: 0.85rem;
    }
    .ttt-solo-hud {
        padding: 0.75rem 1rem;
    }
    .ttt-badge-icon {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    .ttt-solo-score-val {
        font-size: 1.25rem;
    }
}
