:root {
  color-scheme: light;
  --bg: #f6f5ef;
  --surface: #fffef9;
  --surface-2: #eeeee6;
  --ink: #19303d;
  --muted: #758078;
  --line: #dddfd3;
  --accent: #627b69;
  --sq-light: #c4cbbf;
  --sq-dark: #aab7a8;
  --danger: #cd685a;
  --prey: #398b68;
  --focus: #466b86;
  --body: 'Golos Text', 'Segoe UI', system-ui, sans-serif;
  --display: 'Unbounded', 'Segoe UI', system-ui, sans-serif;
}
* { box-sizing: border-box; }
*, *::before, *::after { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
[hidden] { display: none !important; }
/* The viewport stays fixed; only long menu content may scroll internally. */
html, body { width: 100%; overflow: clip; overscroll-behavior: none; }
body { margin: 0; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); height: 100dvh; background: radial-gradient(ellipse at 26% 5%, #fffdf4, transparent 70%), var(--bg); color: var(--ink); font: 14px/1.5 var(--body); }
button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.svg-defs { position: absolute; pointer-events: none; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.app { max-width: 1120px; height: 100%; margin: auto; display: grid; grid-template-rows: minmax(0, 1fr); }
.rules-toggle { display: flex; align-items: center; gap: 6px; border: 0; border-radius: 6px; padding: 4px 8px; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; }
.rules-toggle span { display: grid; place-items: center; border: 1.5px solid currentColor; width: 19px; height: 19px; border-radius: 50%; font-size: 12px; font-weight: 700; }
.rules-toggle:hover { background: var(--surface-2); color: var(--ink); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 276px; gap: 20px; min-height: 0; }
.table { --game-chrome-height: 208px; container-type: size; width: 100%; height: 100%; display: grid; grid-template-rows: 44px 52px max-content 52px 44px; gap: 4px; min-width: 0; min-height: 0; justify-items: center; align-content: center; }
.table > :not(.sr-only) { width: min(100%, max(280px, calc(100cqh - var(--game-chrome-height)))); }
.table > .board-frame { width: max(0px, min(100%, calc(100cqh - var(--game-chrome-height)))); }
.board-frame { align-self: center; aspect-ratio: 1; padding: 4px; border: 1px solid #bdc8b9; border-radius: 12px; background: #e3e8da; box-shadow: 0 14px 38px -24px #3f514a88, inset 0 1px 0 #fff; }
.board-stage { position: relative; isolation: isolate; aspect-ratio: 1; overflow: clip; }
.board { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); border-radius: 10px; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.sq { position: relative; border: 0; border-radius: 0; padding: 0; margin: 0; background: var(--sq-light); min-width: 0; cursor: default; --mark: transparent; box-shadow: inset 0 0 0 100px var(--mark); }
.sq.dark { background: var(--sq-dark); }
.sq.last { --mark: #f3df54a6; }
.sq.last-to { --mark: #f3df54bf; }
.sq.sel { --mark: #fff0b45b; }
.sq.hover { --mark: #f7ffe44f; }
.sq.mine { cursor: grab; touch-action: none; }
.sq.target { cursor: pointer; }
.sq:focus-visible { outline: none; --mark: #fff2bb80; }
.sq.queued-from, .sq.queued-to, .sq.queued-from:focus-visible, .sq.queued-to:focus-visible { --mark: #e74747a6; }
.sq.move::after { content: ''; position: absolute; inset: 44%; border-radius: 50%; background: #345f4e55; }
.pieces, .effects, .attack-arrows { position: absolute; inset: 0; pointer-events: none; }
.pieces { z-index: 2; }
.effects { z-index: 4; overflow: visible; }
.attack-arrows { width: 100%; height: 100%; z-index: 3; overflow: hidden; }
.attack-link { --arrow: #bd6255; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.attack-link.friendly { --arrow: #378965; }
.attack-link.quiet { opacity: .23; }
.attack-link.active { opacity: .95; }
.attack-link .arrow-halo { stroke: #fff8df; stroke-width: 6.2; opacity: .48; }
.attack-link .arrow-line { stroke: var(--arrow); stroke-width: 3.4; }
.pc { position: absolute; width: 12.5%; height: 12.5%; pointer-events: none; --gaze-x: 0px; --gaze-y: 0px; }
.pc::before { content: ''; position: absolute; left: 21%; top: 73%; width: 61%; height: 13%; border-radius: 50%; background: #263c3640; filter: blur(2px); transition: transform 140ms, opacity 140ms; }
.pc.paper::before { left: 27%; width: 50%; top: 79%; }
.pc.scissors::before { opacity: .75; height: 10%; }
.pc.king::before { background: #b5954655; }
.piece-art { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pc > .piece-art { filter: drop-shadow(0 1.3px 1px #243d302e); transition: translate 130ms, scale 130ms; }
.pc.glow-danger > .piece-art { filter: drop-shadow(0 0 2px #d8726490) drop-shadow(0 0 5px #d8726459); }
.pc.glow-prey > .piece-art { filter: drop-shadow(0 0 2px #459a7090) drop-shadow(0 0 5px #459a7059); }
.pc.glow-danger.glow-immediate > .piece-art { filter: drop-shadow(0 0 2px #d06556bf) drop-shadow(0 0 7px #d0655690); }
.pc.glow-prey.glow-immediate > .piece-art { filter: drop-shadow(0 0 2px #329967df) drop-shadow(0 0 7px #329967a6); }
.pc.is-hovered > .piece-art { translate: 0 -3%; }
.pc.is-selected > .piece-art { translate: 0 -5%; }
.pc.is-hovered::before, .pc.is-selected::before { transform: translateY(2px) scale(1.04); opacity: .7; }
.pc.lifted { opacity: .17; }
.pc.lifted .eyes { opacity: 0; }
.mini { position: relative; display: inline-block; width: 24px; height: 24px; flex: none; vertical-align: middle; }
.mini .eyes, .mini .royal-spark, .mini .royal-aura { display: none; }
.eyes { opacity: 0; transition: opacity 130ms; }
.king .eyes, .endangered .eyes, .captured .eyes { opacity: 1; }
.pupils { transform: translate(var(--gaze-x), var(--gaze-y)); transition: transform 100ms ease-out; }
.endangered .smile { d: path('M47 70 Q50 67 53 70'); }
.endangered .eye-whites { stroke: #9b5549; }
.royal-aura { opacity: .16; transform: scale(1.14); transform-origin: 50% 65%; filter: blur(5px); }
.royal-spark { opacity: 0; transform-origin: 82px 24px; }
.scissor-half { transform-origin: 50px 48px; }
.snipping .half-left { animation: snip-left 520ms ease-in-out; }
.snipping .half-right { animation: snip-right 520ms ease-in-out; }
@keyframes snip-left { 0%, 45%, 100% { transform: rotate(0); } 23%, 68% { transform: rotate(6.333333deg); } }
@keyframes snip-right { 0%, 45%, 100% { transform: rotate(0); } 23%, 68% { transform: rotate(-6.333333deg); } }
.wiggling > .piece-art { animation: royal-wiggle 620ms ease-in-out; }
.wiggling .royal-spark { animation: sparkle 620ms ease-out; }
@keyframes royal-wiggle { 0%, 100% { transform: rotate(0); } 28% { transform: translateY(-2px) rotate(-5deg); } 65% { transform: rotate(4deg); } }
@keyframes sparkle { 0%, 100% { opacity: 0; scale: .5; } 40% { opacity: .85; scale: 1; } }
.blinking .eyes { animation: blink 170ms ease-in-out; }
.shivering > .classic-art { animation: fear-shiver 650ms linear; }
@keyframes fear-shiver { 0%, 48%, 72%, 100% { transform: none; } 9%, 24%, 80% { transform: translateX(-2%) rotate(-1deg); } 16%, 32%, 88% { transform: translateX(2%) rotate(1deg); } 40%, 94% { transform: translateX(-.6%); } }
@keyframes blink { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.08); } }
.drag-layer { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: clip; contain: paint; }
.ghost { position: absolute; transition: scale 100ms ease-out; will-change: translate; }
.ghost.up { scale: 1.1; }
.ghost > .piece-art { translate: 0 -8%; filter: drop-shadow(0 4px 2px #273b2e28); }
.ghost::before { transform: translate(3px, 8px) scale(1.07); filter: blur(4px); opacity: .8; }
.grabbing, .grabbing * { cursor: grabbing !important; }
.move-trail { --trail-color: 235 214 173; position: absolute; height: 9.5%; transform-origin: 0 50%; background: linear-gradient(90deg, rgb(var(--trail-color) / 0), rgb(var(--trail-color) / .8) 88%, rgb(var(--trail-color) / 0)); mask-image: linear-gradient(0deg, transparent, #000 18% 82%, transparent); filter: blur(var(--trail-softness, 1.5px)); }
.move-trail.b { --trail-color: 51 94 123; }
.captured { z-index: 6; }
.captured::before { display: none; }
.impact-particle { position: absolute; width: 1%; height: 1%; border-radius: 2px; background: #faf1d8; }
.impact-particle.b { background: #477493; }
.impact-ring { position: absolute; width: 9%; height: 9%; border: 2px solid #fffbecaa; border-radius: 50%; }
.result { position: absolute; inset: 0; display: grid; place-items: center; background: #15252f99; border-radius: 10px; padding: 16px; z-index: 10; }
.result-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 26px; display: grid; justify-items: center; gap: 10px; text-align: center; box-shadow: 0 14px 40px #243b3222; }
.result-title { margin: 0; font: 700 23px/1.3 var(--display); letter-spacing: -.03em; }
.result-why { margin: 0 0 6px; color: var(--muted); }
.player-row { display: flex; align-items: center; gap: 8px; min-width: 0; height: 52px; padding: 0 3px; }
.player-avatar { display: grid; place-items: center; flex: none; width: 34px; height: 34px; background: #e9e5d9; border: 1px solid #d6d6c8; border-radius: 6px; }
.player-avatar.blue { background: #d5dfe3; border-color: #b9cbd2; }
.player-avatar .mini { width: 31px; height: 31px; }
.player-info { min-width: 0; flex: 1; }
.player-name { display: flex; gap: 7px; align-items: baseline; font-size: 12px; font-weight: 600; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-label { font-size: 11px; color: var(--muted); font-weight: 400; }
.player-clock-group { flex: none; display: flex; align-items: center; gap: 12px; }
.player-clock { flex: none; display: flex; align-items: center; justify-content: center; min-width: 126px; height: 49px; padding: 4px 12px; border: 1px solid #d7d8ce; border-radius: 7px; background: #fffef9; color: #25302b; font-variant-numeric: tabular-nums; }
.player-clock.clock-opponent { background: #2d312e; border-color: #242824; color: #fafaf2; }
.player-clock time { min-width: 65px; text-align: center; font-size: 27px; line-height: 1; font-weight: 650; letter-spacing: -.035em; opacity: .48; }
.player-clock small { font-size: 10px; opacity: .7; }
.player-clock.active time { opacity: 1; }
.player-clock.low time { color: #c57627; opacity: 1; }
.player-clock.expired time { color: #cf6557; opacity: 1; }
.clock-turn { visibility: hidden; color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.player-clock-group.active .clock-turn { visibility: visible; }
.clock-turn span { display: inline-block; }
.player-clock-group.active .clock-turn span { animation: clock-letter 4.8s ease-in-out infinite; animation-delay: calc(var(--letter) * 65ms); }
@keyframes clock-letter { 0%, 3%, 15%, 100% { transform: translateY(0); opacity: .75; } 8% { transform: translateY(-1px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .clock-turn span { animation: none !important; } }
@container (max-width: 380px) {
  .player-clock-group { gap: 8px; }
  .player-clock { min-width: 100px; }
  .clock-turn { font-size: 10px; }
}
.time-control { margin: 0 0 8px; font-weight: 600; font-size: 14px; }
.time-control span { margin-left: 5px; font-size: 11px; font-weight: 400; color: var(--muted); }
.captured-pieces { display: flex; align-items: center; gap: 5px; height: 19px; }
.capture-icons { display: flex; flex-wrap: nowrap; gap: 3px; }
.capture-group { display: inline-flex; align-items: center; }
.capture-group .mini { width: 20px; height: 20px; }
.capture-group .mini + .mini { margin-left: -12px; }
.material-advantage { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.game-icon:focus-visible, .rules-toggle:focus-visible, .close-rules:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.panel { background: #fffef9b8; border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; align-content: start; align-self: start; gap: 16px; min-width: 0; }
.group { display: grid; gap: 9px; border: 0; margin: 0; padding: 0; min-width: 0; }
.label { font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: 0; }
.seg { display: flex; background: var(--surface-2); border-radius: 11px; padding: 4px; gap: 2px; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg label { flex: 1; text-align: center; padding: 6px 4px; border-radius: 7px; cursor: pointer; font-size: 11px; font-weight: 500; color: var(--muted); white-space: nowrap; transition: background 150ms, box-shadow 150ms; }
.seg input:checked + label { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px #31463c18; }
.seg input:focus-visible + label { outline: 2px solid var(--focus); }
.team-label { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.team-dot { width: 10px; height: 10px; border: 1px solid #bda883; border-radius: 50%; background: #f8eaca; }
.team-dot.blue { background: #285679; border-color: #173b57; }
.check { display: flex; align-items: center; gap: 9px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; flex: none; }
.check small { font-size: 11px; color: var(--muted); }
.actions { display: grid; }
.btn { border-radius: 11px; padding: 11px 8px; font-size: 12px; font-weight: 600; cursor: pointer; border: 1px solid var(--line); background: transparent; transition: background 130ms, transform 130ms; }
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn.primary:hover { background: #2a4a59; }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.rules-dialog { width: min(610px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 100px #19303d40; overscroll-behavior: contain; }
.rules-dialog::backdrop { background: #15252f99; }
.rules-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; background: var(--surface); }
.rules-kicker { margin: 0 0 3px; color: var(--accent); font-size: 11px; }
.rules-header h2 { margin: 0; font-size: 24px; letter-spacing: -.04em; }
/* Крестик рисуется линиями: глиф × у каждого шрифта сидит на своей базовой линии и уходит от центра круга. */
.close-rules { position: relative; flex: none; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-2); font-size: 0; cursor: pointer; }
.close-rules::before, .close-rules::after { content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 2px; border-radius: 1px; background: currentColor; transform: translate(-50%, -50%) rotate(45deg); }
.close-rules::after { transform: translate(-50%, -50%) rotate(-45deg); }
.rules-content { padding: 20px 24px; display: flow-root; }
.rules-content > :not(.rules-close):not([hidden]) ~ :not([hidden]) { margin-top: 23px; }
.rules-close { float: right; position: sticky; top: 14px; z-index: 1; margin: -6px -10px 8px 14px; }
.rules-content > *, .rule-movement > *, .rule-goal > *, .rule-extras > * { min-width: 0; }
.rules-content h3 { margin: 0 0 6px; font-size: 15px; line-height: 1.3; }
.rules-content p { margin: 0; font-size: 12px; color: #64716b; line-height: 1.6; }
.rule-movement { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 22px; }
.movement-demo { width: 112px; aspect-ratio: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); border-radius: 8px; overflow: hidden; }
.demo-square { display: grid; place-items: center; min-height: 0; background: var(--sq-light); color: #365847; font-size: 24px; line-height: 1; }
.demo-square.dark { background: var(--sq-dark); }
.demo-square .mini { width: 35px; height: 35px; }
.rules-matchups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.rule-matchup { padding: 12px 5px; background: var(--surface-2); border-radius: 10px; text-align: center; }
.rule-pieces { display: flex; align-items: center; justify-content: center; gap: 2px; }
.rule-pieces .mini { width: 43px; height: 43px; }
.beats-arrow { color: var(--accent); font-size: 24px; }
.rule-goal { display: grid; grid-template-columns: 120px 1fr; align-items: center; gap: 14px; border: 1px solid #ded7b4; background: #f8f2db; padding: 14px; border-radius: 12px; }
.rule-more summary { display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--muted); font-size: 13px; font-weight: 600; list-style: none; cursor: pointer; }
.rule-more summary::-webkit-details-marker { display: none; }
.rule-more summary::after { content: ''; width: 6px; height: 6px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); transition: transform 150ms; }
.rule-more[open] summary::after { transform: translateY(2px) rotate(225deg); }
.rule-more summary:hover { color: var(--ink); }
.rule-more .rule-extras { margin-top: 12px; }
.rule-extras { display: grid; grid-template-columns: 1fr 1.6fr; gap: 18px; }
.rule-swatch { display: inline-block; width: 11px; height: 11px; border-radius: 2px; margin-right: 6px; }
.last-swatch { background: #e0ce52; }
.premove-swatch { background: #e16b65; }
:root[data-motion='off'] *, :root[data-motion='off'] *::before, :root[data-motion='off'] *::after { animation: none !important; transition: none !important; }
@media (max-width: 719px) and (orientation: portrait) {
  .app { max-width: 520px; }
  .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 8px; }
  .panel { padding: 9px; gap: 7px 10px; grid-template-columns: minmax(100px, 1fr) minmax(0, 1.4fr); }
  .panel > .group:first-child, #online-slot, .actions { grid-column: 1 / -1; }
  .group { gap: 3px; }
  .label { font-size: 9px; letter-spacing: .04em; }
  .seg { padding: 3px; }
  .seg label { font-size: 10px; padding: 5px 2px; }
  .team-label { gap: 4px; }
  .team-dot { width: 8px; height: 8px; }
  .actions .btn { padding: 7px; }
  .board { border-radius: 7px; }
  .pc::before { filter: blur(1px); }
}
@media (max-height: 500px) and (orientation: landscape) {
  body { padding: 4px 10px; }
  .app { grid-template-rows: minmax(0, 1fr); }
  .layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 12px; }
  .panel { padding: 9px; gap: 8px; }
  .group { gap: 4px; }
  .actions .btn { padding: 7px; }
}
@media (max-width: 400px) {
  .rules-header, .rules-content { padding: 16px; }
  .rules-close { top: 10px; margin: -6px -6px 8px 12px; }
  .rules-header h2 { font-size: 21px; }
  .rule-movement { grid-template-columns: 90px minmax(0, 1fr); gap: 14px; }
  .movement-demo { width: 90px; }
  .demo-square .mini { width: 28px; height: 28px; }
  .rules-matchups { gap: 5px; }
  .rule-pieces .mini { width: 27px; height: 27px; }
  .rule-matchup .mini { width: 31px; height: 31px; }
  .beats-arrow { font-size: 18px; }
  .rule-goal { grid-template-columns: 76px minmax(0, 1fr); padding: 10px; }
  .rule-extras { grid-template-columns: 1fr; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* The same quiet palette carries from the welcome screen onto the board. */
.layout.is-home { display: flex; justify-content: center; align-items: center; overflow-y: auto; padding: 20px 0; }
.is-home .panel { position: relative; width: min(100%, 416px); margin: auto; max-height: none; overflow: visible; padding: 30px; grid-template-columns: minmax(0, 1fr); gap: 23px; border-radius: 22px; box-shadow: 0 18px 60px -38px #3f514a70; }
.is-home .back-button { position: absolute; top: 20px; left: 24px; }
.language-switch { display: none; }
.is-home .language-switch { display: flex; position: absolute; top: 14px; right: 14px; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); }
.language-switch button { min-width: 32px; min-height: 30px; padding: 3px 6px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 600; cursor: pointer; }
.language-switch button[aria-pressed='true'] { color: var(--ink); background: var(--surface); box-shadow: 0 1px 4px #31463c18; }
.language-switch button:hover { color: var(--ink); }
.language-switch button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.start-brand { display: grid; justify-items: center; gap: 18px; text-align: center; }
.start-brand h1 { margin: 0; font: 500 23px/1.4 var(--display); letter-spacing: -.055em; }
.game-logo { width: 76px; height: 76px; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; border: 3px solid #e3e8da; border-radius: 15px; overflow: hidden; box-shadow: 0 5px 14px -9px #3f514a88; transform: rotate(-7deg); }
.game-logo > span { display: grid; place-items: center; background: var(--sq-light); }
.game-logo > span:nth-child(2), .game-logo > span:nth-child(3) { background: var(--sq-dark); }
.game-logo .mini { width: 33px; height: 33px; transform: rotate(7deg); }
.home-choices { display: grid; gap: 10px; }
.mode-button { display: flex; width: 100%; align-items: center; gap: 13px; padding: 13px 16px; min-height: 53px; text-align: left; font-size: 13px; border-radius: 12px; }
.mode-button > span { flex: 1; }
.mode-button small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 400; }
.mode-icon, .mode-chevron, .back-button svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mode-icon { opacity: .75; }
.mode-chevron { width: 17px; height: 17px; opacity: .6; transition: transform 220ms; }
#play-computer[aria-expanded='true'] { background: var(--surface-2); }
#play-computer[aria-expanded='true'] .mode-chevron { transform: rotate(180deg); }
.ai-options { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 220ms ease, visibility 220ms; }
.ai-options.expanded { grid-template-rows: 1fr; visibility: visible; }
.ai-options-inner { min-height: 0; overflow: hidden; }
.ai-options-inner .group { margin: 15px 0 12px; gap: 8px; }
.ai-options-inner > .btn { width: 100%; margin-bottom: 5px; }
.is-home .label { font-size: 9px; }
.is-home .seg { padding: 4px; }
.is-home .seg label { padding: 8px 3px; font-size: 11px; }
.back-button { grid-column: 1 / -1; display: inline-flex; align-items: center; justify-self: start; gap: 8px; border: 0; border-radius: 7px; padding: 5px 3px; font-size: 12px; color: var(--muted); background: transparent; cursor: pointer; }
.back-button svg { width: 17px; height: 17px; }
.back-button:hover { color: var(--ink); }
.back-button:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.back-button:disabled { opacity: .4; cursor: wait; }
.game-mode-label { margin: 0; grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.leave-dialog { max-width: 360px; padding: 24px; }
.leave-dialog h2 { margin: 0 0 9px; font-size: 19px; }
.leave-dialog p { margin: 0 0 20px; color: var(--muted); font-size: 12px; }
.leave-dialog form { display: flex; gap: 9px; }
.leave-dialog .btn { flex: 1; }
@media (max-width: 440px) {
  .start-brand h1 { font-size: 21px; }
}
@media (max-height: 780px) {
  .start-brand { gap: 8px; }
  .game-logo { width: 50px; height: 50px; border-radius: 12px; }
  .game-logo .mini { width: 22px; height: 22px; }
  .start-brand h1 { font-size: 18px; }
}

/* During a game the board owns the screen; actions live in an overlay. */
.is-playing .layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 0; overflow: clip; }
.game-header { display: flex; align-items: center; gap: 8px; min-width: 0; }
.game-icon { position: relative; display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0; border: 0; border-radius: 8px; color: var(--ink); background: transparent; cursor: pointer; touch-action: manipulation; }
.game-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.game-icon:hover:not(:disabled) { background: var(--surface-2); }
.game-icon:disabled { opacity: .25; cursor: default; }
.game-header .game-icon { height: 36px; flex: none; color: var(--muted); }
.game-connection { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--danger); font-size: 11px; }
.return-to-live { margin-left: auto; flex: none; border: 0; border-radius: 7px; padding: 8px; background: #f1e8c7; font-size: 11px; cursor: pointer; }
.game-toolbar { display: grid; grid-template-columns: repeat(4, minmax(44px, 1fr)); height: 44px; border-top: 1px solid var(--line); }
.game-toolbar .game-icon { height: 100%; }
.game-toolbar.reviewing { border-color: #c3ad59; }
/* Ничья и сдача — значками, как на Chess.com: ½ и флаг. */
.draw-glyph { font-size: 22px; font-weight: 600; line-height: 1; letter-spacing: -.02em; }
.game-icon .icon-fill { fill: currentColor; }
.game-icon[aria-pressed="true"] { background: #f1e8c7; }
.draw-notification { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 7; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 20px); width: max-content; min-height: 44px; padding: 8px 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); font-size: 12px; box-shadow: 0 4px 18px #19303d30; pointer-events: none; }
.draw-notification.incoming { padding: 5px 5px 5px 14px; pointer-events: auto; }
.draw-notification p { margin: 0 4px 0 0; }
.draw-answer { display: grid; place-items: center; flex: none; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: transparent; color: var(--ink); cursor: pointer; touch-action: manipulation; }
.draw-answer svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.draw-answer.accept { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.draw-answer:hover:not(:disabled) { background: var(--surface-2); }
.draw-answer.accept:hover:not(:disabled) { background: #2a4a59; }
.draw-answer:disabled { opacity: .35; cursor: default; }
.draw-answer:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (max-width: 719px) and (orientation: portrait) {
  .is-playing .app { max-width: none; }
  .is-playing .board-frame { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .is-playing .board, .is-playing .result { border-radius: 0; }
  .is-playing .player-row { padding: 0 10px; }
  .game-header { padding: 0 4px; }
}

/* Режимы игры с компьютером */
.variant-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.variant-list label { white-space: normal; line-height: 1.2; }
.variant-note { margin: 0; min-height: 2.7em; font-size: 12px; line-height: 1.35; color: var(--muted); }
