#deckGalleryDialog {
  width: min(1100px, 96vw);
  max-width: none;
  height: min(92vh, 900px);
  max-height: 92vh;
  padding: 14px 16px 16px;
  border: 1px solid rgba(110,120,90,.65);
  border-radius: 22px;
  background: rgba(12,14,11,.97);
  color: #f3f0df;
  overflow: hidden;
}
#deckGalleryDialog::backdrop { background: rgba(0,0,0,.78); }
.deck-gallery-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.deck-gallery-head h2 { margin:0; font-size:24px; }
.deck-gallery-count { color:#c9cdbb; font-size:13px; }
#closeDeckGalleryBtn {
  width:44px;
  height:44px;
  flex:0 0 44px;
  border-radius:50%;
  border:1px solid rgba(120,130,100,.6);
  background:#191c16;
  color:#fff;
  font-size:26px;
  line-height:1;
  cursor:pointer;
}
.deck-gallery-scroll {
  height: calc(100% - 56px);
  overflow-y:auto;
  overflow-x:hidden;
  overscroll-behavior:contain;
  padding:2px 6px 16px 2px;
  scrollbar-gutter:stable;
}
#deckGalleryGrid {
  display:grid;
  grid-template-columns:repeat(5, minmax(0,1fr));
  gap:10px;
  align-items:start;
}
#deckGalleryGrid .card {
  width:100%;
  min-width:0;
  aspect-ratio:2 / 3;
  min-height:0;
  height:auto;
  cursor:default;
  scroll-snap-align:none;
  transform:none !important;
}
#deckGalleryGrid .card:disabled {
  opacity:1;
  filter:none;
  cursor:default;
}
#deckGalleryGrid .card.card-live .card-live-name { font-size:clamp(9px,1.45vw,17px); }
#deckGalleryGrid .card.card-live .card-live-cost { font-size:clamp(13px,2.4vw,28px); }
#deckGalleryGrid .card.card-live .card-live-type { font-size:clamp(6px,.85vw,10px); }
#deckGalleryGrid .card.card-live .card-live-effect { font-size:clamp(7px,1vw,12px); }
#deckGalleryGrid .card.card-live .card-live-flavor { font-size:clamp(5px,.75vw,9px); }
@media (max-width:700px) {
  #deckGalleryDialog { width:98vw; height:92vh; padding:10px; border-radius:16px; }
  #deckGalleryGrid { gap:5px; }
  .deck-gallery-head h2 { font-size:18px; }
  #closeDeckGalleryBtn { width:38px; height:38px; flex-basis:38px; }
}
