/* The home screen reserves the same space as its fixed navigation. */
body:not(.card-view):has(#page-open.active) #app{padding-top:0;padding-bottom:100px}
body:not(.card-view) #page-open.active{display:flex;flex-direction:column;height:calc(100dvh - 100px);min-height:0;padding:10px 0 0}
body:not(.card-view) .home-header{flex:0 0 auto}
body:not(.card-view) #pack-stage{display:flex;flex-direction:column;flex:1 1 0;min-height:0;margin:3px auto 8px}
body:not(.card-view) #open-stage{flex:1 1 0;min-height:0}
body:not(.card-view) .pack-view{height:100%;min-height:0}
body:not(.card-view) .foil-pack{height:min(100%,355px);width:auto;max-width:75%;max-height:100%;aspect-ratio:300/440}
body:not(.card-view) #open-controls{flex:0 0 auto;gap:2px;min-height:25px;padding-top:4px}
.pack-inventory{width:100%;min-width:0;max-width:400px;height:82px;min-height:82px;flex:0 0 82px;margin:0 auto;padding:5px 10px 7px;overflow-x:auto;overflow-y:hidden;touch-action:pan-x;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#a99ab4 transparent;scroll-snap-type:x proximity;cursor:grab;user-select:none;-webkit-user-select:none;-webkit-overflow-scrolling:touch}
.pack-inventory::-webkit-scrollbar{display:block;height:3px}.pack-inventory::-webkit-scrollbar-thumb{background:#b7a9bf99;border-radius:9px}.pack-inventory::-webkit-scrollbar-track{background:transparent}
.pack-inventory.is-scrolling{cursor:grabbing;scroll-snap-type:none}.pack-inventory.is-scrolling button{cursor:grabbing}.mini-pack-item{scroll-snap-align:start;touch-action:pan-x}.mini-pack-item .pack-art{pointer-events:none}
/* Reserve the translated/rotated card backs before centering the whole group. */
body.showing-card #app{padding-top:0;padding-bottom:38px}
.showing-card #page-open.active{display:flex;flex-direction:column;justify-content:center;min-height:calc(100dvh - 38px);padding:10px 0}
.showing-card #pack-stage{display:grid;grid-template-columns:minmax(0,1fr);row-gap:16px;flex:0 0 auto;margin:0 auto;min-width:0}
.showing-card #open-stage{min-height:0;min-width:0;flex:0 0 auto;padding-inline:12px}
/* Three backs extend 18px down plus roughly 4px from their rotation.
   The 26px tail scales with the card; the separate 16px grid gap does not. */
.showing-card .reveal-deck{zoom:.86;margin:0 auto 26px}
.showing-card #open-controls{padding:0;gap:6px;min-width:0}
.showing-card #open-controls>button{flex-shrink:0;max-width:100%}
@media(max-height:600px){body:not(.card-view) #page-open.active{padding-top:4px}.home-header h1{font-size:38px}.home-header>p{font-size:10px;margin:2px 0 5px}.pack-inventory{height:72px;min-height:72px;flex-basis:72px}.mini-pack-item .pack-art{height:57px}.showing-card .reveal-deck{zoom:.78}.showing-card #page-open.active{padding:10px 0}}
