/* Shared frame for the interior scenes. The approved 01 and 04 use their own layout. */
html[data-pi-shell][data-pi-app-format]:not([data-pi-app-format="start"],[data-pi-app-format="school"]) {
  --pi-shell-width: 76rem;
  --pi-shell-gutter: clamp(1rem, 5.8vw, 6rem);
  --pi-shell-lamp-offset: clamp(.6rem, 2.8dvh, 1.85rem);
  --pi-scene-gap: .75rem;
}
html[data-pi-shell][data-pi-app-format]:not([data-pi-app-format="start"],[data-pi-app-format="school"]) .pi-shell-controls {
  margin-top: calc(var(--pi-shell-lamp-offset) + .75rem);
}
@media (max-width: 760px), (max-height: 520px) and (orientation: landscape) {
  html[data-pi-shell][data-pi-app-format]:not([data-pi-app-format="start"],[data-pi-app-format="school"]) {
    --pi-shell-gutter: max(.72rem, env(safe-area-inset-left), env(safe-area-inset-right));
    --pi-shell-lamp-offset: .44rem;
  }
}

/* These are duplicate legacy sections below the current scene. */
html[data-pi-app-format="events"] #main #app:has([data-st09]) > .pc-editorial,
html[data-pi-app-format="cabinet"] #main #app:has(.cr-guest) > .ic-entry {
  display: none !important;
}
html[data-pi-shell]:has([data-st09],[data-media-scene="10"],[data-shop07="catalog"]) .pi-shell-section {
  clip-path: inset(50%);
}
html[data-pi-shell]:has([data-st09],[data-media-scene="10"]) .pi-app-layout > .pi-page-controls {
  display: none !important;
}
#main #app :is([data-st09] .st09-layout,[data-media-scene="10"] .nr-scene) {
  gap: var(--pi-scene-gap, .75rem);
}
#main #app > .section-studio[data-section-studio="events"]:has([data-st09]) { padding-inline: 0; }

/* Catalog cards keep their labels and prices. More items scroll in the work area. */
#main #app [data-shop07="catalog"] .at-topbar { margin-bottom: .25rem !important; }
#main #app [data-shop07="catalog"] .at-filters { row-gap: .25rem !important; }
#main #app [data-shop07="catalog"] .at-filters button { margin-block: 0 !important; }
#main #app[data-pi-scene] [data-shop07="catalog"] .at-card { min-height: 0 !important; }
#main #app[data-pi-scene] [data-shop07="catalog"] .at-grid {
  gap: var(--pi-scene-gap, .75rem) !important;
  align-items: stretch;
}
#main #app[data-pi-scene] [data-shop07="catalog"] .at-card-copy {
  gap: .15rem;
  padding: .38rem .55rem .42rem !important;
}
#main #app [data-shop07="catalog"] :is(.at-card-image,.at-card .at-visual) {
  grid-template-rows: minmax(0,1fr);
}
#main #app [data-shop07="catalog"] :is(.at-visual img,.at-sprite) { max-block-size: 100%; }
#main #app [data-shop07="catalog"] .at-catalog-heading { margin-top: .55rem !important; }

/* Put the date controls beside the calendar heading when there is room. */
@media (min-width: 1024px) {
  html[data-pi-shell][data-pi-app-format]:not([data-pi-app-format="start"],[data-pi-app-format="school"]) .pi-shell-controls {
    min-height: 54px;
  }
  #main #app [data-st09] .st-planner:has([data-st-calendar-view]:not([hidden])) {
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 2fr);
    align-items: center;
  }
  #main #app [data-st09] [data-st-calendar-view]:not([hidden]) { display: contents; }
  #main #app [data-st09] .st-toolbar { grid-area: 1 / 2; border-bottom: 0; }
  #main #app [data-st09] [data-st-calendar-view] > :not(.st-toolbar) { grid-column: 1 / -1; }
  #main #app [data-st09] h1.st09-block-title { font-size: clamp(1.4rem, 2.8vw, 2rem); }
}
@media (min-width: 1280px) and (max-height: 820px) {
  #main #app[data-pi-scene] [data-shop07="catalog"] .at-grid {
    grid-template-columns: repeat(7,minmax(0,1fr)) !important;
  }
}
#main #app [data-st09] :is(.st-toolbar,.st-foot,.st-filterbar) { padding-block: .35rem; }
#main #app [data-st09] .st-viewport { max-height: clamp(8.5rem, 21dvh, 12rem); }
#main #app [data-st09] .st-ruler { height: 43px; }
#main #app [data-st09] .st09-casinos :is(select,button),
#main #app [data-st09] .st09-history .st-brand-card { min-height: 44px; }

@media (min-width: 1024px) and (max-height: 900px) {
  #main #app [data-shop07="catalog"] { position: relative; }
  #main #app [data-shop07="catalog"] .at-topbar {
    position: absolute;
    inset: .45rem .5rem auto auto;
    z-index: 2;
    max-width: 41%;
  }
  #main #app [data-shop07="catalog"] .shop07-intro {
    min-height: 6.1rem;
    padding: .7rem clamp(1rem, 3vw, 2.5rem);
    padding-right: 40%;
  }
  #main #app [data-shop07="catalog"] .shop07-intro h1 { font-size: clamp(2rem, 4.35vw, 3.55rem) !important; }
  #main #app [data-shop07="catalog"] .shop07-intro p { margin-top: .3rem; }
  #main #app[data-pi-scene] [data-shop07="catalog"] .at-card-object {
    aspect-ratio: auto;
    height: clamp(2.65rem, 7dvh, 4.1rem) !important;
  }
  #main #app[data-pi-scene] [data-shop07="catalog"] .at-card-copy h2 { font-size: .91rem !important; }
  #main #app[data-pi-scene] [data-shop07="catalog"] .at-card-copy h2 a { min-height: 0; padding-block: 0; }
  #main #app [data-shop07="catalog"] .at-card-bottom { line-height: 1.15; }
  #main #app [data-shop07="catalog"] .shop07-kind,
  #main #app [data-shop07="catalog"] .at-card-bottom > span:first-child { font-size: .73rem; }
  #main #app [data-st09] :is(.st09-casino-venues,.st-brand-grid) { max-height: clamp(6.5rem, 15dvh, 8.5rem); }
  #main #app [data-media-scene="10"] .nr-card-scroll { max-height: clamp(12rem, calc(100dvh - 23rem), 27rem); }
}
@media (min-width: 1280px) and (max-height: 820px) {
  #main #app [data-st09] :is(.st09-casino-venues,.st-brand-grid) { max-height: 6.2rem; }
}

@media (max-width: 760px) {
  #main #app [data-shop07="catalog"] .shop07-intro { min-height: 6.6rem; padding-block: .65rem; }
  #main #app [data-shop07="catalog"] .shop07-intro p { margin-top: .32rem; }
  #main #app[data-pi-scene] [data-shop07="catalog"] .at-card-object { aspect-ratio: 2.9; }
  #main #app[data-pi-scene] [data-shop07="catalog"] .at-grid { gap: .5rem !important; }
  #main #app [data-st09] .st-viewport { max-height: 9rem; }
  #main #app [data-st09] .st-filterbar { padding-block: .3rem; }
}
@media (min-width: 370px) and (max-width: 760px) {
  #main #app [data-st09] .st09-layout { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem; }
  #main #app [data-st09] :is(.st09-casinos,.st09-history) { padding-inline: .55rem; }
  #main #app [data-st09] :is(.st09-casinos,.st09-history) .st09-block-title { font-size: 1.22rem; }
  #main #app [data-st09] .st09-country { display: block; position: relative; }
  #main #app [data-st09] .st09-country span { position: absolute; clip-path: inset(50%); }
  #main #app [data-st09] .st09-country select { width: 100%; }
  #main #app [data-st09] .st-directory > header { padding-top: 0; gap: 0; }
  #main #app [data-st09] .st09-casino-venues button { flex-wrap: wrap; justify-content: flex-start; gap: .15rem .4rem; }
  #main #app [data-st09] :is(.st09-casino-venues,.st-brand-grid) { max-height: 6.1rem; }
}
