/* ETAPA 11B: distribución horizontal común. Las mecánicas permanecen en sus módulos. */
@media (orientation:landscape){
  .screen.active{min-height:100dvh;padding:10px 18px;}
  .hub.screen.active{display:flex;flex-direction:column;justify-content:center;}
  .hub .brand{padding:8px 0 14px;}
  .hub-grid{width:min(100%,1100px);grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;}
  .hub-card{min-height:96px;padding:14px;}
  .game-shell{width:min(1180px,100%);max-width:none;display:grid;grid-template-columns:minmax(250px,.9fr) minmax(420px,1.25fr) minmax(250px,.9fr);grid-template-areas:"head head head" "score flag answers" "help help actions" "result result result";gap:8px 16px;align-items:center;text-align:center;}
  .game-shell>.eyebrow{grid-area:head;margin:0;}.game-shell>.score{grid-area:score;justify-self:center}.game-shell>.flag-stage{grid-area:flag;margin:0;min-height:0;height:min(48vh,330px);padding:14px}.game-shell>.flag-stage img{max-height:100%;}.game-shell>h2{grid-column:1/-1;margin:0;font-size:clamp(1rem,2vw,1.45rem)}.game-shell>.trivia-help{grid-area:help;margin:0}.game-shell>.answers{grid-area:answers;align-self:stretch;grid-template-columns:1fr 1fr;gap:8px}.game-shell>.answers button{min-height:54px;padding:10px}.game-shell>.trivia-actions{grid-area:actions;margin:0;align-self:stretch;flex-direction:column;justify-content:center}.game-shell>.result{grid-area:result;margin:0;}
  .free-shell,.rebuild-shell{width:min(1320px,100%);max-width:none;display:grid;grid-template-columns:minmax(170px,.7fr) minmax(420px,1.7fr) minmax(190px,.8fr);grid-template-areas:"head head head" "status reference actions" "status canvas actions" "status guide actions" "status palette actions";gap:8px 14px;align-items:center;text-align:center;}
  .free-shell header,.rebuild-head{grid-area:head;margin:0}.free-status,.rebuild-status{grid-area:status;display:flex;flex-direction:column;margin:0}.fp-reference,.rb-reference{grid-area:reference;margin:0;min-height:0;max-height:28vh}.fp-canvas-wrap,.rb-board{grid-area:canvas;width:100%;margin:0;max-width:none}.free-shell>#fp-guide,.rebuild-shell>.rb-guide{grid-area:guide;margin:0}.fp-palette,.rb-palette,.rb-pieces{grid-area:palette;margin:0;max-width:none;align-content:center}.fp-actions,.rb-actions{grid-area:actions;margin:0;align-self:end}.free-shell>.fp-actions{display:grid;grid-template-columns:1fr 1fr}.rebuild-shell>.rb-actions{display:grid;grid-template-columns:1fr 1fr}.free-shell>.fp-top-actions{grid-area:head;justify-self:end;margin:0}.pv3-shell{width:min(1320px,100%);margin:auto;display:grid;grid-template-columns:minmax(150px,.65fr) minmax(430px,1.7fr) minmax(190px,.8fr);grid-template-areas:"back head head" "dash ref palette" "dash board actions" "dash guide result";gap:8px 14px;align-items:center;}.pv3-back{grid-area:back}.pv3-header{grid-area:head;margin:0}.pv3-dashboard{grid-area:dash;display:flex;flex-direction:column;margin:0}.pv3-reference{grid-area:ref;max-height:26vh}.pv3-board{grid-area:board;width:100%;margin:0}.pv3-guide{grid-area:guide;margin:0}.pv3-palette{grid-area:palette;margin:0}.pv3-actions{grid-area:actions;margin:0}.pv3-result{grid-area:result;margin:0;}
  .pfe{max-width:1700px;height:calc(100dvh - 20px);display:flex;flex-direction:column;}.pfe-layout{flex:1;min-height:0;grid-template-columns:minmax(165px,230px) minmax(0,1fr) minmax(190px,250px);}.pfe-stage{min-height:0;}.pfe-canvas-wrap{max-height:calc(100dvh - 190px);}.pfe-canvas-wrap canvas{object-fit:contain;}
  .page{max-width:1180px;}
}
@media (orientation:landscape) and (max-height:600px){
  .screen.active{padding:5px 12px;}
  .hub .brand h1,.hub .brand h2{font-size:clamp(1.55rem,5vw,3rem);}.hub .brand>div{font-size:2rem}.hub-grid{gap:7px}.hub-card{min-height:72px;padding:9px}.hub-card span{font-size:.78rem}.hub .local-note{margin:7px 0 0}
  .game-shell{grid-template-columns:minmax(190px,.8fr) minmax(340px,1.4fr) minmax(210px,.9fr);}.game-shell>.flag-stage{height:42vh}.answers button{min-height:44px}.free-shell,.rebuild-shell,.pv3-shell{grid-template-columns:minmax(135px,.6fr) minmax(360px,1.8fr) minmax(170px,.8fr);}.pfe{height:calc(100dvh - 10px);}
}
@media (orientation:landscape) and (max-width:700px){
  .game-shell{grid-template-columns:minmax(112px,.72fr) minmax(0,1.28fr);grid-template-areas:"head head" "score flag" "answers answers" "help actions" "result result";gap:6px 9px;}
  .game-shell>.flag-stage{height:34vh;min-height:92px;}.game-shell>.answers{grid-template-columns:repeat(2,minmax(0,1fr));}.game-shell>.answers button{min-height:44px;padding:7px;font-size:.78rem;}
  .free-shell,.rebuild-shell,.pv3-shell{grid-template-columns:minmax(112px,.72fr) minmax(0,1.28fr);grid-template-areas:"head head" "status reference" "canvas canvas" "guide guide" "palette actions";gap:6px 9px;}
  .free-shell>.fp-top-actions{grid-area:head;}.fp-reference,.rb-reference,.pv3-reference{max-height:22vh;}.fp-canvas-wrap,.rb-board,.pv3-board{min-width:0;}.free-shell>.fp-actions,.rebuild-shell>.rb-actions,.pv3-actions{grid-template-columns:1fr;align-self:stretch;}.free-shell>.fp-actions button,.rebuild-shell>.rb-actions button,.pv3-actions button{min-height:42px;padding:7px 5px;font-size:.75rem;}.fp-palette,.rb-palette,.rb-pieces,.pv3-palette{min-width:0;gap:5px;}.fp-color,.rb-color{width:38px;height:38px;}.pv3-color{min-width:0;padding:4px;}.pv3-color b{display:none;}
  .pfe{height:auto;}.pfe-layout{grid-template-columns:minmax(112px,.72fr) minmax(0,1.28fr);}.pfe-layout>.pfe-panel:last-child{grid-column:1/-1;}.pfe-canvas-wrap{max-height:52vh;}.pfe-head-actions{gap:4px;}.pfe-head-actions button{min-height:42px;padding:6px;}
}
@media (orientation:landscape) and (max-width:700px) and (max-height:340px){
  .screen.active{padding:3px 8px;}
  .hub .brand{padding:0 0 5px;}.hub .brand>div{font-size:1.55rem;}.hub .brand h1,.hub .brand h2{font-size:clamp(1.25rem,4.8vw,2.25rem);}.hub .brand p{margin:3px 0;font-size:.72rem;}.hub-grid{gap:5px;}.hub-card{min-height:58px;padding:6px 8px;border-radius:12px;gap:3px;}.hub-card b{font-size:.78rem;}.hub-card span{font-size:.68rem;}.hub .local-note{margin:4px 0 0;font-size:.68rem;}
}
@media (orientation:landscape){
  .screen.active{height:100dvh;min-height:0;overflow:auto;overscroll-behavior:contain;}
  #album.active,#buscador.active{overflow:hidden;}
  #album.active .collection-page,#buscador.active .collection-page{height:100%;min-height:0;display:flex;flex-direction:column;overflow:hidden;}
  #album.active .album-grid,#buscador.active .search-results{flex:1;min-height:0;overflow:auto;align-content:start;}
}
