:root { color-scheme: dark; font-family: 'Inter', system-ui, sans-serif; color: #eef3f3; background: #141b20; --muted: #a7b9bf; --line: #36454d; --accent: #c4e6d3; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
a { color: inherit; text-underline-offset: 4px; }
button, input { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible { outline: 3px solid #e8c86e; outline-offset: 3px; }
.masthead { width: min(1280px, calc(100% - 64px)); min-height: 94px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 21px; font-weight: 650; letter-spacing: -.04em; }
.brand > span { font: 40px/1 'Segoe UI Symbol', serif; color: var(--accent); }
.edition { color: var(--muted); font-size: 13px; }
.layout { width: min(1180px, calc(100% - 64px)); margin: 30px auto 42px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, .7fr); gap: clamp(30px, 5vw, 80px); align-items: start; }
.table { min-width: 0; }
.player { display: flex; gap: 10px; align-items: center; min-height: 41px; padding: 0 0 10px 24px; font-size: 15px; font-weight: 600; }
.player.near { padding: 10px 0 0 24px; }
.player::before { content: ''; width: 10px; height: 10px; border-radius: 50%; border: 1px solid #9db1bb; background: #1c272d; flex-shrink: 0; }
.player.white::before { background: #f2f4e9; }
.player.active { color: var(--accent); }
.player-status { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--muted); }
.board-frame { display: grid; grid-template-columns: 24px minmax(0, 1fr); grid-template-rows: auto 24px; }
.board { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); aspect-ratio: 1; background: #cfdad8; box-shadow: 0 18px 50px #0003; }
.ranks { display: grid; grid-template-rows: repeat(8, 1fr); }
.files { display: grid; grid-template-columns: repeat(8, 1fr); grid-column: 2; }
.ranks span, .files span { display: grid; place-items: center; color: #a9bec5; font: 12px/1 system-ui, sans-serif; }
.square { position: relative; display: grid; place-items: center; padding: 0; border: 0; border-radius: 0; aspect-ratio: 1; background: #dce5df; touch-action: manipulation; overflow: hidden; }
.square.dark { background: #66828a; }
.square.recent { box-shadow: inset 0 0 0 100px #e6d47740; }
.square.selected { background: #d6bd67; }
.square.check { background: #c86a60; }
.square .piece { position: relative; z-index: 1; font-family: 'Segoe UI Symbol', 'Noto Sans Symbols 2', 'Apple Symbols', serif; font-size: clamp(26px, 4.9vw, 62px); line-height: 1; color: #15252f; }
.square .piece.white { color: #fffdf0; -webkit-text-stroke: 1px #283e46; text-shadow: 0 2px 2px #1c30353b; }
.square.can-select:hover { background: #b6ccbf; }
.square.destination::after { content: ''; position: absolute; width: 23%; aspect-ratio: 1; background: #18323966; border-radius: 50%; }
.square.capture::after { width: 87%; background: transparent; border: 5px solid #263d4670; }
.board-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-left: 24px; color: var(--muted); font-size: 12px; }
button:not(.square) { border: 1px solid #526771; border-radius: 5px; background: #26353e; color: #f2f5ef; padding: 10px 13px; min-height: 44px; font-size: 14px; }
button:not(.square):hover:not(:disabled) { background: #354c57; }
button:disabled { opacity: .5; cursor: default; }
button.text { border: none; background: transparent; padding-inline: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; }
.panel { padding-top: 37px; min-width: 0; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--accent); margin: 0 0 18px; }
h1 { font: 400 clamp(44px, 6vw, 86px)/.95 'STIX Two Text', 'Georgia', serif; letter-spacing: -.05em; margin: 0 0 23px; }
.intro { font-size: 17px; line-height: 1.65; color: var(--muted); margin: 0 0 28px; max-width: 360px; }
button.primary { width: 100%; background: var(--accent); border-color: var(--accent); color: #162d27; font-weight: 650; min-height: 52px; }
button.primary:hover:not(:disabled) { background: #e1f4e9; }
.small { font-size: 13px; color: var(--muted); line-height: 1.55; }
label { display: block; font-size: 14px; margin-bottom: 8px; }
input { width: 100%; min-width: 0; min-height: 44px; padding: 9px 10px; color: #f2f5ef; border: 1px solid #526771; border-radius: 5px; background: #1c2930; }
.input-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.input-row input { font-size: 12px; font-family: 'Consolas', monospace; }
.game-state { font-size: 18px; line-height: 1.5; margin: 22px 0 16px; color: var(--accent); }
.moves-wrap { border-block: 1px solid var(--line); padding-block: 14px; }
h2 { font-size: 14px; font-weight: 500; margin: 0 0 12px; color: var(--muted); }
.moves { max-height: 174px; overflow-y: auto; margin: 0; padding: 0; list-style: none; font: 14px/1.7 'Consolas', monospace; font-variant-numeric: tabular-nums; scrollbar-width: thin; }
.moves li { display: grid; grid-template-columns: 32px 1fr 1fr; gap: 10px; padding: 2px 8px; }
.moves li:nth-child(odd) { background: #ffffff06; }
.moves .move-number { color: #91a6b0; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 15px; }
.recovery, .rules { margin-top: 24px; padding-top: 15px; border-top: 1px solid var(--line); }
summary { font-size: 14px; color: var(--muted); cursor: pointer; }
details p { font-size: 14px; color: var(--muted); line-height: 1.6; }
.feedback { padding: 11px 13px; font-size: 14px; line-height: 1.5; color: #f5d399; border-left: 2px solid #dfbf72; background: #d9b86609; }
.new-game { display: inline-block; margin: 14px 0; }
.confirmation p { font-size: 14px; line-height: 1.5; }
#recover-form { margin: 15px 0; }
#recover-form button { margin-top: 8px; }
dialog { max-width: calc(100% - 30px); padding: 22px; background: #1c2930; border: 1px solid #526771; border-radius: 8px; color: #edf4ef; }
dialog::backdrop { background: #091013b8; }
.promotion-options { display: flex; gap: 8px; }
.promotion-options button { font: 45px/1 'Segoe UI Symbol', serif; min-width: 54px; }
@media (min-width: 1300px) { .square .piece { font-size: 62px; } }
@media (max-width: 800px) {
  .masthead { width: calc(100% - 32px); min-height: 72px; }
  .edition { max-width: 150px; text-align: right; font-size: 11px; line-height: 1.4; }
  .layout { width: min(580px, calc(100% - 24px)); grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; }
  .panel { padding: 16px 12px 0; }
  .layout.lobby .panel { grid-row: 1; padding-top: 12px; }
  .layout.lobby .table { margin-top: 6px; }
  .layout.lobby .rules { display: none; }
  h1 { font-size: 48px; margin-bottom: 13px; }
  .eyebrow { margin-bottom: 12px; }
  .intro { font-size: 15px; line-height: 1.5; max-width: none; margin-bottom: 16px; }
  .square .piece { font-size: clamp(27px, 8.5vw, 56px); }
  .player { font-size: 14px; }
  .player-status { font-size: 12px; }
  .layout:not(.lobby) .panel > .eyebrow, .layout:not(.lobby) .intro { display: none; }
  .layout:not(.lobby) h1 { font-size: 32px; }
  .layout:not(.lobby) .game-state { margin: 0 0 12px; font-size: 16px; }
}
@media (max-width: 360px) { .edition { display: none; } .brand { font-size: 19px; } .promotion-options { gap: 5px; } .promotion-options button { min-width: 48px; padding-inline: 6px; } }
