/*
 * Abhi Arya Chess Game - scoped stylesheet 2.0
 * Everything lives under .abhi-chess-root. The only rules outside it are the compact page heading
 * (applied through the body class abhi-chess-page, added only on pages that carry the shortcode).
 */
.abhi-chess-root, .abhi-chess-root *, .abhi-chess-root *::before, .abhi-chess-root *::after { box-sizing: border-box; }
.abhi-chess-root [hidden] { display: none !important; }

.abhi-chess-root {
  --ac-bg: #F6F1E7; --ac-bed: #EEE6D6; --ac-card: #FFFFFF; --ac-line: #E5DCCB; --ac-line2: #D9CFBC;
  --ac-ink: #26231F; --ac-muted: #6B645A; --ac-accent: #C4572E; --ac-accent-d: #A8481F; --ac-accent-soft: #FBEBE3; --ac-on-accent: #fff;
  --ac-sq-light: #F2E5C9; --ac-sq-dark: #B9825D; --ac-frame: #8A5A3C; --ac-frame-edge: #6E4529;
  --ac-select: rgba(196, 87, 46, .55); --ac-last: rgba(214, 160, 58, .42); --ac-hint: rgba(38, 35, 31, .30);
  --ac-ok: #2F7D4F; --ac-danger: #B3261E; --ac-shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 20px rgba(60, 40, 20, .07);
  display: block; width: 100vw; margin-left: calc(50% - 50vw); margin-top: 0; margin-bottom: 0;
  padding: 6px 0 36px; background: transparent; color: var(--ac-ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-size: 14px; line-height: 1.45;
  position: relative; -webkit-font-smoothing: antialiased;
}
.abhi-chess-root[data-theme-active="dark"] {
  --ac-bg: #1B1815; --ac-bed: #15120F; --ac-card: #25211C; --ac-line: #3A342C; --ac-line2: #4A4237;
  background: var(--ac-bg);
  --ac-ink: #F1ECE3; --ac-muted: #A79E8F; --ac-accent: #D0694A; --ac-accent-d: #E07C5C; --ac-accent-soft: rgba(208, 105, 74, .16); --ac-on-accent: #1B1815;
  --ac-sq-light: #D4C3A0; --ac-sq-dark: #7C5439; --ac-frame: #4A3322; --ac-frame-edge: #2E1F14;
  --ac-select: rgba(224, 124, 92, .6); --ac-last: rgba(226, 178, 84, .38); --ac-hint: rgba(27, 24, 21, .38);
  --ac-ok: #6CC391; --ac-danger: #F08A82; --ac-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
}
.abhi-chess-root[data-board-active="tournament"] { --ac-sq-light: #EBECD0; --ac-sq-dark: #769656; --ac-frame: #4C6234; --ac-frame-edge: #36461F; }
.abhi-chess-root[data-board-active="midnight"] { --ac-sq-light: #C9D3E0; --ac-sq-dark: #5A6E8A; --ac-frame: #34435A; --ac-frame-edge: #222D3F; }
.abhi-chess-root[data-theme-active="dark"][data-board-active="tournament"] { --ac-sq-light: #C5C7A6; --ac-sq-dark: #5D7843; }
.abhi-chess-root[data-theme-active="dark"][data-board-active="midnight"] { --ac-sq-light: #A8B4C4; --ac-sq-dark: #44566F; }

.abhi-chess-root button { font-family: inherit; margin: 0; }
.abhi-chess-root button:focus-visible, .abhi-chess-root input:focus-visible, .abhi-chess-root [tabindex]:focus-visible {
  outline: 2px solid var(--ac-accent); outline-offset: 2px;
}
.abhi-chess-ico { flex: none; display: block; }

.abhi-chess-inner { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* Toolbar */
.abhi-chess-toolbar { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin: 0 0 12px; }
.abhi-chess-seg { display: inline-flex; border: 1px solid var(--ac-line); border-radius: 10px; background: var(--ac-card); overflow: hidden; }
.abhi-chess-seg-btn { width: 42px; height: 38px; border: 0; background: transparent; color: var(--ac-muted); cursor: pointer; display: grid; place-items: center; padding: 0; transition: background .15s, color .15s; }
.abhi-chess-seg-btn + .abhi-chess-seg-btn { border-left: 1px solid var(--ac-line); }
.abhi-chess-seg-btn:hover { color: var(--ac-ink); }
.abhi-chess-seg-btn.is-on { background: var(--ac-accent-soft); color: var(--ac-accent); }
.abhi-chess-tool { width: 42px; height: 38px; border: 1px solid var(--ac-line); border-radius: 10px; background: var(--ac-card); color: var(--ac-ink); cursor: pointer; display: grid; place-items: center; padding: 0; transition: border-color .15s, background .15s; }
.abhi-chess-tool:hover { border-color: var(--ac-accent); background: var(--ac-accent-soft); }

/* Arena */
.abhi-chess-arena { display: grid; grid-template-columns: minmax(0, 1fr) 372px; gap: 24px; align-items: stretch; }
.abhi-chess-stage { min-width: 0; display: flex; justify-content: center; align-items: flex-start; }

.abhi-chess-board-outer {
  --ac-board: min(100%, clamp(660px, calc(100vh - 190px), 720px));
  width: var(--ac-board); display: grid; grid-template-columns: 22px minmax(0, 1fr); grid-template-rows: auto 22px;
}
.abhi-chess-ranks { display: grid; grid-template-rows: repeat(8, 1fr); padding: 14px 0; }
.abhi-chess-ranks span, .abhi-chess-files span { display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; color: var(--ac-muted); }
.abhi-chess-files { display: grid; grid-template-columns: repeat(8, 1fr); padding: 0 14px; }
.abhi-chess-board-wrap {
  aspect-ratio: 1 / 1; width: 100%; position: relative; padding: 10px; border-radius: 8px;
  background: var(--ac-frame); box-shadow: inset 0 0 0 1px var(--ac-frame-edge), var(--ac-shadow), 0 14px 34px rgba(60, 40, 20, .16);
  user-select: none; -webkit-user-select: none;
}
.abhi-chess-board-grid { width: 100%; height: 100%; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .28); }
.abhi-chess-board-wrap.is-thinking .abhi-chess-board-grid { cursor: progress; }
.abhi-chess-sq { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; border: 0; outline: 0; border-radius: 0; min-width: 0; min-height: 0; }
.abhi-chess-sq.sq-light { background: var(--ac-sq-light); }
.abhi-chess-sq.sq-dark { background: var(--ac-sq-dark); }
.abhi-chess-sq.sq-last-move::before { content: ""; position: absolute; inset: 0; background: var(--ac-last); }
.abhi-chess-sq.sq-selected::before { content: ""; position: absolute; inset: 0; background: var(--ac-select); }
.abhi-chess-sq.sq-in-check::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle, rgba(220, 38, 38, .85) 0%, rgba(220, 38, 38, .55) 48%, rgba(220, 38, 38, 0) 74%); }
.abhi-chess-sq.sq-checkmate::before { background: radial-gradient(circle, rgba(185, 28, 28, .95) 0%, rgba(185, 28, 28, .7) 55%, rgba(185, 28, 28, .1) 85%); }
.abhi-chess-sq:focus-visible { outline: 2px solid var(--ac-accent); outline-offset: -3px; z-index: 3; }
.abhi-chess-piece-svg { position: relative; width: 86%; height: 86%; z-index: 1; pointer-events: none; filter: drop-shadow(0 1.5px 1.5px rgba(0, 0, 0, .35)); transition: transform .12s ease; }
.abhi-chess-sq:hover .abhi-chess-piece-svg { transform: scale(1.06); }
.abhi-chess-move-dot { position: absolute; width: 28%; height: 28%; border-radius: 50%; background: var(--ac-hint); pointer-events: none; z-index: 2; }
.abhi-chess-capture-ring { position: absolute; inset: 6%; border-radius: 50%; border: 4px solid rgba(179, 38, 30, .6); pointer-events: none; z-index: 2; }

/* Board overlay (promotion, game over): covers the board only */
.abhi-chess-board-overlay { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: 14px; border-radius: 8px; background: rgba(38, 35, 31, .46); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.abhi-chess-result-card { position: relative; width: min(100%, 320px); background: var(--ac-card); color: var(--ac-ink); border: 1px solid var(--ac-line); border-radius: 12px; padding: 22px 20px 18px; text-align: center; box-shadow: 0 18px 44px rgba(0, 0, 0, .3); }
.abhi-chess-result-icon { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 10px; background: var(--ac-accent-soft); color: var(--ac-accent); }
.abhi-chess-result-title { font-family: Fraunces, Georgia, serif; font-size: 1.6rem; font-weight: 600; margin: 0 0 4px; letter-spacing: -.01em; color: var(--ac-ink); }
.abhi-chess-result-sub { margin: 0 0 14px; color: var(--ac-muted); font-size: 14px; }
.abhi-chess-result-actions { display: grid; gap: 8px; }
.abhi-chess-x { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--ac-muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
.abhi-chess-x:hover { background: var(--ac-bed); color: var(--ac-ink); }
.abhi-chess-promo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.abhi-chess-promo-btn { background: var(--ac-bed); border: 1px solid var(--ac-line); border-radius: 10px; padding: 8px 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ac-ink); font-size: 11.5px; font-weight: 600; }
.abhi-chess-promo-btn:hover { border-color: var(--ac-accent); background: var(--ac-accent-soft); }
.abhi-chess-promo-piece { width: 44px; height: 44px; display: block; background: var(--ac-sq-light); border-radius: 6px; }
.abhi-chess-promo-piece .abhi-chess-piece-svg { width: 100%; height: 100%; }

/* Sidebar */
.abhi-chess-sidebar { display: flex; flex-direction: column; gap: 12px; min-width: 0; margin-bottom: 22px; }
.abhi-chess-moves-card { flex: 1 1 auto; min-height: 96px; position: relative; padding-bottom: 0; }
.abhi-chess-moves-card .abhi-chess-moves-scroll { position: absolute; left: 12px; right: 10px; top: 42px; bottom: 10px; max-height: none; min-height: 0; }
.abhi-chess-card { background: var(--ac-card); border: 1px solid var(--ac-line); border-radius: 12px; padding: 12px; box-shadow: var(--ac-shadow); }
.abhi-chess-players { display: flex; flex-direction: column; gap: 8px; }
.abhi-chess-modehead { display: flex; align-items: center; gap: 10px; width: 100%; padding: 4px 4px 8px; border: 0; background: transparent; color: var(--ac-ink); cursor: pointer; text-align: left; border-radius: 8px; }
.abhi-chess-modehead:hover { background: var(--ac-bed); }
.abhi-chess-mode-ico { width: 38px; height: 38px; border-radius: 50%; background: var(--ac-bed); border: 1px solid var(--ac-line); display: grid; place-items: center; color: var(--ac-ink); }
.abhi-chess-mode-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.abhi-chess-mode-text b { font-family: Fraunces, Georgia, serif; font-size: 1.05rem; font-weight: 600; line-height: 1.2; }
.abhi-chess-mode-text small { color: var(--ac-muted); font-size: 12.5px; }
.abhi-chess-modehead > .abhi-chess-ico { color: var(--ac-muted); }

.abhi-chess-player { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--ac-line); border-radius: 10px; background: var(--ac-card); transition: border-color .15s, box-shadow .15s; }
.abhi-chess-player.is-active-turn { border-color: var(--ac-accent); box-shadow: 0 0 0 2px var(--ac-accent-soft); }
.abhi-chess-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 1px solid var(--ac-line2); }
.abhi-chess-avatar.is-w { background: #FCFAF5; color: #3A322A; }
.abhi-chess-avatar.is-b { background: #2A2520; color: #F1ECE3; border-color: #2A2520; }
.abhi-chess-player-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.abhi-chess-player-label { font-size: 11.5px; color: var(--ac-muted); line-height: 1.2; }
.abhi-chess-player-name { font-weight: 600; font-size: 14.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abhi-chess-player-input { width: 100%; padding: 1px 0; border: 0; border-bottom: 1px dashed transparent; border-radius: 0; background: transparent; color: var(--ac-ink); font: inherit; font-weight: 600; font-size: 14.5px; outline: none; box-shadow: none; }
.abhi-chess-player-input:hover { border-bottom-color: var(--ac-line2); }
.abhi-chess-player-input:focus { border-bottom: 1px solid var(--ac-accent); }
.abhi-chess-chip { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--ac-accent-soft); color: var(--ac-accent-d); white-space: nowrap; }
.abhi-chess-chip.is-you { background: var(--ac-bed); color: var(--ac-muted); }
.abhi-chess-clock { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; padding: 3px 8px; border-radius: 7px; background: var(--ac-bed); color: var(--ac-ink); min-width: 52px; text-align: center; }
.abhi-chess-clock.is-running { background: var(--ac-ink); color: var(--ac-bg); }
.abhi-chess-clock.is-low { background: var(--ac-danger); color: #fff; }

.abhi-chess-turn { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--ac-accent-soft); }
.abhi-chess-turn-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ac-accent); flex: none; box-shadow: 0 0 0 3px var(--ac-accent-soft); }
.abhi-chess-turn-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.abhi-chess-turn-text b { font-family: Fraunces, Georgia, serif; font-size: 1.05rem; font-weight: 600; color: var(--ac-accent-d); line-height: 1.25; }
.abhi-chess-turn-text small { color: var(--ac-muted); font-size: 12.5px; }
.abhi-chess-turn.is-thinking .abhi-chess-turn-dot { animation: abhi-chess-pulse 1s ease-in-out infinite; }
.abhi-chess-turn.is-check { background: rgba(179, 38, 30, .1); }
.abhi-chess-turn.is-check .abhi-chess-turn-dot { background: var(--ac-danger); box-shadow: 0 0 0 3px rgba(179, 38, 30, .15); }
.abhi-chess-turn.is-check b { color: var(--ac-danger); }
.abhi-chess-turn.is-over { background: var(--ac-bed); }
.abhi-chess-turn.is-over .abhi-chess-turn-dot { background: var(--ac-ok); box-shadow: none; }
.abhi-chess-turn.is-over b { color: var(--ac-ink); }
.abhi-chess-link { border: 0; background: transparent; color: var(--ac-accent-d); font-weight: 600; font-size: 12.5px; cursor: pointer; text-decoration: underline; padding: 2px 4px; }
@keyframes abhi-chess-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .55; } }

.abhi-chess-caps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.abhi-chess-cap { background: var(--ac-card); border: 1px solid var(--ac-line); border-radius: 12px; padding: 9px 11px; min-width: 0; }
.abhi-chess-cap-label { display: block; font-size: 11.5px; color: var(--ac-muted); margin-bottom: 4px; }
.abhi-chess-cap-label i { font-style: normal; font-weight: 700; color: var(--ac-accent-d); margin-left: 4px; }
.abhi-chess-cap-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0; min-height: 24px; }
.abhi-chess-cap-piece { width: 22px; height: 22px; margin-right: -5px; display: block; }
.abhi-chess-cap-piece .abhi-chess-piece-svg { width: 100%; height: 100%; display: block; filter: none; }
.abhi-chess-cap-none { font-size: 12px; color: var(--ac-muted); opacity: .8; }

.abhi-chess-card-title { margin: 0 0 8px; font-family: Inter, system-ui, sans-serif; font-size: 13.5px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; color: var(--ac-ink); }
.abhi-chess-count { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: var(--ac-bed); color: var(--ac-muted); font-weight: 600; }
.abhi-chess-moves-scroll { overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.abhi-chess-move-row { display: grid; grid-template-columns: 34px 1fr 1fr; align-items: center; padding: 3px 6px; border-radius: 6px; font-size: 13px; }
.abhi-chess-move-row:nth-child(odd) { background: var(--ac-bed); }
.abhi-chess-move-num { color: var(--ac-muted); font-variant-numeric: tabular-nums; }
.abhi-chess-move-san { font-weight: 500; font-variant-numeric: tabular-nums; padding: 1px 6px; border-radius: 5px; justify-self: start; }
.abhi-chess-move-san.is-latest { background: var(--ac-accent); color: var(--ac-on-accent); font-weight: 600; }
.abhi-chess-move-empty { color: var(--ac-muted); font-size: 13px; padding: 10px 4px; }

/* Buttons */
.abhi-chess-controls { display: flex; flex-direction: column; gap: 8px; }
.abhi-chess-ctl-row { display: grid; gap: 8px; }
.abhi-chess-ctl-row.is-3 { grid-template-columns: repeat(3, 1fr); }
.abhi-chess-ctl-row.is-2 { grid-template-columns: repeat(2, 1fr); }
.abhi-chess-btn { height: 40px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--ac-line); background: var(--ac-card); color: var(--ac-ink); font-size: 13.5px; font-weight: 500; line-height: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; transition: border-color .15s, background .15s, transform .1s; box-shadow: none; text-transform: none; letter-spacing: 0; }
.abhi-chess-btn:hover:not(:disabled) { border-color: var(--ac-accent); background: var(--ac-accent-soft); }
.abhi-chess-btn:active:not(:disabled) { transform: translateY(1px); }
.abhi-chess-btn:disabled { opacity: .45; cursor: not-allowed; }
.abhi-chess-btn.is-soft { background: var(--ac-accent-soft); border-color: transparent; color: var(--ac-accent-d); }
.abhi-chess-btn.is-primary { background: var(--ac-accent); border-color: var(--ac-accent); color: var(--ac-on-accent); font-weight: 600; }
.abhi-chess-btn.is-primary:hover:not(:disabled) { background: var(--ac-accent-d); border-color: var(--ac-accent-d); color: var(--ac-on-accent); }
.abhi-chess-btn.is-block { width: 100%; height: 44px; font-size: 14.5px; }

/* Setup modal */
.abhi-chess-setup-backdrop { position: fixed; inset: 0; z-index: 99990; display: grid; place-items: center; padding: 16px; background: rgba(38, 35, 31, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: abhi-chess-fade .15s ease-out; }
.abhi-chess-setup { width: min(100%, 460px); max-height: calc(100vh - 32px); overflow: auto; background: var(--ac-card); color: var(--ac-ink); border: 1px solid var(--ac-line); border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); animation: abhi-chess-rise .18s ease-out; }
.abhi-chess-setup-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
.abhi-chess-setup-head h3 { margin: 0; font-family: Fraunces, Georgia, serif; font-size: 1.35rem; font-weight: 600; color: var(--ac-ink); }
.abhi-chess-setup-head .abhi-chess-x { position: static; }
.abhi-chess-setup-body { padding: 8px 18px 4px; display: flex; flex-direction: column; gap: 14px; }
.abhi-chess-field-label { display: block; font-size: 12px; font-weight: 600; color: var(--ac-muted); margin-bottom: 6px; letter-spacing: .02em; }
.abhi-chess-field-label em { font-style: normal; font-weight: 400; }
.abhi-chess-opts { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.abhi-chess-opts.is-wrap { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); }
.abhi-chess-opt { min-height: 40px; padding: 0 10px; border: 1px solid var(--ac-line); border-radius: 9px; background: var(--ac-card); color: var(--ac-ink); font-size: 13.5px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; transition: border-color .15s, background .15s; box-shadow: none; text-transform: none; letter-spacing: 0; }
.abhi-chess-opt:hover { border-color: var(--ac-accent); }
.abhi-chess-opt.is-selected { border-color: var(--ac-accent); background: var(--ac-accent-soft); color: var(--ac-accent-d); font-weight: 600; box-shadow: 0 0 0 1px var(--ac-accent) inset; }
.abhi-chess-setup-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 16px 18px 18px; }
@keyframes abhi-chess-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes abhi-chess-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Responsive */
@media (max-width: 1100px) {
  .abhi-chess-arena { grid-template-columns: 1fr; gap: 16px; }
  .abhi-chess-sidebar { margin-bottom: 0; }
  .abhi-chess-moves-card { flex: none; height: 230px; }
  .abhi-chess-board-outer { --ac-board: 100%; }
  .abhi-chess-sidebar { max-width: 640px; width: 100%; margin: 0 auto; }
}
@media (max-width: 560px) {
  .abhi-chess-inner { padding: 0 12px; }
  .abhi-chess-board-outer { grid-template-columns: 16px minmax(0, 1fr); grid-template-rows: auto 16px; }
  .abhi-chess-ranks { padding: 9px 0; }
  .abhi-chess-files { padding: 0 9px; }
  .abhi-chess-ranks span, .abhi-chess-files span { font-size: 10.5px; }
  .abhi-chess-board-wrap { padding: 6px; }
  .abhi-chess-caps { grid-template-columns: 1fr 1fr; gap: 8px; }
  .abhi-chess-opts.is-wrap { grid-template-columns: repeat(2, 1fr); }
  .abhi-chess-btn { height: 44px; }
  .abhi-chess-ctl-row.is-3 .abhi-chess-btn { padding: 0 6px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .abhi-chess-root *, .abhi-chess-root *::before { animation: none !important; transition: none !important; }
}

/* Page heading: same compact look as the other Abhi Arya tool pages. Only pages that carry the game. */
body.abhi-chess-page #main, body.abhi-chess-page main, body.abhi-chess-page .site-main { overflow-x: clip; }
body.abhi-chess-page .intro { padding-top: 20px !important; padding-bottom: 18px !important; }
body.abhi-chess-page .intro .wrap { max-width: 1180px !important; }
body.abhi-chess-page .intro .crumbs { margin-bottom: 10px !important; }
body.abhi-chess-page .intro .intro__title { font-size: clamp(1.65rem, 1.05rem + 1.55vw, 2.3rem) !important; line-height: 1.15 !important; letter-spacing: -.015em !important; font-weight: 600 !important; max-width: none !important; margin: 0 !important; }
body.abhi-chess-page .intro .intro__lead { font-size: 1rem !important; line-height: 1.55 !important; max-width: 72ch !important; margin-top: .4rem !important; margin-bottom: 0 !important; }
@media (max-width: 600px) { body.abhi-chess-page .intro { padding-top: 14px !important; padding-bottom: 12px !important; } body.abhi-chess-page .intro .crumbs { margin-bottom: 8px !important; } body.abhi-chess-page .intro .intro__lead { font-size: .95rem !important; } }

/* ===== Result popup (game over) ===== */
.abhi-chess-setup-backdrop.is-result { padding: 14px; overflow-y: auto; }
.abhi-chess-result-modal { position: relative; width: min(100%, 780px); margin: auto; background: var(--ac-card); background-image: radial-gradient(ellipse 70% 38% at 50% 0, var(--ac-accent-soft), transparent 70%); color: var(--ac-ink); border: 1px solid var(--ac-line); border-radius: 16px; padding: 8px 28px 26px; box-shadow: 0 28px 70px rgba(0, 0, 0, .38); animation: abhi-chess-rise .22s ease-out; }
.abhi-chess-result-modal > .abhi-chess-x { top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%; background: var(--ac-bed); color: var(--ac-ink); z-index: 2; }
.abhi-chess-rhero { display: flex; justify-content: center; margin: 0 -10px; }
.abhi-chess-hero { width: min(100%, 560px); height: auto; display: block; overflow: visible; }
.abhi-chess-rhead { text-align: center; margin-top: -4px; position: relative; }
.abhi-chess-rtitle { font-family: Fraunces, Georgia, serif; font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.3rem); line-height: 1.05; font-weight: 600; letter-spacing: -.02em; margin: 0; color: var(--ac-ink); }
.abhi-chess-rwin { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 8px 0 4px; }
.abhi-chess-rwin span { width: 54px; height: 1px; background: var(--ac-accent); opacity: .7; }
.abhi-chess-rwin b { font-family: Fraunces, Georgia, serif; font-size: 1.55rem; font-weight: 500; color: var(--ac-accent-d); }
.abhi-chess-rline { margin: 0; color: var(--ac-muted); font-size: 15.5px; }
.abhi-chess-rsides { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-top: 22px; }
.abhi-chess-rside { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--ac-line); border-radius: 12px; background: var(--ac-card); min-width: 0; }
.abhi-chess-rside.is-winner { border-color: var(--ac-accent); background: var(--ac-accent-soft); }
.abhi-chess-rav { width: 52px; height: 52px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--ac-bed); color: var(--ac-ink); }
.abhi-chess-rav.is-winner { background: #F6E3D6; color: #8A3A19; }
.abhi-chess-root[data-theme-active="dark"] .abhi-chess-rav.is-winner { background: rgba(208, 105, 74, .28); color: #F0B79F; }
.abhi-chess-rside-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.abhi-chess-rside-text b { font-family: Fraunces, Georgia, serif; font-size: 1.15rem; font-weight: 600; display: flex; align-items: center; gap: 6px; line-height: 1.2; }
.abhi-chess-crown { color: #D49A2E; display: inline-flex; }
.abhi-chess-rs-win, .abhi-chess-rs-draw, .abhi-chess-rs-sub { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; }
.abhi-chess-rs-win { color: var(--ac-ok); }
.abhi-chess-rs-draw, .abhi-chess-rs-sub { color: var(--ac-muted); font-weight: 500; }
.abhi-chess-vs { display: flex; align-items: center; gap: 8px; color: var(--ac-muted); font-family: Fraunces, Georgia, serif; font-size: 1.1rem; }
.abhi-chess-vs i { width: 14px; height: 1px; background: var(--ac-line2); }
.abhi-chess-stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 14px; border: 1px solid var(--ac-line); border-radius: 12px; background: var(--ac-card); }
.abhi-chess-stat { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-width: 0; }
.abhi-chess-stat + .abhi-chess-stat { border-left: 1px solid var(--ac-line); }
.abhi-chess-stat-ico { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--ac-bed); color: var(--ac-accent-d); }
.abhi-chess-stat small { display: block; color: var(--ac-muted); font-size: 12.5px; line-height: 1.2; }
.abhi-chess-stat b { display: block; font-family: Fraunces, Georgia, serif; font-size: 1.25rem; font-weight: 600; line-height: 1.25; white-space: nowrap; font-variant-numeric: tabular-nums; }
.abhi-chess-ractions { display: grid; grid-template-columns: 1.15fr 1fr 1fr 1fr; gap: 10px; margin-top: 14px; }
.abhi-chess-ract { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 64px; padding: 10px 14px; border: 1px solid var(--ac-line); border-radius: 12px; background: var(--ac-bed); color: var(--ac-ink); cursor: pointer; text-align: left; transition: border-color .15s, background .15s, transform .1s; box-shadow: none; text-transform: none; letter-spacing: 0; }
.abhi-chess-ract:hover { border-color: var(--ac-accent); background: var(--ac-accent-soft); }
.abhi-chess-ract:active { transform: translateY(1px); }
.abhi-chess-ract span { display: flex; flex-direction: column; min-width: 0; }
.abhi-chess-ract b { font-family: Fraunces, Georgia, serif; font-size: 1.05rem; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.abhi-chess-ract small { font-size: 12.5px; color: var(--ac-muted); line-height: 1.2; }
.abhi-chess-ract.is-primary { background: var(--ac-accent); border-color: var(--ac-accent); color: var(--ac-on-accent); justify-content: center; }
.abhi-chess-ract.is-primary:hover { background: var(--ac-accent-d); border-color: var(--ac-accent-d); }
.abhi-chess-ract.is-primary b { font-size: 1.15rem; }
.abhi-chess-moves-card.is-flash { animation: abhi-chess-flash 1.4s ease-out; }
@keyframes abhi-chess-flash { 0%, 60% { box-shadow: 0 0 0 3px var(--ac-accent); } 100% { box-shadow: var(--ac-shadow); } }
@media (max-width: 760px) {
  .abhi-chess-result-modal { padding: 6px 16px 18px; }
  .abhi-chess-rsides { grid-template-columns: 1fr; gap: 8px; }
  .abhi-chess-vs { justify-content: center; }
  .abhi-chess-vs i { width: 40px; }
  .abhi-chess-stats { grid-template-columns: 1fr 1fr; }
  .abhi-chess-stat:nth-child(3) { border-left: 0; }
  .abhi-chess-stat:nth-child(n+3) { border-top: 1px solid var(--ac-line); }
  .abhi-chess-ractions { grid-template-columns: 1fr 1fr; }
  .abhi-chess-ract.is-primary { grid-column: 1 / -1; }
  .abhi-chess-rhead { margin-top: 0; }
  .abhi-chess-rwin span { width: 28px; }
}
@media (max-width: 760px) {
  .abhi-chess-stat { padding: 11px 12px; gap: 9px; }
  .abhi-chess-stat-ico { width: 34px; height: 34px; }
  .abhi-chess-stat b { font-size: 1.05rem; white-space: normal; }
  .abhi-chess-ract:last-child { grid-column: 1 / -1; }
}
