:root {
  --bg: #f4f1ec; --card: #fff; --text: #22201c; --muted: #7a746a; --line: #e4ded3;
  --accent: #3f7d4e; --accent-2: #2f6a3e; --danger: #b8453a; --warn: #c98a1b;
  --light: #eeeed2; --dark: #769656; --sel: rgba(255, 214, 10, .55); --last: rgba(255, 214, 10, .32);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #1b1a18; --card: #262522; --text: #ece8e1; --muted: #9b958a; --line: #3a3833; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--accent); text-decoration: none; }
main { max-width: 1280px; margin: 0 auto; padding: 16px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.up { color: var(--accent); } .down { color: var(--danger); }

.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .brand { font-weight: 700; font-size: 18px; color: var(--text); }
.topbar nav { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.topbar .me { color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.card h1, .card h2 { margin: 0 0 12px; font-size: 20px; }
.card h3 { margin: 18px 0 8px; font-size: 15px; }

.btn { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 7px;
  padding: 8px 14px; font: inherit; cursor: pointer; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 13px; }
.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--line); color: var(--text); font-weight: 500; }
.pill.warn { background: var(--warn); color: #fff; }

/* auth */
.auth { max-width: 380px; margin: 40px auto; display: grid; gap: 12px; }
.auth label { display: grid; gap: 4px; font-size: 14px; }
.auth input, select { padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px; font: inherit; background: var(--bg); color: var(--text); }
.alert { background: #fbe6e3; color: #8a2a20; padding: 8px 10px; border-radius: 7px; margin: 0; }

/* layout chơi */
.layout { display: grid; grid-template-columns: 280px minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } #board-wrap { order: -1; } }

.tc-row { display: flex; gap: 10px; margin-bottom: 10px; }
.tc-row label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); flex: 1; }
.players, .invites { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 340px; overflow: auto; }
.players li, .invites li { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font-size: 14px; }
.invites li.in { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.players li.muted, .invites li.muted { border: none; padding: 4px 0; }

/* bàn cờ */
#board-wrap { width: 100%; max-width: min(640px, calc(100vh - 170px)); margin: 0 auto; }
.board { display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); aspect-ratio: 1; width: 100%;
  border-radius: 6px; overflow: hidden; box-shadow: 0 4px 18px rgba(0,0,0,.18); user-select: none; touch-action: none;
  container-type: inline-size; }
.sq { position: relative; min-width: 0; min-height: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 10cqw; cursor: pointer; }
.sq.light { background: var(--light); } .sq.dark { background: var(--dark); }
.sq.last::before, .sq.sel::before { content: ""; position: absolute; inset: 0; background: var(--last); }
.sq.sel::before { background: var(--sel); }
.sq.check { background: radial-gradient(circle, #ff3b30 0%, rgba(255,59,48,.6) 40%, transparent 75%), var(--dark); }
.sq.tgt::after { content: ""; position: absolute; width: 30%; height: 30%; border-radius: 50%; background: rgba(0,0,0,.2); }
.sq.cap::after { content: ""; position: absolute; inset: 4%; border-radius: 50%; border: 5px solid rgba(0,0,0,.2); }
.sq .cf, .sq .cr { position: absolute; font-size: 11px; font-weight: 600; opacity: .7; color: #3a4a2c; line-height: 1; }
.sq .cf { right: 3px; bottom: 2px; } .sq .cr { left: 3px; top: 3px; }
.pc-svg { position: relative; z-index: 1; width: 90%; height: 90%; pointer-events: none;
  filter: drop-shadow(0 1.5px 1px rgba(0,0,0,.28)); }
.pc-ghost { position: fixed; z-index: 50; pointer-events: none; transform: translate(-50%, -50%) scale(1.1);
  display: flex; align-items: center; justify-content: center; }
.pc-ghost .pc-svg { filter: drop-shadow(0 6px 6px rgba(0,0,0,.35)); }

.player-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 2px; font-weight: 600; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; border: 1px solid #555; vertical-align: -1px; }
.swatch.w { background: #fff; } .swatch.b { background: #222; }
.clock { font: 600 22px/1 ui-monospace, "SF Mono", Consolas, monospace; padding: 6px 12px; border-radius: 6px;
  background: var(--card); border: 1px solid var(--line); min-width: 92px; text-align: right; }
.clock.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.clock.active.low { background: var(--danger); border-color: var(--danger); }

/* cột phải */
.status-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #999; }
.dot.on { background: #34c759; } .dot.mid { background: #ffcc00; } .dot.bad, .dot.off { background: #ff3b30; }
.game-status { margin: 12px 0; min-height: 44px; }
.draw-box { padding: 8px; border-radius: 7px; background: color-mix(in srgb, var(--warn) 18%, transparent); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.moves { margin: 14px 0 0; padding: 0 0 0 30px; max-height: 360px; overflow: auto; font: 14px/1.7 ui-monospace, Consolas, monospace; }
.moves li span { display: inline-block; width: 70px; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 60; }
.modal-box { background: var(--card); padding: 16px; border-radius: 10px; text-align: center; }
.promo-choices, #promoChoices { display: flex; gap: 8px; }
.promo-btn { width: 72px; height: 72px; padding: 4px; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--line); background: var(--light); cursor: pointer; }
.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); }
.toast { background: #222; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.3);
  animation: toast-in .2s ease-out; transition: opacity .3s, transform .3s; }
.toast.out { opacity: 0; transform: translateY(8px); }
.toast.info { background: #1f4d7a; } .toast.gold { background: linear-gradient(135deg, #7a5a12, #b8860b); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.badge-toast { display: flex; gap: 12px; align-items: center; } .badge-ico { font-size: 34px; }

/* bảng xếp hạng */
.grid2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 500; }
.table tr.hl td { background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* người xem */
.watchers { margin-left: auto; font-size: 13px; color: var(--muted); cursor: default; }
.live-meta { font-size: 12px; color: var(--muted); }
.spectating .board { cursor: default; }
.spectating .sq { cursor: default; }
.badge-live { display: inline-block; font-size: 11px; font-weight: 600; color: #fff; background: var(--danger);
  border-radius: 4px; padding: 0 5px; margin-right: 6px; vertical-align: 1px; }

/* ---------------------------------------------------------------- bản 2 */
.topbar nav a { padding: 4px 8px; border-radius: 6px; color: var(--text); }
.topbar nav a.active, .topbar nav a:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.topbar nav a.me { color: var(--muted); }
.small { font-size: 13px; } .block { width: 100%; }
.pill.gold { background: #d4a017; color: #fff; }
.icon-btn { border: none; background: none; font-size: 16px; cursor: pointer; padding: 2px 4px; }
.status-row .icon-btn { margin-left: 4px; }
.watchers { margin-left: auto; }

.tabs { display: flex; gap: 4px; margin: -4px -4px 12px; flex-wrap: wrap; }
.tabs button { flex: 1; border: 1px solid var(--line); background: transparent; color: var(--text); border-radius: 7px;
  padding: 7px 6px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tabs button.active .pill { background: rgba(255,255,255,.25); color: #fff; }

.tc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.tc-btn { position: relative; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 9px;
  padding: 10px 6px; cursor: pointer; font: inherit; display: grid; gap: 2px; text-align: center; transition: transform .1s, border-color .1s; }
.tc-btn b { font-size: 20px; } .tc-btn small { color: var(--muted); font-size: 12px; }
.tc-btn:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.tc-btn.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--bg)); animation: pulse 1.4s infinite; }
.tc-btn:disabled { opacity: .45; cursor: not-allowed; }
.tc-badge { position: absolute; top: -7px; right: -4px; background: var(--danger); color: #fff; font-size: 11px; border-radius: 99px; padding: 0 6px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); } }
.seek-box { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px; border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, transparent); font-size: 14px; }
.seek-box .btn { margin-left: auto; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.invite-name { display: flex; gap: 6px; margin-top: 10px; }
.invite-name input, .chat-form input { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font: inherit; background: var(--bg); color: var(--text); }

.lvl-label { margin: 6px 0; font-size: 14px; }
.lvl-row { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-bottom: 12px; }
.lvl { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 6px; padding: 8px 0; font: inherit; font-weight: 700; cursor: pointer; }
.lvl.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.arena { border: 1px solid var(--line); border-radius: 9px; padding: 10px; margin-bottom: 10px; }
.arena.running { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.arena-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; font-size: 14px; }
.arena-me { margin: 8px 0; padding: 6px 8px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 10%, transparent); font-size: 13px; }
.table.compact td { padding: 4px 6px; font-size: 13px; }
.sheet span { display: inline-block; min-width: 12px; font-size: 12px; color: var(--muted); }
.sheet span.fire { color: #e8590c; font-weight: 700; }
.teams { margin-top: 6px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

.chat { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.chat-log { max-height: 160px; overflow: auto; font-size: 13px; display: grid; gap: 3px; margin-bottom: 8px; }
.chat-line.spectator { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 99px; padding: 3px 9px; font: inherit; font-size: 12px; cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chat-form { display: flex; gap: 6px; }

/* bàn cờ: premove, gợi ý, hiệu ứng */
.sq.pre::before { content: ""; position: absolute; inset: 0; background: rgba(40, 110, 220, .38); }
.sq.ptgt::after { content: ""; position: absolute; width: 26%; height: 26%; border-radius: 50%; background: rgba(40, 110, 220, .35); }
.sq.hint { box-shadow: inset 0 0 0 4px rgba(40, 140, 255, .8); }
.pc-svg { will-change: transform; }

/* hồ sơ / câu đố / xem lại */
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .page-grid { grid-template-columns: 1fr; } }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: var(--bg); }
.stat .lbl { font-size: 12px; color: var(--muted); } .stat .val { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 12px; color: var(--muted); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.badge-card { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; display: flex; gap: 8px; align-items: center; font-size: 13px; }
.badge-card .ico { font-size: 26px; }
.badge-card.locked { opacity: .35; filter: grayscale(1); }
.chart-box { position: relative; }
.chart-box svg { width: 100%; height: auto; display: block; }
.chart-tip { position: absolute; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px; font-size: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.15); white-space: nowrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 10px; flex-wrap: wrap; }
.seg button, .seg a { border: none; background: transparent; color: var(--text); padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.seg .on { background: var(--accent); color: #fff; }
.form-grid { display: grid; gap: 10px; max-width: 460px; }
.form-grid label { display: grid; gap: 4px; font-size: 14px; }
.form-grid input, .form-grid select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font: inherit; background: var(--bg); color: var(--text); }
.ok-box { background: color-mix(in srgb, var(--accent) 14%, transparent); padding: 8px 10px; border-radius: 7px; }

.puzzle-info { font-size: 15px; }
.puzzle-info .turn-to-move { font-size: 18px; font-weight: 700; margin: 8px 0; }
.puzzle-result { padding: 10px; border-radius: 8px; margin: 10px 0; font-weight: 600; }
.puzzle-result.ok { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.puzzle-result.bad { background: color-mix(in srgb, var(--danger) 16%, transparent); }

.replay-nav { display: flex; gap: 6px; justify-content: center; margin: 8px 0; }
.replay-nav .btn { min-width: 44px; }
.moves.clickable li span { cursor: pointer; border-radius: 4px; padding: 0 3px; }
.moves.clickable li span:hover { background: var(--line); }
.moves li span.cur { background: var(--accent); color: #fff; }
.moves li span.blunder::after { content: " ??"; color: var(--danger); font-weight: 700; }
.moves li span.mistake::after { content: " ?"; color: #e8590c; font-weight: 700; }
.moves li span.inaccuracy::after { content: " ?!"; color: #d4a017; font-weight: 700; }
.moves li span.cur::after { color: #fff; }
.eval-row { display: flex; gap: 10px; align-items: center; margin: 6px 0; font-size: 14px; }
.eval-num { font: 700 16px ui-monospace, Consolas, monospace; min-width: 70px; }
.acc-table td { font-size: 13px; }
.mk.blunder { fill: #d63b2f; } .mk.mistake { fill: #e8890c; }
.tc-row label { min-width: 0; }
.tc-row select, .tc-row input { width: 100%; min-width: 0; }
.form-grid label.check { display: flex; gap: 8px; align-items: center; }
.form-grid label.check input { width: auto; }
.moves.clickable li span.cur, .moves.clickable li span.cur:hover { background: var(--accent); color: #fff; }
.puzzle-layout .stat-row { grid-template-columns: repeat(3, 1fr); gap: 6px; }
.puzzle-layout .stat { padding: 8px; } .puzzle-layout .stat .val { font-size: 20px; }
.page-grid > * { min-width: 0; }
.card { min-width: 0; overflow-x: auto; }
@media (max-width: 600px) { .table th, .table td { padding: 6px 5px; } main { padding: 12px; } }

/* popup kết quả ván */
.result-modal { animation: fade-in .2s ease-out; }
.result-box { position: relative; width: min(380px, calc(100vw - 32px)); padding: 24px 20px 18px; display: grid; gap: 6px; justify-items: center;
  animation: pop-in .28s cubic-bezier(.2, 1.3, .5, 1); border-top: 6px solid var(--line); }
.result-box.win { border-top-color: #d4a017; } .result-box.loss { border-top-color: var(--danger); }
.result-box.draw { border-top-color: #7a8a99; } .result-box.watch { border-top-color: var(--accent); }
.result-box h2 { margin: 0; font-size: 24px; }
.result-icon { font-size: 54px; line-height: 1; animation: bounce 1s ease-out; }
.result-score { font: 700 20px ui-monospace, Consolas, monospace; }
.result-players { display: flex; gap: 14px; font-size: 14px; flex-wrap: wrap; justify-content: center; }
.result-line { font-size: 15px; }
.result-line:empty { display: none; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.result-x { position: absolute; top: 8px; right: 10px; border: none; background: none; font-size: 18px; color: var(--muted); cursor: pointer; }
.result-box p { margin: 0; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.85); } }
@keyframes bounce { 0% { transform: scale(.3); } 55% { transform: scale(1.25); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .result-modal, .result-box, .result-icon { animation: none; } }

/* chat */
.chat-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 14px; }
.icon-btn.small { font-size: 14px; } .icon-btn.on { opacity: 1; background: color-mix(in srgb, var(--warn) 25%, transparent); border-radius: 6px; }
.chat-log { max-height: 200px; min-height: 60px; overflow: auto; font-size: 13px; display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px;
  padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.chat-line { padding: 4px 8px; border-radius: 8px; max-width: 92%; overflow-wrap: anywhere; line-height: 1.35; background: var(--card); align-self: flex-start; }
.chat-line.mine { align-self: flex-end; background: color-mix(in srgb, var(--accent) 16%, var(--card)); }
.chat-line.spectator { color: var(--muted); font-style: italic; }
.chat-time { font-size: 11px; color: var(--muted); font-weight: 400; }
.chat-form { margin-bottom: 6px; }

.pz-filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.pz-filters label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); min-width: 0; }
.pz-filters select { width: 100%; min-width: 0; }
.pz-tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }

/* chưa tới lượt: bàn cờ khoá, không bấm/kéo được quân */
.board.locked .sq { cursor: not-allowed; }

/* ===== chọn loại cờ ở sảnh ===== */
.variant-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: var(--bg); color: var(--text); font: inherit; font-weight: 600; padding: 7px 14px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--accent); color: #fff; }
.caro-rule { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.caro-rule select { max-width: 210px; }

/* ===== bàn cờ caro 15×15 ===== */
.caro-board {
  --n: 15; --cx: #c62828; --co: #1565c0;
  position: relative; display: grid; grid-template-columns: repeat(var(--n), 1fr);
  width: 100%; background: #f3e2bd; border: 2px solid #8a6a3a; border-radius: 6px; user-select: none; touch-action: manipulation;
  padding: 0 0 14px 16px; /* chỗ cho toạ độ */
  background-clip: padding-box;
}
@media (prefers-color-scheme: dark) { .caro-board { background: #d9c79e; } }
.caro-board .cc {
  position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1;
  border-right: 1px solid #b89a66; border-bottom: 1px solid #b89a66; font-weight: 800; line-height: 1;
  font-size: clamp(12px, 3.6vmin, 30px); cursor: pointer; transition: background .12s;
}
.caro-board .cc:nth-child(15n + 1) { border-left: 1px solid #b89a66; }
.caro-board .cc:nth-child(-n + 15) { border-top: 1px solid #b89a66; }
.caro-board .cc.x { color: var(--cx); cursor: default; }
.caro-board .cc.o { color: var(--co); cursor: default; }
.caro-board .cc.last { background: rgba(255, 214, 10, .55); }
.caro-board .cc.win { background: #7bd389; animation: caroWin 1s ease-in-out infinite alternate; }
@keyframes caroWin { from { background: #7bd389; } to { background: #b7f0c0; } }
.caro-board[data-turn="x"]:not(.locked) .cc.empty:hover { background: color-mix(in srgb, var(--cx) 22%, transparent); }
.caro-board[data-turn="o"]:not(.locked) .cc.empty:hover { background: color-mix(in srgb, var(--co) 22%, transparent); }
.caro-board.locked .cc { cursor: not-allowed; }
.caro-board.waiting { box-shadow: 0 0 0 3px color-mix(in srgb, var(--muted) 30%, transparent); }
.caro-board .cc[data-row]::before { content: attr(data-row); position: absolute; left: -16px; width: 14px; text-align: right;
  font-size: 10px; font-weight: 500; color: #7a5c2e; }
.caro-board .cc[data-col]::after { content: attr(data-col); position: absolute; bottom: -15px; font-size: 10px; font-weight: 500; color: #7a5c2e; }
.stone-x { color: #c62828; font-weight: 800; } .stone-o { color: #1565c0; font-weight: 800; }
.moves.caro-moves li span { font-variant-numeric: tabular-nums; }
