/* The public library pages (models/library/ActivityPageHtml.ts): the approved
   mock, v4 (https://claude.ai/artifact/UxPmpnvQLS7XayktpfmSS8). One file, cached
   across every activity page. */
/* Layout: one teacher-facing paper page. The activity first (title, words, one Play),
   then one suggested game with a few others, then making it yours, then the trial as a
   quiet close. Single light theme on purpose: construction paper on felt (docs/style-guide.md).
   CTA ladder: sun = Play (once per screen) · ink outline = choose / customize · text link = trial. */
:root {
  --board: #2d4a3e;
  --board-deep: #243b32;
  --paper: #faf6ec;
  --card: #ffffff;
  --ink: #26352e;
  --ink-soft: #55635b;
  --line: #e8dfcc;
  --sun: #ffc83d;
  --sun-deep: #f0b01e;
  --sun-press: #c7920a;
  --sky: #3ba2e8;
  --sky-ink: #1a6fb0;
  --leaf-wash: #e8f4ea;
  --leaf-ink: #2f7a3c;
  --note: #fff3c4;
  --note-ink: #6b5410;

  --display: "Grandstander", "Andika", "Lexend", system-ui, sans-serif; /* marketing headlines only */
  --work: "Lexend", Helvetica, Arial, sans-serif;                     /* everything a teacher reads */
  --show: "Fredoka", "Lexend", system-ui, sans-serif;                 /* what the class sees (font zones) */
  /* Torn paper, the landing's own (landing.css --rm-torn-*): a pixel-amplitude tear so a
     chip and a full panel tear alike; a near-white core proud of every cut; a warm hard shadow. */
  --core: #fdfbf4;
  --torn-core: polygon(7px 1.4px,11.11% calc(0px + 0.1px),22.22% calc(0px + 0.3px),33.33% calc(0px + -1.8px),44.44% calc(0px + -1.4px),55.56% calc(0px + -0.6px),66.67% calc(0px + -0.1px),77.78% calc(0px + -1.6px),88.89% calc(0px + -1.8px),calc(100% - 7px) 0.2px,calc(100% - 0.6px) 7px,calc(100% + 0.4px) 11.11%,calc(100% + 1.5px) 22.22%,calc(100% + -0.1px) 33.33%,calc(100% + 0.8px) 44.44%,calc(100% + -1.5px) 55.56%,calc(100% + -0.4px) 66.67%,calc(100% + -1.0px) 77.78%,calc(100% + -1.4px) 88.89%,calc(100% - 0.5px) calc(100% - 7px),calc(100% - 7px) calc(100% - 1.2px),88.89% calc(100% + -0.6px),77.78% calc(100% + 1.8px),66.67% calc(100% + 1.4px),55.56% calc(100% + 0.1px),44.44% calc(100% + -2.2px),33.33% calc(100% + 1.0px),22.22% calc(100% + -0.4px),11.11% calc(100% + -0.7px),7px calc(100% - 1.3px),1.2px calc(100% - 7px),calc(0px + 0.7px) 88.89%,calc(0px + -1.0px) 77.78%,calc(0px + -1.9px) 66.67%,calc(0px + -2.2px) 55.56%,calc(0px + 0.5px) 44.44%,calc(0px + -0.1px) 33.33%,calc(0px + -2.1px) 22.22%,calc(0px + -2.0px) 11.11%,1.6px 7px);
  --torn-face: polygon(6px 0.6px,11.11% calc(0px + 2.0px),22.22% calc(0px + 0.5px),33.33% calc(0px + 2.0px),44.44% calc(0px + -2.2px),55.56% calc(0px + 1.7px),66.67% calc(0px + -0.7px),77.78% calc(0px + -2.1px),88.89% calc(0px + -2.1px),calc(100% - 6px) 2.4px,calc(100% - 2.3px) 6px,calc(100% + 0.2px) 11.11%,calc(100% + -0.2px) 22.22%,calc(100% + 0.2px) 33.33%,calc(100% + 0.5px) 44.44%,calc(100% + 1.3px) 55.56%,calc(100% + 1.3px) 66.67%,calc(100% + -0.4px) 77.78%,calc(100% + -0.1px) 88.89%,calc(100% - 2.0px) calc(100% - 6px),calc(100% - 6px) calc(100% - 0.9px),88.89% calc(100% + -0.1px),77.78% calc(100% + -2.0px),66.67% calc(100% + 1.2px),55.56% calc(100% + 1.6px),44.44% calc(100% + -0.7px),33.33% calc(100% + -1.5px),22.22% calc(100% + 2.3px),11.11% calc(100% + -1.8px),6px calc(100% - 1.1px),1.1px calc(100% - 6px),calc(0px + -1.9px) 88.89%,calc(0px + -1.9px) 77.78%,calc(0px + 0.6px) 66.67%,calc(0px + 1.3px) 55.56%,calc(0px + -2.0px) 44.44%,calc(0px + 0.5px) 33.33%,calc(0px + 2.0px) 22.22%,calc(0px + -1.1px) 11.11%,1.4px 6px);
  --paper-shadow: drop-shadow(0 4px 0 rgba(84, 58, 30, .22));
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.55 var(--work); }
a { color: var(--sky-ink); }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }


/* Header: navigation only; the trial is a quiet link, never a second primary */
.site { background: var(--card); border-bottom: 1px solid var(--line); }
.site .wrap { display: flex; align-items: center; gap: 16px; padding-block: 12px; flex-wrap: wrap; }
.logo { font: 700 20px var(--display); color: var(--ink); text-decoration: none; margin-right: auto; }
.logo span { color: var(--sky-ink); }
.nav { display: flex; gap: 18px; flex-wrap: wrap; font-size: 15px; align-items: center; }
.nav a { color: var(--ink); text-decoration: none; }
.nav a:hover { text-decoration: underline; }
.nav .signup { font-weight: 600; color: var(--sky-ink); }

/* Buttons — the regular site's own pills (landing.css: .btn, .btn-sun, .btn-paper, .btn-chalk) */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 26px; border-radius: 999px; border: 0; text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .08s, box-shadow .08s, background .16s; }
.btn-play { font: 600 18px var(--work); color: #2b2417; background: var(--sun); box-shadow: 0 5px 0 var(--sun-press); }
.btn-play:hover { background: var(--sun-deep); }
.btn-play:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--sun-press); }
.btn-line { font: 600 16px var(--work); color: var(--ink); background: transparent; border: 1.5px solid rgba(38, 53, 46, .3); }
.btn-line:hover { border-color: var(--ink); background: rgba(255, 255, 255, .6); }
.trial .btn-line { color: #f5f2ea; border-color: rgba(245, 242, 234, .7); }
.trial .btn-line:hover { background: rgba(245, 242, 234, .08); border-color: rgba(245, 242, 234, .95); }
.btn-small { min-height: 42px; padding: 0 20px; font-size: 15px; }
.textlink { font-weight: 600; color: var(--sky-ink); }

/* Breadcrumb */
.crumbs { font-size: 14px; color: var(--ink-soft); padding-block: 18px 4px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: #a0a89f; }
.crumbs a { color: var(--ink-soft); }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 36px; align-items: center; padding-block: 8px 30px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.facts li { font: 600 13px var(--work); letter-spacing: .02em; padding: 4px 10px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.facts li.lvl { background: var(--leaf-wash); border-color: #c9e3cd; color: var(--leaf-ink); }
h1 { font: 700 clamp(34px, 5vw, 54px)/1.05 var(--display); margin: 0 0 12px; text-wrap: balance; }
.desc { font-size: 18px; color: var(--ink-soft); max-width: 34em; margin: 0 0 20px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cta .btn { padding: 0 20px; }
.howfree { margin: 14px 0 0; padding: 12px 14px; background: var(--card); border: 1px dashed #d8ccb0; border-radius: 10px; font-size: 15px; max-width: 34em; }
.howfree b { font-weight: 600; }
.howfree span { color: var(--ink-soft); }

.board { background: var(--board); border-radius: 14px; padding: 22px; border: 10px solid #b07b4a; box-shadow: inset 0 0 0 2px var(--board-deep), 0 10px 24px rgba(38,53,46,.18); }
.board img { display: block; width: 100%; height: auto; border-radius: 6px; transform: rotate(-1.2deg); box-shadow: 0 6px 14px rgba(0,0,0,.28); }

/* Sections */
section { padding-block: 32px; border-top: 1px dashed var(--line); }
h2 { font: 600 26px/1.2 var(--work); margin: 0 0 6px; text-wrap: balance; }
.lead { color: var(--ink-soft); margin: 0 0 18px; max-width: 62ch; }

/* The words, as the class sees them */
.words { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.word { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; box-shadow: 0 2px 0 var(--line); }
.word img { width: 100%; height: auto; border-radius: 6px; aspect-ratio: 900 / 690; object-fit: cover; }
/* The word under its picture, as the class reads it: the card art carries no text. */
.word figcaption { font: 600 18px/1.2 var(--show); padding: 8px 2px 2px; overflow-wrap: anywhere; }
@media (max-width: 760px) { .word figcaption { font-size: 14px; padding-top: 4px; } }
details.all { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
details.all summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style-position: inside; }
details.all ol { margin: 0; padding: 4px 16px 16px 40px; columns: 3 12em; column-gap: 28px; font: 700 18px/1.9 var(--show); }

/* Ways to play */
.feature { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.feature img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 960 / 617; background: var(--board); }
.feature .body { padding: 22px; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.tag { font: 600 12.5px var(--work); color: var(--note-ink); background: var(--note); padding: 3px 8px; border-radius: 6px; align-self: flex-start; }
.feature h3 { font: 700 28px var(--show); margin: 0; }
.feature p { margin: 0; color: var(--ink-soft); }
.modes { display: flex; flex-wrap: wrap; gap: 6px; }
.modes span { font-size: 12.5px; font-weight: 600; letter-spacing: .02em; padding: 2px 8px; border-radius: 6px; background: #eef5fb; color: var(--sky-ink); }
.row-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 4px; }

.others-h { font: 600 18px var(--work); margin: 26px 0 12px; }
.others { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mini { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.mini img { width: 100%; height: auto; aspect-ratio: 960 / 617; object-fit: cover; display: block; background: var(--board); }
.mini .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.mini h4 { font: 700 19px var(--show); margin: 0; }
.mini p { margin: 0; font-size: 14.5px; color: var(--ink-soft); flex: 1; }
details.every { margin-top: 16px; }
details.every summary { cursor: pointer; display: inline-flex; }
details.every .list { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px 18px; }
details.every .list a { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); color: var(--ink); text-decoration: none; }
details.every .list a span { color: var(--sky-ink); font-weight: 600; font-size: 14px; }
.group { grid-column: 1 / -1; font: 600 13px var(--work); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); margin-top: 8px; }

/* Make it yours */
.make { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px 32px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.steps { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: start; }
.steps b { width: 30px; height: 30px; border-radius: 50%; background: var(--leaf-wash); color: var(--leaf-ink); display: grid; place-items: center; font: 700 15px var(--work); }
.make .side { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.make .side p { margin: 0; font-size: 14px; color: var(--ink-soft); }

/* Trial: the quiet close */
.trial { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 28px; align-items: center; padding: 22px 24px; border-radius: 14px; background: var(--board); color: #f5f2ea; }
.trial h2 { font: 700 24px/1.2 var(--display); color: #fff; margin: 0; }
.trial p { margin: 6px 0 0; color: #d6e1da; }
.trial .btn-line { border-color: #f5f2ea; background: transparent; color: #fff; }
.trial .btn-line:hover { background: rgba(255,255,255,.08); }

/* Related */
.related { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rel { display: block; background: var(--card); border: 1px dashed #cfc6b0; border-radius: 10px; padding: 16px; color: var(--ink); text-decoration: none; }
.rel:hover b { text-decoration: underline; }
.rel b { font-weight: 600; display: block; }
.rel span { font-size: 14px; color: var(--ink-soft); }

footer { padding-block: 30px 40px; color: var(--ink-soft); font-size: 14px; border-top: 1px solid var(--line); margin-top: 20px; }
footer .wrap { display: flex; gap: 10px 24px; flex-wrap: wrap; }


/* ---- Every edge torn (Barry, 13 Oct 2026) ----
   Each piece is two layers of paper: the core (::before) and the face (::after, inset so
   the core shows at the cut). The element's own box, border and radius step aside. */
.site, .facts li, .howfree, .board, .word, details.all, .feature, .mini, .modes span, .tag,
.make, .steps b, .trial, .rel {
  position: relative;
  isolation: isolate;
  background: transparent;
  border-color: transparent;
  border-radius: 0;
  box-shadow: none;
  filter: var(--paper-shadow);
  --face: var(--card);
  --gap: 3px;
}
.site::before, .facts li::before, .howfree::before, .board::before, .word::before, details.all::before,
.feature::before, .mini::before, .modes span::before, .tag::before, .make::before, .steps b::before,
.trial::before, .rel::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: var(--core); clip-path: var(--torn-core);
}
.site::after, .facts li::after, .howfree::after, .board::after, .word::after, details.all::after,
.feature::after, .mini::after, .modes span::after, .tag::after, .make::after, .steps b::after,
.trial::after, .rel::after {
  content: ""; position: absolute; inset: var(--gap); z-index: -1;
  background: var(--face); clip-path: var(--torn-face);
}
/* Faces and cores per piece */
.site { filter: none; --gap: 0px 0px 3px; }
.facts li.lvl { --face: var(--leaf-wash); }
.modes span { --face: #eef5fb; --gap: 2px; }
.tag { --face: var(--note); --gap: 2px; }
.steps b { --face: var(--leaf-wash); --gap: 2px; }
.board { --core: #b07b4a; --face: var(--board); --gap: 10px; padding: 26px; }
.trial { --face: var(--board); --gap: 4px; }
.rel { --face: #fffdf7; }
details.all, .feature, .mini, .make { --gap: 4px; }
/* Screenshots and cards are pasted on as their own torn pieces */
.board img, .word img, .feature img, .mini img { clip-path: var(--torn-face); border-radius: 0; box-shadow: none; }
.feature, .mini { overflow: visible; }
.feature img { margin: 8px 0 8px 8px; width: calc(100% - 8px); height: calc(100% - 16px); }
.mini img { margin: 6px 6px 0; width: calc(100% - 12px); }

/* Phone: title, Play and the words inside the first screen; the big board steps aside */
@media (max-width: 900px) {
  .others, .related { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 0; padding-block: 4px 18px; }
  .hero .board { display: none; }
  .desc { font-size: 16px; margin-bottom: 16px; }
  .cta .btn { flex: 1 1 100%; }
  .make, .trial { grid-template-columns: minmax(0, 1fr); }
  .nav a:not(.signup):not(.login) { display: none; }
  .words { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .word { padding: 5px; }
  section.words-sec .lead { display: none; }
  section.words-sec h2 { font-size: 20px; margin-bottom: 10px; }
  .howfree { margin-top: 12px; padding: 10px 12px; font-size: 14px; }
  details.all ol { columns: 2 8em; }
  section.words-sec { border-top: 0; padding-top: 0; }
  .others { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .mini { flex-direction: row; align-items: stretch; }
  .mini img { width: 38%; aspect-ratio: auto; margin: 6px 0 6px 6px; }
  .feature img { margin: 8px 8px 0; width: calc(100% - 16px); height: auto; }
  .mini p { display: none; }
}
@media (max-width: 520px) {
  .related { grid-template-columns: minmax(0, 1fr); }
  .wrap { padding-inline: 16px; }
  h1 { font-size: 34px; }
}

/* Question sets: the question, then its answer, one per line. */
details.all ol.qa { columns: 2 22em; font: 400 16px/1.5 var(--work); }
details.all ol.qa li { break-inside: avoid; margin-bottom: 10px; }
details.all ol.qa .q { display: block; color: var(--ink-soft); }
details.all ol.qa .a { display: block; font: 600 17px/1.4 var(--show); }
@media (max-width: 760px) { details.all ol.qa { columns: 1; } }
