:root {
  color-scheme: light;
  --paper: #f1e8d5;
  --ink: #3e3b2d;
  --muted: #847965;
  --ochre: #bf873b;
  --line: #cfc2a9;
  --wood: #554932;
  --cream: #fff1ce;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    14px Arial,
    Helvetica,
    sans-serif;
  background-image: radial-gradient(#76674b1a 0.6px, transparent 0.6px);
  background-size: 5px 5px;
}
button,
input {
  font: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
  color: inherit;
}
button:disabled {
  cursor: default;
}
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid #bd8037;
  outline-offset: 3px;
}
main {
  max-width: 1070px;
  padding: 31px 45px 24px;
  margin: auto;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 25px;
}
.eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  margin: 0;
  color: #8c682e;
}
h1 {
  font:
    60px/1 Georgia,
    serif;
  letter-spacing: -2.5px;
  margin: 9px 0 0;
}
h1 span {
  font: 32px Georgia;
  display: inline-block;
  color: var(--ochre);
  margin-left: 18px;
  vertical-align: middle;
}
.intro {
  font:
    italic 18px Georgia,
    serif;
  margin: 11px 0 0;
  color: var(--muted);
}
.text-button {
  border: 0;
  background: none;
  font-size: 12px;
  padding: 12px 0 12px 12px;
}
.round-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0;
}
.round-bar p {
  font: 16px Georgia;
  margin: 7px 0 0;
  color: #70634f;
}
.stats {
  display: flex;
  gap: 32px;
}
.stats > div {
  min-width: 50px;
}
.stats span {
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--muted);
  display: block;
}
.stats strong {
  font: 36px Georgia;
  display: block;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.stats strong small {
  font: 14px Arial;
  color: #91816b;
  margin-left: 3px;
}
.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 570px) minmax(0, 1fr);
  gap: 40px;
}
.board-frame {
  padding: 13px 14px 12px;
  border-radius: 8px;
  background: linear-gradient(110deg, #5c4e35, #4b422f 70%);
  box-shadow:
    0 4px 0 #302b20,
    0 10px 25px #6d55262b;
  border: 1px solid #716244;
}
.board-top,
.board-bottom {
  display: flex;
  justify-content: space-between;
  color: #d4c6a3;
  font-size: 8px;
  letter-spacing: 1.4px;
  line-height: 1;
  margin: 1px 0 13px;
}
.board-bottom {
  margin: 12px 0 0;
  font-size: 7px;
  letter-spacing: 1.7px;
  color: #baa985;
}
.board {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 3px;
  padding: 4px;
  border: 1px solid #b6a78050;
  border-radius: 3px;
  background: #352f25;
}
.square {
  aspect-ratio: 1;
  min-width: 0;
  border: 1px solid #a5977244;
  border-radius: 3px;
  background: #686049;
  color: #c9bb92;
  position: relative;
  padding: 0;
  font:
    12px Arial,
    sans-serif;
  box-shadow: inset 0 1px 2px #0002;
  transition: background 0.12s;
}
.square .bonus-mark {
  font-size: 11px;
  font-weight: bold;
  opacity: 0.9;
}
.square.bonus-2L {
  background: #737a53;
  color: #e4e6cd;
}
.square.bonus-3L {
  background: #406567;
  color: #d8e4d7;
}
.square.bonus-2W {
  background: #925e41;
  color: #fae4be;
}
.square.centre {
  background: #9b773f;
  color: #f2dfac;
}
.square.centre .bonus-mark {
  font: 26px Georgia;
}
.square.occupied {
  background: linear-gradient(100deg, #f5e0ac, #fff1c9 47%, #f4dfad);
  color: #493c26;
  border-color: #f3daa0;
  box-shadow:
    inset 0 1px 0 #fff6df,
    0 2px 1px #201b1280;
}
.square.occupied .letter {
  font: 30px/1 Georgia;
  display: block;
  margin-top: -3px;
}
.square.occupied .value {
  position: absolute;
  bottom: 4px;
  right: 5px;
  font: bold 9px Arial;
}
.square.draft {
  box-shadow:
    inset 0 0 0 2px #bb7924,
    0 2px 1px #201b1280;
}
.square.draft:after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  background: #a96b29;
  border-radius: 50%;
  width: 3px;
  height: 3px;
}
.square.cursor {
  outline: 2px solid #f3d88e;
  outline-offset: 0;
  z-index: 1;
}
.square:not(.occupied):hover {
  filter: brightness(1.12);
}
.rack-label {
  display: flex;
  justify-content: space-between;
  margin: 25px 0 13px;
  align-items: center;
}
.rack-label .eyebrow {
  font-size: 8px;
  letter-spacing: 1.5px;
}
#rack-tip {
  font-size: 10px;
  color: var(--muted);
}
.rack {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 9px;
  background: linear-gradient(
    180deg,
    transparent 77%,
    #a27742 77%,
    #8e6031 85%,
    #ba945e 87%
  );
  padding: 0 7px 13px;
}
.rack-tile {
  position: relative;
  aspect-ratio: 1/0.98;
  border: 1px solid #d4ba85;
  background: linear-gradient(100deg, #f7e1ad, #ffefc8 60%, #efd6a1);
  border-radius: 5px;
  box-shadow:
    0 3px 0 #b69a67,
    0 5px 6px #68471933;
  font: 34px Georgia;
  color: #493c26;
  padding: 0;
  transition: transform 0.15s;
}
.rack-tile small {
  font: bold 10px Arial;
  position: absolute;
  right: 6px;
  bottom: 5px;
}
.rack-tile.selected {
  transform: translateY(-8px);
  outline: 2px solid #a56c22;
  outline-offset: 3px;
}
.rack-tile.used {
  opacity: 0.24;
  box-shadow: none;
}
.rack-tile:disabled {
  cursor: default;
}
.rack-actions {
  display: flex;
  gap: 8px;
  margin: 15px 0;
}
.rack-actions button {
  flex: 1;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 3px;
  padding: 9px 6px;
  font-size: 11px;
}
.rack-actions button small {
  font-size: 8px;
  color: var(--muted);
  display: block;
  margin-top: 4px;
}
.rack-actions button:hover {
  background: #eadcc1;
}
.submit-row {
  display: flex;
  align-items: center;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 15px 0 0;
  min-height: 72px;
}
.submit-row p {
  font-size: 12px;
  line-height: 1.5;
  color: #796342;
  flex: 1;
  margin: 0;
}
.primary {
  border: 1px solid #373e2c;
  background: #46513a;
  color: #fff1d6;
  border-radius: 4px;
  font-weight: 600;
  padding: 14px 17px;
  font-size: 12px;
  white-space: nowrap;
}
.primary span {
  margin-left: 25px;
}
.primary:disabled {
  opacity: 0.5;
}
.notebook {
  border-left: 1px solid var(--line);
  padding-left: 30px;
}
.note-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.note-heading .eyebrow {
  font-size: 8px;
  line-height: 1.7;
  max-width: 140px;
  letter-spacing: 1.6px;
}
.note-heading > span:last-child {
  font: italic 35px Georgia;
  color: #b58a4b;
}
h2 {
  font: 34px/1.13 Georgia;
  letter-spacing: -1px;
  margin: 21px 0 12px;
}
.note-intro {
  font-size: 12px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0 0 24px;
}
.bonus-legend {
  display: grid;
  gap: 11px;
  margin-bottom: 28px;
}
.bonus-legend > span {
  display: flex;
  align-items: center;
  font-size: 11px;
  color: #786b56;
  gap: 10px;
}
.bonus-legend i {
  font: 700 8px Arial;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  font-style: normal;
  border-radius: 3px;
  color: #f9ebcd;
}
.bonus-legend .dl {
  background: #737a53;
}
.bonus-legend .tl {
  background: #406567;
}
.bonus-legend .dw {
  background: #925e41;
}
.bonus-legend .star {
  background: #9b773f;
  font: 20px Georgia;
}
#receipt {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
#receipt h3 {
  font: 20px Georgia;
  margin: 0 0 15px;
}
.empty-note {
  font: italic 15px/1.6 Georgia;
  color: #9b8e76;
  margin: 0 0 20px;
}
.word-score {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  font: 20px Georgia;
  margin-top: 16px;
}
.word-score strong {
  font-weight: 400;
}
.word-score small {
  font: 11px Arial;
  color: var(--muted);
}
.word-math {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
  margin: 5px 0 13px;
}
.receipt-total {
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding-top: 14px;
  margin-top: 16px;
}
.receipt-total strong {
  font-size: 13px;
}
.turn-track {
  display: flex;
  justify-content: space-between;
  margin: 25px 0 20px;
}
.turn-pip {
  font-size: 9px;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border: 1px solid #c5b998;
  border-radius: 50%;
  color: #a29377;
}
.turn-pip.played {
  background: #6d7d4f;
  color: #fff2d2;
  border-color: #6d7d4f;
}
.turn-pip.exchanged {
  background: #b69562;
  color: #fff2d2;
  border-color: #b69562;
}
.round-log {
  border-top: 1px solid var(--line);
}
.round-log summary {
  font: 13px Georgia;
  padding: 14px 0;
  cursor: pointer;
}
.round-log summary span {
  font: 9px Arial;
  margin-left: 8px;
  color: var(--muted);
}
.round-log ol {
  font-size: 11px;
  line-height: 1.8;
  padding-left: 22px;
}
.round-log li {
  padding: 3px 0;
}
.round-log li b {
  font-weight: 600;
}
.result {
  margin-top: 29px;
  border: 1px solid #b8aa85;
  background: #e1e4ce;
  display: flex;
  justify-content: space-between;
  padding: 27px 32px;
  border-radius: 5px;
  gap: 20px;
}
.result[hidden] {
  display: none;
}
.result h2 {
  margin: 7px 0 9px;
  font-size: 35px;
}
.result p {
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  color: #667054;
}
.final-score {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.final-score strong {
  font: 55px/1 Georgia;
  letter-spacing: -2px;
}
.final-score span {
  font-size: 9px;
  letter-spacing: 2px;
  color: #667054;
  margin-top: 9px;
}
details#rules {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 32px;
}
#rules summary {
  font: 20px Georgia;
  padding: 20px 0;
  cursor: pointer;
}
#rules summary span {
  font: 11px Arial;
  color: var(--muted);
  margin-left: 13px;
}
.rules-copy {
  font-size: 13px;
  line-height: 1.75;
  max-width: 840px;
  padding-bottom: 10px;
}
.rules-copy p {
  margin: 0 0 15px;
}
.values {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 20px 0;
}
.values span {
  border: 1px solid #d0c1a2;
  border-radius: 3px;
  background: #f8edcf;
  width: 34px;
  text-align: center;
  font: 17px Georgia;
  padding: 6px 0;
}
.values small {
  font: 9px Arial;
  margin-left: 4px;
}
.dictionary-box {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 15px 18px;
  margin: 20px 0;
}
.dictionary-box h3 {
  font: 21px Georgia;
  margin: 0 0 12px;
}
.dictionary-box form {
  display: flex;
  gap: 8px;
  max-width: 450px;
}
.dictionary-box input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 10px;
  background: #fff9ec;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.dictionary-box button {
  border: 1px solid #807454;
  border-radius: 3px;
  background: #716745;
  color: #fff6df;
  padding: 10px 12px;
  font-size: 11px;
}
.dictionary-box p {
  font-size: 12px;
  line-height: 1.65;
  margin: 10px 0 0;
}
.dictionary-box a {
  color: #836026;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
footer {
  display: flex;
  justify-content: space-between;
  color: #988a72;
  font-size: 8px;
  letter-spacing: 1.2px;
  margin-top: 23px;
}
@media (max-width: 800px) {
  main {
    padding: 25px;
  }
  .play-layout {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 25px;
  }
  .notebook {
    padding-left: 23px;
  }
  h2 {
    font-size: 28px;
  }
  .stats {
    gap: 20px;
  }
  .round-bar p {
    font-size: 14px;
  }
  .square.occupied .letter {
    font-size: 27px;
  }
  .rack {
    gap: 7px;
  }
  .rack-tile {
    font-size: 28px;
  }
  .notebook .turn-track {
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-start;
  }
}
@media (max-width: 650px) {
  main {
    padding: 19px 12px 22px;
  }
  header {
    padding-bottom: 19px;
    gap: 12px;
    align-items: center;
  }
  h1 {
    font-size: 43px;
    letter-spacing: -1.9px;
  }
  h1 span {
    font-size: 24px;
    margin-left: 8px;
  }
  .eyebrow {
    font-size: 8px;
    letter-spacing: 1.5px;
  }
  .intro {
    font-size: 15px;
    margin-top: 8px;
  }
  .text-button {
    font-size: 10px;
    white-space: nowrap;
    padding-left: 0;
  }
  .round-bar {
    padding: 18px 0 20px;
    gap: 15px;
  }
  .round-bar > .eyebrow {
    font-size: 8px;
  }
  .round-bar > div:first-child {
    max-width: 185px;
  }
  .round-bar > div:first-child .eyebrow {
    font-size: 7px;
    line-height: 1.7;
    letter-spacing: 1px;
  }
  .round-bar p {
    font: 13px/1.4 Georgia;
    margin-top: 5px;
  }
  .stats {
    gap: 15px;
  }
  .stats > div {
    min-width: 39px;
  }
  .stats span {
    font-size: 8px;
    letter-spacing: 1px;
  }
  .stats strong {
    font-size: 29px;
  }
  .stats strong small {
    font-size: 10px;
  }
  .play-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }
  .board-frame {
    margin: 0 -5px;
    padding: 9px 5px 8px;
    border-radius: 6px;
  }
  .board-top {
    font-size: 6px;
    letter-spacing: 1px;
    margin: 1px 3px 9px;
  }
  .board-bottom {
    font-size: 6px;
    letter-spacing: 1px;
    margin: 9px 3px 0;
  }
  .board {
    gap: 2px;
    padding: 3px;
  }
  .square {
    border-radius: 2px;
  }
  .square .bonus-mark {
    font-size: 8px;
  }
  .square.centre .bonus-mark {
    font-size: 22px;
  }
  .square.occupied .letter {
    font-size: 23px;
    margin-top: -3px;
  }
  .square.occupied .value {
    bottom: 3px;
    right: 3px;
    font-size: 7px;
  }
  .rack-label {
    margin-top: 23px;
    margin-bottom: 11px;
  }
  .rack-label .eyebrow {
    font-size: 7px;
  }
  #rack-tip {
    font-size: 9px;
  }
  .rack {
    gap: 7px;
    padding: 0 4px 12px;
  }
  .rack-tile {
    font-size: 28px;
    aspect-ratio: 1/1.18;
    border-radius: 4px;
  }
  .rack-tile small {
    right: 4px;
    bottom: 5px;
    font-size: 8px;
  }
  .rack-actions {
    gap: 7px;
    margin: 12px 0;
  }
  .rack-actions button {
    font-size: 10px;
    padding: 9px 4px;
  }
  .rack-actions button small {
    font-size: 7px;
    margin-top: 3px;
  }
  .submit-row {
    padding-top: 12px;
    min-height: 67px;
    gap: 12px;
  }
  .submit-row p {
    font-size: 11px;
  }
  .primary {
    padding: 13px 12px;
    font-size: 11px;
  }
  .primary span {
    margin-left: 14px;
  }
  .notebook {
    border: 1px solid var(--line);
    padding: 17px 17px 0;
    border-radius: 5px;
  }
  .notebook > .note-heading,
  .notebook > h2,
  .notebook > .note-intro {
    display: none;
  }
  .bonus-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0 0 17px;
  }
  .bonus-legend > span {
    font-size: 9px;
    gap: 7px;
  }
  .bonus-legend i {
    width: 21px;
    height: 21px;
    font-size: 7px;
  }
  .bonus-legend .star {
    font-size: 17px;
  }
  #receipt {
    padding-top: 17px;
  }
  #receipt h3 {
    font-size: 21px;
  }
  .empty-note {
    font-size: 14px;
    line-height: 1.5;
  }
  .notebook .turn-track {
    display: flex;
    justify-content: space-between;
    flex-wrap: nowrap;
    margin: 20px 0 18px;
  }
  .turn-pip {
    width: 21px;
    height: 21px;
    flex: none;
  }
  .word-score {
    font-size: 22px;
    margin-top: 11px;
  }
  .word-math {
    font-size: 10px;
  }
  .result {
    padding: 21px 18px;
    margin-top: 25px;
  }
  .result h2 {
    font-size: 28px;
  }
  .result p {
    font-size: 11px;
  }
  .result .eyebrow {
    font-size: 7px;
  }
  .final-score strong {
    font-size: 42px;
  }
  .final-score span {
    font-size: 8px;
    letter-spacing: 1.4px;
  }
  #rules summary {
    font-size: 18px;
    padding: 18px 0;
  }
  #rules summary span {
    display: block;
    font-size: 10px;
    margin: 6px 0 0 16px;
  }
  .rules-copy {
    font-size: 12px;
  }
  .dictionary-box {
    padding: 14px 12px;
  }
  .dictionary-box h3 {
    font-size: 19px;
  }
  .dictionary-box p {
    font-size: 11px;
  }
  .dictionary-box button {
    font-size: 10px;
    white-space: nowrap;
  }
  footer {
    font-size: 7px;
    letter-spacing: 0.7px;
    gap: 20px;
    line-height: 1.6;
  }
  footer span:last-child {
    text-align: right;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
