/* ==========================================================================
    TIC-TAC-TOE (dynamic grid)
   ========================================================================== */

.init-ttt {
    display: grid;
    gap: 12px;
    justify-items: center;
}

/* Status */
.init-ttt__status {
    min-height: 24px;
    font-weight: 600;
}

/* Grid động: JS set --ttt-size = 3 hoặc 4 */
.init-ttt__grid {
    --ttt-size: 3;              /* fallback nếu JS chưa set */
    --ttt-cell: 72px;           /* size cell mặc định */
    display: grid;
    grid-template-columns: repeat(var(--ttt-size, 3), var(--ttt-cell));
    gap: 10px;
    justify-content: center;
}

/* Ô (Cell) */
.init-ttt__cell {
    width: var(--ttt-cell);
    height: var(--ttt-cell);
    border: 2px solid #d1d5db;          /* border rõ hơn */
    border-radius: 12px;
    background: #ffffff;
    font-size: 28px;
    font-weight: 700;
    line-height: var(--ttt-cell);
    text-align: center;
    transition: border-color .15s, transform .05s, box-shadow .15s;
    box-shadow: 0 2px 4px rgba(0,0,0,.06);
    user-select: none;
    cursor: pointer;
}

/* Hover / Active */
.init-ttt__cell:hover {
    border-color: #94a3b8;              /* slate-400 */
    box-shadow: 0 3px 6px rgba(0,0,0,.12);
}
.init-ttt__cell:active {
    transform: scale(.97);
    border-color: #64748b;              /* slate-500 */
}

/* Khi disable */
.init-ttt__cell.uk-disabled {
    pointer-events: none;
    opacity: .6;
}

/* Focus ring */
.init-ttt__cell:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Responsive: tăng cell khi màn lớn */
@media (min-width: 480px) {
    .init-ttt__grid {
        --ttt-cell: 88px;
    }
    .init-ttt__cell {
        font-size: 32px;
    }
}

/* Giảm hiệu ứng khi user bật reduced motion */
@media (prefers-reduced-motion: reduce) {
    .init-ttt__cell {
        transition: none;
    }
}

/* ==========================================================================
    DARK MODE
   ========================================================================== */

.uk-light .init-ttt__cell {
    background: #1e293b;                /* slate-800 */
    border-color: #475569;              /* slate-600 */
    color: #f8fafc;
    box-shadow: 0 2px 4px rgba(255,255,255,.06);
}

.uk-light .init-ttt__cell:hover {
    border-color: #64748b;              /* slate-500 */
}

.uk-light .init-ttt__cell:active {
    background: #0f172a;                /* slate-900 */
    transform: scale(.97);
}

.uk-light .init-ttt__status {
    color: #f1f5f9;
}
