/* Reading layout uses the established Word Crypt fonts and colour tokens. */
.guide-page { --guide-nav-offset: 140px; }
.guide-page section[id] { scroll-margin-top: var(--guide-nav-offset); }
.guide-skip { position: fixed; top: -120px; left: 16px; z-index: 20; padding: 12px 18px; background: var(--panel); border: 3px solid var(--cyan); }
.guide-skip:focus { top: 12px; }
.guide-hero { padding-top: 36px; padding-bottom: 64px; }
.guide-breadcrumb { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 20px; margin-bottom: 40px; }
.guide-breadcrumb a { text-decoration: underline; text-underline-offset: 4px; }
.guide-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 52px; align-items: center; }
.guide-hero h1 { font-size: clamp(48px, 5.4vw, 76px); line-height: 1.04; max-width: 12ch; }
.guide-subtitle { margin-top: 16px; font-family: var(--pixel); font-size: clamp(28px, 3vw, 38px); color: var(--cyan); }
.guide-intro { margin-top: 20px; font-family: var(--sans); font-size: 21px; line-height: 1.6; max-width: 52ch; }
.guide-meta { margin-top: 22px; font-family: var(--sans); font-size: 14px; color: var(--muted); line-height: 1.7; }
.guide-hero-figure { min-width: 0; margin: 0; }
.guide-page .shot img { display: block; width: 100%; height: auto; }
.guide-page figcaption { margin-top: 14px; font-family: var(--sans); font-size: 15px; line-height: 1.6; color: var(--muted); }
.guide-layout { display: grid; grid-template-columns: 210px minmax(0, 790px); gap: 64px; padding-bottom: 90px; align-items: start; }
.guide-contents { position: sticky; top: 145px; border-top: 3px solid var(--ember); padding-top: 18px; }
.guide-contents p { margin-bottom: 10px; color: var(--muted); }
.guide-contents a { display: block; padding: 9px 0; font-size: 21px; line-height: 1.2; }
.guide-body { min-width: 0; font-family: var(--sans); font-size: 19px; line-height: 1.7; }
.guide-body section + section { margin-top: 64px; padding-top: 44px; border-top: 2px solid var(--rule); }
.guide-body h2 { font-size: clamp(34px, 4vw, 44px); line-height: 1.12; margin: 0 0 22px; }
.guide-body h3 { font-family: var(--sans); font-size: 22px; line-height: 1.4; font-weight: 700; margin: 28px 0 10px; }
.guide-body p + p { margin-top: 18px; }
.guide-body a:not(.store) { color: var(--cyan); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.guide-body strong { color: var(--text); }
.guide-routine { padding: 0; margin: 30px 0 0; list-style: none; counter-reset: routine; }
.guide-routine > li { counter-increment: routine; position: relative; padding-left: 52px; }
.guide-routine > li + li { margin-top: 30px; }
.guide-routine > li::before { content: counter(routine); position: absolute; left: 0; top: -2px; font-family: var(--pixel); font-size: 32px; color: var(--ember); }
.guide-routine h3 { margin-top: 0; }
.guide-table-scroll { overflow-x: auto; margin: 22px 0; border: 2px solid var(--rule); overscroll-behavior-x: contain; }
.guide-table-scroll table { border-collapse: collapse; width: 100%; min-width: 650px; font-size: 17px; text-align: left; }
.guide-table-scroll caption { text-align: left; padding: 14px 18px; color: var(--muted); font-size: 15px; }
.guide-table-scroll th { background: var(--panel-2); color: var(--text); }
.guide-table-scroll th, .guide-table-scroll td { padding: 12px 16px; border-top: 1px solid var(--rule); white-space: nowrap; }
.guide-table-scroll tbody tr:nth-child(even) { background: var(--panel); }
.guide-body .guide-table-hint { font-size: 15px; color: var(--muted); margin-top: 18px; }
.guide-game-steps { padding-left: 24px; margin: 24px 0; }
.guide-game-steps li { padding-left: 4px; margin: 12px 0; }
.guide-game-steps li::marker { color: var(--ember); font-weight: 700; }
.guide-figure { margin: 34px 0; }
.guide-start { margin-top: 60px; padding: 30px; border: 3px solid var(--text); background: var(--panel); box-shadow: 6px 6px 0 var(--ink); }
.guide-start .cta-row { margin: 24px 0 18px; }
.guide-start .store { text-decoration: none; }
.guide-start h2 { font-size: 38px; }
@media (max-width: 1000px) {
  .guide-page .nav-links { display: none; }
  .guide-hero-grid { gap: 32px; }
  .guide-layout { grid-template-columns: 170px minmax(0, 1fr); gap: 36px; }
}
@media (max-width: 760px) {
  .guide-hero { padding-top: 24px; padding-bottom: 40px; }
  .guide-hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .guide-hero h1 { max-width: 16ch; }
  .guide-breadcrumb { margin-bottom: 26px; }
  .guide-layout { display: block; }
  .guide-contents { position: static; margin-bottom: 38px; }
  .guide-contents nav { display: flex; flex-wrap: wrap; gap: 2px 24px; }
  .guide-contents p { width: 100%; margin-bottom: 6px; }
  .guide-contents a { font-size: 20px; }
}
@media (max-width: 480px) {
  .guide-page .wrap { padding-left: 20px; padding-right: 20px; }
  .guide-page .nav .wrap { padding-left: 16px; padding-right: 16px; }
  .guide-hero h1 { font-size: 48px; }
  .guide-intro { font-size: 19px; }
  .guide-body { font-size: 18px; }
  .guide-routine > li { padding-left: 36px; }
  .guide-start { padding: 22px; }
}

/* The exercise borrows the game's paper card, square buttons and Learn/Recall modes. */
.practice-demo { margin-top: 28px; padding: 22px; background: var(--panel); border: 3px solid var(--text); box-shadow: 6px 6px 0 var(--ink); }
.practice-demo [hidden] { display: none !important; }
.practice-demo button, .practice-demo select { font: inherit; }
.practice-pair { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); gap: 12px; align-items: end; }
.practice-pair label { display: flex; flex-direction: column; gap: 8px; min-width: 0; font-size: 16px; line-height: 1.4; }
.practice-pair label > span { color: var(--muted); }
.practice-pair select { box-sizing: border-box; width: 100%; height: 48px; min-height: 48px; padding: 9px 46px 9px 12px; color: var(--text); background: var(--bg-deep); border: 2px solid var(--text); border-radius: 0; font-family: var(--sans); font-size: 16px; line-height: 1.4; cursor: pointer; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='12' viewBox='0 0 18 12'%3E%3Cpath d='m2 3 7 6 7-6' fill='none' stroke='%23ede6d0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 18px 12px; background-position: right 14px center; }
.practice-pair option { color: var(--text); background: var(--bg-deep); }
.practice-pair-arrow { display: flex; align-items: center; justify-content: center; height: 48px; line-height: 1; font-size: 28px; color: var(--cyan); }
.practice-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin: 24px 0 18px; }
.practice-category { display: flex; gap: 16px; align-items: baseline; font-family: var(--pixel); font-size: 25px; line-height: 1.2; }
.practice-category span:first-child { color: var(--muted); }
.practice-modes { display: flex; gap: 8px; }
.practice-demo .practice-button { box-sizing: border-box; min-height: 48px; padding: 8px 16px; color: var(--text); background: var(--panel-2); border: 3px solid var(--text); border-radius: 0; box-shadow: 3px 3px 0 var(--ink); cursor: pointer; font-family: var(--pixel); font-size: 25px; line-height: 1.1; touch-action: manipulation; }
.practice-demo .practice-button[aria-pressed="true"], .practice-demo .practice-button--primary { background: var(--ember); color: var(--ink); border-color: var(--ink); }
.practice-demo .practice-button:disabled { cursor: default; color: var(--muted); border-color: var(--rule); border-style: dashed; background: var(--panel); box-shadow: none; }
.practice-demo .practice-button:focus-visible, .practice-demo select:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }
.practice-paper { box-sizing: border-box; padding: 24px 20px 30px; min-height: 300px; background: var(--text); color: var(--bg-deep); border: 4px solid var(--ink); box-shadow: 7px 7px 0 var(--ember); text-align: center; }
.practice-prompt-language, .practice-answer-language { display: block; font-family: var(--pixel); font-size: 21px; line-height: 1.2; color: oklch(0.4 0.04 200); }
.practice-prompt { display: block; margin: 7px 0 22px; font-family: var(--sans); font-size: clamp(25px, 3vw, 34px); line-height: 1.25; overflow-wrap: anywhere; }
.practice-answer-area { border-top: 1px solid oklch(0.4 0.04 200 / .35); padding-top: 20px; }
.practice-solution { display: flex; align-items: center; justify-content: center; min-height: 108px; margin-top: 6px; }
.practice-answer { font-family: var(--sans); font-size: clamp(32px, 4.5vw, 52px); line-height: 1.2; font-weight: 700; overflow-wrap: anywhere; }
.practice-demo .practice-reveal { max-width: 100%; min-height: 62px; padding: 12px 20px; color: var(--bg-deep); background: transparent; border: 3px dashed var(--bg-deep); box-shadow: none; font-size: 29px; }
.practice-demo .practice-reveal:focus-visible { outline-color: var(--bg-deep); }
.practice-instruction { min-height: 3.2em; margin: 24px 0 18px; color: var(--muted); font-size: 16px; line-height: 1.6; text-align: center; }
.practice-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 12px; }
.practice-listen { display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.practice-listen svg { flex: none; }
.practice-navigation { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 18px; border-top: 2px solid var(--rule); }
.practice-navigation .practice-button { min-width: 120px; }
.practice-demo .practice-note { font-size: 14px; line-height: 1.6; margin-top: 20px; color: var(--muted); }
@media (max-width: 1000px) and (min-width: 761px) {
  .practice-pair { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .practice-pair-arrow { display: none; }
}
@media (max-width: 480px) {
  .practice-demo { padding: 16px 12px; }
  .practice-pair { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .practice-pair-arrow { display: none; }
  .practice-toolbar { gap: 14px; }
  .practice-category { font-size: 24px; }
  .practice-demo .practice-button { padding-left: 12px; padding-right: 12px; font-size: 23px; }
  .practice-paper { padding: 20px 12px 24px; min-height: 290px; }
  .practice-prompt { font-size: 26px; }
  .practice-answer { font-size: 34px; }
  .practice-demo .practice-reveal { font-size: 25px; }
  .practice-actions { grid-template-columns: minmax(0, 1fr); }
  .practice-navigation .practice-button { min-width: 0; }
  .practice-instruction { min-height: 4.8em; }
}

@media (forced-colors: active) {
  .practice-pair select { -webkit-appearance: auto; appearance: auto; background-image: none; padding-right: 12px; }
}

/* Keep full language names clear of the inset chevrons on narrow screens. */
@media (max-width: 600px) {
  .practice-pair { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .practice-pair-arrow { display: none; }
}

/* Translated mode labels can wrap as a group on narrow screens. */
.practice-modes { flex-wrap: wrap; max-width: 100%; }
.practice-demo .practice-button { max-width: 100%; }

.practice-navigation { flex-wrap: wrap; }
.practice-navigation [data-control="next"] { margin-left: auto; }
