/* A shared landscape-tablet contract. Natural scrolling remains available on
   phones, portrait, short windows and zoomed-in layouts for accessibility. */
.tablet-award-nav{display:none}
@media (min-width:1000px) and (min-height:650px) {
  body{min-height:100dvh}
  button,a.icon-button{min-height:44px}
  /* Thread: header / stage / footer, with an aspect-correct portrait playfield. */
  body:has(#playScreen) .app-shell{height:100dvh;min-height:0;display:grid;grid-template-rows:72px minmax(0,1fr) 30px}
  body:has(#playScreen) .topbar{height:72px}
  body:has(#playScreen) main{height:100%;min-height:0;padding:12px 28px;margin:0 auto}
  body:has(#playScreen) .game-footer{padding:6px;margin:0}
  .intro-screen,.ending-screen,.certificate-screen{height:100%;min-height:0;padding:0}
  .intro-art,.ending-art{height:min(100%,calc(100dvh - 145px));max-height:100%;transform:none}
  .intro-copy h1{font-size:clamp(42px,4.8vw,66px)}
  .watch-screen{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr)}
  .section-heading{margin:0 auto 10px}.section-heading h2{font-size:36px}
  .watch-layout{min-height:0;height:100%}.film-frame{height:100%;width:auto;max-width:100%}
  .play-screen{height:100%;display:grid;grid-template-rows:auto 42px minmax(0,1fr);gap:10px}
  .play-top{margin:0}.play-top h2{font-size:clamp(32px,3.7vw,48px)}
  .stitch-track{width:620px;max-width:90%;margin:0 auto}.stitch{width:38px;height:38px}
  .play-screen .game-grid{min-height:0;height:100%;grid-template-columns:minmax(300px,.8fr) minmax(390px,1fr);gap:24px}
  .play-screen .scene-frame,.play-screen .scene-frame.thread-stage{height:100%;min-height:0;width:auto;max-width:100%;aspect-ratio:3/5}
  .play-screen .mission-card{min-height:0;max-height:100%;padding:24px 30px}
  .play-screen .sentence-area{margin:12px 0 0;min-height:0}.play-screen .mission-action{min-height:0}
  .certificate-copy{padding:8px}.certificate-copy h1{font-size:42px}
  .certificate-preview{max-width:360px;max-height:100%}.certificate-preview canvas{max-height:calc(100dvh - 190px);width:auto;max-width:100%;margin:auto}
  /* Room: extend the existing two-column layouts to taller 13-inch tablets. */
  body:has(#exitGame){height:100dvh;display:grid;grid-template-rows:86px minmax(0,1fr) 30px}
  body:has(#exitGame)>header{grid-template-columns:minmax(220px,1fr) auto minmax(240px,1fr);padding:10px 24px;gap:14px}
  body:has(#exitGame)>header nav,.header-tools{grid-column:auto;grid-row:auto;width:auto}
  body:has(#exitGame) main{height:100%;min-height:0;width:100%;max-width:1320px;padding:10px 24px;margin:0 auto}
  body:has(#exitGame)>footer{padding:7px;font-size:11px}
  body:has(#exitGame) .view{height:100%;min-height:0;display:flex;flex-direction:column}
  body:has(#exitGame) .view>h1{font-size:36px;margin:4px 0}.view>p{margin:4px 0}
  body:has(#exitGame) .panel,body:has(#exitGame) .film{flex:1;min-height:0;margin-top:10px;padding:16px 22px}
  #watch .film{grid-template-columns:minmax(180px,32%) 1fr;gap:30px}
  #watch .film video{height:100%;max-height:100%;width:auto;max-width:100%;aspect-ratio:9/16;justify-self:center;object-fit:contain}
  body:has(#exitGame) #read .panel{display:grid;grid-template-columns:44% minmax(0,1fr);grid-template-rows:44px minmax(0,1fr) 44px auto 44px;gap:8px 20px}
  #read .row{grid-column:1/-1}#readImage{grid-column:1;grid-row:2/6;height:100%;width:100%;object-fit:contain;margin:0;min-height:0}
  #sentence{grid-column:2;grid-row:2;font-size:34px;line-height:1.45;margin:0;align-self:center}
  #hearRead{grid-column:2;grid-row:3}#readStatus{grid-column:2;grid-row:4;margin:0}#readNext{grid-column:2;grid-row:5}
  #play .panel{display:flex;flex-direction:column;gap:8px}#stars{font-size:30px;margin:0}
  #stations{flex:1;min-height:0;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(2,minmax(0,1fr));gap:10px;margin:0}
  #stations .station{min-height:0;padding:8px}#stations .station img{height:clamp(65px,12vh,115px);width:115px;margin:0 auto 4px}
  #trophy,#trophy:not(:disabled){margin:6px auto;padding:9px 20px;min-height:46px}#restart{min-height:44px;padding:7px}#restartStatus:empty{display:none}
  #activity .panel{display:grid;grid-template-columns:42% minmax(0,1fr);grid-template-rows:44px auto auto minmax(0,1fr) 44px auto auto auto 44px;gap:7px 20px}
  #activity .row,#activityName,#question{grid-column:1/-1}#activityName{margin:0}#question{font-size:28px;margin:0}
  #clue{grid-column:1;grid-row:4/10;width:100%;height:100%;min-height:0;object-fit:contain;margin:0}
  #sounds,.missing-word{grid-column:2;grid-row:4;margin:0;align-self:center}#hearQuestion{grid-column:2;grid-row:5}
  #choices{grid-column:2;grid-row:6;margin:0;gap:8px}#confirmAnswer{grid-column:2;grid-row:7;margin:0}#feedback{grid-column:2;grid-row:8;min-height:0;margin:0;line-height:1.35}#next{grid-column:2;grid-row:9}
  /* Bag: put film beside copy; leave the whole activity and route in view. */
  .ready-game .reader-shell{height:100dvh;min-height:0;display:grid;grid-template-rows:72px minmax(0,1fr);padding:12px 24px;gap:10px}
  .ready-game .topbar{margin:0;grid-template-columns:auto 1fr auto}.ready-game .journey-progress{grid-column:auto;grid-row:auto}
  .ready-game .rsg-phase{height:100%;min-height:0;margin:0 auto}
  .ready-game .phase-copy{margin:0}.ready-game .phase-copy h1{font-size:36px;margin:8px}
  .ready-game #watch{display:grid;grid-template-columns:1fr 40%;grid-template-rows:1fr auto 1fr;gap:16px;align-items:center}
  .ready-game #watch .phase-copy{grid-column:1;grid-row:1/3;align-self:end}
  .ready-game #watch .film-card{grid-column:2;grid-row:1/4;height:100%;width:auto;max-width:100%;margin:0;justify-self:center}
  .ready-game #toListen{grid-column:1;grid-row:3;justify-self:center;align-self:start}
  .ready-game #listen{display:grid;grid-template-rows:auto minmax(0,1fr);gap:12px}
  .ready-game .story-panel{height:100%;min-height:0;margin:0;padding:20px}.ready-game .story-panel>img{height:100%;max-height:100%;object-fit:contain}
  .ready-game #listen:has(#storyQuiz:not([hidden])) .story-panel{display:none}
  .ready-game .game-panel{min-height:0;margin:0 auto;padding:18px 26px;align-self:center}
  .ready-game #route{height:100%;display:grid;grid-template-rows:auto minmax(0,1fr);gap:10px}
  .ready-game .route-panel{height:100%;min-height:0;padding:16px 24px;display:flex;flex-direction:column}
  .ready-game .station-grid{flex:1;min-height:0;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(2,minmax(0,1fr));gap:12px;margin:8px 0}
  .ready-game .station-card{min-height:0;padding:10px}.ready-game .station-card img{max-height:13vh;object-fit:contain}
  .ready-game .word-stage{margin:12px 0;min-height:70px}.ready-game .choice-row{margin:12px 0}.ready-game .feedback{margin:8px 0;min-height:25px}
  .ready-game .story-reading-panel{height:calc(100% - 100px);display:grid;grid-template-columns:44% minmax(0,1fr);grid-template-rows:44px minmax(0,1fr) 48px auto 48px;gap:10px 20px}
  .story-reading-panel .activity-top{grid-column:1/-1}.story-reading-panel .reading-scene{grid-column:1;grid-row:2/6;width:100%;height:100%;max-height:100%;margin:0;object-fit:contain}
  .story-reading-panel .tracking-sentence{grid-column:2;grid-row:2;align-self:center;line-height:1.5;margin:0;font-size:32px}
  #storyReadHear{grid-column:2;grid-row:3}#storyReadFeedback{grid-column:2;grid-row:4}#storyReadNext{grid-column:2;grid-row:5}
  /* Three-part adventures: reserve controls and let the picture take remaining space. */
  body:not(.ready-game)>.reader-shell{height:100dvh;min-height:0;grid-template-rows:64px minmax(0,1fr);padding:12px 24px;gap:12px}
  .experience-phase{max-height:100%;min-height:0}
  .video-phase{height:100%;grid-template-rows:auto minmax(0,1fr);gap:8px}.video-phase .video-card{height:100%;max-height:100%;width:auto}
  .practice-phase{height:100%;grid-template-rows:auto auto minmax(0,1fr) 64px;gap:8px}
  .practice-phase .reading-stage{height:100%;min-height:0;max-height:none!important}
  .practice-phase .picture-panel{height:100%;min-height:0}.practice-phase .picture-panel img{height:100%;object-fit:contain}
  .practice-phase .controls{margin:0;min-height:0}.practice-phase .caption-panel{padding:20px 24px;min-height:0}
  .practice-phase .read-caption{font-size:clamp(30px,3.2vw,44px);line-height:1.45}
  .practice-phase .focus-word{margin-top:12px;padding:14px 18px}
  .phonics-card{max-height:calc(100dvh - 40px)}
  /* Completion is two screens, never one tall certificate-plus-form column. */
  [data-tablet-award]{position:relative;padding-top:64px!important;max-height:calc(100dvh - 130px);overflow:visible!important}
  .tablet-award-nav{position:absolute;top:8px;left:0;right:0;display:flex;justify-content:center;gap:12px;z-index:2}
  .tablet-award-nav button{min-height:44px;padding:10px 18px;border:1px solid #aacdc3;border-radius:14px;background:#fffaf0;color:#173c61;font:700 16px/1.4 system-ui;cursor:pointer}
  .tablet-award-nav button[aria-pressed=true]{background:#ffda60;border-color:#d1a430}
  [data-tablet-award=award] .tablet-score-page{display:none!important}
  [data-tablet-award=score] .tablet-award-page{display:none!important}
  [data-tablet-award=score]{display:block!important;min-height:0;width:min(100%,940px);margin:auto}
  [data-tablet-award=score] .tablet-award-copy{padding:0}
  [data-tablet-award] .rrdd-result{max-width:860px;margin:0 auto;padding:18px 24px;display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:8px 28px;text-align:left}
  [data-tablet-award] .rrdd-result h3{grid-column:1;font:800 27px/1.2 system-ui;margin:0}
  [data-tablet-award] .rrdd-result>p{grid-column:1;font:16px/1.4 system-ui;margin:0}
  [data-tablet-award] .rrdd-result>label{grid-column:1;margin:6px 0;font:16px/1.4 system-ui}
  [data-tablet-award] .rrdd-result input:not([type=checkbox]){margin:6px 0 0;max-width:100%;padding:10px;font-size:16px}
  [data-tablet-award] .rrdd-avatar-picker{grid-column:2;grid-row:1/7;margin:0;align-self:center}
  [data-tablet-award] .rrdd-avatar-grid{gap:8px;grid-template-columns:repeat(5,1fr)}
  [data-tablet-award] .rrdd-avatar-option{min-height:48px;max-height:54px}
  [data-tablet-award] .rrdd-result>button{grid-column:1;min-height:44px}
  [data-tablet-award] .rrdd-result>a{grid-column:1;margin:0;min-height:44px;align-content:center}
  .achievement-card:has(.rrdd-result){width:min(940px,100%);overflow:visible;max-height:calc(100dvh - 40px);padding:64px 24px 20px}
  .achievement-card .achievement-badge{width:64px;height:64px;margin:0 auto 10px}.achievement-card .achievement-badge span{font-size:40px}
  .achievement-card h2{font-size:32px}.achievement-card ul{margin:12px auto;gap:5px}.achievement-card>p{margin-bottom:10px}
  body:has(#exitGame) #award{display:grid;grid-template-columns:1fr 250px;gap:16px;align-items:center}
  body:has(#exitGame) .certificate{padding:64px 20px 16px}.certificate .cup{font-size:52px;margin:0}.certificate h1{font-size:32px;margin:6px}.certificate h2{font-size:28px;margin:6px}.certificate p{margin:6px;line-height:1.4}.certificate img{height:80px;width:110px}.awardStars{margin:4px;font-size:24px}
  .ready-game .award-complete{width:100%;max-width:1100px}.ready-game .trophy-panel{margin:0;padding:64px 24px 16px}.ready-game .award-medal{width:150px;padding:0}.ready-game .trophy-badge{font-size:50px}.ready-game .trophy-panel h2{font-size:32px}.ready-game .award-signature{margin:8px auto;padding-top:8px}.ready-game .award-praise{margin:8px}.ready-game .award-stars{font-size:24px}
  .ready-game #complete.award-complete{display:grid;grid-template-columns:minmax(0,1fr) 245px;gap:18px;align-items:center}
  .ready-game .achievement-rating{margin:0;padding:18px}.ready-game .achievement-rating h2{font-size:24px}.ready-game .achievement-rating-stars{gap:0}
  .ready-game .trophy-panel[data-tablet-award=award]{display:grid;grid-template-columns:180px minmax(0,1fr);gap:8px 14px;align-items:center;max-width:none}
  .ready-game .award-eyebrow{grid-column:1/-1;margin:0}
  .ready-game .award-medal{grid-column:1;grid-row:2/6}
  .ready-game .trophy-panel h2{grid-column:2;grid-row:2;margin:0;font-size:32px}
  .ready-game .award-intro{grid-column:2;grid-row:3;margin:0;line-height:1.4}
  .ready-game .trophy-panel h3{grid-column:2;grid-row:4;font-size:30px;margin:0}
  .ready-game .award-stars{grid-column:2;grid-row:5}
  .ready-game .award-praise{grid-column:1/-1;grid-row:6;margin:6px;line-height:1.4}
  .ready-game .award-time{grid-column:1/-1;grid-row:7;justify-self:center;margin:4px;padding:8px 16px}
  .ready-game .award-signature{grid-column:1/-1;grid-row:8;padding:6px;margin:4px auto}
  .ready-game #collectTrophy{grid-column:1;grid-row:9;min-width:0;padding:10px;font-size:15px}
  .ready-game #awardPlayAgain{grid-column:2;grid-row:9;font-size:15px;padding:10px}
  .ready-game #trophyStatus{grid-column:1/-1;grid-row:10;margin:0;min-height:0}
  /* Academy already has landscape mission layouts; bound its ornate certificate. */
  .app-shell:has(.site-header) .certificate-screen .certificate{width:min(100%,1120px,calc((100dvh - 260px)*1.6));height:auto;aspect-ratio:16/10;padding:0}
  .app-shell:has(.site-header) .certificate-screen{height:auto;min-height:0}
  .app-shell:has(.site-header) .certificate-screen .certificate-actions{margin:12px 0 0}
  .app-shell:has(.site-header) .certificate-copy{padding:0}
  .app-shell:has(.site-header) .game-screen{padding-bottom:0}
  .app-shell:has(.site-header) .campaign-game .game-title{margin:4px 0 6px}
  .app-shell:has(.site-header) .campaign-game .game-bottom{padding-top:6px;padding-bottom:0}
}
@media print{.tablet-award-nav,.tablet-score-page{display:none!important}.tablet-award-page{display:revert!important}}
