/**
 * Funquizo Games - Tic Tac Toe Styling
 * Uses the Tre i rad presentation with a pannable 19x19 board.
 */

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

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

/* Mode Switcher Tabs */
.luffarschack-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);
}

.luffarschack-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;
}

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

.luffarschack-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);
}

.luffarschack-difficulty {
    display: flex;
    justify-content: center;
    gap: 0.45rem;
    margin: -0.9rem 0 1.35rem;
}

.luffarschack-difficulty button {
    min-width: 76px;
    padding: 0.5rem 0.85rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #475569;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.luffarschack-difficulty button:hover {
    border-color: #94a3b8;
    color: #1e293b;
}

.luffarschack-difficulty button.is-active {
    border-color: #4f46e5;
    background: #eef2ff;
    color: #4338ca;
}

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

/* Solo HUD */
.luffarschack-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);
}

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

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

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

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

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

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

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

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

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

.luffarschack-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;
}

.luffarschack-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: luffarschackPulse 2s infinite ease-in-out;
}

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

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

/* 19x19 Board */
.luffarschack-board-wrap {
    background: #ffffff;
    border-radius: 24px;
    padding: 1rem;
    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;
}

.luffarschack-board-viewport {
    --luffarschack-cell-size: 36px;
    width: min(100%, 684px);
    height: min(684px, calc(100vw - 4rem));
    min-height: 360px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    border: 2px solid #cbd5e1;
    border-radius: 16px;
    background: #f8fafc;
    touch-action: none;
    cursor: grab;
}

.luffarschack-board-viewport:active { cursor: grabbing; }

.luffarschack-grid {
    display: grid;
    grid-template-columns: repeat(19, var(--luffarschack-cell-size));
    grid-template-rows: repeat(19, var(--luffarschack-cell-size));
    gap: 2px;
    width: max-content;
    height: max-content;
    padding: 2px;
    transform: translate3d(0, 0, 0);
    will-change: transform;
}

.luffarschack-grid.is-auto-panning {
    transition: transform 220ms ease-out;
}

.luffarschack-cell {
    width: var(--luffarschack-cell-size);
    height: var(--luffarschack-cell-size);
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--luffarschack-cell-size) * 0.72);
    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;
}

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

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

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

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

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

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

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

.luffarschack-cell.is-last:not(.is-winner) {
    border-color: #f59e0b;
    box-shadow: inset 0 0 0 2px #fbbf24;
}

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

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

.luffarschack-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;
}

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

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

.luffarschack-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) {
    .luffarschack-container { padding: 0 .5rem; }
    .luffarschack-board-wrap {
        padding: .5rem;
        border-radius: 16px;
    }
    .luffarschack-board-viewport {
        --luffarschack-cell-size: 34px;
        width: min(100%, 396px);
        height: min(396px, calc(100vw - 2rem));
        min-height: 0;
        border-radius: 12px;
    }
    .luffarschack-solo-hud {
        padding: 0.75rem 1rem;
    }
    .luffarschack-badge-icon {
        width: 30px;
        height: 30px;
        font-size: 1rem;
    }
    .luffarschack-solo-score-val {
        font-size: 1.25rem;
    }
}
