:root { font: 16px/1.5 system-ui, sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: inherit; }
.shell { width: min(58rem, calc(100% - 1.5rem)); margin-inline: auto; }
.mast { border-bottom: 1px solid; }
.mast .shell { display: flex; justify-content: space-between; align-items: center; gap: .8rem; min-height: 3.4rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: inherit; font-weight: 850; letter-spacing: .09em; text-decoration: none; }
.hero { padding: clamp(1.05rem, 3vw, 2.1rem) 0 1rem; }
.hero h1 { margin: 0; }
.kicker { font: 750 .74rem/1.4 ui-monospace, monospace; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 .35rem; }
.hero p:last-child { margin: .6rem 0 0; max-width: 41rem; }

#workbench {
  --text: #11251e;
  --rule: #b8c5bd;
  --ink: #16372b;
  --mark: #f2c657;
  color-scheme: light;
  background: #fcfaf1;
  color: var(--text);
  border: 1px solid #93a498;
  border-radius: .5rem;
  overflow: hidden;
}
.game :focus-visible { outline: 3px solid #276450; outline-offset: 2px; }
.game-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .45rem 1rem;
  color: #fffaf0;
  background: #092b20;
  padding: .6rem .8rem;
}
.game-bar strong { font: 750 .76rem/1.3 ui-monospace, monospace; text-transform: uppercase; letter-spacing: .07em; }
.game button, .game input, .game textarea { font: inherit; }
.game button {
  cursor: pointer;
  color: #143429;
  background: #fffcf0;
  border: 1px solid #98ac9f;
  border-radius: .3rem;
  font-weight: 750;
  min-height: 2.7rem;
  padding: .4rem .65rem;
}
.game button:hover { border-color: #143429; background: #f3f3df; }
.game-bar button { min-height: 2.4rem; font-size: .79rem; }
.game-bar :focus-visible { outline-color: var(--mark); }
.game .primary { color: #192b21; background: var(--mark); border-color: #a37b20; }
.game .primary:hover { background: #ffda76; }
.pane { padding: clamp(.7rem, 2vw, 1.05rem); }
.pane h2 { margin: 0 0 .45rem; font-size: clamp(1.14rem, 3vw, 1.65rem); }
.pane p { margin: .42rem 0; color: #435d52; }
.club-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .55rem; }
.game .club { display: grid; align-content: start; justify-items: center; gap: .35rem; padding: .55rem .28rem; min-width: 0; text-align: center; line-height: 1.18; }
.club img { display: block; width: clamp(2.3rem, 7vw, 3.7rem); height: clamp(2.3rem, 7vw, 3.7rem); object-fit: contain; }
.club span { font-size: .78rem; overflow-wrap: anywhere; }
.board-wrap { width: min(100%, 31rem); margin: .7rem auto 0; padding-inline: .6rem; }
.board-wrap canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #8da093;
  border-radius: .32rem;
  touch-action: none;
  cursor: grab;
}
.board-wrap canvas:active { cursor: grabbing; }
.board-wrap canvas[tabindex="-1"] { cursor: default; touch-action: auto; }
.board-key { display: flex; justify-content: center; gap: .25rem 1rem; flex-wrap: wrap; font-size: .8rem; color: #405e52; margin: .45rem 0 0; }
.board-key span:first-child::before { content: '┄ '; }
.board-key span:last-child::before { content: '● '; color: #246758; }
.play-pane, .result-pane { width: min(100%, 31rem); margin-inline: auto; }
.scale { display: grid; gap: .15rem; font-size: .9rem; font-weight: 700; margin: .7rem 0; }
.scale input { width: 100%; margin: 0; min-height: 2rem; accent-color: #275d49; }
.play-pane .primary { width: 100%; }
.result-pane h2 { font-size: .94rem; margin-bottom: 0; }
#accuracy { display: block; color: #133a2b; font: 870 clamp(2rem, 7vw, 3.65rem)/1.05 system-ui,sans-serif; letter-spacing: -.04em; margin: .18rem 0 .65rem; }
.result-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .32rem; margin: .45rem 0; }
.result-grid div { padding: .42rem; border: 1px solid var(--rule); border-radius: .25rem; }
.result-grid dt { color: #405e52; font-size: .73rem; line-height: 1.3; }
.result-grid dd { margin: .15rem 0 0; font-size: .95rem; font-weight: 800; }
.actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .65rem; }
#manual-wrap { display: grid; gap: .35rem; margin-top: .5rem; }
#share-text { width: 100%; min-height: 4rem; }
#load-status { margin: .45rem .75rem; }
#load-status:empty, #share-status:empty { display: none; }
.record-list { padding-inline-start: 1.35rem; line-height: 1.8; }
.guide { max-width: 45rem; }
.guide h3 { font-size: 1.15rem; margin: 1.45rem 0 .4rem; }
.guide summary { padding: .5rem 0; font-weight: 750; cursor: pointer; }
.guide details { border-top: 1px solid; }
.languages { display: flex; flex-wrap: wrap; gap: .5rem 1rem; padding-block: .85rem; }
.languages a[aria-current] { text-decoration: none; }

@media (max-width: 34rem) {
  .club-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .result-grid dt { font-size: .68rem; }
}
