.golden-toggle[hidden]{display:none!important}
.deck--hand .deck-controls{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:4px 12px;width:100%;max-width:760px;margin:var(--paragraph-gap,14px) auto 0;box-sizing:border-box}
.deck--hand .deck-date{color:var(--muted,inherit);font:inherit;min-width:0;overflow-wrap:anywhere}
.deck--hand .deck-actions{display:flex;align-items:center;gap:8px;margin-inline-start:auto;flex-wrap:wrap;justify-content:flex-end}
.deck--hand .deck-action{font:inherit;color:inherit;background:none;border:0;padding:2px 0;cursor:pointer;min-height:24px}
.deck--hand .deck-action:disabled{opacity:.5;cursor:default}
.deck--hand .deck-action:focus-visible{outline:2px solid currentColor;outline-offset:2px}
.deck--hand .deck-status{display:block;color:var(--muted,inherit);font-size:.875em;text-align:end}
.deck--hand .deck-status:empty{display:none}
.deck--hand .golden-toggle{min-height:24px;padding:2px 7px;border:1px solid #a58b51;border-radius:4px;background:#fff;color:#664b15;font:inherit;line-height:18px;cursor:pointer}
.deck--hand .golden-toggle[aria-pressed="true"]{background:#9a701f;color:#fff}
.deck--hand .golden-toggle:focus-visible{outline:2px solid #926d1e;outline-offset:2px}

.deck-item.has-card-surface,.card-face{cursor:pointer}
.card-face,.deck{--card-ratio:360/514}
.card-slot{width:100%;position:relative;aspect-ratio:var(--card-ratio)}
@media (min-width: 821px) {
  .deck-grid--hand .deck-item.has-card-surface { display: grid; grid-template-columns: minmax(0, 1fr); }
  .deck-grid--hand .deck-item.has-card-surface::before {
    content: ""; display: block; grid-area: 1 / 1; width: 100%;
    aspect-ratio: var(--card-ratio);
  }
  .deck-grid--hand .deck-item.has-card-surface > .card-face { grid-area: 1 / 1; align-self: start; }
}

/* Card surface layout. */
@media (min-width: 821px) {
  .deck-grid--hand .deck-item.has-card-surface > .card-face {
    position: relative;
    z-index: 11;
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0 auto;
    padding: 0;
    overflow: visible;
    pointer-events: none;
  }
  .deck-grid--hand .card-face > .card-slot {
    display: block;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }
}

/* Fill the available width with cards at their collection display size. */
@media (min-width: 821px) {
  .deck--hand .deck-grid--hand .deck-body {
    width: 100%; max-width: 100%; min-width: 0; padding: 0; box-sizing: border-box;
    /* Keep the card inside its grid cell. */
    overflow: clip;
  }
  .deck--hand .deck-grid--hand .deck-cards.deck-col {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, min(100%, 184px)) !important;
    grid-auto-flow: row;
    column-gap: clamp(6px,.8vw,12px);
    row-gap:16px;
    align-items: start;
    width: 100%; max-width: 100%; min-width: 0;
    box-sizing: border-box;
    padding: 0; margin: 0;
    list-style: none;
  }
  .deck--hand .deck-grid--hand .deck-cards.deck-col > .deck-item {
    grid-column: auto; grid-row: auto;
    min-width: 0; max-width: 100%; width: 100%;
    box-sizing: border-box; margin: 0; padding: 0;
    align-self: start;
  }
  .deck--hand .deck-grid--hand .deck-item.has-card-surface {
    align-items: start;
  }
  .deck--hand .deck-grid--hand .deck-item.has-card-surface::before {
    width: 100%; max-width: 100%; margin: 0 auto;
  }
  .deck--hand .deck-grid--hand .deck-item.has-card-surface > .card-face {
    justify-self: center;
    align-self: start;
    width: 100%; max-width: 100%;
    margin: 0 auto;
  }
}

body .deck--hand.has-hand .deck-grid--hand .deck-cards.deck-col {
  grid-template-columns: repeat(auto-fill, min(100%, 184px)) !important;
  max-width: 760px;
  margin-inline: auto !important;
  justify-content: center;
  column-gap: 8px;
}
.deck--hand.has-hand .deck-item,
.deck--hand.has-hand .card-face {
  --card-ratio: 184 / 266;
}
.deck--hand.has-hand .preview__scene[data-collection] {
  position: absolute;
  left: var(--grid-left, 0px);
  top: var(--grid-top, 0px);
  width: 100%;
  height: 100%;
}
@media (min-width: 1440px) {
  body .deck--hand.has-hand {
    --grid-width: min(760px, calc(100vw - 48px));
    width: var(--grid-width);
    max-width: none;
    margin-inline: calc((100% - var(--grid-width)) / 2);
  }
}

.deck--hand .deck-grid--hand{
  background:transparent;
  border:0;
  border-radius:0;
  box-shadow:none;
}
.deck--hand .deck-grid--hand :is(.deck-body,.deck-divider){
  background:transparent;
}
@media (min-width:821px){
  .deck--hand{
    width:100%;max-width:100%;margin-block:0!important;padding:0;
  }
  .deck--hand .deck-grid--hand .deck-cards.deck-col > .deck-item{
    margin:0!important;
  }
}

/* Every cell shares the same quantity-ribbon anchor. Never translate a whole
   scene by card type, finish, rarity or column position. This also overrides
   edge transforms in an older WordPress combined stylesheet. */
@media (min-width:821px) {
 .deck--hand .deck-grid--hand .deck-cards > .deck-item > .card-face { transform:none!important; }
}
/* Strict dates-v1: never expose imported present-day costs/name as historical. */
.deck-item.is-unreleased{display:none!important}

/* The link tracks the rendered canvas and receives pointer input inside its alpha clip. */
.deck--hand{position:relative}
.deck--hand .deck-item{position:relative}
.deck-grid--hand .deck-item{overflow:hidden}
.deck--hand .deck-item.has-card-surface,
.deck--hand .deck-item .card-face{cursor:auto}
.deck--hand .card-nav{
  position:absolute;z-index:12;margin:0;padding:0;pointer-events:none;
  left:var(--grid-left,0px);top:var(--grid-top,0px);
  width:100%;height:100%
}
.deck--hand .card-nav > svg{position:absolute}
.deck--hand .card-link{display:block;width:100%;height:100%;background:transparent;border:0;text-decoration:none;pointer-events:none}
.deck--hand .card-link[data-hit-area]{cursor:pointer;pointer-events:auto}
.deck--hand .deck-item:has(.card-link:focus-visible){outline:2px solid currentColor;outline-offset:2px}

.card-face.has-native-preview .card-slot::after{content:none}


/* The transferred canvas uses the same aspect ratio for both finishes. */
.preview__stage{position:absolute;inset:0;container-type:size;display:grid;place-items:center;pointer-events:none;overflow:hidden}
.preview__scene{position:relative;width:min(100cqw,calc(100cqh * var(--preview-ratio)));aspect-ratio:var(--preview-ratio);overflow:hidden;min-width:0;min-height:0}
.preview__scene>.preview{position:absolute!important;display:block!important;inset:0;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;min-width:0!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;transform:none!important;object-fit:fill!important;object-position:left top!important;box-sizing:border-box!important}

.card-error{display:flex;flex-direction:column;gap:4px;padding:8px;color:#666;font-size:12px;line-height:1.35;text-align:center;overflow-wrap:anywhere;position:relative;z-index:1}
.card-face.is-native-failed .card-slot{display:grid;place-items:center}

/* Common 360:514 assembled hand display. */
@media(max-width:820px){
 body .deck--hand.has-hand{width:100%;margin-inline:auto!important}
 .deck--hand .deck-body{box-sizing:border-box;padding:0}
 .deck--hand.has-hand .deck-grid--hand .deck-cards.deck-col{display:grid!important;width:100%;justify-items:center;gap:12px 6px!important;margin:0;padding:0!important;list-style:none}
 .deck--hand.has-hand .deck-cards>.deck-item{display:block;min-width:0;width:100%;margin:0!important;padding:0;aspect-ratio:var(--card-ratio)}
 .deck--hand.has-hand .deck-cards>.deck-item::before{content:none}
 .deck--hand.has-hand .deck-item>.card-face{display:block!important;position:absolute;inset-inline:0;top:0;width:100%;max-width:100%;padding:0;margin:0;transform:none!important}
 .deck--hand.has-hand .card-slot{display:grid;place-items:center;aspect-ratio:var(--card-ratio)!important;overflow:hidden;text-align:center}
 .deck--hand.has-hand .card-slot::after{content:none}
}


/* Placeholders are visible before script execution and after a failed import. */
.deck--hand .deck-item.is-native-loading:not([hidden]){visibility:visible!important;opacity:1!important}
.deck--hand .deck-item.is-native-loading .card-face,.deck--hand .card-face.is-native-failed{visibility:visible!important;opacity:1!important}
.deck-empty{grid-column:1/-1;list-style:none;padding:12px;text-align:center;color:#777;font-size:13px}

/* A small neutral loading ring, visible even before JavaScript runs. */
.card-slot[aria-busy="true"]::after{content:none!important}
.card-slot[aria-busy="true"]::before{content:none!important}
.card-face:not(.has-native-preview):not(.is-native-failed) > .card-slot[aria-busy="true"]::before{
  content:""!important;position:absolute;z-index:2;top:50%;left:50%;width:20px;height:20px;box-sizing:border-box;
  border:2px solid #d4d4d4;border-top-color:#525252;border-right-color:#525252;border-radius:50%;
  margin:-10px 0 0 -10px;pointer-events:none;animation:card-spinner .8s linear infinite;
}
@keyframes card-spinner{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.card-slot[aria-busy="true"]::before{animation:none!important}}

/* Bare DBF inserts have no deck controls or quantity navigation. */
.inline-cards__grid{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-start;justify-content:flex-start}
.inline-cards.is-align-center .inline-cards__grid{justify-content:center}
.inline-cards.is-align-right .inline-cards__grid{justify-content:flex-end}
.inline-cards__grid>.card-face{box-sizing:border-box;flex:0 1 min(100%,calc((100% - 36px)/4));min-width:0;max-width:310px;margin:0;padding:0;position:relative;display:block;cursor:default}
