:root {
  --ink: #f3ead9;
  --ink-soft: rgb(243 234 217 / 0.7);
  --ink-faint: rgb(243 234 217 / 0.45);
  --gold: #d8b273;
  --glass: rgb(20 13 9 / 0.5);
  --line: rgb(255 230 195 / 0.14);
}
html, body { margin: 0; height: 100%; background: #0b0806; overflow: hidden; color: var(--ink); font-family: var(--kit-sans); }
#stage canvas { touch-action: none; }
.veil { position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(90% 70% at 0% 0%, rgb(8 5 3 / 0.55) 0%, rgb(8 5 3 / 0) 50%), linear-gradient(to left, rgb(8 5 3 / 0.5) 0%, rgb(8 5 3 / 0) 30%); }
.mast { position: fixed; left: 48px; top: 40px; max-width: 430px; pointer-events: none; }
.over { margin: 0 0 10px; font: 600 11px/1 var(--kit-sans); letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
h1 { margin: 0; font: italic 400 46px/1 var(--kit-oldstyle); letter-spacing: -0.01em; text-shadow: 0 2px 24px rgb(0 0 0 / 0.55); }
.line { margin: 12px 0 0; max-width: 360px; font: 400 14px/1.5 var(--kit-sans); color: var(--ink-soft); }

.now { position: fixed; left: 48px; bottom: 40px; max-width: 520px; pointer-events: none; }
.now-move { margin: 0; font: 400 34px/1 var(--kit-oldstyle); font-variant-numeric: lining-nums; color: var(--ink); text-shadow: 0 2px 20px rgb(0 0 0 / 0.6); }
.now-note { margin: 10px 0 0; min-height: 1.4em; font: 400 14px/1.4 var(--kit-sans); color: var(--ink-soft); text-shadow: 0 1px 12px rgb(0 0 0 / 0.7); }

.sheet {
  position: fixed; right: 36px; top: 36px; bottom: 36px; width: 268px; display: flex; flex-direction: column;
  padding: 18px 16px 14px; box-sizing: border-box; border-radius: 16px; border: 1px solid var(--line);
  background: var(--glass); backdrop-filter: blur(14px) saturate(1.15); -webkit-backdrop-filter: blur(14px) saturate(1.15);
}
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 0 4px 12px; border-bottom: 1px solid var(--line); font: 500 12px/1.2 var(--kit-sans); }
.side { display: inline-flex; align-items: center; gap: 7px; }
.side--b { justify-content: flex-end; text-align: right; }
.side i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.side--w i { background: #efe6d4; }
.side--b i { background: #1b1512; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.35); }
.res { font: 400 15px/1 var(--kit-oldstyle); color: var(--gold); }
.moves { list-style: none; margin: 0; padding: 8px 0; flex: 1; overflow-y: auto; scrollbar-width: none; }
.moves::-webkit-scrollbar { display: none; }
.moves li { display: grid; grid-template-columns: 30px 1fr 1fr; align-items: center; height: 26px; }
.num { font: 400 12px/1 var(--kit-mono); font-variant-ligatures: none; color: var(--ink-faint); text-align: right; padding-right: 8px; }
.ply { all: unset; cursor: pointer; justify-self: start; padding: 4px 8px; border-radius: 6px; font: 500 13.5px/1 var(--kit-mono); font-variant-ligatures: none; color: var(--ink); transition: background 0.2s, color 0.2s; }
.ply:hover { background: rgb(255 240 220 / 0.08); }
.ply:focus-visible { outline: 2px solid var(--gold); }
.ply.is-now { background: var(--ink); color: #1a120c; }
.sheet-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.counter { font: 500 11px/1.2 var(--kit-sans); letter-spacing: 0.06em; color: var(--ink-faint); }
.transport { display: flex; gap: 4px; }
.transport button { all: unset; cursor: pointer; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); transition: background 0.2s; }
.transport button:hover { background: rgb(255 240 220 / 0.1); }
.transport button:focus-visible { outline: 2px solid var(--gold); }
.transport svg { width: 14px; height: 14px; fill: currentColor; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.transport .is-key { background: var(--ink); color: #1a120c; }
.transport .is-key:hover { background: #fff; }
.i-pause { display: none; }
#play[aria-pressed="true"] .i-play { display: none; }
#play[aria-pressed="true"] .i-pause { display: block; }
.src { margin: 10px 2px 0; font: 400 10.5px/1.4 var(--kit-sans); color: var(--ink-faint); }
.hint { position: fixed; left: 48px; top: 50%; margin: 0; padding: 7px 13px; border-radius: 999px; background: rgb(12 8 5 / 0.5); border: 1px solid var(--line);
  font: 400 12px/1 var(--kit-sans); color: var(--ink-soft); transition: opacity 0.6s; }
.hint.is-gone { opacity: 0; }
@media (max-width: 1150px) { h1 { font-size: 40px; } .sheet { width: 244px; } .now-move { font-size: 30px; } }
