:root {
  color-scheme: light;
  --paper: #f8f5ec;
  --surface: #fffdf6;
  --ink: #262b22;
  --muted: #555a4e;
  --line: #d9d5c5;
  --forest: #263c2d;
  --soft: #e5eadb;
  --rust: #9d3c27;
  --serif: Georgia, 'Hiragino Mincho ProN', 'Yu Mincho', 'Times New Roman', serif;
  --sans: 'Helvetica Neue', Arial, 'Hiragino Sans', 'Yu Gothic', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); }
body { margin: 0; min-height: 100vh; font-family: var(--sans); }
[hidden] { display: none !important; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { touch-action: manipulation; }
a { color: var(--forest); }
:focus-visible { outline: 3px solid var(--rust); outline-offset: 4px; }
.skip { position: fixed; top: 12px; left: 12px; padding: 12px; background: var(--surface); z-index: 5; transform: translateY(-200%); }
.skip:focus { transform: none; }
.sr-only { width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); position: absolute; white-space: nowrap; }
.header { border-bottom: 1px solid var(--line); }
.header-inner, .footer-inner { max-width: 1140px; margin: auto; display: flex; align-items: center; gap: 28px; padding: 0 30px; }
.header-inner { min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--forest); letter-spacing: -.065em; }
.brand-grid { color: var(--rust); }
.brand-mark { display: grid; grid-template-columns: repeat(2, 9px); gap: 2px; transform: rotate(-7deg); }
.brand-mark b { width: 9px; height: 9px; background: var(--forest); border-radius: 1px; }
.brand-mark b:nth-child(2) { background: var(--rust); }
.brand-mark b:nth-child(3) { background: transparent; border: 1px solid var(--forest); }
.header nav { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.header nav a, .language { display: inline-flex; min-height: 42px; align-items: center; color: var(--muted); font-size: 14px; text-decoration: none; white-space: nowrap; }
.header nav a[aria-current=page] { color: var(--forest); font-weight: 700; text-decoration: underline; text-underline-offset: .45em; }
.language { border: 1px solid var(--line); padding: 0 13px; border-radius: 3px; color: var(--forest); }
main { min-height: 72vh; }
.game-layout { margin: 0 auto; max-width: 1140px; display: grid; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr); gap: clamp(28px,5vw,76px); padding: 54px 30px 50px; align-items: start; }
.edition-info { min-width: 0; }
.eyebrow { color: var(--forest); font: 700 11px/1.4 var(--sans); letter-spacing: .16em; display: flex; align-items: center; gap: 9px; }
.eyebrow > span:first-child, .dot { width: 8px; height: 8px; transform: rotate(45deg); background: var(--rust); display: inline-block; }
.edition-no { color: var(--muted); margin-left: 7px; letter-spacing: .05em; border-left: 1px solid var(--line); padding-left: 10px; }
h1 { font-weight: 600; font-family: var(--serif); font-size: clamp(39px, 5.1vw, 76px); line-height: .99; margin: 20px 0 22px; letter-spacing: -.067em; }
h1 em { font-weight: inherit; color: var(--forest); }
html[lang=ja] h1 em { font-style: normal; }
html[lang=ja] h1 { font-size: clamp(32px, 4.5vw, 59px); letter-spacing: -.035em; line-height: 1.14; }
h2 { font: 600 24px/1.18 var(--serif); letter-spacing: -.022em; margin: 25px 0 12px; }
p, li { line-height: 1.62; }
.lead { color: var(--muted); font-size: clamp(16px, 1.5vw, 19px); line-height: 1.6; max-width: 36ch; margin: 0 0 24px; }
.edition-meta { display: flex; gap: 25px; border-block: 1px solid var(--line); padding: 13px 0 14px; margin: 0 0 20px; }
.edition-meta div + div { padding-left: 25px; border-left: 1px solid var(--line); }
.edition-meta dt { text-transform: uppercase; font-weight: 700; font-size: 10px; letter-spacing: .13em; color: var(--muted); margin-bottom: 5px; }
.edition-meta dd { margin: 0; color: var(--forest); font-weight: 700; font-size: 14px; }
.rules { list-style: none; counter-reset: rules; margin: 0; padding: 0; }
.rules li { counter-increment: rules; display: flex; gap: 10px; font-size: 14px; color: var(--muted); align-items: baseline; padding: 2px 0; }
.rules li::before { content: counter(rules, decimal-leading-zero); color: var(--rust); font-size: 11px; font-weight: 700; }
.side-links { margin-top: 21px; display: flex; align-items: center; flex-wrap: wrap; gap: 13px; }
.secondary-button, .control-row button, .hint-panel button, .reset-panel button, .accent-button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border: 1px solid #d2ccba; background: var(--surface); color: var(--forest); padding: 8px 12px; border-radius: 3px; text-decoration: none; font-size: 13px; font-weight: 700; cursor: pointer; }
.accent-button, .control-row button.accent-button, .hint-panel button.accent-button, .reset-panel button.accent-button { background: var(--forest); color: #fffdf6; border-color: var(--forest); }
button:disabled { opacity: .5; cursor: default; }
.text-link { font-size: 14px; text-underline-offset: .25em; }
.play-sheet { min-width: 0; background: var(--surface); padding: clamp(12px, 2vw, 26px); border: 1px solid var(--line); border-radius: 5px; box-shadow: 5px 5px 0 #e8e4d6; }
.sheet-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 13px; gap: 12px; }
.sheet-label { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--forest); letter-spacing: .055em; font-size: 13px; }
.size-chip { padding: 5px 8px; background: var(--soft); color: var(--forest); font-size: 11px; font-weight: 700; border-radius: 2px; white-space: nowrap; }
.board { isolation: isolate; width: 100%; aspect-ratio: 1; display: grid; grid-template-columns: repeat(var(--size), minmax(0,1fr)); grid-template-rows: repeat(var(--size), minmax(0,1fr)); box-shadow: 0 0 0 2px var(--forest); position: relative; background: #fbf8ed; user-select: none; touch-action: none; }
.cell-row { display: contents; }
.cell { min-width: 0; min-height: 0; background: transparent; color: var(--ink); padding: 0; border-radius: 0; border: 1px solid #ddd8ca; margin: -0.5px; touch-action: none; position: relative; z-index: 1; cursor: crosshair; font: 700 clamp(19px, 3vw, 33px)/1 var(--serif); }
.cell.clue { color: #253327; }
.cell:focus-visible { outline: 2px solid var(--rust); outline-offset: -3px; z-index: 2; }
.cell.chosen { background: #ede1cd; }
.cell.spot { outline: 3px solid var(--rust); outline-offset: -5px; z-index: 2; }
.cell.witness { outline: 2px dashed var(--forest); outline-offset: -5px; }
.cell.forced { background: #eadaba; }
.layer-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--size),1fr); grid-template-rows: repeat(var(--size),1fr); pointer-events: none; }
.board-layer { display: block; position: relative; pointer-events: none; margin: 1px; }
.placed-layer { background: #e1ead6; border: 2px solid #59654d; }
.placed-layer[data-color="1"] { background: #f1dacc; border-color: #875d4f; }
.placed-layer[data-color="2"] { background: #dce7e7; border-color: #4d6267; }
.placed-layer[data-color="3"] { background: #efe1bb; border-color: #746238; }
.placed-layer[data-color="4"] { background: #ebdfed; border-color: #745d78; }
.placed-layer[data-color="5"] { background: #e7e9cb; border-color: #686b44; }
.draft-layer { background: rgb(87 111 85 / .18); border: 2px solid var(--forest); }
.candidate-layer { border: 3px dashed var(--rust); background: rgb(170 77 51 / .14); }
.control-row { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 13px; }
.control-row button { flex: 1; white-space: nowrap; }
.hint-panel, .reset-panel { padding: 10px 13px; background: #f3eee0; border-left: 3px solid var(--rust); margin-top: 11px; }
.hint-panel p, .reset-panel p { font-size: 14px; margin: 0 0 7px; }
.hint-panel button + button, .reset-panel button + button { margin-left: 6px; }
.game-note { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0 8px; margin-top: 8px; }
.game-note p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.game-note .progress { font-weight: 700; color: var(--forest); }
.fineprint { display: block; font-size: 11px; color: var(--muted); margin-top: 5px; }
.complete-banner { background: var(--soft); padding: 12px; margin-top: 12px; display: grid; gap: 3px; color: var(--forest); }
.complete-banner span { font-size: 13px; }
[data-share-link] { margin: 12px 0 0; width: 100%; padding: 7px; }
.footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 72px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.footer-inner > span:first-child { font: 700 17px var(--serif); color: var(--forest); }
.footer-note { margin-right: auto; }
.content { max-width: 900px; margin: auto; padding: 52px 30px 56px; }
.content h1 { max-width: 20ch; }
.archive-list { list-style: none; padding: 0; margin: 24px 0 0; border-top: 1px solid var(--line); }
.archive-list li a { display: flex; align-items: center; gap: 15px; min-height: 50px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--forest); }
.archive-list li a:hover { background: var(--surface); }
.archive-issue { color: var(--rust); font-weight: 700; font-size: 13px; }
.archive-list .size-chip { margin-left: auto; }
.vendor-sheet { background: var(--surface); border: 1px solid var(--line); padding: 22px; margin-bottom: 20px; }
.vendor-actions { display: flex; flex-wrap: wrap; gap: 8px; }
[data-vendor-slot] iframe { width: 100%; aspect-ratio: 5 / 3; border: 0; }
.vendor-frame { margin: 0; text-align: center; }
.vendor-frame iframe { max-width: 100%; }
@media (max-width: 720px) {
  .header-inner, .footer-inner { padding: 0 16px; gap: 11px; }
  .header-inner { min-height: 62px; flex-wrap: wrap; }
  .header nav { gap: 12px; }
  .header nav a, .language { font-size: 12px; }
  .language { padding: 0 7px; }
  .brand { font-size: 22px; gap: 5px; }
  .brand-mark { grid-template-columns: repeat(2,6px); }
  .brand-mark b { width: 6px; height: 6px; }
  .game-layout { display: flex; flex-direction: column; padding: 29px 16px 40px; gap: 16px; }
  .edition-info { display: contents; }
  .edition-info .eyebrow { order: 0; }
  .edition-info h1, .edition-info .lead, .edition-meta { order: 1; margin: 0; }
  .edition-info h1 br { display: none; }
  .edition-info h1 em::before { content: ' '; }
  html[lang=ja] .edition-info h1 em::before { content: ''; }
  .edition-meta { width: 100%; padding: 8px 0; }
  .play-sheet { order: 2; width: 100%; }
  .side-rules, .side-links, .edition-info > h2, .edition-info > p:not(.lead), .edition-info > ol, .edition-info > a { order: 3; margin: 0; }
  .footer-inner { min-height: 78px; padding-block: 14px; }
  .footer-note { order: 3; width: 100%; }
  .content { padding: 38px 16px; }
}
