/* Shieldwall HD client (22.10.2026): collectible cards (js/cards.js). The rarity frame is drawn here, 36 px inside the
   600 x 840 art (--fs = 36 / 600, --fsy = 36 / 840), the name sits in the bottom band (y 672 to 804 inside the frame).
   Only transform and opacity animate; reduced motion swaps the faces without a turn. */
.cd { --rc: #a4adb7; position: relative; display: block; width: 100%; aspect-ratio: 600 / 840; padding: 0; border: 0; background: none; color: inherit; perspective: 1100px; cursor: default; font: inherit; text-align: left; }
button.cd { cursor: pointer; }
.cd.r-common { --rc: #a4adb7; } .cd.r-rare { --rc: #4fa3ff; } .cd.r-epic { --rc: #b56dff; } .cd.r-legendary { --rc: #ffb02e; }
.cd-in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .62s var(--ease, cubic-bezier(.2, .8, .2, 1)); }
.cd.flip .cd-in { transform: rotateY(180deg); }
.cd-face { position: absolute; inset: 0; overflow: hidden; border-radius: 5.5% / 3.9%; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: #0b0d12;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .45), 0 0 0 1px rgba(0, 0, 0, .6); }
.cd-front img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.cd-frame { position: absolute; left: var(--fs); right: var(--fs); top: var(--fsy); bottom: var(--fsy); border: 2px solid var(--rc); border-radius: 4%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(0, 0, 0, .45), 0 0 10px color-mix(in srgb, var(--rc) 55%, transparent); pointer-events: none; }
.cd.r-epic .cd-frame, .cd.r-legendary .cd-frame { border-width: 3px; }
.cd.r-legendary .cd-frame::after { content: ""; position: absolute; inset: -3px; border-radius: inherit; box-shadow: 0 0 18px 2px color-mix(in srgb, var(--rc) 70%, transparent); opacity: .55; animation: cdglow 2.6s ease-in-out infinite alternate; }
@keyframes cdglow { from { opacity: .25; } to { opacity: .8; } }
.cd-gem { position: absolute; left: 50%; top: calc(var(--fsy) - 7px); width: 13px; height: 13px; margin-left: -6.5px; transform: rotate(45deg); background: var(--rc); border: 2px solid #0b0d12; box-shadow: 0 0 8px var(--rc); }
.cd-name { position: absolute; left: var(--fs); right: var(--fs); top: 80%; bottom: var(--fsy); display: flex; align-items: center; justify-content: center; padding: 0 6%;
  background: linear-gradient(180deg, rgba(5, 6, 9, 0), rgba(5, 6, 9, .72) 38%); border-radius: 0 0 4% 4%; pointer-events: none; }
.cd-name b { font: 700 clamp(10px, 1.05em, 18px)/1.12 var(--ff-d); color: #fff3da; text-align: center; text-shadow: 0 1px 2px #000, 0 0 8px rgba(0, 0, 0, .8);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.cd-grid .cd-name b { font-size: 12px; }
.cd.big .cd-name b { font-size: 21px; }
.cd-n, .cd-new { position: absolute; top: calc(var(--fsy) + 6px); padding: 2px 7px; border-radius: 999px; font: 700 12px/1.3 var(--ff-c); letter-spacing: .04em; pointer-events: none; }
.cd-n { right: calc(var(--fs) + 6px); background: rgba(5, 6, 9, .82); color: var(--gold2); border: 1px solid var(--line2); }
.cd-new { left: calc(var(--fs) + 6px); background: var(--ember); color: #1a0f05; text-transform: uppercase; }
.cd-lock { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); color: rgba(237, 229, 213, .55); pointer-events: none; }
.cd-lock .ic { width: 28px; height: 28px; }
/* missing: a dark silhouette of the art, the frame only hinted */
.cd.off .cd-front img { filter: grayscale(1) brightness(.3) contrast(1.25) blur(2px); transform: scale(1.04); }
.cd.off .cd-frame { opacity: .35; box-shadow: none; }
.cd.off .cd-gem { opacity: .4; box-shadow: none; }
.cd.off .cd-name b { color: var(--muted); }
/* back: rune pattern; in the detail it carries name, rarity and flavour text */
.cd-back { transform: rotateY(180deg); background:
  radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--rc) 22%, transparent), transparent 62%),
  repeating-linear-gradient(45deg, rgba(212, 173, 98, .07) 0 2px, transparent 2px 14px),
  repeating-linear-gradient(-45deg, rgba(212, 173, 98, .07) 0 2px, transparent 2px 14px), #0d1016; }
.cd-back::before { content: ""; position: absolute; left: var(--fs); right: var(--fs); top: var(--fsy); bottom: var(--fsy); border: 2px solid color-mix(in srgb, var(--rc) 70%, #d4ad62); border-radius: 4%; }
.cd-back-in { position: absolute; left: calc(var(--fs) + 8%); right: calc(var(--fs) + 8%); top: calc(var(--fsy) + 6%); bottom: calc(var(--fsy) + 6%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.cd-back-logo .ic { width: 46px; height: 46px; color: color-mix(in srgb, var(--rc) 60%, #f3d793); }
.cd-bk-name { font: 700 20px/1.15 var(--ff-d); color: #fff3da; }
.cd-back .cd-flav { font-size: 14px; color: #e3d9c6; font-style: italic; }
.cd-bk-meta { color: var(--muted); font-size: 12px; }
button.cd:hover .cd-in { transform: translateY(-3px); }
button.cd.flip:hover .cd-in { transform: rotateY(180deg) translateY(-3px); }
button.cd:focus-visible { outline: none; }
button.cd:focus-visible .cd-face { box-shadow: 0 0 0 2px var(--gold2), 0 6px 18px rgba(0, 0, 0, .45); }

/* ---------- album page ---------- */
.cards .cd-top { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.cd-top-txt { display: flex; flex-direction: column; gap: 6px; flex: 1 1 220px; min-width: 0; }
.cd-top-txt > b { font: 700 22px/1.2 var(--ff-d); color: var(--gold2); }
.cd-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cd-chips em { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: rgba(0, 0, 0, .3); font: 600 13px/1.3 var(--ff-c); font-style: normal; color: var(--ink); }
.cd-chips em.cd-dust { color: var(--ember2); border-color: rgba(255, 122, 26, .45); }
.cd-ev { display: flex; align-items: center; gap: 6px; color: var(--rune); }
.cd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; margin-bottom: 22px; }
.cards .sec-head { margin-top: 6px; }
.cd-show-row { display: grid; grid-template-columns: repeat(3, minmax(0, 112px)); gap: 14px; }
.cd-slot { display: flex; align-items: center; justify-content: center; aspect-ratio: 600 / 840; border-radius: 5.5% / 3.9%; border: 1px dashed var(--line2); background: rgba(0, 0, 0, .25); color: var(--dim); }
.cd-slot .ic { width: 26px; height: 26px; }
.cd-show-empty { margin-top: 10px; }
.cd-show .cd-name b { font-size: 11px; }
.cd-rules .cd-rl { margin: 0 0 6px; padding-left: 18px; display: grid; gap: 6px; color: var(--ink); }
.cd-firsts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px; }
.cd-firsts li { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); }
.cd-firsts li.on { color: var(--ink); }
.cd-firsts li.on .ic { color: var(--green); }
/* ---------- detail and reveal modals ---------- */
.modal-box.m-cd { width: min(760px, 100%); }
.cd-detail { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 22px; align-items: start; }
.cd-stage { display: flex; justify-content: center; }
.cd-stage .cd.big { width: min(300px, 70vw); }
.cd-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cd-side h3 { font: 700 26px/1.15 var(--ff-d); color: #fff3da; }
.cd-side .cd-flav { font-style: italic; color: #e3d9c6; }
.cd-how { margin: 0; padding-left: 18px; color: var(--muted); display: grid; gap: 4px; }
.cd-side .m-acts { flex-wrap: wrap; justify-content: flex-start; }
.cd-side .btn[aria-disabled="true"] { opacity: .55; }
.m-cd-rv { width: min(440px, 100%) !important; }
.cd-reveal { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.cd-reveal .cd-stage .cd.big { width: min(280px, 64vw); }
.cd-rv-count { color: var(--muted); font: 600 13px/1 var(--ff-c); letter-spacing: .08em; }
.cd-rv-info { min-height: 76px; display: flex; flex-direction: column; align-items: center; gap: 6px; opacity: .7; transition: opacity .3s; }
.cd-rv-info.on { opacity: 1; }
.cd-rv-info b { font: 700 20px/1.2 var(--ff-d); color: #fff3da; }
.cd-rv-info ul { list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: 14px; }
.cd-reveal .m-acts { justify-content: center; }
.cd.cd-pop { animation: cdpop .7s var(--ease-pop, cubic-bezier(.2, 1.35, .35, 1)) both; }
@keyframes cdpop { 0% { transform: scale(.94); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
.cd.cd-pop.flip { animation: none; }
.cd.cd-pop.r-legendary::after, .cd.cd-pop.r-epic::after { content: ""; position: absolute; inset: -8%; z-index: -1; border-radius: 12%; background: radial-gradient(closest-side, color-mix(in srgb, var(--rc) 55%, transparent), transparent); animation: cdburst 1.4s ease-out both; pointer-events: none; }
@keyframes cdburst { from { opacity: 0; transform: scale(.7); } 30% { opacity: 1; } to { opacity: 0; transform: scale(1.25); } }
/* ---------- home mini, profile, friends ---------- */
.cd-mini { margin-top: 16px; }
.cd-mini .lvl-row { align-items: center; }
.cd-mini-fan { display: flex; margin-left: auto; padding-right: 6px; }
.cd-mini-fan img { width: 44px; aspect-ratio: 600 / 840; object-fit: cover; border-radius: 4px; border: 1px solid var(--line2); box-shadow: 0 3px 8px rgba(0, 0, 0, .5); margin-left: -14px; }
.cd-mini-fan img:nth-child(1) { transform: rotate(-8deg); } .cd-mini-fan img:nth-child(3) { transform: rotate(8deg); }
.cd-prof { margin-top: 16px; }
.cd-fr { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.cd-fr img { width: 22px; aspect-ratio: 600 / 840; object-fit: cover; border-radius: 3px; border: 1px solid #a4adb7; }
.cd-fr img.r-rare { border-color: #4fa3ff; } .cd-fr img.r-epic { border-color: #b56dff; } .cd-fr img.r-legendary { border-color: #ffb02e; }

@media (max-width: 700px) {
  .cd-detail { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .cd-side { align-items: center; }
  .cd-side .m-acts { justify-content: center; }
  .cd-how { text-align: left; }
}
@media (max-width: 600px) {
  .cd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .cd-grid .cd-name b { font-size: 10px; }
  .cd-show-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
  .cd-n, .cd-new { font-size: 10px; padding: 1px 5px; }
  .cd-gem { width: 9px; height: 9px; margin-left: -4.5px; top: calc(var(--fsy) - 5px); }
  .cd-mini-fan img { width: 34px; }
  .cd-firsts { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .cd-in { transition: none; }
  .cd.r-legendary .cd-frame::after, .cd.cd-pop, .cd.cd-pop::after { animation: none; }
  button.cd:hover .cd-in { transform: none; }
  button.cd.flip:hover .cd-in { transform: rotateY(180deg); }
}
