:root {
  font-family: Arial, Helvetica, sans-serif;
  color: #fff4da;
  background: #103d33;
  font-synthesis: none;
  --cream: #fff4da;
  --muted: #c3d3c8;
  --ink: #173e32;
  --peach: #f4b58b;
  --line: #507065;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
main {
  max-width: 620px;
  margin: auto;
  padding: 22px 22px 28px;
}
button,
select,
textarea {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: inherit;
  padding: 10px 14px;
}
button:disabled {
  cursor: default;
  opacity: 0.46;
}
a {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--peach);
  outline-offset: 4px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
  font:
    34px/1 Georgia,
    serif;
  letter-spacing: -1.4px;
}
.brand img {
  height: 39px;
  width: 37px;
  margin-right: -1px;
}
.icon {
  border-radius: 50%;
  min-width: 44px;
  padding: 8px;
  font-size: 20px;
}
.edition {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 20px 0 0;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.edition > span {
  font-size: 10px;
  letter-spacing: 1.6px;
  color: var(--muted);
}
.edition button {
  border: 0;
  font-size: 12px;
  padding: 6px 0 6px 8px;
}
.intro {
  text-align: center;
  margin: 24px 0;
}
h1,
h2 {
  font-family: Georgia, serif;
  font-weight: normal;
}
h1 {
  font-size: 30px;
  letter-spacing: -0.6px;
  margin: 0 0 9px;
}
.intro p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  margin: 0;
}
.bank-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 9px;
}
.bank {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}
.tile,
.slot.filled {
  background: var(--cream);
  color: var(--ink);
  border: 0;
  border-bottom: 3px solid #cfc1a2;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 0 #092a22;
}
.tile {
  font-size: 13px;
  min-height: 48px;
  padding: 8px 2px;
}
.tile.used {
  visibility: hidden;
  pointer-events: none;
}
.tile.selected,
.slot.selected {
  background: var(--peach);
  color: var(--ink);
  border-color: #d28d61;
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}
.interaction {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  min-height: 18px;
  margin: 13px 0 16px;
}
.chains {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}
.chain {
  text-align: center;
  min-width: 0;
}
.chain h2 {
  font:
    11px Arial,
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.6px;
  color: var(--muted);
  margin: 0 0 10px;
}
.word-cell {
  position: relative;
  margin-bottom: 18px;
}
.word-cell:not(:last-child):after {
  content: "↓";
  position: absolute;
  bottom: -17px;
  left: 0;
  right: 0;
  color: #9ab6a8;
  font-size: 14px;
  line-height: 16px;
}
.anchor {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  gap: 8px;
}
.anchor small {
  font-size: 9px;
  font-weight: normal;
  color: var(--muted);
  text-transform: uppercase;
}
.slot {
  width: 100%;
  min-height: 45px;
  padding: 8px 2px;
  background: #0d342c;
  border: 1px solid #6e8c7c;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
}
.slot:not(.filled) {
  color: #9db8aa;
}
.slot:disabled {
  opacity: 1;
}
.slot.filled {
  animation: settle 0.15s ease-out;
}
.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  bottom: 0;
  background: #103d33;
  padding: 13px 0 10px;
  border-top: 1px solid var(--line);
  z-index: 2;
}
.quiet {
  border: 0;
  padding: 8px;
  font-size: 13px;
}
.primary {
  background: var(--cream);
  color: var(--ink);
  border-color: var(--cream);
  font-weight: 700;
  min-width: 100px;
}
.actions .primary {
  margin-left: auto;
}
.primary:disabled {
  background: #81988a;
  border-color: #81988a;
  color: #153a2f;
  opacity: 1;
}
#status {
  font-size: 13px;
  line-height: 1.6;
  min-height: 22px;
  text-align: center;
  margin: 9px 0 18px;
}
.feedback {
  border-top: 1px solid var(--line);
  padding: 12px 0;
}
#feedback-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
#feedback-title,
.note-label,
#feedback-saved {
  grid-column: 1/-1;
}
#feedback-title {
  font-size: 22px;
  margin: 8px 0;
}
label {
  font-size: 12px;
  display: block;
}
select,
textarea {
  width: 100%;
  color: var(--cream);
  background: #0d342c;
  border: 1px solid #769284;
  border-radius: 8px;
  padding: 10px;
  margin-top: 7px;
  min-height: 44px;
}
textarea {
  resize: vertical;
  line-height: 1.5;
}
textarea::placeholder {
  color: #b2c7ba;
}
#feedback-saved {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
}
#progress {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
}
#storage-note {
  color: #ffd0af;
}
dialog {
  background: #fff8e9;
  color: var(--ink);
  border: 0;
  border-radius: 18px;
  padding: 30px;
  max-width: 470px;
  width: calc(100% - 28px);
  max-height: 88dvh;
  overflow: auto;
  margin: auto;
}
dialog::backdrop {
  background: #041e19bb;
  backdrop-filter: blur(3px);
}
dialog h2 {
  font-size: 28px;
  margin: 10px 0 18px;
}
dialog p,
dialog li {
  font-size: 14px;
  line-height: 1.6;
}
dialog li {
  margin-bottom: 9px;
}
dialog ol {
  padding-left: 20px;
}
dialog button {
  color: var(--ink);
  border-color: #a0ad98;
}
dialog .primary {
  background: var(--ink);
  color: var(--cream);
  border-color: var(--ink);
}
dialog .close {
  position: absolute;
  right: 10px;
  top: 8px;
  border: 0;
  font-size: 25px;
}
.eyebrow {
  font-size: 10px !important;
  letter-spacing: 1.5px;
}
.example {
  background: #e3e7d5;
  border-radius: 8px;
  text-align: center;
  padding: 16px;
  font-weight: bold;
}
.example small {
  display: block;
  font-weight: normal;
  margin-top: 8px;
}
#puzzle-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
#puzzle-list button.current {
  outline: 2px solid var(--ink);
  background: #e3e7d5;
}
#puzzle-list small {
  display: block;
  min-height: 12px;
}
.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
#export-text {
  color: var(--ink);
  background: white;
  font: 12px/1.5 monospace;
  margin-bottom: 15px;
}
.skip {
  position: absolute;
  top: -60px;
  background: var(--cream);
  color: var(--ink);
  padding: 12px;
  z-index: 5;
}
.skip:focus {
  top: 0;
}
[hidden] {
  display: none !important;
}
@keyframes settle {
  from {
    transform: translateY(-3px);
  }
  to {
    transform: translateY(0);
  }
}
@media (max-width: 420px) {
  main {
    padding: 18px 16px;
  }
  .brand {
    font-size: 29px;
    letter-spacing: -1px;
  }
  .brand img {
    width: 31px;
    height: 34px;
  }
  .edition > span {
    font-size: 9px;
    letter-spacing: 1px;
  }
  .intro {
    margin: 20px 0;
  }
  h1 {
    font-size: 27px;
  }
  .bank {
    gap: 7px;
  }
  .tile {
    font-size: 11px;
  }
  .chains {
    gap: 20px;
  }
  .anchor,
  .slot {
    font-size: 12px;
  }
  .anchor small {
    display: none;
  }
  #feedback-fields {
    grid-template-columns: 1fr;
  }
  #feedback-title,
  .note-label,
  #feedback-saved {
    grid-column: auto;
  }
  .puzzle-nav button {
    padding: 10px;
  }
  dialog {
    padding: 27px 22px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
/* Keep both fixed endpoints in view on a typical phone without shrinking taps. */
@media (max-width: 550px) {
  main {
    padding-top: 12px;
  }
  .edition {
    margin-top: 12px;
    padding: 2px 0;
  }
  .intro {
    margin: 12px 0 16px;
  }
  .tile {
    min-height: 44px;
  }
  .interaction {
    margin: 10px 0 12px;
  }
  .word-cell {
    margin-bottom: 14px;
  }
  .word-cell:last-child {
    margin-bottom: 0;
  }
  .word-cell:not(:last-child):after {
    bottom: -13px;
    line-height: 12px;
    font-size: 12px;
  }
  .anchor {
    min-height: 32px;
  }
  .chain h2 {
    margin-bottom: 8px;
  }
  .actions {
    margin-top: 14px;
  }
}

/* The board is the page; secondary tools live in centered dialogs. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.header-tools {
  display: flex;
  gap: 6px;
}
.header-tools .icon {
  min-width: 40px;
  padding: 6px;
}
.edition {
  margin-top: 12px;
  padding: 0;
}
.edition button {
  min-width: 44px;
  padding: 8px;
}
.intro {
  margin: 12px 0;
}
.interaction {
  margin: 9px 0 12px;
}
.anchor {
  min-height: 48px;
  border: 2px solid #f7edcf;
  border-radius: 9px;
  background: #dbe4bd;
  color: #183e31;
  font-size: 16px;
  font-weight: 800;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 2px 0 #082c24;
}
.anchor small {
  display: block;
  font-size: 8px;
  color: #36533d;
  letter-spacing: 1px;
  font-weight: 700;
}
.word-cell {
  margin-bottom: 12px;
}
.word-cell:last-child {
  margin-bottom: 0;
}
.word-cell:not(:last-child):after {
  bottom: -12px;
  line-height: 12px;
  font-size: 12px;
}
.actions {
  margin-top: 14px;
}
#status {
  margin: 0;
  min-height: 0;
}
#completion {
  text-align: center;
}
#completion h2 {
  margin: 12px 0;
  font-size: 34px;
}
#completion-info {
  font-size: 15px;
}
.result-symbol {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 4px auto 18px;
  background: #dbe4bd;
  color: #245b47;
  font:
    36px Georgia,
    serif;
}
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 24px;
}
.menu-options {
  display: grid;
  gap: 10px;
}
#menu-dialog #progress {
  color: #36533d;
}
.feedback {
  border: 0;
  padding: 0;
}
#feedback-fields {
  grid-template-columns: 1fr;
}
#feedback-saved {
  color: #36533d;
}
#feedback-dialog select,
#feedback-dialog textarea {
  color: #183e31;
  background: #fffef8;
  border-color: #81907b;
}
#feedback-dialog textarea::placeholder {
  color: #576a58;
}
#storage-note {
  font-size: 12px;
  text-align: center;
}
@media (max-width: 420px) {
  .brand {
    font-size: 25px;
  }
  .brand img {
    width: 28px;
    height: 30px;
  }
  .header-tools {
    gap: 2px;
  }
  .anchor {
    font-size: 15px;
  }
  .anchor small {
    display: block;
  }
}
@media (max-height: 760px) {
  main {
    padding-top: 10px;
    padding-bottom: 12px;
  }
  .edition {
    margin-top: 8px;
  }
  .intro {
    margin: 8px 0;
  }
  .tile {
    min-height: 44px;
  }
  .anchor {
    min-height: 40px;
  }
  .slot {
    min-height: 44px;
  }
  .word-cell {
    margin-bottom: 8px;
  }
  .word-cell:not(:last-child):after {
    bottom: -8px;
    line-height: 8px;
    font-size: 10px;
  }
  .interaction {
    margin: 7px 0;
  }
  .actions {
    margin-top: 10px;
    padding: 10px 0;
  }
}
@media (min-width: 700px) {
  main {
    max-width: 840px;
  }
  #board {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    column-gap: 30px;
  }
  .bank-label {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
  }
  .bank {
    grid-column: 1;
    grid-row: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-self: start;
  }
  .interaction {
    grid-column: 1;
    grid-row: 3;
    align-self: start;
  }
  .chains {
    grid-column: 2;
    grid-row: 1 / 4;
  }
  .actions {
    grid-column: 1 / -1;
  }
}

/* Compact play controls and exact-link feedback. */
main {
  max-width: 560px;
  padding: 12px 16px;
}
.edition {
  margin-top: 6px;
}
.intro {
  margin: 8px 0;
}
.anchor {
  min-height: 36px;
  flex-direction: row;
  font-size: 15px;
}
.word-cell {
  margin-bottom: 24px;
}
.word-cell:not(:last-child):after {
  content: none;
}
.word-cell > .link-marker {
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
}
.link-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  min-width: 60px;
  text-align: center;
  font-size: 14px;
  line-height: 24px;
  color: #aec4b6;
}
.link-marker.wrong {
  color: #ffc4af;
  font-size: 11px;
  font-weight: 700;
  line-height: 14px;
}
.link-marker.wrong::before,
.link-marker.wrong::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 2px;
  height: 4px;
  background: #ffb198;
}
.link-marker.wrong::before {
  top: 0;
}
.link-marker.wrong::after {
  bottom: 0;
}
.tile.used {
  display: none;
}
.bank {
  gap: 6px;
}
.tile {
  min-height: 44px;
}
.actions {
  gap: 8px;
  margin-top: 10px;
  padding: 10px 0 0;
}
.actions .quiet {
  background: #285749;
  border: 1px solid #8aa68e;
  border-bottom: 3px solid #082e25;
  border-radius: 9px;
  min-height: 46px;
  padding: 10px 16px;
  color: #fff4da;
  font-weight: 600;
}
.actions .quiet:disabled {
  background: #1a463a;
  opacity: 0.55;
}
.toast {
  position: fixed;
  left: 50%;
  top: 72px;
  transform: translateX(-50%) translateY(-5px);
  z-index: 5;
  padding: 10px 18px;
  border-radius: 20px;
  border: 1px solid #f3b298;
  background: #fff3de;
  color: #4b241b;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.3s,
    transform 0.3s;
  box-shadow: 0 4px 20px #001d1955;
}
.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.menu-options a {
  border: 1px solid #a0ad98;
  border-radius: 10px;
  padding: 13px;
  text-align: center;
  text-decoration: none;
  font-size: 14px;
}
#chains.linked-board {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.dual-anchors,
.dual-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
}
.dual-links .link-marker {
  position: relative;
}
.dual-links {
  height: 24px;
  justify-items: center;
}
.linked-row {
  position: relative;
}
.paired-tile {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  background: var(--cream);
  color: var(--ink);
  border: 1px solid #e1d9bc;
  border-bottom: 3px solid #b7b59b;
  box-shadow: 0 2px 0 #082e25;
  min-height: 50px;
  padding: 10px 4px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.paired-tile.selected {
  background: var(--peach);
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}
.paired-tile:disabled,
.flip-tile:disabled {
  opacity: 1;
}
.flip-tile {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 44px;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-left: 1px solid #bdc4ab;
  border-right: 1px solid #bdc4ab;
  border-radius: 0;
  background: #e4e5ce;
  color: #2b5241;
  font-size: 25px;
}
.linked-mode main {
  max-width: 540px;
}
.linked-mode #board {
  display: block;
}
.linked-mode .interaction {
  margin: 8px 0 12px;
}
@media (min-width: 700px) {
  body:not(.linked-mode) main {
    max-width: 740px;
  }
  body:not(.linked-mode) #board {
    grid-template-columns: 180px minmax(0, 1fr);
    column-gap: 20px;
  }
  body:not(.linked-mode) #board:has(#bank[hidden]) {
    display: block;
    max-width: 480px;
    margin: auto;
  }
}
@media (max-height: 760px) {
  main {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .anchor {
    min-height: 32px;
  }
  .linked-mode .interaction {
    margin: 6px 0;
  }
  .linked-mode .intro {
    margin: 4px 0;
  }
  .linked-mode .edition {
    margin-top: 2px;
  }
}
@media (max-width: 360px) {
  .paired-tile {
    font-size: 12px;
  }
  .actions .quiet {
    padding: 10px 12px;
  }
}

/* Unified tactile controls: flat faces, complete borders, consistent tap targets. */
button {
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
}
button:not(:disabled):active {
  filter: brightness(0.92);
}
.header-tools .icon {
  background: #285749;
  border: 1px solid #779b87;
  border-radius: 12px;
  min-width: 44px;
}
.edition {
  border: 0;
  gap: 8px;
  margin: 12px 0 8px;
}
.edition button {
  border: 1px solid #779b87;
  border-radius: 10px;
  background: #285749;
  font-size: 13px;
  font-weight: 600;
}
.edition #picker {
  flex: 1;
}
.edition button:disabled {
  opacity: 0.4;
}
.linked-mode .interaction {
  margin: 8px 0 12px;
  min-height: 18px;
}
.anchor {
  border: 1px solid #dbe4bd;
  border-radius: 6px;
  box-shadow: none;
}
.paired-tile {
  min-height: 52px;
  border: 1px solid #eee0be;
  border-bottom: 1px solid #eee0be;
  box-shadow: 0 2px 0 #082e25;
  border-radius: 12px;
  gap: 54px;
  padding: 12px 4px;
}
.flip-tile {
  width: 44px;
  min-height: 44px;
  border: 1px solid #96aa90;
  border-radius: 10px;
  background: #dbe4bd;
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
}
.paired-tile.selected {
  outline: 3px solid #ffcc9f;
  outline-offset: 2px;
  background: #f4b58b;
}
.actions {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1.3fr;
  gap: 10px;
  padding: 12px 0 4px;
  margin-top: 12px;
  border-top: 0;
}
.actions .quiet,
.actions .primary {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 10px 6px;
  border: 1px solid #95b09b;
  border-radius: 12px;
  box-shadow: none;
  font-size: 14px;
  font-weight: 700;
}
.actions .quiet {
  background: #315f50;
  color: #fff4da;
}
.actions .quiet:disabled {
  opacity: 1;
  color: #94b0a1;
  background: #1b483b;
  border-color: #507568;
}
.actions .primary {
  border-color: #fff4da;
}
#hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
#hint-count {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: #dbe4bd;
  color: #173e32;
  min-width: 20px;
  height: 20px;
  font-size: 11px;
}
[hidden],
#hint-count[hidden] {
  display: none !important;
}
dialog {
  padding: 28px 24px 24px;
  border: 1px solid #e4d8bb;
  border-radius: 20px;
  box-shadow: 0 16px 60px #001c1966;
}
dialog h2 {
  text-align: center;
  margin: 12px 28px 18px;
}
dialog .close {
  width: 44px;
  height: 44px;
  border: 1px solid #c2c9b4;
  border-radius: 12px;
  background: #e7ebd9;
  font-size: 23px;
}
dialog button,
.menu-options a {
  min-height: 48px;
  background: #e7ebd9;
  border: 1px solid #a8b79a;
  font-weight: 600;
}
dialog .primary {
  border-color: #173e32;
  background: #173e32;
  color: #fff4da;
}
#hint-dialog {
  text-align: center;
}
#hint-dialog > button,
#help-dialog > .primary {
  width: 100%;
  margin-top: 20px;
}
#hint-position {
  margin: 0 0 18px;
  color: #4e6657;
  font-size: 14px;
}
.hint-sides,
.hint-tile {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.hint-sides {
  color: #4e6657;
  font-size: 12px;
  margin-bottom: 6px;
}
.hint-tile {
  background: #dbe4bd;
  border: 1px solid #acb99d;
  border-radius: 12px;
  padding: 18px 4px;
  font-size: 15px;
}
.hint-tile strong + strong {
  border-left: 1px solid #acb99d;
}
#completion-info {
  text-align: center;
}
.toast {
  top: 64px;
  bottom: auto;
  max-width: calc(100vw - 28px);
  border-radius: 12px;
  font-size: 13px;
}
@media (max-width: 360px) {
  main {
    padding-left: 12px;
    padding-right: 12px;
  }
  .header-tools {
    gap: 4px;
  }
  .brand {
    font-size: 23px;
  }
  .paired-tile {
    font-size: 12px;
  }
}
/* Short phone viewports keep endpoints above the action bar. */
@media (max-height: 660px) {
  .linked-mode .paired-tile {
    min-height: 48px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .linked-mode .dual-links,
  .linked-mode .link-marker {
    height: 20px;
    line-height: 20px;
  }
  .linked-mode .link-marker.wrong {
    line-height: 14px;
  }
  .linked-mode .anchor {
    min-height: 30px;
  }
  .linked-mode .actions {
    margin-top: 8px;
    padding-top: 8px;
  }
  .linked-mode .interaction {
    margin: 6px 0 8px;
  }
}
#comparison-nav {
  display: flex;
  flex: 1;
  gap: 4px;
}
#comparison-nav button {
  flex: 1;
  padding: 8px 4px;
  font-size: 12px;
}
#comparison-nav button[aria-pressed="true"] {
  background: #fff4da;
  color: #173e32;
  border-color: #fff4da;
}
.loop-return .anchor {
  background: transparent;
  border: 1px dashed #a1bca5;
  color: #dbe4bd;
  font-size: 13px;
}

.dual-anchors:not(.loop-return) .anchor { background: transparent; color: #dbe4bd; border: 0; border-bottom: 1px solid #9eb5a1; border-radius: 0; }
.linked-row .flip-tile { width: 52px; height: 44px; background: transparent; border: 0; color: #48624e; }
.linked-row .flip-tile::before { content: ""; position: absolute; inset: 6px 5px; border: 1px solid #a8b99f; border-radius: 8px; pointer-events: none; }

[data-daily] .edition {display:flex; justify-content:center}
[data-daily] .edition button, [data-daily] #menu, [data-daily] .intro {display:none}
[data-daily] .edition > span {display:block; font-weight:600}

[data-daily] .dual-links {
  height: 20px;
  align-items: center;
}
[data-daily] .dual-links .link-marker:not(.wrong) {
  color: #d3e3ce;
  line-height: 20px;
  height: 20px;
}
[data-daily] .paired-tile.selected {
  outline: 3px solid #ffcb95;
  outline-offset: 1px;
  box-shadow: inset 0 0 0 2px var(--ink);
}
#daily-guide {
  text-align: center;
  max-width: min(25rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
}
#daily-guide h2 { margin: 0 0 .5rem; }
#daily-guide h2:focus { outline: none; }
#daily-guide p { margin: .65rem 0; }
#daily-guide .primary { width: 100%; margin-top: .5rem; }
.guide-example {
  background: var(--ink);
  color: #e4edcf;
  border-radius: 12px;
  padding: .85rem .6rem;
  margin: 1rem 0 .5rem;
  font-weight: 700;
}
.guide-example .dual-anchors, .guide-example .dual-links { gap: 54px; }
.guide-example .paired-tile { align-items: center; }
#daily-guide #guide-flip { margin: 0; padding: 0; min-width: 44px; }
#daily-guide #guide-status { font-weight: 600; min-height: 1.5em; }

[data-daily] .dual-links .link-marker.wrong {
  align-self: center;
  min-width: 0;
  height: 17px;
  padding: 0 7px;
  border-radius: 5px;
  background: #ffcfb0;
  color: #4b261a;
  font-size: 12px;
  line-height: 17px;
}
[data-daily] .dual-links .wrong::before,
[data-daily] .dual-links .wrong::after { content: none; }

[data-daily].at-home main { max-width: 29rem; padding-top: clamp(1.5rem, 7svh, 4rem); }
.at-home header { justify-content: center; }
.at-home .header-tools { display: none; }
.at-home .brand { font-size: clamp(36px, 9vw, 50px); }
.at-home .brand img { width: .95em; height: 1.08em; }
[data-daily] .edition > span { font-size: .875rem; letter-spacing: .045em; }
#daily-home { text-align: center; }
#daily-home h1 { margin: 1.1rem 0 .4rem; font: 400 clamp(27px, 6vw, 36px)/1.15 Georgia, serif; }
#daily-home > p { max-width: 21rem; margin: .5rem auto; color: var(--muted); line-height: 1.4; }
#home-example { max-width: 21rem; margin: 1rem auto; }
#home-example .guide-example { border: 1px solid var(--line); padding: .9rem; }
#home-example #guide-status { color: var(--muted); margin: .6rem 0; font-size: .875rem; }
#home-play { width: min(100%, 21rem); font-weight: 700; }
[data-daily] #interaction:focus { outline: none; }
[data-daily] #completion .result-symbol, .admiring #undo, .admiring #hint { display: none; }
[data-daily] #completion h2 { margin: .25rem 0 .65rem; }
[data-daily] #result-close { width: 100%; background: var(--ink); color: var(--cream); }
[data-daily] #next-edition { margin: .8rem 0 0; font-size: .875rem; }
.admiring .actions { display: flex; justify-content: center; }
.admiring #check { background: transparent; border: 1px solid var(--line); color: var(--cream); }
.admiring #chains.linked-board { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.admiring #chains ol { margin: 0; padding: 0; list-style: none; text-align: center; }
.admiring #chains li {
  display: grid; align-content: center; gap: 2px;
  margin-bottom: 5px; padding: clamp(4px, 1svh, 8px) 2px;
  border-radius: 8px; background: var(--cream); color: var(--ink);
}
.admiring #chains li small { font: 600 .75rem/1.2 Arial, sans-serif; color: #476356; }
.admiring #chains li span { font: 600 1.125rem/1.2 Georgia, serif; }
[data-daily] main:has(#loading:not([hidden])) {
  min-height: 100svh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
[data-daily] main:has(#loading:not([hidden])) :is(.header-tools, .edition) { display: none; }
[data-daily] #loading { margin: .75rem auto 0; text-align: center; }
[data-daily] .guide-example #guide-flip {
  width: 64px; min-height: 44px; margin: 0; padding: 0;
  background: #215548; color: white; border: 2px solid var(--ink);
  border-radius: 9px; font-size: .95rem; font-weight: 700;
}
[data-daily] .guide-example #guide-flip::before { content: none; }

[data-daily] header { flex-wrap: wrap; }
[data-daily] #help { width: auto; border-radius: 10px; font-size: .9rem; }
/* Match each connector lane to the tile's border and inline padding. */
[data-daily] { --column-gap: 3.5rem; --tile-inset: 5px; --word-font: Arial, Helvetica, sans-serif; }
[data-daily] .guide-example { --column-gap: 4rem; }
[data-daily] :is(.dual-anchors, .dual-links, .paired-tile) {
  grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--column-gap);
  align-items: center; text-align: center;
}
[data-daily] :is(.dual-anchors, .dual-links) { padding-inline: var(--tile-inset); }
[data-daily] .paired-tile { padding-inline: calc(var(--tile-inset) - 1px); }
[data-daily] :is(.paired-tile span, .dual-anchors > *) {
  font: 700 1rem/1.2 var(--word-font); letter-spacing: .025em;
}
[data-daily] .dual-anchors .anchor {
  min-height: 44px; border: 0; padding: 0; box-shadow: none;
}
[data-daily] #chains .linked-row { min-height: 44px; }
[data-daily] #chains .paired-tile { min-height: 44px; padding-block: .5rem; }
[data-daily] .guide-example .dual-links { font: 400 .875rem/1.25 var(--word-font); }
[data-daily] :is(#home-example, #daily-guide) #guide-status {
  margin: .65rem 0 0; padding-top: .55rem; border-top: 1px solid var(--line);
  min-height: 0; color: var(--muted); font: 400 .875rem/1.35 var(--word-font);
}
[data-daily] :is(.guide-example #guide-flip, #chains .flip-tile) {
  font: 600 .875rem/1.2 var(--word-font);
}
[data-daily] .admiring #chains li span { font-family: var(--word-font); }
[data-daily] :is(.paired-tile span, .anchor, .guide-example span, .admiring li) {
  min-width: 0; overflow-wrap: anywhere; white-space: normal;
}
[data-daily] .guide-example .dual-links { height: auto; min-height: 24px; }
[data-daily] .toast { white-space: normal; max-width: 92vw; }
[data-daily] .result-actions { flex-wrap: wrap; }

[data-daily] #interaction {
  max-width: 32rem; min-height: 2.7em; margin: .5rem auto;
  font: 400 .9375rem/1.35 var(--word-font); color: var(--muted); text-wrap: pretty;
}
[data-daily] #chains .dual-links {
  min-height: 1.55rem; height: auto; align-items: center;
}
[data-daily] #chains .link-marker:not(.wrong) {
  min-width: 0; max-width: 100%; height: auto; line-height: 1.25;
  overflow-wrap: anywhere; font-size: .875rem;
}
[data-daily] #chains .wrong {
  display: grid; place-items: center; inline-size: 1.25rem; block-size: 1.25rem;
  min-width: 0; padding: 0; font: 700 1rem/1 var(--word-font);
}

[data-daily] #completion {
  width: min(22rem, calc(100vw - 2rem)); padding: 1.5rem;
  border: 1px solid #d4c59c; background: #fff8e6; color: #183f34;
}
#result-edition {
  display: flex; align-items: center; justify-content: center; gap: .35rem;
  font: 600 .875rem/1.3 Arial, sans-serif;
}
#result-edition img { filter: brightness(0) saturate(100%) opacity(.74); }
#result-date { margin-left: .25rem; padding-left: .6rem; border-left: 1px solid #b7bfac; font-weight: 400; }
[data-daily] #completion h2 { font: 400 2.5rem/1.05 Georgia, serif; margin: 1.1rem 0 .45rem; }
[data-daily] #completion-info { margin: 0; color: #355648; font: 400 1rem/1.4 Arial, sans-serif; }
#result-chain { display: grid; justify-content: center; gap: .2rem; margin: 1rem 0 1.25rem; color: #48806a; font: 600 .8rem/1 monospace; }
[data-daily] #completion .result-actions { display: grid; grid-template-columns: 1fr; gap: .4rem; }
[data-daily] #result-share { background: #184c3e; color: #fff8e6; }
[data-daily] #completion #result-close { background: transparent; color: #244b3e; border-color: #b5c0ac; }
#share-status:empty { display: none; }
#share-copy { width: 100%; font-size: 1rem; }

#solved-ad { margin: 2.5rem auto 1rem; text-align: center; }
#solved-ad small { display: block; margin-bottom: .5rem; color: var(--muted); }
#solved-ad ins { display: block; }
#solved-ad:has(ins[data-ad-status="unfilled"]) { display: none; }
[data-daily] #completion::backdrop { background: rgba(6, 37, 30, .88); backdrop-filter: blur(6px); }
.daily-footer {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  padding: 0 1rem 1rem;
  color: var(--muted);
  font-size: .875rem;
}
.daily-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-underline-offset: .2em;
}
[data-daily] #chains .paired-tile:enabled { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
[data-daily] #chains .paired-tile.dragging { position: relative; z-index: 4; cursor: grabbing; opacity: .85; box-shadow: 0 5px 14px #203f3436; }
[data-daily] #chains .drop-target .paired-tile { outline: 3px dashed #32694d; outline-offset: -3px; }
[data-daily] .more-games{font:600 .85rem/1.25 system-ui,sans-serif;color:inherit;text-decoration:underline;text-underline-offset:.2em;white-space:nowrap}
[data-daily] #check-budget{margin:.3rem auto;text-align:center;font-size:.88rem;color:var(--muted)}
[data-daily] #check-budget:empty{display:none}
.game-choices{display:grid;gap:.85rem;margin:1rem auto;text-align:left}
.game-choice{display:grid;grid-template-columns:minmax(0, .85fr) minmax(0, 1.65fr);align-items:center;gap:1.1rem;background:var(--cream);color:#233e32;border-radius:14px;padding:1.2rem}
.game-start h2{font:400 clamp(1.55rem,3vw,2rem)/1.15 Georgia,serif;margin:0 0 .65rem}
.game-lesson{display:grid;grid-template-columns:6.5rem 1fr;align-items:center;gap:1rem;border-left:1px solid #c7cbb9;padding-left:1.15rem}
.game-lesson p{font-size:.96rem;line-height:1.45;margin:0}
.chain-sample,.middle-sample{font:600 .82rem/1.25 system-ui,sans-serif;display:grid;text-align:center;gap:.18rem;color:#416453}
.chain-sample{grid-template-columns:1fr 1fr}
.chain-sample b,.middle-sample b{background:#dce7d5;border-radius:.3rem;padding:.22rem .12rem;color:#203e30}
.middle-sample{grid-template-columns:1fr;justify-self:center;width:4.5rem}
.game-choice :is(#home-play,.game-action),[data-daily] #completion .other-game{display:inline-flex;align-items:center;justify-content:center;width:auto;min-height:44px;padding:.5rem 1.2rem;background:#244d3f;border:0;border-radius:.55rem;color:white;text-decoration:none;font:600 .95rem/1.25 system-ui,sans-serif}
.game-choice #home-play[hidden]{display:none}
.chain-example summary{cursor:pointer;text-underline-offset:.2em;text-decoration:underline;padding:.5rem}

[data-daily] #completion.out-of-checks #result-close{background:#244d3f;color:white}
[data-daily] #completion.out-of-checks .other-game{background:transparent;color:#244d3f;text-decoration:underline}
[data-daily].at-home main{max-width:49rem;padding-top:clamp(.9rem,3svh,2rem)}
[data-daily].at-home #daily-home h1{font-size:clamp(1.25rem,2.4vw,1.65rem);margin:.8rem auto}
@media(max-width:37rem){
 .game-choice{grid-template-columns:1fr;gap:.75rem;padding:.95rem}
 .game-start{display:flex;justify-content:space-between;align-items:center;gap:.55rem;flex-wrap:wrap}
 .game-start h2{margin:0}
 .game-lesson{border:0;border-top:1px solid #c7cbb9;padding:.65rem 0 0;grid-template-columns:6rem 1fr;gap:.75rem}
 .game-choice :is(#home-play,.game-action){padding:.5rem .8rem}
}

.chain-sample .sample-row{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;background:#dce7d5;border:1px solid #aebfa9;border-radius:.35rem}
.chain-sample .sample-row b{padding:.22rem 0;background:transparent}
.blank-word{display:grid;grid-template-columns:repeat(5,1fr);gap:2px;margin:.2rem 0}
.blank-word i{aspect-ratio:.83;border:1px solid #73917c;border-radius:2px;background:#fffdf6}
.game-lesson small{display:block;margin-top:.45rem;font:600 .78rem/1.4 system-ui,sans-serif;color:#4b6255}

@media(min-width:42rem){
  [data-daily].at-home main{max-width:54rem}
  .game-choice{grid-template-columns:minmax(11rem,.8fr) minmax(0,1.65fr);padding:.75rem 1.6rem}
  .game-lesson{grid-template-columns:7.25rem 1fr;padding-left:1.5rem;gap:1.3rem}
  .game-choice:nth-child(2){grid-template-columns:minmax(0,1.65fr) minmax(11rem,.8fr)}
  .game-choice:nth-child(2) .game-start{grid-area:1/2;text-align:center}
  .game-choice:nth-child(2) .game-lesson{grid-area:1/1;border-left:0;border-right:1px solid #c7cbb9;padding:0 1.5rem 0 0}
  .chain-sample,.middle-sample{font-size:.95rem}
  .game-lesson p{max-width:35ch;font-size:1rem}
  [data-daily]:not(.at-home) main{max-width:39rem}
}
.blank-word i{display:grid;place-items:center;font:700 .66rem/1 system-ui,sans-serif;color:#244d3f}
.game-choice .game-action{box-shadow:none}
@media(prefers-reduced-motion:no-preference){
  .at-home .sample-row b:first-child{animation:demo-swap-left 1.8s ease both}
  .at-home .sample-row b:last-child{animation:demo-swap-right 1.8s ease both}
  .at-home .blank-word i{animation:demo-letter .28s ease backwards;animation-delay:1.8s}
  .at-home .blank-word i:nth-child(2){animation-delay:2s}
  .at-home .blank-word i:nth-child(3){animation-delay:2.2s}
  .at-home .blank-word i:nth-child(4){animation-delay:2.4s}
  .at-home .blank-word i:nth-child(5){animation-delay:2.6s}
}
@keyframes demo-swap-left{0%,45%{transform:translateX(100%)}70%{transform:translate(50%,-.4rem)}100%{transform:none}}
@keyframes demo-swap-right{0%,45%{transform:translateX(-100%)}70%{transform:translate(-50%,.4rem)}100%{transform:none}}
@keyframes demo-letter{from{color:transparent}to{color:#244d3f}}

/* The miniature uses the same paired rows and fixed endpoints as the daily board. */
.lesson-card{margin:1rem auto;text-align:left;grid-template-columns:minmax(0,1fr) minmax(0,.9fr);gap:2rem;padding:clamp(1rem,3vw,2rem)}
.lesson-copy h2{font:400 1.75rem/1.15 Georgia,serif;margin:0 0 .6rem}
.lesson-copy p,.lesson-steps{font:inherit;line-height:1.45;margin:0}
.lesson-steps{padding-left:1.4rem;margin:.85rem 0 1rem}
.lesson-steps li+li{margin-top:.35rem}
#chain-lesson{text-align:center;background:#eceddf;border-radius:.7rem;padding:.9rem;color:#244d3f}
.lesson-board{max-width:16rem;margin:auto;text-transform:uppercase}
.lesson-ends,.lesson-tile{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:center;text-align:center}
.lesson-ends{font-size:.88rem;padding:.4rem 0}
.lesson-tiles{display:grid;gap:.3rem}
.lesson-tile{padding:.45rem 0;background:#fffaf0;border:1px solid #aabaaa;border-radius:.45rem;box-shadow:0 1px 2px #244d3f1a}
#chain-lesson[data-step="0"] .lesson-tile:first-child{transform:translateY(calc(100% + .3rem))}
#chain-lesson[data-step="0"] .lesson-tile:last-child{transform:translateY(calc(-100% - .3rem))}
#chain-lesson:is([data-step="0"],[data-step="1"]) .lesson-tile:first-child b:first-child{transform:translateX(100%)}
#chain-lesson:is([data-step="0"],[data-step="1"]) .lesson-tile:first-child b:last-child{transform:translateX(-100%)}
.lesson-caption{font-size:.94rem;line-height:1.4;min-height:2.8em;margin:.6rem auto 0}
.lesson-control{background:transparent;color:#244d3f;border:0;text-decoration:underline;text-underline-offset:.2em;min-height:44px;padding:.4rem .7rem}
@media(prefers-reduced-motion:no-preference){.lesson-tile,.lesson-tile b{transition:transform .65s ease}}
@media(max-width:37rem){.lesson-card{grid-template-columns:1fr;gap:1rem}.lesson-caption{min-height:2.8em}}
.daily-games{color:inherit;display:inline-flex;align-items:center;min-height:44px;font:600 .9rem/1.2 system-ui,sans-serif;text-underline-offset:.2em}.at-home header:has(.daily-games){flex-wrap:wrap;column-gap:1rem}
