/* REPPTRADE v4.4.31 — edge-to-edge actor portraits + restored hover artwork,
   two authoritative NFT palettes. Additive override of v4.4.30; preserve
   existing records, themed borders, cast text and title font rules. */

/* The actor tile used to have 8px top/bottom inset. Remove it so the image
   rail touches the inside of the tile boundary exactly like cast details. */
#libraryCast .rc440-actor-grid .rc440-actor-card {
  --rc431-photo-width:88px;
  grid-template-columns:var(--rc431-photo-width) minmax(0,1fr)!important;
  padding:0 14px 0 0!important;
  align-items:stretch!important;
  min-height:104px!important;
  overflow:hidden!important;
  gap:18px!important;
}
#libraryCast .rc440-actor-grid .rc440-actor-card .rc440-actor-portrait {
  display:flex!important;
  width:var(--rc431-photo-width)!important;
  height:100%!important;
  min-height:103px!important;
  max-height:none!important;
  align-self:stretch!important;
  margin:0!important;
  border:0!important;
  border-right:1px solid var(--cast-accent,#648bac)!important;
  border-radius:0!important;
  background-position:center!important;
  background-size:cover!important;
  z-index:3!important;
}
#libraryCast .rc440-actor-grid .rc440-actor-card .rc440-actor-text {
  position:relative;
  z-index:3!important;
  align-self:center!important;
  min-width:0!important;
  padding-block:8px!important;
}
/* Preserve the original show-artwork cross-fade/cycle, but render it ONLY
   in the space to the right of the portrait instead of behind the photo. */
#libraryCast .rc440-actor-grid .rc442-actor-card .rc442-art-layer {
  position:absolute!important;
  inset:0 0 0 var(--rc431-photo-width)!important;
  width:auto!important;
  background-position:center!important;
  background-size:cover!important;
  z-index:1!important;
  pointer-events:none!important;
  opacity:0;
  transition:opacity .55s cubic-bezier(.22,.63,.25,1)!important;
}
#libraryCast .rc440-actor-grid .rc442-actor-card:is(:hover,:focus-visible) .rc442-art-layer.rc442-visible {
  opacity:1!important;
}
#libraryCast .rc440-actor-grid .rc442-actor-card:not(:hover):not(:focus-visible) .rc442-art-layer {
  opacity:0!important;
}
/* Earlier artwork-mode first-layer opacity used !important and prevented
   the second cycling layer from taking over. Use the active layer only. */
body.rc419-artwork-view #libraryCast .rc442-actor-card .rc442-art-layer:first-child:not(.rc442-visible){opacity:0!important}

@media(max-width:760px){
 #libraryCast .rc440-actor-grid .rc440-actor-card{--rc431-photo-width:72px;min-height:92px!important;padding:0 12px 0 0!important;gap:12px!important}
 #libraryCast .rc440-actor-grid .rc440-actor-card .rc440-actor-portrait{min-height:91px!important}
}
@media(max-width:520px){
 #libraryCast .rc440-actor-grid .rc440-actor-card{--rc431-photo-width:64px;min-height:90px!important;padding:0 10px 0 0!important;gap:10px!important}
 #libraryCast .rc440-actor-grid .rc440-actor-card .rc440-actor-portrait{min-height:89px!important}
}
@media(prefers-reduced-motion:reduce){
 #libraryCast .rc440-actor-grid .rc442-actor-card .rc442-art-layer{transition:none!important}
}

/* One definitive NFT palette. Highlight is yellow with RED text (not brown);
   Red is solid red with white text. Never inherit a show's accent palette. */
body[data-nft-style="red"] {
 --rc426-nft-bg:#a41429;
 --rc426-nft-fg:#ffffff;
 --rc426-nft-edge:#d94a5d;
 --rc426-nft-rail:#ffffff;
}
body[data-nft-style="highlight"] {
 --rc426-nft-bg:#ffed29;
 --rc426-nft-fg:#c00022;
 --rc426-nft-edge:#b10c2a;
 --rc426-nft-rail:#c00022;
}

/* Explicit elements across Library, recording detail, Master Catalogue, NFT
   Manager, packs/proposed-order match panels. Unique NFT classes only. */
body[data-nft-style] :is(
  .boot .info.nft-info,
  .nft-pill,
  .mastercard .nft-pill,
  #page-master .catalogue-meta .nft,
  #rc440Overlay .rc426-nft-field,
  #catalogueDetailModal .rc426-nft-field,
  .rc426-nft-field,
  .rc423-detail-nft,
  #nftManagerList .nft-datebox,
  #nftManagerList .nft-state,
  #page-packs .rc423-nft,
  #page-packs .matchdetails .matchdetail-box.nft-detail
) {
  background:var(--rc426-nft-bg)!important;
  background-image:none!important;
  color:var(--rc426-nft-fg)!important;
  -webkit-text-fill-color:var(--rc426-nft-fg)!important;
  border-color:var(--rc426-nft-edge)!important;
  text-shadow:none!important;
}
/* These detail fields and their text have higher-specificity legacy color and
   background rules; scope override to the actual NFT field, never siblings. */
body[data-nft-style] #rc440Overlay .rc451-record-detail .rc440-field.rc426-nft-field,
body[data-nft-style] #catalogueDetailModal .rc440-field.rc426-nft-field,
body[data-nft-style] #rc440Overlay .rc419-full-show-theme .rc451-record-detail .rc440-field.rc426-nft-field,
body[data-nft-style] #rc440Overlay .rc419-full-show-theme .rc451-record-detail .rc440-field.rc426-nft-field {
  background:var(--rc426-nft-bg)!important;
  background-image:none!important;
  border-color:var(--rc426-nft-edge)!important;
  box-shadow:inset 3px 0 0 var(--rc426-nft-rail)!important;
}
body[data-nft-style] #rc440Overlay .rc451-record-detail .rc440-field.rc426-nft-field :is(span,strong),
body[data-nft-style] #catalogueDetailModal .rc440-field.rc426-nft-field :is(span,strong),
body[data-nft-style] :is(.nft-info,.nft-pill,.rc426-nft-field,.rc423-detail-nft,.nft-datebox,.nft-state,.rc423-nft,.nft-detail,.catalogue-meta .nft) :is(span,strong,.label,.value,.nft-pill-label,.nft-pill-date,.nft-date,.rc423-nft-prefix,.rc423-nft-value),
body[data-nft-style] #page-packs .rc423-nft .rc423-nft-prefix,
body[data-nft-style] #page-packs .matchdetails .matchdetail-box.nft-detail :is(.label,.value) {
  color:var(--rc426-nft-fg)!important;
  -webkit-text-fill-color:var(--rc426-nft-fg)!important;
  text-shadow:none!important;
  opacity:1!important;
}
/* Mode changes also color the option buttons, so selection is unmistakable. */
body[data-nft-style="red"] #nftStyleToggle > button[data-nftstyle="red"] {
 background:#a41429!important;border-color:#d94a5d!important;color:#fff!important;
}
body[data-nft-style="highlight"] #nftStyleToggle > button[data-nftstyle="highlight"] {
 background:#ffed29!important;border-color:#c00022!important;color:#c00022!important;
}
