@font-face { font-family: 'Zen Kaku Gothic New'; font-weight: 400; font-display: swap; src: url(/fonts/zen-kaku-gothic-new-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Zen Kaku Gothic New'; font-weight: 400; font-display: swap; src: url(/fonts/zen-kaku-gothic-new-latin-ext-400-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Zen Kaku Gothic New'; font-weight: 500; font-display: swap; src: url(/fonts/zen-kaku-gothic-new-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Zen Kaku Gothic New'; font-weight: 700; font-display: swap; src: url(/fonts/zen-kaku-gothic-new-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Zen Old Mincho'; font-weight: 400; font-display: swap; src: url(/fonts/zen-old-mincho-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Zen Old Mincho'; font-weight: 600; font-display: swap; src: url(/fonts/zen-old-mincho-latin-600-normal.woff2) format('woff2'); }

:root {
  --room: #E8EAE7; --paper: #FCFCFA; --sumi: #1B1C1A; --muted: #5A5F5A; --hair: #C9CDC8; --rule: #8F958F;
  --sans: 'Zen Kaku Gothic New', 'Hiragino Sans', 'Yu Gothic', sans-serif;
  --serif: 'Zen Old Mincho', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --paper-size: min(760px, 100vw);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--room); color: var(--sumi); font: 400 15px/1.7 var(--sans); }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sumi); outline-offset: 2px; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: 52px; }
.mark { font: 600 20px/1 var(--serif); text-decoration: none; letter-spacing: .01em; }
.top nav { display: flex; gap: 4px; }
.top nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; text-decoration: none; color: var(--muted); font-size: 14px; }
.top nav a:hover { color: var(--sumi); }

.axis { width: var(--paper-size); margin: 0 auto; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 12px 16px 12px; border-bottom: 1px solid var(--hair); }
h1 { margin: 0; font: 400 23px/1.25 var(--serif); letter-spacing: .005em; }
.where { margin: 2px 0 0; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.live { margin: 0 0 2px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sumi); }

.stage { position: relative; }
.frame { position: relative; width: var(--paper-size); height: var(--paper-size); background: var(--paper); overflow: hidden; touch-action: none; }
.frame canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.frame.pan canvas { cursor: grab; }
.frame.report canvas { cursor: help; }
.frame.view canvas { cursor: default; }
.msg { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 24px; color: var(--muted); font-size: 14px; pointer-events: none; }
.msg strong { display: block; font: 400 22px/1.3 var(--serif); color: var(--sumi); margin-bottom: 6px; }

.stage { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 1px; row-gap: 2px; padding-bottom: 10px; }
.frame { flex: 0 0 100%; margin-bottom: 8px; }
.rail { display: contents; }
.rail .sep { display: none; }
.ink { order: 1; } .brk { order: 2; flex-basis: 100%; height: 0; } .wd { order: 3; } .act { order: 4; }
.wd + .act, .act.gap { margin-left: 6px; }
.ring.dk { display: none; }
.ring { position: relative; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: 1px solid transparent; background: none; display: grid; place-items: center; cursor: pointer; padding: 0; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
.ring:hover { border-color: var(--hair); }
.ring[aria-pressed=true] { border-color: var(--sumi); }
.ring:disabled { opacity: .35; cursor: default; border-color: transparent; }
.ring svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ink i { width: 22px; height: 22px; border-radius: 50%; background: var(--c); }
.wd i { border-radius: 50%; background: var(--sumi); }

.far { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--hair); }
.far p { margin: 0; font-size: 14px; color: var(--muted); max-width: 46ch; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; background: var(--sumi); color: var(--paper); text-decoration: none; border: 0; border-radius: 0; font-weight: 500; font-size: 14px; white-space: nowrap; cursor: pointer; }
.btn:hover { background: #33352f; }

.scale { padding: 20px 16px 8px; }
.scale ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; }
.scale li { text-align: left; font-size: 12px; color: var(--muted); border-left: 1px solid var(--hair); padding: 0 0 0 8px; }
.scale li:first-child { border-left-color: var(--sumi); }
.scale .sw { height: 14px; margin: 4px 8px 6px 0; background: rgba(27, 28, 26, var(--a)); outline: 1px solid var(--hair); outline-offset: -1px; }
.scale .n { font: 400 22px/1 var(--serif); color: var(--sumi); font-variant-numeric: tabular-nums lining-nums; }
.scale li.on { color: var(--sumi); }
.scale li.on .sw { outline: 1px solid var(--sumi); }
.scale.scrub li { cursor: pointer; }
.cap { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

.replay { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: rgba(252, 252, 250, .92); border-top: 1px solid var(--hair); font-size: 13px; font-variant-numeric: tabular-nums; }
.replay #rtime { flex: 1; }
.text { background: none; border: 0; min-height: 44px; padding: 0 10px; cursor: pointer; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.about { padding: 40px 16px 24px; border-top: 1px solid var(--hair); margin-top: 24px; }
h2 { margin: 0 0 16px; font: 400 20px/1.3 var(--serif); }
.cols p { margin: 0 0 12px; color: #2f312d; }
.rules { margin: 8px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.rules li { padding: 10px 0; border-top: 1px solid var(--hair); }

.foot { width: var(--paper-size); margin: 0 auto; display: flex; gap: 20px; padding: 24px 16px 40px; font-size: 13px; color: var(--muted); }
.foot span { font-family: var(--serif); color: var(--sumi); margin-right: auto; }
.foot a { min-height: 24px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 8px); max-width: calc(100vw - 32px); padding: 12px 18px; background: var(--sumi); color: var(--paper); font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .18s var(--ease), transform .18s var(--ease); z-index: 10; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

dialog { border: 1px solid var(--sumi); background: var(--paper); color: var(--sumi); padding: 24px; max-width: 360px; border-radius: 0; }
dialog::backdrop { background: rgba(232, 234, 231, .7); }
dialog h3 { margin: 0 0 8px; font: 400 20px/1.3 var(--serif); }
dialog p { margin: 0 0 20px; font-size: 14px; color: var(--muted); }
dialog .opts { display: grid; gap: 8px; margin: 16px 0; }
dialog .row { display: flex; gap: 8px; justify-content: flex-end; }
.btn.ghost { background: none; color: var(--sumi); border: 1px solid var(--rule); }

@media (min-width: 900px) {
  :root { --paper-size: min(760px, calc(100vh - 260px), calc(100vw - 240px)); --paper-size: max(480px, min(760px, calc(100vh - 260px), calc(100vw - 240px))); }
  .top { padding: 0 32px; }
  .head { padding: 18px 0 14px; }
  h1 { font-size: 30px; }
  .stage { display: block; padding: 0; }
  .frame { margin: 0; }
  .rail { position: absolute; top: 0; bottom: 0; width: 56px; display: flex; flex-direction: column; justify-content: flex-start; align-items: center; gap: 2px; }
  .brk { display: none; }
  .rail > * { order: 0; }
  .ring.dk { display: grid; }
  .wd + .act, .act.gap { margin-left: 0; }
  .rail.left { right: calc(100% + 28px); }
  .rail.right { left: calc(100% + 28px); }
  .rail .sep { display: block; flex: 0 0 1px; width: 24px; background: var(--hair); margin: 8px 0; }
  .scale, .about, .far { padding-left: 0; padding-right: 0; }
  .about .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
  .foot { padding-left: 0; padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

.page { min-height: 60vh; }
.walls { list-style: none; margin: 0 0 16px; padding: 0 16px; }
.walls li { border-bottom: 1px solid var(--hair); }
.walls a { display: grid; grid-template-columns: 40px 1fr; gap: 2px 12px; padding: 14px 0; text-decoration: none; min-height: 44px; }
.walls .no { grid-row: span 2; font: 400 20px/1.3 var(--serif); color: var(--muted); font-variant-numeric: tabular-nums; }
.walls .nm { font: 400 19px/1.35 var(--serif); }
.walls a:hover .nm { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.walls small { font: 400 12px var(--sans); color: var(--muted); letter-spacing: .04em; }
.walls .st { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.walls .st b { font-weight: 500; color: var(--sumi); }
.walls .mine .no { color: var(--sumi); }
.walls .empty { padding: 24px 0; color: var(--muted); }
.page .cap { padding: 0 16px; }
@media (min-width: 900px) {
  .walls, .page .cap { padding: 0; }
  .walls a { grid-template-columns: 56px 1fr auto; align-items: baseline; }
  .walls .no { grid-row: auto; }
}
.prose { padding-bottom: 24px; }
.prose h2 { margin: 32px 16px 8px; font-size: 19px; }
.prose p { margin: 0 16px 12px; max-width: 64ch; color: #2f312d; }
.prose .head + p { margin-top: 24px; }
.prose .head p { margin: 2px 0 0; }
@media (min-width: 900px) { .prose h2, .prose p { margin-left: 0; margin-right: 0; } }
