/* Keep the game header and scrollable play area inside the usable screen. */
.full-game-header button{min-height:44px}
.quick-status:empty{display:none}
.full-game-content{min-width:0;overscroll-behavior:contain}
.village-game-arena .full-game-content{align-items:safe center;grid-template-columns:minmax(0,1fr)}
.collection-album{grid-template-columns:minmax(0,1fr)}
.album-dock{min-width:0}
.collection-album:not([data-collection="puzzle"]) .album-piece{touch-action:pan-x}
.snow-tray .snow-accessory{touch-action:pan-x}

@media (orientation:portrait){
  .full-game.festive-duel,.village-game-arena{
    background-image:linear-gradient(#09132224 12%,#111d3590 62%,#081421e6),url("./duel-art/arena-portrait.webp");
    background-position:center;
  }
  .full-game.packing-arena{
    background-image:linear-gradient(#13132863,#160d19a9),url("./packing-art/workshop-portrait.webp");
  }
  .full-game.reindeer-arena,.reindeer-yard{
    background-image:linear-gradient(#10233b32,#0b244a0a 55%,#18304143),url("./reindeer-art/stable-yard-portrait.webp");
    background-position:center bottom;
  }
  .hero .scenery{background-image:url("./village-art/alpine.webp");background-position:center 52%}

  body[data-theme] .cover{
    background-image:linear-gradient(0deg,#091423fa 1%,#091423b8 47%,#09142318 92%),var(--portrait-theme-art,url("./village-art/alpine.webp"));
    background-size:cover;
    background-position:center;
    align-items:end;
  }
  body[data-theme] .cover::after{content:none}
  body[data-theme="square"]{--portrait-theme-art:url("./village-art/square.webp")}
  body[data-theme="candy"]{--portrait-theme-art:url("./village-art/candy.webp")}
  body[data-theme="ginger"]{--portrait-theme-art:url("./village-art/ginger.webp")}
  body[data-theme="fir"]{--portrait-theme-art:url("./village-art/fir.webp")}
  body[data-theme="penguin"]{--portrait-theme-art:url("./village-art/penguin.webp")}
  body[data-theme="autumn"]{--portrait-theme-art:url("./village-art/autumn-portrait.webp")}
  body[data-theme="spring"]{--portrait-theme-art:url("./village-art/spring-portrait.webp")}
  body[data-theme="party"]{--portrait-theme-art:url("./village-art/party-portrait.webp")}

  [data-collection]:not([data-collection="puzzle"]) .album-board,
  [data-collection]:not([data-collection="puzzle"]) .fit-scene .album-board{
    --aspect:2 / 3;
    width:min(calc(100% - 16px),calc((100cqh - 16px) * var(--aspect)));
  }
  .collection-album:not([data-collection="puzzle"]) .album-stage-controls{display:none}
  .album-stage:has(picture) .album-backdrop{object-fit:contain}
  .album-stage:has(picture)::before{display:none}
  .album-stage:has(picture){background:radial-gradient(#385566,#162937)}
  [data-collection]:not([data-collection="puzzle"]) .album-board > :is(.album-slot,.album-decoration){
    --spot-x:var(--portrait-x,var(--original-x));
    --spot-y:var(--portrait-y,var(--original-y));
    --spot-width:var(--portrait-width,var(--original-width));
  }
  .village-stream{
    clip-path:polygon(13% 21%,14% 23%,11% 26%,15% 29%,19% 32%,17% 35%,10% 39%,10% 42%,14% 45%,16% 49%,13% 53%,9% 56%,9% 59%,15% 62%,16% 66%,14% 70%,9% 75%,6% 80%,6% 83%,12% 87%,18% 91%,19% 100%,7% 100%,6% 94%,0% 87%,0% 73%,7% 69%,9% 66%,8% 63%,1% 60%,0% 57%,4% 53%,8% 50%,9% 46%,5% 43%,1% 40%,1% 37%,8% 34%,12% 31%,11% 29%,6% 26%,6% 24%,9% 22%);
  }
  .village-flake{animation-name:village-portrait-snow}
  .village-flake:nth-child(3n){animation-name:village-portrait-snow;--snow-drift:-20px}
  .village-santa{left:35%;top:82%;width:23%}
  .snow-field{
    background:#3f5d78 url("./collection-art/snowman-portrait.webp") center / cover no-repeat;
  }
  .snow-field::before{display:none}
  .snow-stage{
    background:none;box-shadow:none;
    width:min(100cqw,85cqh);
    translate:0 min(4cqh,26px);
  }
  .snow-dock-controls button,.snow-tray-page{min-height:44px}
}


@media (max-width:745px) and (orientation:portrait){
  .workspace{width:calc(100% - 16px)}
  .doors{padding-inline:8px}
  .site-head{padding-inline:max(10px,env(safe-area-inset-left),env(safe-area-inset-right))}
  .site-head nav{gap:.35rem}
  #music,.cover .actions button,.cover .actions .button{min-height:44px}
  #modal .dialog-panel input:not([type="checkbox"]),#modal .dialog-panel select,
  #modal .dialog-panel textarea,.settings input:not([type="checkbox"]),.settings select,.roster-profile input{
    font-size:16px;
  }
  .full-game-header{padding-inline:max(.6rem,env(safe-area-inset-left),env(safe-area-inset-right))}
  .full-game-header h2{overflow-wrap:anywhere}
  .village-game-arena .full-game-content{padding-inline:.45rem}
  .village-game-arena .game-stage,.quick-game{padding-inline:clamp(.32rem,2vw,.85rem)}
  .village-game-arena .four-board{gap:3px}
  .village-game-arena .four-board button,.quick-board button,.quick-actions button{min-block-size:44px}
  .quick-actions:has(> :nth-child(9)){
    display:grid;grid-template-columns:repeat(6,minmax(0,1fr));
  }
  .quick-actions:has(> :nth-child(9)) button{min-width:0;padding-inline:0}
  .duel-stage,.packing-stage,.reindeer-stage,.bauble-stage{min-width:0;grid-template-columns:minmax(0,1fr)}
  .duel-stage>.roster-picker,.village-game-arena .game-intro{min-width:0}
  .roster-picker .roster-slot{min-width:0;max-width:100%}
  .roster-picker .roster-slot .roster-badge{min-width:0}
  .album-tray,.snow-tray{overscroll-behavior-inline:contain}
  .collection-album .album-help{line-height:1.3}
  .collection-album .album-dock-header{column-gap:.5rem}
  .album-back{padding-inline:.65rem}
}

@media (orientation:portrait) and (max-height:640px){
  .village-game-arena .full-game-content{padding-block:.55rem max(.6rem,env(safe-area-inset-bottom))}
  .game-stage[data-game="snakes"] .game-grid{max-width:224px}
  .game-stage[data-game="tic"] .game-grid{max-width:267px}
  .quick-game[data-game="frost"] .quick-board{max-width:230px}
  .quick-game[data-game="maze"] .quick-board{max-width:265px}
  .quick-game .roster-lineup{margin-block:.3rem}
  .quick-game .quick-help,.quick-game .quick-status{margin-block:.25rem .4rem}
  .quick-game .quick-actions{margin-top:.45rem}
}

@keyframes village-portrait-snow{to{top:102%;transform:translateX(var(--snow-drift,20px))}}
