/* =====================================================================
   Bad Monkey card kit: styles for BMCARDS.html() (bm-cards.js).
   From the MonkeySpace trading card (MonkeySpace/css/ms.css .tcard), in the
   site-template tokens (site-template/css/bad-monkey.css): ink borders, hard
   shadows, graph paper per type, DM Mono / DM Sans / Space Grotesk.
   ===================================================================== */
.bmc {
  --ink: #292832; --card: #fcfbf7; --foot: #f3f1ea; --muted: #62606b;
  --mono: 'DM Mono', 'Courier New', monospace; --sans: 'DM Sans', Arial, sans-serif; --display: 'Space Grotesk', Arial, sans-serif;
  position: relative; display: flex; flex-direction: column; background: var(--card); color: var(--ink);
  border: 2px solid var(--ink); box-shadow: 6px 7px 0 var(--ink); width: 240px; min-width: 0; font-family: var(--sans);
  transition: transform .15s, box-shadow .15s;
}
.bmc:hover { transform: translate(-3px, -4px); box-shadow: 9px 11px 0 var(--ink) }
.bmc .band { display: flex; justify-content: space-between; align-items: center; font: 10px var(--mono); letter-spacing: .14em; padding: 7px 10px; border-bottom: 2px solid var(--ink) }
.bmc .band b { font-weight: 500 }
.bmc .art { position: relative; height: 136px; border-bottom: 2px solid var(--ink); overflow: hidden }
.bmc .art svg { display: block; width: 100%; height: 100% }
.bmc .body { padding: 12px 13px 10px; display: flex; flex-direction: column; gap: 6px; flex: 1 }
.bmc h4 { font: 700 20px/1.1 var(--display); letter-spacing: -.035em; margin: 0 }
.bmc .issuer { font: 10.5px var(--mono); color: var(--muted) }
.bmc .desc { font-size: 12.5px; line-height: 1.45; color: #55525d; margin: 2px 0 }
.bmc dl { margin: 2px 0 0; display: grid; grid-template-columns: auto 1fr; font: 10.5px var(--mono); border-top: 1px solid var(--ink) }
.bmc dt, .bmc dd { margin: 0; padding: 4px 0; border-bottom: 1px dashed #d0ccd3 }
.bmc dt { color: #75717b; text-transform: uppercase; letter-spacing: .06em; padding-right: 10px }
.bmc dd { text-align: right }
.bmc .foot { display: flex; align-items: center; gap: 8px; border-top: 2px solid var(--ink); padding: 8px 12px; background: var(--foot); font: 9.5px var(--mono); color: var(--muted) }
.bmc .foot .seal { color: #3f7a5e; letter-spacing: .1em }
.bmc .foot .lease { flex: 1; height: 8px; border: 1.2px solid var(--ink); background: #e6e2d6; position: relative }
.bmc .foot .lease i { position: absolute; left: 0; top: 0; bottom: 0; background: #82dbb5 }
.bmc .foot.market { flex-direction: column; align-items: flex-start; gap: 2px }
.bmc .price { font: 700 20px var(--display); letter-spacing: -.04em; color: var(--ink) }
.bmc .price small { font: 10px var(--mono); color: var(--muted); letter-spacing: 0 }
.bmc .grade { position: absolute; right: 10px; top: 40px; z-index: 2; background: #282833; color: #adf2dc; border: 1.5px solid var(--ink); font: 500 15px var(--mono); padding: 5px 7px 4px; text-align: center; line-height: 1 }
.bmc .grade small { display: block; font-size: 7.5px; letter-spacing: .14em; color: #dcd6e6; margin-top: 3px }

/* the four types and the deck: band colour and graph paper (site-template paper-lav / -yellow / -green / -slate) */
.bmc.t-agent .band { background: #d8d0e6 }
.bmc.t-asset .band { background: #efe2a6 }
.bmc.t-model .band { background: #cfe0cf }
.bmc.t-app   .band { background: #cfd8e3 }
.bmc.t-deck  .band { background: #282833; color: #adf2dc }
.bmc.t-agent .art { background-color: #ece7f1; background-image: linear-gradient(#ddd5e6 1px, transparent 1px), linear-gradient(90deg, #ddd5e6 1px, transparent 1px); background-size: 13px 13px }
.bmc.t-asset .art { background-color: #f6f1da; background-image: linear-gradient(#e9e0b9 1px, transparent 1px), linear-gradient(90deg, #e9e0b9 1px, transparent 1px); background-size: 13px 13px }
.bmc.t-model .art { background-color: #e8ede3; background-image: linear-gradient(#d6dfd1 1px, transparent 1px), linear-gradient(90deg, #d6dfd1 1px, transparent 1px); background-size: 13px 13px }
.bmc.t-app   .art { background-color: #e4e7ea; background-image: linear-gradient(#d3d8dd 1px, transparent 1px), linear-gradient(90deg, #d3d8dd 1px, transparent 1px); background-size: 13px 13px }
.bmc.t-deck  .art { background-color: #33333f; background-image: linear-gradient(#44434f 1px, transparent 1px), linear-gradient(90deg, #44434f 1px, transparent 1px); background-size: 13px 13px }

/* big */
.bmc.big { width: 340px }
.bmc.big .art { height: 210px }
.bmc.big h4 { font-size: 28px }

/* back: the signed advertisement */
.bmc.back { background: var(--foot) }
.bmc.back .code { padding: 14px 14px 12px; font: 11.5px/1.65 var(--mono); flex: 1 }
.bmc.back .code div { padding-left: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.bmc.back .code .k { color: #80738f }

/* mini: for piles, hands and palettes */
.bmc.mini { width: 120px; box-shadow: 4px 5px 0 var(--ink) }
.bmc.mini .band { font-size: 10px; padding: 5px 8px }
.bmc.mini .art { height: 66px }
.bmc.mini .nm { font: 700 14px/1.15 var(--display); letter-spacing: -.02em; padding: 7px 8px 9px; text-align: center }

/* deck parts list */
.bmc .parts { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); font: 11px var(--mono) }
.bmc .parts li { display: flex; gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px dashed #d0ccd3 }
.bmc .parts li b { font-weight: 500; font-size: 8.5px; letter-spacing: .1em; padding: 2px 5px; border: 1px solid var(--ink); min-width: 46px; text-align: center }
.bmc .parts li.t-agent b { background: #d8d0e6 } .bmc .parts li.t-asset b { background: #efe2a6 }
.bmc .parts li.t-model b { background: #cfe0cf } .bmc .parts li.t-app b { background: #cfd8e3 }

/* chips: a card named inline in running text */
.bmc-chip { display: inline-flex; align-items: center; gap: 6px; font: 500 11px 'DM Mono', monospace; letter-spacing: .1em; padding: 3px 8px; border: 1.5px solid #292832; box-shadow: 2px 2px 0 #292832; white-space: nowrap }
.bmc-chip.t-agent { background: #d8d0e6 } .bmc-chip.t-asset { background: #efe2a6 } .bmc-chip.t-model { background: #cfe0cf } .bmc-chip.t-app { background: #cfd8e3 } .bmc-chip.t-deck { background: #282833; color: #adf2dc }

/* layouts: grid, fan, stack, flip */
.bmc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(244px, 1fr)); gap: 28px 22px; justify-items: start }
.bmc-row { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start }
.bmc-fan { position: relative; height: 430px; display: flex; justify-content: center; padding-top: 18px }
.bmc-fan .bmc { position: absolute; left: calc(50% - 120px); transform-origin: 50% 130% }
.bmc-fan .bmc:nth-child(1) { transform: translateX(-150px) rotate(-11deg) }
.bmc-fan .bmc:nth-child(2) { transform: translateX(-52px) rotate(-4deg) translateY(-10px) }
.bmc-fan .bmc:nth-child(3) { transform: translateX(52px) rotate(4deg) translateY(-10px) }
.bmc-fan .bmc:nth-child(4) { transform: translateX(150px) rotate(11deg) }
.bmc-fan .bmc:hover { z-index: 5 }
.bmc-stack { position: relative; width: 260px; height: 420px }
.bmc-stack .bmc { position: absolute; left: 0; top: 0 }
.bmc-stack .bmc:nth-child(2) { transform: translate(8px, 8px) rotate(2deg) }
.bmc-stack .bmc:nth-child(3) { transform: translate(16px, 16px) rotate(4deg) }
.bmc-flip { perspective: 1200px; width: 240px; height: 410px; cursor: pointer }
.bmc-flip .faces { position: relative; width: 100%; height: 100%; transition: transform .6s; transform-style: preserve-3d }
.bmc-flip.on .faces, .bmc-flip:focus-visible .faces { transform: rotateY(180deg) }
.bmc-flip .bmc { position: absolute; inset: 0 auto auto 0; backface-visibility: hidden; height: 400px }
.bmc-flip .bmc.back { transform: rotateY(180deg) }
@media (prefers-reduced-motion: reduce) { .bmc, .bmc-flip .faces { transition: none } }
