:root {
  color-scheme: light;
  --paper: #f5f6f2;
  --ink: #202c27;
  --muted: #616960;
  --green: #244d39;
  --line: #d3d8ce;
  --tile: #e9ece4;
  --group-0: #bed68f;
  --group-1: #edc75a;
  --group-2: #90bfd7;
  --group-3: #d48daf;
  --group-border-0: #637e38;
  --group-border-1: #997725;
  --group-border-2: #3d7997;
  --group-border-3: #935175;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 1.5; }
button, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: 3px solid #a44322; outline-offset: 4px; }
button:disabled { cursor: default; }
.paper { max-width: 960px; padding: 25px 36px 0; margin: 0 auto; }
.edition-line { display: flex; justify-content: space-between; gap: 12px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0; border-top: 1px solid var(--ink); padding: 9px 0; }
.brand-line { border-top: 1px solid var(--line); border-bottom: 3px double var(--ink); padding: 19px 0 23px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font: bold 42px/1 Georgia, 'Times New Roman', serif; }
.brand img { flex-shrink: 0; }
.brand-dot { color: var(--green); }
.brand-note { color: var(--muted); font: italic 15px/1.4 Georgia, 'Times New Roman', serif; text-align: right; }
main { max-width: 704px; margin: 0 auto; }
.puzzle-nav { display: flex; flex-wrap: wrap; gap: 0 20px; border-bottom: 1px solid var(--line); margin-top: 6px; }
.puzzle-nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; min-height: 46px; padding: 11px 0; border-bottom: 3px solid transparent; }
.puzzle-nav a:hover { color: var(--green); }
.puzzle-nav a[aria-current="page"] { color: var(--green); border-color: var(--green); }
@media (max-width: 600px) {
  .puzzle-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; }
  .puzzle-nav a { font-size: 12px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 10px 0; }
}
.puzzle-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 36px 0 25px; }
.eyebrow { display: flex; align-items: center; gap: 7px; font-size: 10px; font-weight: bold; text-transform: uppercase; color: var(--green); }
.live-dot { width: 6px; height: 6px; background: var(--green); border-radius: 50%; }
.edition-number { margin-left: 4px; padding-left: 10px; border-left: 1px solid var(--line); font-variant-numeric: tabular-nums; }
h1 { font: 700 29px/1.2 Georgia, 'Times New Roman', serif; margin: 9px 0 6px; }
.instructions { margin: 0; color: var(--muted); font-size: 14px; }
.button { border: 1px solid #bbc4b7; border-radius: 5px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 600; min-height: 44px; padding: 10px 16px; cursor: pointer; display: inline-flex; justify-content: center; align-items: center; gap: 8px; white-space: nowrap; transition: background .15s, border-color .15s, transform .15s; }
.button:hover:not(:disabled) { background: #e2e7dd; border-color: var(--green); }
.button:active:not(:disabled) { transform: translateY(1px); }
.button:disabled { color: #697466; border-color: #d6dbd1; background: #eef0e9; }
.button span[aria-hidden] { font-size: 19px; line-height: 1; }
.new-puzzle { font-size: 12px; padding: 8px 13px; flex-shrink: 0; }
.primary { background: var(--green); border-color: var(--green); color: white; }
.primary:hover:not(:disabled) { background: #163d29; color: white; }
.primary:disabled { background: #dfe5da; }
.stats { display: grid; grid-template-columns: 1.7fr 1fr 1fr; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 15px 0; }
.stats > div { display: flex; flex-direction: column; gap: 5px; padding-left: 24px; border-left: 1px solid var(--line); }
.stats > div:first-child { padding-left: 0; border-left: 0; }
.stat-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; }
.stat-value { font-size: 19px; font-weight: 600; line-height: 24px; font-variant-numeric: tabular-nums; }
.streak-mark { color: var(--green); }
.lives { display: flex; align-items: center; height: 24px; gap: 7px; }
.life { height: 12px; width: 12px; border-radius: 50%; background: var(--green); border: 1px solid var(--green); transition: background .25s; }
.life.used { background: transparent; border-color: #98a391; }
.lives-count { margin-left: 3px; font-size: 12px; color: var(--muted); }
.play-area { margin-top: 23px; }
.board-caption { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; margin-bottom: 10px; }
.word-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.word { min-width: 0; min-height: 77px; padding: 10px 7px; background: var(--tile); border: 2px solid transparent; border-radius: 5px; font-size: 15px; line-height: 1.2; font-weight: 700; color: var(--ink); position: relative; cursor: pointer; display: flex; align-items: center; justify-content: center; text-align: center; overflow-wrap: anywhere; transition: background .15s, color .15s, border-color .15s, transform .15s; }
@media (hover: hover) { .word:hover { background: #dce3d5; transform: translateY(-1px); } }
.word.selected { background: var(--green); color: #fff; border-color: #244d39; }
.word.hinted:after { content: ''; position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: #a44322; outline: 2px solid var(--paper); }
.word.long { font-size: 12px; }
.word:disabled { cursor: default; }
.solved-groups { display: grid; gap: 8px; }
.solved-groups:not(:empty) { margin-bottom: 8px; }
.solved-group { min-height: 77px; border: 1px solid var(--group-border-0); border-radius: 5px; padding: 12px 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #17251d; background: var(--group-0); }
.solved-group[data-colour="1"] { background: var(--group-1); border-color: var(--group-border-1); }
.solved-group[data-colour="2"] { background: var(--group-2); border-color: var(--group-border-2); }
.solved-group[data-colour="3"] { background: var(--group-3); border-color: var(--group-border-3); }
.solved-group h3 { margin: 0 0 3px; font-size: 12px; line-height: 1.35; font-weight: 800; text-transform: uppercase; }
.solved-group p { margin: 0; font-size: 12px; }
.solved-group.revealed { border-style: dashed; }
.solved-group.revealed h3:before { content: 'Unfound · '; text-transform: none; font-weight: normal; }
.solved-group.arrive { animation: arrive .4s ease-out; }
.word-grid.shake { animation: shake .35s ease-in-out; }
.message { min-height: 48px; padding: 13px 0 9px; font-size: 12px; color: var(--muted); text-align: center; }
.message.error { color: #9b301c; font-weight: 600; }
.message.success { color: var(--green); font-weight: 600; }
.controls { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.secondary-controls { display: flex; gap: 8px; }
.hint-count { border-left: 1px solid #bbc4b7; padding-left: 8px; font-size: 11px; }
.clear-button { padding-left: 12px; padding-right: 12px; }
.result { border-top: 1px solid var(--line); padding: 27px 0 0; text-align: center; position: relative; overflow: hidden; margin-top: 8px; }
.result canvas { position: absolute; inset: 0; pointer-events: none; width: 100%; height: 100%; }
.result > :not(canvas) { position: relative; }
.result-kicker { font-size: 10px; font-weight: bold; text-transform: uppercase; color: var(--green); }
.result h2 { font: 700 29px/1.2 Georgia, 'Times New Roman', serif; margin: 8px 0; }
.result p { font-size: 13px; color: var(--muted); margin: 0 0 16px; }
.result-metrics { display: flex; gap: 16px; align-items: center; justify-content: center; font-size: 11px; color: var(--muted); flex-wrap: wrap; }
.result-metrics strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.result-actions { margin: 21px 0 9px; display: flex; gap: 10px; justify-content: center; }
#share-fallback { max-width: 350px; margin: 16px auto; text-align: left; }
#share-fallback label { font-size: 12px; }
.connection-notes { border-top: 1px solid var(--line); margin: 27px 0 0; padding-top: 16px; }
.connection-notes summary { cursor: pointer; min-height: 44px; padding: 8px 0; font-family: Georgia, 'Times New Roman', serif; font-size: 18px; font-weight: bold; }
.connection-notes summary:focus-visible { outline: 3px solid #a44322; outline-offset: 4px; }
.note-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.note-item:last-child { border-bottom: 0; }
.note-item h3 { font-size: 13px; margin: 0 0 5px; }
.note-item p { font-size: 14px; line-height: 1.6; margin: 0; color: #495247; }
textarea { display: block; width: 100%; background: #fff; border: 1px solid var(--line); padding: 10px; border-radius: 5px; resize: vertical; }
footer { display: flex; justify-content: space-between; gap: 16px; padding: 17px 0 25px; margin-top: 35px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@keyframes arrive { from { opacity: .3; transform: scale(.98); } to { opacity: 1; transform: scale(1); } }
@media (max-width: 650px) {
  .paper { padding: 18px 20px 0; }
  .brand { font-size: 32px; gap: 9px; }
  .brand img { width: 32px; height: 32px; }
  .brand-note { font-size: 12px; }
  .puzzle-heading { margin: 27px 0 21px; }
  h1 { font-size: 25px; }
  .controls { flex-direction: column; }
  .secondary-controls { width: 100%; }
  .secondary-controls .button { flex: 1; padding: 9px 7px; }
  #submit { width: 100%; }
  .word { min-height: 74px; font-size: 13px; }
  .word.long { font-size: 11px; }
}
@media (max-width: 440px) {
  .paper { padding: 13px 14px 0; }
  .edition-line { font-size: 9px; }
  .brand { font-size: 29px; }
  .brand-note { display: none; }
  .brand-line { padding: 16px 0 19px; }
  .puzzle-heading { gap: 8px; align-items: flex-start; }
  h1 { font-size: 23px; max-width: 220px; }
  .instructions { font-size: 12px; max-width: 205px; }
  .new-puzzle { min-height: 38px; padding: 8px; font-size: 11px; margin-top: 25px; gap: 3px; }
  .eyebrow { font-size: 9px; gap: 4px; }
  .edition-number { padding-left: 6px; margin-left: 2px; }
  .stats { grid-template-columns: 1.7fr 1fr .8fr; padding: 12px 0; }
  .stats > div { padding-left: 15px; }
  .stat-label { font-size: 9px; }
  .word-grid { gap: 6px; }
  .word { min-height: 73px; padding: 9px 3px; font-size: 12px; }
  .word.long { font-size: 10px; }
  .solved-group { min-height: 73px; padding: 10px; }
  .solved-group h3 { font-size: 11px; }
  .solved-group p { font-size: 11px; }
  .result h2 { font-size: 25px; }
  footer { margin-top: 27px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
