/* Compact landscape table; the outer viewport rotates portrait devices. */
@media(orientation:landscape) and (max-width:999px){
 main{padding:8px 10px 16px}
 header{margin-bottom:12px;gap:12px;align-items:center}
 h1{font-size:23px;letter-spacing:2px}
 .logo{width:31px;height:34px;font-size:24px}
 nav{max-width:none;gap:6px}
 nav button{font-size:12px;padding:6px 9px}
 .layout,.teaching .layout{display:grid;grid-template-columns:132px minmax(0,1fr);gap:14px;align-items:start}
 .layout aside,.teaching .layout aside{display:block;grid-column:1;grid-row:1;min-width:0}
 .table,.teaching .table{display:block;grid-column:2;grid-row:1;min-width:0}
 .life-panel,.teaching .life-panel{display:block;width:auto;min-width:0;padding:8px;margin:0 0 12px}
 .combatant,.teaching .life-panel .combatant{display:block;min-width:0}
 .combatant>div{flex-wrap:wrap}
 .combatant strong,.teaching .life-panel .combatant strong{font-size:25px}
 .combatant b{font-size:12px}
 .combatant .tag{font-size:9px}
 .health-track,.teaching .life-panel>.health-track{display:block}
 .field-panel,.teaching .field-panel{display:block;width:auto;min-width:0;padding:9px;margin:0 0 12px}
 .field-symbol{display:none}
 #field h2,.teaching #field h2{font-size:18px}
 #field h2 small{font-size:10px}
 #field p,.teaching #field p{font-size:12px}
 .protection,.teaching .field-panel .protection{font-size:12px;line-height:1.7}
 .protection span{display:inline-block;margin-left:0;margin-right:4px}
 .queued-field{font-size:12px}
 .queued-field .hexagram{width:23px}
 .stats{display:none}
 .ledger-open{width:100%;font-size:11px;padding:8px}
 .ledger-open small{display:block;font-size:10px}
 .opponent-rack{height:48px}
 .opponent-cards{height:40px}
 .opponent-cards i{width:28px;height:38px}
 .opponent-label{font-size:10px}
 .deck-stack{width:25px;height:34px;top:0}
 .arena,.teaching .arena{width:auto;margin:0;padding:3px 0}
 .chain,.teaching .chain{grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;min-height:85px;padding:10px 1px}
 .empty-chain{min-height:62px}
 .chain-card{min-height:100px}
 .chain .card-top>b,.teaching .chain .card-top>b{font-size:19px}
 .chain .card-attributes{flex-wrap:wrap}
 .controls-dock,.teaching .controls-dock{position:sticky;top:6px;z-index:8;width:auto;margin:0 0 10px;padding:7px;background:#244e41f5;border:1px solid #789475}
 .attack-summary{min-height:28px;margin-bottom:6px}
 .attack-summary>strong{font-size:30px}
 .actions button,.teaching .controls-dock .actions button,.teaching .responses button{min-height:34px;font-size:13px;padding:7px 11px}
 .hand,.teaching .hand{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px 11px;padding:6px 5px 12px}
 .teaching .hand{grid-template-columns:repeat(min(4,var(--lesson-columns,4)),minmax(0,1fr))}
 .hand .card,.teaching .hand .card{min-height:177px;padding:3px 5px 5px;scroll-margin-top:145px;scroll-margin-bottom:20px}
 .hand .card-top>b,.teaching .hand .card-top>b{font-size:25px}
 .hand .card-illustration,.teaching .hand .card-illustration{min-height:52px}
 .hand .pixel-art,.teaching .hand .pixel-art{width:52px;height:52px}
 .hand .card-attributes,.teaching .hand .card-attributes{font-size:11px;padding:4px 0}
 .hand .card-attributes b,.teaching .hand .card-attributes b{font-size:16px}
 .hand .card-preview,.teaching .hand .card-preview{font-size:11px;min-height:35px}
 .hand .field-card .hexagram,.teaching .hand .field-card .hexagram{height:53px;width:41px}
 .hand .field-card .card-top>b,.teaching .hand .field-card .card-top>b{font-size:15px}
 .hand .field-card h3{font-size:18px}
 .teaching #tutorialBanner{position:static;width:auto;margin:0 0 14px;padding:12px}
 #tutorialBanner .lesson-goal{font-size:21px;margin-top:10px}
 #tutorialBanner .lesson-hint{font-size:17px}
 #tutorialBanner .lesson-top>b{font-size:14px}
 #tutorialBanner .lesson-visual{font-size:15px}
 #relationsPanel,.teaching #relationsPanel{grid-column:1/-1;grid-row:2;position:static;width:auto;margin-top:10px;padding:12px}
 #diagrams{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
 .diagram:first-child{width:auto;grid-column:auto;justify-self:stretch}
 .diagram+.diagram{border-top:0;padding-top:0}
 .diagram svg{max-height:205px}
 .diagram h3{font-size:12px}
 .teaching #diagrams:has(.diagram:only-child){grid-template-columns:minmax(0,230px);justify-content:center}
 .lesson-result{padding-bottom:40px}
 .lesson-result .result-value{font-size:30px}
 .lesson-result p{font-size:17px}
 dialog{max-height:92dvh}
}
