.award-view-controls,
.merch-gallery-frames {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px 44px;
  align-items: center;
  width: 100%;
  max-width: 19rem;
  margin-inline: auto;
  gap: .2rem;
  text-align: center;
  font-size: .875rem;
}

.award-view-controls:has([data-play][hidden]) {
  grid-template-columns: 44px minmax(0, 1fr) 44px;
}

.award-view-controls button,
.merch-gallery394 .merch-gallery-frames button,
.merch-gallery394 .merch-gallery-close {
  display: inline-grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffdfaa;
  font-size: 1.45rem;
  line-height: 1;
}

.award-view-controls button:hover,
.merch-gallery394 button:hover { background: #443626; }
.award-view-controls button[data-play] { font-size: .9rem; }
.award-viewframe,
.merch-gallery394 .merch-gallery-award {
  touch-action: pan-y pinch-zoom;
  user-select: none;
}
.award-viewframe img { -webkit-user-drag: none; }

.merch-gallery394[open] {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.merch-gallery394.merch-award-dialog[open] {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

.merch-gallery394 .merch-gallery-bar,
.merch-gallery394 .merch-gallery-actions {
  gap: .35rem .6rem;
  padding: .22rem max(.65rem, env(safe-area-inset-right)) .22rem max(.65rem, env(safe-area-inset-left));
}

.merch-gallery394 .merch-gallery-bar { padding-top: max(.22rem, env(safe-area-inset-top)); }
.merch-gallery394 .merch-gallery-actions { padding-bottom: max(.22rem, env(safe-area-inset-bottom)); }
.merch-gallery394 .merch-gallery-actions strong { font-size: .875rem; }
.merch-gallery394 .merch-gallery-actions p { font-size: .8rem; margin-top: .12rem; }
.merch-gallery394 .merch-gallery-action {
  padding: .35rem .55rem;
  font-size: .84rem;
  white-space: normal;
  flex-shrink: 1;
}

.merch-gallery394 .merch-gallery-picture {
  display: grid;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  container-type: size;
}

.merch-gallery394 .merch-gallery-picture > img { max-height: 100cqh; }

.merch-gallery394 .merch-gallery-picture > .merch-printed-art {
  width: min(100%, calc(100cqh * var(--photo-ratio, .9)));
}

.merch-gallery394 .merch-gallery-picture .merch-award-frame:not([hidden]) {
  display: block;
  position: relative;
  width: min(100%, calc(50vh * var(--frame-ratio)));
  width: min(100%, calc(100cqh * var(--frame-ratio)));
  aspect-ratio: var(--frame-ratio);
  overflow: hidden;
}

.merch-gallery394 .merch-award-frame img {
  position: absolute;
  inset: 0 auto auto var(--sheet-left);
  width: var(--sheet-width);
  max-width: none;
  height: 100%;
}

.merch-gallery-frames { grid-template-columns: 44px minmax(0, 1fr) 44px; }
.merch-gallery394 [hidden] { display: none !important; }
.merch-gallery394 :is(button, a):focus-visible { outline: 2px solid #ffdfaa; outline-offset: -2px; }
#gold-route-earn { scroll-margin-top: 8rem; }

@media (max-width: 740px) {
  html body.page372[data-page372="merch"] > header.has-toolbar372 {
    position: relative;
    top: auto;
    background: #101512;
    row-gap: 4px !important;
  }

  .page372[data-page372="merch"] #header-list377 :is(a, summary) { font-size: .81rem; }
  .page372[data-page372="merch"] .merch-index { padding-block: .4rem; }
  .page372[data-page372="merch"] .merch-index .merch-nav389 { margin-top: .05rem; }
  .page372[data-page372="merch"] .merch-nav389 ul { gap: 0 .6rem; }
  .page372[data-page372="merch"] .merch-nav389 a {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: .2rem 0;
    font-size: .8rem;
    min-height: 44px;
  }

  .page372[data-page372="merch"] #main-content > section,
  #breaker-interactive, #gold-route-earn { scroll-margin-top: .75rem !important; }
}

@media (max-width: 360px) {
  .merch-gallery394 .merch-gallery-actions { align-items: flex-start; }
}

/* Hidden controls must not create an extra gallery grid row. */
.merch-gallery394 .merch-gallery-frames[hidden] { display: none !important; }
.merch-gallery394 .merch-gallery-picture > img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }


.merch-gallery394 .merch-gallery-actions[hidden] { display: none; }

/* The gallery toolbar is independent of the site header grid. */
.merch-gallery394 .merch-gallery-bar {
  box-sizing: border-box;
  width: 100%;
  min-height: 0;
  flex-shrink: 0;
}
.merch-gallery394 .merch-gallery-bar > h2 {
  flex: 1 1 auto;
  min-width: 0;
}
.merch-gallery394 .merch-gallery-bar > .merch-gallery-close {
  flex: 0 0 44px;
  height: 44px;
  margin-inline-start: auto;
}
