/* Игры на двоих (/games/krestiki-noliki): поверх каркаса казуальных игр (assets/casual/casual.css —
   .cg-stage, .cg-btn, .cg-note, .cg-board-wrap, «Другие игры»). Здесь — только то, чего там нет. */

.dq-stage { gap: 16px; max-width: 640px; }
.dq-start, .dq-game { display: flex; flex-direction: column; gap: 14px; font-family: 'Inter', sans-serif; }

.dq-group { display: flex; flex-direction: column; gap: 6px; }
.dq-label { font: 600 12px/1.2 'Inter', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #7a756c; }
.dq-choices { display: flex; flex-wrap: wrap; gap: 6px; }

.dq-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dq-mode {
    display: flex; flex-direction: column; gap: 6px; align-items: flex-start; text-align: left;
    padding: 16px 16px 18px; background: #fffdf8; border: 1px solid #d8d0c0; cursor: pointer;
    font-family: 'Inter', sans-serif; color: #141414;
}
.dq-mode:hover { background: #fff; border-color: #141414; }
.dq-mode b { font: 800 19px/1.2 'Playfair Display', Georgia, serif; }
.dq-mode span { font-size: 13.5px; line-height: 1.45; color: #57534b; }
.dq-botopts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-top: 10px; border-top: 1px solid #e3ddd1; }

.dq-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.dq-status { margin: 0; font: 700 16px/1.35 'Inter', sans-serif; color: #141414; flex: 1 1 220px; min-width: 0; }
.dq-status.is-win { color: #2f9e44; }
.dq-status.is-lose { color: #c2410c; }
.dq-scores { display: flex; gap: 18px; }
.dq-score { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.dq-score b { font: 700 21px/1.1 'Inter', sans-serif; font-variant-numeric: tabular-nums; color: #141414; }
.dq-score small { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #7a756c; }

.dq-invite { display: flex; flex-direction: column; gap: 6px; padding: 12px; background: #fffdf8; border: 1px solid #e3ddd1; }
.dq-expire { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0; }
.dq-expire-text { flex: 1 1 260px; }
.dq-linkrow { display: flex; gap: 8px; }
.dq-link {
    flex: 1; min-width: 0; padding: 8px 10px; min-height: 38px; box-sizing: border-box;
    font: 14px/1.2 'Inter', sans-serif; color: #141414; background: #fff; border: 1px solid #d8d0c0;
}
.dq-hint { margin: 0; font: 13px/1.45 'Inter', sans-serif; color: #7a756c; }

/* --- поле --- */
.dq-board {
    --n: 3;
    display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-template-rows: repeat(var(--n), minmax(0, 1fr)); gap: 6px;
    width: min(100%, 460px); aspect-ratio: 1; padding: 6px; box-sizing: border-box;
    background: #2b2925; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.dq-cell {
    display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; padding: 0;
    background: #fffdf8; border: 0; border-radius: 0; cursor: default; color: inherit;
    transition: background .12s;
}
.dq-cell.is-free { cursor: pointer; }
.dq-cell.is-free:hover, .dq-cell.is-free:focus-visible { background: #fff; outline: none; box-shadow: inset 0 0 0 3px rgba(20, 20, 20, .35); }
.dq-cell:disabled { opacity: 1; }
.dq-cell.is-win { background: #ffe9a8; }
.dq-board[style*="--n: 5"] { gap: 5px; }

.dq-mark { width: 72%; height: auto; aspect-ratio: 1; fill: none; stroke-width: 11; stroke-linecap: round; display: block; }
.dq-mark--x { stroke: #1f5fa8; }
.dq-mark--o { stroke: #c2410c; }
.dq-board[style*="--n: 5"] .dq-mark { stroke-width: 12; }
.dq-mark.is-new path, .dq-mark.is-new circle { stroke-dasharray: 1; stroke-dashoffset: 1; animation: dq-draw .28s ease-out forwards; }
.dq-mark.is-new path:nth-child(2) { animation-delay: .12s; }
@keyframes dq-draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
    .dq-mark.is-new path, .dq-mark.is-new circle { animation: none; stroke-dashoffset: 0; }
}

/* --- шашки (/games/shashki) --- */
.ck-rules { padding: 12px 14px; background: #fffdf8; border: 1px solid #e3ddd1; font: 14px/1.5 'Inter', sans-serif; color: #3b3832; }
.ck-rules b { display: block; margin-bottom: 4px; font: 800 16px/1.3 'Playfair Display', Georgia, serif; color: #141414; }
.ck-rules ul { margin: 0; padding-left: 18px; }
.ck-rules li { margin: 3px 0; }
.ck-variant { margin: 0; font: 600 12px/1.2 'Inter', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #7a756c; }

.ck-board {
    --n: 8; --light: #f0e6d2; --dark: #7a5a3a;
    display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-template-rows: repeat(var(--n), minmax(0, 1fr)); gap: 0;
    width: min(100%, 540px); aspect-ratio: 1; padding: 6px; box-sizing: border-box;
    background: #2b2925; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.ck-cell {
    position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 0; padding: 0;
    border: 0; border-radius: 0; cursor: default; color: inherit; font-family: 'Inter', sans-serif;
}
.ck-cell.is-light { background: var(--light); }
.ck-cell.is-dark { background: var(--dark); }
.ck-cell.is-last { background: #8d7a35; }
.ck-cell.is-dark:disabled { opacity: 1; }
.ck-cell.is-movable, .ck-cell.is-dest, .ck-cell.is-sel { cursor: pointer; }
.ck-cell.is-sel::before { content: ''; position: absolute; inset: 3px; box-shadow: inset 0 0 0 3px #ffd75e; }
.ck-cell.is-movable:hover::before, .ck-cell.is-movable:focus-visible::before { content: ''; position: absolute; inset: 3px; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .55); }
.ck-cell:focus-visible { outline: none; }
.ck-cell.is-dest::after { content: ''; position: absolute; width: 28%; height: 28%; border-radius: 50%; background: rgba(255, 215, 94, .9); box-shadow: 0 0 0 3px rgba(0, 0, 0, .18); }
.ck-cell.is-dest:hover::after { width: 36%; height: 36%; }
.ck-lab { position: absolute; font: 600 10px/1 'Inter', sans-serif; pointer-events: none; color: rgba(255, 255, 255, .6); }
.ck-lab--rank { left: 3px; top: 2px; }
.ck-lab--file { right: 3px; bottom: 2px; }
.ck-cell.is-light .ck-lab { color: rgba(0, 0, 0, .4); }

.ck-piece {
    position: relative; display: flex; align-items: center; justify-content: center; width: 78%; aspect-ratio: 1; border-radius: 50%;
    box-shadow: 0 2px 3px rgba(0, 0, 0, .45), inset 0 0 0 3px rgba(0, 0, 0, .12);
    transition: transform .15s;
}
.ck-piece--w { background: radial-gradient(circle at 35% 30%, #fffef9 0, #f4ecdb 45%, #d9ccb1 100%); }
.ck-piece--b { background: radial-gradient(circle at 35% 30%, #5a554e 0, #2d2a26 50%, #141311 100%); }
.ck-piece::after { content: ''; position: absolute; inset: 14%; border-radius: 50%; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .14); }
.ck-piece--b::after { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .13); }
.ck-piece.is-new { animation: ck-pop .22s ease-out; }
@keyframes ck-pop { from { transform: scale(.82); } to { transform: scale(1); } }
.ck-crown { position: relative; z-index: 1; width: 56%; height: auto; fill: #d4a017; stroke: #7c5a00; stroke-width: 1; stroke-linejoin: round; }
.ck-piece--b .ck-crown { fill: #f0c24b; stroke: #5b4300; }
@media (prefers-reduced-motion: reduce) { .ck-piece.is-new { animation: none; } }

.dq-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; }
.dq-help { margin: 0; font: 13px/1.45 'Inter', sans-serif; color: #7a756c; text-align: center; }

@media (max-width: 560px) {
    .dq-modes, .dq-botopts { grid-template-columns: 1fr; }
    .dq-scores { width: 100%; justify-content: space-between; }
    .dq-score { align-items: flex-start; }
}
