:root {
  --roster-card-width:102px;
}

/* Cards use click, hold and drag gestures rather than browser text selection. */
:is(article.card,article.roster-card,.instructor-card,.support-card-button,.shop-block-prize,.reference-subcard,.reference-block),
:is(article.card,article.roster-card,.instructor-card,.support-card-button,.shop-block-prize,.reference-subcard,.reference-block) * {
  -webkit-user-select:none;
  user-select:none;
  -webkit-touch-callout:none;
}

/* Card artwork keeps its 118:154 canvas across every in-game list. */
:is(#page,#dialog,.lineup-reserve-dock) .mini-card:not(:is(.pack-art,.intro-cards) .mini-card) {
  display:block;
  position:relative;
  flex:none;
  width:min(100%,var(--roster-card-width));
  max-width:none;
  height:auto;
  aspect-ratio:118/154;
  margin-inline:auto;
  overflow:hidden;
}
:is(#page,#dialog,.lineup-reserve-dock) .mini-card:not(:is(.pack-art,.intro-cards) .mini-card) > .roster-card {
  position:absolute;
  inset:0 auto auto 0;
  width:118px;
  height:154px;
  max-width:none;
  transform:scale(var(--card-scale));
  transform-origin:top left;
}

:is(#page,#dialog,.lineup-reserve-dock) :is(.reserve-grid,.replacement-grid,.collection,.album-grid,.fusion-album,.fusion-sockets) {
  display:grid;
  grid-template-columns:repeat(auto-fill,var(--roster-card-width));
  grid-template-rows:none;
  grid-auto-rows:max-content;
  justify-content:start;
  align-content:start;
  align-items:start;
  gap:6px;
  min-width:0;
  overflow:auto;
}
:is(#page,#dialog,.lineup-reserve-dock) :is(.reserve-pick,.replacement-option,.collection-tile,.album-card,.fusion-sleeve) {
  min-width:0;
}
:is(#page,#dialog,.lineup-reserve-dock) :is(.replacement-option,.album-card,.fusion-sleeve) {
  padding:0;
  border:0;
}
:is(#page,#dialog,.lineup-reserve-dock) .collection-tile {
  padding:0 0 4px;
  border:0;
}
:is(#page,#dialog,.lineup-reserve-dock) .album-grid {
  max-height:48dvh;
}
:is(#page,#dialog,.lineup-reserve-dock) .fusion-album {
  max-height:50dvh;
}
#page .pbm-fusion .fusion-sockets {
  grid-template-columns:repeat(4,var(--roster-card-width));
  justify-content:center;
}
:is(#page,#dialog,.lineup-reserve-dock) .training-stand .stand-card {
  width:var(--roster-card-width);
  max-width:none;
  padding:0;
}

/* A fixed row can scroll while retaining the shared card size. */
#page .card-lineup-bench .bench-cards {
  grid-template-columns:repeat(5,var(--roster-card-width));
  width:100%;
  max-width:none;
  overflow-x:auto;
  gap:6px;
}
#page .card-lineup-bench .bench-cards .order-cell {
  padding:0;
  border:0;
}
#page .card-field-board .card-field-slot {
  width:min(17.5%,var(--roster-card-width));
}
#page .card-pitching-board {
  overflow-x:auto;
}
#page .card-pitching-roster {
  --pitch-tile:var(--roster-card-width);
  --group-inset:12px;
  --pitch-gap:6px;
  grid-template-columns:minmax(0,1fr);
  width:max-content;
  min-width:100%;
  max-width:none;
}
#page .card-pitching-roster .order-cell {
  padding:0;
  border:0;
}
#page .card-pitching-roster .card-pitching-bullpen {
  grid-template-columns:calc(4 * var(--pitch-tile) + 3 * var(--pitch-gap) + var(--group-inset)) repeat(2,calc(var(--pitch-tile) + var(--group-inset)));
  justify-content:center;
}
#page .card-pitching-bullpen [data-duty="middle"] {
  grid-column:auto;
}
#page .card-pitching-bullpen :is([data-duty="setup"],[data-duty="closer"]) {
  width:auto;
}

@media(min-width:851px) {
  #page.page-training:has(>.skill-studio,>.pbm-fusion) {
    overflow:hidden;
    min-height:0;
  }
  #page.page-training>.skill-studio {
    flex:1 1 0;
    min-height:0;
    grid-template-columns:max-content minmax(0,1fr);
  }
  #page .skill-studio>.player-album {
    min-height:0;
  }
  #page .skill-studio .album-grid {
    flex:1 1 0;
    min-height:0;
    max-height:none;
    grid-template-columns:repeat(4,var(--roster-card-width));
    overflow-y:auto;
    scrollbar-width:thin;
    scrollbar-gutter:stable both-edges;
    justify-content:center;
  }
  #page .skill-studio .player-album>:is(.album-tabs,.album-bar,nav) {
    flex:none;
  }
  #page .skill-studio>.athlete-desk {
    min-height:0;
  }
  #page .skill-studio .skill-workbench {
    min-height:0;
    min-width:0;
    width:100%;
    align-self:stretch;
  }
  #page .skill-studio .skill-bank-grid {
    min-height:0;
    overflow-y:auto;
  }
  #page.page-training>.pbm-fusion {
    flex:1 1 0;
    min-height:0;
  }
  #page .pbm-fusion .fusion-desk {
    flex:1 1 0;
    min-height:0;
    grid-template-rows:minmax(0,1fr);
    grid-template-columns:minmax(0,1fr) calc(var(--roster-card-width) * 4 + 56px);
  }
  #page .pbm-fusion .fusion-stock {
    min-height:0;
    overflow:hidden;
  }
  #page .pbm-fusion .fusion-album {
    height:100%;
    min-height:0;
    max-height:none;
    justify-content:center;
    scrollbar-width:thin;
    scrollbar-gutter:stable both-edges;
  }
  #page .pbm-fusion .fusion-machine {
    min-height:0;
    overflow-y:auto;
  }
}
@media(min-width:851px) and (max-width:1100px) {
  #page .skill-studio .skill-bank-grid {
    grid-template-columns:1fr;
  }
  #page .skill-studio .skill-biog {
    grid-template-columns:minmax(0,1fr);
  }
  #page .skill-studio .growth-ratings {
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media(max-width:690px) {
  :root {
    --roster-card-width:min(90px,calc((100vw - 64px) / 4));
  }
  #dialog .replacement-grid {
    grid-template-columns:repeat(4,var(--roster-card-width));
    gap:6px;
    padding-inline:0;
    justify-content:center;
  }
  #page .card-pitching-roster {
    --group-inset:8px;
    --pitch-gap:4px;
  }
}

.cost-reserve-notice{font-size:12px;line-height:1.55;word-break:keep-all;}
