/* Phone and tablet adaptations shared by Android and the desktop renderer. */
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior-y: none; }
@container kp-stage (max-width: 600px){
  .header { padding-inline: 16px; gap: 10px; }
  .header-title { text-align: center; }
  .quiet-button, .text-link, .resume-link, .topic-switch button,
  .playback-toggle, .game-footer .secondary { min-height: 48px; }
  .symbol-tile { min-height: 48px; }
  .topic-card { min-width: 0; }
  .topic-card h2 { font-size: clamp(16px, 4.6cqw, 23px); }
  .topic-symbol { letter-spacing: -4px; }
  .topic-arrow { right: 9px; bottom: 9px; width: 28px; height: 28px; }
  .home-main { padding-inline: 16px; }
  .home-intro h1 { font-size: clamp(32px, 9.8cqw, 43px); }
  .catalog-preview { overflow: hidden; }
  .catalog-copy h3 { overflow-wrap: anywhere; }
  .section-heading > div { min-width: 0; }
  .section-heading .range-label { flex-shrink: 0; }
  .lesson-controls { flex-wrap: wrap; }
  .lesson-controls .primary { order: -1; flex-basis: 100%; }
  .lesson-controls .secondary { flex: 1; }
  .symbol-grid, .lesson-numbers .symbol-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .directory-heading { align-items: flex-start; flex-wrap: wrap; gap: 6px; }
  .choice-buttons { max-width: 100%; }
  .choice-buttons.three { width: 100%; padding-inline: 12px; gap: 10px; }
  .choice-buttons.three .choice-button { flex: 1; min-width: 0; width: auto; font-size: clamp(56px, 20cqw, 85px); }
  .choice-buttons.three .two-digit { font-size: clamp(42px, 15cqw, 61px); }
  .play-screen .trace-stage { height: auto; min-height: 0; aspect-ratio: 1; max-width: 480px; }
  .trace-canvas { touch-action: none; }
  .lesson-fruit { width: 36px; height: 44px; font-size: 28px; }
  .ten-frame { gap: 3px; }
  dialog { width: calc(100% - 24px); max-height: calc(100cqh - 32px); padding: 20px; overflow-y: auto; }
  .setting input, .setting select { max-width: 100%; min-height: 48px; font-size: 16px; }
  .dialog-top { gap: 10px; }
  .dialog-top .quiet-button { flex-shrink: 0; }
}
@container kp-stage (max-width: 350px){
  .wordmark { font-size: 17px; gap: 5px; }
  .quiet-button.text { padding-inline: 10px; }
  .topic-grid { gap: 12px; }
  .topic-symbol { font-size: 72px; }
  .topic-symbol small { font-size: 48px; }
  .lesson-symbols { font-size: 70px; }
  .games-grid { gap: 10px; }
  .section-heading h2 { font-size: 19px; }
}
@container kp-stage (max-height: 500px) and (orientation: landscape){
  .screen { min-height: 100cqh; }
  .header { height: 64px; }
  .home-main { padding-block: 15px 35px; }
  .topic-grid { margin-top: 20px; }
  .topic-card { min-height: 200px; }
  .focus-main { flex: none; padding-bottom: 12px; }
  .play-screen .trace-stage { height: auto; min-height: 0; width: min(64cqh, 320px); aspect-ratio: 1; }
}
