:root { --bg: #2b2622; --panel: #3a332d; --panel-2: #453d36; --ink: #f1e9dc; --muted: #c9bfb1; --accent: #d9a441; --light: #f2ead8; --dark: #7b9a6d; --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); min-height: 100vh; }
.page { max-width: 1060px; margin: 0 auto; padding: 18px 14px 40px; }
.page-head { text-align: center; margin-bottom: 14px; }
.page-head .eyebrow { margin: 0; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.page-head h1 { margin: 2px 0 6px; font-size: 42px; letter-spacing: .01em; }
.page-head .lede { margin: 0 auto; max-width: 640px; font-size: 15px; color: var(--muted); }
/* game layout: board + side panel */
.game { display: grid; grid-template-columns: minmax(280px, 640px) minmax(240px, 340px); gap: 18px; justify-content: center; align-items: start; }
.board-col { min-width: 0; }
.board-wrap { position: relative; border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.45); background: var(--dark); line-height: 0; }
.board { display: block; width: 100%; height: auto; aspect-ratio: 1; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 6px; outline: none; }
.sq.light { fill: var(--light); } .sq.dark { fill: var(--dark); }
.coord { font: 600 22px var(--font); pointer-events: none; } .coord.on-light { fill: #6e8a63; } .coord.on-dark { fill: #f2ead8; opacity: .9; }
.hl-last { fill: rgba(255, 214, 0, .45); } .hl-sel { fill: rgba(30, 130, 235, .5); } .hl-over { fill: none; stroke: rgba(255,255,255,.85); stroke-width: 6; } .hl-check { pointer-events: none; }
.dot { fill: rgba(20, 20, 20, .22); pointer-events: none; } .cap { fill: none; stroke: rgba(20, 20, 20, .25); stroke-width: 9; pointer-events: none; }
.piece { cursor: grab; transition: transform .16s ease; will-change: transform; } .piece.drag { cursor: grabbing; transition: none; filter: drop-shadow(0 6px 6px rgba(0,0,0,.4)); }
.game.review .board { filter: grayscale(.55) brightness(.9); } .game.review .piece { cursor: default; }
.player-bar { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 4px 6px; font-size: 14px; }
.p-name { font-weight: 700; } .p-think { color: var(--accent); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); animation: pulse 1s ease-in-out infinite; } @keyframes pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }
.p-material { margin-left: auto; display: inline-flex; align-items: center; gap: 1px; } .p-material .pc { width: 16px; height: 16px; } .p-material .plus { margin-left: 5px; font-size: 13px; color: var(--muted); }
/* side panel */
.side { background: var(--panel); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; }
.toolbar button, .nav button, .review-bar button, .dlg-buttons button, .promo-btn { font: 14px var(--font); color: var(--ink); background: var(--panel-2); border: 1px solid #5a5048; border-radius: 6px; padding: 7px 11px; cursor: pointer; }
.toolbar button:hover, .nav button:hover, .dlg-buttons button:hover { background: #544a41; } .toolbar button:disabled { opacity: .45; cursor: default; }
.toolbar button.primary { background: var(--accent); color: #241d12; border-color: #b8862f; font-weight: 700; } .toolbar button.primary:hover { background: #e4b455; }
.toolbar.small button { font-size: 13px; padding: 5px 9px; }
button[aria-pressed="false"] { opacity: .8; }
.status { margin: 0; font-weight: 700; font-size: 16px; } .status.over { color: var(--accent); }
.flash { margin: -6px 0 0; min-height: 20px; font-size: 13px; color: #f0b7a4; }
.moves { list-style: none; margin: 0; padding: 6px 4px; background: #2f2924; border-radius: 6px; max-height: 300px; min-height: 120px; overflow-y: auto; font-variant-numeric: tabular-nums; }
.moves li { display: grid; grid-template-columns: 36px 1fr 1fr; align-items: center; } .moves .num { color: var(--muted); font-size: 13px; padding-left: 6px; }
.moves .mv { font: 15px var(--font); color: var(--ink); background: none; border: 0; text-align: left; padding: 3px 8px; border-radius: 4px; cursor: pointer; } .moves .mv:hover { background: #453d36; } .moves .mv.cur { background: var(--accent); color: #241d12; font-weight: 700; } .moves .gap { color: var(--muted); cursor: default; }
.moves .result { display: block; text-align: center; font-weight: 700; padding: 6px; color: var(--accent); }
.review-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--accent); }
.nav { display: flex; gap: 6px; } .nav button { flex: 1; padding: 5px 0; font-size: 15px; }
.noscript { text-align: center; color: var(--muted); }
/* promotion picker */
.promo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; gap: 8px; padding: 10px; background: rgba(43, 38, 34, .96); border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.6); z-index: 5; }
.promo-btn { width: 64px; height: 64px; padding: 4px; display: flex; align-items: center; justify-content: center; background: var(--light); } .promo-btn:hover, .promo-btn:focus-visible { outline: 3px solid var(--accent); } .promo-btn .pc { width: 52px; height: 52px; }
/* content panels */
.panel { background: var(--panel); border-radius: 8px; padding: 16px 20px; margin: 18px auto 0; max-width: 1000px; }
.panel h2 { font-size: 18px; margin: 6px 0 8px; } .panel h3 { font-size: 15px; margin: 14px 0 2px; } .panel p { margin: 4px 0 8px; color: var(--ink); }
.steps { padding-left: 22px; margin: 0 0 10px; } .steps li { margin: 0 0 8px; }
.cols { columns: 2 280px; column-gap: 22px; padding-left: 20px; margin: 0 0 10px; } .cols li { margin-bottom: 5px; break-inside: avoid; }
.keys { border-collapse: collapse; width: 100%; font-size: 14px; } .keys th { text-align: left; white-space: nowrap; padding: 3px 10px 3px 0; font-weight: 700; color: var(--accent); } .keys td { padding: 3px 18px 3px 0; }
.levels { border-collapse: collapse; font-size: 14px; } .levels th, .levels td { text-align: left; padding: 3px 14px 3px 0; } .levels th { color: var(--accent); }
.note { font-size: 13px; color: var(--muted); }
.foot { color: var(--muted); text-align: center; font-size: 13px; margin-top: 22px; } .foot a { color: var(--ink); }
/* dialogs */
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 12px; }
.dialog { background: var(--panel); color: var(--ink); border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.6); min-width: 280px; max-width: min(94vw, 460px); font-size: 14px; }
.dialog.wide { max-width: min(94vw, 560px); }
.dlg-title { font-weight: 700; padding: 12px 16px 0; font-size: 17px; }
.dlg-body { padding: 10px 16px 4px; } .dlg-body label { display: block; margin-bottom: 6px; }
.dlg-body textarea, .dlg-body select, .dlg-body input[type="text"] { width: 100%; font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--ink); background: #2f2924; border: 1px solid #5a5048; border-radius: 6px; padding: 6px 8px; }
.dlg-body select { font-family: var(--font); font-size: 14px; }
.dlg-body textarea { min-height: 120px; resize: vertical; }
.radios { border: 1px solid #5a5048; border-radius: 6px; padding: 6px 10px 4px; margin: 8px 0 0; } .radios legend { padding: 0 4px; color: var(--muted); } .radios label { margin: 4px 0; }
.dlg-note { color: var(--muted); margin: 6px 0 0; font-size: 13px; }
.dlg-body.msg { display: flex; gap: 14px; align-items: flex-start; } .dlg-body.msg p { margin: 0; white-space: pre-line; }
.msg-icon { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #241d12; font: 700 22px/32px Georgia, serif; text-align: center; }
.dlg-buttons { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 14px; } .dlg-buttons button.default { background: var(--accent); color: #241d12; border-color: #b8862f; font-weight: 700; }
.dlg-buttons button:focus-visible, .toolbar button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.stats { border-collapse: collapse; width: 100%; } .stats th, .stats td { text-align: right; padding: 3px 8px; } .stats th:first-child, .stats td:first-child { text-align: left; }
.tabs { display: flex; gap: 4px; margin-bottom: 8px; } .help-tab { font: 13px var(--font); padding: 5px 10px; background: var(--panel-2); color: var(--ink); border: 1px solid #5a5048; border-radius: 6px; cursor: pointer; } .help-tab[aria-selected="true"] { background: var(--accent); color: #241d12; font-weight: 700; }
.help-panel { min-height: 130px; } .help-panel p { margin: 4px 0 8px; }
.about-body a, .dlg-body a { color: var(--accent); }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); background: #111; color: #fff; padding: 7px 12px; font-size: 13px; border-radius: 4px; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 200; max-width: 90vw; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 760px) { .game { grid-template-columns: 1fr; } .page { padding: 10px 6px 30px; } .page-head h1 { font-size: 32px; } .page-head .lede { font-size: 14px; } .side { padding: 10px; } .moves { max-height: 180px; } .coord { font-size: 26px; } .player-bar { padding: 2px 4px; } }
.player-bar > * { min-width: 0; } .p-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .p-think { flex: none; } .p-material { flex-wrap: wrap; justify-content: flex-end; }
#dlg-stats .dlg-body { overflow-x: auto; }
@media (max-width: 480px) { .p-material .pc { width: 13px; height: 13px; } .player-bar { gap: 6px; } .stats th, .stats td { padding: 3px 4px; font-size: 13px; } .keys tr { display: grid; grid-template-columns: max-content 1fr; column-gap: 10px; } .keys td { padding-right: 0; } }
@media (prefers-reduced-motion: reduce) { #toast, .piece { transition: none; } .pulse { animation: none; } }
