@font-face {
  font-family: PickHand;
  src: url('assets/pick-hand.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  font-family: PickHand, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  --ink: #302b24;
  --paper: #fffefa;
  --paper-texture: url('assets/white-grain.svg');
  --paper-edge: #89745a1c;
  --paper-shadow: 0 2px 3px #5d45231c, 0 0 1px #80684b12;
  color: var(--ink);
  background: #e4d2b6 url('assets/kraft-grain.svg') repeat;
}
body { color: var(--ink); }
button, input, output { font-family: inherit; }
.game { max-width: 1120px; padding-left: 46px; padding-right: 46px; }
.topbar { grid-template-columns: auto minmax(0,1fr) auto; gap: 16px; }
.page-tools, .brand, .help-toggle, .settings-toggle, #completionOpen,
.question, .answer, .confirm, .bank-tile, .stage-dots, .next-control,
.settings-panel, .help-panel, dialog, .drag-ghost, .full-reset,
.mute-button, #recordWarning, .feedback:not(:empty), .reconnect-button {
  background: var(--paper) var(--paper-texture);
  border: 1px solid var(--paper-edge);
  border-radius: 1px 2px 1px 1px;
  box-shadow: var(--paper-shadow);
}
.page-tools { width: max-content; padding: 3px 10px 3px 5px; gap: 2px; }
.page-tools .next-label { font-size: 18px; }
.page-tools .restart-open { color: var(--ink); font-size: 25px; width: 32px; }
.brand { justify-self: center; font-size: 24px; font-weight: 400; padding: 5px 17px; letter-spacing: .12em; }
.top-actions { gap: 10px; }
.help-toggle { padding: 4px 12px; min-height: 42px; font-size: 18px; color: var(--ink); }
.settings-toggle { width: 42px; height: 42px; padding: 9px; }
.top-actions>#completionOpen { width: 36px; height: 42px; }
#recordWarning { padding: 4px 7px; }
.icon-button:hover:not(:disabled), .help-toggle:hover, .full-reset:hover,
.confirm:hover, .mute-button:hover { background: var(--paper) var(--paper-texture); color: #61503a; }
.page-tools .icon-button { background: transparent; border: none; box-shadow: none; }
.play-area { padding-bottom: 12px; }
.question-wrap { min-height: 110px; margin-bottom: 38px; }
.question {
  width: max-content;
  max-width: 100%;
  padding: 16px 29px 19px;
  font-size: clamp(25px,3.2vw,35px);
  font-weight: 400;
  letter-spacing: .025em;
  line-height: 1.8;
  transform: rotate(-.22deg);
}
.question-condition { font-size: inherit; line-height: inherit; font-weight: inherit; margin-top: 2px; }
.question-wrap:has(.question-condition) { min-height: 155px; }
.answer-row { max-width: 480px; gap: 16px; }
.answer { min-height: 76px; padding: 11px 16px; border-color: var(--paper-edge); }
.answer.drop-active { background: var(--paper) var(--paper-texture); border-color: #85755e; }
.answer-placeholder { width: 30px; height: 1px; background: #8c8271; margin: 0 4px; }
.answer-token { font-size: 31px; min-width: 35px; }
.confirm { width: 72px; height: 76px; color: var(--ink); }
.confirm:disabled { background: var(--paper) var(--paper-texture); color: #c2b9aa; border-color: var(--paper-edge); }
.confirm svg { width: 30px; height: 30px; }
#confirm { width: 112px; padding: 0 10px; font-size: 21px; white-space: nowrap; }
.glyph, .answer-token, .bank-tile, #helpToggle, #confirm,
#confirm .glyph, .help-toggle .glyph { cursor: default; }
body.dragging, body.dragging * { cursor: default !important; }
.feedback { align-self: center; width: max-content; max-width: 100%; padding: 0 13px; color: #75614a; font-size: 15px; margin-top: 6px; }
.feedback:empty { padding: 0; }
.bank { max-width: 396px; gap: 16px; margin-top: 12px; height: 76px; }
.bank .bank-tile { flex: 0 1 52px; width: 52px; height: 59px; font-size: 31px; border-bottom-width: 1px; }
.bank-tile:nth-child(6n+1) { transform: rotate(-.7deg); }
.bank-tile:nth-child(6n+2) { transform: rotate(.8deg); }
.bank-tile:nth-child(6n+3) { transform: rotate(-.4deg); }
.bank-tile:nth-child(6n+4) { transform: rotate(.5deg); }
.bank-tile:nth-child(6n+5) { transform: rotate(-.6deg); }
.bank-tile:nth-child(6n) { transform: rotate(.6deg); }
.stage-dots { padding: 5px 10px; gap: 13px; }
.stage-button { font-size: 18px; font-weight: 400; color: #b8ae9c; }
.stage-button.active { font-weight: 400; color: var(--ink); }
.stage-button.active:after { background: #60533f; height: 1px; }
.stage-button:disabled { color: #c9c2b5; }
.next-control { gap: 2px; padding: 1px 2px 1px 13px; }
.next-label { color: var(--ink); font-size: 18px; }
.next-control button { width: 36px; }
.settings-panel, .help-panel {
  width: 330px;
  right: max(22px,calc((100vw - 1028px)/2));
  padding: 8px 20px 20px;
  box-shadow: 0 5px 10px #5d45231a;
}
.panel-top { background: var(--paper) var(--paper-texture); }
.panel-top h2 { font-size: 20px; font-weight: 400; color: var(--ink); }
.help-panel .instruction { color: var(--ink); font-size: 21px; line-height: 1.9; margin: 13px 0 6px; text-wrap: pretty; }
/* Inline glyph spans cannot disable native panning; cover every source's block/flex ancestor before contact. */
.question, .page-tools, #helpToggle, #confirm, .answer, .bank,
.help-panel .instruction { touch-action: none; }
.settings-disclaimer, .hint-note, .records-disclaimer { font-size: 14px; color: #7e715f; }
.settings-disclaimer { line-height: 1.8; margin: 10px 0 2px; }
.audio-settings { border-color: #b5a88f55; }
.volume-heading { font-size: 18px; color: #6f6250; }
.audio-settings input { accent-color: #776348; }
.mute-button { font-size: 17px; color: var(--ink); }
.mute-button.is-muted { background: var(--paper) var(--paper-texture); color: var(--ink); text-decoration: line-through; }
.setting-links { font-size: 20px; line-height: 1.9; }
.setting-links a { color: var(--ink); }
.full-reset { font-size: 19px; color: var(--ink); min-height: 46px; }
.outside { background: transparent; }
dialog { padding: 40px 28px 28px; box-shadow: 0 9px 30px #5d452324; }
dialog::backdrop { background: #77664d55; }
dialog h2 { font-size: 28px; font-weight: 400; line-height: 1.6; }
dialog p { font-size: 18px; color: #6f6250; }
.success-mark { font-size: 39px; color: #5f6c4d; }
.secret-message { color: #8c6b3b; }
.dialog-action { height: 56px; width: 64px; }
.share-link { background: var(--paper) var(--paper-texture); color: var(--ink); border: 1px solid var(--paper-edge); box-shadow: var(--paper-shadow); font-size: 20px; border-radius: 1px; }
.share-link:hover { background: var(--paper) var(--paper-texture); color: #61503a; }
.record-grid { font-size: 19px; gap: 12px; }
.record-grid dt { color: #756954; }
.records-dialog #previewNote { font-size: 15px; }
.drag-ghost { color: var(--ink); font-size: 32px; box-shadow: 0 7px 13px #5d452326; }
.connection { background: var(--paper) var(--paper-texture); color: #756954; font-size: 20px; }
.reconnect-button { font-size: 20px; }
noscript { background: var(--paper); }
@media(max-width:600px) {
  .game { padding-left: 14px; padding-right: 14px; }
  .topbar { gap: 7px; }
  .page-tools { padding: 2px 5px 2px 1px; gap: 0; }
  .page-tools .next-label { font-size: 14px; }
  .page-tools .restart-open { width: 25px; height: 32px; font-size: 23px; padding: 2px; }
  .brand { font-size: 19px; padding: 5px 10px; }
  .top-actions { gap: 6px; }
  .help-toggle { font-size: 15px; padding: 5px 6px; min-height: 36px; }
  .top-actions .settings-toggle { width: 32px; height: 36px; padding: 6px; }
  .top-actions>#completionOpen { width: 26px; height: 36px; font-size: 21px; padding: 3px; }
  .question { font-size: 26px; line-height: 1.9; padding: 13px 18px 16px; }
  .question-wrap { min-height: 110px; margin-bottom: 25px; }
  .question-wrap:has(.question-condition) { min-height: 155px; }
  .answer-row { gap: 12px; }
  .answer { min-height: 67px; padding: 9px 10px; }
  .confirm { width: 58px; height: 67px; }
  #confirm { width: 88px; padding: 0 6px; font-size: 18px; }
  .answer-token { font-size: 28px; min-width: 29px; }
  .bank { gap: 8px; margin-top: 7px; height: 66px; }
  .bank .bank-tile { flex: 0 1 46px; width: 46px; height: 53px; font-size: 28px; }
  .stage-dots { padding: 3px 7px; gap: 8px; }
  .stage-button { width: 28px; }
  .stage-button.active:after { left: 6px; }
  .next-control { padding-left: 9px; }
  .next-label { font-size: 17px; }
  .next-control button { width: 29px; }
  .settings-panel, .help-panel { right: 14px; width: min(330px,calc(100vw - 28px)); padding-left: 17px; padding-right: 17px; }
  .help-panel .instruction { font-size: 20px; }
}
@media(max-height:660px) {
  .question-wrap { margin-bottom: 18px; }
  .question { padding-top: 11px; padding-bottom: 13px; }
  .bank { height: 59px; margin-top: 5px; }
  .bank .bank-tile { height: 50px; }
  .feedback { margin-top: 3px; height: 28px; line-height: 28px; }
}
@media(max-height:440px) {
  .brand { font-size: 18px; padding-top: 2px; padding-bottom: 2px; }
  .help-toggle { min-height: 32px; }
  .page-tools { padding-top: 0; padding-bottom: 0; }
  .page-tools .restart-open { height: 31px; }
  .page-tools .next-label { font-size: 15px; }
  .play-area { grid-template-columns: minmax(0,1fr) 160px; padding-bottom: 0; }
  .question-wrap { min-height: 45px; margin-bottom: 14px; }
  .question-wrap:has(.question-condition) { min-height: 90px; }
  .question { font-size: 22px; padding: 5px 20px; }
  .question-condition { margin-top: 0; line-height: 1.5; }
  .answer { min-height: 55px; padding-top: 5px; padding-bottom: 5px; }
  .confirm { height: 55px; }
  .bank { width: 160px; height: 92px; margin-top: 0; gap: 6px; }
  .bank .bank-tile { width: 40px; height: 40px; font-size: 26px; }
  .feedback { height: 20px; line-height: 20px; margin-top: 4px; }
  .stage-dots { padding-top: 0; padding-bottom: 0; }
  .next-control { padding-top: 0; padding-bottom: 0; height: 34px; }
  .next-control .icon-button { height: 32px; }
}
