@font-face {
  font-family: 'Lilita One';
  src: url('/assets/lilita-one-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Barlow Condensed';
  src: url('/assets/barlow-condensed-800.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/assets/dm-sans-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/assets/dm-sans-700.woff2') format('woff2');
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
}
/*
 * Romaji: DM Sans draws a capital I like a small l, so "Iie" read as the English "lie". Kero
 * Romaji holds one glyph, DM Sans's I with bars (its stem, cap height and T-bar thickness), and
 * a romaji's other letters stay DM Sans. Made from dist/assets/dm-sans-*.woff2 with fontTools
 * (SIL Open Font License, as DM Sans).
 */
@font-face {
  font-family: 'Kero Romaji';
  src: url('/assets/fonts/kero-romaji-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0049;
}
@font-face {
  font-family: 'Kero Romaji';
  src: url('/assets/fonts/kero-romaji-700.woff2') format('woff2');
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0049;
}
@font-face {
  font-family: 'Kero Japanese';
  src: url('/assets/noto-sans-jp.woff2') format('woff2');
  font-display: swap;
}
/* The comic fonts load only on pages that use them. */
@font-face {
  font-family: 'Kero Comic';
  src: url('/assets/fonts/comic-neue-700-normal.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Kero Comic';
  src: url('/assets/fonts/comic-neue-700-italic.woff2') format('woff2');
  font-weight: 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'Kero Impact';
  src: url('/assets/fonts/bangers-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  --ink: #392c20;
  --paper: #fffaf0;
  --yellow: #f6c747;
  --butter: #ffe6a3;
  --red: #b6382b;
  --blue: #8bd1d6;
  --muted: #685844;
  --line: #d8c9a9;
  --heading: 'Lilita One', sans-serif;
  --body: 'DM Sans', sans-serif;
  /* The body font with a capital I that never reads as l (Iie, not "lie"). */
  --romaji: 'Kero Romaji', 'DM Sans', sans-serif;
  --page: 1380px;
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.6 var(--body);
}
a {
  color: inherit;
  text-decoration: none;
}
button,
select {
  font: inherit;
  color: inherit;
}
img {
  display: block;
  max-width: 100%;
  height: auto;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  font-family: var(--heading);
  font-weight: 400;
  line-height: 1.05;
  overflow-wrap: anywhere;
}
h1 {
  font-size: clamp(3rem, 7vw, 6rem);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
h2 {
  font-size: clamp(2.5rem, 4.5vw, 4rem);
  margin-bottom: 24px;
}
h3 {
  font-size: 2rem;
}
h1 em,
h2 em {
  font-style: normal;
  color: var(--red);
}
p {
  margin-bottom: 18px;
}
a,
summary,
select,
button {
  -webkit-tap-highlight-color: transparent;
}
a:focus-visible,
summary:focus-visible,
select:focus-visible,
button:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 5px;
}
a:hover .link-label,
.text-link:hover,
.quiet-link:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}
.nowrap {
  white-space: nowrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 1000;
  background: var(--ink);
  color: white;
  padding: 14px 20px;
  transform: translateY(-180%);
}
.skip-link:focus {
  transform: none;
}
.section {
  max-width: var(--page);
  margin: 0 auto;
  padding: 80px 6%;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.section-heading h2 {
  margin: 0;
}
.section-heading h2 > span {
  color: var(--red);
}
.eyebrow {
  display: block;
  font: 700 0.8125rem/1.5 var(--body);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 56px;
  max-width: 100%;
  padding: 15px 24px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 18px 21px 17px 23px;
  box-shadow: 0 4px 0 var(--ink);
  font-weight: 700;
  line-height: 1.4;
  transition:
    transform 0.18s,
    box-shadow 0.18s;
}
.button:hover {
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 0 7px 0 var(--ink);
}
/* A button that lifts when hovered keeps a strip of its old place under it while it is up, so a
   pointer resting on its bottom edge never makes it flicker up and down (a Start button that
   appears under a still mouse did, every frame). No specificity, so a button placed by its own
   class keeps its place. */
:where(.button:hover, .drawing-button:not(:disabled):hover) {
  position: relative;
}
:where(.button:hover, .drawing-button:not(:disabled):hover)::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 4px;
}
.button.white {
  background: var(--paper);
}
.button span {
  flex-shrink: 0;
}
/* KEROTOWN's two stores side by side (src/components/store-link.ts), Google Play first: one row
   where both fit, one above the other where they do not. */
.store-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  max-width: 100%;
}
/* Each store's own official badge, unchanged and the same height as its twin: 56px for a page's
   main pair, 44px on the cards. Apple's and Google's rules: no recolouring, no extra frame. */
.store-badge {
  display: inline-block;
  flex: none;
  border-radius: 9px;
  line-height: 0;
  transition: transform 120ms ease;
}
.store-badge:hover {
  transform: translateY(-2px);
}
.store-badge:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 3px;
}
.store-badge-image {
  display: block;
  width: auto;
  height: 100%;
}
.store-badge--big {
  height: 56px;
}
.store-badge--small {
  height: 44px;
}
@media (prefers-reduced-motion: reduce) {
  .store-badge {
    transition: none;
  }
  .store-badge:hover {
    transform: none;
  }
}
.watch-button {
  background: var(--red);
  color: white;
}
.play-icon {
  font-size: 0.875rem;
}
/* TikTok's note (src/components/channel-marks.ts), white on an ink circle, the size of the
   YouTube play circle beside it. Discord's speech bubble is the same size, ink on the site's
   blue. */
.tiktok-icon,
.discord-icon {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: white;
}
.discord-icon {
  background: var(--blue);
  color: var(--ink);
}
.tiktok-icon svg,
.discord-icon svg {
  display: block;
  width: 17px;
  height: 17px;
}
.quiet-link {
  display: block;
  width: fit-content;
  padding: 14px 0 4px;
  font-size: 0.9375rem;
  font-weight: 700;
  min-height: 44px;
}
.text-link,
.link-label {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-weight: 700;
  min-height: 44px;
}
.page-intro {
  padding-top: 52px;
  padding-bottom: 28px;
}
.page-intro h1 {
  margin: 0 0 18px;
}
.page-intro > p {
  max-width: 560px;
}
.site-header {
  max-width: var(--page);
  margin: 0 auto;
  padding: 22px 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand-frog {
  width: 54px;
  height: 56px;
  position: relative;
}
.brand-frog img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: rotate(-8deg);
}
.brand-name {
  font: 400 2.15rem/0.9 var(--heading);
  letter-spacing: -0.025em;
}
.brand-name small {
  display: block;
  font: 700 0.625rem/1.5 var(--body);
  letter-spacing: 0.055em;
  margin-top: 5px;
}
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 28px;
  margin-left: auto;
  font-size: 0.9375rem;
  font-weight: 700;
}
.site-header nav > a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
}
.site-header nav > a[aria-current] {
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 7px;
}
/* The way into learning stands out: Learn comes first, as a butter pill. */
.site-header nav > a.nav-learn {
  padding: 0 14px;
  background: var(--butter);
  border: 2px solid var(--ink);
  border-radius: 999px;
}
.site-header nav > a.nav-learn:hover {
  background: var(--yellow);
}
/* KEROTOWN ONLINE, named in full (the owner, 28 October 2026): one line wherever the menu is one
   row, KEROTOWN over ONLINE on a phone (below). */
.site-header nav > a.nav-online {
  white-space: nowrap;
}
/* The red Watch tab (src/render/layout.ts): the site's own /watch/ page, so no outside-link
   arrow. On /watch/ it is the current page: underlined like the menu, with an ink ring. */
.watch-tab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 19px 0 12px;
  flex-shrink: 0;
  border-radius: 30px;
  color: white;
  background: var(--red);
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
}
.watch-tab:hover {
  background: var(--ink);
}
.watch-tab[aria-current] {
  box-shadow:
    0 0 0 3px var(--paper),
    0 0 0 5px var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}
/* Kero's Discord beside it (src/render/layout.ts): the site's blue with ink words and the white
   speech-bubble mark, as the Discord button on /watch/, so it reads as the site's own way in. */
.discord-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 17px 0 8px;
  flex-shrink: 0;
  border-radius: 30px;
  color: var(--ink);
  background: var(--blue);
  font-size: 0.9375rem;
  font-weight: 700;
  white-space: nowrap;
}
.discord-tab:hover {
  color: white;
  background: var(--ink);
}
.discord-tab .discord-icon {
  background: white;
  color: var(--ink);
}
.watch-tab-icon {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.5em;
  height: 1.5em;
  border-radius: 50%;
  background: white;
  color: var(--red);
}
.watch-tab-icon svg {
  display: block;
  width: 62%;
  height: 62%;
  fill: currentColor;
}
.watch-tab:hover .watch-tab-icon {
  color: var(--ink);
}
.site-footer {
  max-width: var(--page);
  margin: 0 auto;
  padding: 42px 6% 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 0.875rem;
  font-weight: 700;
}
.site-footer nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.copyright {
  flex-basis: 100%;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
  padding-top: 14px;
}
.not-found {
  min-height: 65vh;
}
.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
/* A SLIM BAR, NOT A CARD. The bar is legal furniture and it should read as furniture: one line of
   text and two answers on a single row from about 700px up, and a two row stack on a phone. It
   used to be a paragraph on a chunky pair of buttons, which measured 237px on a 320px phone and
   103px on a desktop, and a notice that size stops being furniture and starts being a takeover.

   The bar is capped and scrolls: at 200% text on a small phone an uncapped one filled the screen
   and buried the page behind it. src/client/consent.ts reserves its measured height at the foot
   of the body so the footer never sits underneath it. */
.consent-banner {
  position: fixed;
  inset: auto 0 0;
  z-index: 900;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 10px 6%;
  background: var(--butter);
  border-top: 3px solid var(--ink);
}
.consent-banner[hidden] {
  display: none;
}
.consent-banner:focus-visible {
  outline: 3px solid #075693;
  outline-offset: -8px;
}
/* The basis is what decides the two layouts, and it is the only thing that does. Wider than about
   700px there is room for the line and both answers, so nothing wraps; narrower, the line claims
   its own row and the answers drop under it. No media query is needed for either. */
.consent-copy {
  flex: 1 1 340px;
  max-width: 640px;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
}
/* Grows into whatever the line leaves, so the answers sit at the far end of the bar on a wide
   screen and at the right of their own row on a phone. */
.consent-actions {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
/* ONE RULE FOR BOTH ANSWERS, AND NO VARIANT. Same size, same fill, same weight, and the decline
   is first: see the note in src/components/consent-banner.ts. The site's own button, cut down to
   the bar's scale. These two sit at 44px rather than the 56px .button floor, because the bar has
   to read as furniture and a 56px pair pushes it back towards the card it replaced; 44px is the
   floor the site's smaller controls keep and it still clears WCAG 2.5.5 at AAA. The wobble is
   scaled, not flattened: a perfect pill would make the only two buttons a first time visitor
   meets the only two that are not in the site's hand drawn voice. The rest plus the lift equals
   the hover offset, as it does on .button, so the shadow's bottom edge stays put. */
.consent-actions .button {
  min-height: 44px;
  padding: 9px 18px;
  border-radius: 14px 17px 13px 19px;
  box-shadow: 0 3px 0 var(--ink);
  font-size: 0.875rem;
  cursor: pointer;
}
.consent-actions .button:hover {
  box-shadow: 0 6px 0 var(--ink);
}
.consent-choice {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}
.consent-choice[hidden] {
  display: none;
}
.consent-choice:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}
/* Eight places beside the logo need a little less room from here down, and less again near 960px,
   where the menu moves under the logo. Each step starts where the one above it stops fitting on
   one line, KEROTOWN ONLINE in full. */
@media (max-width: 1260px) {
  .site-header {
    gap: 18px;
  }
  .site-header nav {
    gap: 18px;
  }
}
@media (max-width: 1160px) {
  .site-header {
    gap: 14px;
  }
  .site-header nav {
    gap: 14px;
    font-size: 0.875rem;
  }
}
/* Just over 960px the eight places still fit on one line beside the logo, a little closer. */
@media (max-width: 1080px) {
  .site-header {
    gap: 10px;
  }
  .site-header nav {
    gap: 7px;
    font-size: 0.8125rem;
  }
  .site-header nav > a.nav-learn {
    padding: 0 11px;
  }
}
/* Two rows from here down: the logo, the Watch tab and the Discord tab on top, the eight places
   under them, spread across the whole width so every one shows on a 320px phone without sideways
   scrolling. Eight places and both tabs only fit beside the logo from 1261px (since 5 November
   2026, when the Discord tab joined the header; before, from 961px). */
@media (max-width: 1260px) {
  .site-header {
    flex-wrap: wrap;
    row-gap: 4px;
    padding: 14px 5% 6px;
  }
  /* 44 px tall like every other tap target in the menu (audit F24). */
  .site-header .watch-tab {
    margin-left: auto;
    min-height: 44px;
    padding: 0 14px 0 9px;
    gap: 7px;
    font-size: 0.8125rem;
  }
  .site-header nav {
    order: 3;
    flex-basis: 100%;
    justify-content: space-between;
    gap: 2px 10px;
    margin-left: 0;
    font-size: 0.875rem;
  }
  .site-header nav > a.nav-learn {
    padding: 0 12px;
  }
  .brand-name {
    font-size: 1.9rem;
  }
  .brand-frog {
    width: 45px;
    height: 47px;
  }
  .brand-name small {
    font-size: 0.5625rem;
  }
}
/* From 1261px the eight places share the line with the logo and both tabs, a little closer, and
   from 1361px the Discord tab has its word too; between them it shows only its mark, a 44px circle
   (its name shows as a tooltip, and the home page has the labelled button). From 1260px down it
   sits on the top row with Watch, with its word. */
@media (min-width: 1261px) {
  .site-header {
    padding-left: min(6%, 80px);
    padding-right: min(6%, 80px);
  }
  .site-header nav {
    gap: 20px;
  }
}
@media (min-width: 1261px) and (max-width: 1360px) {
  .site-header .discord-tab {
    padding: 0 8px;
  }
  .site-header .discord-tab-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
@media (max-width: 1260px) {
  .site-header .discord-tab {
    padding: 0 13px 0 8px;
    gap: 7px;
    font-size: 0.8125rem;
  }
}
/* On the narrowest phones the logo, Watch and the Discord mark share the top row, a little closer
   on a 320px phone. */
@media (max-width: 400px) {
  .site-header .discord-tab {
    padding: 0 8px;
  }
  .site-header .discord-tab-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
/* Just over 640px the eight places still fit one row under the logo, a little smaller. */
@media (min-width: 641px) and (max-width: 700px) {
  .site-header nav {
    font-size: 0.8125rem;
  }
}
/* Eight places do not fit one row on a phone or a small tablet, so they sit in a row of four over a
   row of four (Learn, Manga, Fan art, Characters over KEROTOWN, KEROTOWN ONLINE, Japan, Ideas),
   spread across the whole width, so the header stays two rows tall and the home page's first tiles
   stay on the first screen. KEROTOWN ONLINE stands as KEROTOWN over ONLINE, no wider than KEROTOWN
   and inside its 44px tap, so the header is no taller. Each column is as wide as its longest name,
   so Characters and KEROTOWN never clip, and every place is a 44px tap. The header is the size
   container, so the menu itself can change its columns: by the header's width in its own em, with
   text at 200% a place is never narrower than its longest name, so the places go three a row, two
   a row or one a row, and none runs into another. */
@media (max-width: 640px) {
  .site-header {
    container: site-header / inline-size;
  }
  .site-header nav {
    display: grid;
    grid-template-columns: repeat(4, auto);
    justify-content: space-between;
    justify-items: center;
    gap: 0 4px;
  }
  .site-header nav > a {
    justify-content: center;
    min-width: 44px;
  }
  /* Its current mark is one bar under both words: an underline under KEROTOWN would run into
     ONLINE. */
  .site-header nav > a.nav-online {
    flex-direction: column;
    gap: 0;
    width: min-content;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
  }
  .site-header nav > a.nav-online[aria-current] {
    text-decoration: none;
  }
  .site-header nav > a.nav-online[aria-current]::after {
    content: '';
    align-self: stretch;
    margin-top: 4px;
    border-top: 3px solid;
  }
  @container site-header (width < 18em) {
    .site-header nav {
      grid-template-columns: repeat(3, auto);
    }
  }
  @container site-header (width < 13.5em) {
    .site-header nav {
      grid-template-columns: repeat(2, auto);
    }
  }
  @container site-header (width < 10em) {
    .site-header nav {
      grid-template-columns: auto;
      justify-content: center;
    }
  }
}
@media (max-width: 360px) {
  .site-header nav {
    font-size: 0.8125rem;
  }
  .site-header nav > a.nav-learn {
    padding: 0 9px;
  }
  .brand-name {
    font-size: 1.7rem;
  }
}
/* Four places a row on a 320 px phone, with room to spare. */
@media (max-width: 340px) {
  .site-header {
    column-gap: 5px;
  }
  .site-header .watch-tab {
    padding: 0 11px 0 8px;
  }
  .site-header nav {
    gap: 0 2px;
    font-size: 0.75rem;
  }
  .site-header nav > a.nav-learn {
    padding: 0 8px;
  }
}
@media (max-width: 700px) {
  .section {
    padding: 48px 6%;
  }
  .section-heading {
    gap: 8px;
    margin-bottom: 20px;
  }
  .page-intro {
    padding-top: 28px;
    padding-bottom: 18px;
  }
  .site-footer {
    padding-top: 32px;
  }
  .site-footer nav {
    gap: 4px 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  :root {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
@media (forced-colors: active) {
  .button,
  .cast-card,
  .portrait,
  .manga-page,
  .manga-panel {
    box-shadow: none;
    border: 2px solid CanvasText;
  }
  a:focus-visible,
  summary:focus-visible,
  select:focus-visible,
  button:focus-visible {
    outline: 3px solid Highlight;
  }
}
/* How a drawing gets onto the art wall: Fan art and Draw. */
.share-steps {
  overflow-wrap: anywhere;
  display: grid;
  gap: 10px;
  margin: 18px 0 24px;
  padding: 0;
  list-style: none;
  counter-reset: share-step;
  font-size: 1rem;
  line-height: 1.5;
}
.share-steps li {
  position: relative;
  padding-left: 44px;
  counter-increment: share-step;
}
.share-steps li::before {
  content: counter(share-step);
  position: absolute;
  top: -2px;
  left: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #fffaf0;
  font-weight: 800;
}
.share-steps a {
  display: inline-block;
  padding: 4px 0;
  font-weight: 700;
  text-decoration: underline;
}
/* The Continue button: home, /learn/ and /study/. */
.continue-box {
  display: flex;
  justify-content: center;
  margin: 0 0 18px;
}
.continue-box[hidden] {
  display: none;
}
.continue-box .continue-go {
  max-width: 100%;
  text-align: left;
}
.continue-go span:first-child {
  flex-shrink: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.learn-room {
  --learn-bg: var(--butter);
  max-width: var(--page);
  margin: 10px auto 40px;
  padding: 30px 6% 48px;
  background: var(--learn-bg);
  border-block: 3px solid var(--ink);
}
.learn-room--katakana {
  --learn-bg: var(--blue);
  /* Darker text tones keep contrast on the blue background. */
  --muted: #3f3224;
  --red: #7f2219;
}
.learn-room--numbers {
  --learn-bg: #ffd9c2;
  --muted: #4a3a2a;
  --red: #8a2a1f;
}
.learn-room--index {
  --learn-bg: var(--butter);
}
.learn-room [hidden] {
  display: none !important;
}
.learn-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 18px;
}
.learn-intro h1 {
  font-size: clamp(2.3rem, 4.5vw, 3.8rem);
  margin-bottom: 12px;
}
.learn-intro h1 [lang='ja'] {
  font-family: 'Kero Japanese', var(--body);
  color: var(--red);
}
.learn-intro p:last-child {
  margin: 0;
  max-width: 46ch;
}
.learn-sticker {
  padding: 16px 22px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  transform: rotate(7deg);
  font: 1.3rem/1.1 var(--heading);
  flex-shrink: 0;
  text-align: center;
}
.learn-room--katakana .learn-sticker {
  background: var(--paper);
}
.learn-switch {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 4px 0 26px;
}
.learn-switch a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 18px;
  font-weight: 700;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: 0 3px 0 var(--ink);
}
.learn-switch a[aria-current='page'] {
  background: var(--ink);
  color: var(--paper);
}
.learn-switch [lang='ja'] {
  font-family: 'Kero Japanese', var(--body);
}

.learn-lesson {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  grid-template-areas:
    'guide cards'
    'guide nav';
  gap: 18px 28px;
  align-items: start;
}
.learn-guide {
  grid-area: guide;
  text-align: center;
}
.learn-sensei {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 50%;
}
.learn-guide h2 {
  font-size: 1.4rem;
  margin: 12px 0 4px;
}
.learn-count {
  margin: 0;
  font-weight: 700;
  color: var(--muted);
}
.learn-cards {
  grid-area: cards;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}
.learn-card {
  padding: 24px 28px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px 24px 18px 26px;
  box-shadow: 6px 6px 0 var(--ink);
}
.learn-card .eyebrow {
  color: var(--red);
  margin-bottom: 6px;
}
.learn-card h3 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin: 0 0 10px;
}
.learn-card h3:focus {
  outline: none;
}
.learn-card p {
  font-size: 1.1rem;
  margin: 0 0 14px;
  max-width: 60ch;
}
.learn-outro {
  font-weight: 700;
}
.learn-examples {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.learn-examples li {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 130px;
  flex: 1 1 130px;
  max-width: 260px;
  padding: 14px 12px;
  background: var(--butter);
  border: 2px solid var(--ink);
  border-radius: 14px;
  text-align: center;
}
.learn-room--katakana .learn-examples li {
  background: #d9f0f2;
}
.learn-jp {
  font:
    2.2rem/1.2 'Kero Japanese',
    var(--body);
  font-weight: 700;
}
.learn-romaji {
  font-weight: 700;
  color: var(--red);
}
.learn-meaning {
  font-size: 0.95rem;
  color: var(--muted);
}
.learn-nav {
  grid-area: nav;
  display: flex;
  gap: 12px;
}
.learn-nav .primary {
  flex: 1;
}

.learn-quiz {
  margin-top: 44px;
  padding: 26px 28px 30px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 24px 20px 26px 18px;
  box-shadow: 6px 6px 0 var(--ink);
  scroll-margin-top: 90px;
}
.learn-quiz-heading h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin: 0 0 6px;
}
.learn-quiz-heading p:last-child {
  margin: 0 0 18px;
}
.learn-question h3 {
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  margin: 0 0 14px;
}
.learn-question h3:focus,
.learn-results h3:focus {
  outline: none;
}
.learn-choices {
  display: grid;
  gap: 10px;
  max-width: 560px;
}
.learn-choice {
  min-height: 52px;
  padding: 10px 18px;
  font: 700 1.05rem/1.4 var(--body);
  color: var(--ink);
  text-align: left;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}
.learn-choice [lang='ja'] {
  font-family: 'Kero Japanese', var(--body);
  font-size: 1.25em;
}
.learn-choice:not(:disabled):hover {
  background: var(--butter);
  transform: translateY(-2px);
}
.learn-choice:disabled {
  cursor: default;
  opacity: 0.6;
}
.learn-choice.is-right {
  opacity: 1;
  background: #cfeccb;
}
.learn-choice.is-right::after {
  content: ' ✓';
}
.learn-choice.is-wrong {
  opacity: 1;
  background: #f6d2cc;
}
.learn-choice.is-wrong::after {
  content: ' ✗';
}
.learn-feedback {
  max-width: 560px;
  margin-top: 16px;
}
.learn-feedback p {
  margin: 0 0 12px;
}
.learn-verdict {
  font: 1.3rem/1.2 var(--heading);
  color: var(--red);
}
.learn-verdict.is-right {
  color: #2f7a35;
}
.learn-results {
  display: flex;
  align-items: center;
  gap: 24px;
}
.learn-result-kero {
  width: 140px;
  height: auto;
  flex-shrink: 0;
}
.learn-results h3 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0 0 14px;
  letter-spacing: 0.04em;
}
.learn-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.learn-result-actions [lang='ja'] {
  font-family: 'Kero Japanese', var(--body);
}
.learn-paper details {
  margin-bottom: 10px;
}

@media (max-width: 720px) {
  .learn-intro {
    flex-direction: column;
    align-items: flex-start;
  }
  .learn-sticker {
    display: none;
  }
  .learn-lesson {
    grid-template-columns: 1fr;
    grid-template-areas: 'guide' 'cards' 'nav';
  }
  .learn-guide {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
  }
  .learn-sensei {
    width: 84px;
  }
  .learn-guide h2 {
    margin: 0;
  }
  .learn-card,
  .learn-quiz {
    padding: 20px;
  }
  .learn-results {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .learn-choice:not(:disabled):hover {
    transform: none;
  }
}

/* ════ Lesson grid ════ */
.learn-back {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 14px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.learn-progress {
  margin: -8px 0 18px;
  font-weight: 700;
}
.learn-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.learn-tile {
  position: relative;
  display: grid;
  gap: 4px;
  height: 100%;
  padding: 18px 18px 16px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 18px 22px 16px 20px;
  box-shadow: 0 4px 0 var(--ink);
  transition:
    transform 0.18s,
    box-shadow 0.18s;
}
.learn-tile:hover {
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 0 7px 0 var(--ink);
}
.learn-tile--intro {
  background: var(--yellow);
}
.learn-tile-label {
  font: 700 0.8125rem/1.4 var(--body);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--red);
}
.learn-tile-kana {
  font:
    700 1.9rem/1.25 'Kero Japanese',
    var(--body);
  letter-spacing: 0.04em;
}
.learn-tile-title {
  font: 1.2rem/1.2 var(--heading);
}
.learn-tile-sub {
  color: var(--muted);
  font-size: 0.95rem;
}
.learn-tile--intro .learn-tile-sub,
.learn-tile--intro .learn-tile-label {
  color: var(--ink);
}
.learn-tile-badge:empty {
  display: none;
}
.learn-tile-badge {
  justify-self: start;
  margin-top: 6px;
  padding: 2px 10px;
  font-weight: 700;
  font-size: 0.85rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #cfeccb;
}
.learn-tile.is-next {
  outline: 4px solid var(--red);
  outline-offset: 3px;
}
.learn-tile.is-next .learn-tile-badge {
  background: var(--yellow);
}
.learn-how {
  margin-top: 36px;
  padding: 22px 26px;
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: 18px;
}
.learn-how h2 {
  font-size: 1.5rem;
  margin: 0 0 10px;
}
.learn-how ol {
  margin: 0 0 10px;
  padding-left: 1.3em;
}
.learn-how li + li {
  margin-top: 6px;
}
.learn-how p {
  margin: 0;
  color: var(--muted);
}

/* ════ Flash cards ════ */
.learn-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.learn-section-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}
.flash-cards {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}
.learn-flash--stepped .flash-cards {
  grid-template-columns: minmax(0, 460px);
  justify-content: center;
}
.flash-face {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 6px;
  width: 100%;
  min-height: 210px;
  padding: 20px;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 22px 18px 24px 20px;
  box-shadow: 6px 6px 0 var(--ink);
  cursor: pointer;
}
.flash-face:disabled {
  cursor: default;
  opacity: 1;
}
.learn-flash--stepped .flash-face {
  min-height: 300px;
}
.flash-kana {
  font:
    700 clamp(4.5rem, 12vw, 7rem)/1 'Kero Japanese',
    var(--body);
}
.flash-back {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}
.flash-romaji {
  font: 2rem/1 var(--heading);
  color: var(--red);
}
.flash-cue {
  max-width: 30ch;
  color: var(--muted);
}
.flash-hint {
  display: none;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--muted);
}
/* With JavaScript the back is hidden until the card is flipped. */
.learn-flash--stepped .flash-back {
  display: none;
}
.learn-flash--stepped .flash-hint {
  display: block;
}
.learn-flash--stepped .is-flipped .flash-back {
  display: grid;
}
.learn-flash--stepped .is-flipped .flash-hint {
  display: none;
}
.learn-flash--stepped .is-flipped .flash-face {
  background: var(--butter);
}
.learn-room--katakana .learn-flash--stepped .is-flipped .flash-face {
  background: #d9f0f2;
}
.learn-flash .learn-nav {
  max-width: 460px;
  margin: 0 auto;
}

/* ════ Multiple choice ════ */
.mc-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.mc-progress p {
  margin: 0;
  font-weight: 700;
  white-space: nowrap;
}
.mc-bar {
  flex: 1;
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  overflow: hidden;
}
.mc-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--yellow);
  transition: width 0.3s;
}
.mc-question {
  text-align: center;
}
.mc-prompt {
  margin: 0;
  font-weight: 700;
  color: var(--muted);
}
.mc-target {
  margin: 4px 0 18px;
  font: 2.6rem/1.2 var(--heading);
}
.mc-target:focus {
  outline: none;
}
.mc-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 520px;
  margin: 0 auto;
}
.mc-choice {
  min-height: 64px;
  padding: 10px;
  font: 1.6rem/1.2 var(--heading);
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
}
.mc-choice--kana {
  font:
    700 2.2rem/1.2 'Kero Japanese',
    var(--body);
}
.mc-choice:not(:disabled):hover {
  background: var(--butter);
  transform: translateY(-2px);
}
.mc-choice:disabled {
  cursor: default;
  opacity: 0.55;
}
.mc-choice.is-right {
  opacity: 1;
  background: #cfeccb;
}
.mc-choice.is-wrong {
  opacity: 1;
  background: #f6d2cc;
}
.mc-question .learn-feedback {
  margin: 18px auto 0;
}
.learn-paper-list {
  columns: 3;
  font-size: 1.1rem;
}

/* ════ Home page section ════ */
.learn-preview {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 40px;
  align-items: center;
  background: var(--butter);
  border-block: 3px solid var(--ink);
  margin-block: 35px 0;
}
.learn-preview [hidden] {
  display: none !important;
}
.learn-preview h2 span {
  color: var(--red);
}
.learn-resume {
  display: grid;
  gap: 10px;
  justify-items: start;
  font-weight: 700;
}
.learn-preview-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.learn-preview-card {
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 22px 20px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 22px 18px 24px 20px;
  box-shadow: 6px 6px 0 var(--ink);
  transform: rotate(-2deg);
  transition: transform 0.18s;
}
.learn-preview-card--katakana {
  background: #d9f0f2;
  transform: rotate(2deg);
}
.learn-preview-card:hover {
  transform: rotate(0) translateY(-4px);
}
.learn-preview-kana {
  font:
    700 clamp(2rem, 4vw, 2.8rem)/1.2 'Kero Japanese',
    var(--body);
}
.learn-preview-name {
  font: 1.5rem/1.2 var(--heading);
}
.learn-preview-name [lang='ja'] {
  white-space: nowrap;
  font-family: 'Kero Japanese', var(--body);
  color: var(--red);
  font-size: 0.85em;
}
.learn-preview-sub {
  color: var(--muted);
}
.learn-preview-go {
  margin-top: 6px;
  font-weight: 700;
}

@media (max-width: 860px) {
  .learn-preview {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .learn-preview-cards {
    grid-template-columns: 1fr;
  }
  .learn-paper-list {
    columns: 2;
  }
  .mc-choice {
    font-size: 1.35rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .learn-tile,
  .learn-preview-card,
  .mc-bar span {
    transition: none;
  }
  .learn-tile:hover,
  .learn-preview-card:hover,
  .mc-choice:not(:disabled):hover {
    transform: none;
  }
}

/* ════ Simpler lesson layout ════ */
.lesson-head {
  text-align: center;
  margin-bottom: 18px;
}
.lesson-head .eyebrow {
  margin-bottom: 4px;
  color: var(--red);
}
.lesson-head h1 {
  margin: 0;
  font:
    700 clamp(3rem, 9vw, 5.5rem)/1.1 'Kero Japanese',
    var(--heading);
  letter-spacing: 0.06em;
}
.battle-room .lesson-head h1 {
  font: clamp(2.4rem, 6vw, 4rem)/1.1 var(--heading);
  letter-spacing: 0;
}
.battle-vs {
  color: var(--red);
}
.lesson-romaji {
  margin: 4px 0 0;
  font: 1.3rem/1.3 var(--heading);
  letter-spacing: 0.08em;
  color: var(--muted);
}
.lesson-steps {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 28px;
}
.lesson-steps a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.lesson-steps b,
.step-title b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding-top: 0.1em;
}
.lesson-steps a {
  min-height: 46px;
  padding: 8px 18px;
  font-weight: 700;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
}
.lesson-steps b,
.step-title b {
  justify-content: center;
  width: 1.7em;
  height: 1.7em;
  font: 1rem/1 var(--heading);
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.step-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}
.learn-flash,
.learn-words,
.learn-draw {
  scroll-margin-top: 90px;
}
.learn-room .learn-quiz {
  margin-top: 36px;
}

/* Sound buttons */
.sound-button {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  font-size: 1.5rem;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}
.sound-button:hover {
  transform: translateY(-2px);
}
.flash-card {
  position: relative;
}
.flash-sound {
  position: absolute;
  top: 14px;
  right: 14px;
}
.flash-card audio {
  width: 100%;
  margin-top: 8px;
}
.mc-target-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.mc-target-row .mc-target {
  margin-bottom: 18px;
}
.mc-target-row .sound-button {
  margin-bottom: 18px;
}

/* ════ Stroke order ════ */
.learn-draw {
  margin-top: 36px;
  padding: 26px 28px 22px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px 26px 18px 24px;
  box-shadow: 6px 6px 0 var(--ink);
}
.draw-picker {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.draw-picker button {
  width: 58px;
  height: 58px;
  font:
    700 1.8rem/1 'Kero Japanese',
    var(--body);
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}
.draw-picker button[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
}
.draw-stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}
.draw-demo,
.draw-pad {
  margin: 0;
  display: grid;
  gap: 10px;
  justify-items: center;
}
.draw-demo svg,
.draw-paper {
  width: min(100%, 320px);
  aspect-ratio: 1;
  background:
    linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat,
    linear-gradient(var(--line), var(--line)) center / 1px 100% no-repeat,
    #fff;
  border: 3px solid var(--ink);
  border-radius: 16px;
}
.draw-demo figcaption,
.draw-pad figcaption {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  font-weight: 700;
}
.draw-under {
  fill: none;
  stroke: #efe4cb;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.draw-stroke {
  fill: none;
  stroke: var(--ink);
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw-stroke 0.9s ease-in-out forwards;
  animation-delay: calc(var(--s) * 1s + 0.3s);
}
.draw-number {
  opacity: 0;
  animation: draw-number 0.2s forwards;
  animation-delay: calc(var(--s) * 1s + 0.3s);
}
.draw-number circle {
  fill: var(--red);
}
.draw-number text {
  font: 700 6.5px/1 var(--body);
  fill: #fff;
}
/* Stroke timing by class, because the live security policy blocks inline styles. */
.draw-s0 {
  --s: 0;
}
.draw-s1 {
  --s: 1;
}
.draw-s2 {
  --s: 2;
}
.draw-s3 {
  --s: 3;
}
.draw-s4 {
  --s: 4;
}
.draw-s5 {
  --s: 5;
}
@keyframes draw-stroke {
  to {
    stroke-dashoffset: 0;
  }
}
@keyframes draw-number {
  to {
    opacity: 1;
  }
}
.draw-paper {
  position: relative;
  overflow: hidden;
}
.draw-guide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.draw-guide path {
  fill: none;
  stroke: #e9dcc0;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.draw-paper canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}
.draw-credit {
  margin: 18px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}
.draw-credit a {
  text-decoration: underline;
}

/* ════ Battle ════ */
.battle-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 26px;
  padding: 14px 20px;
  background: var(--red);
  color: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 5px 0 var(--ink);
  font: 1.6rem/1.2 var(--heading);
  text-align: center;
  transition: transform 0.18s;
}
.battle-banner:hover {
  transform: translateY(-3px) rotate(-1deg);
}
.battle-banner span {
  display: grid;
  font-family: var(--body);
  font-weight: 700;
  font-size: 1rem;
}
.battle-banner b {
  font: 1.8rem/1.1 var(--heading);
}
.battle-banner img {
  width: 90px;
  height: 90px;
  object-fit: contain;
}
.battle-banner-sensei {
  border: 3px solid var(--ink);
  border-radius: 50%;
  object-fit: cover !important;
  object-position: top;
  background: var(--paper);
}
.battle-stage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto 18px;
  padding: 18px 18px 26px;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(57, 44, 32, 0.15) 0 40%, transparent 41%),
    linear-gradient(#fff6dc, var(--paper));
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
}
.fighter {
  display: grid;
  gap: 8px;
  justify-items: center;
}
.fighter-art {
  width: min(100%, 220px);
  height: 220px;
  object-fit: contain;
}
.fighter--sensei .fighter-art {
  width: min(100%, 180px);
  object-fit: cover;
  object-position: top;
  border: 3px solid var(--ink);
  border-radius: 20px;
}
.hp {
  display: grid;
  gap: 4px;
  width: min(100%, 200px);
  margin: 0;
  font-weight: 700;
}
.hp-bar {
  display: block;
  height: 14px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}
.hp-bar span {
  display: block;
  height: 100%;
  width: 100%;
  background: #4caf50;
  transition: width 0.4s;
}
.fighter--sensei .hp-bar span {
  background: var(--red);
}
.battle-bubble {
  align-self: center;
  display: grid;
  justify-items: center;
  gap: 8px;
}
.battle-kana {
  display: grid;
  place-items: center;
  width: 130px;
  height: 130px;
  margin: 0;
  font:
    700 4.5rem/1 'Kero Japanese',
    var(--body);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 5px 0 var(--ink);
}
.battle-kana.is-new {
  animation: battle-pop-in 0.35s ease-out;
}
.fighter--kero.is-attacking .fighter-art {
  animation: kero-lunge 0.6s ease-in-out;
}
.fighter--sensei.is-attacking .fighter-art {
  animation: sensei-lunge 0.6s ease-in-out;
}
.fighter.is-hit .fighter-art {
  animation: fighter-shake 0.5s 0.25s ease-in-out;
}
.battle-pop {
  position: absolute;
  top: 30%;
  margin: 0;
  font: 2rem/1 var(--heading);
  color: var(--red);
  opacity: 0;
  pointer-events: none;
}
.battle-pop[data-side='sensei'] {
  right: 18%;
}
.battle-pop[data-side='kero'] {
  left: 18%;
}
.battle-pop.is-popping {
  animation: damage-float 1s ease-out;
}
.battle-choices {
  margin-bottom: 10px;
}
.battle-log {
  min-height: 1.6em;
  margin: 8px 0 0;
  font-weight: 700;
  text-align: center;
}
.battle-using {
  margin: 4px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
.battle-won .fighter--sensei .fighter-art {
  transform: rotate(80deg) translateY(30px);
  transition: transform 0.6s;
}
.battle-lost .fighter--kero .fighter-art {
  transform: rotate(-80deg) translateY(30px);
  transition: transform 0.6s;
}
.battle-room .learn-results {
  justify-content: center;
  text-align: center;
}
.battle-room .learn-result-actions {
  justify-content: center;
}
@keyframes kero-lunge {
  40% {
    transform: translateX(90px) rotate(12deg);
  }
}
@keyframes sensei-lunge {
  40% {
    transform: translateX(-90px) rotate(-8deg);
  }
}
@keyframes fighter-shake {
  20%,
  60% {
    translate: -10px 0;
  }
  40%,
  80% {
    translate: 10px 0;
  }
}
@keyframes damage-float {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-40px);
  }
}
@keyframes battle-pop-in {
  0% {
    transform: scale(0.4);
  }
  70% {
    transform: scale(1.1);
  }
}

@media (max-width: 640px) {
  .battle-stage {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 'bubble bubble' 'kero sensei';
  }
  .battle-bubble {
    grid-area: bubble;
  }
  .fighter--kero {
    grid-area: kero;
  }
  .fighter--sensei {
    grid-area: sensei;
  }
  .fighter-art {
    height: 140px;
  }
  .battle-kana {
    width: 104px;
    height: 104px;
    font-size: 3.6rem;
  }
  .battle-banner img {
    width: 60px;
    height: 60px;
  }
  .learn-draw {
    padding: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .draw-stroke {
    animation: none;
    stroke-dashoffset: 0;
  }
  .draw-number {
    animation: none;
    opacity: 1;
  }
  .battle-kana.is-new,
  .fighter .fighter-art,
  .battle-pop.is-popping {
    animation: none !important;
  }
  .battle-pop.is-popping {
    opacity: 1;
  }
  .battle-banner,
  .hp-bar span {
    transition: none;
  }
}

/* ════ Read words ════ */
.learn-words {
  margin-top: 36px;
  padding: 26px 28px 26px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 24px 18px 22px 20px;
  box-shadow: 6px 6px 0 var(--ink);
  text-align: center;
}
.learn-words .step-title {
  justify-content: flex-start;
}
.word-card {
  display: grid;
  justify-items: center;
  gap: 4px;
  margin: 6px auto 14px;
}
.word-art {
  width: 120px;
  height: 120px;
  object-fit: contain;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 18px;
}
.word-meaning {
  margin: 0;
  font: 1.4rem/1.2 var(--heading);
}
.word-tiles {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 4px;
}
.word-tiles:focus {
  outline: none;
}
.word-tile {
  display: grid;
  place-items: center;
  width: 72px;
  height: 80px;
  font:
    700 2.8rem/1 'Kero Japanese',
    var(--body);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--ink);
}
.word-tile.is-blank {
  color: var(--red);
  background: var(--butter);
  border-style: dashed;
}
.word-tile.is-filled {
  background: #cfeccb;
  animation: battle-pop-in 0.35s ease-out;
}
.word-romaji {
  margin: 4px 0 6px;
  font: 1.4rem/1.2 var(--heading);
  letter-spacing: 0.08em;
  color: var(--muted);
}
.learn-words .learn-results {
  justify-content: center;
}
.learn-words .learn-result-actions {
  justify-content: center;
}
.word-list {
  list-style: none;
  padding: 0;
  font-size: 1.2rem;
}
@media (max-width: 520px) {
  .word-tile {
    width: 54px;
    height: 62px;
    font-size: 2.1rem;
  }
  .word-tiles {
    gap: 5px;
  }
  .learn-words {
    padding: 20px 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .word-tile.is-filled {
    animation: none;
  }
}

/* ════ Next lesson ════ */
.lesson-next {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

/* ════ In this lesson: a plain table under the games (docs/pm-audit.md C6) ════ */
.lesson-table {
  max-width: 760px;
  margin: 36px auto 0;
}
.lesson-table h2 {
  margin: 0 0 12px;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
}
.lesson-table table {
  width: 100%;
  border-collapse: collapse;
  background: var(--paper);
  border: 2px solid var(--ink);
  font-size: 0.95rem;
}
.lesson-table th,
.lesson-table td {
  padding: 8px 6px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.lesson-table td:nth-child(3),
.lesson-table td:nth-child(4) {
  overflow-wrap: anywhere;
}
.lesson-table th:first-child,
.lesson-table td:nth-child(2) {
  white-space: nowrap;
}
.lesson-table thead th {
  border-top: 0;
  background: var(--ink);
  color: #fff;
  font-size: 0.85rem;
}
.lesson-table tbody th {
  font-size: 1.6rem;
  line-height: 1.1;
  text-align: center;
}
.lesson-table p {
  margin: 12px 0 0;
}
.learn-chart-link {
  display: flex;
  justify-content: center;
  margin: 22px 0 0;
}
.manga-word-links {
  max-width: 760px;
  margin: 28px auto 0;
  padding: 16px 18px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
}
.manga-word-links h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
}
.manga-word-links ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.manga-word-links a {
  display: inline-block;
  min-height: 44px;
  padding: 10px 0;
  font-weight: 700;
  text-decoration: underline;
}

/* ════ The kana chart: tap to hear, and printable ════ */
.kana-chart-room h1 {
  font-family: var(--heading);
  font-size: clamp(2.2rem, 9vw, 3.6rem);
  line-height: 1;
}
.kana-chart-line {
  max-width: 34rem;
  margin-inline: auto;
}
.kana-chart-wrap {
  max-width: 640px;
  margin: 18px auto 0;
}
.kana-chart {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  table-layout: fixed;
}
.kana-chart thead th {
  font-size: 0.9rem;
  color: var(--muted);
}
.kana-chart .kana-chart-lesson {
  width: 3.4em;
  font-size: 0.7rem;
}
.kana-chart tbody th {
  text-align: center;
}
.kana-chart tbody th a {
  display: inline-grid;
  place-items: center;
  min-width: 32px;
  min-height: 44px;
  font-weight: 800;
}
.kana-chart td {
  padding: 0;
}
.chart-cell {
  display: grid;
  justify-items: center;
  width: 100%;
  min-height: 56px;
  padding: 6px 2px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.chart-cell:hover,
.chart-cell:focus-visible {
  background: var(--yellow);
}
.chart-kana {
  font-size: clamp(1.4rem, 6vw, 2rem);
  line-height: 1.1;
}
.chart-romaji {
  font-size: 0.8rem;
  font-weight: 700;
}
.kana-chart-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}
@media print {
  .site-header,
  .site-footer,
  .consent-banner,
  .skip-link,
  .learn-back,
  .kana-chart-actions {
    display: none !important;
  }
  .kana-chart-room {
    margin: 0;
    padding: 0;
    border: 0;
    background: #fff;
  }
  .chart-cell {
    background: #fff;
  }
}

/* ════ Learn landing ════ */
.learn-picks {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.learn-pick {
  display: grid;
  gap: 6px;
  height: 100%;
  padding: 26px 22px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 22px 18px 24px 20px;
  box-shadow: 6px 6px 0 var(--ink);
  transition: transform 0.18s;
}
.learn-pick:hover {
  transform: translateY(-4px) rotate(-1deg);
}
.learn-pick--katakana {
  background: #d9f0f2;
}
.learn-pick--numbers {
  background: #ffe9dc;
}
.learn-pick-big {
  font:
    700 clamp(2.2rem, 5vw, 3rem)/1.15 'Kero Japanese',
    var(--heading);
}
.learn-pick-title {
  font: 1.7rem/1.2 var(--heading);
}
.learn-pick-sub {
  font-weight: 700;
  color: var(--muted);
}

/* ════ Numbers and time ════ */
.learn-group + .learn-group {
  margin-top: 28px;
}
.learn-group-title {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 2rem);
}
.learn-room--numbers .learn-tile-title {
  font-size: 1.35rem;
}
.learn-room--numbers .learn-tile-sub[lang='ja'] {
  font-family: 'Kero Japanese', var(--body);
}
.lesson-head .lesson-title {
  font: clamp(2.4rem, 7vw, 4rem)/1.1 var(--heading);
  letter-spacing: 0;
}
.lesson-jp {
  font-family: 'Kero Japanese', var(--body);
  letter-spacing: 0.04em;
}
.time-prompt {
  display: grid;
  justify-items: center;
  gap: 6px;
}
.time-prompt--number {
  font: clamp(3.5rem, 11vw, 5.5rem)/1 var(--heading);
}
.time-prompt-visual {
  display: grid;
  place-items: center;
}
.learn-art {
  width: 120px;
  height: 120px;
  object-fit: contain;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 18px;
}
.time-prompt-text {
  font: 1.7rem/1.2 var(--heading);
}
.clock {
  width: 130px;
  height: 130px;
}
.clock-face {
  fill: #fff;
  stroke: var(--ink);
  stroke-width: 4;
}
.clock-tick {
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
}
.clock-tick--big {
  stroke-width: 3.5;
}
.clock-hour,
.clock-minute {
  stroke: var(--ink);
  stroke-linecap: round;
}
.clock-hour {
  stroke-width: 6;
}
.clock-minute {
  stroke: var(--red);
  stroke-width: 4;
}
.clock-pin {
  fill: var(--ink);
}
.flash-jp {
  font:
    700 clamp(2.4rem, 8vw, 3.4rem)/1.15 'Kero Japanese',
    var(--body);
}
.mc-choice-main {
  display: block;
}
.mc-choice-main[lang='ja'] {
  font:
    700 1.6rem/1.25 'Kero Japanese',
    var(--body);
}
.learn-quiz .mc-choice {
  font-size: 1.25rem;
}
.battle-kana--text {
  width: auto;
  min-width: 130px;
  height: auto;
  min-height: 130px;
  padding: 12px 18px;
  border-radius: 28px;
  font: 1.6rem/1.2 var(--heading);
  text-align: center;
}
.battle-kana .time-prompt-text {
  font-size: 1rem;
}
.battle-show-main {
  display: block;
}
.battle-kana--text .battle-show-main:not(:has(*)) {
  font-size: 2rem;
  line-height: 1.1;
}
/* How a number's reading is said, under what Sensei shows. */
.battle-romaji {
  display: block;
  margin-top: 4px;
  font: 1.3rem/1.2 var(--heading);
  color: var(--red);
}
/* The kana battle shows a sound in romaji: letters, a little smaller than a kana. */
.battle-kana--sound {
  font: 3.3rem/1 var(--heading);
}
@media (max-width: 640px) {
  .battle-kana--sound {
    font-size: 2.7rem;
  }
}
.battle-kana .clock {
  width: 92px;
  height: 92px;
}
.learn-preview-card--numbers {
  background: #ffe9dc;
  transform: rotate(-1deg);
}
@media (max-width: 520px) {
  .clock {
    width: 110px;
    height: 110px;
  }
  .time-prompt-text {
    font-size: 1.4rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .learn-pick {
    transition: none;
  }
  .learn-pick:hover {
    transform: none;
  }
}

/* Long "Next lesson: …" labels wrap on narrow phones instead of pushing the page wide. */
.learn-room .button {
  text-align: center;
}
.learn-room .button > span:first-child {
  flex-shrink: 1;
  min-width: 0;
}

.learn-quiz .mc-target-row {
  flex-wrap: wrap;
}
.sound-button--big {
  width: 96px;
  height: 96px;
  font-size: 2.6rem;
  margin-bottom: 18px;
}

/* ════ Drawn visuals ════ */
.speaker-icon {
  width: 26px;
  height: 26px;
}
.speaker-body {
  fill: var(--ink);
}
.speaker-waves {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-linecap: round;
}
.sound-button--big .speaker-icon {
  width: 48px;
  height: 48px;
}
.visual {
  display: block;
}
.visual--calendar {
  width: 110px;
  height: 110px;
}
.cal-page {
  fill: #fff;
  stroke: var(--ink);
  stroke-width: 3;
}
.cal-top {
  fill: var(--red);
  stroke: var(--ink);
  stroke-width: 3;
}
.cal-ring {
  stroke: var(--ink);
  stroke-width: 4;
  stroke-linecap: round;
}
.cal-day {
  font: 30px var(--heading);
  fill: var(--ink);
}
.visual--days,
.visual--span,
.visual--week {
  width: 250px;
  max-width: 100%;
  height: auto;
}
.tl-label {
  font: 700 11px var(--body);
  fill: var(--red);
}
.tl-box {
  fill: #fff;
  stroke: var(--ink);
  stroke-width: 2.5;
}
.tl-box--on {
  fill: var(--yellow);
}
.tl-today {
  fill: var(--red);
}
.tl-tick {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.clock-wedge {
  fill: var(--yellow);
  stroke: var(--ink);
  stroke-width: 1.5;
}
.clock-question {
  font: 48px var(--heading);
  fill: var(--red);
}
.battle-kana .learn-art,
.battle-kana .visual--calendar {
  width: 84px;
  height: 84px;
}
.battle-kana .visual--days,
.battle-kana .visual--span,
.battle-kana .visual--week {
  width: 150px;
}
@media (max-width: 520px) {
  .learn-art,
  .word-art,
  .visual--calendar {
    width: 96px;
    height: 96px;
  }
}

/* ════ The learning path (home page and /learn/) ════ */
.learn-path {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
  counter-reset: none;
}
.learn-path-step {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    'number big go'
    'number title go'
    'number line go'
    'number size go';
  column-gap: 14px;
  row-gap: 2px;
  align-items: center;
  padding: 16px 18px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 22px 18px 24px 20px;
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 0.18s;
}
a.learn-path-step:hover {
  transform: translateY(-3px);
}
.learn-path-step--katakana {
  background: #d9f0f2;
}
.learn-path-step--numbers {
  background: #ffe9dc;
}
.learn-path-step--vocab {
  background: #ece4f7;
}
.learn-path-step--study {
  background: #e6f5dc;
}
.learn-path-step--food {
  background: #fff0cb;
}
.learn-path-number {
  grid-area: number;
  align-self: start;
  display: inline-grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  padding-top: 0.1em;
  font: 1.3rem/1 var(--heading);
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.learn-path-step.is-done .learn-path-number {
  background: #9ccf7f;
}
.learn-path-big {
  grid-area: big;
  font:
    700 clamp(1.6rem, 5vw, 2.2rem)/1.15 'Kero Japanese',
    var(--heading);
}
.learn-path-title {
  grid-area: title;
  margin: 0;
  font: 1.45rem/1.15 var(--heading);
}
.learn-path-line {
  grid-area: line;
  line-height: 1.35;
}
.learn-path-size {
  grid-area: size;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted, #4a3a2a);
}
.learn-path-go {
  grid-area: go;
  font: 1.6rem/1 var(--heading);
}
.learn-preview--path {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
}
.learn-preview--path .learn-path {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.learn-path-does {
  grid-area: does;
  margin-top: 2px;
  font-size: 0.9375rem;
  line-height: 1.35;
  color: var(--muted, #4a3a2a);
}
.learn-room--index .learn-path {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 8px 0 0;
}
.learn-room--index .learn-path-step {
  height: 100%;
  grid-template-areas:
    'number big go'
    'number title go'
    'number line go'
    'number does go'
    'number size go';
  align-content: start;
}
.learn-room--index .continue-box {
  margin: 12px 0 0;
}
.learn-steps-title {
  margin: 34px 0 16px;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

/* ════ /learn/: Kero at his desk ════ */
.learn-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
}
.learn-hero h1 {
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  margin-bottom: 14px;
}
.learn-hero-copy > p:not(.eyebrow) {
  max-width: 40ch;
}
.learn-order {
  padding: 10px 14px;
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: 14px;
  font-weight: 700;
  line-height: 1.4;
}
.learn-saved {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}
.learn-order {
  margin: 18px 0 8px;
}
.learn-new {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0;
  font-weight: 700;
}
/* The way into the games, part of Learn: a plain link under the order, not a second button. */
.learn-to-games {
  margin-bottom: 2px;
}
/* A returning learner's Continue button is the one yellow button; the newcomer's start goes white. */
.learn-hero-copy:has(.continue-box:not([hidden])) .learn-new .button {
  background: var(--paper);
}
.study-scene {
  margin: 0;
  min-width: 0;
}
.study-scene-inner {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  border: 3px solid var(--ink);
  border-radius: 26px 22px 28px 24px;
  box-shadow: 6px 6px 0 var(--ink);
  background: #f6e7c8;
  transform: rotate(1deg);
}
.study-scene-inner picture,
.study-scene-room,
.study-scene-desk,
.study-scene-sheet {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.study-scene-room,
.study-scene-desk img {
  display: block;
  width: 100%;
  height: 100%;
  /* The room is drawn a hair wider than 3:2: fill the frame without stretching it. */
  object-fit: cover;
}
/* Kero stands behind the desk; the desk's back edge is at 66.5% of the room's height. */
.study-scene-kero {
  position: absolute;
  left: 33.5%;
  top: 38%;
  width: 33%;
  height: auto;
  animation: kero-reads 3.2s ease-in-out infinite;
  transform-origin: 50% 100%;
}
/* The same room again, drawn only below the desk's back edge, in front of Kero. */
.study-scene-desk {
  clip-path: inset(66.5% 0 0 0);
}
.study-scene-sheet path {
  fill: none;
  stroke: #3f3226;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  animation: kana-write 0.42s ease-in backwards;
}
.study-scene figcaption {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: right;
}
.study-scene figcaption a {
  text-decoration: underline;
  white-space: nowrap;
}
@keyframes kero-reads {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  45% {
    transform: translateY(-4%) rotate(-2deg);
  }
  60% {
    transform: translateY(-3%) rotate(1.5deg);
  }
}
@keyframes kana-write {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@media (max-width: 860px) {
  .learn-room--index .learn-path {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 700px) {
  .learn-hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .study-scene {
    order: -1;
    width: 100%;
    max-width: 520px;
    margin-inline: auto;
  }
}
/* On a phone the picture shows the right three quarters of the room: Kero and the sheet. */
@media (max-width: 560px) {
  .study-scene-inner {
    aspect-ratio: 9 / 8;
    transform: none;
  }
  .study-scene-inner > picture,
  .study-scene-desk,
  .study-scene-sheet {
    width: 133.4%;
    left: -33.4%;
  }
  .study-scene-kero {
    left: calc(33.5% * 1.334 - 33.4%);
    width: calc(33% * 1.334);
  }
}

/* ════ The home page's short Learn block ════ */
.learn-preview--compact {
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  margin-top: 40px;
  padding-block: 48px;
}
.learn-preview--compact h2 {
  margin-bottom: 14px;
}
.learn-preview--compact .learn-preview-copy > p {
  max-width: 36ch;
  font-weight: 700;
}
/* Two steps a row up to tablets (four in a row squeezed the names), wider cards beside the copy
   on a desktop. */
.learn-path--compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 901px) {
  .learn-path--compact {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  }
}
.learn-path--compact .learn-path-step {
  grid-template-areas:
    'number title go'
    'number size go';
  padding: 12px 14px;
}
.learn-path--compact .learn-path-number {
  align-self: center;
}
.learn-path--compact .learn-path-title {
  font-size: 1.25rem;
}
@media (max-width: 900px) {
  .learn-preview--compact {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
}
/* On phones the number and arrow share the top line and the name gets the card's full width, so
   names such as "Hiragana" keep whole words from 320 px up. */
@media (max-width: 560px) {
  .learn-path--compact {
    gap: 10px;
  }
  .learn-path--compact .learn-path-step {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      'number go'
      'title title'
      'size size';
    row-gap: 4px;
    padding: 10px 12px;
  }
  .learn-path--compact .learn-path-number {
    justify-self: start;
    width: 2rem;
    height: 2rem;
    font-size: 1.1rem;
  }
  .learn-path--compact .learn-path-go {
    font-size: 1.3rem;
  }
  .learn-path--compact .learn-path-title {
    font-size: 1.15rem;
  }
}
.learn-games {
  margin-top: 40px;
}
.learn-games .section-heading h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}
@media (max-width: 900px) {
  .learn-preview--path {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .learn-preview--path .learn-path {
    grid-template-columns: 1fr;
  }
  .learn-path-step {
    padding: 14px 14px;
    column-gap: 10px;
  }
}

/* One stroke after another, in stroke order: あ い う え お. */
.study-scene-sheet .stroke-0 {
  animation-delay: 0.8s;
}
.study-scene-sheet .stroke-1 {
  animation-delay: 1.25s;
}
.study-scene-sheet .stroke-2 {
  animation-delay: 1.7s;
}
.study-scene-sheet .stroke-3 {
  animation-delay: 2.15s;
}
.study-scene-sheet .stroke-4 {
  animation-delay: 2.6s;
}
.study-scene-sheet .stroke-5 {
  animation-delay: 3.05s;
}
.study-scene-sheet .stroke-6 {
  animation-delay: 3.5s;
}
.study-scene-sheet .stroke-7 {
  animation-delay: 3.95s;
}
.study-scene-sheet .stroke-8 {
  animation-delay: 4.4s;
}
.study-scene-sheet .stroke-9 {
  animation-delay: 4.85s;
}
.study-scene-sheet .stroke-10 {
  animation-delay: 5.3s;
}
.study-scene-sheet .stroke-11 {
  animation-delay: 5.75s;
}

/* ════ /kerotown/: KEROTOWN, Kero's game, and the way to Google Play ════ */
.kerotown-site h2 > span {
  color: var(--red);
}
/* Headings shrink to fit their box rather than break a word in two, which at 200% text on a phone
   split KEROTOWN, DOMINATION and Japanese down the middle. 21vw keeps Japanese, the longest h2
   word at 4.0em, inside a 320 px screen. */
.kerotown-site h2 {
  font-size: min(clamp(2.5rem, 4.5vw, 4rem), 21vw);
}
.kerotown-heading {
  margin-bottom: 28px;
}
.kerotown-heading h2 {
  margin-bottom: 10px;
}
.kerotown-heading p,
.kerotown-section-line {
  max-width: 40rem;
  margin-bottom: 0;
  font-size: 1.125rem;
  line-height: 1.5;
}
.kerotown-note {
  margin: 22px 0 0;
  font-weight: 700;
}

/* ── The hero: on a phone the store button comes straight after the lead, so it is on the first
   screen above the cookie bar, then the facts and the picture (audit F04); on a wide screen the
   picture moves to the right of the words ── */
.kerotown-hero {
  container-type: inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding-top: 32px;
  padding-bottom: 40px;
}
.kerotown-hero .eyebrow {
  color: var(--red);
  margin-bottom: 8px;
}
/* KEROTOWN. is 5.25em wide: never more than its column, so the name and its full stop stay whole. */
.kerotown-hero h1 {
  margin-bottom: 14px;
  font-size: min(clamp(3rem, 7vw, 6rem), 18cqi);
}
.kerotown-hero h1 span {
  color: var(--red);
}
.kerotown-lead {
  max-width: 34rem;
  font-size: 1.1875rem;
  line-height: 1.5;
}
.kerotown-facts {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
}
.kerotown-facts li {
  padding: 4px 14px;
  background: var(--butter);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 700;
}
.kerotown-facts li:first-child {
  background: #9bd8ae;
}
/* The town in a postcard frame, with the site's own Kero cutout stepping out of it. */
.kerotown-hero-art {
  position: relative;
  min-width: 0;
  margin: 4px 0 40px;
}
.kerotown-hero .kerotown-lead {
  margin-bottom: 20px;
}
.kerotown-frame {
  display: block;
  padding: 8px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 6px;
  box-shadow: 5px 7px 0 #b88e46;
  transform: rotate(1.5deg);
}
.kerotown-frame img,
.kerotown-shot img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.kerotown-kero {
  position: absolute;
  width: 24%;
  left: -3%;
  bottom: -14%;
  transform: rotate(-10deg);
}

/* ── The links under the hero: each part of a long page one tap away. Every link is at least
   44px tall, and they wrap, so nothing is hidden off the side of a phone ── */
.kerotown-jump {
  padding-top: 0;
  padding-bottom: 12px;
}
.kerotown-jump ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.kerotown-jump a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 16px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 2px 3px 0 var(--ink);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.kerotown-jump a:hover {
  background: var(--butter);
}
.kerotown-jump a:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 2px;
}

/* ── Dates to know: what happens in small capitals, the day in the heading's big letters ── */
.kerotown-dates {
  padding-top: 28px;
  padding-bottom: 28px;
}
.kerotown-dates h2 {
  margin-bottom: 22px;
}
.kerotown-date-list {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
}
.kerotown-date {
  container-type: inline-size;
  padding: 18px 20px 20px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 22px 18px 24px 17px;
  box-shadow: 5px 5px 0 var(--ink);
}
.kerotown-date--demo {
  background: #d9f0e0;
}
.kerotown-date--release {
  background: var(--butter);
}
.kerotown-date--web {
  background: #d7eef0;
}
.kerotown-date h3 {
  margin: 0 0 10px;
}
.kerotown-date-what {
  display: block;
  margin-bottom: 6px;
  font-family: var(--body);
  font-size: 0.9375rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.3;
  text-transform: uppercase;
}
/* The longest day, Saturday 21 November, is two lines in a narrow card and never a split word.
   November, its longest word, is 4.36em wide: 21cqi keeps it inside its card at 200% text, on a
   phone and three cards a row on a tablet alike. */
.kerotown-date-when {
  display: block;
  font-size: min(clamp(1.875rem, 5vw, 2.5rem), 21cqi);
  line-height: 1.05;
}
.kerotown-date p {
  margin: 0;
  font-size: 1.0625rem;
}
.kerotown-date .text-link {
  margin-top: 8px;
}

/* ── The stores: Google Play's and the App Store's own badges, side by side ── */
.kerotown-store {
  display: grid;
  justify-items: start;
  gap: 12px;
}
.store-links--big {
  gap: 14px;
}
/* The pre-registrations, straight under the button: one size, the total in red. */
.kerotown-prereg {
  max-width: 30rem;
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.45;
}
.kerotown-prereg strong {
  color: var(--red);
}

/* ── The site's ink card round a capture ── */
.kerotown-shot {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  background: var(--blue);
  border: 3px solid var(--ink);
  border-radius: 18px 16px 20px 15px;
  box-shadow: 4px 4px 0 var(--ink);
}

/* ── A word the game shows: hiragana, romaji and English ── */
.kerotown-word {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  line-height: 1.3;
}
/* A word is never broken across two lines: at 200% text on a small phone a long one shrinks to the
   screen instead (ちょうちんおばけ is eight kana). */
.kerotown-word b {
  font:
    700 min(1.375rem, 8.5vw) / 1.3 'Kero Japanese',
    sans-serif;
  white-space: nowrap;
  color: var(--red);
}
.kerotown-site p span[lang='ja'] {
  white-space: nowrap;
}
.kerotown-romaji {
  font-weight: 700;
}
.kerotown-english {
  font-size: 0.9375rem;
  color: var(--muted);
}
.kerotown-word--card {
  display: grid;
  justify-items: center;
  min-width: 96px;
  height: 100%;
  padding: 8px 12px 10px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 14px 12px 15px 13px;
  box-shadow: 0 3px 0 var(--ink);
  text-align: center;
}
.kerotown-word--card b {
  font-size: min(1.625rem, 8vw);
}
.kerotown-word--card .kerotown-english {
  color: var(--ink);
}

/* ── The fighters: the game's own picker beside what each power does ── */
.kerotown-fighters {
  padding-top: 40px;
}
.kerotown-fighters-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}
.kerotown-fighter-list,
.kerotown-mode-list,
.kerotown-map-list,
.kerotown-rungs,
.kerotown-word-list,
.kerotown-way-list,
.kerotown-safe-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.kerotown-fighter-list {
  display: grid;
  gap: 14px;
}
/* The name and its power badge share a line while they fit, and the badge drops under the name when
   they do not (200% text on a small phone), so a name is never split. */
.kerotown-fighter {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 12px;
  padding: 14px 18px 16px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px 18px 22px 17px;
  box-shadow: 4px 4px 0 var(--ink);
}
.kerotown-fighter h3 {
  margin: 0;
  font-size: 1.75rem;
}
.kerotown-fighter p,
.kerotown-fighter .kerotown-word {
  flex: 1 0 100%;
}
.kerotown-fighter p {
  margin: 0;
  font-size: 1.0625rem;
}
.kerotown-fighter .kerotown-word {
  margin-top: 6px;
}
.kerotown-power {
  padding: 2px 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font: 1.125rem/1.4 var(--heading);
  letter-spacing: 0.04em;
}
.kerotown-fighter--kero .kerotown-power {
  background: #7cc8f2;
}
.kerotown-fighter--goro .kerotown-power {
  background: #ff9418;
}

/* ── The modes: the game's own three cards, in their own colours ── */
.kerotown-modes {
  padding-top: 32px;
}
/* Three across from a tablet up (12.5rem is 200 px, so a 768 px screen has no card left alone on a
   second row), and fewer, wider cards when the text is made bigger. */
.kerotown-mode-list {
  container: modes / inline-size;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.5rem), 1fr));
  gap: 18px;
}
.kerotown-mode {
  container-type: inline-size;
  overflow: hidden;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px 18px 22px 17px;
  box-shadow: 4px 4px 0 var(--ink);
}
.kerotown-mode-top {
  display: grid;
  place-items: center;
  padding: 16px;
  border-bottom: 3px solid var(--ink);
}
.kerotown-mode--gold .kerotown-mode-top {
  background: #ffd260;
}
.kerotown-mode--blue .kerotown-mode-top {
  background: #a5d8f6;
}
.kerotown-mode--green .kerotown-mode-top {
  background: #badf8d;
}
.kerotown-mode-mark {
  width: 56px;
  height: 56px;
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* DOMINATION, 6.2em, always fits between the card's margins. */
.kerotown-mode h3 {
  margin: 16px 18px 6px;
  font-size: min(1.625rem, calc(16cqi - 7px));
}
.kerotown-mode p {
  margin: 0 18px 18px;
  font-size: 1.0625rem;
}

/* ── The four maps, two a row from a tablet up ── */
.kerotown-maps {
  padding-top: 32px;
}
.kerotown-map-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px 28px;
}
.kerotown-map-copy {
  padding: 14px 4px 0;
}
.kerotown-map h3 {
  margin: 0 0 4px;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}
.kerotown-map p {
  margin: 6px 0 0;
  font-size: 1.0625rem;
}

/* ── Bonk in a row: the three rewards beside BIG KERO, then the Oni ── */
.kerotown-streak {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  padding-top: 40px;
}
.kerotown-streak h2 {
  margin-bottom: 10px;
}
.kerotown-rungs {
  container-type: inline-size;
  display: grid;
  gap: 16px;
  margin-top: 24px;
}
.kerotown-rung {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.kerotown-rung-at {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 50%;
  font: 1.75rem/1 var(--heading);
}
.kerotown-rung h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: 4px 0 4px;
  /* OCTOPUS, 4.2em, fits beside the number's 70 px. */
  font-size: min(1.625rem, calc(22cqi - 16px));
}
.kerotown-rung p {
  margin: 0;
  font-size: 1.0625rem;
}
.kerotown-tag {
  padding: 1px 10px;
  background: #ffd260;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font: 700 0.75rem/1.6 var(--body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.kerotown-oni {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px 32px;
  align-items: center;
  margin-top: 12px;
  padding: 18px;
  background: #ffd9d2;
  border: 3px solid var(--ink);
  border-radius: 24px 20px 26px 22px;
  box-shadow: 6px 6px 0 var(--ink);
}
.kerotown-oni h3 {
  margin: 0 0 6px;
  font-size: clamp(2rem, 3.4vw, 2.75rem);
}
.kerotown-oni p {
  max-width: 28rem;
  margin: 10px 0 0;
  font-size: 1.125rem;
}

/* ── Japanese all around: the butter band the site uses for learning ── */
.kerotown-words {
  margin-block: 32px;
  background: var(--butter);
  border-block: 3px solid var(--ink);
}
.kerotown-words-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px 56px;
  align-items: center;
  padding-block: 56px;
}
.kerotown-words h2 {
  margin-bottom: 10px;
}
.kerotown-words h3 {
  margin: 28px 0 14px;
  font-size: 1.625rem;
}
/* Each word card as wide as its word, at least 7.5rem, sharing out what is left of the row. */
.kerotown-word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.kerotown-word-list > li {
  flex: 1 1 7.5rem;
}

/* ── TRAP RUN: the four courses as the four maps are, two a row from a tablet up, then the
   showdown as the Oni is: its capture beside its words ── */
.kerotown-trap {
  padding-top: 40px;
}
.kerotown-course-list {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px 28px;
  margin: 0;
  padding: 0;
}
.kerotown-course-copy {
  padding: 14px 4px 0;
}
.kerotown-course h3 {
  margin: 0 0 4px;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}
.kerotown-course p {
  margin: 6px 0 0;
  font-size: 1.0625rem;
}
.kerotown-showdown {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px 32px;
  align-items: center;
  margin-top: 36px;
  padding: 18px;
  background: var(--butter);
  border: 3px solid var(--ink);
  border-radius: 24px 20px 26px 22px;
  box-shadow: 6px 6px 0 var(--ink);
}
/* SHOWDOWN is 5.74em wide: 16.5cqi keeps it whole beside or under its capture at 200% text. */
.kerotown-showdown-copy {
  container-type: inline-size;
}
.kerotown-showdown h3 {
  margin: 0 0 6px;
  font-size: min(clamp(2rem, 3.4vw, 2.75rem), 16.5cqi);
}
.kerotown-showdown p {
  max-width: 28rem;
  margin: 0;
  font-size: 1.125rem;
}

/* ── Play your way: three cards, three a row on a wide screen ── */
.kerotown-ways {
  padding-top: 40px;
}
.kerotown-ways h2,
.kerotown-yours h2 {
  margin-bottom: 22px;
}
/* ── Make it yours: coins, the store and the sound board, beside the sound board's capture ── */
.kerotown-yours {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px 56px;
  align-items: center;
  padding-top: 40px;
}
.kerotown-way-list {
  display: grid;
  gap: 14px;
}
.kerotown-way {
  padding: 14px 18px 16px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px 18px 22px 17px;
  box-shadow: 4px 4px 0 var(--ink);
}
.kerotown-way h3 {
  margin: 0 0 4px;
  font-size: 1.5rem;
}
.kerotown-way p {
  margin: 0;
  font-size: 1.0625rem;
}
.kerotown-way--wifi {
  background: #d9f0e0;
}

/* ── The trailer: its own thumbnail, and the title's link covers the whole card ── */
.kerotown-trailer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  column-gap: 48px;
  padding-top: 32px;
}
.kerotown-trailer-card {
  position: relative;
  display: grid;
  grid-template-columns: min(44%, 220px) minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  max-width: 640px;
}
.kerotown-trailer-thumb {
  position: relative;
  overflow: hidden;
  background: var(--blue);
  border: 3px solid var(--ink);
  border-radius: 18px 16px 20px 15px;
  box-shadow: 4px 4px 0 var(--ink);
  transition:
    transform 0.18s,
    box-shadow 0.18s;
}
.kerotown-trailer-thumb img {
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
}
/* A play mark over the picture: YouTube's red circle with a white triangle, drawn here. */
.kerotown-trailer-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  margin: -28px 0 0 -28px;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--red);
}
.kerotown-trailer-play::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 14px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent white;
}
.kerotown-trailer-card:hover .kerotown-trailer-thumb {
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 4px 7px 0 var(--ink);
}
/* The title's longest word, KEROTOWN (5.2em), always fits the column beside the picture, even at
   200% text: on a phone that column is 0.55 of the screen's 88vw, less the gap. (No container
   here: it would hold the link's full card cover inside the column.) */
.kerotown-trailer-copy h3 {
  margin: 0;
  font-size: min(clamp(1.375rem, 2.6vw, 2rem), calc(8.5vw - 2px));
}
.kerotown-trailer-link::after {
  content: '';
  position: absolute;
  inset: -6px;
  z-index: 1;
  border-radius: 20px;
}
.kerotown-trailer-link:focus-visible {
  outline: none;
}
.kerotown-trailer-link:focus-visible::after {
  outline: 3px solid #075693;
  outline-offset: 2px;
}
.kerotown-trailer-card:hover .kerotown-trailer-link {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.kerotown-trailer-link > span[aria-hidden] {
  margin-left: 8px;
}
/* The full trailer's card (15 November 2026): its picture is wide, so it stands above the title
   at every width rather than beside it, and the doubled class outranks the phone rule that sets
   the upright card's two columns. */
.kerotown-trailer-card.kerotown-trailer-card--wide {
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  max-width: 560px;
}
.kerotown-trailer-card--wide .kerotown-trailer-thumb img {
  aspect-ratio: 16 / 9;
}

/* ── Good to know ── */
.kerotown-safety {
  padding-top: 40px;
  padding-bottom: 24px;
}
.kerotown-safe-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: 16px;
}
.kerotown-safe {
  position: relative;
  padding: 16px 18px 18px 64px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px 18px 22px 17px;
  box-shadow: 4px 4px 0 var(--ink);
}
.kerotown-safe::before {
  content: '✓';
  position: absolute;
  left: 16px;
  top: 16px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: #9bd8ae;
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-weight: 800;
}
.kerotown-safe h3 {
  margin: 2px 0 6px;
  font-size: 1.5rem;
}
.kerotown-safe p {
  margin: 0;
  font-size: 1rem;
}
.kerotown-safety-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  max-width: 44rem;
  margin: 26px 0 0;
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* ── The end: the store again, on the butter card ── */
.kerotown-final {
  padding-top: 40px;
  padding-bottom: 24px;
}
.kerotown-final-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px 48px;
  align-items: center;
  padding: 32px 24px;
  background: var(--butter);
  border: 3px solid var(--ink);
  border-radius: 24px 20px 26px 22px;
  box-shadow: 6px 6px 0 var(--ink);
}
.kerotown-final h2 {
  margin-bottom: 12px;
}
.kerotown-final-copy p {
  font-size: 1.125rem;
  margin-bottom: 8px;
}

/* ── The news line under the store: the channel, for news on any phone (audit F03) ── */
.kerotown-store-news {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 12px;
  max-width: 30rem;
  margin: 0;
  font-size: 0.9375rem;
}
.kerotown-store-news .text-link,
.kerotown-channel .text-link {
  gap: 8px;
}

/* ── How to play: each move with its drawn mark, beside a capture of the ink ── */
.kerotown-moves {
  padding-top: 24px;
}
.kerotown-moves-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}
.kerotown-move-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
}
.kerotown-move {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px 18px 22px 17px;
  box-shadow: 4px 4px 0 var(--ink);
}
.kerotown-move-mark {
  width: 52px;
  height: 52px;
  padding: 6px;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 50%;
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kerotown-move--ink .kerotown-move-mark {
  background: #a5d8f6;
}
.kerotown-move--capsule .kerotown-move-mark {
  background: #f7b6c8;
}
.kerotown-move h3 {
  margin: 0 0 2px;
  font-size: min(1.5rem, 8vw);
}
.kerotown-move p {
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
}

/* ── A map's card: the whole card opens its page ── */
.kerotown-map {
  position: relative;
}
.kerotown-map-frogs {
  font-weight: 700;
}
.kerotown-map-go::after {
  content: '';
  position: absolute;
  inset: -6px;
  z-index: 1;
  border-radius: 20px;
}
.kerotown-map-go:focus-visible {
  outline: none;
}
.kerotown-map-go:focus-visible::after {
  outline: 3px solid #075693;
  outline-offset: 2px;
}
.kerotown-map:hover .kerotown-map-go {
  text-decoration: underline;
  text-underline-offset: 5px;
}
.kerotown-map:hover .kerotown-shot {
  transform: translateY(-3px) rotate(-0.5deg);
}
.kerotown-map .kerotown-shot {
  transition: transform 0.18s;
}

/* ── Play your way and Make it yours: the cards ── */
.kerotown-way--coins {
  background: #fff1c2;
}
.kerotown-way .text-link,
.kerotown-safe .text-link,
.kerotown-help-item .text-link {
  margin-top: 4px;
}

/* ── Kero Town, a later update: the town's green band ── */
.kerotown-town {
  margin-block: 40px 8px;
  background: #d9f0e0;
  border-block: 3px solid var(--ink);
}
.kerotown-town-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding-block: 48px;
}
.kerotown-town-inner .kerotown-heading {
  margin-bottom: 0;
}
.kerotown-town-inner .kerotown-word {
  margin-bottom: 10px;
}
.kerotown-badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 14px;
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.9375rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.kerotown-town-points {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
}
.kerotown-town-point {
  padding: 14px 18px 16px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px 18px 22px 17px;
  box-shadow: 4px 4px 0 var(--ink);
}
.kerotown-town-point h3 {
  margin: 0 0 4px;
  font-size: 1.5rem;
}
.kerotown-town-point p {
  margin: 0;
  font-size: 1.0625rem;
}
.kerotown-town-shots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 18px;
}
.kerotown-town-go {
  justify-self: start;
}

/* ── Fan art: every drawing as the same small tile, with its artist ── */
.kerotown-fans {
  padding-top: 40px;
}
/* More fan art is coming: the owner's word on the butter card, Kero beside it, big enough to
   notice, with the art wall link right there. */
.kerotown-fans-coming {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px 14px;
  align-items: center;
  max-width: 44rem;
  margin: 0 0 28px;
  padding: 16px 20px 14px;
  background: var(--butter);
  border: 3px solid var(--ink);
  border-radius: 20px 18px 22px 17px;
  box-shadow: 4px 4px 0 var(--ink);
}
.kerotown-fans-coming-kero {
  width: 64px;
  height: auto;
  transform: rotate(-8deg);
}
.kerotown-fans-coming p,
.kerotown-fan-hero-copy .kerotown-fans-coming p {
  max-width: none;
  margin: 0;
}
.kerotown-fans-coming .kerotown-fans-coming-title {
  font: 1.625rem/1.15 var(--heading);
}
.kerotown-fans-coming .kerotown-fans-coming-line,
.kerotown-fans-coming .text-link {
  grid-column: 1 / -1;
}
.kerotown-fans-coming .kerotown-fans-coming-line {
  font-size: 1.0625rem;
  line-height: 1.55;
}
.kerotown-fans-coming .text-link {
  justify-self: start;
}
.kerotown-fan-hero-copy .kerotown-fans-coming {
  margin: 20px 0 22px;
}
.kerotown-fan-tiles,
.kerotown-fan-cards {
  list-style: none;
  margin: 0;
  padding: 0;
}
/* Tiles share a row while they are at least 8rem, so bigger text means fewer, wider tiles. */
.kerotown-fan-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 9rem), 1fr));
  gap: 14px;
}
/* Positioned, so the words only a screen reader hears stay inside the tile, and inside the strip
   a phone swipes along, rather than widening the page. */
.kerotown-fan-tile-link {
  position: relative;
  display: grid;
  align-content: start;
  gap: 2px;
  height: 100%;
  padding: 8px 8px 10px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 14px 12px 15px 13px;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.18s;
}
.kerotown-fan-tile-link:hover {
  transform: translateY(-2px);
}
.kerotown-fan-tile-art {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  margin-bottom: 6px;
  overflow: hidden;
  background: #fff;
  border-radius: 8px;
}
.kerotown-fan-tile-art img,
.kerotown-fan-card-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.kerotown-fan-name {
  display: block;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.kerotown-fan-handle {
  display: block;
  font-size: 0.875rem;
  line-height: 1.3;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.kerotown-fans-swipe {
  display: none;
  margin: 0 0 8px;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--muted);
}
.kerotown-fans-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
  margin: 18px 0 0;
}

/* ── Where the drawings hang: one card a map, stacked on a phone and two a row from a tablet up,
   each with its count, where to look, a little picture of every drawing and the two ways on ── */
.kerotown-hang {
  padding-top: 40px;
}
.kerotown-hang-list {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px 24px;
  margin: 0;
  padding: 0;
}
.kerotown-hang-map {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 18px 20px 16px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px 18px 22px 17px;
  box-shadow: 4px 4px 0 var(--ink);
}
/* The name and its count share a line while they fit; the count drops under the name when they
   do not (200% text on a small phone), so a name is never split. */
.kerotown-hang-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}
.kerotown-hang-top h3 {
  margin: 0;
  font-size: min(1.75rem, 9vw);
}
.kerotown-hang-count {
  padding: 2px 12px;
  background: var(--butter);
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 0.9375rem;
  font-weight: 800;
  white-space: nowrap;
}
.kerotown-hang-where {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.5;
}
.kerotown-hang-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 40px;
  margin-bottom: 28px;
}
.kerotown-hang-intro .kerotown-heading {
  margin-bottom: 18px;
}
.kerotown-hang-shot {
  margin: 0;
}
.kerotown-hang-shot figcaption {
  margin-top: 10px;
  font-size: 1rem;
  font-weight: 700;
}
/* A little picture of every drawing, as many a row as fit and never bigger than 56 px. */
.kerotown-hang-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(44px, 56px));
  gap: 6px;
  width: 100%;
}
.kerotown-hang-thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 10px 9px 11px 8px;
}
.kerotown-hang-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.kerotown-hang-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 24px;
  margin: auto 0 0;
  padding-top: 4px;
}
/* The words and the arrow wrap as one line of text, so on a small phone a long link breaks
   between words and its arrow stays beside the last word instead of floating to the card's edge.
   Still a 44 px tap target. */
.kerotown-hang-links .text-link {
  display: block;
  padding-block: 10px;
  line-height: 1.5;
}
.kerotown-hang-links .text-link span {
  margin-left: 6px;
}

/* ── The trailer's side: the card, then the channel ── */
.kerotown-trailer-side {
  display: grid;
  gap: 18px;
}
.kerotown-channel {
  display: grid;
  justify-items: start;
  gap: 0;
  margin: 0;
  font-size: 0.9375rem;
}

/* ── Good to know: the heading beside the ready-made messages, then the cards ── */
.kerotown-safety-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 48px;
  align-items: center;
  margin-bottom: 28px;
}
.kerotown-safety-line .text-link {
  margin-left: 4px;
}

/* ── Help (audit F01): the store listings' Support URL lands here ── */
.kerotown-help {
  padding-top: 40px;
  scroll-margin-top: 90px;
}
.kerotown-help-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
}
.kerotown-help-item {
  padding: 16px 18px 18px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px 18px 22px 17px;
  box-shadow: 4px 4px 0 var(--ink);
  scroll-margin-top: 90px;
}
.kerotown-help-item h3 {
  margin: 2px 0 8px;
  font-size: 1.375rem;
}
.kerotown-help-item p {
  margin: 0;
  font-size: 1rem;
}
.kerotown-help-item--email {
  grid-column: 1 / -1;
  background: var(--butter);
}
.kerotown-email {
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.kerotown-ideas {
  margin: 16px 0 0;
  font-size: 1rem;
}

/* ════ The pages under /kerotown/: a map, Kero Town and the fan art ════ */
.kerotown-sub-top {
  padding-top: 18px;
  padding-bottom: 0;
}
.kerotown-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 700;
}
.kerotown-back:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}
.kerotown-map-hero {
  container-type: inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding-top: 8px;
  padding-bottom: 24px;
}
.kerotown-map-hero h1 {
  margin-bottom: 10px;
  font-size: min(clamp(3rem, 7vw, 5.5rem), 15cqi);
}
.kerotown-map-hero h1 span,
.kerotown-fan-hero h1 span {
  color: var(--red);
}
.kerotown-map-hero .eyebrow,
.kerotown-fan-hero .eyebrow {
  color: var(--red);
  margin-bottom: 8px;
}
.kerotown-word--big b {
  font-size: min(2rem, 11vw);
}
.kerotown-word--big {
  margin-bottom: 12px;
}
.kerotown-map-title .kerotown-lead {
  margin-bottom: 18px;
}
.kerotown-map-big {
  box-shadow: 6px 6px 0 var(--ink);
}
.kerotown-features {
  padding-top: 24px;
}
.kerotown-feature-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 16px;
  margin: 0 0 24px;
  padding: 0;
}
.kerotown-feature {
  padding: 16px 18px 18px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px 18px 22px 17px;
  box-shadow: 4px 4px 0 var(--ink);
}
.kerotown-feature h3 {
  margin: 0 0 6px;
  font-size: 1.625rem;
}
.kerotown-feature p {
  margin: 8px 0 0;
  font-size: 1.0625rem;
}
.kerotown-map-more {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 20px;
}
.kerotown-sub-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 28px;
  padding-top: 8px;
  padding-bottom: 32px;
}

/* ── The fan art page: the cards, one per drawing, all alike ── */
.kerotown-fan-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding-top: 8px;
}
.kerotown-fan-hero h1 {
  margin-bottom: 10px;
}
.kerotown-fan-hero-copy p {
  max-width: 36rem;
  font-size: 1.0625rem;
}
.kerotown-fan-hero-art {
  margin: 0;
}
.kerotown-fan-hero-art figcaption {
  margin-top: 10px;
  font-size: 0.9375rem;
  font-weight: 700;
}
.kerotown-fan-jump ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
}
.kerotown-fan-jump a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 16px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 14px;
  font-weight: 700;
}
.kerotown-fan-jump a span {
  padding: 0 8px;
  background: var(--yellow);
  border-radius: 999px;
}
.kerotown-fan-jump a:hover {
  background: var(--butter);
}
.kerotown-fan-map {
  padding-top: 40px;
  scroll-margin-top: 90px;
}
.kerotown-fan-map .kerotown-word {
  margin-bottom: 8px;
}
.kerotown-fan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: 18px;
  margin-bottom: 18px;
}
.kerotown-fan-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px 18px 22px 17px;
  box-shadow: 4px 4px 0 var(--ink);
  scroll-margin-top: 90px;
}
.kerotown-fan-card:target {
  outline: 4px solid var(--red);
  outline-offset: 3px;
}
.kerotown-fan-card-art {
  aspect-ratio: 1;
  padding: 10px;
  background: #fff;
  border-bottom: 3px solid var(--ink);
}
.kerotown-fan-card-copy {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px 16px 12px;
}
.kerotown-fan-card-copy h3 {
  margin: 0;
  font-size: 1.375rem;
}
.kerotown-fan-credit {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin: 0;
}
.kerotown-fan-avatar {
  width: 40px;
  height: 40px;
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.kerotown-fan-where {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.45;
}

/* ── Kero Town's page ── */
.kerotown-town-when {
  display: inline-block;
  margin: 0;
  padding: 8px 14px;
  background: #d9f0e0;
  border: 2px solid var(--ink);
  border-radius: 14px;
  font-weight: 700;
}
.kerotown-town-part {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  padding-top: 40px;
}
.kerotown-town-part-copy p {
  max-width: 36rem;
  font-size: 1.125rem;
}
.kerotown-town-words {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
  padding: 0;
}
.kerotown-town-part-shots {
  display: grid;
  gap: 18px;
}
.kerotown-sights {
  padding-top: 40px;
}
.kerotown-sight-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
}
.kerotown-sight {
  overflow: hidden;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px 18px 22px 17px;
  box-shadow: 4px 4px 0 var(--ink);
}
.kerotown-sight .kerotown-shot {
  border: 0;
  border-bottom: 3px solid var(--ink);
  border-radius: 0;
  box-shadow: none;
}
.kerotown-sight-copy {
  padding: 14px 18px 18px;
}
.kerotown-sight-copy h3 {
  margin: 0 0 6px;
  font-size: min(1.5rem, 7.5vw);
}
.kerotown-sight-copy p {
  margin: 8px 0 0;
}
.kerotown-sight--words {
  background: var(--butter);
}

@media (min-width: 700px) {
  .kerotown-map-list,
  .kerotown-course-list,
  .kerotown-hang-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 860px) {
  .kerotown-hero {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    grid-template-rows: 1fr repeat(5, auto) 1fr;
    column-gap: 56px;
    padding-top: 48px;
  }
  .kerotown-hero > * {
    grid-column: 1;
  }
  /* The words' column is 0.45 of the hero less the gap. */
  .kerotown-hero h1 {
    font-size: min(clamp(3rem, 7vw, 6rem), calc(8.4cqi - 5px));
  }
  .kerotown-hero > .eyebrow {
    grid-row: 2;
  }
  .kerotown-hero > h1 {
    grid-row: 3;
  }
  .kerotown-hero > .kerotown-lead {
    grid-row: 4;
  }
  .kerotown-hero > .kerotown-store {
    grid-row: 5;
  }
  .kerotown-hero > .kerotown-facts {
    grid-row: 6;
    margin: 22px 0 0;
  }
  .kerotown-hero > .kerotown-hero-art {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: center;
    margin-bottom: 18px;
  }
  .kerotown-fighters-body {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 40px;
  }
  .kerotown-streak {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    column-gap: 48px;
    align-items: center;
  }
  .kerotown-oni {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    padding: 24px;
  }
  .kerotown-words-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .kerotown-date-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
  .kerotown-showdown {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    padding: 24px;
  }
  .kerotown-ways .kerotown-way-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .kerotown-yours {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
  .kerotown-trailer {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  }
  .kerotown-trailer .kerotown-heading {
    margin-bottom: 0;
  }
  /* Two equal halves: an auto store column grew with bigger text and squeezed Be first to play. */
  .kerotown-final-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding: 40px 44px;
  }
}
/* On a phone the drawings are a strip of two rows to swipe along, so 34 of them do not make the
   page five screens longer; every tile is still a link a keyboard reaches in order. */
@media (max-width: 699px) {
  .kerotown-fan-tiles {
    grid-template-columns: none;
    grid-template-rows: auto auto;
    grid-auto-flow: column;
    grid-auto-columns: minmax(8.5rem, 40%);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 4px 4px 14px;
  }
  .kerotown-fan-tile {
    scroll-snap-align: start;
  }
  .kerotown-fans-swipe {
    display: block;
  }
}
/* On a phone each mode is a row: its mark on the left in the card's colour, its words beside. With
   the text made big there is no room beside the mark, so the card keeps its mark on top. */
@media (max-width: 699px) {
  @container modes (min-width: 17rem) {
    .kerotown-mode {
      display: grid;
      grid-template-columns: 76px minmax(0, 1fr);
      grid-template-rows: auto 1fr;
    }
    .kerotown-mode-top {
      grid-row: 1 / -1;
      border-bottom: 0;
      border-right: 3px solid var(--ink);
    }
    .kerotown-mode-mark {
      width: 44px;
      height: 44px;
    }
    .kerotown-mode h3 {
      margin: 14px 16px 2px;
      font-size: min(1.375rem, calc(16cqi - 18px));
    }
    .kerotown-mode p {
      margin: 0 16px 14px;
      font-size: 1rem;
    }
  }
  .kerotown-hero-art {
    margin-bottom: 32px;
  }
}
/* On a phone the facts sit between the store and the picture. */
@media (max-width: 859px) {
  .kerotown-hero > .kerotown-facts {
    margin: 20px 0 22px;
  }
}
@media (max-width: 520px) {
  .kerotown-store,
  .store-links--big {
    width: 100%;
  }
  .kerotown-trailer-card {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 16px;
  }
  .kerotown-safe {
    padding-left: 60px;
  }
}
@media (min-width: 860px) {
  .kerotown-moves-body {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 40px;
  }
  .kerotown-town-inner {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    column-gap: 48px;
    align-items: center;
  }
  .kerotown-town-shots,
  .kerotown-town-go {
    grid-column: 1 / -1;
  }
  .kerotown-town-shots {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .kerotown-safety-top,
  .kerotown-hang-intro {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .kerotown-hang-intro {
    align-items: center;
  }
  .kerotown-map-hero,
  .kerotown-fan-hero {
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    column-gap: 48px;
  }
  .kerotown-map-hero h1 {
    font-size: min(clamp(3rem, 7vw, 5.5rem), calc(6.4cqi - 4px));
  }
  .kerotown-town-part {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 48px;
  }
  .kerotown-town-part:nth-of-type(even) .kerotown-town-part-copy {
    order: 1;
  }
}
/* ── Easier on the eye on a phone (the owner, 23 October 2026): text at full size, the drawings
   strip one row of wider tiles so names stay whole, fewer screens of stacked pictures, and more
   room inside the cards ── */
@media (max-width: 699px) {
  .kerotown-note {
    font-size: 1rem;
    line-height: 1.55;
  }
  .kerotown-english {
    font-size: 1rem;
  }
  /* One row to swipe, each tile wide enough for its artist's name and handle. */
  .kerotown-fan-tiles {
    grid-template-rows: auto;
    /* A fixed share, not minmax: with 34 tracks there is no free space to grow into, so a
       minmax track would sit at its minimum. */
    grid-auto-columns: max(min(10rem, 85%), 56%);
    gap: 12px;
  }
  .kerotown-fan-handle {
    font-size: 0.9375rem;
  }
  .kerotown-fans-coming {
    grid-template-columns: 52px minmax(0, 1fr);
    padding: 14px 18px 12px;
  }
  .kerotown-fans-coming-kero {
    width: 52px;
  }
  .kerotown-fans-coming .kerotown-fans-coming-title {
    font-size: min(1.5rem, 7.5vw);
  }
  /* Kero Town's three pictures: the first across the card, the other two side by side. */
  .kerotown-town-shots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .kerotown-town-shots > :first-child {
    grid-column: 1 / -1;
  }
  .kerotown-final-inner {
    gap: 28px;
    padding: 28px 20px;
  }
  .kerotown-final .kerotown-ideas {
    margin-top: 22px;
  }
  /* The ideas link on a line of its own, like the link above it, so it never props the
     sentence's lines apart. */
  .kerotown-final .kerotown-ideas .text-link {
    display: flex;
    width: fit-content;
  }
  /* The fan art page: the four maps close under the hero, and shorter picture wells. */
  .kerotown-fan-jump {
    padding-top: 8px;
    padding-bottom: 24px;
  }
  .kerotown-fan-card-art {
    aspect-ratio: 4 / 3;
  }
  .kerotown-fan-where {
    font-size: 1rem;
    line-height: 1.5;
  }
  .kerotown-fan-hero-art figcaption {
    font-size: 1rem;
  }
}
/* In a contrast theme the drawn marks take the theme's own text colour, so they stay visible on a
   black card (audit C05). */
@media (forced-colors: active) {
  .kerotown-mode-mark,
  .kerotown-move-mark {
    stroke: CanvasText;
  }
}
@media (prefers-reduced-motion: reduce) {
  .kerotown-trailer-thumb,
  .kerotown-map .kerotown-shot,
  .kerotown-fan-tile-link {
    transition: none;
  }
}

/* Approved creations are drawn only after the public feed answers. No inline styling. */
.kerotown-creations-head {
  padding-top: 20px;
  padding-bottom: 24px;
}
.kerotown-creations-head h1 {
  font-size: min(5rem, 16vw);
}
.kerotown-creations-head h1 span {
  color: var(--red);
}
.kerotown-creations {
  min-height: 16rem;
  padding-top: 12px;
  padding-bottom: 64px;
}
.kerotown-creations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 28px;
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
}
.kerotown-creations-grid li {
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--butter);
  box-shadow: 5px 5px 0 var(--ink);
  overflow: hidden;
  max-width: 400px;
}
.kerotown-creations-grid figure {
  margin: 0;
}
.kerotown-creations-grid img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}
.kerotown-creations-grid [hidden] {
  display: none;
}
.kerotown-creations-grid figcaption {
  padding: 20px;
  overflow-wrap: anywhere;
  border-top: 3px solid var(--ink);
}
.kerotown-creations-grid h2 {
  font-size: 1.75rem;
  margin: 0 0 8px;
}
.kerotown-creations-grid p {
  margin: 0 0 8px;
}
.kerotown-creations-grid figure > p {
  padding: 24px;
}

.kerotown-service {
  font-weight: 700;
  margin: 1rem 0;
}
.kerotown-service[hidden] {
  display: none;
}
/* the items page's prices line, under the items it is about (15 November 2026) */
.kerotown-prices {
  padding-top: 0;
  padding-bottom: 0;
  color: var(--muted);
  font-size: 0.9375rem;
}
.kerotown-creations-grid h3,
.kerotown-creations-grid h4 {
  font-size: 1.6rem;
  margin: 0 0 8px;
}
/* KEROTOWN ONLINE's live part (src/client/kerotown-live.ts): who is playing now, THIS WEEK's boards and the looks being
   played in, every player drawn by fighter, colour and score, and since 19 November 2026 a player who shares his page
   by its name, a link to it. */
.kerotown-live-online {
  font-weight: 700;
  font-size: 1.25rem;
}
.kerotown-board {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 12px;
  max-width: 44rem;
}
.kerotown-board-row {
  display: grid;
  grid-template-columns: 3rem 72px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--butter);
  box-shadow: 4px 4px 0 var(--ink);
}
.kerotown-board-row img {
  width: 72px;
  height: auto;
}
.kerotown-board-place {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  font-weight: 800;
  font-size: 1.2rem;
}
.kerotown-board-row--1 .kerotown-board-place {
  background: #f7c948;
}
.kerotown-board-row--2 .kerotown-board-place {
  background: #d9dde3;
}
.kerotown-board-row--3 .kerotown-board-place {
  background: #e7a76b;
}
.kerotown-board-who {
  display: grid;
  gap: 2px;
}
.kerotown-board-who p {
  margin: 0;
}
.kerotown-board-score {
  font-weight: 800;
  font-size: 1.15rem;
  white-space: nowrap;
}
.kerotown-live-resets,
.kerotown-looks {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
}
.kerotown-looks li {
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 14px;
  text-align: center;
}
.kerotown-looks img {
  width: 100%;
  height: auto;
}
.kerotown-look-name {
  font-weight: 800;
  margin: 8px 0 0;
}
/* A shared page's name on a board or a look (the owner, 19 November 2026: "when you click goes to profile"): underlined,
   so it reads as a link where A PLAYER beside it does not, and free to wrap anywhere, so a long name never pushes a
   phone's row wider than the screen. */
.kerotown-live-name {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  overflow-wrap: anywhere;
}
.kerotown-live-name:hover {
  text-decoration-thickness: 3px;
}
/* the look under a shared page's name, as the players' list draws it under theirs */
/* THE PLAYERS' OWN PAGES (src/client/kerotown-live.ts; the owner, 15 November 2026: "i want to be sharable like
   that"): the list of everybody who chose to share, a card each that is all one link, and one player's own page, his
   fighter large beside his name, his three scores, what he wears and the SHARE button. */
.kerotown-pages {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 20px;
}
.kerotown-page-card {
  display: grid;
  justify-items: center;
  gap: 4px;
  height: 100%;
  box-sizing: border-box;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 14px;
  text-align: center;
  color: var(--ink);
  text-decoration: none;
  transition:
    transform 0.18s,
    box-shadow 0.18s;
}
.kerotown-page-card:hover {
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 4px 7px 0 var(--ink);
}
.kerotown-page-card:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 3px;
}
.kerotown-page-card img {
  width: 100%;
  height: auto;
}
.kerotown-page-card strong {
  font-size: 1.0625rem;
  overflow-wrap: anywhere;
}
.kerotown-page-card span {
  color: var(--muted);
  font-size: 0.9375rem;
}
.kerotown-player-card {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  border: 3px solid var(--ink);
  border-radius: 22px 18px 24px 17px;
  background: var(--paper);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 24px;
}
.kerotown-player-card > img {
  width: 100%;
  height: auto;
}
.kerotown-player-body h2 {
  margin: 0;
  font-size: min(clamp(1.75rem, 4vw, 2.75rem), calc(9vw - 2px));
  overflow-wrap: anywhere;
}
.kerotown-player-look {
  margin: 6px 0 0;
  font-weight: 700;
}
/* three scores, always three across: two and one on a phone was the uneven row the owner asked to be rid of on the
   items page ("if 3 and then one looks to plain") */
.kerotown-player-scores {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 0;
}
.kerotown-player-scores > div {
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 10px 12px;
  background: var(--butter);
}
.kerotown-player-scores dt {
  font-size: 0.8125rem;
  font-weight: 800;
}
.kerotown-player-scores dd {
  margin: 4px 0 0;
  font-size: 1.75rem;
  font-weight: 800;
}
.kerotown-player-body h3 {
  margin: 24px 0 8px;
  font-size: 1.125rem;
}
.kerotown-player-worn {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.kerotown-player-worn li {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 6px 10px;
  font-weight: 700;
}
.kerotown-player-worn img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.kerotown-player-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin: 24px 0 0;
}
.kerotown-player-shared {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}
.kerotown-player-gone {
  font-weight: 700;
}
/* A PAGE'S PHASE ONE (19 November 2026, PAGE-PICK): ABOUT ME's picked lines as the game's chips and the favourite map
   and game under them, the SHOWCASE as small item cards drawn like the items page's, and the badges as stickers. Each is
   there only where the feed has it, so a page without them is as it was. */
.kerotown-player-lines,
.kerotown-player-showcase,
.kerotown-player-badges {
  list-style: none;
  padding: 0;
  margin: 0;
}
.kerotown-player-lines,
.kerotown-player-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kerotown-player-lines li {
  padding: 6px 14px;
  background: #fff1c7;
  border: 2px solid var(--ink);
  border-radius: 14px 12px 15px 13px;
  font: 1.0625rem/1.25 var(--heading);
  letter-spacing: 0.02em;
}
/* HIS HANDLES (21 November 2026, the owner's words: "as plain text on their page on this website"): each network's word
   over the name, in the badges' sticker style, as text with nothing to tap. Long names wrap rather than widen the card. */
.kerotown-player-handles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.kerotown-player-handles > div {
  padding: 6px 14px;
  background: #fff1c7;
  border: 2px solid var(--ink);
  border-radius: 14px 12px 15px 13px;
  min-width: 0;
}
.kerotown-player-handles dt {
  font: 0.8125rem/1.2 var(--heading);
  letter-spacing: 0.04em;
}
.kerotown-player-handles dd {
  margin: 0;
  font: 1.0625rem/1.25 var(--heading);
  overflow-wrap: anywhere;
}
.kerotown-player-favourites {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: 10px;
  margin: 12px 0 0;
}
.kerotown-player-favourites div {
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
}
.kerotown-player-favourites dt {
  font-size: 0.8125rem;
  font-weight: 800;
}
.kerotown-player-favourites dd {
  margin: 2px 0 0;
  font: 1.25rem/1.2 var(--heading);
}
/* as many across as fit at a card's least width, so six sit in one row beside a large fighter, and never one alone in a
   column at 320 */
.kerotown-player-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 104px), 1fr));
  gap: 14px;
}
.kerotown-player-showcase li {
  display: flex;
  border: 3px solid var(--ink);
  border-radius: 14px;
  background: var(--butter);
  box-shadow: 3px 3px 0 var(--ink);
  overflow: hidden;
}
.kerotown-player-showcase figure {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin: 0;
}
.kerotown-player-showcase img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: 8px;
  box-sizing: border-box;
  background: var(--paper);
}
.kerotown-player-showcase figcaption {
  flex: 1;
  padding: 8px 10px;
  border-top: 3px solid var(--ink);
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.kerotown-player-badges li {
  padding: 4px 14px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 0.9375rem;
  font-weight: 800;
}
/* the two numbers beside the three scores: five boxes as three over two, each row full, never a box alone on a row */
.kerotown-player-scores--five {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.kerotown-player-scores--five > div {
  grid-column: span 2;
}
.kerotown-player-scores--five > div:nth-child(n + 4) {
  grid-column: span 3;
}
@media (max-width: 699px) {
  .kerotown-player-card {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
    padding: 18px;
  }
  .kerotown-player-card > img {
    max-width: 60vw;
  }
  .kerotown-player-scores {
    gap: 8px;
    width: 100%;
  }
  .kerotown-player-scores > div {
    padding: 8px 6px;
  }
  .kerotown-player-scores dt {
    font-size: 0.6875rem;
  }
  .kerotown-player-scores dd {
    font-size: 1.375rem;
  }
  .kerotown-player-worn,
  .kerotown-player-actions,
  .kerotown-player-lines,
  .kerotown-player-badges {
    justify-content: center;
  }
  .kerotown-player-body [data-page-part] {
    width: 100%;
  }
  /* three across a 390 phone, as small as the desk's cards, rather than two large ones and one left alone */
  .kerotown-player-showcase {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 84px), 1fr));
    gap: 12px;
  }
  .kerotown-player-showcase figcaption {
    padding: 6px;
    font-size: 0.8125rem;
  }
}
@media (max-width: 520px) {
  .kerotown-board-row {
    grid-template-columns: 2.6rem 56px 1fr;
  }
  .kerotown-board-row img {
    width: 56px;
  }
  .kerotown-board-score {
    grid-column: 3;
  }
}
/* A make's card (the owner, 15 November 2026: "improve stlye of that"): every card the same height in its row, and the
   picture in a square on the card's own ground so a tall and a wide picture line up. */
.kerotown-creations-grid li {
  display: flex;
}
.kerotown-creations-grid figure {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.kerotown-creations-grid figure > img {
  aspect-ratio: 1 / 1;
  padding: 12px;
  box-sizing: border-box;
  background: var(--paper, #fffaf0);
}
.kerotown-creations-grid figcaption {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.kerotown-live-intro {
  padding-block: 2rem;
}
.kerotown-live-intro .button {
  margin: 0.5rem 0.5rem 0.5rem 0;
}

.kerotown-live-intro h2 {
  font-size: min(3rem, calc(9vw - 5px));
}

/* ── The look-round picture on a map page (13 November 2026). Without scripts it is the flat
   picture in its frame. With them the canvas lies over it and the buttons under it are shown. ── */
.kerotown-look {
  padding-top: 24px;
  padding-bottom: 24px;
}
.kerotown-look [hidden] {
  display: none;
}
.kerotown-look-view {
  display: grid;
  gap: 16px;
}
.kerotown-look-stage {
  position: relative;
  overflow: hidden;
  /* the ring of arrows is sized by the picture's own width */
  container-type: inline-size;
  aspect-ratio: 16 / 9;
  /* a browser too old for aspect-ratio still gives the picture a height */
  min-height: 220px;
  max-height: 80vh;
  background: #bfe0f7;
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 6px 6px 0 var(--ink);
  /* a finger moved sideways turns the picture; moved up or down it scrolls the page as usual */
  touch-action: pan-y pinch-zoom;
  -webkit-user-select: none;
  user-select: none;
}
.kerotown-look-view.is-live .kerotown-look-stage {
  cursor: grab;
}
.kerotown-look-view.is-dragging .kerotown-look-stage {
  cursor: grabbing;
}
.kerotown-look-stage:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 3px;
}
.kerotown-look-still,
.kerotown-look-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.kerotown-look-still {
  object-fit: cover;
}
.kerotown-look-hint,
.kerotown-look-busy {
  position: absolute;
  left: 50%;
  margin: 0;
  padding: 6px 14px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 2px 3px 0 var(--ink);
  font-weight: 700;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}
.kerotown-look-hint {
  top: 12px;
}
.kerotown-look-busy {
  top: 62px;
}
/* The arrows on the ground, as in Street View: a ring at the foot of the picture, tipped back like
   the floor, with an arrow for each path that leaves this place. The script turns the ring against
   the view, so the arrow at its far side is the way ahead and the one at its near side is the way
   back. --look-ring is how far out from the middle an arrow sits. */
.kerotown-look-walk {
  /* a fixed share of the picture's width, between a phone's size and a big screen's */
  --look-ring: clamp(50px, 7.4cqw, 88px);
  --look-step: clamp(54px, 7.8cqw, 92px);
  position: absolute;
  left: 50%;
  bottom: 3%;
  width: calc(2 * var(--look-ring) + var(--look-step));
  height: calc(2 * var(--look-ring) + var(--look-step));
  margin-left: calc(-1 * var(--look-ring) - var(--look-step) / 2);
  perspective: 560px;
  perspective-origin: 50% 20%;
  pointer-events: none;
}
.kerotown-look-ring {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
}
.kerotown-look-step {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--look-step);
  height: var(--look-step);
  margin: calc(var(--look-step) / -2) 0 0 calc(var(--look-step) / -2);
  padding: 0;
  background: none;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
}
.kerotown-look-step svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 3px 0 rgb(57 44 32 / 0.35));
}
.kerotown-look-step-edge,
.kerotown-look-step-face {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kerotown-look-step-edge {
  stroke: var(--ink);
  stroke-width: 15;
}
.kerotown-look-step-face {
  stroke: var(--paper);
  stroke-width: 9;
}
/* The path ahead of the view, which the up arrow key walks. */
.kerotown-look-step.is-ahead .kerotown-look-step-face {
  stroke: var(--yellow);
}
.kerotown-look-step:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 0;
}
.kerotown-look-tools {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.kerotown-look-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 9px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 2px 3px 0 var(--ink);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  position: absolute;
  pointer-events: auto;
}
.kerotown-look-tool--left,
.kerotown-look-tool--right {
  top: 50%;
  margin-top: -22px;
}
.kerotown-look-tool--left {
  left: 10px;
}
.kerotown-look-tool--right {
  right: 10px;
}
.kerotown-look-tool--full {
  top: 10px;
  right: 10px;
  padding: 0 14px 0 10px;
}
.kerotown-look-tool span {
  display: inline-flex;
}
.kerotown-look-tool .kerotown-look-when-open,
.kerotown-look-view.is-open .kerotown-look-tool .kerotown-look-when-shut {
  display: none;
}
.kerotown-look-view.is-open .kerotown-look-tool .kerotown-look-when-open {
  display: inline-flex;
}
.kerotown-look-tool:focus-visible,
.kerotown-look-chip:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 2px;
}
.kerotown-look-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.kerotown-look-group {
  min-width: 0;
}
.kerotown-look-caption {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.5;
}
.kerotown-look-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 32px;
}
.kerotown-look-label {
  margin: 0 0 8px;
  font: 700 0.8125rem/1.5 var(--body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.kerotown-look-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.kerotown-look-chip {
  max-width: 100%;
  min-height: 44px;
  padding: 6px 16px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 2px 3px 0 var(--ink);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
/* Only where a pointer can hover: on a phone the last thing touched would stay lit. */
@media (hover: hover) {
  .kerotown-look-tool:hover,
  .kerotown-look-chip:hover {
    background: var(--butter);
  }
  .kerotown-look-step:hover .kerotown-look-step-face {
    stroke: var(--butter);
  }
}
.kerotown-look-chip[aria-pressed='true'] {
  background: var(--yellow);
}
/* On a phone the picture is square, so there is room to look up at the big screen, and the full
   screen button is its mark alone. */
@media (max-width: 599px) {
  .kerotown-look-stage {
    aspect-ratio: 1 / 1;
  }
  .kerotown-look-word {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .kerotown-look-tool--full {
    padding: 0 9px;
  }
  .kerotown-look-hint {
    max-width: calc(100% - 130px);
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
/* The full screen: the dialog is the whole window, the picture takes all the room the buttons
   under it leave, and a finger looks up and down as well as round. */
.kerotown-look-dialog {
  /* fixed and on top even where a dialog cannot be opened as a modal one */
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  background: var(--paper);
  border: 0;
  overflow: hidden;
}
.kerotown-look-dialog::backdrop {
  background: var(--ink);
}
.kerotown-look-locked {
  overflow: hidden;
}
.kerotown-look-view.is-open {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
}
.kerotown-look-view.is-open .kerotown-look-stage {
  flex: 1;
  min-height: 0;
  max-height: none;
  aspect-ratio: auto;
  border-width: 0 0 3px;
  border-radius: 0;
  box-shadow: none;
  touch-action: none;
}
.kerotown-look-view.is-open .kerotown-look-stage:focus-visible {
  outline-offset: -4px;
}
.kerotown-look-view.is-open .kerotown-look-panel {
  flex: none;
  gap: 8px;
  max-height: 42%;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
.kerotown-look-view.is-open .kerotown-look-caption {
  font-size: 1rem;
}
.kerotown-look-view.is-open .kerotown-look-groups {
  gap: 8px 28px;
}
.kerotown-look-view.is-open .kerotown-look-label {
  margin-bottom: 4px;
}
@media (max-width: 599px) {
  /* one row a group, pushed sideways, so the picture keeps the screen */
  .kerotown-look-view.is-open .kerotown-look-groups {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .kerotown-look-view.is-open .kerotown-look-chips {
    flex-wrap: nowrap;
    padding: 2px 4px 6px 2px;
    overflow-x: auto;
  }
  .kerotown-look-view.is-open .kerotown-look-chip {
    flex: none;
    white-space: nowrap;
  }
}

/* The four courses to walk, inside the TRAP RUN section: a smaller heading, the same picture. */
.kerotown-trap-look {
  margin-top: 36px;
}
.kerotown-trap-look-heading {
  margin-bottom: 18px;
}
.kerotown-trap-look-heading h3 {
  margin-bottom: 8px;
}
.kerotown-trap-look-heading p {
  max-width: 40rem;
  margin-bottom: 0;
  font-size: 1.125rem;
  line-height: 1.5;
}

/* ════ Lessons ════ */
.learn-room--study {
  /* Pond green, with darker text tones so muted copy and red keep their contrast. */
  --learn-bg: #d9efcb;
  --pond: #8bd1d6;
  --pad: #6fae4f;
  --pad-dark: #3f7a2c;
  --muted: #4a3a2a;
  --red: #8f2a1f;
  --right: #cfeccb;
  --wrong: #f6d2cc;
}
.learn-room--study [lang='ja'] {
  font-family: 'Kero Japanese', var(--body);
}
/*
 * Romaji in the body font takes the capital I with bars (site.css), so いいえ's Iie never reads
 * as "lie". Kept weak (:where), so a romaji in the heading font (Lilita One, whose I has its own
 * bars) keeps it.
 */
:where(.learn-room--study, .play-host) [lang='ja-Latn'] {
  font-family: var(--romaji);
}
/* The numbers and time lessons run the same player on their own peach page. */
.learn-room--study.learn-room--numbers {
  --learn-bg: #ffd9c2;
  --red: #8a2a1f;
}
/* The Vocabulary section: the same player on a soft lilac page. */
.learn-room--study.learn-room--vocab {
  --learn-bg: #e9e0f6;
  --muted: #45372a;
  --red: #84271c;
}
.learn-pick--study {
  background: #e6f5dc;
}
.study-meter {
  display: block;
  height: 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
  overflow: hidden;
}
.study-meter > span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--pad);
  transition: width 0.3s;
}
.study-progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.study-progress-row .study-meter {
  flex: 1;
  min-width: 80px;
}
.study-progress-row p {
  margin: 0;
  font-weight: 700;
}

/* The six lesson cards */
.study-resume {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 20px;
  font-weight: 700;
}
.study-lessons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}
.study-lesson {
  display: grid;
  gap: 4px;
  height: 100%;
  padding: 20px 20px 18px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px 24px 18px 22px;
  box-shadow: 0 5px 0 var(--ink);
  transition:
    transform 0.18s,
    box-shadow 0.18s;
}
.study-lesson:hover {
  transform: translateY(-3px) rotate(-1deg);
  box-shadow: 0 8px 0 var(--ink);
}
.study-lesson-title {
  font: 1.45rem/1.15 var(--heading);
}
.study-lesson-jp {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--red);
}
.study-lesson-sub {
  color: var(--muted);
  font-size: 0.95rem;
}
.study-lesson .study-meter {
  margin-top: 8px;
}
.study-lesson-progress {
  font-weight: 700;
  font-size: 0.9rem;
}
.study-lesson-progress:empty {
  display: none;
}
.study-lesson.is-done {
  background: #eef8e6;
}
.study-review-banner {
  background: var(--pad-dark);
}
.battle-banner-goro {
  transform: scaleX(-1);
}

/* One lesson: the outline */
.learn-room--study .lesson-head h1.lesson-title {
  font: clamp(2.6rem, 7vw, 4.4rem)/1.05 var(--heading);
  letter-spacing: 0;
}
.study-lesson-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 22px;
  max-width: 760px;
  margin: 0 auto 22px;
}
.study-lesson-bar .study-progress-row {
  flex: 1 1 260px;
}
.study-noscript {
  max-width: 60ch;
  margin: 0 auto 18px;
  padding: 12px 16px;
  background: var(--paper);
  border: 2px dashed var(--ink);
  border-radius: 14px;
  text-align: center;
}
.study-part {
  margin-top: 34px;
  scroll-margin-top: 90px;
}
.study-part > p {
  max-width: 60ch;
}
.study-sections {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 18px;
}
.study-section {
  padding: 18px 20px 16px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px 24px 18px 26px;
  box-shadow: 5px 5px 0 var(--ink);
}
.study-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.study-section-head > div {
  flex: 1;
  min-width: 0;
}
.study-section-head h3 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.7rem);
}
.study-section-number {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 2.2rem;
  height: 2.2rem;
  padding-top: 0.1em;
  font: 1.15rem/1 var(--heading);
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.study-section.is-done .study-section-number {
  background: var(--pad);
}
.study-section-pattern {
  margin: 4px 0 0;
  font-weight: 700;
  color: var(--red);
}
.study-section-count {
  margin: 0;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--muted);
  text-align: right;
}
.study-sets {
  container-type: inline-size;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: 10px;
}
/* Each set has a Play button beside it, straight into its two games. */
.study-set-item {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.study-set-item > .study-set {
  flex: 1 1 auto;
  min-width: 0;
}
.study-set-play {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 58px;
  padding: 6px 8px;
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
  text-decoration: none;
  background: #3f7a2c;
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.15s;
}
.study-set-play[hidden] {
  display: none;
}
.study-set-play:hover {
  transform: translateY(-2px);
}
.study-play-icon {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.study-set {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 10px;
  height: 100%;
  min-height: 64px;
  padding: 10px 14px;
  background: var(--butter);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 3px 0 var(--ink);
  transition: transform 0.15s;
}
.study-set:hover {
  transform: translateY(-2px);
}
.study-set-label {
  font: 1.05rem/1.2 var(--heading);
}
.study-set-range {
  grid-column: 1 / -1;
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.study-set .study-meter {
  grid-column: 1 / -1;
  height: 8px;
  margin-top: 4px;
}
.study-set-badge {
  grid-row: 1;
  grid-column: 2;
  padding: 0 8px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--paper);
}
.study-set-badge:empty {
  display: none;
}
.study-set.is-done {
  background: #e3f3d8;
}
.study-set.is-done .study-set-badge {
  color: #fff;
  border-color: var(--pad-dark);
  background: var(--pad-dark);
}
/* Large text on a phone (200%): the set and its Play button stack, and the badge takes its own
   line, so nothing runs off the screen. At normal sizes the query never matches. */
@container (max-width: 13em) {
  .study-set-item {
    flex-direction: column;
  }
  .study-set-play {
    flex-direction: row;
    min-height: 44px;
  }
  .study-set {
    grid-template-columns: minmax(0, 1fr);
  }
  .study-set-badge {
    grid-row: 2;
    grid-column: 1;
    justify-self: start;
  }
}
.study-set--revision {
  background: var(--paper);
  border-style: dashed;
}
.study-set--review {
  background: var(--yellow);
  min-height: 80px;
}
.study-sets--review {
  grid-template-columns: minmax(0, 520px);
}
.study-list {
  margin-top: 12px;
}
.study-list summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.study-list-set {
  scroll-margin-top: 90px;
}
.study-list-set h3,
.study-list-set h4 {
  margin: 12px 0 6px;
  font: 1.1rem/1.2 var(--heading);
}
.study-list-set ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.study-list-set li {
  padding: 8px 12px;
  background: var(--butter);
  border-radius: 12px;
}
/* Make your own without JavaScript: each topic and the words that suit it. */
.study-list-make p {
  margin: 0 0 6px;
}
.study-list-set .study-list-fits {
  gap: 6px;
}
.study-list-set .study-list-fits li {
  padding: 0;
}
.study-list-fits li > [lang='ja']:first-child {
  font-weight: 700;
}
.study-list-word,
.study-list-pattern {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
}
.study-list-jp,
.study-pattern-jp {
  font-size: 1.2rem;
  font-weight: 700;
}
.study-list-romaji {
  font-weight: 700;
  color: var(--red);
}
.study-list-note,
.study-list-example,
.study-list-how {
  flex-basis: 100%;
  font-size: 0.9rem;
  color: var(--muted);
}
.study-list-drill summary {
  cursor: pointer;
}
.study-list-answer {
  margin: 6px 0 0;
  font-weight: 700;
}
.study-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin: 0 0 4px;
}
.study-line-jp {
  font-weight: 700;
}
.study-line-romaji {
  color: var(--red);
  font-size: 0.9rem;
}
.study-line-en {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.9rem;
}
.study-speaker {
  font-weight: 700;
}
.study-blank {
  display: inline-block;
  min-width: 2.4em;
  padding: 0 4px;
  margin: 0 2px;
  border-bottom: 3px solid var(--red);
  color: var(--red);
  text-align: center;
}
.study-blank.is-filled {
  background: var(--right);
  border-radius: 6px 6px 0 0;
  color: var(--ink);
  font-weight: 700;
}
.study-review-lessons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  font-weight: 700;
}
.study-review-lessons a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ════ The player ════ */
.study-player {
  scroll-margin-top: 4px;
}
.study-player-head {
  text-align: center;
  margin-bottom: 10px;
}
.study-player-head .eyebrow {
  margin-bottom: 4px;
  color: var(--red);
}
.study-player-head h2 {
  margin: 0 0 2px;
  font-size: clamp(1.8rem, 6vw, 3rem);
}
.study-player-head h2:focus {
  outline: none;
}
.study-player-range {
  margin: 0 0 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--muted);
}
/* A big review covers studied cards; this adds the rest. */
.study-review-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin: 0 0 6px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}
.study-review-all[hidden] {
  display: none;
}
.study-review-all input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--ink);
}
.study-player-head .study-progress-row {
  max-width: 420px;
  margin: 0 auto;
}
/* The tabs and the two sound switches share one row above the stage. */
.study-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 12px;
}
.study-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.study-tab {
  min-height: 46px;
  padding: 8px 16px;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}
.study-tab[aria-selected='true'] {
  background: var(--ink);
  color: var(--paper);
}
.study-tab:not([aria-selected='true']):hover {
  background: var(--butter);
}
.study-panel {
  padding: 22px 24px 26px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 24px 20px 26px 18px;
  box-shadow: 6px 6px 0 var(--ink);
}
.study-player-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}
/* The set buttons are secondary: the round's own answer or Next is the one primary button. */
.study-player-nav .study-player-next {
  margin-left: auto;
}
.study-count {
  margin: 0 0 12px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}
.study-count-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 12px;
}
.study-count-row .study-count {
  margin: 0;
}
.study-empty {
  margin: 0;
  text-align: center;
  font-weight: 700;
}
.study-done:empty {
  display: none;
}
.study-results h3 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
}
.study-result-detail {
  max-width: 50ch;
}
.study-results.is-record .study-result-kero {
  animation: study-cheer 0.9s ease-in-out 3;
}
.study-tricky-title {
  margin: 0 0 6px;
  font-weight: 700;
}
.study-tricky {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.study-tricky li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 6px 10px;
  background: var(--butter);
  border-radius: 10px;
}
.study-tricky-jp {
  font-weight: 700;
}
.study-tricky-romaji {
  color: var(--red);
}
@keyframes study-cheer {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  30% {
    transform: translateY(-22px) rotate(-8deg);
  }
  60% {
    transform: translateY(0) rotate(6deg);
  }
}

/* ════ Rounds of 4: the round bar, the answer sheet and the round summary ════
 * Shared by Flashcards and Learn (src/client/study-feedback.ts). Props such as cards, choices and
 * the sheet may tilt and squash; Kero only hops and turns as a whole picture.
 */
.learn-room--study {
  --orange: #c9661c;
  --orange-soft: #fde6c8;
  --green-ink: #2f6a24;
}
.round-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin: 0 0 12px;
}
.round-bar[hidden] {
  display: none;
}
.round-dots {
  display: flex;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.round-dot {
  width: 14px;
  height: 14px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
  transition:
    background 0.2s,
    transform 0.26s var(--ease-spring);
}
.round-dot.is-now {
  background: var(--butter);
  transform: scale(1.3);
}
.round-dot.is-right {
  background: var(--pad);
}
.round-dot.is-again {
  border-color: var(--orange);
  box-shadow: inset 0 0 0 2px var(--orange);
}
.round-dot.is-miss {
  background: var(--orange);
}
.round-text {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--muted);
}
.round-overall {
  font-weight: 700;
}
.round-streak {
  padding: 1px 10px;
  font: 1.05rem/1.4 var(--heading);
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 2px 0 var(--ink);
}
.round-streak[hidden] {
  display: none;
}
.round-streak.is-pop {
  animation: round-pop 0.32s var(--ease-spring);
}
@keyframes round-pop {
  from {
    transform: scale(0.5) rotate(-8deg);
  }
  to {
    transform: none;
  }
}

/* The answer sheet: rises from the bottom of the stage after every answer. */
.answer-sheet {
  position: absolute;
  right: -6px;
  bottom: -6px;
  left: -6px;
  z-index: 4;
  display: grid;
  gap: 8px;
  padding: 12px 14px 14px;
  border: 3px solid var(--ink);
  border-radius: 20px 18px 16px 16px;
  box-shadow:
    0 -6px 18px rgb(57 44 32 / 0.12),
    4px 4px 0 var(--ink);
  opacity: 0;
  transform: translateY(18px);
  transition:
    transform 0.26s var(--ease-out),
    opacity 0.18s;
}
.answer-sheet[hidden] {
  display: none;
}
/* Too long for the screen where it sits: docked to the bottom of the screen, scrolling inside. */
.answer-sheet.is-docked {
  position: fixed;
  right: 8px;
  bottom: 8px;
  left: 8px;
  z-index: 30;
  max-width: 640px;
  max-height: calc(100vh - 16px);
  max-height: calc(100dvh - 16px);
  margin: 0 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.answer-sheet.is-docked .answer-actions {
  position: sticky;
  bottom: -14px;
  margin: 0 -14px -14px;
  padding: 10px 14px 14px;
  background: inherit;
}
.answer-sheet.is-in {
  opacity: 1;
  transform: none;
}
.answer-sheet.is-right {
  background: #e4f5dc;
}
.answer-sheet.is-wrong {
  background: #fff0e6;
}
.answer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font: 1.45rem/1.1 var(--heading);
}
.is-right > .answer-head {
  color: var(--green-ink);
}
.is-wrong > .answer-head {
  color: var(--red);
}
.answer-mark {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  background: #fff;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.is-in .answer-mark {
  animation: round-pop 0.3s var(--ease-spring);
}
.mark-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.answer-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}
.answer-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 10px;
  margin: 0;
  font-weight: 700;
}
.answer-line-jp {
  font-size: 1.3rem;
  overflow-wrap: anywhere;
}
.answer-line-romaji,
.answer-romaji {
  color: var(--red);
}
.answer-big {
  display: grid;
  justify-items: start;
  gap: 1px;
}
.answer-jp-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}
.answer-jp {
  font-size: clamp(1.5rem, 7vw, 2.2rem);
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.answer-romaji {
  font: 1.2rem/1.2 var(--heading);
}
.answer-en {
  font-size: 1.08rem;
  font-weight: 700;
}
.answer-given,
.answer-note {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}
.answer-given s {
  color: var(--red);
  font-weight: 700;
}
.answer-given-romaji {
  font-weight: 600;
}
.answer-say {
  width: 34px;
  height: 34px;
  margin: 0;
}
.answer-say .speaker-icon {
  width: 19px;
  height: 19px;
}
.answer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.answer-actions .drawing-button[hidden] {
  display: none;
}
.answer-next {
  position: relative;
  min-width: 132px;
  overflow: hidden;
}
/* A right answer moves on by itself: a thin bar fills along the Next button meanwhile. */
.answer-timer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--ink);
  opacity: 0;
  transform: scaleX(0);
  transform-origin: left;
}
.answer-sheet.is-auto.is-in .answer-timer {
  opacity: 0.35;
  animation: answer-timer 0.9s linear forwards;
}
@keyframes answer-timer {
  to {
    transform: scaleX(1);
  }
}

/* The round summary: Kero, stars, the four answers, one clear next step. */
.study-done[hidden] {
  display: none;
}
.round-summary {
  position: relative;
  display: grid;
  gap: 14px;
  max-width: 560px;
  margin: 0 auto;
}
.round-summary-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.round-summary-kero {
  flex: none;
  width: 92px;
  height: auto;
}
.round-summary.is-cheer .round-summary-kero {
  animation: kero-cheer 0.8s var(--ease-out) 2;
}
@keyframes kero-cheer {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  35% {
    transform: translateY(-24px) rotate(-8deg);
  }
  65% {
    transform: translateY(0) rotate(5deg);
  }
}
.round-summary-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.round-summary-title {
  margin: 0;
  font-size: clamp(1.6rem, 6vw, 2.3rem);
}
.round-summary-title:focus {
  outline: none;
}
.round-summary-detail {
  margin: 0;
  font-weight: 700;
  color: var(--muted);
}
.round-stars {
  display: flex;
  gap: 4px;
  margin: 0;
}
.round-star .hop-star {
  display: block;
  width: 34px;
  height: 32px;
  fill: #fff;
  stroke: var(--ink);
  stroke-width: 2.6;
  stroke-linejoin: round;
}
.round-star.is-on .hop-star {
  fill: var(--yellow);
}
.round-star {
  animation: round-pop 0.34s var(--ease-spring) both;
}
.round-star:nth-child(2) {
  animation-delay: 0.12s;
}
.round-star:nth-child(3) {
  animation-delay: 0.24s;
}
.round-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.round-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
}
.round-row-mark {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid currentColor;
  border-radius: 50%;
}
.round-row-mark .mark-icon {
  width: 16px;
  height: 16px;
}
.round-row.is-right .round-row-mark {
  color: var(--green-ink);
  background: var(--right);
}
.round-row.is-again .round-row-mark {
  color: var(--orange);
  background: var(--orange-soft);
}
.round-row-words {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 10px;
  min-width: 0;
}
.round-row-jp {
  font-size: 1.15rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.round-row-romaji {
  color: var(--red);
  font-weight: 700;
}
.round-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.round-actions > :first-child {
  flex: 1 1 200px;
}
.round-play {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  border-top: 2px dashed rgb(57 44 32 / 0.25);
}
.round-play-label {
  margin-right: 4px;
  font: 1.1rem/1 var(--heading);
}
.round-play-link {
  flex: 1 1 0;
  justify-content: center;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
}
.round-confetti {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ════ Flashcards: a stack of cards to flip and swipe ════ */
.cards-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  max-width: 520px;
  margin: 0 auto;
}
.cards-stage[hidden] {
  display: none;
}
.card-deck {
  position: relative;
  display: grid;
  margin-bottom: 8px;
  /* A sorted card flies off sideways. Left unclipped, that overflow plus the next card rising
     made phone browsers scroll the page to the top on every Know it or Still learning. Clip
     sideways only, with room for the cards' offset shadow. */
  overflow-x: clip;
  overflow-clip-margin: 12px;
}
.card-ghost {
  grid-area: 1 / 1;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 22px 18px 24px 20px;
  box-shadow: 4px 4px 0 var(--ink);
}
.card-ghost[hidden] {
  display: none;
}
.card-ghost--1 {
  transform: translateY(7px) rotate(1.6deg) scale(0.975);
}
.card-ghost--2 {
  background: #f4ead2;
  transform: translateY(13px) rotate(-2.2deg) scale(0.95);
}
.flashcard {
  position: relative;
  z-index: 1;
  grid-area: 1 / 1;
  touch-action: pan-y;
}
.flashcard.is-rising {
  animation: card-rise 0.24s var(--ease-out);
}
@keyframes card-rise {
  from {
    transform: translateY(10px) scale(0.95);
  }
}
.flashcard--flyer {
  z-index: 3;
  pointer-events: none;
}
.flashcard--flyer .flashcard-stamp.is-shown {
  opacity: 1;
}
.flashcard.is-flying {
  transition:
    transform 0.22s var(--ease-in),
    opacity 0.22s ease-in;
}
.flashcard.is-back {
  transition: transform 0.26s var(--ease-spring);
}
.flashcard-face {
  display: block;
  width: 100%;
  padding: 0;
  font: inherit;
  color: var(--ink);
  text-align: center;
  background: none;
  border: 0;
  border-radius: 22px 18px 24px 20px;
  cursor: grab;
  touch-action: pan-y;
  perspective: 1400px;
  -webkit-tap-highlight-color: transparent;
}
.flashcard.is-dragging .flashcard-face {
  cursor: grabbing;
}
.flashcard-face:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 4px;
}
.flashcard-inner {
  display: grid;
  transform-style: preserve-3d;
  transition: transform 0.32s var(--ease-spring);
}
.flashcard.is-flipped .flashcard-inner {
  transform: rotateY(180deg);
}
.flashcard-side {
  grid-area: 1 / 1;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  /* Tall enough for most backs (a note included), so the buttons stay put from card to card. */
  min-height: 290px;
  padding: 26px 20px 28px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 22px 18px 24px 20px;
  box-shadow: 6px 6px 0 var(--ink);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.study-card-back.flashcard-side {
  background: #eef8e6;
  transform: rotateY(180deg);
}
.flashcard-stamp {
  position: absolute;
  top: 62px;
  z-index: 2;
  padding: 4px 12px;
  font: 1.25rem/1.2 var(--heading);
  background: rgb(255 255 255 / 0.88);
  border: 3px solid currentColor;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
}
.flashcard-stamp.is-know {
  left: 16px;
  color: var(--green-ink);
  transform: rotate(-12deg);
}
.flashcard-stamp.is-learning {
  right: 16px;
  color: var(--orange);
  transform: rotate(10deg);
}
.flashcard-again {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--orange-soft);
  border: 2px solid var(--ink);
  border-radius: 999px;
  pointer-events: none;
}
.flashcard-again[hidden] {
  display: none;
}
.study-card-sound {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  gap: 8px;
}
.study-card-hint {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}
.study-card-jp {
  font-size: clamp(2rem, 9.5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.study-card-romaji {
  font: 1.7rem/1.1 var(--heading);
  color: var(--red);
}
.study-card-meaning {
  font: clamp(1.6rem, 6vw, 2.2rem)/1.15 var(--heading);
}
.study-card-visual .learn-art,
.study-card-visual .clock,
.study-card-visual .visual {
  width: 104px;
  height: 104px;
}
.study-card-visual .visual--days,
.study-card-visual .visual--span,
.study-card-visual .visual--week {
  width: 170px;
  height: auto;
}
.study-card-kana {
  font-size: clamp(1.5rem, 6vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.study-card-example {
  display: grid;
  gap: 2px;
  max-width: 40ch;
  padding: 8px 12px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 14px;
  font-size: 0.95rem;
}
.study-card-example-jp {
  font-size: 1.1rem;
  font-weight: 700;
}
.study-card-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
}
.study-card-note {
  max-width: 42ch;
  font-size: 0.95rem;
  color: var(--muted);
}
.study-card-pattern {
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  font-weight: 700;
}
.study-card-line {
  display: grid;
  gap: 2px;
}
.study-card-speaker {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}
.study-card-sentence {
  font-size: clamp(1.35rem, 5vw, 1.9rem);
  font-weight: 700;
}
.study-card-romaji-small {
  color: var(--red);
  font-weight: 700;
}
.study-card-english {
  font-size: 1.1rem;
}
.study-piles {
  display: grid;
  /* Side by side, or one above the other once large text no longer fits two. */
  grid-template-columns: repeat(auto-fit, minmax(min(6.5rem, 100%), 1fr));
  gap: 12px;
}
.study-pile {
  min-height: 54px;
  gap: 8px;
  padding: 8px 10px;
}
.study-pile--learning {
  background: var(--orange-soft);
}
.study-pile-count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  font-size: 0.85rem;
  background: rgb(255 255 255 / 0.75);
  border: 2px solid var(--ink);
  border-radius: 999px;
}
.study-pile-arrow {
  font-size: 1.1rem;
}
.card-sides {
  justify-self: center;
}
.study-toggle {
  display: inline-flex;
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}
.study-chip {
  min-height: 44px;
  padding: 6px 14px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
}
.study-toggle .study-chip {
  border: 0;
  border-radius: 0;
}
.study-toggle .study-chip + .study-chip {
  border-left: 2px solid var(--ink);
}
.study-chip[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
}
@media (min-width: 720px) {
  .flashcard-side {
    min-height: 320px;
  }
}
@media (max-width: 380px) {
  .study-pile {
    font-size: 0.9rem;
    gap: 6px;
  }
  .study-pile-arrow {
    display: none;
  }
  .flashcard-side {
    min-height: 250px;
  }
}

/* ════ Learn: one question at a time, on a stage that never jumps ════ */
.ask-stage {
  position: relative;
  min-height: 360px;
  max-width: 620px;
  margin: 0 auto;
}
.ask-stage[hidden] {
  display: none;
}
.ask-question {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  text-align: center;
}
.ask-prompt {
  margin: 0;
  font-weight: 700;
  color: var(--muted);
}
.ask-target {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  min-height: 100px;
  padding: 12px 46px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 20px 16px 22px 18px;
  box-shadow: 4px 4px 0 var(--ink);
}
.ask-target--sentence {
  padding: 12px 14px;
}
.ask-target:focus {
  outline: none;
}
.ask-target:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 3px;
}
.ask-target--gap {
  justify-items: stretch;
  padding: 12px 14px;
  text-align: left;
}
.ask-target--listen {
  background: var(--butter);
}
.ask-jp {
  font-size: clamp(1.9rem, 8.5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.ask-jp.is-long,
.ask-line-jp.is-very-long {
  font-size: clamp(1.6rem, 6vw, 2.3rem);
}
.ask-jp.is-very-long {
  font-size: clamp(1.3rem, 5vw, 1.8rem);
}
.ask-romaji {
  font: 1.25rem/1.2 var(--heading);
  color: var(--red);
}
.ask-romaji--line {
  font: 700 1rem/1.3 var(--romaji);
}
.ask-line--romaji {
  justify-content: center;
}
.ask-en {
  font: clamp(1.5rem, 6vw, 2.1rem)/1.15 var(--heading);
}
.ask-target .ask-say {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
}
.ask-visual .learn-art,
.ask-visual .clock,
.ask-visual .visual {
  width: 88px;
  height: 88px;
}
.ask-visual .visual--days,
.ask-visual .visual--span,
.ask-visual .visual--week {
  width: 150px;
  height: auto;
}
.ask-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: baseline;
  gap: 2px 8px;
  margin: 0;
}
.ask-line-speaker {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.ask-line-jp {
  font-size: clamp(1.3rem, 5.4vw, 1.8rem);
  font-weight: 700;
}
/* Japanese with spaces between its words wraps at the spaces, never inside a word: everywhere
   in the lessons (the Pattern tab, word lists, blocks), not just in the questions. */
.learn-room--study [lang='ja'],
.ask-line-jp,
.ask-jp,
.answer-jp,
.answer-line-jp,
.round-row-jp,
.study-card-sentence,
.study-card-jp,
.study-card-kana,
.ask-choice-jp {
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.ask-line--before .ask-line-jp {
  font-size: 1.05rem;
}
.ask-line-en {
  flex-basis: 100%;
  font-size: 0.9rem;
  color: var(--muted);
}
.ask-target .ask-line--main .ask-say {
  position: static;
  width: 32px;
  height: 32px;
}
.ask-choices {
  display: grid;
  gap: 8px;
}
.ask-choices[hidden] {
  display: none;
}
.ask-choices.is-grid {
  grid-template-columns: 1fr 1fr;
}
.ask-choice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 6px 14px;
  font: 700 1.05rem/1.25 var(--body);
  color: var(--ink);
  text-align: center;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  overflow-wrap: anywhere;
  transition:
    transform 90ms,
    box-shadow 90ms,
    background 0.15s;
}
/* Hover only where there is a mouse: on a phone a tap leaves :hover on the spot, and the next
   question's choice under it would look picked already. */
@media (hover: hover) {
  .ask-choice:not(:disabled):hover {
    background: var(--butter);
  }
}
.ask-choice:not(:disabled):active {
  box-shadow: 0 1px 0 var(--ink);
  transform: translateY(3px);
}
.ask-choice:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 3px;
}
.ask-choice:disabled {
  cursor: default;
}
.ask-choice:disabled:not(.is-right, .is-wrong) {
  opacity: 0.5;
}
.ask-choice.is-right {
  background: var(--right);
  animation: choice-pop 0.3s var(--ease-spring);
}
.ask-choice.is-wrong {
  background: var(--wrong);
  animation: choice-shake 0.24s;
}
@keyframes choice-pop {
  50% {
    transform: scale(1.05);
  }
}
@keyframes choice-shake {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}
.ask-choice-key {
  display: none;
  position: absolute;
  top: 4px;
  left: 7px;
  font-size: 0.72rem;
  color: var(--muted);
}
@media (hover: hover) and (pointer: fine) {
  .ask-choice-key {
    display: block;
  }
}
.ask-choice-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.ask-choice-jp {
  font-size: 1.35rem;
}
.ask-choice-jp.is-long {
  font-size: 1.1rem;
}
.ask-dunno {
  min-height: 44px;
  padding: 6px 12px;
  font: 700 0.95rem/1.2 var(--body);
  color: var(--muted);
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}
.ask-dunno:disabled {
  opacity: 0.5;
  cursor: default;
}
.ask-question.is-enter .ask-target,
.ask-question.is-enter .ask-choice {
  animation: learn-in 0.26s var(--ease-out) both;
}
.ask-question.is-enter .ask-choice:nth-child(2) {
  animation-delay: 0.04s;
}
.ask-question.is-enter .ask-choice:nth-child(3) {
  animation-delay: 0.08s;
}
.ask-question.is-enter .ask-choice:nth-child(4) {
  animation-delay: 0.12s;
}
/* Slide and settle without fading, so the question and its answers are readable (and pass the
   contrast audit) from the first frame. */
@keyframes learn-in {
  from {
    transform: translateY(10px) scale(0.96);
  }
}
/* A finished set or run has its own Next button, so the player's set buttons step aside. */
.study-player:has(.study-panel:not([hidden]) .round-play) .study-player-nav,
.study-player:has(.study-panel:not([hidden]) .round-summary--end) .study-player-nav,
.study-player:has(.study-panel:not([hidden]) .make-done) .study-player-nav {
  display: none;
}
@media (max-width: 520px) {
  /* On a phone the round needs the room; the set's words are on its cards. */
  .study-player-range {
    display: none;
  }
  .ask-question {
    gap: 10px;
  }
}
.study-pattern-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}
@media (prefers-reduced-motion: reduce) {
  .flashcard-inner,
  .flashcard.is-flipped .flashcard-inner {
    transform: none;
    transition: none;
  }
  .flashcard-side {
    backface-visibility: visible;
    -webkit-backface-visibility: visible;
    transition: opacity 0.15s;
  }
  .study-card-back.flashcard-side {
    visibility: hidden;
    opacity: 0;
    transform: none;
  }
  .flashcard.is-flipped .study-card-back {
    visibility: visible;
    opacity: 1;
  }
  .flashcard.is-flipped .study-card-front {
    visibility: hidden;
    opacity: 0;
  }
  .flashcard.is-rising,
  .ask-question.is-enter .ask-target,
  .ask-question.is-enter .ask-choice,
  .ask-choice.is-right,
  .ask-choice.is-wrong,
  .round-streak.is-pop,
  .round-star,
  .is-in .answer-mark,
  .round-summary.is-cheer .round-summary-kero {
    animation: none;
  }
  .answer-sheet {
    transform: none;
    transition: opacity 0.15s;
  }
  .answer-sheet.is-auto.is-in .answer-timer {
    animation: none;
  }
  .round-dot,
  .ask-choice {
    transition: none;
  }
}
@media (forced-colors: active) {
  .round-dot.is-right,
  .round-dot.is-miss,
  .round-dot.is-now {
    background: Highlight;
  }
  .answer-sheet,
  .flashcard-side,
  .ask-choice {
    border-color: CanvasText;
  }
}

/* Lily pads and Gyoza Grab: see the sections at the end of this file. */

/* Grammar */
.study-patterns {
  display: grid;
  gap: 16px;
}
.study-patterns-intro {
  margin: 0;
  font-weight: 700;
}
.study-pattern-card {
  padding: 18px 20px;
  background: var(--butter);
  border: 3px solid var(--ink);
  border-radius: 18px 22px 16px 20px;
}
.study-pattern-card .eyebrow {
  margin-bottom: 4px;
  color: var(--red);
}
.study-pattern-card .study-pattern-jp {
  margin: 0;
  font-size: clamp(1.6rem, 5vw, 2.2rem);
}
.study-pattern-romaji {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--red);
}
.study-pattern-meaning {
  margin: 0 0 6px;
  font: 1.3rem/1.2 var(--heading);
}
.study-pattern-how {
  max-width: 62ch;
  margin: 0;
}
.study-examples-title {
  margin: 16px 0 8px;
  font: 1.15rem/1.2 var(--heading);
}
.study-examples {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.study-example {
  padding: 10px 12px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 14px;
}
.study-say {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 0 0 8px;
}
.study-say-body {
  display: grid;
  gap: 1px;
  min-width: 0;
}
.study-say:last-child {
  margin-bottom: 0;
}
.study-say-name {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.study-say-jp {
  font-size: 1.25rem;
  font-weight: 700;
}
.study-say-romaji {
  color: var(--red);
  font-weight: 700;
}
.study-say-en {
  color: var(--muted);
}
.study-face {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  object-fit: cover;
  object-position: top;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.study-face--text {
  display: inline-grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--butter);
}
.study-more-examples,
.study-pattern-fold {
  margin-top: 12px;
}
.study-more-examples summary,
.study-pattern-fold summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  min-height: 44px;
  padding: 8px 0;
  font-weight: 700;
  cursor: pointer;
}
.study-pattern-fold {
  padding: 4px 14px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 14px;
}
.study-pattern-fold[open] {
  padding-bottom: 14px;
}
.study-fold-jp {
  font-size: 1.2rem;
}
.study-fold-en {
  color: var(--muted);
}
.study-gap-hint {
  margin: 6px 0 0;
  font-weight: 700;
  color: var(--red);
}

@media (max-width: 720px) {
  .study-panel {
    padding: 14px 12px 16px;
  }
  .study-section {
    padding: 16px 14px 14px;
  }
  .study-section-head {
    flex-wrap: wrap;
  }
  .study-section-count {
    flex-basis: 100%;
    text-align: left;
  }
  .study-sets {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  .study-lesson,
  .study-set,
  .study-meter > span {
    transition: none;
  }
  .study-lesson:hover,
  .study-set:hover,
  .study-tile[aria-pressed='true'] {
    transform: none;
  }
}
@media (forced-colors: active) {
  .study-set,
  .study-section,
  .study-panel,
  .study-card-face,
  .study-tile,
  .study-lesson {
    box-shadow: none;
  }
  .study-tab[aria-selected='true'],
  .study-chip[aria-pressed='true'],
  .study-tile[aria-pressed='true'] {
    outline: 3px solid Highlight;
  }
  .hop-label {
    border-color: CanvasText;
  }
}

/* Long phrases shrink so they still fit a phone. */
.study-card-jp.is-long {
  font-size: clamp(1.6rem, 6vw, 2.3rem);
}
.study-card-jp.is-very-long {
  font-size: clamp(1.3rem, 5vw, 1.8rem);
}
.learn-room--study.is-playing > .learn-back {
  display: none;
}
@media (max-width: 520px) {
  .study-tabs {
    gap: 5px;
  }
  .study-tab {
    min-height: 44px;
    padding: 6px 11px;
    font-size: 0.9rem;
  }
  .study-bar {
    gap: 6px;
  }
  /* On a phone the switches show just their icons; their names stay for screen readers. */
  .study-switch {
    justify-content: center;
    width: 44px;
    padding: 0;
  }
  .study-switch-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
}
@media (max-width: 360px) {
  .study-tab {
    padding: 6px 8px;
    font-size: 0.86rem;
  }
}

/* While a set is open, the lesson title shrinks to one line above the player. */
.learn-room--study.is-playing .study-head {
  margin-bottom: 6px;
}
.learn-room--study.is-playing .study-head h1.lesson-title {
  font-size: clamp(1.4rem, 4vw, 1.8rem);
}
.learn-room--study.is-playing .study-head .eyebrow,
.learn-room--study.is-playing .study-head .lesson-romaji,
.learn-room--study.is-playing .study-head .study-summary {
  display: none;
}

/* ════ Lily pads ════
 * One portrait stage: the painted pond scrolls under a camera, the pads are drawn in code, and
 * Kero and Goro move only as whole pictures (translate, rotate, uniform scale, opacity).
 * JavaScript sets transforms through the CSSOM, never a style attribute.
 */
.learn-room--study,
.play-host {
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-in: cubic-bezier(0.5, 0, 0.9, 0.4);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}
/* The games also run on the kana and numbers lessons, which have their own page colours. */
.play-host {
  --pond: #8bd1d6;
  --pad: #6fae4f;
  --pad-dark: #3f7a2c;
  --right: #cfeccb;
  --wrong: #f6d2cc;
}
.play-host [lang='ja'] {
  font-family: 'Kero Japanese', var(--body);
}
.study-panel[data-panel='play'] {
  padding: 10px;
}
.hop-stage {
  position: relative;
  width: min(100%, 520px);
  height: clamp(460px, calc(100vh - 28px), 720px);
  height: clamp(460px, calc(100svh - 28px), 720px);
  /* Taller only when a long card needs it, so the pads ahead stay clear (study-hop.ts). */
  min-height: var(--hop-need-h, 0px);
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  background: #5ed8c3;
  border: 3px solid var(--ink);
  border-radius: 20px;
  scroll-margin-top: 10px;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.hop-scene,
.hop-fx,
.hop-front {
  position: absolute;
  inset: 0;
}
.hop-scene {
  z-index: 0;
}
.hop-scene.is-arriving {
  animation: hop-fade-in 0.35s ease-out;
}
.hop-fx {
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.hop-scene.is-shaking {
  animation: hop-shake 0.2s linear;
}
.hop-world {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  will-change: transform;
}
.hop-water,
.hop-far-water {
  background-color: #5ed8c3;
  background-image: url('/assets/study/pond-water-720.webp');
  background-image: -webkit-image-set(
    url('/assets/study/pond-water-720.webp') 1x,
    url('/assets/study/pond-water.webp') 2x
  );
  background-image: image-set(
    url('/assets/study/pond-water-720.webp') 1x,
    url('/assets/study/pond-water.webp') 2x
  );
  background-repeat: repeat-y;
  background-size: 100% auto;
}
.hop-water {
  position: absolute;
  inset: 0;
}
.hop-far {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
}
.hop-far.is-moving {
  transition: transform 0.42s var(--ease-out);
}
.hop-sky {
  position: relative;
  height: 1600px;
  background: linear-gradient(to bottom, #f1fbff 0%, #d6f2fd 70%, #bcebfe 100%);
}
/* Two soft clouds just above the far bank's roofs, drawn in code. */
.hop-sky::before,
.hop-sky::after {
  content: '';
  position: absolute;
  bottom: 34px;
  width: 30%;
  height: 34px;
  background:
    radial-gradient(circle at 30% 70%, #fff 0 38%, transparent 40%),
    radial-gradient(circle at 55% 45%, #fff 0 44%, transparent 46%),
    radial-gradient(circle at 78% 70%, #fff 0 34%, transparent 36%);
  opacity: 0.9;
}
.hop-sky::before {
  left: 8%;
}
.hop-sky::after {
  right: 6%;
  bottom: 70px;
  width: 24%;
  opacity: 0.75;
}
.hop-far-art {
  display: block;
  width: 100%;
  height: auto;
  margin-top: -1px;
}
.hop-far-water {
  height: 0;
  margin-top: -1px;
  background-position: center top;
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
}
.hop-near {
  position: absolute;
  left: 0;
  bottom: 0;
  display: block;
  width: 100%;
  height: auto;
}
/* Light glinting on the water: two drifting layers of code-drawn highlights. */
.hop-shimmer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}
.hop-shimmer::before,
.hop-shimmer::after {
  content: '';
  position: absolute;
  inset: -40px -60px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='170'%3E%3Cg fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-width='2.4'%3E%3Cpath d='M18 30q9-6 18 0'/%3E%3Cpath d='M122 74q11-7 22 0'/%3E%3Cpath d='M58 128q8-5 16 0'/%3E%3Cpath d='M176 146q8-5 16 0'/%3E%3C/g%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='92' cy='22' r='1.8'/%3E%3Ccircle cx='172' cy='98' r='1.5'/%3E%3Ccircle cx='34' cy='88' r='1.3'/%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.32;
  animation: hop-drift 9s ease-in-out infinite alternate;
}
.hop-shimmer::after {
  background-position: 110px 60px;
  opacity: 0.22;
  animation:
    hop-drift 12s ease-in-out -4s infinite alternate-reverse,
    hop-twinkle 3.6s ease-in-out infinite alternate;
}
.hop-rows {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.hop-row {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
}
.hop-pad {
  position: absolute;
  bottom: 0;
  width: 29%;
  padding: 0;
  font: inherit;
  color: var(--ink);
  background: none;
  border: 0;
  transform: translate(-50%, 50%);
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
.hop-row--3 .hop-pad:nth-child(1) {
  left: 20%;
}
.hop-row--3 .hop-pad:nth-child(2) {
  left: 50%;
}
.hop-row--3 .hop-pad:nth-child(3) {
  left: 80%;
}
.hop-row--2 .hop-pad {
  width: 38%;
}
.hop-row--2 .hop-pad:nth-child(1) {
  left: 30%;
}
.hop-row--2 .hop-pad:nth-child(2) {
  left: 70%;
}
.hop-pad:disabled {
  cursor: default;
}
.hop-pad:focus {
  outline: none;
}
.hop-pad-sink,
.hop-pad-float,
.hop-pad-bob {
  position: relative;
  display: block;
}
.hop-pad-float {
  transition:
    transform 0.32s var(--ease-spring),
    opacity 0.28s ease-out;
}
.hop-pad:nth-child(2) .hop-pad-float {
  transition-delay: 60ms;
}
.hop-pad:nth-child(3) .hop-pad-float {
  transition-delay: 120ms;
}
.hop-row.is-submerged .hop-pad-float {
  opacity: 0.45;
  transform: translateY(10px) scale(0.86);
}
.hop-row.is-submerged .hop-label,
.hop-row.is-submerged .hop-lotus {
  visibility: hidden;
}
.hop-pad-bob {
  animation: hop-bob 3s ease-in-out infinite;
}
.hop-pad:nth-child(2) .hop-pad-bob {
  animation-delay: -1s;
}
.hop-pad:nth-child(3) .hop-pad-bob {
  animation-delay: -2s;
}
/* A slow ring of water spreading round each pad. */
.hop-pad-sink::before {
  content: '';
  position: absolute;
  left: 2%;
  right: 2%;
  top: 34%;
  height: 52%;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  opacity: 0;
  animation: hop-ripple 3.4s ease-out infinite;
}
.hop-pad:nth-child(2) .hop-pad-sink::before {
  animation-delay: -1.2s;
}
.hop-pad:nth-child(3) .hop-pad-sink::before {
  animation-delay: -2.3s;
}
.hop-leaf {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.hop-leaf-shadow {
  fill: rgba(12, 74, 78, 0.24);
}
.hop-leaf-under {
  fill: #2f6a25;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linejoin: round;
}
.hop-leaf-top {
  fill: #6fb04e;
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linejoin: round;
}
.hop-leaf-light {
  fill: #93d468;
  opacity: 0.75;
}
.hop-leaf-vein {
  fill: none;
  stroke: #3f7a2c;
  stroke-width: 1.8;
  stroke-linecap: round;
  opacity: 0.8;
}
.hop-lotus {
  position: absolute;
  top: -30%;
  right: -4%;
  width: 30%;
  height: auto;
  pointer-events: none;
}
.hop-label {
  position: absolute;
  top: 48%;
  left: 50%;
  display: block;
  width: max-content;
  max-width: 92%;
  padding: 3px 7px;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.18;
  text-align: center;
  overflow-wrap: break-word;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 2px 0 var(--ink);
  transform: translate(-50%, -50%);
  transition: transform 0.15s var(--ease-out);
}
.hop-label:empty {
  display: none;
}
.hop-key {
  position: absolute;
  top: -9px;
  left: -9px;
  display: none;
  width: 20px;
  height: 20px;
  font: 700 0.72rem/16px var(--body);
  text-align: center;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--paper);
  border-radius: 50%;
}
@media (hover: hover) and (pointer: fine) {
  .hop-key {
    display: block;
  }
}
.hop-label.is-long {
  font-size: 0.8rem;
}
.hop-label.is-very-long {
  font-size: 0.72rem;
}
.hop-label.is-jp {
  max-width: 100%;
  padding-inline: 5px;
}
.hop-label-jp {
  display: block;
  font-size: 1.22rem;
  line-height: 1.15;
  white-space: nowrap;
}
.hop-label.is-long .hop-label-jp {
  font-size: 1.04rem;
}
.hop-label.is-very-long .hop-label-jp {
  font-size: 0.88rem;
}
.hop-label.is-wrap .hop-label-jp {
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
@media (hover: hover) {
  .hop-pad:not(:disabled):hover .hop-label {
    transform: translate(-50%, -58%);
  }
}
.hop-pad:focus-visible .hop-label {
  outline: 3px solid #075693;
  outline-offset: 3px;
}
.hop-pad.is-pressed .hop-pad-float {
  transform: translateY(3px);
  transition-duration: 0.09s;
}
.hop-pad.is-landed .hop-pad-float {
  animation: hop-dip 0.38s var(--ease-out);
}
.hop-pad.is-right .hop-label {
  background: var(--right);
  opacity: 0;
  transition: opacity 0.2s 0.15s;
}
.hop-pad.is-gone .hop-pad-float {
  animation: hop-wobble-sink 0.7s ease-in forwards;
}
.hop-pad.is-tipped .hop-pad-float {
  animation: hop-tip 0.45s var(--ease-in) 0.05s forwards;
}
.hop-pad.is-under .hop-pad-float {
  animation: hop-under 0.4s ease-in forwards;
}
.hop-pad.is-gold .hop-pad-float {
  animation: hop-resurface 0.4s var(--ease-spring) both;
}
.hop-pad.is-gold .hop-label {
  background: #ffe08a;
}
.hop-pad-bob::after {
  content: '';
  position: absolute;
  left: -6%;
  right: -6%;
  top: 8%;
  height: 84%;
  border: 4px solid #ffd23f;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.hop-pad.is-gold .hop-pad-bob::after {
  animation: hop-glow 0.8s ease-in-out 0.4s 2 both;
}
/* A streak of three makes the labels glint. */
.hop-row.is-glinting .hop-label {
  background-image: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255, 236, 160, 0.9) 48%,
    transparent 66%
  );
  background-size: 260% 100%;
  animation: hop-glint 1.4s ease-in-out 0.3s 1 both;
}

/* Kero and his shadow */
.hop-kero {
  position: absolute;
  left: 0;
  bottom: 0;
  width: var(--kero-w, 86px);
  will-change: transform;
  pointer-events: none;
}
.hop-kero-sink {
  position: relative;
  display: block;
  transform-origin: 50% 100%;
}
.hop-kero-sink.is-sinking {
  overflow: hidden;
  margin-top: -220px;
  padding-top: 220px;
}
.hop-kero-img {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 50% 100%;
}
.hop-stage[data-state='ready'] .hop-kero-sink,
.hop-stage[data-state='intro'] .hop-kero-sink {
  animation: hop-breathe 2.6s ease-in-out infinite;
}
.hop-kero.is-happy .hop-kero-sink {
  animation: hop-happy 0.46s var(--ease-out) 2;
}
.hop-kero.is-startled .hop-kero-sink {
  animation: hop-startle 0.42s var(--ease-out);
}
.hop-shadow {
  position: absolute;
  left: 0;
  bottom: 0;
  width: calc(var(--kero-w, 86px) * 0.72);
  height: calc(var(--kero-w, 86px) * 0.2);
  background: rgba(16, 58, 52, 0.3);
  border-radius: 50%;
  pointer-events: none;
}

/* Reeds in front, and Goro hiding behind the right-hand clump */
.hop-front {
  overflow: hidden;
  pointer-events: none;
}
.hop-reeds {
  position: absolute;
  bottom: -3%;
  width: auto;
  height: 25%;
  transform-origin: 50% 100%;
  animation: hop-sway 5s ease-in-out infinite alternate;
}
.hop-reeds--left {
  left: -8%;
  height: 22%;
}
.hop-hide {
  position: absolute;
  right: -7%;
  bottom: -3%;
  height: 26%;
  aspect-ratio: 568 / 900;
}
.hop-reeds-clump {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform-origin: 50% 100%;
  animation: hop-sway 5s ease-in-out -2.4s infinite alternate;
}
.hop-goro {
  position: absolute;
  left: 6%;
  bottom: 34%;
  width: 84%;
  transform: translateY(110%);
  transition: transform 0.26s var(--ease-spring);
}
.hop-goro.is-peek {
  transform: translateY(6%);
  transition-duration: 0.4s;
  transition-timing-function: var(--ease-out);
}
.hop-goro.is-up {
  transform: translateY(-72%);
}
.hop-goro.is-sulking {
  transform: translateY(70%) rotate(-10deg);
  transition-duration: 0.7s;
  transition-timing-function: var(--ease-in);
}
.hop-goro-img {
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 50% 90%;
}
.hop-goro.is-peek .hop-goro-img {
  animation: hop-look 4.2s ease-in-out infinite;
}
.hop-goro.is-laughing .hop-goro-img {
  animation: hop-laugh 0.5s ease-in-out 2;
}

/* Heads-up: takoyaki, crossing, streak, sound */
.hop-hud {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  pointer-events: none;
}
.hop-hud > * {
  pointer-events: auto;
}
.hop-hud.is-quiet .hop-boat,
.hop-hud.is-quiet .hop-crossing,
.hop-hud.is-quiet .hop-combo,
.hop-stage[data-state='results'] .hop-crossing,
.hop-stage[data-state='results'] .hop-combo {
  visibility: hidden;
}
.hop-boat {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  width: 94px;
  height: 40px;
  padding: 0 8px 7px;
}
.hop-boat-tray {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 22px;
}
.hop-boat-wood {
  fill: #ecc98c;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linejoin: round;
}
.hop-boat-grain {
  fill: none;
  stroke: #c79a55;
  stroke-width: 1.4;
}
.hop-boat-ball {
  position: relative;
  width: 26px;
  height: 26px;
  transition:
    opacity 0.2s,
    transform 0.2s;
}
.hop-boat-ball.is-gone {
  opacity: 0;
  transform: scale(0.4);
}
.hop-tako {
  display: block;
  width: 100%;
  height: 100%;
}
.hop-tako-ball {
  fill: #d99140;
  stroke: var(--ink);
  stroke-width: 2;
}
.hop-tako-shade {
  fill: #b4692a;
}
.hop-tako-sauce {
  fill: #5b2d14;
}
.hop-tako-mayo {
  fill: none;
  stroke: #fffaf0;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hop-tako-nori {
  fill: #3f8a2c;
}
.hop-tako-flake {
  fill: #f0c49a;
}
.hop-tako-shine {
  fill: none;
  stroke: #f3c27c;
  stroke-width: 2;
  stroke-linecap: round;
}
.hop-flyer {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  width: 26px;
  height: 26px;
  pointer-events: none;
}
.hop-crossing {
  margin: 0 auto;
  padding: 2px 10px;
  white-space: nowrap;
  font-weight: 700;
  font-size: 0.85rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
}
.hop-crossing:empty {
  visibility: hidden;
}
.hop-combo {
  margin: 0;
  padding: 2px 8px;
  font: 1.05rem/1.2 var(--heading);
  color: var(--paper);
  background: var(--ink);
  border-radius: 999px;
}
.hop-combo:empty {
  display: none;
}
.hop-combo.is-hot {
  color: var(--yellow);
}
.hop-sound {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 2px 0 var(--ink);
  cursor: pointer;
}
.hop-sound .speaker-icon {
  width: 24px;
  height: 24px;
}
.hop-sound[aria-pressed='false'] .speaker-waves {
  opacity: 0;
}
.hop-sound[aria-pressed='false']::after {
  content: '';
  position: absolute;
  width: 26px;
  height: 3px;
  background: var(--ink);
  border-radius: 2px;
  transform: rotate(-45deg);
}
.hop-sound:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 2px;
}

/* The prompt card: the question, then the answer in the same place */
.hop-card {
  position: absolute;
  top: 58px;
  left: 10px;
  right: 10px;
  z-index: 3;
  padding: 12px 14px 16px;
  text-align: center;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--ink);
}
.hop-card[hidden] {
  display: none;
}
.hop-card:focus {
  outline: none;
}
.hop-card:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 3px;
}
.hop-card.is-right {
  background: #effae9;
}
.hop-card.is-wrong {
  background: #fff3ee;
}
.hop-card-body {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 3px;
  max-height: calc(var(--stage-h, 600px) - 100px);
  overflow-y: auto;
}
/* A short prompt with no speaker (a sound to pick the kana for, a particle's job) never needs
   scrolling, and with nothing in it to focus it must not become a scroll box at all: a romaji
   sound overflows its line box by a few pixels, which would show a scroll bar on Windows and
   fail the keyboard scroll check. */
.hop-card-body:not(:has(button)) {
  overflow: visible;
}
.hop-card-body.is-new {
  animation: hop-card-in 0.22s var(--ease-out);
}
.hop-clock-ring {
  position: absolute;
  top: -3px;
  left: -3px;
  width: calc(100% + 6px);
  height: calc(100% + 6px);
  overflow: visible;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.hop-clock-track {
  fill: none;
  stroke: none;
}
.hop-clock-left {
  fill: none;
  stroke: #f0a63a;
  stroke-width: 5;
  stroke-dasharray: 100 100;
  stroke-linecap: round;
}
.hop-card.is-timed .hop-clock-ring {
  opacity: 1;
}
.hop-card.is-hurry .hop-clock-left {
  stroke: var(--red);
}
.hop-clock-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  display: none;
  height: 5px;
  background: var(--red);
  border-radius: 3px;
  transform-origin: left center;
}
.hop-prompt-jp {
  font-size: clamp(1.9rem, 8vw, 2.5rem);
  font-weight: 700;
  line-height: 1.1;
}
.hop-prompt-jp.is-long {
  font-size: clamp(1.5rem, 6vw, 2rem);
}
.hop-prompt-jp.is-very-long {
  font-size: clamp(1.2rem, 5vw, 1.6rem);
}
.hop-prompt-romaji,
.hop-answer-romaji {
  font: 1.08rem/1.2 var(--heading);
  color: var(--red);
}
/* A particle's sound alone (wa, o, e) is too short to read at the romaji's usual size. */
.hop-prompt-romaji--big {
  font-size: 1.7rem;
}
.hop-prompt-ask {
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.hop-prompt-en {
  font: clamp(1.3rem, 5.4vw, 1.7rem)/1.15 var(--heading);
}
/* A long meaning stays short enough that the card never reaches the pads on a small phone. */
.hop-prompt-en.is-long {
  font-size: clamp(1.1rem, 4.6vw, 1.45rem);
}
.hop-prompt-en.is-very-long {
  font-size: clamp(1rem, 4.1vw, 1.25rem);
}
/* The English to spell, with the word's picture or clock beside it. */
.hop-prompt-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px 10px;
}
.hop-prompt-visual {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
}
.hop-prompt-visual > *,
.hop-prompt-visual img,
.hop-prompt-visual svg {
  max-width: 48px;
  max-height: 48px;
  width: auto;
  height: auto;
}
.hop-prompt-visual .time-prompt-text {
  display: none;
}
.hop-context {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}
.hop-context-name {
  font-weight: 700;
}
.hop-pieces {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin: 2px 0;
}
.hop-piece {
  max-width: 100%;
  padding: 2px 8px;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.35;
  /* A piece is a word or two: it moves to the next line whole, never split from its 。 */
  white-space: nowrap;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 10px;
}
.hop-piece.has-gap {
  border-style: dashed;
}
.hop-piece.has-gap:has(.hop-filled) {
  border-style: solid;
}
.hop-piece.is-long {
  font-size: 0.98rem;
}
.hop-blank {
  display: inline-block;
  min-width: 2em;
  color: var(--red);
}
.hop-filled {
  color: #1f6b2a;
  text-decoration: underline 3px;
  text-underline-offset: 4px;
}
.hop-prompt-line-en,
.hop-answer-en {
  font-weight: 700;
}
.hop-prompt-line-romaji,
.hop-answer-line-romaji,
.hop-answer-note {
  font-size: 0.86rem;
  color: var(--muted);
}
.hop-picked {
  font: 700 0.9rem/1.2 var(--body);
  color: var(--muted);
}
.hop-picked s {
  text-decoration-thickness: 2px;
}
.hop-picked-romaji {
  margin-left: 0.3em;
  font-weight: 600;
}
.hop-hint {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--red);
}
.hop-verdict {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 8px;
  font: 1.15rem/1.2 var(--heading);
}
.hop-card.is-right .hop-verdict {
  color: #1f6b2a;
}
.hop-card.is-wrong .hop-verdict {
  color: var(--red);
}
.hop-answer-word {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 4px 10px;
}
.hop-answer-jp {
  font-size: clamp(1.6rem, 7vw, 2.1rem);
  font-weight: 700;
  line-height: 1.15;
}
.hop-answer-jp.is-long,
.hop-answer-jp.is-very-long {
  font-size: clamp(1.25rem, 5vw, 1.6rem);
}
.hop-card.is-right .hop-answer-jp {
  font-size: 1.4rem;
}
.hop-note {
  display: block;
  margin-top: 2px;
  font-size: 0.86rem;
  line-height: 1.5;
}
.hop-note-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  margin-right: 6px;
  padding: 0 8px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
}
.hop-note-chip b {
  font-size: 1.05rem;
}
.hop-note-chip span {
  font-size: 0.8rem;
  color: var(--muted);
}
.hop-note-text {
  font-weight: 700;
}
.hop-next {
  min-width: 150px;
  margin-top: 6px;
}

/* Start card and results */
.hop-intro {
  position: absolute;
  top: 60px;
  left: 12px;
  right: 12px;
  z-index: 4;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 16px 16px 18px;
  text-align: center;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink);
}
.hop-intro[hidden],
.hop-results[hidden] {
  display: none;
}
.hop-intro-title {
  margin: 0;
  font-size: 1.8rem;
}
.hop-intro-title:focus {
  outline: none;
}
.hop-intro-line {
  max-width: 32ch;
  margin: 0;
  font-weight: 700;
}
.hop-best {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 700;
}
.hop-best[hidden] {
  display: none;
}
.hop-best-stars,
.hop-results-stars {
  display: inline-flex;
  gap: 2px;
}
.hop-best .hop-star {
  width: 22px;
  height: 21px;
}
.hop-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 700;
  font-size: 0.92rem;
  text-align: left;
  cursor: pointer;
}
.hop-switch input {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 28px;
  margin: 0;
  background: #d8c9a9;
  border: 2px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.hop-switch input::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-sizing: border-box;
  transition: transform 0.15s var(--ease-out);
}
.hop-switch input:checked {
  background: #6fb04e;
}
.hop-switch input:checked::before {
  transform: translateX(20px);
}
.hop-switch input:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 2px;
}
.hop-start {
  min-width: 170px;
}
.hop-results {
  position: absolute;
  top: 28%;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  display: flex;
  align-items: flex-end;
}
.hop-results-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 100%;
  padding: 12px 14px 14px;
  text-align: center;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink);
  animation: hop-rise 0.42s var(--ease-spring);
}
.hop-results-stars {
  justify-content: center;
  margin: 0;
}
.hop-star {
  width: 36px;
  height: 34px;
}
.hop-star path {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-linejoin: round;
}
.hop-star.is-filled path {
  fill: var(--yellow);
}
.hop-results-stars .hop-star {
  animation: hop-star-pop 0.4s var(--ease-spring) both;
}
.hop-results-stars .hop-star:nth-child(2) {
  animation-delay: 0.12s;
}
.hop-results-stars .hop-star:nth-child(3) {
  animation-delay: 0.24s;
}
.hop-results-title {
  margin: 2px 0 0;
  font-size: 1.5rem;
}
.hop-results-title:focus {
  outline: none;
}
.hop-results-sub {
  margin: 0;
  font-weight: 700;
  color: var(--muted);
}
.hop-results-list {
  display: grid;
  flex: 0 1 auto;
  align-content: start;
  gap: 5px;
  min-height: 0;
  margin: 10px 0 12px;
  padding: 2px;
  overflow-y: auto;
  list-style: none;
  text-align: left;
}
.hop-results-list:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 2px;
}
.hop-results-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 8px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 12px;
}
.hop-results-list li.is-missed {
  background: var(--wrong);
}
.hop-mark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 2px;
}
.hop-mark--right circle {
  fill: #2f7a3a;
}
.hop-mark--right path {
  fill: none;
  stroke: #fff;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hop-mark--splash path {
  fill: #2f78b5;
  stroke: var(--ink);
  stroke-width: 1.5;
}
.hop-mark--splash .hop-mark-shine {
  fill: none;
  stroke: #fff;
  stroke-width: 1.6;
  stroke-linecap: round;
}
.hop-verdict .hop-mark {
  margin-top: 0;
}
.hop-results-words {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  min-width: 0;
}
.hop-results-jp {
  font-weight: 700;
}
.hop-results-romaji {
  font-size: 0.84rem;
  color: var(--muted);
}
.hop-results-en {
  flex-basis: 100%;
  font-size: 0.9rem;
}
.hop-results-actions {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.hop-badge {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 3;
  padding: 2px 10px;
  font: 1.5rem/1.1 var(--heading);
  color: var(--ink);
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  opacity: 0;
  pointer-events: none;
}
.hop-badge.is-popping {
  animation: hop-badge 0.9s var(--ease-out) forwards;
}

@keyframes hop-bob {
  50% {
    transform: translateY(-2px);
  }
}
@keyframes hop-ripple {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  25% {
    opacity: 0.55;
  }
  100% {
    opacity: 0;
    transform: scale(1.45);
  }
}
@keyframes hop-dip {
  40% {
    transform: translateY(4px) scale(0.96);
  }
  75% {
    transform: translateY(-1px) scale(1.01);
  }
}
@keyframes hop-wobble-sink {
  20% {
    transform: rotate(-5deg);
  }
  40% {
    transform: rotate(4deg);
    opacity: 1;
  }
  100% {
    transform: translateY(26px) scale(0.84);
    opacity: 0;
  }
}
@keyframes hop-tip {
  to {
    transform: translateY(30px) rotate(25deg);
    opacity: 0;
  }
}
@keyframes hop-under {
  to {
    transform: translateY(18px) scale(0.9);
    opacity: 0;
  }
}
@keyframes hop-resurface {
  from {
    transform: translateY(14px) scale(0.9);
    opacity: 0.2;
  }
}
@keyframes hop-glow {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.95);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}
@keyframes hop-glint {
  from {
    background-position: 120% 0;
  }
  to {
    background-position: -20% 0;
  }
}
@keyframes hop-breathe {
  50% {
    transform: scale(1.025);
  }
}
@keyframes hop-startle {
  30% {
    transform: translateY(-10px) rotate(-6deg);
  }
  60% {
    transform: translateY(-4px) rotate(5deg);
  }
}
@keyframes hop-happy {
  45% {
    transform: translateY(-18px) rotate(6deg);
  }
}
@keyframes hop-shake {
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}
@keyframes hop-sway {
  from {
    transform: rotate(-1.5deg);
  }
  to {
    transform: rotate(1.5deg);
  }
}
@keyframes hop-laugh {
  25% {
    transform: rotate(-6deg);
  }
  75% {
    transform: rotate(6deg);
  }
}
@keyframes hop-drift {
  from {
    transform: translate(-24px, 0);
  }
  to {
    transform: translate(24px, 10px);
  }
}
@keyframes hop-twinkle {
  from {
    opacity: 0.1;
  }
  to {
    opacity: 0.4;
  }
}
@keyframes hop-card-in {
  from {
    opacity: 0.4;
    transform: scale(0.97);
  }
}
@keyframes hop-look {
  0%,
  55%,
  100% {
    transform: none;
  }
  65% {
    transform: translateY(-4px) rotate(-5deg);
  }
  80% {
    transform: translateY(-4px) rotate(4deg);
  }
}
@keyframes hop-fade-in {
  from {
    opacity: 0;
  }
}
@keyframes hop-rise {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}
@keyframes hop-star-pop {
  from {
    transform: scale(0.4) rotate(-20deg);
    opacity: 0;
  }
}
@keyframes hop-badge {
  0% {
    opacity: 0;
    scale: 0.6;
  }
  25% {
    opacity: 1;
    scale: 1.12;
  }
  40% {
    scale: 1;
  }
  100% {
    opacity: 0;
    translate: 0 -34px;
  }
}

@media (max-width: 720px) {
  .study-panel[data-panel='play'] {
    padding: 6px;
  }
}
@media (max-width: 420px) {
  /* On a phone a game takes most of the page gutter: every pixel helps the pads and tiles. */
  .study-panel[data-panel='play'],
  .learn-play .play-room {
    margin-inline: -14px;
    padding: 4px;
  }
}
@media (max-width: 380px) {
  .hop-crossing-word {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .hop-boat {
    width: 84px;
  }
  .hop-label {
    padding: 2px 5px;
    font-size: 0.84rem;
  }
  .hop-label.is-long {
    font-size: 0.78rem;
  }
  .hop-label.is-very-long {
    font-size: 0.7rem;
  }
  .hop-label-jp {
    font-size: 1.08rem;
  }
  .hop-piece {
    padding: 1px 6px;
    font-size: 1rem;
  }
  .hop-piece.is-long {
    font-size: 0.9rem;
  }
  .hop-pieces {
    gap: 4px;
  }
  .hop-card {
    padding: 10px 10px 12px;
  }
  .hop-label.is-long .hop-label-jp {
    font-size: 0.92rem;
  }
  .hop-label.is-very-long .hop-label-jp {
    font-size: 0.8rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hop-stage *,
  .hop-stage *::before,
  .hop-stage *::after {
    animation: none !important;
    transition: none !important;
  }
  .hop-shimmer {
    display: none;
  }
  .hop-pad.is-gone .hop-pad-float,
  .hop-pad.is-tipped .hop-pad-float,
  .hop-pad.is-under .hop-pad-float {
    opacity: 0;
  }
  .hop-pad.is-gold .hop-pad-bob::after {
    opacity: 1;
  }
  .hop-card.is-timed .hop-clock-ring {
    opacity: 0;
  }
  .hop-card.is-timed .hop-clock-bar {
    display: block;
  }
}
@media (forced-colors: active) {
  .hop-card,
  .hop-intro,
  .hop-results-card,
  .hop-label {
    box-shadow: none;
  }
}

/* ════ The narrator: speaker buttons and the sound switches (docs/study-audio.md) ════ */
.say-button {
  position: relative;
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0 0 0 6px;
  padding: 0;
  vertical-align: middle;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 2px 0 var(--ink);
  cursor: pointer;
}
.say-button[hidden] {
  display: none;
}
.say-button .speaker-icon {
  width: 20px;
  height: 20px;
}
.say-button:hover {
  transform: translateY(-1px);
}
.say-button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--ink);
}
.say-button:focus-visible,
.study-switch:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 2px;
}
/* A ring pulses out while the line is speaking. */
.say-button.is-speaking::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  animation: say-pulse 0.9s ease-out infinite;
}
@keyframes say-pulse {
  from {
    opacity: 0.8;
    transform: scale(0.85);
  }
  to {
    opacity: 0;
    transform: scale(1.25);
  }
}
.say-button--big {
  width: 96px;
  height: 96px;
  margin: 4px auto;
  border-width: 3px;
  box-shadow: 0 4px 0 var(--ink);
}
.say-button--big .speaker-icon {
  width: 48px;
  height: 48px;
}

/* Flashcards: the speaker sits in the top corner; the example's button shows once turned. */
.study-card-say {
  width: 44px;
  height: 44px;
  margin: 0;
}
.study-card-say .speaker-icon {
  width: 24px;
  height: 24px;
}
.study-card:not(.is-flipped) .study-card-say--example {
  display: none;
}
.study-card-say--example {
  width: 36px;
  height: 36px;
  justify-self: center;
  background: var(--paper);
}

/* Grammar: a speaker after the pattern and after each example line */
.study-pattern-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
}
.study-say-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.study-say-line .study-say-jp {
  padding-top: 2px;
}
.study-say-line .say-button,
.study-line .say-button,
.study-list-word .say-button,
.study-list-pattern .say-button,
.study-list-example .say-button,
.study-list-answer .say-button {
  width: 32px;
  height: 32px;
  margin: 0 0 0 4px;
}
/* Before a sentence, the speaker leads the line. */
.study-say-line .say-button,
.study-line .say-button,
.study-list-example .say-button {
  margin: 0 4px 0 0;
}
.study-say-line .say-button .speaker-icon,
.study-line .say-button .speaker-icon,
.study-list-word .say-button .speaker-icon,
.study-list-pattern .say-button .speaker-icon,
.study-list-example .say-button .speaker-icon,
.study-list-answer .say-button .speaker-icon {
  width: 18px;
  height: 18px;
}
.lesson-jp .say-button {
  margin-left: 8px;
}

/* Lily pads: one speaker in the card's top corner, for the prompt or the answer. */
.hop-card-body .hop-say {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  margin: 0;
}
/* Only the lines beside it (the question or verdict, then the English or the word) keep clear of
   the speaker: the romaji and a sentence's pieces below use the card's whole width, so a long
   sentence card stays short enough to leave the pads in view on a small phone. */
.hop-card-body:has(.hop-say) > :nth-child(-n + 2) {
  padding-inline: 42px;
}

/* The Voice and Effects switches under the player title */
.study-switches {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.study-switches[hidden] {
  display: none;
}
.study-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 4px 14px 4px 8px;
  font: 700 0.95rem/1 var(--body);
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 2px 0 var(--ink);
  cursor: pointer;
}
.study-switch .speaker-icon {
  width: 22px;
  height: 22px;
}
.study-switch[aria-pressed='true'] {
  background: var(--yellow);
}
.study-switch[aria-pressed='false'] {
  color: var(--muted);
  text-decoration: line-through;
}
.study-switch[aria-pressed='false'] .speaker-icon {
  opacity: 0.45;
}
@media (prefers-reduced-motion: reduce) {
  .say-button.is-speaking::after {
    animation: none;
    opacity: 0.6;
    transform: none;
  }
  .say-button:hover,
  .say-button:active {
    transform: none;
  }
}
@media (forced-colors: active) {
  .say-button,
  .study-switch {
    border-color: ButtonText;
  }
  .study-switch[aria-pressed='true'] {
    outline: 2px solid Highlight;
  }
}

/* ════ Play: the two games side by side ════ */
.play-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 720px;
  margin: 0 auto;
}
.play-picker[hidden],
.play-game[hidden] {
  display: none;
}
.play-tile {
  display: grid;
  grid-template-rows: 150px auto;
  padding: 0;
  overflow: hidden;
  font: inherit;
  color: var(--ink);
  text-align: left;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink);
  cursor: pointer;
  transition:
    transform 0.12s var(--ease-out),
    box-shadow 0.12s var(--ease-out);
}
.play-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 0 var(--ink);
}
.play-tile:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--ink);
}
.play-tile:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 3px;
}
.play-tile:disabled {
  cursor: not-allowed;
  opacity: 0.6;
  transform: none;
}
.play-tile-art {
  position: relative;
  display: block;
  overflow: hidden;
  background: #8bd1d6 center / cover no-repeat;
  border-bottom: 3px solid var(--ink);
}
.play-tile--hop .play-tile-art {
  background-image: url('/assets/study/pond-strip-720.webp');
  background-position: center 58%;
}
.play-tile--grab .play-tile-art {
  background-color: #fbe7bd;
  background-image: url('/assets/study/picnic-bank-720.webp');
  background-position: center 34%;
}
.play-tile-art img {
  position: absolute;
  height: auto;
  filter: drop-shadow(0 3px 0 rgba(57, 44, 32, 0.22));
  transition: transform 0.2s var(--ease-spring);
}
.play-tile--hop .play-tile-kero {
  bottom: 10px;
  left: 50%;
  width: 92px;
  margin-left: -46px;
}
.play-tile--grab .play-tile-kero {
  bottom: 8px;
  left: 6%;
  width: 26%;
  max-width: 84px;
}
.play-tile-plate {
  top: 30%;
  left: 31%;
  width: 38%;
}
.play-tile-gyoza {
  top: 27%;
  left: 42%;
  width: 16%;
}
.play-tile-goro {
  right: 6%;
  bottom: 6px;
  width: 27%;
  max-width: 86px;
}
.play-tile:hover .play-tile-kero {
  transform: translateY(-8px) rotate(-4deg);
}
.play-tile-words {
  display: grid;
  gap: 2px;
  padding: 12px 16px 14px;
}
.play-tile-name {
  font: 1.45rem/1.1 var(--heading);
}
.play-tile-line {
  font-weight: 700;
  color: var(--muted);
}
.play-tile-best[hidden] {
  display: none;
}
.play-tile-best {
  display: inline-flex;
  gap: 2px;
  margin-top: 4px;
  font-weight: 700;
  font-size: 0.9rem;
}
.play-tile-best .hop-star {
  width: 20px;
  height: 19px;
}
.play-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: 0 0 8px;
  padding: 0 14px;
  font: 700 0.95rem var(--body);
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}
.play-back:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .play-tiles {
    gap: 10px;
  }
  .play-tile {
    grid-template-rows: 112px auto;
    border-radius: 16px;
  }
  .play-tile-words {
    padding: 8px 10px 10px;
  }
  .play-tile-name {
    font-size: 1.15rem;
  }
  .play-tile-line {
    font-size: 0.85rem;
  }
  .play-tile--hop .play-tile-kero {
    width: 70px;
    margin-left: -35px;
  }
}

/* A Play button on each kana and numbers lesson tile */
.learn-tile-item {
  position: relative;
}
/* Room under the tile's words for its Play button. */
.learn-tile-item > .learn-tile {
  padding-bottom: 54px;
}
.learn-tile-play {
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 12px;
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
  text-decoration: none;
  background: #3f7a2c;
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 2px 0 var(--ink);
}
.learn-tile-play:hover {
  transform: translateY(-1px);
}
.learn-tile-play:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 2px;
}
.learn-tile-play .study-play-icon {
  width: 14px;
  height: 14px;
}

/* The Play step on the kana and numbers lessons */
.learn-play {
  margin: 28px 0;
}
.learn-play .learn-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.learn-play .study-switches[hidden],
.play-room[hidden] {
  display: none;
}

/* The hub's Games row: both games with everything learned so far */
.study-games {
  margin-top: 28px;
}
.study-games-title {
  margin: 0 0 4px;
  font-size: 1.4rem;
}
.study-games-note {
  margin: 0 0 8px;
  font-weight: 700;
  color: var(--muted);
}
.study-games-note[hidden] {
  display: none;
}
.study-games-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.study-game {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 72px;
  padding: 8px 12px;
  color: var(--ink);
  text-decoration: none;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink);
  transition: transform 0.15s;
}
.study-game:hover {
  transform: translateY(-2px);
}
.study-game.is-waiting {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.study-game-art {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  width: 56px;
}
.study-game-art img {
  width: 100%;
  height: auto;
}
.study-game--grab .study-game-art img.study-game-gyoza {
  position: absolute;
  left: -6px;
  bottom: 0;
  width: 34px;
}
.study-game--grab .study-game-art img.study-game-goro {
  margin-left: 16px;
  width: 40px;
}
.study-game-words {
  display: grid;
  min-width: 0;
}
.study-game-name {
  font: 1.1rem/1.15 var(--heading);
}
.study-game-line {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--muted);
}
@media (max-width: 420px) {
  .study-games-row {
    grid-template-columns: 1fr;
  }
}

/* ════ Gyoza Grab ════
 * A picnic on the pond bank: the painted bank is one world layer, with the table's plate, Kero,
 * Goro, the little plates and Goro's chopsticks placed on it in percentages. Kero and Goro move
 * only as whole pictures; the props (gyoza, tiles, chopsticks) may squash and tilt.
 */
.grab-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 520px);
  /* In rem as well, so with text at 200% the stage grows taller than the screen and the page
     scrolls, rather than a two-row tray running out of room inside it. */
  height: clamp(max(480px, 30rem), calc(100vh - 28px), max(720px, 45rem));
  height: clamp(max(480px, 30rem), calc(100svh - 28px), max(720px, 45rem));
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
  color: var(--ink);
  background: linear-gradient(#c4e8f6 0 34%, #fbe6b9 34% 100%);
  border: 3px solid var(--ink);
  border-radius: 20px;
  scroll-margin-top: 10px;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.grab-world {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  width: 100%;
  aspect-ratio: 1080 / 1920;
  pointer-events: none;
  will-change: transform;
}
.grab-bank {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.grab-fx {
  position: absolute;
  inset: 0;
  z-index: 7;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* The table's plate: four gyoza in a gentle arc */
.grab-plate {
  position: absolute;
  top: 30.4%;
  left: 29%;
  width: 42%;
  aspect-ratio: 512 / 216;
}
.grab-plate.is-arriving {
  animation: grab-plate-in 0.42s var(--ease-spring);
}
.grab-plate-img {
  display: block;
  width: 100%;
  height: auto;
}
.grab-spot {
  position: absolute;
  width: 27%;
  aspect-ratio: 256 / 143;
}
.grab-spot--1 {
  top: 16%;
  left: 5%;
}
.grab-spot--2 {
  top: 2%;
  left: 26%;
}
.grab-spot--3 {
  top: 2%;
  left: 47%;
}
.grab-spot--4 {
  top: 16%;
  left: 68%;
}
.grab-spot--2,
.grab-spot--3 {
  z-index: 0;
}
.grab-spot--1,
.grab-spot--4 {
  z-index: 1;
}
.grab-gyoza {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 0 rgba(57, 44, 32, 0.22));
  transition:
    transform 0.25s var(--ease-out),
    filter 0.25s;
}
.grab-spot.is-current .grab-gyoza {
  transform: translateY(-14%) scale(1.08);
  filter: drop-shadow(0 0 5px #fff4a8) drop-shadow(0 4px 0 rgba(57, 44, 32, 0.25));
  animation: grab-steaming 1.6s ease-in-out infinite;
}
.grab-gyoza.is-hidden,
.grab-tile.is-hidden {
  visibility: hidden;
}
.grab-flying {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  pointer-events: none;
}

/* Kero's and Goro's little plates: the live score */
.grab-mine {
  position: absolute;
  top: 44.6%;
  width: 21%;
  aspect-ratio: 512 / 216;
}
.grab-mine--kero {
  left: 5%;
}
.grab-mine--goro {
  right: 5%;
}
.grab-mine-img {
  display: block;
  width: 100%;
  height: auto;
}
.grab-mine-pile {
  position: absolute;
  inset: auto 6% 38%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}
.grab-mine-pile .grab-gyoza {
  flex: 0 0 auto;
  width: 46%;
  margin: 0 -9%;
}

/* Kero and Goro, standing either side of the table */
.grab-kero,
.grab-goro {
  position: absolute;
  z-index: 1;
}
.grab-kero {
  top: 30%;
  left: 2%;
  width: 27%;
}
.grab-goro {
  top: 29%;
  right: 1%;
  width: 28%;
}
.grab-kero-img,
.grab-goro-img {
  position: relative;
  display: block;
  width: 100%;
  height: auto;
  transform-origin: 50% 100%;
}
.grab-shadow {
  position: absolute;
  bottom: -2%;
  left: 18%;
  width: 64%;
  height: 11%;
  background: rgba(57, 44, 32, 0.24);
  border-radius: 50%;
  transition: transform 0.3s;
}
.grab-stage[data-state='ready'] .grab-kero-img,
.grab-stage[data-state='intro'] .grab-kero-img {
  animation: grab-breathe 2.6s ease-in-out infinite;
}
.grab-stage[data-state='ready'] .grab-goro-img,
.grab-stage[data-state='intro'] .grab-goro-img {
  animation: grab-breathe 2.9s ease-in-out infinite reverse;
}
.grab-kero.is-hopping .grab-kero-img,
.grab-goro.is-hopping .grab-goro-img {
  animation: grab-hop 0.3s var(--ease-out);
}
.grab-kero.is-hopping .grab-shadow {
  animation: grab-shadow-hop 0.3s var(--ease-out);
}
.grab-kero.is-happy .grab-kero-img {
  animation: grab-hop 0.32s var(--ease-out) 3;
}
.grab-goro.is-reaching .grab-goro-img {
  animation: none;
  transform: translateX(-4%) rotate(-5deg);
  transition: transform 0.3s var(--ease-out);
}
.grab-goro.is-jolting .grab-goro-img {
  animation: grab-jolt 0.24s var(--ease-out);
}
.grab-goro.is-laughing .grab-goro-img {
  animation: grab-wobble 0.32s ease-in-out 2;
}
.grab-goro.is-grumbling .grab-goro-img {
  animation: grab-grumble 0.4s ease-in-out;
}
/* A clean build: the tiles in the answer bounce one after another. */
.grab-build.is-clean .grab-placed {
  animation: grab-cheer 0.42s var(--ease-out) both;
}
.grab-build.is-clean .grab-slot:nth-child(2) .grab-placed {
  animation-delay: 0.05s;
}
.grab-build.is-clean .grab-slot:nth-child(3) .grab-placed {
  animation-delay: 0.1s;
}
.grab-build.is-clean .grab-slot:nth-child(4) .grab-placed {
  animation-delay: 0.15s;
}
.grab-build.is-clean .grab-slot:nth-child(5) .grab-placed {
  animation-delay: 0.2s;
}
.grab-build.is-clean .grab-slot:nth-child(6) .grab-placed {
  animation-delay: 0.25s;
}
.grab-build.is-clean .grab-slot:nth-child(n + 7) .grab-placed {
  animation-delay: 0.3s;
}
.grab-goro.is-fuming .grab-goro-img {
  animation: grab-wobble 0.18s linear 4;
}

/* Goro's chopsticks: the clock, sliding from his hand to the gyoza */
.grab-sticks {
  position: absolute;
  top: 26.4%;
  left: 63%;
  z-index: 2;
  width: 30%;
  aspect-ratio: 600 / 85;
  transform-origin: 88% 50%;
}
/* Held up and ready: the tips tilt up until Goro reaches for the gyoza. */
.grab-sticks-img {
  display: block;
  width: 100%;
  height: auto;
  transform: rotate(14deg);
  transform-origin: 88% 50%;
}
.grab-sticks.is-snapping .grab-sticks-img {
  animation: grab-snap 0.2s var(--ease-out);
}
.grab-stage[data-clock='off'] .grab-sticks,
.grab-stage[data-clock='waiting'] .grab-sticks {
  transition: transform 0.3s var(--ease-out);
}

/* Heads-up: plate count, streak, sound */
.grab-hud {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  pointer-events: none;
}
.grab-hud > * {
  pointer-events: auto;
}
.grab-hud.is-quiet .grab-plate-count,
.grab-hud.is-quiet .grab-combo,
.grab-stage[data-state='results'] .grab-plate-count,
.grab-stage[data-state='results'] .grab-combo {
  visibility: hidden;
}
.grab-plate-count {
  margin: 0;
  padding: 4px 12px;
  font-weight: 800;
  font-size: 0.9rem;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
}
.grab-plate-count:empty {
  visibility: hidden;
}
.grab-combo {
  margin: 0 auto 0 0;
  font: 1.3rem/1 var(--heading);
  color: var(--ink);
  text-shadow:
    0 2px 0 var(--paper),
    0 -2px 0 var(--paper),
    2px 0 0 var(--paper),
    -2px 0 0 var(--paper);
}
.grab-combo.is-hot {
  color: #b6382b;
}
.grab-sound {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}
.grab-sound[hidden],
.hop-sound[hidden] {
  display: none;
}
.grab-sound .speaker-icon {
  width: 24px;
  height: 24px;
}
.grab-sound[aria-pressed='false'] .speaker-waves {
  opacity: 0.15;
}
.grab-sound:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 2px;
}

/* The prompt card: what to build, never the answer */
.grab-card {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  margin: 58px 10px 0;
  padding: 8px 14px 12px;
  text-align: center;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--ink);
}
.grab-card[hidden] {
  display: none;
}
.grab-card:focus {
  outline: none;
}
.grab-card:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 3px;
}
.grab-card-body {
  display: grid;
  justify-items: center;
  gap: 2px;
}
.grab-card-body.is-new {
  animation: hop-card-in 0.22s var(--ease-out);
}
.grab-ask {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.grab-prompt-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
}
.grab-prompt-en {
  font: 1.35rem/1.2 var(--heading);
  overflow-wrap: anywhere;
}
/* How the thing to build is said: its romaji, under its English. */
.grab-prompt-romaji {
  font: 1.08rem/1.2 var(--heading);
  color: var(--red);
  overflow-wrap: anywhere;
}
.grab-prompt-romaji--big {
  font-size: 1.7rem;
}
/* A sentence: a long English line and its romaji take smaller type, so the tray keeps its room
   on a small phone. */
.grab-prompt-en.is-long {
  font-size: 1.15rem;
}
.grab-prompt-en.is-very-long {
  font-size: 1.02rem;
}
.grab-prompt-romaji--line {
  font-size: 0.95rem;
}
/* A letter gyoza: the sound (or a chain of sounds) to pick the kana for. */
.grab-prompt-sound {
  font: clamp(1.9rem, 8vw, 2.5rem)/1.1 var(--heading);
  color: var(--red);
  overflow-wrap: anywhere;
}
.grab-prompt-hint {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}
.grab-visual {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
}
.grab-visual > *,
.grab-visual img,
.grab-visual svg {
  max-width: 58px;
  max-height: 58px;
  width: auto;
  height: auto;
}
.grab-visual .time-prompt-text {
  display: none;
}
.grab-context {
  display: flex;
  gap: 6px;
  font-size: 0.95rem;
}
.grab-context-name {
  font-weight: 800;
}
.grab-prompt-row .study-face {
  width: 34px;
  height: 34px;
}
.grab-bubble {
  position: absolute;
  top: 4%;
  right: 22%;
  z-index: 4;
  padding: 4px 10px;
  font: 1rem/1.2 var(--heading);
  color: #8f2a1f;
  white-space: nowrap;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 14px 14px 4px 14px;
  opacity: 0;
  transform: scale(0.6);
  transform-origin: 100% 100%;
}
.grab-bubble.is-showing {
  animation: grab-bubble 1.8s var(--ease-spring) forwards;
}
@keyframes grab-bubble {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  12%,
  80% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1);
  }
}
.grab-clock-bar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 5px;
  background: #f6c747;
  border-radius: 999px;
  opacity: 0;
  transform-origin: left center;
}
.grab-card.is-timed .grab-clock-bar {
  opacity: 1;
}
.grab-card.is-hurry .grab-clock-bar {
  background: #b6382b;
}

/* The scene shows through this band */
.grab-card[hidden] + .grab-band {
  margin-top: 54px;
}
.grab-band {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: 100 / 40;
  pointer-events: none;
}
.grab-badge {
  position: absolute;
  top: 2px;
  left: 22%;
  z-index: 4;
  padding: 2px 10px;
  font: 1.3rem/1.2 var(--heading);
  color: var(--ink);
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 999px;
  opacity: 0;
  transform: scale(0.6);
}
.grab-badge.is-popping {
  animation: grab-badge 0.9s var(--ease-spring);
}

/* The build: slots for the answer, the tray of tiles, then the answer once built */
.grab-build {
  position: relative;
  z-index: 3;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 10px 10px;
  overflow-y: auto;
}
.grab-build[hidden] {
  display: none;
}
.grab-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-height: 66px;
  margin: 0;
  padding: 7px;
  list-style: none;
  background: rgba(255, 250, 240, 0.94);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 3px 0 var(--ink);
}
.grab-build.is-done .grab-slots {
  background: #fff3ee;
}
.grab-build.is-done.is-clean .grab-slots {
  background: #effae9;
}
.grab-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 52px;
  border: 2px dashed #a58c66;
  border-radius: 12px;
}
/* The build scrolls as a whole on a small phone; its parts never squash. */
.grab-build > * {
  flex-shrink: 0;
}
.grab-slot.is-next {
  border-style: solid;
  border-color: var(--ink);
  background: #fff4cc;
}
.grab-slot.is-filled {
  border: 0;
}
.grab-slot.is-fixed {
  border: 0;
  min-width: 26px;
  color: var(--muted);
}
.grab-slot.is-awaiting > * {
  visibility: hidden;
}
.grab-slot.is-landing {
  animation: grab-settle 0.16s var(--ease-out);
}
/* An empty labelled slot is as wide as its label at any text size (study-grab.ts). */
.grab-slots.is-sentence .grab-slot {
  min-width: max(52px, calc(var(--label-chars, 0) * 0.5rem + 10px));
}
.grab-slot-label {
  position: absolute;
  top: 3px;
  white-space: nowrap;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #8f2a1f;
}
.grab-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding-top: 2px;
}
.grab-tray[hidden] {
  display: none;
}
.grab-tile,
.grab-placed {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 56px;
  padding: 3px 10px;
  font: inherit;
  color: var(--ink);
  background: #fffdf6;
  border: 3px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 4px 0 var(--ink);
  cursor: pointer;
  transition:
    transform 0.09s var(--ease-out),
    box-shadow 0.09s var(--ease-out);
}
.grab-placed {
  min-width: 46px;
  min-height: 52px;
  background: #fff8dc;
  box-shadow: 0 2px 0 var(--ink);
}
.grab-build.is-done .grab-placed {
  cursor: default;
}
.grab-build.is-done.is-clean .grab-placed {
  background: #dff3d4;
}
.grab-tile:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}
.grab-tile:focus-visible,
.grab-placed:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 2px;
}
.grab-tile.is-used {
  visibility: hidden;
}
.grab-tile.is-particle,
.grab-placed.is-particle {
  background: var(--butter);
  border-radius: 999px;
}
.grab-tile-jp {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}
.is-long > .grab-tile-jp {
  font-size: 1.2rem;
}
.is-very-long > .grab-tile-jp {
  font-size: 1rem;
}
.grab-tile.is-hint {
  border-color: #b97a00;
  background: #fff1b8;
  animation: grab-hint 0.9s ease-in-out infinite;
}
.grab-tile.is-shaking {
  animation: grab-shake 0.24s linear;
  background: var(--wrong);
}
.grab-flyer {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  margin: 0;
  pointer-events: none;
}
.grab-flyer.is-wrong {
  background: var(--wrong);
}
.grab-key {
  position: absolute;
  top: -9px;
  left: -9px;
  display: none;
  width: 20px;
  height: 20px;
  font: 700 0.72rem/16px var(--body);
  text-align: center;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--paper);
  border-radius: 50%;
}
@media (hover: hover) and (pointer: fine) {
  .grab-key {
    display: block;
  }
}
.grab-feedback {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 12px 10px;
  text-align: center;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 3px 0 var(--ink);
  animation: hop-card-in 0.22s var(--ease-out);
}
.grab-feedback[hidden] {
  display: none;
}
.grab-feedback p {
  margin: 0;
}
.grab-verdict {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 1.15rem/1.2 var(--heading);
}
.grab-verdict svg {
  width: 22px;
  height: 22px;
}
.grab-verdict.is-wrong {
  color: #8f2a1f;
}
.grab-answer {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.grab-answer-jp {
  font-size: 1.5rem;
  font-weight: 700;
}
.grab-answer-romaji {
  font-weight: 700;
  color: var(--muted);
}
.grab-answer-en {
  font-weight: 700;
}
.grab-answer-note {
  font-size: 0.9rem;
  color: var(--muted);
}
.grab-note {
  display: flex;
  align-items: baseline;
  gap: 8px;
  max-width: 34rem;
  font-size: 0.9rem;
  text-align: left;
}
.grab-note-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 0 8px;
  background: var(--butter);
  border: 2px solid var(--ink);
  border-radius: 999px;
}
.grab-note-chip span {
  font-size: 0.78rem;
  color: var(--muted);
}
.grab-usual {
  font-size: 0.9rem;
}
.grab-usual-label {
  font-weight: 800;
}
.grab-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
}
.grab-actions [hidden] {
  display: none;
}
.grab-say {
  flex: 0 0 auto;
}

/* Start card and results */
.grab-intro,
.grab-results {
  position: absolute;
  z-index: 6;
  left: 12px;
  right: 12px;
}
.grab-intro {
  bottom: 14px;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 16px 16px 18px;
  text-align: center;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink);
}
.grab-intro[hidden],
.grab-results[hidden] {
  display: none;
}
.grab-intro-title {
  margin: 0;
  font-size: 1.8rem;
}
.grab-intro-title:focus {
  outline: none;
}
.grab-intro-line {
  max-width: 32ch;
  margin: 0;
  font-weight: 700;
}
.grab-best {
  margin: 0;
  font-weight: 700;
}
.grab-best[hidden] {
  display: none;
}
.grab-results {
  top: 56px;
  bottom: 12px;
  display: flex;
  align-items: flex-start;
}
.grab-results-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: 100%;
  max-height: 100%;
  padding: 14px 14px 16px;
  overflow-y: auto;
  text-align: center;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink);
  animation: hop-card-in 0.3s var(--ease-spring);
}
.grab-results-title {
  margin: 0;
  font-size: 1.6rem;
}
.grab-results-title:focus {
  outline: none;
}
.grab-results-sub {
  margin: 0;
  font-weight: 700;
  color: var(--muted);
}
.grab-score {
  display: flex;
  justify-content: center;
  gap: 18px;
}
.grab-score-side {
  display: grid;
  justify-items: center;
  gap: 2px;
}
.grab-score-face {
  width: 58px;
  height: auto;
}
.grab-score-pile {
  display: flex;
  justify-content: center;
  min-height: 22px;
}
.grab-score-gyoza {
  width: 34px;
  margin: 0 -6px;
}
.grab-score-num {
  font: 1.4rem/1 var(--heading);
}

/* Motion */
@keyframes grab-breathe {
  50% {
    transform: translateY(-2%) scale(1.02);
  }
}
@keyframes grab-hop {
  40% {
    transform: translateY(-18px) rotate(6deg);
  }
  75% {
    transform: translateY(0) rotate(-2deg);
  }
}
@keyframes grab-shadow-hop {
  40% {
    transform: scale(0.7);
  }
}
@keyframes grab-jolt {
  40% {
    transform: translateX(-10%) rotate(-8deg);
  }
}
@keyframes grab-wobble {
  25% {
    transform: rotate(-6deg);
  }
  75% {
    transform: rotate(6deg);
  }
}
@keyframes grab-grumble {
  30% {
    transform: rotate(-4deg) translateY(2%);
  }
  65% {
    transform: rotate(3deg);
  }
}
@keyframes grab-cheer {
  45% {
    transform: translateY(-7px);
  }
}
@keyframes grab-snap {
  50% {
    transform: rotate(14deg) scale(1, 0.5);
  }
}
@keyframes grab-steaming {
  50% {
    transform: translateY(-20%) scale(1.08);
  }
}
@keyframes grab-plate-in {
  from {
    opacity: 0;
    transform: translateY(-18px) scale(0.9);
  }
}
@keyframes grab-badge {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  25%,
  70% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-10px) scale(1);
  }
}
@keyframes grab-settle {
  50% {
    transform: translateY(1px);
  }
}
@keyframes grab-hint {
  50% {
    transform: scale(1.08);
  }
}
@keyframes grab-shake {
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}
@media (max-width: 380px) {
  .grab-plate-word {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
  .grab-tile {
    min-width: 48px;
    padding-inline: 8px;
  }
  .grab-tile-jp {
    font-size: 1.35rem;
  }
}
/* On a short phone a kana gap, word gap or sentence gap card (English, romaji and the pieces) is
   tighter, so it never reaches the pads. */
@media (max-height: 720px) {
  .hop-card {
    padding: 8px 12px 12px;
  }
  .hop-card .hop-card-body {
    gap: 1px;
  }
  .hop-card[data-ask='chunk'] .hop-prompt-ask,
  .hop-card[data-ask='line'] .hop-prompt-ask {
    font-size: 0.7rem;
  }
  .hop-card[data-ask='chunk'] .hop-prompt-en,
  .hop-card[data-ask='chunk'] .hop-prompt-en.is-long {
    font-size: 1.15rem;
  }
  .hop-card[data-ask='chunk'] .hop-prompt-en.is-very-long {
    font-size: 1rem;
  }
  .hop-card[data-ask='chunk'] .hop-prompt-romaji,
  .hop-card[data-ask='line'] .hop-prompt-romaji,
  .hop-card[data-ask='gap'] .hop-prompt-romaji {
    font-size: 0.95rem;
  }
  .hop-card .hop-piece {
    padding: 1px 6px;
    font-size: 1rem;
  }
  .hop-card .hop-card-body .hop-say {
    width: 34px;
    height: 34px;
  }
  .hop-card .hop-card-body:has(.hop-say) > :nth-child(-n + 2) {
    padding-inline: 38px;
  }
}
@media (max-height: 620px) {
  .grab-card {
    margin-top: 54px;
    padding-block: 6px 10px;
  }
  .grab-prompt-en {
    font-size: 1.2rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .grab-plate.is-arriving,
  .grab-spot.is-current .grab-gyoza,
  .grab-stage .grab-kero-img,
  .grab-stage .grab-goro-img,
  .grab-kero.is-hopping .grab-shadow,
  .grab-tile.is-hint,
  .grab-tile.is-shaking,
  .grab-slot.is-landing,
  .grab-build.is-clean .grab-placed,
  .grab-sticks.is-snapping .grab-sticks-img,
  .grab-card-body.is-new,
  .grab-feedback,
  .grab-results-card,
  .play-tile,
  .play-tile-art img {
    animation: none !important;
    transition: none !important;
  }
  .grab-goro.is-reaching .grab-goro-img {
    transform: none;
  }
  .grab-badge.is-popping,
  .grab-bubble.is-showing {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .grab-tile.is-hint {
    outline: 3px solid #b97a00;
    outline-offset: 2px;
  }
  .grab-tile.is-shaking {
    outline: 3px solid #8f2a1f;
  }
}

/* ════ Sentence blocks (docs/study-design.md section 3.2) ════ */
.learn-room--study,
.play-room {
  --role-topic: #ffe6a3;
  --role-topic-ink: #6b4e00;
  --role-time: #d3e8f7;
  --role-time-ink: #164e78;
  --role-place: #d6efc7;
  --role-place-ink: #2f5f1f;
  --role-with: #f8d7e4;
  --role-with-ink: #8a2550;
  --role-how: #e4dcf6;
  --role-how-ink: #4f3591;
  --role-object: #ffdcbf;
  --role-object-ink: #8a4300;
  --role-noun: #fffaf0;
  --role-noun-ink: #392c20;
  --role-lead: #ece4d4;
  --role-lead-ink: #4a3a2a;
  --role-end: #f6d2cc;
  --role-end-ink: #8f2a1f;
}
.block-lines {
  display: grid;
  gap: 8px;
}
.blocks {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.block {
  --fill: var(--paper);
  --ink-role: var(--ink);
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 44px;
  padding: 5px 9px 6px;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--fill);
  color: var(--ink);
  font: inherit;
  text-align: left;
  line-height: 1.2;
}
.block--topic {
  --fill: var(--role-topic);
  --ink-role: var(--role-topic-ink);
}
.block--time {
  --fill: var(--role-time);
  --ink-role: var(--role-time-ink);
}
.block--place,
.block--goal {
  --fill: var(--role-place);
  --ink-role: var(--role-place-ink);
}
.block--with {
  --fill: var(--role-with);
  --ink-role: var(--role-with-ink);
}
.block--how {
  --fill: var(--role-how);
  --ink-role: var(--role-how-ink);
}
.block--object {
  --fill: var(--role-object);
  --ink-role: var(--role-object-ink);
}
.block--noun {
  --fill: var(--role-noun);
  --ink-role: var(--role-noun-ink);
}
.block--lead {
  --fill: var(--role-lead);
  --ink-role: var(--role-lead-ink);
}
.block--end {
  --fill: var(--role-end);
  --ink-role: var(--role-end-ink);
}
.block--plain {
  --fill: var(--paper);
}
.block-role {
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--ink-role);
}
.block-jp {
  font-size: 1.15rem;
  font-weight: 700;
  white-space: nowrap;
}
.block-joint {
  color: var(--ink-role);
}
.block-p {
  margin-left: 4px;
  padding-left: 5px;
  border-left: 2px solid currentColor;
  color: var(--ink-role);
  font-weight: 900;
}
.block-blank {
  display: inline-block;
  min-width: 1.4em;
  border-bottom: 3px dashed var(--ink);
  color: transparent;
}
.block-blank.block-p {
  border-left: 2px solid var(--ink);
}
.block-blank.is-filled {
  color: var(--ink-role);
  border-bottom-style: solid;
}
.block-romaji {
  font-size: 0.8rem;
  color: var(--muted);
}
.block-en {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-role);
}
.block.is-marked {
  outline: 3px dashed var(--red);
  outline-offset: 2px;
}
.block-lines.is-compact .block {
  padding: 3px 7px 4px;
  border-width: 2px;
  border-radius: 10px;
}
.block-lines.is-compact .block-jp {
  font-size: 1rem;
}
.block-lines.is-compact .block-role {
  font-size: 0.6rem;
}
@media (max-width: 380px) {
  .block {
    padding: 4px 7px 5px;
  }
  .block-jp {
    font-size: 1.05rem;
  }
}

/* ════ Questions about sentences: blocks, Tap the part, Build it ════ */
.ask-sentence {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  width: 100%;
}
.ask-sentence .study-face {
  flex: 0 0 auto;
}
.ask-sentence .block-lines {
  justify-items: center;
}
.ask-sentence .blocks {
  justify-content: center;
}
.ask-sentence--en .ask-en {
  text-align: center;
}
.ask-en--small {
  font-size: 0.95rem;
  color: var(--muted);
  text-align: center;
}
.ask-en--job {
  max-width: 30ch;
  font-size: 1.1rem;
  text-align: center;
}
.ask-target--part,
.ask-target--build,
.ask-target--pgap,
.ask-target--sentence {
  padding-inline: 12px;
}
/* A word to build or a sentence to pick has a speaker in the corner: keep the English clear of it. */
.ask-target--build:has(.ask-say),
.ask-target--sentence:has(.ask-say) {
  padding-inline: 46px;
}
.ask-particle {
  display: grid;
  justify-items: center;
  min-width: 96px;
  padding: 6px 18px 8px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: var(--fill, var(--paper));
}
.ask-particle .ask-jp {
  font-size: 2.6rem;
  line-height: 1.1;
  color: var(--ink-role, var(--ink));
}
.ask-choices.is-blocks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.ask-block {
  position: relative;
  min-height: 56px;
  padding-top: 16px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--ink);
  transition:
    transform 90ms var(--ease-out, ease-out),
    background 0.15s;
}
.ask-block:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}
.ask-block .ask-choice-key {
  position: absolute;
  top: 3px;
  right: 6px;
  left: auto;
}
.ask-block.is-right {
  background: var(--right);
}
.ask-block.is-wrong {
  background: var(--wrong);
}
.ask-build {
  display: grid;
  gap: 10px;
}
.ask-build[hidden] {
  display: none;
}
.ask-slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-height: 52px;
  margin: 0;
  padding: 8px;
  list-style: none;
  background: rgb(255 255 255 / 0.55);
  border: 2px dashed var(--ink);
  border-radius: 14px;
}
.ask-slot {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 44px;
  padding: 4px 8px;
  border: 2px dashed rgb(57 44 32 / 0.45);
  border-radius: 10px;
  background: var(--paper);
}
.ask-slot.is-next {
  border-color: var(--ink);
  border-style: solid;
  box-shadow: 0 0 0 3px rgb(246 199 71 / 0.7);
}
.ask-slot.is-filled {
  border: 3px solid var(--ink);
  background: var(--fill, var(--paper));
  animation: slot-pop 220ms var(--ease-spring, ease-out);
}
.ask-slot.is-shown {
  animation: none;
}
/* A piece the learner does not place: the ～ of a suffix card. */
.ask-slot.is-fixed {
  border: 0;
  background: none;
  animation: none;
}
.ask-slot-label {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.role-ink--topic {
  color: var(--role-topic-ink);
}
.role-ink--time {
  color: var(--role-time-ink);
}
.role-ink--place,
.role-ink--goal {
  color: var(--role-place-ink);
}
.role-ink--with {
  color: var(--role-with-ink);
}
.role-ink--how {
  color: var(--role-how-ink);
}
.role-ink--object {
  color: var(--role-object-ink);
}
.role-ink--noun {
  color: var(--role-noun-ink);
}
.role-ink--end {
  color: var(--role-end-ink);
}
.ask-tray {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.ask-tile {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 48px;
  padding: 8px 12px 8px 14px;
  color: var(--ink);
  font: inherit;
  background: var(--fill, var(--paper));
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
  transition:
    transform 90ms var(--ease-out, ease-out),
    opacity 0.15s;
}
.ask-tile.block {
  flex-direction: row;
}
.ask-tile:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}
.ask-tile .ask-choice-key {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 0.65rem;
}
.ask-tile-jp {
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
}
.ask-tile.is-particle .ask-tile-jp {
  font-weight: 900;
}
.ask-tile.is-used {
  opacity: 0.25;
  box-shadow: none;
}
.ask-tile.is-shake {
  animation: tile-shake 240ms ease-in-out;
}
.ask-tile.is-hint {
  animation: tile-hint 0.9s ease-in-out infinite;
}
.ask-build-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.answer-usual {
  margin: 6px 0 0;
  font-size: 0.9rem;
}
.answer-usual-label {
  font-weight: 700;
}
.answer-sheet .block-lines {
  margin-top: 8px;
}
@keyframes slot-pop {
  from {
    transform: scale(0.85);
  }
  to {
    transform: scale(1);
  }
}
@keyframes tile-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px) rotate(-3deg);
  }
  75% {
    transform: translateX(6px) rotate(3deg);
  }
}
@keyframes tile-hint {
  0%,
  100% {
    box-shadow: 0 3px 0 var(--ink);
  }
  50% {
    box-shadow:
      0 3px 0 var(--ink),
      0 0 0 5px rgb(246 199 71 / 0.9);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ask-slot.is-filled,
  .ask-tile.is-shake,
  .ask-tile.is-hint {
    animation: none;
  }
  .ask-tile.is-hint {
    outline: 4px solid var(--yellow);
  }
}

/* Cards: blocks on the back, particle cards */
.study-card-line--blocks {
  display: grid;
  justify-items: center;
  gap: 4px;
}
.study-card-example--blocks {
  display: grid;
  justify-items: center;
  gap: 4px;
}
.flashcard-side .block-lines,
.flashcard-side .blocks {
  justify-content: center;
}
.flashcard-side .block-lines.is-compact .block {
  padding: 2px 6px 3px;
}
.study-card-particle {
  display: grid;
  justify-items: center;
  padding: 4px 18px 6px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: var(--fill, var(--paper));
}
.study-card-particle .study-card-jp {
  color: var(--ink-role, var(--ink));
}

/* Pattern tab: the template and examples in blocks */
.study-pattern-card .block-lines {
  margin: 8px 0;
}
.study-pattern-title {
  margin: 2px 0 6px;
  font: 1.3rem/1.2 var(--heading);
}
.study-say-body .block-lines {
  margin: 4px 0;
}

/* The word lists: blocks under each line, particles and order cards */
.study-line {
  margin: 0 0 8px;
}
.study-line-text {
  margin: 0 0 4px;
}
.study-list-particle p,
.study-list-pattern-head {
  margin: 0 0 4px;
}
.study-list-particle-jp {
  display: inline-grid;
  place-items: center;
  min-width: 2.2em;
  padding: 0 6px;
  font-size: 1.3rem;
  font-weight: 900;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--fill, var(--paper));
  color: var(--ink-role, var(--ink));
}
.study-list-order {
  display: block;
  font-family: var(--heading);
  font-weight: 400;
}
.study-list-answer p {
  margin: 0 0 4px;
}

/* ════ Lesson pages: folding sections, the next step ════ */
.study-section {
  padding: 0;
}
.study-section-fold > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  border-radius: inherit;
}
.study-section-fold > summary::-webkit-details-marker {
  display: none;
}
.study-section-fold > summary::after {
  content: '';
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-right: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  transform: rotate(-45deg);
  transition: transform 0.2s;
}
.study-section-fold[open] > summary::after {
  transform: rotate(45deg);
}
.study-section-fold > summary:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}
.study-section-name {
  flex: 1;
  min-width: 0;
}
.study-section-name h3 {
  margin: 0;
  font-size: clamp(1.2rem, 3vw, 1.6rem);
}
.study-section-pattern {
  display: block;
}
.study-section-fold > .study-sets,
.study-section-fold > .study-list {
  margin: 0 18px 16px;
}
.study-section-fold > .study-sets {
  margin-top: 4px;
}
.study-section--structure .study-section-number {
  background: var(--role-time);
}
.study-set.is-next {
  background: var(--yellow);
  box-shadow: 0 3px 0 var(--ink);
}
.study-set.is-next .study-set-badge {
  background: var(--ink);
  color: var(--paper);
}
.study-due-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 700;
  color: var(--ink);
}
.study-due-link[hidden] {
  display: none;
}
.lesson-next .drawing-button {
  text-decoration: none;
  color: var(--ink);
}
@media (max-width: 520px) {
  /* On a phone the count sits under the section name, so a name like "Jobs and workplaces"
     keeps whole words on a 320 px screen instead of breaking inside them. */
  .study-section-fold > summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      'number name chevron'
      'number count chevron';
    column-gap: 10px;
    row-gap: 2px;
    padding: 12px 14px;
  }
  .study-section-fold > summary .study-section-number {
    grid-area: number;
  }
  .study-section-fold > summary .study-section-name {
    grid-area: name;
  }
  .study-section-fold > summary .study-section-count {
    grid-area: count;
    max-width: none;
    text-align: left;
  }
  .study-section-fold > summary::after {
    grid-area: chevron;
  }
  .study-section-fold > .study-sets,
  .study-section-fold > .study-list {
    margin: 0 12px 14px;
  }
}

/* ════ /study/: Today, Mix it up, the week ════ */
.study-hub-intro {
  margin-bottom: 14px;
}
.study-hub-line {
  max-width: 34rem;
}
/* A first visit: one way in, then the lessons (docs/pm-audit.md B1). */
.study-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
  max-width: 560px;
  margin: 0 auto 22px;
  text-align: center;
}
.study-start[hidden] {
  display: none;
}
.study-start-note {
  color: var(--muted);
  font-weight: 700;
}
/*
 * Today, Mix it up and the week are for a learner who has studied here before. Until the script
 * decides (and without it), the inline flag in the hub picks: a first visit hides them, and a
 * returning learner keeps their space, so the lesson list never jumps (CLS). The script then
 * sets each one's hidden attribute.
 */
.study-hub:not(.is-returning) :is(.today-card, .study-mix, .study-week) {
  display: none;
}
.study-hub.is-returning:not(.is-ready) :is(.today-card, .study-mix, .study-week) {
  visibility: hidden;
}
.study-hub.is-returning:not(.is-ready) .study-start {
  display: none;
}
.today-ring-slot {
  display: inline-flex;
  min-height: 40px;
  min-width: 40px;
}
.study-section-example-en {
  display: block;
  font-family: var(--body);
  font-size: 0.85em;
  font-weight: 700;
  color: var(--muted);
}
.today-card {
  display: grid;
  gap: 10px;
  max-width: 560px;
  margin: 0 auto 18px;
  padding: 16px 18px 14px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 22px 18px 24px 20px;
  box-shadow: 5px 5px 0 var(--ink);
}
.today-card[hidden],
.study-mix[hidden],
.study-scope[hidden],
.study-week[hidden] {
  display: none;
}
.today-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.today-title {
  margin: 0;
  font-size: 1.7rem;
}
.today-streak {
  margin: 0 0 0 auto;
  font-weight: 800;
}
.today-streak:empty {
  display: none;
}
.today-plan {
  margin: 0;
  font-weight: 700;
  color: var(--muted);
}
.today-go {
  justify-self: start;
  text-decoration: none;
}
/* The goal and where new words come from are rarely changed, so they fold away. */
.today-settings {
  padding-top: 8px;
  border-top: 2px dashed rgb(57 44 32 / 0.25);
}
.today-settings[open] {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}
.today-settings-toggle {
  flex: 1 1 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}
.today-goal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.today-setting-label {
  font-weight: 700;
  font-size: 0.9rem;
}
.today-from {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.today-from select {
  min-height: 44px;
  max-width: 100%;
  padding: 6px 10px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
}
.goal-ring {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}
.goal-ring-art {
  width: 40px;
  height: 40px;
  transform: rotate(-90deg);
}
.goal-ring-track,
.goal-ring-fill {
  fill: none;
  stroke-width: 6;
}
.goal-ring-track {
  stroke: rgb(57 44 32 / 0.15);
}
.goal-ring-fill {
  stroke: var(--pad-dark);
  stroke-linecap: round;
  transition: stroke-dasharray 0.4s;
}
.goal-ring.is-met .goal-ring-fill {
  stroke: #c99a12;
}
.study-mix {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  max-width: 560px;
  margin: 0 auto 16px;
}
.study-mix-go {
  text-decoration: none;
  color: var(--ink);
}
.study-mix-go.is-waiting,
.study-game.is-waiting {
  opacity: 0.55;
}
.study-scope {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
}
.study-scope .study-chip {
  min-width: 44px;
  padding-inline: 10px;
}
.study-scope .study-chip:disabled {
  opacity: 0.4;
  cursor: default;
}
.study-mix-note {
  flex-basis: 100%;
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}
.study-mix-note[hidden] {
  display: none;
}
.study-week {
  display: grid;
  justify-items: center;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto 22px;
}
.study-week-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 6px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 16px;
  cursor: pointer;
}
.study-week-more {
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: underline;
}
.week-pads {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.week-pad {
  display: grid;
  justify-items: center;
  gap: 2px;
  font-size: 0.75rem;
  font-weight: 700;
}
.week-pad-dot,
.study-day {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 18px;
  border-radius: 50% 50% 46% 54% / 60% 60% 40% 40%;
  background: rgb(57 44 32 / 0.1);
  border: 2px solid transparent;
}
.week-pad.is-goal .week-pad-dot,
.study-day.is-goal {
  background: #f1b928;
  border-color: var(--ink);
}
.week-pad.is-some .week-pad-dot,
.study-day.is-some {
  background: #9ccf7f;
  border-color: var(--pad-dark);
}
.week-pad.is-rest .week-pad-dot,
.study-day.is-rest {
  background: transparent;
  border: 2px dotted var(--ink);
}
.week-pad.is-today .week-pad-dot,
.study-day.is-today {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.study-counts {
  margin: 0;
  font-weight: 700;
}
.study-month {
  width: 100%;
  padding: 12px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 16px;
}
.study-month[hidden] {
  display: none;
}
.study-month-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.study-month-title {
  margin: 0;
  font-size: 1.2rem;
}
.study-month-step {
  min-width: 44px;
  min-height: 44px;
  font: inherit;
  font-weight: 800;
  color: var(--ink);
  background: var(--butter);
  border: 2px solid var(--ink);
  border-radius: 12px;
  cursor: pointer;
}
.study-month-table {
  width: 100%;
  margin-top: 8px;
  border-collapse: collapse;
  text-align: center;
}
.study-month-table th {
  padding: 4px 0;
  font-size: 0.8rem;
}
.study-month-table td {
  padding: 3px 0;
}
.study-month-table .study-day {
  width: 34px;
  height: 30px;
  font-size: 0.85rem;
  font-weight: 700;
}
.study-day.is-future {
  background: transparent;
  color: var(--muted);
}
.study-month-key {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin: 8px 0 0;
  font-size: 0.85rem;
}
.study-month-key-entry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.study-day--key {
  width: 18px;
  height: 14px;
}
.study-hub-heading {
  margin: 8px 0 12px;
  font-size: 1.5rem;
}

/* ════ Sessions in the player: Today and Mix it up ════ */
.learn-room--study.is-session .study-bar {
  display: none;
}
.session-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin: 0 0 8px;
}
.session-step {
  margin: 0;
  font-weight: 800;
}
.session-step:empty {
  display: none;
}
.session-screen .week-pads {
  justify-content: center;
  margin: 10px 0;
}
.session-stop {
  text-decoration: none;
  color: var(--ink);
}
.learn-room--study.is-session .study-progress-row,
.learn-room--study.is-session .study-player-range {
  display: none;
}
.session-head .goal-ring-art {
  width: 30px;
  height: 30px;
}
.session-head .goal-ring {
  font-size: 0.9rem;
}
@media (max-width: 400px) {
  .study-tab {
    padding: 6px 8px;
    font-size: 0.85rem;
  }
  .study-tabs {
    gap: 4px;
  }
  .study-scope .study-chip {
    min-width: 40px;
    padding-inline: 8px;
  }
}
.study-say--plain {
  grid-template-columns: minmax(0, 1fr);
}
@media (max-width: 400px) {
  .study-bar {
    gap: 4px;
  }
  .study-tab {
    padding-inline: 7px;
  }
  .study-switches {
    gap: 4px;
  }
  .study-switch {
    width: 40px;
  }
}
/* Gyoza Grab: an empty slot shows its block's role colour while the sentence is new. */
.grab-slot.role-slot--topic {
  background: var(--role-topic);
}
.grab-slot.role-slot--time {
  background: var(--role-time);
}
.grab-slot.role-slot--place,
.grab-slot.role-slot--goal {
  background: var(--role-place);
}
.grab-slot.role-slot--with {
  background: var(--role-with);
}
.grab-slot.role-slot--how {
  background: var(--role-how);
}
.grab-slot.role-slot--object {
  background: var(--role-object);
}
.grab-slot.role-slot--noun {
  background: var(--role-noun);
}
.grab-slot.role-slot--end {
  background: var(--role-end);
}
.grab-tile.block,
.grab-placed.block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: var(--fill);
}
.grab-feedback .block-lines {
  margin: 6px 0;
}
.today-card > * {
  min-width: 0;
}
.today-from {
  flex: 1 1 100%;
  min-width: 0;
}
.today-from select {
  flex: 1 1 12rem;
  width: 100%;
  min-width: 0;
}
/* On /study/, while Today, Mix it up or a game is open, the hub's title shrinks to one line. */
.learn-room--study.is-playing .study-hub-intro {
  margin-bottom: 4px;
}
.learn-room--study.is-playing .study-hub-intro .eyebrow {
  display: none;
}
.learn-room--study.is-playing .study-hub-intro h1 {
  font-size: clamp(1.4rem, 4vw, 1.8rem);
}
.study-player-head .eyebrow:empty {
  display: none;
}
/* The smallest phones (320 px): the four tabs and both sound switches share one row. */
@media (max-width: 360px) {
  .study-bar {
    gap: 4px;
  }
  .study-tabs {
    gap: 3px;
  }
  .study-tab {
    padding-inline: 4px;
    font-size: 0.8rem;
  }
  .study-switches {
    gap: 2px;
  }
  .study-switch {
    width: 33px;
  }
  .study-switch .speaker-icon {
    width: 20px;
    height: 20px;
  }
}

/* ════ Lesson 1: building up to sentences (docs/study-design.md section 3) ════ */
.learn-room--study,
.play-room {
  --role-like: #d2efe9;
  --role-like-ink: #1d5c50;
}
.block--like {
  --fill: var(--role-like);
  --ink-role: var(--role-like-ink);
}
.role-ink--like {
  color: var(--role-like-ink);
}

/* The lesson head: the Japanese title, then its romaji. */
.lesson-jp-more {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 10px;
  margin: 2px 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}
.lesson-jp-romaji,
.study-lesson-romaji {
  font-weight: 700;
  color: var(--red);
}
.study-lesson-romaji {
  font-size: 0.85rem;
}
/* Under the step's sentence (in red), its romaji on a line of its own. */
.study-section-romaji {
  display: block;
  font-family: var(--romaji);
  font-size: 0.82em;
  color: var(--ink);
}

/* Word lists: each example with its romaji and English; the word's class. */
.study-example-jp {
  font-weight: 700;
}
.study-example-romaji {
  font-weight: 700;
  color: var(--red);
}
.study-list-pos,
.study-card-pos {
  display: inline-block;
  padding: 1px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  background: var(--butter);
  border: 2px solid var(--ink);
  border-radius: 999px;
}
.study-card-pos {
  justify-self: center;
}
.study-list-swap,
.study-list-steps {
  display: grid;
  gap: 4px;
  margin: 6px 0 0;
  padding-left: 1.2em;
}
.study-swap-line,
.study-step-line {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
}

/* Build up: the phrase so far, with a slot where the next piece goes. */
.ask-target--ladder {
  gap: 8px;
  padding: 14px 12px;
}
.ladder-chain {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ladder-chip,
.ladder-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  min-height: 46px;
  padding: 4px 9px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 12px;
}
.ladder-chip-jp {
  font-size: 1.1rem;
  font-weight: 700;
  word-break: keep-all;
}
.ladder-slot.is-next {
  min-width: 56px;
  border-style: dashed;
  box-shadow: 0 0 0 3px rgb(246 199 71 / 0.7);
}
.ladder-slot.is-filled {
  animation: slot-pop 220ms var(--ease-spring, ease-out);
}
.ladder-chain.is-right .ladder-slot {
  background: var(--right);
}
.ladder-chain.is-wrong .ladder-slot {
  background: var(--butter);
}
.ladder-hint {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted);
}
.ladder-note {
  margin: 0;
  font-weight: 700;
  color: var(--red);
}
.ladder-next {
  justify-self: center;
  min-height: 48px;
}

/* Choose: the lines around the choice, and choices that show their romaji. */
.ask-target--choose {
  justify-items: stretch;
  padding: 12px 14px;
  text-align: left;
}
.choose-lines .ask-en {
  font-size: clamp(1.2rem, 5vw, 1.6rem);
}
.ask-context .study-say-jp {
  font-size: 1.05rem;
}
.ask-target > .ask-context {
  justify-self: stretch;
  text-align: left;
}
.ask-choice-romaji {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--red);
}
.ask-choices.is-lines .ask-choice-jp {
  font-size: 1.15rem;
}

/* Pattern swap: the pieces as chips, and the line the chosen one makes. */
.pattern-swap {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.pattern-swap-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pattern-swap-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-height: 48px;
  padding: 4px 12px;
}
.pattern-swap-jp {
  font-size: 1.05rem;
  font-weight: 700;
}
.pattern-swap-romaji {
  font-size: 0.75rem;
  font-weight: 700;
}
.pattern-swap-line {
  margin: 0;
}

/* Make your own: three rows built in turn, each with its tray. */
.make-stage {
  display: grid;
  gap: 12px;
}
.make-intro {
  margin: 0;
  font-weight: 700;
  text-align: center;
}
.make-rows {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.make-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #fff;
  border: 2px solid rgb(57 44 32 / 0.35);
  border-radius: 14px;
}
.make-row.is-active {
  border: 3px solid var(--ink);
  box-shadow: 0 0 0 3px rgb(246 199 71 / 0.7);
}
.make-row:not(.is-active, .is-done) {
  background: transparent;
  border-style: dashed;
}
.make-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font: 1.1rem/1.2 var(--heading);
}
.make-row-number {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 0.95rem;
  background: var(--butter);
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.make-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 48px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.make-slot {
  display: inline-flex;
  align-items: center;
  min-width: 48px;
  min-height: 44px;
  padding: 4px 10px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
}
.make-slot.is-next {
  border-style: dashed;
}
.make-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.make-tile {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 52px;
  padding: 4px 10px;
  color: var(--ink);
  font: inherit;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}
.make-tile:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--ink);
}
.make-tile:disabled {
  opacity: 0.25;
  box-shadow: none;
  cursor: default;
}
.make-tile:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 3px;
}
.make-tile.is-shake {
  animation: tile-shake 240ms ease-in-out;
}
.make-tile--topic,
.make-tile--name {
  background: var(--role-topic);
}
.make-tile--adj {
  background: var(--role-like);
}
.make-tile--desu,
.make-tile--dou,
.make-tile--ask {
  background: var(--role-end);
}
.make-tile--very,
.make-tile--yes,
.make-tile--no {
  background: var(--role-lead);
}
/* Lesson 2: an adjective's "not" and the slip beside it look alike, so the rule decides. */
.make-tile--not,
.make-tile--slip {
  background: var(--role-like);
}
.make-tile-jp {
  font-size: 1.1rem;
  font-weight: 700;
  white-space: nowrap;
}
.make-tile-romaji {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--red);
}
.make-line {
  display: grid;
  gap: 1px;
  margin: 0;
}
.make-line-jp-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.make-line-jp {
  font-size: 1.2rem;
  font-weight: 700;
}
.make-line-romaji {
  font-weight: 700;
  color: var(--red);
}
.make-note {
  min-height: 1.4em;
  margin: 0;
  font-weight: 700;
}
.make-note.is-wrong {
  color: var(--red);
}
.make-actions {
  display: flex;
  justify-content: flex-start;
}
.make-exchange {
  display: grid;
  gap: 10px;
  padding: 12px;
  text-align: left;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
}
.make-say-all {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0;
  font-weight: 700;
}

/* An old lesson's address, on its way to the new lesson. */
.study-moved {
  max-width: 34rem;
  margin: 0 auto;
  text-align: center;
}

/* ════ Words first: the scene, meeting new items, meaning by ear (docs/study-design.md 3.2) ════ */
.ask-scene {
  display: grid;
  gap: 12px;
  max-width: 620px;
  margin: 0 auto;
  padding: 14px;
  text-align: left;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 20px 16px 22px 18px;
  box-shadow: 4px 4px 0 var(--ink);
}
.ask-scene[hidden] {
  display: none;
}
.ask-scene-title {
  margin: 0;
  font: 1.35rem/1.15 var(--heading);
}
.ask-scene-title:focus {
  outline: none;
}
.talk-scene {
  display: grid;
  gap: 8px;
}
.talk-scene-line {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.45;
}
.talk-scene-exchange {
  margin: 4px 0 0;
}
.ask-scene-go,
.ask-meet-next {
  justify-self: center;
  min-width: min(100%, 220px);
  min-height: 52px;
  font-size: 1.1rem;
}
.ask-meet-next[hidden] {
  display: none;
}
.ask-target--meet {
  padding: 14px;
  background: var(--paper);
}
.ask-meet {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 100%;
}
.ask-meet--pattern,
.ask-meet--example,
.ask-meet--drill {
  justify-items: stretch;
  text-align: left;
}
.ask-meet--pattern .study-pattern-card {
  margin: 0;
  box-shadow: none;
  border: 0;
  padding: 0;
  background: none;
}
.ask-meet-lines {
  margin: 0;
}
.ask-meet-visual .learn-art,
.ask-meet-visual .clock,
.ask-meet-visual .visual {
  width: 96px;
  height: 96px;
}
.ask-meet-visual .visual--days,
.ask-meet-visual .visual--span,
.ask-meet-visual .visual--week {
  width: 160px;
  height: auto;
}
.ask-meet-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
}
.ask-meet-head .ask-say {
  position: static;
}
.ask-meet-jp {
  font-size: clamp(2rem, 9vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.ask-meet-jp.is-long {
  font-size: clamp(1.6rem, 6.5vw, 2.4rem);
}
.ask-meet-jp.is-very-long {
  font-size: clamp(1.3rem, 5vw, 1.8rem);
}
.ask-meet-romaji {
  font: 1.45rem/1.15 var(--heading);
  color: var(--red);
}
.ask-meet-en {
  font: clamp(1.25rem, 5vw, 1.6rem)/1.2 var(--heading);
}
.ask-meet-note {
  margin: 2px 0 0;
  font-weight: 700;
  color: var(--muted);
}
.ask-meet-example {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin: 8px 0 0;
  padding-top: 8px;
  border-top: 2px dashed rgb(57 44 32 / 0.25);
  width: 100%;
}
.ask-meet-example-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ask-meet-example-jp {
  font-size: 1.15rem;
  font-weight: 700;
}
.ask-meet-example-romaji {
  font-weight: 700;
  color: var(--red);
}
.ask-meet-example-en {
  color: var(--muted);
  font-weight: 700;
}
.ask-listen {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 0;
}
.ask-listen .ask-listen-say {
  width: 72px;
  height: 72px;
}
.ask-listen .ask-listen-say .speaker-icon {
  width: 38px;
  height: 38px;
}
.ask-listen-hint {
  font-weight: 700;
  color: var(--muted);
}
.ask-choice-text {
  display: grid;
  justify-items: center;
  gap: 1px;
}
.ask-piece {
  margin: 4px 0 0;
  font-size: clamp(1.6rem, 7vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.ladder-piece-note {
  margin: 0;
  padding: 4px 10px;
  font-weight: 700;
  background: var(--butter);
  border: 2px solid var(--ink);
  border-radius: 10px;
}

/* Kero and Goro react in the corner of Learn: a hop on a streak, a peek on a miss. */
.ask-cast {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
}
.ask-cast img {
  position: absolute;
  width: 54px;
  height: auto;
  opacity: 0;
}
.ask-cast-kero {
  top: 4px;
  left: 4px;
}
.ask-cast-goro {
  top: 4px;
  right: -60px;
}
.ask-cast-kero.is-hop {
  animation: cast-hop 0.9s var(--ease-out);
}
.ask-cast-goro.is-peek {
  animation: cast-peek 1.4s var(--ease-out);
}
@keyframes cast-hop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
  }
  25% {
    opacity: 1;
    transform: translateY(-14px) rotate(-6deg) scale(1.05);
  }
  55% {
    opacity: 1;
    transform: translateY(0) rotate(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(0);
  }
}
@keyframes cast-peek {
  0% {
    opacity: 0;
    transform: translateX(0);
  }
  25%,
  70% {
    opacity: 1;
    transform: translateX(-62px) rotate(-8deg);
  }
  100% {
    opacity: 0;
    transform: translateX(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ask-cast-kero.is-hop,
  .ask-cast-goro.is-peek {
    animation: none;
  }
}

/* Sensei's plain correction of a misread number word. */
.answer-sensei {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  margin: 0;
  padding: 8px 10px;
  text-align: left;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 12px;
}
.answer-sensei-face {
  grid-row: 1 / 3;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--butter);
}
.answer-sensei-name {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.answer-sensei-text {
  font-weight: 700;
}

/* A word's example under its flashcard, with its speaker right beside it. */
.study-card-example-row {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin-top: 12px;
  padding: 10px 12px;
  text-align: center;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 14px;
}
.study-card-example-row[hidden] {
  display: none;
}
.study-card-example-said {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.study-card-example-row .study-card-romaji-small,
.study-card-example-en {
  margin: 0;
}
.study-card-example-en {
  font-weight: 700;
  color: var(--muted);
}

/* The scene in a word list, readable without script. */
.study-list-scene {
  display: grid;
  gap: 6px;
  margin: 0 0 10px;
  padding: 10px 12px;
  background: #fff;
  border: 2px dashed rgb(57 44 32 / 0.4);
  border-radius: 12px;
}

/* ════ Make your own with a clock or a calendar ════ */
.make-setter {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
}
.make-setter-title {
  margin: 0;
  font: 1.1rem/1.2 var(--heading);
}
.make-clock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.make-clock-face {
  width: 112px;
  height: 112px;
}
.make-clock-time,
.make-date-shown {
  margin: 0;
  font: 1.8rem/1.1 var(--heading);
  text-align: center;
}
.make-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 6px;
}
.make-chips--minutes,
.make-chips--months {
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
}
.make-chips--half {
  grid-template-columns: repeat(2, minmax(80px, 140px));
  justify-content: center;
}
.make-chip {
  min-height: 44px;
  padding: 4px 6px;
  justify-content: center;
}
.make-tile--time,
.make-tile--hour,
.make-tile--minute,
.make-tile--half,
.make-tile--month,
.make-tile--day {
  background: var(--role-time);
}
.make-tile--desuka {
  background: var(--role-end);
}
.make-tile--wa {
  background: var(--role-topic);
}
.make-line .study-face {
  width: 32px;
  height: 32px;
}
.make-line--reply {
  padding-top: 8px;
  border-top: 2px dashed rgb(57 44 32 / 0.25);
}

/* ════ /learn/vocabulary/: a pack's line under its name, and the link on to more ════ */
.vocab-pack .study-lesson-sub + .study-lesson-sub {
  margin-top: 2px;
}
.vocab-more {
  margin: 18px 0 0;
}
.study-lesson--vocab {
  background: #f1ebfa;
}

/* ════ /learn/numbers/: the path in three parts ════ */
.numbers-part {
  display: grid;
  gap: 10px;
  margin: 26px 0 0;
}
.numbers-part-title {
  margin: 0;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
}
.numbers-part-number {
  display: block;
  font: 800 0.8rem/1.2 var(--body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
}
.numbers-part-line {
  margin: 0;
  font-weight: 700;
  color: var(--muted);
}
.numbers-sections {
  margin: 0;
}
.learn-room--index .today-card--mini {
  margin: 14px 0;
  max-width: 460px;
}
.numbers-section-item {
  position: relative;
}
.numbers-section-item > .numbers-section {
  padding-bottom: 62px;
}
.numbers-section-item > .learn-tile-play {
  min-height: 44px;
  padding: 0 16px;
}

/* A long block (いま すんでいる ところ は) wraps at its spaces in a narrow card, never past it. */
.block {
  max-width: 100%;
}
.block-jp {
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
@media (max-width: 400px) {
  .ask-scene {
    padding: 10px 8px;
  }
  .ask-scene .study-example,
  .ask-meet .study-example {
    padding: 8px;
  }
  .ask-target--meet {
    padding: 10px 8px;
  }
  /* A long word such as なんようびですか stays whole on its line, its 。 with it: the face
     sits small beside the speaker's name, and the line takes the card's whole width. */
  .ask-scene .study-say-jp,
  .ask-meet .study-say-jp {
    font-size: 1.1rem;
  }
  .ask-scene .study-say:not(.study-say--plain),
  .ask-meet .study-say:not(.study-say--plain) {
    grid-template-columns: 28px minmax(0, 1fr);
    align-items: center;
    column-gap: 8px;
    row-gap: 2px;
  }
  .ask-scene .study-say:not(.study-say--plain) > .study-say-body,
  .ask-meet .study-say:not(.study-say--plain) > .study-say-body {
    display: contents;
  }
  .ask-scene .study-say-body > :not(.study-say-name),
  .ask-meet .study-say-body > :not(.study-say-name) {
    grid-column: 1 / -1;
  }
  .ask-scene .study-say .study-face,
  .ask-meet .study-say .study-face {
    width: 28px;
    height: 28px;
    font-size: 0.6rem;
  }
}

/* ════ The kana paths (docs/kana-design.md) ════ */
/* Hiragana keeps its butter page and katakana its blue one, in the same player. */
.learn-room--study.learn-room--hiragana {
  --learn-bg: var(--butter);
}
.learn-room--study.learn-room--katakana {
  --learn-bg: var(--blue);
  --muted: #3f3224;
  --red: #7f2219;
}
/* A letter's sound, big: the question "Pick the kana". */
.ask-sound {
  font: clamp(2.4rem, 11vw, 3.6rem)/1.05 var(--heading);
  color: var(--red);
}
/* Read it: the letter or word in kana, big. */
.ask-read-jp {
  font-size: clamp(2.4rem, 11vw, 3.8rem);
  font-weight: 700;
  line-height: 1.15;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.ask-read-jp.is-long {
  font-size: clamp(1.8rem, 7.5vw, 2.6rem);
}
.ask-read-jp.is-very-long {
  font-size: clamp(1.4rem, 5.5vw, 2rem);
}
.ask-choice-reading {
  font: 1.45rem/1.15 var(--heading);
  color: var(--red);
}
/* Meeting a letter: the kana bigger than a word's. */
.ask-meet--kana .ask-meet-jp {
  font-size: clamp(3.2rem, 15vw, 4.8rem);
  line-height: 1.05;
}
.ask-meet--kana .ask-meet-romaji {
  font-size: 1.8rem;
}
.study-card-letter {
  font-size: clamp(3.4rem, 16vw, 5.2rem);
  line-height: 1.05;
}
/* A letter's sound: the whole question on an English-first card, so it fills the card. */
.study-card-letter-sound {
  font-size: clamp(2.8rem, 13vw, 4rem);
}
.study-list-kana {
  font-size: 1.6rem;
}
/* Say it to Kero: the moment, and who speaks first. */
.make-scene {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}
.make-line--cue .study-face {
  width: 32px;
  height: 32px;
}
/* At Kero's café: the menu on the counter. */
.make-menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 118px), 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.make-menu-item {
  display: grid;
  gap: 0;
  padding: 6px 8px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px;
}
.make-menu-jp {
  font-weight: 700;
  font-size: 1.1rem;
}
.make-menu-romaji {
  font-weight: 700;
  color: var(--red);
}
.make-menu-en {
  font-size: 0.9rem;
  color: var(--muted);
}
.make-tile--dish,
.make-tile--o {
  background: var(--role-object);
}
.make-tile--please {
  background: var(--role-end);
}
.make-tile--kana .make-tile-jp {
  font-size: 1.4rem;
}
/* A rule card on the kana paths reads "How it works". */
.study-pattern-card--rule .study-pattern-jp {
  font-size: clamp(1.6rem, 7vw, 2.4rem);
}

/* ════ Easy, Normal or Hard: one switch on the hubs and in the player ════ */
.level-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 12px 0 0;
}
.level-switch[hidden] {
  display: none;
}
/* With scripts on, the page's switch and the title's speaker hold their place from the first
   paint, hidden until the script shows them, so the path below never jumps down as the page
   loads. Without scripts they stay out. */
@media (scripting: enabled) {
  /* Over the rooms' own [hidden] rule (display: none !important), for these three only. */
  body .level-switch[hidden]:not(.level-switch--player) {
    display: flex !important;
    visibility: hidden;
  }
  body .lesson-jp .say-button[hidden] {
    display: inline-grid !important;
    visibility: hidden;
  }
  body .study-set-play[hidden] {
    display: flex !important;
    visibility: hidden;
  }
}
.level-switch-label {
  font-weight: 700;
}
.level-switch-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.level-chip {
  min-width: 64px;
  min-height: 44px;
  padding: 4px 14px;
  font: 700 0.95rem/1.1 var(--body);
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 2px 0 var(--ink);
  cursor: pointer;
  transition:
    transform 0.1s var(--ease-out),
    box-shadow 0.1s var(--ease-out);
}
.level-chip:active {
  transform: translateY(2px);
  box-shadow: none;
}
.level-chip[aria-pressed='true'] {
  color: var(--paper);
  background: var(--ink);
}
.level-chip:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 2px;
}
.level-switch-note {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--muted);
}
.level-switch--player {
  margin-top: 8px;
}
.level-switch--hub {
  margin: 0 0 14px;
}
.study-lesson-bar .level-switch {
  justify-content: center;
}
.study-lesson-bar .level-switch-note {
  text-align: center;
}
@media (prefers-reduced-motion: reduce) {
  .level-chip {
    transition: none;
  }
  .level-chip:active {
    transform: none;
  }
}
@media (forced-colors: active) {
  .level-chip {
    border-color: ButtonText;
  }
  .level-chip[aria-pressed='true'] {
    outline: 2px solid Highlight;
  }
}

/* Easy: Hint lights the next tile, in Learn and in Gyoza Grab. */
.ask-hint[hidden],
.grab-hint[hidden] {
  display: none;
}
.ask-hint,
.grab-hint {
  min-width: 88px;
}
.hop-level-line {
  max-width: 32ch;
  margin: 0;
  font-weight: 700;
  color: var(--muted);
}
.hop-level-line[hidden] {
  display: none;
}

/* ════ Match: the meaning game ════
 * Cards are dealt face down and flip up. A Japanese card (kana and romaji) pairs with its
 * meaning (English, a numeral, a clock or a calendar). Props may squash and tilt; Kero and Goro
 * move only as whole pictures.
 */
.match-stage {
  position: relative;
  display: grid;
  gap: 10px;
  width: min(100%, 680px);
  margin: 0 auto;
}
.match-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
}
.match-hud.is-quiet {
  display: none;
}
.match-round {
  margin: 0;
  font-weight: 700;
}
.match-combo {
  margin: 0;
  font: 1.3rem/1 var(--heading);
  color: var(--red);
}
.match-combo.is-hot {
  animation: hop-twinkle 1.2s ease-in-out infinite;
}
.match-clock {
  margin: 0 0 0 auto;
  padding: 4px 12px;
  font: 1.25rem/1 var(--heading);
  font-variant-numeric: tabular-nums;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 2px 0 var(--ink);
}
.match-clock[hidden] {
  display: none;
}
.match-kero,
.match-goro {
  flex: 0 0 auto;
  width: 44px;
  height: auto;
}
.match-goro {
  order: 9;
}
.match-kero.is-hop {
  animation: match-kero-hop 0.6s var(--ease-out);
}
.match-goro.is-peek {
  animation: match-goro-glee 0.9s ease-in-out;
}
@keyframes match-kero-hop {
  40% {
    transform: translateY(-12px) rotate(-6deg);
  }
  70% {
    transform: translateY(0) rotate(2deg);
  }
}
@keyframes match-goro-glee {
  20%,
  60% {
    transform: rotate(-8deg) translateY(-4px);
  }
  40%,
  80% {
    transform: rotate(8deg) translateY(-4px);
  }
}
.match-table {
  position: relative;
  padding: 12px;
  background:
    radial-gradient(circle at 12px 12px, rgb(255 255 255 / 0.35) 2px, transparent 2.5px) 0 0 / 24px
      24px,
    #ffe6a3;
  border: 3px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 5px 0 var(--ink);
}
.match-table[hidden] {
  display: none;
}
.match-board {
  display: grid;
  gap: 10px;
}
.match-board.is-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 14px;
}
.match-col {
  display: grid;
  grid-auto-rows: 1fr;
  gap: 10px;
}
.match-board.is-mixed {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (min-width: 640px) {
  .match-board.is-mixed {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .match-board.is-mixed.is-six {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .match-board.is-columns {
    column-gap: 28px;
  }
}
.match-fx {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.match-card {
  position: relative;
  display: block;
  min-height: 76px;
  padding: 0;
  font: inherit;
  color: var(--ink);
  text-align: center;
  background: none;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  perspective: 800px;
  -webkit-tap-highlight-color: transparent;
}
.match-card-inner {
  position: relative;
  display: grid;
  min-height: inherit;
  height: 100%;
  transform-style: preserve-3d;
  transition:
    transform 0.32s var(--ease-out) calc(var(--deal, 0) * 45ms),
    translate 0.12s var(--ease-out);
}
.match-card.is-down .match-card-inner {
  transform: rotateY(180deg);
}
.match-card-face,
.match-card-back {
  grid-area: 1 / 1;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  min-width: 0;
  padding: 8px 10px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--ink);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.match-card-face {
  background: var(--paper);
}
.match-card--en .match-card-face {
  background: #fff4d6;
}
.match-card-back {
  transform: rotateY(180deg);
  background:
    radial-gradient(circle at 50% 50%, #8fd0a0 0 30%, transparent 31%) 50% 50% / 34px 34px,
    #5aa64a;
}
.match-jp {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.match-jp.is-long {
  font-size: 1.15rem;
}
.match-jp.is-very-long {
  font-size: 1rem;
}
.match-romaji {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--red);
  overflow-wrap: anywhere;
}
.match-en {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.match-en.is-long {
  font-size: 0.95rem;
}
.match-visual {
  display: grid;
  place-items: center;
  width: min(100%, 120px);
  height: 56px;
}
.match-visual > *,
.match-visual img,
.match-visual svg {
  width: 100%;
  height: 100%;
  max-height: 56px;
  object-fit: contain;
}
.match-visual .time-prompt-text {
  display: none;
}
.match-card:hover:not(:disabled) .match-card-inner {
  translate: 0 -2px;
}
.match-card.is-picked .match-card-inner {
  translate: 0 -4px;
}
.match-card.is-picked .match-card-face {
  background: var(--yellow);
  box-shadow:
    0 6px 0 var(--ink),
    0 0 0 4px rgb(255 255 255 / 0.9);
}
.match-card:focus-visible {
  outline: 3px solid #075693;
  outline-offset: 4px;
}
.match-card.is-wrong .match-card-face {
  background: var(--wrong);
  animation: match-shake 0.36s ease-in-out;
}
.match-card.is-hint .match-card-face {
  background: #fff1a8;
  animation: match-hint 0.8s ease-in-out infinite;
}
.match-card.is-matched {
  cursor: default;
}
.match-card.is-matched .match-card-face {
  background: var(--right);
  box-shadow: 0 2px 0 var(--ink);
  animation: match-pop 0.42s var(--ease-spring);
}
.match-card.is-matched .match-card-inner {
  opacity: 0.72;
  transition: opacity 0.3s ease 0.3s;
}
/* A tick, drawn in CSS, in the corner of a matched card. */
.match-card.is-matched .match-card-face::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 9px;
  width: 7px;
  height: 13px;
  border: solid #2f5f1f;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.match-badge {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  margin: -18px 0 0 -26px;
  padding: 2px 10px;
  font: 1.4rem/1.1 var(--heading);
  color: var(--ink);
  background: var(--yellow);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--ink);
  opacity: 0;
  pointer-events: none;
}
.match-badge.is-popping {
  animation: hop-badge 0.9s var(--ease-out) forwards;
}
.match-plus {
  position: absolute;
  top: -8px;
  right: 14px;
  z-index: 4;
  font: 1.2rem/1 var(--heading);
  color: var(--red);
  opacity: 0;
  pointer-events: none;
}
.match-plus.is-showing {
  animation: match-plus 0.9s var(--ease-out);
}
.match-intro {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 18px 16px 20px;
  text-align: center;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink);
}
.match-intro[hidden],
.match-results[hidden] {
  display: none;
}
.match-intro-title {
  margin: 0;
  font-size: 1.8rem;
}
.match-intro-art {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 190px;
  height: 84px;
}
.match-intro-card {
  width: 48px;
  height: 66px;
  margin: 0 -6px;
  background:
    radial-gradient(circle at 50% 50%, #8fd0a0 0 30%, transparent 31%) 50% 50% / 24px 24px,
    #5aa64a;
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 3px 0 var(--ink);
  animation: match-fan 2.4s ease-in-out infinite;
}
.match-intro-card:nth-child(1) {
  transform: rotate(-12deg);
  animation-delay: -0.4s;
}
.match-intro-card:nth-child(2) {
  transform: translateY(-8px);
  background: var(--paper);
  animation-delay: -0.8s;
}
.match-intro-card:nth-child(3) {
  transform: rotate(12deg);
  animation-delay: -1.2s;
}
.match-intro-kero {
  position: absolute;
  right: -14px;
  bottom: -4px;
  width: 58px;
  height: auto;
}
@keyframes match-fan {
  50% {
    translate: 0 -4px;
  }
}
.match-intro-title:focus {
  outline: none;
}
.match-intro-line {
  max-width: 34ch;
  margin: 0;
  font-weight: 700;
}
.match-intro-level,
.match-best {
  max-width: 36ch;
  margin: 0;
  font-weight: 700;
  color: var(--muted);
}
.match-best[hidden] {
  display: none;
}
.match-start {
  min-width: 170px;
}
@keyframes match-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.12) rotate(-2deg);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes match-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-7px) rotate(-2deg);
  }
  45% {
    transform: translateX(6px) rotate(2deg);
  }
  70% {
    transform: translateX(-4px);
  }
}
@keyframes match-hint {
  0%,
  100% {
    box-shadow: 0 4px 0 var(--ink);
  }
  50% {
    box-shadow:
      0 4px 0 var(--ink),
      0 0 0 6px rgb(246 199 71 / 0.95);
  }
}
@keyframes match-plus {
  0% {
    opacity: 0;
    transform: translateY(6px);
  }
  25% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-18px);
  }
}
@media (max-width: 400px) {
  .match-table {
    padding: 10px 8px;
  }
  .match-board.is-columns {
    column-gap: 8px;
  }
  .match-card {
    min-height: 70px;
  }
  .match-card-face,
  .match-card-back {
    padding: 6px;
  }
  .match-jp {
    font-size: 1.3rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .match-card-inner {
    transition: opacity 0.15s linear;
  }
  .match-card.is-down .match-card-inner {
    transform: none;
    opacity: 0;
  }
  .match-card:hover:not(:disabled) .match-card-inner,
  .match-card.is-picked .match-card-inner {
    translate: none;
  }
  .match-card.is-wrong .match-card-face,
  .match-card.is-matched .match-card-face,
  .match-combo.is-hot,
  .match-kero.is-hop,
  .match-goro.is-peek {
    animation: none;
  }
  .match-card.is-hint .match-card-face {
    animation: none;
    outline: 4px solid var(--yellow);
  }
  .match-badge.is-popping,
  .match-plus.is-showing,
  .match-intro-card {
    animation: none;
  }
}
@media (forced-colors: active) {
  .match-card-face,
  .match-card-back {
    border-color: ButtonText;
  }
  .match-card.is-picked .match-card-face {
    outline: 3px solid Highlight;
  }
  .match-card.is-matched .match-card-face {
    outline: 2px dashed GrayText;
  }
}

/* Match on the Play tab and on the hub's Games row: two little cards, a word and its meaning. */
.play-tile--match .play-tile-art {
  background: #ffe6a3;
}
.play-tile-cards {
  position: absolute;
  inset: 18px 14px 18px 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.play-tile-card {
  display: grid;
  place-items: center;
  min-width: 0;
  max-width: 48%;
  min-height: 70%;
  padding: 6px 8px;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--ink);
}
.play-tile-card--jp {
  transform: rotate(-5deg);
}
.play-tile-card--en {
  font: 1.6rem/1 var(--heading);
  background: #fff4d6;
  transform: rotate(4deg);
}
.play-tile-card-jp {
  font-size: 1.15rem;
  white-space: nowrap;
}
.play-tile-card-romaji {
  font-size: 0.8rem;
  color: var(--red);
}
.play-tile--match .play-tile-kero {
  bottom: 8px;
  left: 4%;
  width: 30%;
  max-width: 88px;
}
.study-game-cards {
  display: flex;
  gap: 3px;
  width: 100%;
}
.study-game--match .study-game-art {
  width: 66px;
}
.study-game-card {
  display: grid;
  place-items: center;
  flex: 1 1 0;
  min-height: 42px;
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 8px;
  transform: rotate(-4deg);
}
.study-game-card--en {
  background: #fff4d6;
  transform: rotate(4deg);
}
.study-games-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 620px) {
  .study-games-row {
    grid-template-columns: 1fr;
  }
}

/* Three games on the Play tab: side by side on a wide screen, one under another on a phone,
   each with its picture beside its name. */
.play-tiles {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 920px;
}
@media (max-width: 720px) {
  .play-tiles {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .play-tile {
    grid-template-rows: none;
    grid-template-columns: minmax(120px, 38%) 1fr;
    min-height: 108px;
  }
  .play-tile-art {
    border-bottom: 0;
    border-right: 3px solid var(--ink);
  }
  .play-tile-words {
    align-content: center;
    padding: 10px 12px;
  }
  .play-tile--hop .play-tile-kero {
    width: 64px;
    margin-left: -32px;
  }
  .play-tile-cards {
    inset: 12px 4px 12px 36%;
    gap: 4px;
  }
  .play-tile-card {
    max-width: none;
    padding: 4px 6px;
    border-width: 2px;
  }
  .play-tile-card-jp {
    font-size: 0.95rem;
  }
  .play-tile--match .play-tile-kero {
    left: 2%;
    width: 34%;
  }
}
/* In the player the switch keeps to one line, so a whole round still fits on a phone: its note
   is read out, not shown. */
.level-switch--player .level-switch-note {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.study-player-head .level-switch {
  justify-content: center;
}
.match-clock[hidden] + .match-goro {
  margin-left: auto;
}

/* A speaker shown by name ("You") grows with its text, so it never spills out of its circle at
   200% text; a face picture keeps its fixed size. */
.make-line {
  --face: 32px;
}
.grab-prompt-row {
  --face: 34px;
}
.study-face.study-face--text {
  width: auto;
  height: auto;
  min-width: var(--face, 40px);
  min-height: var(--face, 40px);
  padding: 0 0.3em;
  border-radius: 999px;
}
