:root {
  --bg: #1a1230;
  --ink: #f8f1ff;
  --muted: #b9a9c9;
  --line: #3a2d52;
  --panel: #1a1230;
  --tile: #1a1230;
  --tile-border: #5a4b70;
  --tile-filled: #8b7a9e;
  --correct: #6aaa64;
  --correct-ink: #f4fff2;
  --wrong: #c94c4c;
  --wrong-ink: #fff6f6;
  --unknown: #e0b43a;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --tap: 36px;
  --clue-size: 13px;
  --clue-pad: 1px;
  --cell-h: 36px;
  --play-gap: 8px;
  --input-size: 16px;
  --table-gap: 6px;
  --clue-cols: 1;
  --play-max: 1200px;
  --notes-size: 16px;
  --mast-h: 8rem;
  --footer-h: 2rem;
  --notes-paper: #241832;
  --notes-border: #c4a07a;
  --notes-shadow: 0 8px 20px color-mix(in srgb, #000 32%, transparent);
  --key: #3a2d52;
  --key-ink: #f8f1ff;
  --kbd-h: 0px;
}

html[data-theme="light"] {
  --bg: #fff6eb;
  --ink: #2a1f18;
  --muted: #6e5a4c;
  --line: #e4d5c6;
  --panel: #fff6eb;
  --tile: #fffdf8;
  --tile-border: #cbbbaa;
  --tile-filled: #2a1f18;
  --correct: #6aaa64;
  --correct-ink: #f4fff2;
  --wrong: #c94c4c;
  --wrong-ink: #fff6f6;
  --unknown: #b57a12;
  --notes-paper: #fffaf3;
  --notes-border: #d2a57a;
  --notes-shadow: 0 8px 18px color-mix(in srgb, #2a1f18 12%, transparent);
  --key: #e4d5c6;
  --key-ink: #2a1f18;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

button,
input,
textarea,
a,
summary {
  touch-action: manipulation;
  font: inherit;
  color: inherit;
}

button {
  background: transparent;
  border: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
a:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  width: min(var(--play-max), calc(100% - 16px));
  margin: 0 auto;
  padding: calc(2px + var(--safe-top)) 8px calc(6px + var(--safe-bottom));
  gap: 0;
  text-align: center;
}

.mast {
  flex: 0 0 auto;
}

.mast-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-height: 36px;
  border-bottom: 1px solid var(--line);
}

.mast-tools {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.icon-btn {
  min-width: var(--tap);
  min-height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

h1 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-optical-sizing: auto;
  font-weight: 600;
  letter-spacing: 0.12em;
  font-size: 1.2rem;
  line-height: 1;
  text-transform: uppercase;
  color: var(--ink);
}

.eyebrow {
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 3px;
}

.question {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 2px 0 0;
  color: var(--ink);
  font-weight: 600;
}

.question strong {
  color: inherit;
  font-weight: 600;
}

.lede,
.meta,
.site-footer,
.toast,
.empty,
.setup,
.howto {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.lede {
  max-width: 52ch;
  margin: 0 auto;
}

.howto {
  max-width: 62ch;
  margin: 2px auto 0;
  text-align: left;
  color: var(--ink);
}

.howto summary {
  cursor: pointer;
  text-align: center;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  list-style: none;
}

.howto summary::-webkit-details-marker {
  display: none;
}

.howto[open] summary {
  margin-bottom: 4px;
}

.howto #how-to,
.howto .setup {
  margin: 0 0 4px;
  color: var(--ink);
}

.meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.62rem;
  margin: 2px 0 3px;
  color: var(--muted);
}

.meta svg {
  width: 12px;
  height: 12px;
  vertical-align: -2px;
}

.practice-nav {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: 100%;
  max-width: 100%;
  margin: 0 0 2px;
  overflow-x: hidden;
  color: var(--muted);
}

.practice-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 6px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.practice-picker-label {
  flex: 0 0 auto;
  font-size: var(--clue-size, 13px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.practice-select-wrap {
  position: relative;
  flex: 1 1 12rem;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.practice-nav select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 32px;
  height: 32px;
  padding: 0 32px 0 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  background-image: none;
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0;
  text-transform: none;
  appearance: none;
  -webkit-appearance: none;
}

.practice-nav select option,
.practice-nav select optgroup {
  padding: 6px 8px;
  font-size: 16px;
}

.practice-select-caret {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--ink);
}

.practice-select-caret svg {
  display: block;
  width: 16px;
  height: 16px;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.actions button {
  border: 2px solid var(--ink);
  min-height: 40px;
  min-width: 96px;
  padding: 8px 16px;
  color: var(--bg);
  background: var(--ink);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
}

.actions button.ghost,
.actions #win-close,
.actions #start-over-cancel {
  background: transparent;
  color: var(--ink);
}

.board {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
  width: 100%;
}

.play {
  display: flex;
  flex-direction: column;
  gap: var(--play-gap);
  width: 100%;
  min-height: 0;
  text-align: left;
}

.puzzle-col {
  display: flex;
  flex-direction: column;
  gap: var(--play-gap);
  min-width: 0;
  width: 100%;
  order: 1;
}

.grid-wrap {
  min-width: 0;
}

.notes-swap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.notes-swap-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 0;
}

.notes-swap-label {
  color: var(--muted);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
}

.notes-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: var(--panel);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.notes-back svg {
  width: 14px;
  height: 14px;
}

.notes-pad {
  position: relative;
  flex: 1 1 auto;
  min-height: 8rem;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--notes-border);
  border-radius: 18px;
  background: var(--notes-paper);
  color: var(--ink);
  font-size: var(--notes-size, 16px);
  line-height: 1.45;
  text-align: left;
  white-space: pre-wrap;
  overflow: auto;
  caret-color: transparent;
}

.notes-pad-before,
.notes-pad-after {
  white-space: pre-wrap;
}

.notes-caret {
  display: inline-block;
  width: 1.5px;
  height: 1em;
  margin: 0 1px -2px 0;
  background: var(--ink);
  vertical-align: -2px;
  animation: notes-caret 1s step-end infinite;
}

.notes-pad-placeholder {
  position: absolute;
  left: 14px;
  top: 12px;
  color: var(--muted);
  opacity: 0.72;
  pointer-events: none;
}

@keyframes notes-caret {
  50% { opacity: 0; }
}

.word-bank {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  color: var(--ink);
}

.word-bank-row {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 0.75em;
  align-items: baseline;
  min-width: 0;
}

.word-bank-cat {
  white-space: nowrap;
  font-size: var(--clue-size, 13px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.2;
}

.word-bank-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 2px 10px;
  min-width: 0;
}

.word-bank-word {
  font-size: var(--clue-size, 13px);
  line-height: 1.2;
  color: var(--ink);
}

.word-bank-word.is-placed {
  color: var(--muted);
  text-decoration: line-through;
}

.grid-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: var(--table-gap);
  table-layout: fixed;
}

.grid-table .attr-head {
  width: 7rem;
  min-width: 7rem;
  padding: 0 8px 0 0;
  font-size: var(--clue-size, 13px);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
  line-height: 1;
}

.grid-table .attr-head svg {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: middle;
  margin-right: 6px;
}

.grid-table .attr-head span {
  display: inline;
  white-space: nowrap;
  vertical-align: middle;
}

.house-head {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 2px;
  text-align: center;
  color: var(--muted);
  background: transparent;
}

.house-head svg {
  width: 12px;
  height: 12px;
  vertical-align: -2px;
}

.grid-table td {
  position: relative;
  vertical-align: middle;
  padding: 0;
  background: transparent;
}

.slot {
  position: relative;
  display: block;
  min-height: var(--cell-h, var(--tap));
  height: var(--cell-h);
  margin: 0;
  border: 2px solid var(--tile-border);
  background: var(--tile);
  border-radius: 0;
  transform: scale(1);
  transition: transform 140ms ease;
}

.slot.is-selected,
.slot:focus-within {
  z-index: 5;
  border-color: var(--ink);
  transform: scale(1.06);
}

.grid-table td:has(.slot.is-selected),
.grid-table td:has(.slot:focus-within) {
  z-index: 5;
}

.slot-fit {
  display: none;
}

.slot-ghost {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  font-size: var(--input-size, 16px);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-align: left;
  color: var(--muted);
  pointer-events: none;
  overflow: hidden;
  white-space: nowrap;
  line-height: calc(var(--cell-h) - 4px);
}

.slot-input {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: var(--cell-h);
  border: 0;
  background: transparent;
  font-size: var(--input-size, 16px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: calc(var(--cell-h) - 4px);
  text-transform: uppercase;
  text-align: center;
  color: var(--ink);
  padding: 0 4px;
}

.slot.is-filled {
  border-color: var(--tile-filled);
}

.slot.is-unknown {
  border-style: dashed;
  border-color: var(--unknown);
}

.slot.is-correct,
.slot.is-correct .slot-input,
.slot.is-correct .slot-fit {
  background: var(--correct);
  border-color: var(--correct);
  color: var(--correct-ink);
}

.slot.is-wrong,
.slot.is-wrong .slot-input,
.slot.is-wrong .slot-fit {
  background: var(--wrong);
  border-color: var(--wrong);
  color: var(--wrong-ink);
}

.slot.is-pop {
  animation: pop 0.28s ease;
}

.slot.is-flip {
  animation: flip 0.5s ease;
}

.slot.is-shake {
  animation: shake 0.42s ease;
}

.slot.is-win {
  animation: hop 0.55s ease;
}

@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes flip {
  0% { transform: rotateX(0deg); }
  50% { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

@keyframes hop {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
}

.notes-panel {
  order: 2;
  min-width: 0;
  text-align: left;
}

.notes-toggle {
  cursor: pointer;
  list-style: none;
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: left;
  padding: 4px 0;
}

.notes-toggle::-webkit-details-marker {
  display: none;
}

.notes {
  display: block;
  width: 100%;
  min-height: 12rem;
  resize: none;
  background: var(--notes-paper);
  border: 2px solid var(--notes-border);
  border-radius: 18px;
  box-shadow: var(--notes-shadow);
  color: var(--ink);
  font-size: var(--notes-size, 16px);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  padding: 16px 18px;
  line-height: 1.5;
}

.notes::placeholder {
  color: var(--muted);
  opacity: 0.72;
}

.notes:focus,
.notes:focus-visible {
  outline: 2px solid var(--notes-border);
  outline-offset: 2px;
  border-color: var(--notes-border);
  box-shadow: var(--notes-shadow), 0 0 0 4px color-mix(in srgb, var(--notes-border) 30%, transparent);
}

.hint-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.hint-heading {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0 0 1px;
  min-height: 0;
  line-height: 1;
}

.hint-label {
  color: var(--muted);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  margin: 0;
  line-height: 1;
}

.icon-btn.hint-reveal {
  min-width: 28px;
  min-height: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--muted);
}

.hint-reveal svg {
  width: 16px;
  height: 16px;
}

.icon-btn.hint-notes {
  min-width: 28px;
  min-height: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--muted);
}

.hint-notes svg {
  width: 16px;
  height: 16px;
}

.icon-btn.hint-notes.is-open {
  color: var(--ink);
}

.icon-btn.hint-notes.is-open svg path[opacity] {
  opacity: 1;
}

.clues {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(var(--clue-cols, 1), minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 0;
}

.clue {
  display: grid;
  grid-template-columns: 1.7em minmax(0, 1fr);
  align-items: start;
  gap: 4px;
  width: 100%;
  min-height: 0;
  padding: var(--clue-pad, 1px) 0;
  text-align: left;
  color: var(--ink);
  font-size: var(--clue-size, 13px);
  line-height: 1.25;
  white-space: normal;
  border-bottom: 0;
  background: transparent;
}

.clue-num {
  font-size: inherit;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  font-weight: 600;
  color: var(--muted);
  line-height: inherit;
}

.clue-text {
  min-width: 0;
  color: inherit;
}

.clue-text strong {
  font-weight: 600;
  color: inherit;
  background: none;
}

.clue.is-used {
  color: var(--muted);
}

.clue.is-used .clue-text {
  text-decoration: line-through;
  text-decoration-color: var(--muted);
  text-decoration-thickness: 1px;
}

.site-footer {
  text-align: center;
  flex: 0 0 auto;
  margin-top: 6px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.58rem;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(12px + var(--kbd-h, 0px) + var(--safe-bottom));
  transform: translateX(-50%);
  z-index: 8;
  border: 2px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
  padding: 8px 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.68rem;
}

.osk {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 6px 6px calc(8px + var(--safe-bottom));
  background: var(--bg);
  touch-action: manipulation;
}

html.is-osk .osk {
  display: flex;
}

html.is-osk .shell {
  padding-bottom: calc(var(--kbd-h, 168px) + var(--safe-bottom));
}

html.is-osk .lede {
  display: none;
}

html.is-osk .question {
  font-size: 1.05rem;
  margin: 1px 0 0;
}

html.is-osk h1 {
  font-size: 1.12rem;
}

html.is-osk .eyebrow {
  margin-top: 2px;
}

html.is-osk .howto {
  margin: 1px auto 0;
}

html.is-osk .meta {
  margin: 1px 0 2px;
}

html.is-osk .practice-nav {
  margin: 0 0 1px;
}

.osk-row {
  display: flex;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.osk-row:nth-child(2) {
  padding: 0 10px;
}

.osk-key {
  flex: 1 1 0;
  min-width: 0;
  min-height: 42px;
  height: 42px;
  padding: 0 2px;
  border: 0;
  border-radius: 8px;
  background: var(--key);
  color: var(--key-ink);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.osk-key.is-wide {
  flex: 1.55 1 0;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.osk-key.is-space {
  flex: 6 1 0;
}

.osk-key svg {
  width: 22px;
  height: 22px;
}

.osk-key:active {
  background: color-mix(in srgb, var(--key) 72%, var(--ink));
}

@media (pointer: fine) {
  .osk {
    display: none !important;
  }
}

@media (min-width: 640px) {
  .osk,
  html.is-osk .osk {
    display: none !important;
  }

  #btn-notes {
    display: none;
  }
}

.win {
  position: fixed;
  inset: 0;
  z-index: 9;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.win-card {
  width: min(380px, 100%);
  border: 2px solid var(--ink);
  background: var(--bg);
  padding: 28px 22px 20px;
  text-align: center;
}

.win-card h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.8rem;
  letter-spacing: -0.03em;
  margin-bottom: 6px;
  color: var(--ink);
}

.win-question {
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 16px;
}

.win-stats {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 18px;
}

.win-stats li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.win-stats strong {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.35rem;
  color: var(--ink);
}

.win-stats span {
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.empty {
  padding: 24px;
  text-align: center;
}

@media (max-width: 639px) {
  .grid-table .attr-head span {
    display: none;
  }

  .grid-table .attr-head {
    width: 1.5rem;
    min-width: 1.5rem;
    text-align: center;
    padding: 0 2px;
  }

  .grid-table .attr-head svg {
    margin-right: 0;
  }

  .house-head span {
    display: none;
  }

  .slot-input,
  .slot-ghost,
  .notes {
    font-size: 16px;
  }

  .slot {
    overflow: hidden;
  }

  .slot.is-selected,
  .slot:focus-within {
    overflow: visible;
  }

  .slot.is-selected .slot-fit {
    visibility: hidden;
  }

  .slot.is-selected .slot-input {
    color: var(--ink);
    caret-color: transparent;
  }

  .slot.is-editing {
    overflow: visible;
    z-index: 6;
  }

  .slot-fit {
    display: flex;
    position: absolute;
    inset: 0;
    z-index: 2;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--ink);
    pointer-events: none;
    overflow: hidden;
    line-height: 1.05;
    padding: 2px;
  }

  .slot.is-editing .slot-fit {
    visibility: hidden;
  }

  .slot-input {
    color: transparent;
    caret-color: transparent;
    letter-spacing: 0;
  }

  .slot.is-editing .slot-input {
    color: var(--ink);
    caret-color: var(--ink);
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: var(--edit-w, 100%);
    min-width: 100%;
    min-height: 44px;
    height: 44px;
    font-size: 16px;
    background: var(--tile);
    border: 2px solid var(--ink);
    box-shadow: var(--notes-shadow);
    z-index: 3;
    padding: 0 8px;
  }

  .slot.is-editing.is-correct .slot-input {
    background: var(--correct);
    border-color: var(--correct);
    color: var(--correct-ink);
  }

  .slot.is-editing.is-wrong .slot-input {
    background: var(--wrong);
    border-color: var(--wrong);
    color: var(--wrong-ink);
  }

  .slot.is-editing.is-unknown .slot-input {
    border-style: dashed;
    border-color: var(--unknown);
    color: var(--ink);
    background: var(--tile);
  }

  .slot:not(.is-editing):not(.is-selected) .slot-ghost {
    display: none;
  }

  .slot.is-selected .slot-ghost {
    position: absolute;
    inset: 0;
    z-index: 2;
    font-size: 16px;
    letter-spacing: 0;
    line-height: calc(var(--cell-h) - 4px);
  }

  .slot.is-editing .slot-ghost {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: var(--edit-w, 100%);
    min-width: 100%;
    min-height: 44px;
    height: 44px;
    font-size: 16px;
    letter-spacing: 0;
    z-index: 2;
    line-height: 44px;
  }

  .notes-panel {
    display: none !important;
  }

  .notes-pad {
    font-size: 16px;
  }

  .clue,
  .word-bank-word,
  .word-bank-cat,
  .grid-table .attr-head,
  .house-head,
  .play {
    transition:
      font-size 180ms ease,
      line-height 180ms ease,
      padding 180ms ease,
      gap 180ms ease;
  }

  .board.is-fitting .clue,
  .board.is-fitting .word-bank-word,
  .board.is-fitting .word-bank-cat,
  .board.is-fitting .grid-table .attr-head,
  .board.is-fitting .house-head,
  .board.is-fitting .play,
  .board.is-fitting .slot {
    transition: none;
  }
}

@media (min-width: 640px) {
  :root {
    --clue-size: 15px;
    --clue-pad: 4px;
  }

  .board {
    justify-content: stretch;
  }

  .play {
    flex: 1 1 auto;
    flex-direction: row;
    justify-content: space-between;
    align-items: stretch;
    gap: 20px;
    min-height: 0;
    height: 100%;
  }

  .notes-panel {
    order: 0;
    flex: 1 1 28%;
    width: 28%;
    min-width: 260px;
    max-width: 30%;
    position: sticky;
    top: calc(4px + var(--safe-top));
    align-self: flex-start;
    height: calc(100dvh - var(--mast-h, 8rem) - var(--footer-h, 2rem) - 8px);
    max-height: calc(100dvh - var(--mast-h, 8rem) - var(--footer-h, 2rem) - 8px);
    display: flex;
    flex-direction: column;
    text-align: left;
  }

  .notes-toggle {
    pointer-events: none;
    cursor: default;
    flex: 0 0 auto;
  }

  .notes-sheet {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  .notes-swap {
    display: none !important;
  }

  .notes {
    flex: 1 1 auto;
    width: 100%;
    min-height: 16rem;
    height: calc(100dvh - var(--mast-h, 8rem) - var(--footer-h, 2rem) - 2.5rem);
    max-height: calc(100dvh - var(--mast-h, 8rem) - var(--footer-h, 2rem) - 2.5rem);
    overflow: auto;
  }

  .puzzle-col {
    order: 0;
    flex: 1 1 70%;
    max-width: 840px;
    width: 100%;
    min-width: 0;
  }
}

@media (max-height: 760px) {
  .lede { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .slot,
  .slot.is-selected,
  .slot:focus-within {
    transform: none;
    transition: none;
  }

  .slot.is-pop,
  .slot.is-flip,
  .slot.is-shake,
  .slot.is-win {
    animation: none;
  }

  .notes-caret {
    animation: none;
  }

  .clue,
  .word-bank-word,
  .word-bank-cat,
  .grid-table .attr-head,
  .house-head,
  .play {
    transition: none;
  }
}
