:root {
  color-scheme: light;
  --paper: #f7f4ea;
  --surface: #fffdf6;
  --light: #f4ecd9;
  --green: #8fa68e;
  --deep: #355b43;
  --ink: #263e35;
  --muted: #6e8072;
  --line: #d8dfcf;
  --gold: #e5bc60;
  --danger: #a94943;
  --shadow: 0 8px 30px #263e3509, 0 2px 5px #263e3505;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; background: radial-gradient(ellipse at 5% 20%, #e8edd966, transparent 48%), var(--paper); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: not-allowed; opacity: .45; }
button, input { touch-action: manipulation; }
button:focus-visible, input:focus-visible, a:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #a98638; outline-offset: 3px; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 650; }
button { border: 0; background: none; }
input[type="text"] { width: 100%; min-width: 0; height: 48px; border: 1px solid var(--line); border-radius: 11px; padding: 0 13px; color: var(--ink); background: #fffdf8; }
input[type="text"]::placeholder { color: #8a968b; }
input[type="text"]:focus { border-color: var(--deep); }
label, legend { font-size: .86rem; font-weight: 550; }
label + input { margin-top: 9px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border-radius: 11px; min-height: 44px; padding: 10px 17px; font-size: .9rem; font-weight: 600; line-height: 1.5; text-decoration: none; transition: background .18s, box-shadow .18s, transform .18s; }
.button:not(:disabled):active { transform: translateY(1px); }
.button.primary { background: var(--deep); color: #fffaf0; box-shadow: 0 3px 0 #233e2d; }
.button.primary:not(:disabled):hover { background: #426c50; box-shadow: 0 3px 0 #233e2d, 0 5px 12px #263e351a; }
.button.secondary { background: #eef0e4; border: 1px solid #d5ddcb; }
.button.secondary:not(:disabled):hover { background: #e3e9d9; }
.button.subtle { background: transparent; }
.button.subtle:not(:disabled):hover { background: #e7ecdc; }
.button.full { width: 100%; }
.button-row { display: flex; gap: 10px; margin-top: 18px; }
.button-row > .button { flex: 1; }
.text-button { min-height: 36px; padding: 6px 3px; font-size: .83rem; font-weight: 600; color: var(--deep); text-underline-offset: 4px; }
.text-button:not(:disabled):hover { text-decoration: underline; }
.muted { color: var(--muted); line-height: 1.7; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: .75rem; font-weight: 600; letter-spacing: .08em; line-height: 1.5; }
.tag { display: inline-block; padding: 4px 9px; color: var(--muted); background: #e9ecdf; border-radius: 7px; font-size: .72rem; font-weight: 500; white-space: nowrap; }
.panel { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.site-header { max-width: 1224px; padding: 24px 28px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand img { border-radius: 12px; }
.brand strong { display: block; font-size: 1.15rem; letter-spacing: .025em; line-height: 1.4; }
.brand-subtitle { display: inline-block; white-space: nowrap; }
.header-actions { display: flex; gap: 13px; align-items: center; }
.header-actions .subtle span { display: grid; place-items: center; width: 18px; height: 18px; border: 1px solid var(--muted); border-radius: 50%; font-size: .72rem; }
.profile-button { display: flex; align-items: center; gap: 8px; min-height: 42px; max-width: 190px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 30px; font-size: .82rem; background: #fffdf680; }
.profile-button > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar-dot { width: 19px; height: 19px; border: 4px solid #8fa68e; background: #f4ecd9; border-radius: 50%; flex-shrink: 0; }
.main-shell { max-width: 1200px; margin: auto; padding: 16px 28px 44px; }
.lobby { display: grid; grid-template-columns: 1.2fr 1fr; align-items: center; gap: 70px; min-height: min(720px, calc(100svh - 180px)); }
.lobby-intro { padding: 25px 0; }
.tiny-leaf { width: 10px; height: 15px; border-radius: 9px 1px 9px 1px; transform: rotate(24deg); background: var(--green); }
.lobby h1 { font-size: clamp(2.4rem, 4.2vw, 3.65rem); line-height: 1.37; letter-spacing: -.055em; margin: 21px 0 18px; }
.lobby h1 span { color: #5d7d51; }
.intro-board { position: relative; width: 300px; height: 244px; margin: 14px 0 11px; }
.intro-tile { width: 86px; height: 78px; position: absolute; border-radius: 9px; transform: rotate(-12deg) skew(7deg); box-shadow: 0 6px 0 #c7cfb7; }
.tile-one { background: var(--light); left: 55px; top: 63px; }
.tile-two { background: var(--green); left: 143px; top: 42px; }
.tile-three { background: var(--green); left: 73px; top: 147px; }
.tile-four { background: var(--light); left: 161px; top: 126px; }
.intro-piece { position: absolute; width: 114px; height: 114px; filter: drop-shadow(4px 9px 3px #263e3520); }
.intro-king { left: 32px; top: 6px; transform: rotate(-9deg); }
.intro-rook { left: 151px; top: 84px; transform: rotate(8deg); }
.intro-facts { display: flex; gap: 20px; color: var(--muted); font-size: .75rem; flex-wrap: wrap; }
.intro-facts span::before { content: "✓"; margin-right: 6px; color: #547a4d; }
.lobby-forms { width: 100%; max-width: 430px; }
.mode-picker { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-bottom: 15px; }
.mode-picker button { min-width: 0; min-height: 68px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fffdf680; }
.mode-picker button strong, .mode-picker button small { display: block; }
.mode-picker button strong { font-size: .91rem; font-weight: 600; }
.mode-picker button small { color: var(--muted); font-size: .7rem; line-height: 1.6; margin-top: 3px; }
.mode-picker button[aria-pressed="true"] { border-color: #6b8960; background: #e8eedc; box-shadow: inset 0 0 0 1px #6b8960; }
.mode-picker button:hover { background: #edf1e3; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 22px; }
.setting-row label { flex: 1; }
.setting-row select { max-width: 65%; min-width: 0; min-height: 44px; padding: 8px 9px; color: var(--ink); background: #f6f6eb; border: 1px solid var(--line); border-radius: 9px; }
#lobby-import { width: 100%; margin-top: 15px; }
.local-resume { padding-top: 18px; margin-top: 21px; border-top: 1px solid var(--line); }
.local-resume p { margin-bottom: 10px; font-size: .78rem; }
#peer-panel > .button + .button { margin-top: 13px; }
#peer-panel .small-copy { margin-bottom: 0; }
.offline-note { font-size: .75rem; text-align: center; margin: 18px 10px; }
.offline-download { margin-top: 12px; font-size: .8rem; }
.local-game-actions { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 8px; }
.save-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 2px; margin-top: 6px; }
.save-actions .button { padding: 8px 2px; font-size: .72rem; min-height: 44px; }
.save-status { font-size: .68rem; text-align: center; padding: 4px; overflow-wrap: anywhere; }
.peer-code-section { margin-top: 20px; }
.peer-code-section label { display: block; margin-bottom: 8px; }
.peer-code-section textarea { display: block; width: 100%; resize: vertical; min-height: 110px; max-height: 250px; padding: 12px; background: #f8f8ef; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); font-family: ui-monospace, Consolas, monospace; font-size: .8rem; overflow-wrap: anywhere; }
.peer-code-section .button-row { margin-top: 10px; }
.peer-code-section .small-copy { margin: 8px 0 0; }
.peer-status { font-size: .82rem; line-height: 1.7; margin: 15px 0; }
.turn-card.thinking { border-top-color: #95a86e; }
.turn-card.thinking h2::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 8px; vertical-align: middle; background: #7a965b; animation: thinking-pulse 1s ease-in-out infinite; }
.room-card { padding: 29px; }
.room-card h2 { font-size: 1.62rem; margin: 10px 0; letter-spacing: -.025em; }
.room-card > p { font-size: .86rem; }
.color-picker { border: 0; padding: 0; margin: 24px 0 23px; display: flex; gap: 10px; }
.color-picker legend { margin-bottom: 12px; padding: 0; }
.color-picker label { position: relative; flex: 1; min-width: 0; }
.color-picker input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.color-picker label > span { pointer-events: none; min-height: 103px; display: flex; align-items: center; flex-direction: column; justify-content: center; gap: 3px; border: 1px solid var(--line); border-radius: 12px; background: #f8f7ef; }
.color-picker input:checked + span { border-color: #6b8960; background: #edf0df; box-shadow: 0 0 0 1px #6b8960; }
.color-picker input:focus-visible + span { outline: 3px solid var(--gold); outline-offset: 3px; }
.color-picker small { color: var(--muted); font-size: .65rem; font-weight: 400; }
.random-mark { width: 36px; height: 36px; display: grid; place-items: center; font-size: 1.8rem; font-weight: 400; }
.form-divider { display: flex; align-items: center; gap: 12px; margin: 28px 0 22px; color: var(--muted); font-size: .76rem; }
.form-divider::before, .form-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.join-form label { display: block; margin-bottom: 10px; }
.input-row { display: flex; gap: 9px; }
.input-row .button { flex-shrink: 0; }
.identity-line { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 21px; color: var(--muted); font-size: .69rem; flex-wrap: wrap; }
.identity-line code { max-width: 100%; overflow-wrap: anywhere; font-size: .7rem; }
.resume-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 17px; margin-bottom: 16px; border-radius: 14px; background: #e5ebd9; border: 1px solid #cbd6bd; }
.resume-card strong { font-size: .9rem; }
.resume-card p { margin-top: 5px; font-size: .75rem; color: var(--muted); overflow-wrap: anywhere; }
.resume-card .button { font-size: .76rem; padding: 10px 12px; white-space: nowrap; }
.game { --board-column: clamp(440px, calc(100svh - 350px), 760px); max-width: calc(var(--board-column) + 332px); margin: auto; }
.room-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 7px 0 23px; }
.room-heading h1 { font-size: 1.3rem; margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.room-code { padding: 3px 1px; font-family: ui-monospace, Consolas, monospace; font-size: inherit; font-weight: 650; letter-spacing: .04em; border-bottom: 1px dashed #aab99a; max-width: min(54vw, 500px); overflow: hidden; text-overflow: ellipsis; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 302px; gap: 30px; align-items: start; }
.play-area { min-width: 0; }
.player-card { display: flex; align-items: center; gap: 12px; min-height: 69px; padding: 5px 7px 12px; }
#player-bottom { padding: 14px 7px 5px; }
.player-avatar { width: 45px; height: 45px; flex-shrink: 0; border-radius: 12px; background: #ede8d8; border: 1px solid #d8dfcf; position: relative; }
.player-avatar img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.player-card.is-turn .player-avatar { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px #8ca66d; }
.player-details { min-width: 0; flex: 1; }
.player-name { display: flex; align-items: center; gap: 7px; line-height: 1.5; font-size: .95rem; }
.player-name > strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.you-tag { font-size: .65rem; background: #e4e9d8; padding: 1px 6px; border-radius: 4px; font-weight: 400; }
.player-status { font-size: .73rem; margin-top: 3px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.player-status .connection-dot { width: 6px; height: 6px; }
.player-color { margin-left: auto; font-size: .76rem; color: var(--muted); flex-shrink: 0; }
.board-frame { position: relative; padding: 19px 19px 24px 24px; border-radius: 15px; background: #e6e6d7; border: 1px solid #c6cdbb; box-shadow: 0 5px 0 #c3cbb8, 0 16px 28px #263e3514, inset 0 1px 0 #fff9; }
.board { width: 100%; aspect-ratio: 1; position: relative; overflow: hidden; border-radius: 3px; background: var(--board-image, url('assets/board/board.svg')) center / 100% 100%; box-shadow: 0 0 0 1px #69826950; isolation: isolate; }
.squares-layer, .pieces-layer, .effects-layer { position: absolute; inset: 0; }
.squares-layer { z-index: 1; }
.pieces-layer { z-index: 2; pointer-events: none; }
.effects-layer { z-index: 4; pointer-events: none; }
.square { position: absolute; width: 12.5%; height: 12.5%; padding: 0; border-radius: 0; transition: background .12s; outline-offset: -4px; }
.square::before { content: ""; position: absolute; inset: 0; pointer-events: none; }
.square:hover::before { background: #fff5de2b; }
.square.last::before { background: #f4d96c5e; }
.square.selected::before { background: #ead27078; box-shadow: inset 0 0 0 3px #6c8a4f; }
.square:focus-visible { outline: 3px solid #fae9a7; outline-offset: -4px; z-index: 1; }
.square .legal-hint { position: absolute; pointer-events: none; inset: 0; display: grid; place-items: center; }
.legal-dot { display: block; width: 21%; height: 21%; border-radius: 50%; background: #2649315e; box-shadow: inset 0 0 0 1px #23452812; }
.legal-ring { position: absolute; inset: 5%; border: 5px solid #355b43a0; border-radius: 50%; }
.legal-corners { position: absolute; inset: 0; background: var(--corners-image, url('assets/overlays/swap.svg')) center / 100% 100% no-repeat; }
.piece { position: absolute; width: 12.5%; height: 12.5%; pointer-events: none; transform-origin: 50% 64%; }
.piece-image { position: absolute; width: 94%; height: 94%; left: 3%; top: 3%; object-fit: contain; filter: drop-shadow(0 2px 1px #263e3530); -webkit-user-drag: none; user-select: none; }
.moving-piece { will-change: transform; z-index: 5; }
.moving-piece .piece-image { filter: drop-shadow(0 5px 3px #263e3538); }
.check-glow { position: absolute; inset: 0; border-radius: 18%; pointer-events: none; opacity: 1; background: radial-gradient(ellipse, #e73528ec 12%, #df382cc7 42%, #d7393075 68%, #bd302328 100%); box-shadow: inset 0 0 0 2px #b92d26c2, inset 0 0 14px #c7252b73; animation: check-pulse 2.8s ease-in-out infinite; }
.rank-labels { position: absolute; top: 19px; bottom: 24px; left: 3px; width: 19px; display: grid; grid-template-rows: repeat(8,1fr); }
.file-labels { position: absolute; left: 24px; right: 19px; bottom: 1px; height: 22px; display: grid; grid-template-columns: repeat(8,1fr); }
.rank-labels span, .file-labels span { display: grid; place-items: center; font-family: ui-monospace, monospace; font-size: .7rem; color: #5e705d; }
.board-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 4px 0; min-height: 44px; }
.board-foot p { color: var(--muted); font-size: .78rem; line-height: 1.6; }
.board-foot button { white-space: nowrap; font-size: .75rem; }
.board-legend { display: flex; gap: 18px; font-size: .68rem; color: var(--muted); justify-content: center; margin: 7px 0 12px; }
.board-legend > span { display: flex; align-items: center; gap: 5px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; background: #627b62; }
.legend-ring { width: 12px; height: 12px; border: 2px solid #627b62; border-radius: 50%; }
.legend-corners { width: 14px; height: 14px; background: var(--corners-image, url('assets/overlays/swap.svg')) center / contain no-repeat; }
.game-sidebar { display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.turn-card { padding: 22px; position: relative; overflow: hidden; border-top: 3px solid #9db28b; }
.turn-card h2 { font-size: 1.4rem; letter-spacing: -.03em; margin: 10px 0 8px; line-height: 1.5; }
.turn-card p { font-size: .81rem; }
.turn-card > .button { margin-top: 18px; }
.turn-card.your-turn { background: linear-gradient(130deg, #eef3e4, #fffdf6 85%); border-top-color: #577b47; }
.turn-card.checked { border-top-color: #bc3730; background: #fff0e8; }
.turn-card.finished { border-top-color: #d4ad59; background: #faf3df; }
.offer-card { padding: 18px 20px; background: #f4efdb; border-color: #dcd1a7; }
.offer-card h3 { font-size: 1.05rem; margin: 6px 0; }
.offer-card p { font-size: .8rem; line-height: 1.6; color: #776f54; }
.offer-card .button-row { margin-top: 13px; }
.offer-card small { display: block; font-size: .7rem; margin-top: 10px; }
.history-card { overflow: hidden; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; padding: 18px 19px 13px; }
.panel-heading h2 { font-size: 1rem; }
.panel-heading > span { font-size: .72rem; }
.history-columns { display: grid; grid-template-columns: 38px 1fr 1fr; gap: 5px; padding: 8px 15px; font-size: .68rem; color: var(--muted); border-top: 1px solid #e8e9de; border-bottom: 1px solid #e8e9de; background: #f5f6ec; }
.move-list { height: 250px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #c3cdb7 transparent; overscroll-behavior: contain; }
.empty-history { display: grid; place-content: center; text-align: center; height: 100%; min-height: 120px; color: #798772; font-size: .85rem; gap: 9px; }
.empty-history span { font-size: .69rem; color: #9ba38e; }
.move-row { display: grid; grid-template-columns: 33px minmax(0,1fr) minmax(0,1fr); align-items: stretch; gap: 3px; padding: 3px 10px; min-height: 36px; }
.move-row:nth-child(even) { background: #f4f5e954; }
.move-number { color: #9aa28f; align-self: center; padding-left: 5px; font-size: .7rem; font-variant-numeric: tabular-nums; }
.move-button { min-width: 0; border-radius: 5px; padding: 7px 6px; text-align: left; font-size: .72rem; line-height: 1.6; white-space: normal; overflow-wrap: anywhere; }
.move-button:hover { background: #e9efdd; }
.move-button.current { background: #dce8cf; color: #33583b; font-weight: 650; }
.history-controls { display: flex; align-items: center; justify-content: space-around; border-top: 1px solid var(--line); padding: 6px 5px; background: #fafbf2; }
.history-controls > span { font-size: .72rem; color: var(--muted); min-width: 61px; text-align: center; font-variant-numeric: tabular-nums; }
.mobile-replay, .mobile-panel-picker, .mobile-live-label { display: none; }
.icon-button { min-width: 38px; height: 39px; font-size: 1.3rem; border-radius: 7px; }
.icon-button:not(:disabled):hover { background: #e7ecdc; }
.review-notice { display: flex; align-items: center; justify-content: space-between; padding: 4px 12px; gap: 5px; font-size: .7rem; color: #766635; background: #f5e8b6; }
.review-notice .text-button { font-size: .7rem; white-space: nowrap; color: #65592e; }
.game-actions { padding: 9px 13px; }
.action-buttons { display: flex; gap: 4px; }
.action-buttons > button { flex: 1; white-space: nowrap; font-size: .76rem; padding: 10px 5px; }
.game-actions > .full { margin: 8px 0; }
.resign-button { width: 100%; color: #977064; text-align: center; font-size: .71rem; padding: 8px 2px; }
.presentation-settings { display: grid; gap: 3px; }
.motion-setting, .sound-setting { display: flex; align-items: center; gap: 7px; min-height: 36px; font-size: .72rem; font-weight: 400; margin: 0 5px; color: var(--muted); cursor: pointer; }
.motion-setting input, .sound-setting input { accent-color: var(--deep); width: 15px; height: 15px; }
.motion-setting > span, .sound-setting > span { font-size: .66rem; margin-left: auto; }
.lobby-sound-setting { margin: 12px 8px 0; min-height: 44px; }
.site-footer { max-width: 1144px; margin: auto; padding: 21px 0 25px; display: flex; align-items: center; gap: 15px; border-top: 1px solid #d8dfcf80; color: #96a08c; font-size: .69rem; }
.site-footer > span:first-child { font-weight: 600; letter-spacing: .06em; color: #7f8d73; }
.footer-connection { margin-left: auto; }
.connection-banner { max-width: 1144px; margin: 0 auto 5px; padding: 8px 14px; background: #f3e6be; border: 1px solid #e2d098; border-radius: 10px; display: flex; align-items: center; gap: 8px; color: #766439; font-size: .79rem; }
.connection-banner > span:nth-child(2) { flex: 1; }
.connection-banner .text-button { font-size: .75rem; white-space: nowrap; color: #756039; }
.connection-dot { display: inline-block; width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; background: #a78e4e; }
.connection-dot.online { background: #709260; }
.connection-dot.offline { background: #b6ada0; }
.inline-error { color: var(--danger); font-size: .8rem; line-height: 1.65; margin-top: 14px; }
.modal { color: var(--ink); background: var(--surface); border: 1px solid #d4dbc9; border-radius: 22px; padding: 32px; width: min(620px, calc(100% - 32px)); max-height: calc(100svh - 48px); box-shadow: 0 30px 90px #172c3240; overflow-y: auto; }
.modal::backdrop { background: #243b3269; backdrop-filter: blur(5px); }
.compact-modal { max-width: 420px; }
.modal h2 { margin: 13px 0 12px; font-size: 1.55rem; line-height: 1.45; letter-spacing: -.03em; padding-right: 10px; }
.modal h3 { font-size: 1rem; margin-bottom: 7px; }
.modal > p, .modal form > p { font-size: .86rem; }
.modal-close { position: absolute; right: 14px; top: 12px; width: 34px; height: 34px; border-radius: 50%; background: #eff1e7; font-size: 1.4rem; color: var(--muted); }
.modal-close:hover { background: #e3e9d8; }
.modal form { margin-top: 21px; }
.small-copy { font-size: .75rem !important; line-height: 1.7; margin: 14px 0 20px; }
.promotion-modal { max-width: 490px; text-align: center; }
.promotion-options { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin: 23px 0 4px; }
.promotion-choice { display: flex; flex-direction: column; align-items: center; gap: 9px; min-width: 0; border: 1px solid var(--line); border-radius: 13px; padding: 13px 6px; background: #f4f1e4; }
.promotion-choice:hover { background: #e3ebd5; border-color: #87a46b; }
.promotion-choice img { width: 100%; aspect-ratio: 1; max-width: 84px; }
.promotion-choice span { font-size: .86rem; }
.help-section { display: flex; gap: 15px; margin: 25px 0; }
.help-number { display: grid; place-items: center; width: 29px; height: 29px; flex-shrink: 0; border-radius: 8px; background: #e6edda; color: #668153; font-size: .71rem; font-family: ui-monospace, monospace; }
.help-section p { color: var(--muted); font-size: .84rem; line-height: 1.85; margin: 7px 0; }
.help-tip { border-radius: 10px; background: #f1f2e7; color: #6e7b65; line-height: 1.8; padding: 12px 14px; margin: 20px 0; font-size: .75rem !important; }
.claim-options { display: grid; gap: 9px; margin-top: 18px; }
.claim-option { padding: 12px 15px; border: 1px solid var(--line); border-radius: 10px; text-align: left; background: #f3f4e9; line-height: 1.8; font-size: .84rem; }
.claim-option:hover { background: #e6edd9; }
#share-dialog label { display: block; margin-top: 20px; }
#share-url { font-family: ui-monospace, monospace; font-size: .8rem; margin-bottom: 20px; }
.toast { position: fixed; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 13px 21px; border-radius: 12px; color: #fff8e5; background: #304a3df2; box-shadow: 0 9px 27px #263e352e; max-width: min(560px, calc(100vw - 36px)); width: max-content; font-size: .85rem; line-height: 1.6; z-index: 50; pointer-events: none; }
.toast.error { background: #854e40f2; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -70px; left: 15px; z-index: 100; padding: 12px 20px; background: var(--surface); border-radius: 9px; }
.skip-link:focus { top: 10px; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; padding: 30px; background: var(--paper); z-index: 100; }
@keyframes check-pulse { 0%, 100% { opacity: .84; } 50% { opacity: 1; } }
@keyframes thinking-pulse { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }
@media (min-width: 1400px) { .main-shell { max-width: 1280px; } }
@media (max-width: 1050px) { .lobby { gap: 30px; } .lobby h1 { font-size: 2.8rem; } .game-layout { gap: 21px; grid-template-columns: minmax(0, 1fr) 272px; } .turn-card { padding: 18px; } .main-shell { padding-left: 22px; padding-right: 22px; } .site-footer, .connection-banner { margin-left: 22px; margin-right: 22px; } .move-list { height: 210px; } }
@media (max-width: 800px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .play-area { width: 100%; max-width: 640px; margin: auto; }
  .game-sidebar { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 14px; align-items: start; }
  .history-card { grid-column: 2; grid-row: 1 / span 3; }
  .turn-card, .offer-card, .game-actions { grid-column: 1; }
  .presentation-settings { grid-column: 1 / -1; }
  .lobby { gap: 24px; }
  .lobby h1 { font-size: 2.25rem; }
  .room-card { padding: 23px; }
  .intro-facts { gap: 9px; font-size: .67rem; }
}
@media (max-width: 650px) {
  :root { -webkit-text-size-adjust: 100%; }
  .site-header { padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); gap: 8px; }
  .brand { min-width: 0; gap: 7px; }
  .brand img { width: 34px; height: 34px; }
  .brand strong { font-size: .94rem; max-width: 103px; letter-spacing: 0; line-height: 1.25; }
  .brand-subtitle { display: block; }
  .header-actions { gap: 3px; }
  .header-actions .button { min-height: 44px; padding: 7px 9px; font-size: .8rem; }
  .header-actions .subtle span { display: none; }
  .profile-button { padding: 6px 9px; max-width: 112px; font-size: .8rem; min-height: 44px; }
  .avatar-dot { width: 14px; height: 14px; border-width: 3px; }
  .main-shell { padding: 4px max(8px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
  input[type="text"], select, .peer-code-section textarea { font-size: 16px; }
  .button, .text-button, .modal-close { min-height: 44px; }
  .lobby { display: block; min-height: 0; max-width: 470px; margin: auto; }
  .lobby-intro { padding: 14px 12px 18px; position: relative; }
  .lobby h1 { font-size: 2.1rem; line-height: 1.3; margin: 12px 0; }
  .intro-board { display: none; }
  .intro-facts { margin-top: 12px; gap: 14px; font-size: .7rem; }
  .lobby-forms { max-width: none; }
  .mode-picker { gap: 7px; margin-bottom: 12px; }
  .mode-picker button { padding: 11px 12px; min-height: 68px; }
  .mode-picker button small { font-size: .72rem; }
  .setting-row { gap: 8px; }
  .setting-row select { padding-left: 8px; padding-right: 3px; }
  .save-actions .button { font-size: .83rem; }
  .save-status { font-size: .73rem; }
  .peer-code-section .button { font-size: .83rem; padding: 9px 8px; }
  .room-card { padding: 20px; }
  .room-card h2 { font-size: 1.35rem; }
  .color-picker { margin: 17px 0 20px; }
  .color-picker label > span { min-height: 88px; }
  .form-divider { margin: 21px 0 18px; }
  .game { max-width: 520px; }
  .room-bar { padding: 0 3px 8px; gap: 8px; }
  .room-heading { min-width: 0; }
  .room-heading h1 { font-size: .96rem; gap: 5px; margin-top: 0; }
  .room-code { min-height: 44px; letter-spacing: 0; }
  .room-heading .eyebrow { display: none; }
  .room-bar > .button { padding: 8px; min-height: 44px; font-size: .78rem; white-space: nowrap; flex-shrink: 0; }
  .room-bar .tag { font-size: .62rem; }
  .game-layout { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .play-area { grid-row: 2; width: 100%; }
  .board-frame { padding: 4px 4px 18px 17px; border-radius: 9px; }
  .rank-labels { top: 4px; bottom: 18px; left: 0; width: 17px; }
  .file-labels { left: 17px; right: 4px; height: 17px; }
  .rank-labels span, .file-labels span { font-size: .67rem; }
  .player-card { min-height: 48px; gap: 9px; padding: 4px 7px 9px; }
  #player-bottom { min-height: 49px; padding: 11px 7px 3px; }
  .player-avatar { width: 32px; height: 32px; border-radius: 9px; }
  .player-name { font-size: .86rem; }
  .player-status { font-size: .67rem; }
  .player-color { font-size: .7rem; }
  .board-foot { padding: 0 5px; gap: 8px; }
  .board-foot p { font-size: .76rem; }
  .board-foot button { font-size: .76rem; padding: 7px; }
  .board-legend { font-size: .69rem; gap: 17px; margin: 11px 0 0; }
  .legal-ring { border-width: 3px; }
  .game-sidebar { display: contents; }
  .turn-card { grid-column: 1; grid-row: 1; padding: 9px 13px; border-radius: 11px; border-top-width: 2px; }
  .turn-card .eyebrow { font-size: .7rem; letter-spacing: .03em; float: right; margin: 3px 0 0 8px; }
  .turn-card h2 { font-size: 1.02rem; margin: 0; line-height: 1.5; }
  .turn-card p, .turn-card > .button { display: none; }
  .turn-card.finished p { display: block; font-size: .77rem; margin-top: 5px; }
  .offer-card { grid-column: 1; grid-row: 3; padding: 14px 17px; }
  .mobile-replay { display: block; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  .mobile-replay .history-controls { border-top: 0; padding: 3px 5px; }
  .mobile-replay .icon-button { min-width: 44px; min-height: 44px; height: 44px; }
  .mobile-replay #history-live { min-width: 66px; color: var(--deep); }
  .mobile-live-label { display: inline; font-size: .88rem; font-weight: 600; }
  .desktop-live-symbol { display: none; }
  .mobile-panel-picker { display: flex; grid-column: 1; grid-row: 4; gap: 4px; padding: 4px; border-radius: 12px; background: #e7ebde; }
  .mobile-panel-picker button { flex: 1; min-height: 44px; border-radius: 9px; font-size: .9rem; }
  .mobile-panel-picker button[aria-pressed="true"] { background: var(--surface); color: var(--deep); font-weight: 600; box-shadow: 0 2px 5px #263e3510; }
  .history-card, .game-actions { grid-column: 1; grid-row: 5; }
  .game[data-mobile-panel="actions"] .history-card { display: none; }
  .game[data-mobile-panel="history"] .game-actions, .game[data-mobile-panel="history"] .presentation-settings { display: none; }
  .move-list { height: 194px; }
  .history-columns, .move-row { grid-template-columns: 40px minmax(0,1fr) minmax(0,1fr); }
  .move-button { font-size: .86rem; min-height: 44px; }
  .game-actions { padding: 10px 13px; }
  .action-buttons { gap: 8px; }
  .action-buttons > button { font-size: .88rem; min-height: 48px; border: 1px solid var(--line); background: #f2f4e9; }
  .resign-button { font-size: .82rem; }
  .presentation-settings { grid-column: 1; grid-row: 6; }
  .motion-setting, .sound-setting { min-height: 44px; font-size: .8rem; padding: 0 8px; }
  .motion-setting input, .sound-setting input { width: 20px; height: 20px; }
  .site-footer { margin: 0 18px; padding: 20px 0; gap: 10px; font-size: .61rem; }
  .connection-banner { margin: 0 8px 8px; padding: 5px 11px; font-size: .77rem; }
  .connection-banner .text-button { font-size: .7rem; }
  .modal { padding: 25px 22px calc(22px + env(safe-area-inset-bottom)); border-radius: 20px 20px 12px 12px; max-width: none; width: calc(100% - 16px); max-height: calc(100dvh - 24px); margin: auto 8px max(8px, env(safe-area-inset-bottom)); overscroll-behavior: contain; }
  .modal-close { width: 44px; right: 8px; top: 7px; }
  .modal h2 { font-size: 1.4rem; }
  #share-url { font-size: 16px; }
  .promotion-options { gap: 7px; }
  .promotion-choice { padding: 9px 4px; }
  .help-section { gap: 10px; }
}
@media (max-width: 380px) { .brand { gap: 5px; } .header-actions .button { padding-left: 6px; padding-right: 6px; } .profile-button { max-width: 93px; } .lobby h1 { font-size: 1.9rem; } .intro-facts { gap: 9px; } .room-card { padding: 17px; } .room-bar .tag { display: none; } }
@media (hover: none) { .square:hover::before { background: transparent; } .square.last::before { background: #f4d96c5e; } .square.selected::before { background: #ead27078; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
html[data-reduced-motion="true"] *, html[data-reduced-motion="true"] *::before, html[data-reduced-motion="true"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { .check-glow { opacity: 1; } }
html[data-reduced-motion="true"] .check-glow { opacity: 1; }
