/* The play area and growth controls stay together on landscape tablets. */
.power-summary{font-size:16px;line-height:1.5;word-break:keep-all}
.word-detail{padding:8px 0;background:none;color:#54734c;font-size:14px;text-align:left;min-height:40px}
body:has(dialog[open]){overflow:hidden}
.modal-head{position:sticky;top:0;z-index:1;background:#fffdf4}
.modal-head button{min-width:44px;min-height:44px}
#world canvas{touch-action:none;cursor:grab}
#world canvas:active{cursor:grabbing}
.view-hint{position:absolute;z-index:2;top:82px;right:12px;max-width:calc(100% - 24px);font-size:13px;color:#2f5140;background:#fffdf2e0;border:1px solid #d7e1c4;padding:6px 11px;border-radius:10px;pointer-events:none;word-break:keep-all}
@media(max-width:520px){.view-hint{top:77px;right:9px;font-size:11px;padding:4px 8px}.map-tag{display:none}}

@media (min-width:740px) and (orientation:landscape){
 body{height:100dvh;overflow:hidden}
 .topbar{height:60px;padding:0 20px}
 .brand{font-size:20px;gap:9px}.brandmark{width:38px;height:38px;font-size:30px}.brand small{font-size:11px;margin-top:2px}
 nav{gap:5px}nav button{min-height:44px;font-size:14px;padding:8px 12px}
 main{height:calc(100dvh - 60px);max-width:none;padding:10px 16px 14px;display:flex;flex-direction:column;gap:9px}
 .chapter{height:34px;flex:none;margin:0;padding:0 4px}
 .chapter .eyebrow{display:none}.chapter h1{font-size:23px;margin:0}.chapter-note{font-size:14px}
 .game-layout{flex:1;min-height:0;grid-template-columns:minmax(0,1fr) clamp(240px,25vw,300px);gap:14px}
 .play-column{min-width:0;min-height:0;display:grid;grid-template-rows:minmax(0,1fr) 24px 88px 44px;gap:7px}
 .arena{height:100%;min-height:0;border-width:3px;border-radius:20px}
 .hud{top:12px;left:12px;right:12px;gap:7px}
 .stat{padding:7px 12px;min-width:83px}.stat strong{font-size:21px}.stat span{font-size:12px}
 .wave-pill{height:45px;padding:10px 12px}.wave-pill strong{font-size:20px}.wave-pill span{font-size:14px}
 .map-tag{display:none}
 .arena-bottom{bottom:10px;left:10px;right:10px}
 .arena-bottom>span{font-size:14px;padding:9px 12px;max-width:calc(100% - 104px)}
 .arena-bottom button{min-width:44px;height:44px}
 .recruit-header{margin:0;gap:10px}.recruit-header h2{font-size:18px}.recruit-header span{display:none}
 .tower-cards{min-height:0;gap:8px}
 .tower-card{min-height:0;height:88px;padding:8px 10px;border-radius:13px}
 .tower-card .mini{font-size:22px;margin-bottom:3px}.tower-card strong{font-size:18px}.tower-card small{font-size:12px;margin-top:3px}.tower-card .cost{top:9px;right:8px;font-size:13px}
 .pad-control{margin:0;gap:8px;flex-wrap:nowrap;font-size:14px;min-width:0}.pad-control small{display:none}
 .pad-control>div{flex:1;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:5px}
 .pad-control button{width:100%;height:42px;min-width:0;border-radius:12px;font-size:16px}
 .sidebar{min-height:0;display:grid;grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto auto 32px;gap:10px}
 .selection-panel{grid-row:1;min-height:0;border:2px solid #d1dfbc;background:#edf3e0;padding:17px;display:flex;flex-direction:column;border-radius:20px}
 .selection-panel .eyebrow{font-size:13px;letter-spacing:.3px}
 .selection-panel h3{font-size:25px;margin:10px 0 12px}
 .selection-panel ol{font-size:16px;line-height:1.9;margin-bottom:8px}
 .selection-panel .muted{font-size:14px;line-height:1.6;margin-top:10px}
 .selection-panel .upgrade{margin-top:auto;flex-shrink:0;min-height:50px;border:0;border-radius:12px;background:#2b6045;color:#fff9df;font-size:18px;box-shadow:0 3px 0 #18412d}
 .selection-panel .upgrade:disabled{box-shadow:none;opacity:.65}
 .tower-actions{margin-top:6px;justify-content:center}
 .tower-actions button{font-size:14px;min-height:44px;padding:9px 10px}
 .teacher-panel{grid-row:2;box-shadow:none;padding:12px;border-radius:15px}
 .teacher-panel .teacher-heading,.teacher-panel>p{display:none}
 .task-line{padding:0 0 9px;border:0;gap:0}.task-line span{display:none}.task-line strong{font-size:15px;font-weight:normal;text-align:center}
 .teacher-panel .primary{min-height:48px;padding:10px;font-size:18px;box-shadow:0 3px 0 #173c2b}
 .skill{grid-row:3;padding:10px 12px;gap:10px;min-height:66px;border-radius:15px}
 .skill-icon{padding:10px 7px;font-size:17px}.skill strong{font-size:16px}.skill small{font-size:12px;margin-top:5px}
 .collection{grid-row:4;grid-column:auto;padding:0 4px;font-size:13px}
 footer{display:none}
 dialog{width:min(740px,calc(100vw - 40px));max-height:calc(100dvh - 28px);padding:18px 24px}
 #modalBody h2{font-size:28px;margin:8px 0 12px}
 #modalBody p{line-height:1.6;margin:10px 0}
 #modalBody .primary{margin-top:12px;min-height:46px}
 .word-scene{padding:12px;margin-top:10px}.word-scene .scene-emoji{font-size:38px}.lesson-word{font-size:44px;margin:8px 0;letter-spacing:3px}
 .word-scene .definition{font-size:19px!important}.example{padding:12px}
 .story-icon{font-size:38px;margin:10px 0}.story-steps{margin:14px 0}
 .answers{gap:8px;margin:15px 0}.answer{min-height:48px;padding:12px 16px}
 .feedback{min-height:28px}.word-tile{padding:13px}.word-tile h3{margin:4px 0}.word-tile p{font-size:14px}
 dialog[data-kind="print"] #modalBody{display:grid;grid-template-columns:1fr 190px;column-gap:20px;align-items:start}
 dialog[data-kind="print"] h2,dialog[data-kind="print"] #modalBody>p:first-of-type{grid-column:1/-1}
 dialog[data-kind="print"] .tabs{grid-column:1;grid-row:3;margin:10px 0}
 dialog[data-kind="print"] .print-pick{grid-column:1;grid-row:4;margin:8px 0}
 dialog[data-kind="print"] .print-pick button{min-width:44px;min-height:44px;font-size:17px}
 dialog[data-kind="print"] .paper-preview{grid-column:2;grid-row:3/5;width:180px;margin:10px 0;min-height:190px}
 dialog[data-kind="print"] .outline-text{font-size:70px}
 dialog[data-kind="print"] .paper-preview.word .outline-text{font-size:42px}
 dialog[data-kind="print"] .download-row,dialog[data-kind="print"] .game-note{grid-column:1/-1}
}
@media (min-width:740px) and (orientation:landscape) and (max-height:650px){
 .topbar{height:52px}.brand small{display:none}
 main{height:calc(100dvh - 52px);padding:7px 12px 10px;gap:6px}
 .chapter{height:28px}.chapter h1{font-size:20px}
 .game-layout{gap:10px;grid-template-columns:minmax(0,1fr) 240px}
 .play-column{grid-template-rows:minmax(0,1fr) 20px 80px 44px;gap:5px}
 .tower-card{height:80px;padding:7px 8px}.tower-card .mini{font-size:20px}.tower-card strong{font-size:17px}.tower-card small{font-size:11px}
 .sidebar{gap:7px;grid-template-rows:minmax(0,1fr) auto auto 29px}
 .selection-panel{padding:12px}.selection-panel h3{font-size:23px;margin:6px 0 8px}.power-summary{font-size:15px}
 .word-detail{min-height:36px;padding:7px 0;font-size:13px}
 .selection-panel .upgrade{min-height:46px;font-size:17px}.tower-actions{margin-top:3px}.tower-actions button{min-height:40px}
 .teacher-panel{padding:10px}.task-line{padding-bottom:6px}.teacher-panel .primary{min-height:44px}
 .skill{min-height:60px;padding:8px 10px}.skill small{font-size:11px}
 dialog{padding:14px 22px}
 .word-scene{padding:8px}.word-scene .scene-emoji{font-size:30px}.lesson-word{font-size:36px;margin:4px 0}
 #modalBody h2{font-size:25px}.definition{font-size:18px!important}
}
@media (max-width:739px) and (orientation:landscape){
 .sidebar{grid-template-columns:1fr 1fr}.selection-panel{grid-column:2;grid-row:1/3}
}
/* Leave room for a tablet browser's address bar on shorter displays. */
@media (min-width:740px) and (orientation:landscape) and (max-height:560px){
 .topbar{height:48px}main{height:calc(100dvh - 48px);padding:7px 12px}
 .chapter{display:none}
 .play-column{grid-template-rows:minmax(0,1fr) 18px 66px 44px;gap:4px}
 .tower-card{height:66px;padding:6px 9px}.tower-card .mini{font-size:18px}.tower-card small{display:none}
 .sidebar{grid-template-rows:minmax(0,1fr) auto auto;align-items:stretch}
 .collection{display:none}
 .selection-panel{padding:10px}.selection-panel h3{font-size:22px;margin:4px 0 6px}
 .selection-panel .power-summary{display:none}.selection-panel .word-detail{min-height:36px}
 .selection-panel ol{font-size:14px;line-height:1.65}.selection-panel>.muted{font-size:13px;line-height:1.5}
 .selection-panel .upgrade{min-height:44px}.tower-actions button{min-height:36px;padding:7px}
 .teacher-panel{padding:8px}.task-line{padding-bottom:4px}.task-line strong{font-size:14px}
 .skill{min-height:52px;padding:6px 10px}.skill-icon{padding:7px}
 .hud{top:8px;left:8px;right:8px}.stat{padding:5px 10px}.stat strong{font-size:18px}
 .arena-bottom{bottom:7px}.arena-bottom>span{font-size:12px}
 .view-hint{top:62px;right:8px;font-size:12px;padding:4px 9px}
}
