:is(.beginner-sudoku-guide, .word-search-guide) {
  --worked-guide-paper: url("/assets/riddle-desk-paper.webp") center top / 670px auto;
  --worked-guide-cream: #f8efdd;
}
.worked-guide-hero {
  background: var(--worked-guide-paper), var(--worked-guide-cream);
  background-blend-mode: luminosity;
}
.worked-guide-hero { border-bottom: 1px solid #d8c7a7; }
.worked-guide-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .88fr);
  align-items: center;
  gap: clamp(18px, 6vw, 88px);
  padding-block: clamp(22px, 5vw, 56px);
}
.worked-guide-back { display: inline-block; margin-bottom: 10px; color: #304c37; }
.worked-guide-intro h1 {
  margin: 0;
  font: 700 clamp(2.65rem, 6.1vw, 5.7rem)/.99 var(--font-editorial);
  color: #132733;
  letter-spacing: -.05em;
}
.worked-guide-intro h1::after {
  display: block;
  width: min(58%, 290px);
  height: 10px;
  margin: 10px 0 6px;
  content: "";
  border-top: 4px solid var(--brand-action);
  border-radius: 50%;
  transform: rotate(-3deg);
}
.worked-guide-intro p { max-width: 34ch; margin: 0 0 15px; font-size: clamp(1rem, 1.8vw, 1.25rem); }
.worked-guide-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.worked-guide-actions .btn { min-height: 44px; }
.worked-guide-art {
  display: block;
  width: min(75%, 380px);
  height: auto;
  margin: 26px 0 0 7%;
  transform: rotate(-6deg);
}
.beginner-exercise {
  width: min(100%, 486px);
  justify-self: center;
  color: #132733;
  padding: clamp(10px, 2.2vw, 22px);
  border: 1px solid #c9b797;
  border-radius: 13px 24px 11px 20px;
  background: var(--worked-guide-paper), #fdf4e2;
  background-blend-mode: luminosity;
  box-shadow: 4px 6px #ccb58a7d;
}
.beginner-exercise h2 { margin: 0 0 7px; font: 700 clamp(1.4rem, 2.75vw, 2.1rem)/1.02 var(--font-editorial); }
.beginner-exercise .sudoku-lesson-figure {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.beginner-exercise .sudoku-lesson-grid td.sudoku-lesson-cell { height: clamp(25px, 7.4vw, 44px); }
.beginner-exercise .sudoku-lesson-grid td.is-exercise {
  color: #8b2e19;
  background: #f6df99;
}
.beginner-exercise td.is-exercise span {
  display: inline-grid;
  place-items: center;
  width: 1.62em;
  height: 1.62em;
  border: 2px solid currentColor;
  border-radius: 50%;
  line-height: 1;
}
.beginner-exercise.is-solved .sudoku-lesson-grid td.is-exercise {
  color: #2b5736;
  background: #dcebd0;
}
.beginner-exercise.is-solved td.is-exercise span { animation: beginner-number-in .2s ease-out both; }
@keyframes beginner-number-in {
  from { transform: scale(.76); }
  to { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .beginner-exercise.is-solved td.is-exercise span { animation: none; }
}
.beginner-options:not([hidden]) { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 9px; }
.beginner-options button {
  min-height: 44px;
  border: 1px solid #50624b;
  border-radius: 7px 12px 8px 10px;
  color: #233b28;
  background: #fffaf0;
  font: 700 1.14rem var(--font-ui);
}
.beginner-options button[aria-pressed="true"] { color: #772d20; border-color: #a85035; background: #f6dfcc; }
.beginner-exercise.is-solved .beginner-options button[aria-pressed="true"] { color: #fff; background: #37593d; }
.beginner-result { min-height: 1.4em; margin: 6px 0 0; font-size: .88rem; font-weight: 650; }
@media (max-width: 700px) {
  .worked-guide-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .worked-guide-intro { position: relative; }
  .worked-guide-actions .btn { padding-inline: 12px; }
  .worked-guide-intro h1 { max-width: 15ch; font-size: clamp(2.3rem, 9.7vw, 3.4rem); }
  .worked-guide-intro p { max-width: 30ch; }
  .worked-guide-art { position: absolute; top: -7px; right: 0; width: 25%; max-width: 100px; margin: 0; pointer-events: none; }
  .beginner-exercise .sudoku-lesson-grid thead th { height: 17px; }
}

.word-lesson {
  width: min(100%, 486px);
  justify-self: center;
  padding: clamp(10px, 2.2vw, 22px);
  border: 1px solid #c9b797;
  border-radius: 15px 8px 22px 11px;
  background: var(--worked-guide-paper), #fdf4e2;
  background-blend-mode: luminosity;
  box-shadow: 4px 6px #ccb58a7d;
  color: #132733;
}
.word-lesson h2 { margin: 0 0 10px; font: 700 clamp(1.4rem, 2.75vw, 2.1rem)/1.02 var(--font-editorial); }
.word-lesson h2 span { color: #7b321e; letter-spacing: .065em; }
.word-lesson-grid {
  width: 100%;
  table-layout: fixed;
  border-spacing: 0;
  border: 1px solid #a6916e;
  background: #fffaf0;
}
.word-lesson-grid td { padding: 0; border: 1px solid #dbcfb5; }
.word-lesson-grid button {
  display: block;
  width: 100%;
  height: clamp(36px, 10vw, 56px);
  border: 0;
  background: transparent;
  color: #172934;
  font: 750 clamp(1rem, 4.2vw, 1.5rem) var(--font-ui);
}
.word-lesson-grid button:focus-visible { position: relative; outline-offset: -3px; }
.word-lesson-grid button.is-first-letter { border-radius: 50%; box-shadow: inset 0 0 0 2px #9b4731; background: #f5e0ab; }
.word-lesson-grid button.is-found-letter {
  color: #28472b;
  background: #d9eacb;
  animation: found-letter-ink .23s var(--letter-delay, 0ms) both;
}
@keyframes found-letter-ink {
  from { background-color: #fce5ae; }
  to { background-color: #d9eacb; }
}
@media (prefers-reduced-motion: reduce) {
  .word-lesson-grid button.is-found-letter { animation: none; }
}
.word-lesson [role="status"] { min-height: 2.6em; margin: 8px 0 2px; font-size: .92rem; font-weight: 650; }
.word-lesson [data-next-word] { min-height: 44px; }
.word-lesson [data-next-word][hidden],
.guide-exercise-play[hidden] { display: none; }
.worked-guide-hero .guide-exercise-play { min-height: 44px; margin: 8px 0 0; }
.word-lesson-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.word-lesson .word-lesson-actions .btn { margin: 4px 0 0; }
.triple-row { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 12px 0; }
.triple-row td { height: 38px; padding: 0; border: 1px solid #b8aa8d; background: #fffaf0; text-align: center; font-weight: 700; }
.triple-row td:nth-child(3n):not(:last-child) { border-inline-end: 2px solid #7b755b; }
.triple-row [data-triple-target] { color: #28472b; background: #d9e8cd; }
.triple-exercise .beginner-options button { padding-inline: 3px; font-size: clamp(.9rem, 2vw, 1.12rem); }
.triple-exercise .beginner-options small { display: block; font-size: .66em; font-weight: 600; }
.triple-exercise .beginner-options button[aria-pressed="true"]:disabled { color: #fff; background: #37593d; }
.triple-step:not([hidden]) { display: flex; gap: 8px; margin-top: 10px; }
.triple-step .btn { min-width: 44px; min-height: 44px; }
.triple-step .btn:disabled { text-decoration: line-through; opacity: .64; }
.triple-exercise.is-solved [data-triple-target] { animation: beginner-number-in .2s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .triple-exercise.is-solved [data-triple-target] { animation: none; }
}
.word-search-guide .word-lesson-art { width: min(60%, 235px); margin: 12px 0 0 6%; transform: rotate(-4deg); }
@media (max-width: 700px) {
  .word-search-guide .word-lesson-art { top: -15px; right: 1%; width: 24%; max-width: 84px; margin: 0; }
}
@media (min-width: 701px) {
  .word-search-guide .worked-guide-intro h1 { font-size: clamp(2.65rem, 5.15vw, 4.8rem); }
}

#beginner-second-move + .beginner-options:not([hidden]) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
#beginner-exercise { scroll-margin-top: calc(var(--header-h) + 12px); }
.beginner-sudoku-guide .beginner-result:not(:empty) {
  padding: 6px 9px;
  border-radius: 6px;
  background: #f4e5c8;
}
.beginner-sudoku-guide .beginner-exercise.is-solved .beginner-result { background: #e5edd5; }
@media (max-width: 700px) {
  .beginner-sudoku-guide .worked-guide-layout { padding-block: 16px; gap: 10px; }
  .beginner-sudoku-guide .worked-guide-back { margin-bottom: 7px; }
  .beginner-sudoku-guide .worked-guide-intro h1 { font-size: clamp(1.9rem, 9vw, 3.3rem); }
  .beginner-sudoku-guide .worked-guide-intro h1::after { margin-block: 7px 3px; }
  .beginner-sudoku-guide .worked-guide-intro p { max-width: none; margin-bottom: 10px; }
  .beginner-sudoku-guide .worked-guide-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  }
  .beginner-sudoku-guide .worked-guide-actions .btn {
    padding-inline: 6px;
    font-size: clamp(.75rem, 3.5vw, .94rem);
    text-align: center;
    white-space: normal;
  }
  .beginner-sudoku-guide .beginner-exercise-actions .btn {
    flex: 1 1 130px;
    padding-inline: 6px;
    font-size: clamp(.75rem, 3.5vw, .94rem);
    text-align: center;
  }
}
@media (max-width: 360px) {
  .beginner-sudoku-guide .beginner-exercise .sudoku-lesson-grid td.sudoku-lesson-cell { height: 22px; }
}
.beginner-exercise-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.beginner-exercise-actions .btn { min-height: 44px; margin: 0; white-space: normal; }
.beginner-exercise-actions .btn[hidden] { display: none; }

.kids-word-search-guide .worked-guide-layout {
  grid-template-areas: "intro lesson" "actions lesson" "art lesson";
  gap: 15px clamp(20px, 5vw, 68px);
  align-items: start;
}
.kids-word-search-guide .worked-guide-intro { grid-area: intro; }
.kids-word-search-guide .worked-guide-actions { grid-area: actions; }
.kids-word-search-guide .word-lesson {
  grid-area: lesson;
  width: min(100%, 520px);
  align-self: center;
}
.kids-word-search-guide .word-lesson-art {
  grid-area: art;
  width: min(100%, 345px);
  margin: 0;
  transform: none;
  pointer-events: none;
}
.kids-word-search-guide .word-lesson-grid button {
  height: auto;
  min-height: 44px;
  aspect-ratio: 1;
  font-size: clamp(1.22rem, 3.65vw, 2.15rem);
}
.kids-word-search-guide .word-lesson [role="status"] { min-height: 1.6em; }
.kids-word-search-guide .word-lesson-actions .btn { white-space: normal; }
@media (min-width: 950px) {
  .kids-word-search-guide .worked-guide-intro h1 { max-width: 11ch; }
}
@media (min-width: 701px) and (max-width: 949px) {
  .kids-word-search-guide .worked-guide-layout {
    grid-template-areas: "intro art" "actions actions" "lesson lesson";
    grid-template-columns: minmax(0, 1fr) minmax(158px, .38fr);
    padding-block: 24px;
    gap: 14px 20px;
  }
  .kids-word-search-guide .word-lesson-art { align-self: center; }
}
@media (max-width: 700px) {
  .kids-word-search-guide .worked-guide-layout {
    grid-template-areas: "intro art" "lesson lesson" "actions actions";
    grid-template-columns: minmax(0, 1fr) minmax(74px, .32fr);
    gap: 12px 5px;
  }
  .kids-word-search-guide .worked-guide-intro h1 { font-size: clamp(1.98rem, 8vw, 3.3rem); }
  .kids-word-search-guide .worked-guide-intro p { margin: 0; }
  .kids-word-search-guide .word-lesson-art {
    position: static;
    width: 100%;
    max-width: 155px;
    align-self: center;
  }
  .kids-word-search-guide .worked-guide-actions { display: grid; }
}
