/* The content pages, in the design's palette and type. The app's own screens keep their inline
 * styles; this is only for the pages site.mjs generates. */
:root {
  --ink: #1b1527;
  --ink-soft: rgba(27, 21, 39, .66);
  --purple: #7a4ddb;
  --purple-deep: #5a33ad;
  --page: #f3f0fa;
  --card: #fff;
  --line: rgba(27, 21, 39, .08);
  --green: #1f9e6e;
  --amber: #f0a92e;
  --grey: #d8d3e4;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 16px/1.65 'Nunito', system-ui, sans-serif;
}
h1, h2, h3, h4 { font-family: 'Baloo 2', system-ui, cursive; line-height: 1.15; margin: 0 0 12px; }
h1 { font-size: clamp(30px, 4.4vw, 46px); letter-spacing: -.01em; }
h2 { font-size: clamp(22px, 2.8vw, 29px); margin-top: 36px; }
h3 { font-size: clamp(18px, 2.2vw, 22px); margin-top: 26px; }
p { margin: 0 0 16px; text-wrap: pretty; }
a { color: var(--purple-deep); text-underline-offset: 3px; }
a:hover { color: var(--purple); }
code { background: #efe7fd; border-radius: 6px; padding: 1px 6px; font-size: .92em; }
strong { font-weight: 800; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 10px 16px; border-radius: 12px; z-index: 10; }

/* One frame, every page. These are the app's own numbers (max-width 1280, side padding
 * clamp(16px,2.4vw,28px)), so the logo and the nav sit in exactly the same place whether you
 * are on the board at / or on a word list. */
.frame { max-width: 1280px; margin: 0 auto; padding-left: clamp(16px, 2.4vw, 28px); padding-right: clamp(16px, 2.4vw, 28px); }
.frame.row { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }

/* Tier one is the app's header, unchanged from page to page: brand, your own screens, your
 * streak and XP. Tier two is where a content page puts the sections it has and the app does
 * not, so the first bar never grows a different shape. */
.appbar { background: #fff; border-bottom: 2px solid var(--line); }
/* 38px matches the app header's own row height exactly, so the bar is 60px on every page.
 * A touch device gets the 44px target back. */
.brand {
  display: inline-flex; align-items: center; gap: 10px; min-height: 38px; text-decoration: none;
  font: 800 20px 'Baloo 2', cursive; color: var(--ink);
}
@media (pointer: coarse), (max-width: 720px) {
  .brand, .appnav a { min-height: 44px; }
}
.brand .mark {
  width: 38px; height: 38px; flex: none; border-radius: 13px; background: var(--purple); color: #fff;
  display: grid; place-items: center; font: 800 24px/1 'Baloo 2', cursive;
  box-shadow: 0 3px 0 var(--purple-deep);
}
.appbar a, .sectionbar a, .crumbs a, footer.site nav a { text-decoration: none; }
.crumbs a:hover, footer.site nav a:hover { text-decoration: underline; }
.appbar .frame.row { padding-top: 11px; padding-bottom: 11px; gap: 16px; }
.appnav { display: flex; flex-wrap: wrap; gap: 4px; margin-right: auto; }
.appnav a {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 12px;
  font: 800 14px 'Nunito', sans-serif; color: #5b5470; text-decoration: none;
}
.appnav a:hover { background: #f3f0fa; }
.stats { display: flex; gap: 8px; align-items: center; }
.stats .chip {
  display: inline-flex; align-items: baseline; gap: 6px; border-radius: 99px; padding: 7px 13px;
  font: 700 12px 'Nunito', sans-serif;
}
.stats .chip strong { font: 800 15px 'Baloo 2', cursive; }

@media (max-width: 720px) {
  /* Brand and your numbers on the first line, your screens on the second: three stacked rows
   * of chrome was most of the fold on a phone. */
  .appbar .frame.row { gap: 8px 10px; }
  .appbar .brand { order: 1; }
  .stats { order: 2; margin-left: auto; }
  .appnav { order: 3; flex-basis: 100%; gap: 0; margin-right: 0; }
  .appnav a { padding: 0 10px; min-height: 40px; }
}

/* The section bar scrolls sideways on a small screen. `overflow: hidden` on the bar itself is
 * what stops that row from widening the document: without it the page scrolls sideways too. */
.sectionbar { background: var(--page); border-bottom: 2px solid var(--line); overflow: hidden; }
.sectionbar .frame.row {
  justify-content: flex-start; gap: 6px; padding-top: 6px; padding-bottom: 6px;
  flex-wrap: nowrap; overflow-x: auto; min-width: 0; max-width: 100%; scrollbar-width: none;
}
.sectionbar .frame.row::-webkit-scrollbar { display: none; }
.sectionbar a {
  white-space: nowrap; display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px;
  border-radius: 10px; font: 800 13.5px 'Nunito', sans-serif; color: #5b5470; text-decoration: none;
}
.sectionbar a:hover { background: #e7e0f7; }
.sectionbar a[aria-current="page"] { background: var(--purple); color: #fff; }

header.site, footer.site { padding: 14px 0; }

/* The play row, in the blueprint's proportions. Cards, gap and flex basis are the app's. */
.play { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.play .side { flex: 1 1 250px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.play .side:last-child { flex: 1 1 270px; }
.play .centre { flex: 2.2 1 470px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.card {
  background: var(--card); border-radius: 22px; padding: 22px; box-shadow: 0 3px 0 var(--line);
}
.card h1 { font-size: clamp(25px, 2.6vw, 31px); margin: 6px 0 10px; }
.card h2 { font-size: 20px; margin: 0 0 12px; }
.kicker { font: 800 10.5px 'Nunito', sans-serif; letter-spacing: .14em; color: var(--purple); text-transform: uppercase; }
.lessonslot .meta, .card .meta { font-size: 13.5px; color: var(--ink-soft); }
.below { max-width: 980px; margin: 56px auto 0; display: flex; flex-direction: column; gap: 28px; }
@media (max-width: 1080px) {
  .play .side:last-child { order: 3; }
  .play .centre { order: 1; flex-basis: 100%; }
  .play .side { order: 2; flex-basis: 100%; }
}

/* Measure: prose stays readable, the way the app caps its own paragraphs. */
.copy p, .copy li { max-width: 68ch; }
.promise { font-size: 15px; margin: 0; }
.crumbs { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs .sep { opacity: .5; }
.promise { font-size: 18px; color: var(--ink-soft); max-width: 62ch; }

.copy { background: var(--card); border-radius: 22px; padding: clamp(18px, 3vw, 30px); box-shadow: 0 3px 0 var(--line); }
.copy > :first-child { margin-top: 0; }
.copy ul, .copy ol { margin: 0 0 16px; padding-left: 22px; }
.copy li { margin-bottom: 7px; }
.tablewrap { overflow-x: auto; margin-bottom: 18px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th { font-weight: 800; }

.faq { margin-top: 32px; }
.faq details {
  background: var(--card); border-radius: 16px; padding: 14px 18px; margin-bottom: 10px;
  box-shadow: 0 3px 0 var(--line);
}
.faq summary { cursor: pointer; font-weight: 800; }
.faq details[open] summary { margin-bottom: 8px; }
.faq p { margin: 0; color: var(--ink-soft); }

.related { margin-top: 32px; }
.related ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.play .related ul { grid-template-columns: 1fr; }
.play .related h2 { margin-top: 0; }
.play .related a { box-shadow: none; background: #faf8ff; padding: 11px 14px; font-size: 14px; }
.related a {
  display: block; background: var(--card); border-radius: 14px; padding: 13px 16px;
  box-shadow: 0 3px 0 var(--line); font-weight: 800; text-decoration: none;
}
.note { margin-top: 26px; font-size: 13.5px; color: var(--ink-soft); }

/* The board. Sized so the tiles and the keyboard never reflow once the page has painted.
 * A board that draws a grid sits on a card, the way the app's board does; a mount that is
 * already made of cards (the answer archive, the hubs) stays flat so cards do not nest. */
.board { margin: 22px 0 28px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.board:not(:has(.lesson)):not(:has(.related)) {
  background: var(--card); border-radius: 26px; padding: clamp(16px, 2.4vw, 26px);
  box-shadow: 0 3px 0 var(--line);
}
/* A single board is a 560px object, the width the design drew it at. Only the multi-board grid
 * and the tables want the whole column. */
.board:has(.keys):not(:has(.multi)):not(:has(table)) { max-width: 600px; margin-inline: auto; }
/* A field carries its label above it, so a form row lines up on the bottom edge, not the
 * middle: otherwise the button floats halfway up the label. */
.board form.bar { align-items: flex-end; }
.board .empty { font: 400 14px/1.6 'Nunito', sans-serif; color: var(--ink-soft); text-align: center; margin: 0; }

/* The action that submits the form is the primary action on the page, and it should look it.
 * Everything else on a board bar is secondary. */
.board button[type="submit"], .board .bar button[type="submit"], .finderform button.go {
  background: var(--purple); color: #fff; box-shadow: 0 4px 0 var(--purple-deep);
  padding: 0 20px; height: 44px; border: none; border-radius: 14px; cursor: pointer;
  font: 800 14px 'Nunito', sans-serif;
}
.board button[type="submit"]:hover, .board .bar button[type="submit"]:hover, .finderform button.go:hover { background: #8a60e3; }
.board button[type="submit"]:active, .board .bar button[type="submit"]:active, .finderform button.go:active {
  transform: translateY(3px); box-shadow: 0 1px 0 var(--purple-deep);
}
.board .bar button:not([type="submit"]):hover { background: #efe7fd; }
.board .grid { display: grid; gap: 6px; }
/* A row of tiles fits the column it is in: nine letters on a phone shrink, they do not push
 * the page sideways. The square comes from the aspect ratio, not a fixed width. */
.board .grid { width: 100%; max-width: 420px; }
.board .row { display: grid; gap: 6px; width: 100%; }
.board .row .tile { width: auto; min-width: 0; aspect-ratio: 1; height: auto; }
.board .tile {
  width: 54px; height: 54px; border-radius: 10px; display: grid; place-items: center;
  font: 800 25px 'Nunito', sans-serif; text-transform: uppercase;
  /* Tinted, not white: the board sits on a white card, and a white tile on a white card is
   * an outline, not a slot. */
  background: #f7f5fc;
  box-shadow: inset 0 0 0 2px #e6e2f0; color: var(--ink);
}
.board .tile.hit { background: var(--green); color: #fff; box-shadow: none; }
.board .tile.near { background: var(--amber); color: #fff; box-shadow: none; }
.board .tile.miss { background: var(--grey); color: #fff; box-shadow: none; }
.board .keys { display: flex; flex-direction: column; gap: 7px; width: 100%; max-width: 520px; }
.board .keys .krow { display: flex; gap: 5px; justify-content: center; }
.board .key {
  flex: 1 1 auto; min-width: 30px; height: 50px; border: none; border-radius: 9px; cursor: pointer;
  background: #ece8f6; box-shadow: 0 3px 0 rgba(27, 21, 39, .1);
  font: 800 14px 'Nunito', sans-serif; color: var(--ink); text-transform: uppercase;
}
.board .key:hover { background: #e2dcf2; }
.board .key:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(27, 21, 39, .1); }
.board .key.wide { flex: 1.6 1 auto; font-size: 12px; }
.board .key.hit { background: var(--green); color: #fff; }
.board .key.near { background: var(--amber); color: #fff; }
.board .key.miss { background: var(--grey); color: #fff; }
.board .msg { min-height: 24px; font-weight: 800; color: var(--purple-deep); }
.board .lesson {
  background: var(--card); border-radius: 18px; padding: 18px 20px; box-shadow: 0 3px 0 var(--line);
  width: 100%; max-width: 520px;
}
.board .lesson h2 { margin: 0 0 6px; font-size: 22px; }
.board .lesson .meta { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.board .bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; font-size: 13px; color: var(--ink-soft); }
.board .bar button {
  border: none; background: #fff; cursor: pointer; padding: 9px 15px; border-radius: 12px;
  font: 800 13px 'Nunito', sans-serif; color: var(--purple-deep); box-shadow: 0 3px 0 rgba(27, 21, 39, .07);
}
@media (max-width: 420px) {
  .board .tile { font-size: 19px; }
  /* Ten keys have to fit the phone. The row sets the width; the height keeps the target. */
  .board .key { height: 46px; min-width: 22px; font-size: 12px; padding: 0 2px; }
  .board .key.wide { font-size: 10px; }
}
.board { max-width: 100%; box-sizing: border-box; }
.board .keys, .board .grid { max-width: 100%; }

/* The games that are not a board: finder, dictation, matching, quiz. */
.field { display: flex; flex-direction: column; gap: 5px; font: 800 12px 'Nunito', sans-serif; color: var(--ink-soft); }
.field input {
  height: 44px; border: 2px solid var(--line); border-radius: 12px; padding: 0 12px;
  font: 700 15px 'Nunito', sans-serif; background: #fff; color: var(--ink); min-width: 140px;
}
.finderform { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: center; width: 100%; }
.finderform button { align-self: flex-end; height: 44px; }
.board form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; justify-content: center; }
.board input[type="text"], .board input[type="number"] {
  height: 44px; border: 2px solid var(--line); border-radius: 12px; padding: 0 12px;
  font: 700 15px 'Nunito', sans-serif; background: #fff;
}
.finderlist { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 24px; }
.finderlist li { break-inside: avoid; margin-bottom: 6px; font-size: 14px; }
.finderlist .meta { color: var(--ink-soft); }
.matchgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; width: 100%; }
.matchcol { display: flex; flex-direction: column; gap: 8px; }
.matchbtn {
  border: none; cursor: pointer; text-align: left; padding: 12px 14px; border-radius: 12px;
  background: #fff; box-shadow: 0 3px 0 var(--line); font: 700 14px 'Nunito', sans-serif; color: var(--ink);
}
.matchbtn.on { background: #efe7fd; color: var(--purple-deep); }
.matchbtn.done { background: var(--green); color: #fff; box-shadow: none; }
.options { display: grid; gap: 9px; margin-top: 12px; }
.option {
  border: none; cursor: pointer; text-align: left; padding: 13px 15px; border-radius: 13px;
  background: #faf8ff; box-shadow: 0 3px 0 var(--line); font: 600 14.5px/1.5 'Nunito', sans-serif; color: var(--ink);
}
.option:hover { background: #efe7fd; }
.board .bar button.on { background: var(--purple); color: #fff; }
.wordlist { margin-top: 32px; }
@media print {
  header.site, footer.site, .board .keys, .related, .faq, [data-ts-ad] { display: none !important; }
}

/* Letter hive and the custom list builder. */
.hive { display: grid; grid-template-columns: repeat(4, 56px); gap: 8px; justify-content: center; }
.hivekey {
  height: 56px; border: none; border-radius: 14px; cursor: pointer; background: #fff;
  box-shadow: 0 3px 0 var(--line); font: 800 20px 'Nunito', sans-serif; color: var(--ink);
}
.hivekey.centre { background: var(--amber); color: #fff; }
.listform { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 520px; }
.listform textarea {
  width: 100%; border: 2px solid var(--line); border-radius: 14px; padding: 12px;
  font: 500 15px/1.6 'Nunito', sans-serif; background: #fff; color: var(--ink);
}
.lesson input[readonly] {
  width: 100%; margin-top: 10px; height: 44px; border: 2px solid var(--line); border-radius: 12px;
  padding: 0 12px; font: 600 13px 'Nunito', sans-serif; background: #faf8ff;
}
.board button.tile { cursor: pointer; border: none; }

/* Every interactive thing is reachable, visible and big enough to hit. */
:where(a, button, summary, input, textarea, select):focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 2px;
  border-radius: 6px;
}
button, summary, .option, .matchbtn { min-height: 44px; }
.faq summary { padding: 4px 0; }
/* Height is the axis a thumb misses on a keyboard row; width is set by how many keys fit the
 * screen, and forcing 44px there pushed the row wider than the phone. */
.board .key { min-height: 44px; }
.board .bar button, .hivekey { min-height: 44px; min-width: 44px; }
.crumbs a, header.site nav a, footer.site nav a, footer.site nav button {
  min-height: 44px; display: inline-flex; align-items: center;
}
input, textarea, select { font-family: inherit; }
