:root {
  color-scheme: light;
  --paper: #f7f6ed;
  --ink: #1c2d23;
  --muted: #5b685e;
  --line: #dedfd1;
  --panel: #fdfcf6;
  --forest: #1c3228;
  --board-slot: #2a4034;
  --green: #c7eb90;
  --green-dark: #a7d469;
  --peach: #f4b993;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { color: inherit; font: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, textarea:focus-visible, .wordmark:focus-visible {
  outline: 2px solid #356b4c;
  outline-offset: 4px;
}
h1, h2, h3, p { margin: 0; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 1.1em;
  height: 1.1em;
  display: inline-block;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.site-header { border-bottom: 1px solid var(--line); }
.header-inner {
  max-width: 1230px;
  margin: 0 auto;
  min-height: 66px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: inherit;
  font-size: 18px;
  font-weight: 840;
  letter-spacing: -.045em;
  text-decoration: underline;
  text-underline-offset: .12em;
}
.wordmark:hover { color: #356b4c; }
.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 7px);
  grid-template-rows: repeat(2, 7px);
  gap: 2px;
  padding: 5px;
  border-radius: 5px;
  background: var(--forest);
  transform: rotate(-7deg);
}
.brand-mark i { border-radius: 1.5px; background: var(--green); }
.brand-mark i:first-child { background: var(--peach); }
.brand-mark i:nth-child(2) { grid-column: 1; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.help-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #cfd4c6;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 680;
  white-space: nowrap;
}
.help-button:hover, .secondary-button:hover { background: #e9eddf; }

.shell { max-width: 1112px; padding: 0 32px; margin: 0 auto; }
.puzzle-intro { padding: 38px 0 31px; text-align: center; }
.puzzle-edition {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: 700 11px/1.35 var(--mono);
  letter-spacing: .1em;
  color: #485c4c;
}
.edition-dot { width: 5px; height: 5px; border-radius: 50%; background: #638752; }
.puzzle-intro h1 {
  margin: 6px 0 8px;
  color: var(--ink);
  font-size: clamp(48px, 6.2vw, 86px);
  font-weight: 900;
  letter-spacing: -.075em;
  word-spacing: .065em;
  line-height: 1;
}
.puzzle-intro h1 span { color: #c36b47; }
#puzzle-intro { color: var(--muted); font-size: 1rem; font-weight: 500; }
.game-link { display: inline-block; margin-top: 8px; color: #345c3c; font-size: .9375rem; font-weight: 730; }
.game-layout {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) minmax(340px, 2.08fr) minmax(190px, 1fr);
  align-items: start;
  gap: 18px;
}

.panel {
  padding: 18px;
  border: 1px solid #dcded1;
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 2px 0 #e6e8dc;
}
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.section-heading h2 {
  font-size: 16px;
  font-weight: 820;
  letter-spacing: -.035em;
}
.remaining {
  color: #4f654f;
  background: #eaf0df;
  padding: 4px 7px;
  border-radius: 5px;
  white-space: nowrap;
  font: 700 10px/1.1 var(--mono);
}
.queue {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 16px;
}
.queue-slot {
  position: relative;
  min-width: 0;
  width: 100%;
  aspect-ratio: 1.08;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: #e7eadb;
  touch-action: none;
  user-select: none;
}
.queue-slot .tile-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-color: #d9dfcd;
  box-shadow: inset 0 -3px #d5ddc9;
  font-size: clamp(17px, 2.3vw, 30px);
}
.queue-slot:hover:enabled { background: #dfe8cf; }
.queue-slot.is-selected { background: var(--peach); }
.queue-slot.is-selected:hover:enabled { background: #f6c6a5; }
.queue-slot.is-selected .tile-face { border-color: #e5a780; box-shadow: inset 0 -3px #dc9d78; }
.queue-slot.is-empty { background: transparent; }
.queue-slot.is-empty .tile-face { border: 1px dashed #d5dacb; box-shadow: none; }
.rack-guide { margin-top: 12px; }
.rack-instruction {
  max-width: 26ch;
  color: #5a685d;
  font-size: 12px;
  line-height: 1.55;
}
.rack-demo {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #345c3c;
  font-size: .8125rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: .18em;
}

.playfield { min-width: 0; }
.board-frame {
  --gap: 6px;
  padding: 16px;
  border: 1px solid #0e241b;
  border-radius: 17px;
  background: var(--forest);
  box-shadow: 0 4px 0 #0e241b, 0 12px 30px -16px #27322986;
}
.board-top {
  padding: 0 1px 8px;
  border-bottom: 1px solid #3b5044;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: #e1ecd8;
  font: 700 10px/1.3 var(--mono);
  letter-spacing: .12em;
}
.compact-score { display: none; }
.board-count { display: flex; align-items: center; gap: 7px; color: #bbcdbb; letter-spacing: 0; }
.board-count i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--gap);
  margin-top: 5px;
}
.column {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--gap);
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}
.column:focus-visible { outline: 2px solid var(--peach); outline-offset: 2px; }
.column[aria-disabled="true"] { cursor: default; }
.column-label {
  display: grid;
  place-items: center;
  height: 23px;
  border-radius: 5px;
  color: #a5bfad;
  font: 700 11px/1 var(--mono);
}
.column.is-target .column-label { color: #241c14; background: var(--peach); }
.column.is-target.is-full .column-label { color: var(--peach); background: #39493b; }
.tile-face {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--ink);
  font-weight: 890;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.board-cell {
  width: 100%;
  aspect-ratio: 1.095;
  border-color: #344b3e;
  background: var(--board-slot);
  font-size: clamp(19px, 2.55vw, 34px);
}
.column.is-target .board-cell:not(.is-placed):not(.is-preview) {
  border-color: #456150;
  background: #314a3b;
}
.tile-value {
  position: absolute;
  right: 8%;
  bottom: 9%;
  min-width: 1ch;
  font: 700 max(8px, .32em)/1 var(--mono);
}
.board-cell.is-placed {
  border-color: #e4dfcb;
  background: #f5eedb;
  box-shadow: inset 0 -3px #d6cbb2;
}
.board-cell.is-scoring {
  border-color: #b4d97f;
  background: var(--green);
  box-shadow: inset 0 -3px var(--green-dark);
}
.board-cell.is-doubled {
  border-color: #ffe29c;
  background: #ffd06a;
  box-shadow: inset 0 -3px #d79737;
}
.board-cell.is-preview {
  color: #ffd6b9;
  border: 1px dashed #d79d78;
  background: #604d3d;
}
.board-cell.is-bonus-square { border-color: #d7aa51; }
.column .board-cell.is-bonus-square:not(.is-placed):not(.is-preview) { background: #4a402a; border-color: #b48c46; }
.bonus-square-label { position: absolute; inset: 0; display: grid; place-items: center; color: #ffdc8c; font: 800 .64em/1 var(--mono); }
.is-placed .bonus-square-label, .is-preview .bonus-square-label {
  inset: 7% 6% auto auto;
  display: block;
  font-size: max(8px, .31em);
}
.is-placed .bonus-square-label { color: #62420e; }
.board-cell.is-bonus-active { background: #f7d27d; border-color: #ffe8ae; box-shadow: inset 0 -3px #d6a34d; }
.board-cell.is-bonus-preview { outline: 2px dashed #ffdc8c; outline-offset: -3px; }
.board-cell.is-at-risk { outline: 2px dashed #922f1e; outline-offset: -4px; }
.crossing-bonus-rule { margin: 9px 1px 0; color: #ffdc8c; font-size: .8125rem; line-height: 1.35; }
.board-cell.falling {
  z-index: 1;
  animation: land .23s cubic-bezier(.34, .03, .69, .94) both;
}
.board-cell.is-crossing::after {
  position: absolute;
  inset: 0;
  border: 2px solid #ffdf8a;
  border-radius: inherit;
  box-shadow: 0 0 9px #ffd372;
  content: "";
  pointer-events: none;
  animation: crossing .8s ease-out both;
}
@keyframes crossing {
  0%, 20% { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes land {
  from { transform: translateY(calc(var(--fall-rows) * (-100% - var(--gap)) - 16px)); }
  to { transform: translateY(0); }
}
.board-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 3px 0 0;
  color: #5d6a5b;
}
.key-guide, .edit-controls { display: flex; align-items: center; gap: 5px; }
.key-guide { font-size: 11px; }
.key-guide span { margin-right: 7px; }
kbd {
  min-width: 21px;
  padding: 2px 4px;
  border: 1px solid #d8dece;
  border-bottom-width: 2px;
  border-radius: 4px;
  background: #fdfcf7;
  color: #435848;
  font: 700 10px/1.2 var(--mono);
  text-align: center;
}
.text-button {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 39px;
  padding: 4px 7px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #465d4b;
  font-size: 12px;
  font-weight: 690;
}
.text-button:hover:enabled { background: #e8edde; }
.text-button:disabled { color: #7d897c; opacity: .75; }
.edit-controls .icon { width: 15px; height: 15px; }

.move-feedback {
  display: flex;
  align-items: center;
  min-height: 43px;
  margin-top: 12px;
  padding: 6px 10px;
  border: 1px solid #dce3d4;
  border-radius: 7px;
  background: #f0f2e8;
  color: #425a48;
  font-size: .875rem;
  font-weight: 680;
  line-height: 1.3;
}
.move-feedback[data-tone="gain"] { background: #e9f5d9; border-color: #c3daac; color: #2e542c; }
.move-feedback[data-tone="loss"] { background: #faeee4; border-color: #e8c9b7; color: #80422d; }
.move-feedback.is-drop-preview { border-style: dashed; }
.finish-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding: 9px;
  border-radius: 8px;
  background: #e9f2dc;
  color: #345036;
}
.finish-actions p { font-size: .875rem; font-weight: 780; }
.finish-actions > div, .recap-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.finish-actions .secondary-button { background: var(--panel); }
.recap {
  margin-top: 12px;
  border-color: #ccdac0;
  background: #f4f8eb;
  scroll-margin-top: 16px;
}
.recap:focus-visible { outline: 2px solid #356b4c; outline-offset: 3px; }
.recap-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.recap-edition { color: var(--muted); font-size: .8125rem; font-weight: 700; }
.recap h2 { margin-top: 2px; font-size: clamp(1.25rem, 4.1vw, 1.65rem); letter-spacing: -.045em; }
.recap-score { white-space: nowrap; font-size: .875rem; color: #34543a; }
.recap-score strong { font-size: clamp(1.65rem, 5vw, 2.25rem); font-variant-numeric: tabular-nums; line-height: 1; }
.recap-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 13px 0; padding: 9px 0; border-block: 1px solid #dbe6d1; }
.recap-stats dt { color: var(--muted); font-size: .8125rem; }
.recap-stats dd { margin: 3px 0 0; font-size: .875rem; font-weight: 800; overflow-wrap: anywhere; }
.recap-best-words { display: block; color: #466748; }
.recap-personal-best { margin: 0 0 12px; color: #34543a; font-size: .875rem; }
.recap .posted-status { margin-top: 8px; color: #33583b; font-size: .875rem; }

.maker-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #dbe6d1;
}
.maker-note h3 { margin-bottom: 2px; color: var(--muted); font-size: .875rem; font-weight: 650; }
.maker-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.maker-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: #345c3c;
  font-size: .875rem;
  font-weight: 650;
  text-underline-offset: .2em;
}
.maker-links a:focus-visible { outline: 2px solid #356b4c; outline-offset: 2px; }

.score-total {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 6px 0 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e1e3d7;
}
.score-total strong {
  color: #233c2a;
  font-size: 48px;
  font-weight: 870;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.075em;
  line-height: 1.1;
}
.score-total > span {
  color: #688069;
  font: 700 10px/1 var(--mono);
  letter-spacing: .055em;
}
.goal-header { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.goal-header h3 { font-size: 12px; font-weight: 750; }
.goal-header span { color: #516855; font: 700 11px/1.2 var(--mono); }
.progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 9px 0 14px; }
.progress span { height: 6px; border-radius: 2px; background: #e6ebdb; }
.progress .is-filled { background: #6b9b58; }
.empty-words {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #59695c;
  font-size: 12px;
  line-height: 1.35;
}
.empty-icon {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  border: 1px dashed #a8b4a2;
  border-radius: 4px;
  font: 750 10px/1 var(--mono);
}
.word-list { display: grid; gap: 5px; padding: 0; margin: 0; list-style: none; }
.word-list li {
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-height: 31px;
  padding: 3px 6px;
  border-radius: 5px;
  background: #eff4e5;
  font: 700 11px/1 var(--mono);
  letter-spacing: .05em;
}
.word-definition {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 3px 6px;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  text-align: left;
  cursor: pointer;
}
.word-definition small { color: var(--muted); font-size: .6875rem; font-weight: 600; }
.word-direction { color: #456448; font-size: 16px; text-align: center; }
.word-points {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  color: #3e613e;
}
.word-multiplier { font-size: 9px; letter-spacing: 0; }
.word-crossing-bonus, .word-list .is-doubled .word-multiplier { padding: 2px 4px; border-radius: 4px; }
.word-crossing-bonus { background: #f9e9bc; color: #694710; }
.word-list li.is-doubled { background: #fff0c8; box-shadow: inset 3px 0 #dda23c; }
.word-list .is-doubled .word-multiplier { background: #ffd06a; color: #613900; }
.benchmark {
  margin: 0 0 16px;
  padding: 11px;
  border: 1px solid #d7e2c9;
  border-radius: 8px;
  background: #eef3e4;
  color: #2c4932;
}
.benchmark h3 { font-size: .875rem; font-weight: 780; }
.benchmark-value { margin: 2px 0; font-size: .875rem; }
.benchmark-value strong { font-size: 1.65rem; font-variant-numeric: tabular-nums; line-height: 1.25; }
.benchmark p { margin-bottom: 6px; font-size: .8125rem; line-height: 1.4; }
.benchmark a { color: #345c3c; font-size: .8125rem; font-weight: 720; text-underline-offset: 3px; }
.scoring-details { margin: 6px 0; font-size: .8125rem; }
.scoring-details summary { cursor: pointer; font-weight: 720; }
.scoring-details p { margin: 4px 0 0; }

.leaderboard, .history { max-width: 660px; margin: 26px auto 0; scroll-margin-top: 16px; }
.leaderboard .section-heading h2, .history .section-heading h2 { font-size: 1.3rem; }
.leaderboard .section-heading p, .history .section-heading p { margin-top: 3px; color: var(--muted); font-size: .875rem; }
.leaderboard-message { margin: 13px 0 2px; color: var(--muted); font-size: .9375rem; }
.personal-rank { margin: 8px 0; padding: 8px 10px; border-radius: 6px; background: #edf4e4; color: #33583b; font-size: .875rem; font-weight: 760; }
.leaderboard-table { width: 100%; margin-top: 12px; border-collapse: collapse; table-layout: fixed; }
.leaderboard-table th, .leaderboard-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  overflow-wrap: anywhere;
}
.leaderboard-table th { color: var(--muted); font-size: .875rem; }
.leaderboard-table th:first-child { width: 4rem; }
.leaderboard-table th:last-child, .leaderboard-table td:last-child { width: 5rem; text-align: right; }
.leaderboard-table tbody tr:last-child td { border-bottom: none; }
.leaderboard-table tr.is-you { background: #edf4e4; }
.leaderboard-table td:first-child, .leaderboard-table td:last-child { font-variant-numeric: tabular-nums; font-weight: 720; }
.history-empty { margin-top: 13px; color: var(--muted); font-size: .9375rem; }
.history-list, .archive-list { padding: 0; margin: 9px 0 0; list-style: none; }
.history-list li { display: grid; grid-template-columns: 1.25fr 1fr auto; align-items: baseline; gap: 6px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: .875rem; }
.history-list li:last-child { border-bottom: none; }
.history-list span { color: var(--muted); }
.archive-section { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.archive-section h3 { margin-bottom: 4px; font-size: 1rem; }
.archive-list a { display: block; padding: 9px; color: #315739; border-radius: 6px; font-size: .9375rem; font-weight: 720; text-underline-offset: 3px; }
.archive-list a:hover, .archive-list a[aria-current] { background: #e9f2de; }

.demo-controls { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: .9375rem; font-weight: 730; }
.demo-controls:has([hidden]) { display: none; }
.demo-controls .demo-tile { width: 34px; min-height: 34px; background: var(--peach); color: var(--ink); }
.demo-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; max-width: 245px; margin: auto; padding: 10px; background: var(--forest); border-radius: 10px; }
.demo-column { display: grid; gap: 5px; padding: 0; border: 0; background: transparent; border-radius: 5px; }
.demo-column:focus-visible { outline-color: var(--peach); outline-offset: 2px; }
.demo-label { padding: 3px; border-radius: 5px; color: #ccdaca; font: 700 .8125rem/1.25 var(--mono); }
.demo-target .demo-label { background: var(--peach); color: var(--ink); }
.demo-tile { display: grid; aspect-ratio: 1.25; place-items: center; border-radius: 5px; background: var(--board-slot); color: var(--ink); font-size: 1.35rem; font-weight: 850; }
.demo-filled { background: #f5eedb; }
.demo-scored { background: var(--green); box-shadow: inset 0 -3px var(--green-dark); }
.demo-hint { min-height: 3em; margin-top: 10px; }

#leaderboard-form input {
  width: 100%;
  min-height: 44px;
  margin: 4px 0 8px;
  padding: 7px 10px;
  color: var(--ink);
  font: inherit;
  border: 1px solid #bfcbbb;
  border-radius: 7px;
  background: var(--paper);
}
#post-detail { margin-bottom: 12px; }
#confirm-post:disabled { opacity: .65; }
#leaderboard-error { margin-top: 8px; color: #8e3a29; }

.site-footer {
  display: flex;
  justify-content: center;
  margin: 18px 0 0;
  padding: 15px 0 24px;
  border-top: 1px solid var(--line);
}
.site-footer > span { display: flex; align-items: center; gap: 6px; color: #5a6a5b; font-size: 12px; }
.site-footer strong { min-width: 8ch; color: #344d39; font: 700 12px/1 var(--mono); }

dialog {
  width: calc(100% - 32px);
  max-width: 440px;
  padding: 23px;
  border: 1px solid #d1dac8;
  border-radius: 16px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 12px 50px #172b2380;
}
dialog::backdrop { background: #1a2b22a6; }
.dialog-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.dialog-top h2 { font-weight: 840; letter-spacing: -.045em; }
.close-button {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #405b47;
}
.close-button:hover { background: #e9edde; }
.rules { display: grid; gap: 11px; margin: 0 0 14px; padding-left: 20px; }
.rules li { padding-left: 2px; }
.rules li::marker { color: #517451; font: 800 13px var(--mono); }
.rules li, dialog p, dialog label { color: #4c6151; font-size: 14px; line-height: 1.5; }
.rules strong { color: var(--ink); }
.scoring-rules { margin: 5px 0; padding-left: 18px; }
.scoring-rules li::marker { color: #517451; }
.dialog-note { padding: 11px 13px; border-radius: 6px; background: #edf1e3; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
#help-dialog > .primary-button, #share-dialog > .primary-button { margin-top: 14px; }
.primary-button, .secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 750;
}
.primary-button { border-color: #34523d; background: #2b4936; color: #f6f9ed; }
.primary-button:hover { background: #3b6046; }
.secondary-button { border-color: #d8dfd0; background: transparent; }
textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 6px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: 13px/1.45 var(--mono);
  resize: vertical;
}

@media (max-width: 925px) {
  .shell { padding: 0 23px; }
  .game-layout { grid-template-columns: minmax(152px, 1fr) minmax(300px, 2.25fr) minmax(152px, 1fr); gap: 12px; }
  .panel { padding: 13px; }
  .section-heading h2 { font-size: 15px; }
  .queue { gap: 5px; }
}
@media (max-width: 700px) {
  .header-inner { min-height: 50px; padding: 3px 10px; gap: 6px; }
  .header-actions { gap: 5px; }
  .wordmark { gap: 7px; font-size: 1rem; white-space: nowrap; }
  .help-button { min-height: 40px; padding-inline: 9px; }
  .shell { max-width: 510px; padding-inline: 11px; }
  .puzzle-intro { padding: 17px 0 13px; }
  .puzzle-intro h1 { margin-top: 6px; margin-bottom: 7px; font-size: clamp(41px, 10vw, 62px); }
  #puzzle-intro { font-size: .875rem; }
  .puzzle-edition { font-size: 10px; }
  .game-layout { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .rack {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(126px, 36%);
    align-items: center;
    gap: 2px 9px;
    padding: 7px 9px;
  }
  .rack .section-heading { align-self: end; justify-content: flex-start; }
  .queue { grid-area: 1 / 2 / span 2; align-self: center; margin-top: 0; }
  .queue-slot { aspect-ratio: 1.05; min-height: 41px; }
  .queue-slot .tile-face { font-size: 23px; }
  .rack-guide { align-self: start; margin-top: 0; }
  .rack-instruction { font-size: 11px; max-width: 31ch; line-height: 1.3; }
  .board-frame { --gap: 4px; padding: 8px 8px 9px; border-radius: 12px; }
  .board-top { padding-bottom: 5px; }
  .board-title { display: none; }
  .compact-score { display: inline; letter-spacing: .045em; color: var(--green); }
  .board { margin-top: 3px; }
  .column-label { height: 19px; }
  .board-cell { font-size: clamp(20px, 6.7vw, 31px); border-radius: 5px; }
  .crossing-bonus-rule { margin-top: 6px; font-size: .75rem; }
  .move-feedback { min-height: 36px; margin-top: 8px; font-size: .8125rem; }
  .finish-actions { gap: 5px; padding: 7px; }
  .board-controls { justify-content: flex-end; margin-top: 3px; }
  .board-controls .key-guide { display: none; }
  .score-total strong { font-size: 42px; }
  .site-footer { margin-top: 14px; }
}
@media (max-width: 360px) {
  #help-button { min-width: 40px; justify-content: center; }
  #help-button > span { display: none; }
  .wordmark { font-size: .9375rem; }
  .puzzle-intro { padding: 11px 0 8px; }
  .puzzle-intro h1 { font-size: 38px; }
  .board-top { gap: 6px; }
  .compact-score { letter-spacing: 0; }
  .board-cell { aspect-ratio: 1.23; }
  .finish-actions .secondary-button, .finish-actions .primary-button { min-height: 40px; }
}
@media (hover: none) {
  .key-guide { display: none; }
  .board-controls { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  .board-cell.falling { animation: none; }
  .board-cell.is-crossing::after { animation: none; box-shadow: none; }
}
