/* Phones held sideways (iPhone: about 932 x 430, less with Safari's bars), and short laptop windows (up to 600 px tall).
   Loaded last; applies only to short landscape screens, so the iPad and laptop layouts are untouched.
   The menus are sized in rem, so lowering the root size scales them; the puzzle is sized in px and
   gets its own compact layout below. */

@media (orientation: landscape) and (max-height: 600px) {
  html { font-size: clamp(11px, 2.75vh, 16px); }

  /* ---------- menus ---------- */
  .banner { height: calc(3rem + env(safe-area-inset-top, 0px)); margin-bottom: 0.4rem; }
  .banner .deco { transform: scale(0.6); transform-origin: top center; }
  .title { font-size: 2.8rem; }
  .title-small { font-size: 2rem; }
  .who-body { gap: 0.5rem; padding-bottom: 0.6rem; }
  .who-body { padding-top: 0.6rem; }
  .who-body .title { margin-top: 0.6rem; font-size: 2.4rem; }
  .who-card { width: 9.5rem; min-height: 8.5rem; padding: 0.6rem 0.4rem; }
  .home-body { gap: 1.2rem; padding-top: 0; padding-bottom: 0.4rem; }
  .home-hero { flex-basis: 26%; }
  .home-main { gap: 0.45rem; }
  .home-buttons { gap: 0.6rem; }
  .home-buttons #btn-adventure { min-height: 3.8rem; font-size: 1.8rem; }
  .btn-big { min-height: 3.4rem; }
  .home-body { overflow-y: auto; }
  .screen-scroll .sub-body { padding-top: 3.4rem; padding-bottom: 1.5rem; }
  .pets-grid { gap: 0.5rem 1rem; }
  .pet-card { padding: 0.4rem 0.5rem 0.5rem; }
  .practice-card { gap: 0.4rem 1.2rem; padding: 0.7rem 1.4rem 0.8rem; margin-top: 2.6rem; }
  .practice-card .pr-tables .btn { min-height: 2.4rem; }

  /* home v2 and the warm-up */
  .home2 { gap: 0.45rem; }
  .home2-hi .title { font-size: 2.2rem; }
  .home2-hi .lead { font-size: 1rem; margin-top: 0.1rem; }
  .home2-icon { width: 2.4rem; height: 2.4rem; font-size: 1.1rem; box-shadow: 0 3px 0 var(--ink); border-width: 3px; }
  .home2-corner { top: calc(0.3rem + env(safe-area-inset-top, 0px)); }
  .playcard { padding: 0.45rem 0.9rem 0.6rem; gap: 0.15rem; }
  .playcard-go { gap: 0.35rem; }
  .journey { gap: 0.2rem; }
  .jr-road { margin-top: 1.2rem; min-height: 2.5rem; }
  .jr-girl { height: 3.6rem; }
  .play-bar { min-height: 3.4rem; font-size: 1.8rem; box-shadow: 0 4px 0 var(--ink); }
  .btn-quiet { min-height: 2.5rem; font-size: 1rem; }
  .wu-card { padding: 0.8rem 1.4rem 1rem; gap: 1rem; }
  .wu-ahmed { height: 10rem; }
  .wu-words { gap: 0.5rem; }

  /* start screen */
  #screen-who .title { font-size: 2.4rem; }
  .who-play { padding: 0.6rem 1rem 0.8rem 1.6rem; gap: 1rem; }
  .who-play-img { height: 10rem; }
  .who-play-name { font-size: 2.4rem; }
  .who-play-go { min-height: 3rem; font-size: 1.4rem; }

  /* first-run intro */
  .in-ahmed { inset-inline-end: 24%; }
  .in-girl { inset-inline-start: 13%; }
  .in-tag-card { padding: 0.3rem 0.8rem 0.4rem; max-width: 13rem; }
  .in-tag-name { font-size: 1.6rem; }
  .in-tag-role { font-size: 0.9rem; }
  .in-arrow { width: 2.4rem; height: 2.8rem; }
  .in-bubble { top: 3%; inset-inline: 16%; padding: 0.5rem 1rem 0.6rem; }
  .in-bubble-hi { font-size: 1.3rem; }
  .in-bubble li { font-size: 1rem; }

  /* the game keeps clear of the notch and the rounded corners */
  .game-stage { left: env(safe-area-inset-left, 0px); right: env(safe-area-inset-right, 0px); }

  /* ---------- level-up card: short, with the two buttons side by side ---------- */
  .levelup-card { width: min(42rem, 80%); gap: 0.3rem; padding: 0.9rem 1.6rem 1.1rem; max-height: calc(100% - 1rem); }
  .lu-kicker { font-size: 2.4rem; }
  .lu-badge { width: 5rem; height: 5rem; }
  .lu-num { font-size: 2.2rem; }
  .lu-name { font-size: 1.4rem; }
  .lu-blurb { margin-bottom: 0.1rem; }
  .lu-next { font-size: 1rem; padding: 0.2rem 0.8rem; }
  .lu-buttons { flex-wrap: nowrap; margin-top: 0.3rem; }
  .lu-buttons .btn-big { min-height: 3rem; font-size: 1.35rem; }
  .lu-hero { height: 12rem; inset-inline-start: -8rem; }

  /* ---------- lessons ---------- */
  .ls-kind { font-size: 12px; padding: 0 10px 0 6px; border-width: 2px; }
  .ls-card-title { font-size: 20px; }
  .ls-text { font-size: 15px; line-height: 1.3; }
  .ls-html { font-size: 20px; }
  .ls-page { gap: 6px; }
  .ls-body { padding: 6px 10px; }
  .ls-ask-q { font-size: 16px; }
  .ls-choice { min-height: 40px; font-size: 18px; padding: 2px 14px 2px 24px; min-width: 5.5em; box-shadow: 0 3px 0 var(--ink); border-width: 3px; }
  .ls-fb { font-size: 14px; }
  .ls-root { padding: 4px max(8px, env(safe-area-inset-right, 0px)) 4px max(8px, env(safe-area-inset-left, 0px)); }
}

/* Upright phones: the game plays sideways. */
@media (orientation: portrait) and (max-width: 1100px) {
  .rotate-inner h2 { font-size: 1.8rem; }
}
