/* トレカ風の札（コレクション・ガチャの一覧で共通）。部品は public/js/cards.js の tcard()
   2026-09-30 社長「レアカードになるにつれてキャラ背景も豪華にしていってカードゲームのように並べてほしい」
   base・N＝鋼 / R＝銀 / SR＝紫の宝石 / SSR＝金（光の筋・角の飾り）/ UR・CHAR＝虹のホロ / SECRET＝真珠
   class はすべて .tc で始める（app.css の .ccard・.lb・.spin などとぶつけない） */

.tc {
  --tc-c: var(--rar-base);
  --tc-bw: 6px; --tc-bw: 4.4cqi;              /* 枠の太さ（cqi＝札の幅の1%） */
  --tc-bgi: url(/img/cards/bg_n.webp);
  --tc-bgc: #15131c;
  --tc-bgo: rgba(0, 0, 0, 0);
  --tc-fr: linear-gradient(150deg, #6a6f7e 0%, #33363f 18%, #8a8f9c 34%, #2a2c33 52%, #585d6b 70%, #202228 86%, #737887 100%);
  --tc-line: var(--tc-c);
  --tc-tagc: #fff;
  --tc-glow: 0 0 0 transparent;
  position: relative; display: block; box-sizing: border-box;
  width: 100%; min-width: 56px; aspect-ratio: 63 / 88;
  margin: 0; padding: 0; border: 0; background: none; color: #fff;
  font: inherit; text-align: left; line-height: 1.3;
  border-radius: 4.8% / 3.4%;
  container-type: inline-size;
  -webkit-user-select: none; user-select: none;
}
button.tc { cursor: pointer; }
.tc:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

/* 札の本体（傾きはここだけに付ける。外側の .tc はガチャの動きに使えるよう空けておく） */
.tc-body {
  position: absolute; inset: 0; display: block; overflow: hidden; border-radius: inherit; isolation: isolate;
  background: var(--tc-bgc);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.75), var(--tc-glow), 0 3px 10px rgba(0, 0, 0, 0.55);
  transform: perspective(700px) rotateX(var(--tc-rx, 0deg)) rotateY(var(--tc-ry, 0deg));
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.3, 1), scale 0.12s ease-out;
}
.tc.tc-hov .tc-body { transition: transform 0.08s linear, scale 0.12s ease-out; }
button.tc:active .tc-body { scale: 0.97; }
.tc-body > * { position: absolute; pointer-events: none; }

/* 背景の絵（レアごと）。下は名札が読めるように暗く */
.tc-bg {
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 3, 16, 0) 42%, rgba(6, 3, 16, 0.62) 100%),
    linear-gradient(var(--tc-bgo), var(--tc-bgo)),
    var(--tc-bgi) center / cover no-repeat,
    var(--tc-bgc);
  box-shadow: inset 0 0 5cqi 1cqi rgba(0, 0, 0, 0.55);
}

/* 光の筋・粒（キャラの後ろ） */
.tc-fx { inset: 0; overflow: hidden; }
.tc-fx::before, .tc-fx::after { content: ""; position: absolute; pointer-events: none; }

/* キャラの絵 */
.tc-img {
  left: 6%; top: 6%; width: 88%; height: 84%;
  object-fit: contain; object-position: 50% 100%;
  filter: drop-shadow(0 0 2.2cqi rgba(0, 0, 0, 0.6));
  -webkit-user-drag: none;
}
/* 胸から上を大きく（キャラ一覧） */
.tc-bust .tc-img { left: 50%; top: 5%; width: auto; height: 138%; max-width: none; object-fit: fill; translate: -50% 0; }
/* 絵を札いっぱいに（SSR・UR の一枚絵） */
.tc-full .tc-img { left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 26%; filter: none; }

/* ホロ（指・マウスの位置で光る。UR・CHAR・SECRET はいつも薄く虹が流れる） */
.tc-holo {
  inset: 0; opacity: 0; transition: opacity 0.35s;
  mix-blend-mode: overlay;
  background: radial-gradient(farthest-corner circle at var(--tc-mx, 50%) var(--tc-my, 30%), rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0.18) 22%, rgba(255, 255, 255, 0) 52%);
}
.tc.tc-hov .tc-holo { opacity: 1; }
/* 流れる虹は UR・CHAR・SECRET だけが持つ（中身が無くても置くと、札の4倍の層ができる） */

/* 枠（マスクで縁だけ残す） */
.tc-frame {
  inset: 0; border-radius: inherit; padding: var(--tc-bw);
  background: var(--tc-fr);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
/* 枠の内側の細い線と、金属のきらめき（枠の上だけを走る） */
.tc-frame::before { content: ""; position: absolute; inset: calc(var(--tc-bw) - 1px); border-radius: 2.4cqi; border: 1px solid rgba(255, 255, 255, 0.4); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); }
.tc-frame::after { content: ""; position: absolute; left: 0; top: -10%; bottom: -10%; width: 46%; background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.85) 50%, rgba(255, 255, 255, 0)); transform: translateX(-190%) skewX(-15deg); opacity: 0; }

/* 角の飾り（SSR から上） */
.tc-crn { inset: 0; filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 1.5cqi var(--tc-c)); }
.tc-crn i {
  position: absolute; width: 21cqi; height: 21cqi; background: var(--tc-fr);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M0 0h31l-4.5 4.5H4.5v22L0 31z'/%3E%3Cpath d='M10 3.2 16.8 10 10 16.8 3.2 10z'/%3E%3Cpath d='M18 8.2h9.5l-2.6 2.6H18zM8.2 18v9.5l2.6-2.6V18z'/%3E%3Ccircle cx='31.5' cy='9.5' r='1.9'/%3E%3Ccircle cx='9.5' cy='31.5' r='1.9'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M0 0h31l-4.5 4.5H4.5v22L0 31z'/%3E%3Cpath d='M10 3.2 16.8 10 10 16.8 3.2 10z'/%3E%3Cpath d='M18 8.2h9.5l-2.6 2.6H18zM8.2 18v9.5l2.6-2.6V18z'/%3E%3Ccircle cx='31.5' cy='9.5' r='1.9'/%3E%3Ccircle cx='9.5' cy='31.5' r='1.9'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tc-crn i:nth-child(1) { left: 0; top: 0; }
.tc-crn i:nth-child(2) { right: 0; top: 0; transform: scaleX(-1); }
.tc-crn i:nth-child(3) { left: 0; bottom: 0; transform: scaleY(-1); }
.tc-crn i:nth-child(4) { right: 0; bottom: 0; transform: scale(-1, -1); }

/* 左上のレアの札 */
.tc-tag {
  left: 5px; top: 5px; left: 3.2cqi; top: 3.2cqi;
  min-width: 2.3em; padding: 0 0.45em; border-radius: 0.3em;
  font-size: 11px; font-size: clamp(9px, 7.8cqi, 15px); font-weight: 800; line-height: 1.45; letter-spacing: 0.04em; text-align: center; white-space: nowrap;
  color: var(--tc-tagc); background: var(--tc-fr);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 1px 3px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.55);
}
/* 上限の星（名札の2行目の右。Lv・+% の右に並べ、狭い札では次の行に回る） */
.tc-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 0.15em; }
.tc-stars {
  margin-left: auto;
  color: var(--gold); font-size: 10px; font-size: clamp(9.5px, 8cqi, 14px); line-height: 1.25; letter-spacing: -0.08em; white-space: nowrap;
  text-shadow: 0 0 4px rgba(255, 211, 77, 0.6), 0 1px 1px #000;
}
/* 重なっている枚数（左の中ほど。合成のエサにできる数） */
.tc-cnt {
  left: 5px; top: 26px; left: 3.2cqi; top: calc(3.2cqi + 1.9em);
  min-width: 2.3em; padding: 0 0.45em; border-radius: 0.3em;
  font-size: 11px; font-size: clamp(9px, 7.8cqi, 15px); font-weight: 800; line-height: 1.45; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums;
  color: #fff; background: rgba(8, 4, 20, 0.82);
  box-shadow: 0 0 0 1px rgba(255, 211, 77, 0.75), 0 1px 3px rgba(0, 0, 0, 0.7);
}
.tc:not(:has(.tc-tag)) .tc-cnt { top: 5px; top: 3.2cqi; }
/* 右上の札（装備中・使用中・NEW） */
.tc-badge {
  right: 5px; top: 5px; right: 3.2cqi; top: 3.2cqi;
  padding: 0 0.55em; border-radius: 99px; background: var(--cyan); color: #001a22;
  font-size: 10px; font-size: clamp(9px, 7.4cqi, 13px); font-weight: 800; line-height: 1.5; white-space: nowrap;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 2cqi rgba(54, 226, 255, 0.75);
}
/* 鍵 */
.tc-lock { left: 50%; top: 44%; translate: -50% -50%; display: flex; flex-direction: column; align-items: center; gap: 1.6cqi; color: var(--muted); }
.tc-lki { display: block; width: 32px; height: 32px; width: 22cqi; height: 22cqi; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8)); }
.tc-lki svg { display: block; width: 100%; height: 100%; }
.tc-lock b {
  padding: 0 0.6em; border-radius: 99px; background: rgba(0, 0, 0, 0.62);
  font-size: 11px; font-size: clamp(9px, 7.6cqi, 14px); font-weight: 800; line-height: 1.5; white-space: nowrap;
}
.tc-secret .tc-lock { color: var(--rar-SECRET); }
.tc-secret .tc-lock b { color: var(--rar-SECRET); text-shadow: 0 0 8px var(--rar-SECRET); }

/* 下の名札 */
.tc-plate {
  left: var(--tc-bw); right: var(--tc-bw); bottom: var(--tc-bw);
  display: flex; flex-direction: column; gap: 0.1em;
  padding: 4px 6px 5px; padding: 1.8cqi 3.4cqi 2.4cqi;
  background:
    linear-gradient(90deg, transparent, var(--tc-line) 18%, var(--tc-line) 82%, transparent) top / 100% 1px no-repeat,
    linear-gradient(180deg, rgba(14, 8, 32, 0.74), rgba(6, 3, 16, 0.94));
}
.tc-title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
  font-size: 13px; font-size: clamp(10.5px, 10cqi, 17px); font-weight: 800; line-height: 1.22; letter-spacing: 0.01em;
  overflow-wrap: anywhere; text-wrap: balance; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}
.tc-sub {
  display: block; font-size: 11px; font-size: clamp(9.5px, 8cqi, 14px); font-weight: 700; line-height: 1.25;
  color: #d9d1f4; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.tc-sub b { color: var(--gold); font-weight: 800; }

/* ---------- レアごと ---------- */
/* base・N＝鋼 */
.tc-base { --tc-c: #8a8fa0; --tc-bgo: rgba(8, 8, 14, 0.38); }
.tc-n {
  --tc-c: var(--rar-N);
  --tc-fr: linear-gradient(150deg, #b3b9c8 0%, #4f5463 15%, #d2d6df 30%, #3b3f4b 46%, #868c9d 62%, #2d3039 80%, #aab0bf 100%);
  --tc-bgo: rgba(20, 24, 36, 0.12);
}
/* 鋼の板だけだと無地に見える（2026-09-30 社長「キャラ背景が無地」）。キャラの色のスポットライト・足元の光・斜めの光の線を重ねる
   色は tcard の color（--tc-cc）。渡されていない札はレアの色 */
.tc-base .tc-bg::before, .tc-n .tc-bg::before {
  content: ""; position: absolute; inset: 0; opacity: 0.8; mix-blend-mode: screen;
  background:
    radial-gradient(78% 54% at 50% 38%, var(--tc-cc, var(--tc-c)), rgba(0, 0, 0, 0) 72%),
    radial-gradient(74% 24% at 50% 96%, var(--tc-cc, var(--tc-c)), rgba(0, 0, 0, 0) 70%);
}
.tc-base .tc-bg::after, .tc-n .tc-bg::after {
  content: ""; position: absolute; inset: 0; opacity: 0.5; mix-blend-mode: screen;
  background:
    linear-gradient(118deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.22) 44%, rgba(255, 255, 255, 0) 52%),
    repeating-linear-gradient(118deg, rgba(255, 255, 255, 0) 0 8cqi, rgba(255, 255, 255, 0.09) 8cqi 8.8cqi);
}
.tc-n .tc-bg::before { opacity: 0.92; }
/* R＝銀・青み */
.tc-r {
  --tc-c: var(--rar-R);
  --tc-bgi: url(/img/cards/bg_r.webp); --tc-bgc: #0f1a33;
  --tc-fr: linear-gradient(150deg, #ffffff 0%, #a5b2c9 13%, #f1f5fc 27%, #66758f 43%, #dfe7f4 58%, #7f8eaa 76%, #f7faff 100%);
  --tc-tagc: #0e1f3d;
  --tc-glow: 0 0 8px rgba(79, 168, 255, 0.25);
}
.tc-r .tc-tag { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); }
/* SR＝紫の宝石・光の粒 */
.tc-sr {
  --tc-c: var(--rar-SR);
  --tc-bgi: url(/img/cards/bg_sr.webp); --tc-bgc: #1d0838;
  --tc-fr: linear-gradient(150deg, #f7e4ff 0%, #b865ff 11%, #4a0f86 24%, #e3b3ff 38%, #7a26c9 54%, #300858 70%, #c98aff 85%, #f4dcff 100%);
  --tc-glow: 0 0 10px rgba(192, 112, 255, 0.4);
}
/* SSR＝金・回る光の筋・角の飾り */
.tc-ssr {
  --tc-c: var(--rar-SSR);
  --tc-bw: 7px; --tc-bw: 5cqi;
  --tc-bgi: url(/img/cards/bg_ssr.webp); --tc-bgc: #2a1a04;
  --tc-bgo: rgba(20, 10, 0, 0.18);
  --tc-fr: linear-gradient(150deg, #fff9d8 0%, #e6b030 11%, #7c4f0b 23%, #ffe98f 37%, #c18a18 51%, #fff4bd 63%, #8f600f 79%, #ffd862 100%);
  --tc-tagc: #3a2200;
  --tc-glow: 0 0 12px rgba(255, 211, 77, 0.5);
}
.tc-ssr .tc-tag { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55); }
/* UR・CHAR＝虹のホロ */
.tc-ur, .tc-char {
  --tc-c: var(--rar-UR);
  --tc-bw: 7px; --tc-bw: 5cqi;
  --tc-bgi: url(/img/cards/bg_ur.webp); --tc-bgc: #1a0730;
  --tc-bgo: rgba(10, 4, 30, 0.2);
  --tc-fr:
    linear-gradient(150deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0) 26%, rgba(255, 255, 255, 0.45) 50%, rgba(255, 255, 255, 0) 74%, rgba(255, 255, 255, 0.5) 100%),
    conic-gradient(from 210deg, #ff4fd8, #ff9d4f, #fff36b, #5dffb0, #36e2ff, #7a6bff, #ff4fd8);
  --tc-line: linear-gradient(90deg, #ff4fd8, #fff36b, #5dffb0, #36e2ff, #7a6bff);
  --tc-glow: 0 0 14px rgba(255, 79, 216, 0.55), 0 0 26px rgba(54, 226, 255, 0.25);
}
.tc-char {
  --tc-c: var(--cyan);
  --tc-fr:
    linear-gradient(150deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0) 26%, rgba(255, 255, 255, 0.45) 50%, rgba(255, 255, 255, 0) 74%, rgba(255, 255, 255, 0.5) 100%),
    conic-gradient(from 30deg, #36e2ff, #ff2e97, #ffd34d, #5dffb0, #36e2ff);
  --tc-glow: 0 0 14px rgba(54, 226, 255, 0.55), 0 0 26px rgba(255, 46, 151, 0.3);
}
/* 虹の札の字は濃い色（明るい黄・水色の上でも読める） */
.tc-ur .tc-tag, .tc-char .tc-tag { color: #1c0628; font-weight: 900; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55); }
.tc-ur .tc-plate, .tc-char .tc-plate { background: var(--tc-line) top / 100% 1px no-repeat, linear-gradient(180deg, rgba(14, 8, 32, 0.74), rgba(6, 3, 16, 0.94)); }
/* SECRET＝真珠・ミント */
.tc-secret {
  --tc-c: var(--rar-SECRET);
  --tc-bw: 7px; --tc-bw: 5cqi;
  --tc-bgi: url(/img/cards/bg_secret.webp); --tc-bgc: #0c2a26;
  --tc-bgo: rgba(4, 26, 30, 0.34);
  --tc-fr:
    linear-gradient(150deg, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0) 32%, rgba(255, 255, 255, 0.55) 58%, rgba(255, 255, 255, 0) 84%),
    conic-gradient(from 120deg, #f3fffb, #8ff3d6, #ffd9ee, #d6d0ff, #eafff9, #74ecca, #fff0f8, #f3fffb);
  --tc-tagc: #0b3a31;
  --tc-line: linear-gradient(90deg, #8ff3d6, #ffd9ee, #d6d0ff, #8ff3d6);
  --tc-glow: 0 0 12px rgba(109, 255, 216, 0.45);
}
.tc-secret .tc-tag { text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7); }
.tc-secret .tc-plate { background: var(--tc-line) top / 100% 1px no-repeat, linear-gradient(180deg, rgba(8, 26, 30, 0.74), rgba(4, 12, 18, 0.94)); }

/* ---------- 動き（光の筋・粒・ホロ・枠のきらめき） ---------- */
/* 枠のきらめき（R から上） */
.tc-r .tc-frame::after, .tc-sr .tc-frame::after, .tc-ssr .tc-frame::after, .tc-ur .tc-frame::after, .tc-char .tc-frame::after, .tc-secret .tc-frame::after { opacity: 1; animation: tc-sweep 6s ease-in-out infinite; }
.tc-sr .tc-frame::after { animation-duration: 5s; }
.tc-ssr .tc-frame::after { animation-duration: 4.2s; }
.tc-ur .tc-frame::after, .tc-char .tc-frame::after, .tc-secret .tc-frame::after { animation-duration: 3.6s; }
@keyframes tc-sweep { 0%, 55% { transform: translateX(-190%) skewX(-15deg); } 90%, 100% { transform: translateX(300%) skewX(-15deg); } }

/* 虹の枠は色が流れる */
.tc-ur .tc-frame, .tc-ur .tc-tag, .tc-ur .tc-crn i, .tc-char .tc-frame, .tc-char .tc-tag, .tc-char .tc-crn i { animation: tc-hue 7s linear infinite; }
.tc-secret .tc-frame, .tc-secret .tc-crn i { animation: tc-pearl 6s ease-in-out infinite alternate; }
@keyframes tc-hue { to { filter: hue-rotate(360deg); } }
@keyframes tc-pearl { from { filter: hue-rotate(-24deg) brightness(1); } to { filter: hue-rotate(24deg) brightness(1.08); } }

/* 回る光の筋（SSR＝金・UR/CHAR＝虹・SECRET＝真珠） */
.tc-ssr .tc-fx::before, .tc-ur .tc-fx::before, .tc-char .tc-fx::before, .tc-secret .tc-fx::before {
  left: 50%; top: 34%; width: 190%; aspect-ratio: 1; translate: -50% -50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 228, 140, 0.34) 0deg 5deg, rgba(255, 228, 140, 0) 5deg 15deg);
  -webkit-mask: radial-gradient(closest-side, #000 12%, rgba(0, 0, 0, 0.6) 40%, transparent 72%);
  mask: radial-gradient(closest-side, #000 12%, rgba(0, 0, 0, 0.6) 40%, transparent 72%);
  animation: tc-spin 30s linear infinite;
}
.tc-ur .tc-fx::before, .tc-char .tc-fx::before {
  background: repeating-conic-gradient(from 0deg, rgba(255, 110, 230, 0.34) 0deg 4deg, rgba(0, 0, 0, 0) 4deg 10deg, rgba(110, 240, 255, 0.34) 10deg 14deg, rgba(0, 0, 0, 0) 14deg 20deg, rgba(255, 240, 120, 0.3) 20deg 24deg, rgba(0, 0, 0, 0) 24deg 30deg);
  animation-duration: 22s;
}
.tc-secret .tc-fx::before { background: repeating-conic-gradient(from 0deg, rgba(230, 255, 248, 0.3) 0deg 6deg, rgba(0, 0, 0, 0) 6deg 18deg); animation-duration: 40s; }
@keyframes tc-spin { to { transform: rotate(360deg); } }

/* 上っていく光の粒（R＝青・SR＝紫・SSR＝金・UR/CHAR＝虹・SECRET＝泡）。高さ200%の模様を半分ずらして継ぎ目なく回す */
.tc-r .tc-fx::after, .tc-sr .tc-fx::after, .tc-ssr .tc-fx::after, .tc-ur .tc-fx::after, .tc-char .tc-fx::after, .tc-secret .tc-fx::after {
  left: 0; top: 0; width: 100%; height: 200%;
  background-image:
    radial-gradient(circle, rgba(190, 225, 255, 0.85) 0 1px, rgba(190, 225, 255, 0) 1.8px),
    radial-gradient(circle, rgba(120, 180, 255, 0.6) 0 1.3px, rgba(120, 180, 255, 0) 2.2px);
  background-size: 25% 12.5%, 33.333% 16.667%;
  background-position: 0 0, 40% 30%;
  animation: tc-rise 16s linear infinite;
  opacity: 0.55;
}
.tc-sr .tc-fx::after {
  background-image:
    radial-gradient(circle, rgba(246, 222, 255, 0.95) 0 1.2px, rgba(246, 222, 255, 0) 2px),
    radial-gradient(circle, rgba(200, 130, 255, 0.8) 0 1.6px, rgba(200, 130, 255, 0) 2.6px);
  animation-duration: 11s; opacity: 0.85;
}
.tc-ssr .tc-fx::after {
  background-image:
    radial-gradient(circle, rgba(255, 246, 200, 1) 0 1.3px, rgba(255, 246, 200, 0) 2.2px),
    radial-gradient(circle, rgba(255, 200, 80, 0.85) 0 1.8px, rgba(255, 200, 80, 0) 3px);
  animation: tc-rise 9s linear infinite, tc-tw 1.8s ease-in-out infinite alternate; opacity: 1;
}
.tc-ur .tc-fx::after, .tc-char .tc-fx::after {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 1) 0 1.4px, rgba(255, 255, 255, 0) 2.4px),
    radial-gradient(circle, rgba(255, 120, 230, 0.9) 0 1.8px, rgba(255, 120, 230, 0) 3px),
    radial-gradient(circle, rgba(110, 240, 255, 0.9) 0 1.6px, rgba(110, 240, 255, 0) 2.8px);
  background-size: 25% 12.5%, 33.333% 16.667%, 20% 10%;
  background-position: 0 0, 40% 30%, 70% 60%;
  animation: tc-rise 7.5s linear infinite, tc-tw 1.2s ease-in-out infinite alternate; opacity: 1;
}
.tc-secret .tc-fx::after {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0) 0 2px, rgba(230, 255, 250, 0.85) 2.4px 3px, rgba(230, 255, 250, 0) 3.6px),
    radial-gradient(circle, rgba(255, 220, 240, 0.85) 0 1.2px, rgba(255, 220, 240, 0) 2px);
  animation: tc-rise 14s linear infinite; opacity: 0.9;
}
@keyframes tc-rise { from { transform: translateY(0); } to { transform: translateY(-50%); } }
@keyframes tc-tw { from { opacity: 0.55; } to { opacity: 1; } }

/* 虹・真珠のホロ（いつも薄く流れ、指を当てると強く） */
.tc-ur .tc-holo, .tc-char .tc-holo, .tc-secret .tc-holo { opacity: 0.8; mix-blend-mode: color-dodge; }
.tc-ur.tc-hov .tc-holo, .tc-char.tc-hov .tc-holo, .tc-secret.tc-hov .tc-holo { opacity: 1; }
.tc-ur .tc-holo, .tc-char .tc-holo, .tc-secret .tc-holo {
  background:
    radial-gradient(farthest-corner circle at var(--tc-mx, 50%) var(--tc-my, 30%), rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 40%),
    repeating-linear-gradient(115deg, rgba(255, 60, 170, 0.16) 0%, rgba(255, 220, 60, 0.16) 4%, rgba(60, 255, 180, 0.16) 8%, rgba(60, 200, 255, 0.16) 12%, rgba(170, 70, 255, 0.16) 16%, rgba(255, 60, 170, 0.16) 20%)
      var(--tc-mx, 50%) var(--tc-my, 50%) / 300% 300%;
}
.tc-secret .tc-holo {
  background:
    radial-gradient(farthest-corner circle at var(--tc-mx, 50%) var(--tc-my, 30%), rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0) 40%),
    repeating-linear-gradient(115deg, rgba(140, 255, 220, 0.14) 0%, rgba(255, 210, 235, 0.14) 6%, rgba(210, 205, 255, 0.14) 12%, rgba(140, 255, 220, 0.14) 18%)
      var(--tc-mx, 50%) var(--tc-my, 50%) / 300% 300%;
}
.tc-ur .tc-holo::before, .tc-char .tc-holo::before, .tc-secret .tc-holo::before {
  content: ""; position: absolute; inset: -50%; opacity: 1;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0) 30%, rgba(255, 140, 230, 0.22) 40%, rgba(255, 250, 170, 0.26) 46%, rgba(140, 255, 230, 0.22) 52%, rgba(140, 190, 255, 0.2) 58%, rgba(255, 255, 255, 0) 68%);
  animation: tc-drift 5.5s ease-in-out infinite alternate;
}
.tc-secret .tc-holo::before { background: linear-gradient(115deg, rgba(255, 255, 255, 0) 32%, rgba(200, 255, 240, 0.24) 44%, rgba(255, 225, 245, 0.26) 50%, rgba(220, 215, 255, 0.22) 56%, rgba(255, 255, 255, 0) 68%); }
@keyframes tc-drift { from { transform: translate(-22%, -12%); } to { transform: translate(22%, 12%); } }

/* ---------- 状態 ---------- */
/* 持っていない（暗い影の札） */
.tc-off .tc-img { filter: brightness(0); opacity: 0.55; }
.tc-off .tc-bg { filter: grayscale(0.85) brightness(0.42); }
.tc-off .tc-frame, .tc-off .tc-crn, .tc-off .tc-tag { filter: grayscale(0.8) brightness(0.62); animation: none; }
.tc-off .tc-fx, .tc-off .tc-holo::before { display: none; }
.tc-off .tc-frame::after { animation: none; opacity: 0; }
.tc-off .tc-body { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.75), 0 3px 10px rgba(0, 0, 0, 0.55); }
.tc-off .tc-title { color: #b9b0d6; }
/* ひみつの服は持つまでミントの影（誘う） */
.tc-secret.tc-off .tc-img { filter: brightness(0) drop-shadow(0 0 2.6cqi var(--rar-SECRET)); opacity: 0.85; }
.tc-secret.tc-off .tc-frame, .tc-secret.tc-off .tc-crn { filter: grayscale(0.3) brightness(0.8); }
/* 使っているキャラ・装備中の服 */
.tc-use .tc-body, .tc-eq .tc-body { box-shadow: 0 0 0 2px var(--cyan), 0 0 14px rgba(54, 226, 255, 0.6), 0 3px 10px rgba(0, 0, 0, 0.55); }
/* 出てくる動き（delay を付けたときだけ） */
.tc-pop { animation: tc-pop 0.5s cubic-bezier(0.2, 1.3, 0.4, 1) both; animation-delay: var(--tc-delay, 0ms); }
@keyframes tc-pop { from { opacity: 0; transform: translateY(10px) scale(0.86); } }

/* 画面の外の札は動きを止める（スマホの負担を減らす） */
.tc:not(.tc-live) .tc-body *, .tc:not(.tc-live) .tc-body *::before, .tc:not(.tc-live) .tc-body *::after { animation-play-state: paused !important; }

@media (prefers-reduced-motion: reduce) {
  .tc, .tc *, .tc *::before, .tc *::after { animation: none !important; }
  .tc-body { transform: none !important; transition: none; }
  .tc-frame::after { opacity: 0 !important; }
}

/* ---------- 並べ方（コレクション）。スマホ縦2〜3列・横4列 ---------- */
.tc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; }
@media (min-width: 360px) { .tc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 8px; } }
@media (min-width: 700px) { .tc-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 10px; } }
/* 横向きのスマホは背が低いので5列（1段がまるごと見える大きさ） */
@media (orientation: landscape) and (max-height: 520px) { .tc-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 8px; } }

/* ---------- 大きな舞台（キャラ詳細の上の立ち絵・ガチャの看板）。部品は cards.js の stage() ----------
   2026-09-30 社長「選択した時の上に出るキャラ画像もカード状の柄のまま豪華な状態にして」
   札と同じ柄（レアの class は .tc-ssr などをそのまま使う）を大きく敷く。比率は親が決めるので .tc は付けない（既定の変数だけここへ写す） */
/* 既定の変数は :where()（強さ 0）に置く。ふつうに書くと、ファイルの後ろにあるぶんレアの class（.tc-ssr の金の枠など）に勝ってしまい、どのレアも灰色の枠になった */
:where(.tc-stage) {
  --tc-c: var(--rar-base);
  --tc-bgi: url(/img/cards/bg_n.webp);
  --tc-bgc: #15131c;
  --tc-bgo: rgba(0, 0, 0, 0);
  --tc-fr: linear-gradient(150deg, #6a6f7e 0%, #33363f 18%, #8a8f9c 34%, #2a2c33 52%, #585d6b 70%, #202228 86%, #737887 100%);
  --tc-line: var(--tc-c);
  --tc-tagc: #fff;
  --tc-glow: 0 0 0 transparent;
}
.tc-stage {
  position: relative; overflow: hidden; isolation: isolate; box-sizing: border-box;
  container-type: inline-size;
  border-radius: 14px; background: var(--tc-bgc);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.75), var(--tc-glow), 0 6px 18px rgba(0, 0, 0, 0.55);
}
/* 枠は札より細く（大きな面では 5cqi が太すぎる）。レアの class の指定に勝つよう [class] を足す */
.tc-stage[class] { --tc-bw: 8px; }
.tc-stage.tc-ssr[class], .tc-stage.tc-ur[class], .tc-stage.tc-char[class], .tc-stage.tc-secret[class] { --tc-bw: 10px; }
.tc-stage > span { position: absolute; pointer-events: none; }
/* 絵は後ろの層（absolute）より上に描く。static のままだと層の下に隠れる */
.tc-stage > img { position: relative; }
.tc-stage > .tc-frame::before { border-radius: 8px; }
/* 足元の光（レアの色） */
.tc-stage > .tc-floor {
  left: 0; right: 0; bottom: 0; height: 40%; opacity: 0.55; mix-blend-mode: screen;
  background: radial-gradient(56% 92% at 50% 100%, var(--tc-c), rgba(0, 0, 0, 0) 72%);
}
.tc-stage.tc-base > .tc-floor, .tc-stage.tc-n > .tc-floor { background: radial-gradient(56% 92% at 50% 100%, var(--tc-cc, var(--tc-c)), rgba(0, 0, 0, 0) 72%); opacity: 0.4; }
/* 角の飾りは SSR から上だけ */
.tc-stage:not(.tc-ssr):not(.tc-ur):not(.tc-char):not(.tc-secret) > .tc-crn { display: none; }
.tc-stage > .tc-crn i { width: 56px; height: 56px; }
.tc-stage > .tc-tag { left: 16px; top: 16px; font-size: 17px; padding: 1px 0.6em; }
/* 粒は面が広いぶん細かく敷く（高さは 50% を割り切る数。半分ずらしても継ぎ目が出ない） */
.tc-stage > .tc-fx::after { background-size: 12.5% 6.25%, 16.667% 8.333%; }
.tc-stage.tc-ur > .tc-fx::after, .tc-stage.tc-char > .tc-fx::after { background-size: 12.5% 6.25%, 16.667% 8.333%, 10% 5%; }
.tc-stage > .tc-fx::before { top: 42%; width: 170%; }
@media (prefers-reduced-motion: reduce) {
  .tc-stage > span, .tc-stage > span *, .tc-stage > span::before, .tc-stage > span::after, .tc-stage > span *::before, .tc-stage > span *::after { animation: none !important; }
}
