/* Page layouts: 開卡包, 收藏冊, 玩家頁, 玩家列表 — plus shared page bits. */
@keyframes pillIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h2 { margin: 0; font-size: 22px; }
.page-sub { color: var(--muted); font-weight: 700; }
.loading { color: var(--dim); padding: 40px; text-align: center; font-weight: 600; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state .es-ico { font-size: 54px; margin-bottom: 8px; }
.empty-state h3 { color: #fff; margin: 0 0 6px; }
.empty-state .btn { display: inline-block; margin-top: 12px; }
.alb-empty { grid-column: 1 / -1; text-align: center; color: var(--dim); padding: 30px; font-weight: 600; }
.bar-track { height: 8px; background: var(--bg); border-radius: 999px; overflow: hidden; margin-bottom: 10px; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), #22d3ee); border-radius: 999px; transition: width .4s; }
a.btn { display: block; text-align: center; }

/* ---------- 開卡包 ---------- */
.page-packs .game-stage { justify-content: flex-start; }
.daily-box { margin-bottom: 14px; }
.daily-ready { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: color-mix(in srgb, var(--green) 14%, var(--bg)); border: 1px solid color-mix(in srgb, var(--green) 45%, transparent); border-radius: 8px; padding: 10px 12px; font-weight: 700; }
.daily-done { background: var(--bg); border-radius: 8px; padding: 10px 12px; color: var(--muted); font-size: 13px; font-weight: 600; }
.pk-kinds { display: grid; gap: 6px; }
.pk-kind { text-align: left; border: 2px solid transparent; border-radius: 10px; padding: 10px 12px 10px 50px; position: relative; background: var(--bg); color: #fff; transition: border-color .15s, background .15s; }
.pk-kind::before { content: ""; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 26px; height: 36px; border-radius: 5px; background: linear-gradient(135deg, var(--f1), var(--f2)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.25), 0 4px 10px rgba(0,0,0,.3); }
.pk-kind > b { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.pk-kind small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin-top: 2px; }
.pk-kind:hover { background: var(--panel-2); }
.pk-kind.active { border-color: var(--f1); background: color-mix(in srgb, var(--f1) 16%, var(--bg)); }
.pk-afford { text-align: center; color: var(--dim); font-size: 12px; font-weight: 600; margin-top: 8px; }
.daily-btn { min-width: 96px; font-variant-numeric: tabular-nums; }
.daily-btn:disabled { opacity: 1; background: var(--panel-2); color: var(--muted); cursor: default; }

/* ---------- 收藏冊 ---------- */
.page-album { background: var(--panel); border-radius: 10px; padding: 18px 20px; }
.alb-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 12px; }
.alb-sum div { background: var(--bg); border-radius: 6px; padding: 8px 10px; font-size: 12px; font-weight: 700; border-left: 3px solid var(--rc); }
.alb-sum b { color: #fff; float: right; font-variant-numeric: tabular-nums; }
.alb-sum .bar, .pf-tiers .bar { height: 4px; background: var(--panel-2); border-radius: 999px; margin-top: 6px; overflow: hidden; clear: both; }
.alb-sum .bar i, .pf-tiers .bar i { display: block; height: 100%; background: var(--rc); }
.alb-tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.alb-tabs button { border: 0; background: var(--bg); color: var(--muted); font-weight: 700; font-size: 12px; padding: 6px 10px; border-radius: 999px; }
.alb-tabs button.active { background: var(--panel-2); color: #fff; box-shadow: inset 0 0 0 1px var(--rc, var(--line-2)); }
.alb-tools { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.alb-tools .input { flex: 1; min-width: 180px; }
.alb-tools label { display: flex; gap: 6px; align-items: center; cursor: pointer; font-weight: 700; font-size: 13px; color: var(--muted); }
.alb-hint { color: var(--dim); font-size: 12px; flex: 1; }
.alb-banner { background: color-mix(in srgb, var(--yellow) 14%, var(--bg)); border: 1px solid color-mix(in srgb, var(--yellow) 45%, transparent); color: #fde68a; border-radius: 6px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; font-weight: 600; }
.alb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; padding: 4px 2px 8px; }
.alb-card { position: relative; aspect-ratio: 124 / 182; --art: 44px; }
.alb-card .cnt { position: absolute; bottom: -6px; right: -4px; background: var(--bg-deep); border: 1px solid var(--line); color: #fff; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; z-index: 1; }
.alb-card .cnt.dup { background: var(--yellow); border-color: var(--yellow); color: #05080a; }
.alb-card .artc { position: absolute; bottom: -6px; left: -4px; background: var(--bg-deep); border: 1px solid var(--line); color: var(--muted); font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 999px; z-index: 1; }
.alb-card .artc.full { color: #05080a; background: linear-gradient(90deg, #ffb020, #fff35c); border-color: #ffd34d; }
.bulk-rows { display: grid; gap: 6px; margin-bottom: 14px; }
.bulk-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; background: var(--bg); border-left: 3px solid var(--rc); border-radius: 6px; padding: 9px 12px; cursor: pointer; font-weight: 700; }
.bulk-row .bn { color: var(--rc); }
.bulk-row b { color: #fff; font-variant-numeric: tabular-nums; min-width: 90px; text-align: right; }
.bulk-row.off { opacity: .45; cursor: default; }
.alb-lock { position: absolute; inset: 0; border-radius: 10px; background: var(--bg); box-shadow: inset 0 0 0 2px var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--dim); font-weight: 800; font-size: 11px; }
.alb-lock span { font-size: 28px; font-weight: 900; color: var(--line-2); }
.alb-card.own { cursor: pointer; transition: transform .15s; }
.alb-card.own:hover { transform: translateY(-3px); }
.alb-card.shown { box-shadow: 0 0 0 3px var(--yellow); border-radius: 10px; }
.alb-card.shown::before { content: '🏅'; position: absolute; top: -8px; left: -6px; z-index: 2; font-size: 16px; }
.alb-more { grid-column: 1 / -1; }

/* ---------- 卡牌資訊 ---------- */
.cd-wrap { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; justify-content: center; }
.cd-card { position: relative; width: 220px; height: 323px; --art: 116px; flex-shrink: 0; filter: drop-shadow(0 12px 28px rgba(0,0,0,.5)); animation: cdIn .45s cubic-bezier(.3,1.4,.5,1); }
.cd-side { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cd-card { --cw: 220px; cursor: pointer; user-select: none; -webkit-user-select: none; }
.cd-flip { position: absolute; inset: 0; transition: transform .18s ease-in-out; }
.cd-flip.turning { transform: scaleX(0); }
.cd-front, .cd-backside { position: absolute; inset: 0; }
.cd-front[hidden], .cd-backside[hidden] { display: none; }
.cd-flip-hint { font-size: 12px; font-weight: 700; color: var(--dim); }
.cd-locked { background: var(--bg); border: 1px dashed var(--line-2); border-radius: 8px; padding: 14px; color: #fff; font-weight: 800; font-size: 14px; text-align: center; margin: 10px 0; }
.cd-locked small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; margin-top: 6px; }
.cd-card .pc-name { font-size: 16px; } .cd-card .pc-mult { font-size: 26px; } .cd-card .pc-top { font-size: 11px; }
@keyframes cdIn { from { transform: rotateY(90deg) scale(.8); } }
.cd-info { flex: 1; min-width: 220px; }
.cd-info h3 { margin: 0 0 4px; color: #fff; font-size: 20px; }
.cd-var { display: inline-block; margin-left: 8px; font-size: 12px; font-weight: 700; color: var(--muted); }
.cd-arts { margin: 12px 0 4px; }
.cd-tag { display: inline-block; font-weight: 800; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--rc) 25%, transparent); color: var(--rc); margin-bottom: 14px; }
.cd-lore { color: var(--muted); font-size: 14px; line-height: 1.7; background: var(--bg); border-left: 3px solid var(--rc); border-radius: 6px; padding: 12px 14px; margin-bottom: 14px; }
.cd-lore p { margin: 0 0 6px; } .cd-lore p:last-child { margin-bottom: 0; }
.cd-lore p.lead { color: #fff; font-size: 15px; font-weight: 600; }
.cd-quirk { font-size: 13px; color: #e2e8f0; background: color-mix(in srgb, var(--rc) 12%, var(--bg)); border-radius: 6px; padding: 8px 12px; margin: -6px 0 14px; }
.cd-block { background: var(--bg); border: 1px dashed color-mix(in srgb, var(--rc) 55%, var(--line)); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; line-height: 1.75; color: #dbe3ee; }
.cd-block .cd-bt { font-weight: 800; color: var(--rc); margin-bottom: 4px; font-size: 13px; letter-spacing: .5px; }
.cd-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.cd-stats div { background: var(--bg); border-radius: 6px; padding: 8px 10px; font-size: 12px; }
.cd-stats b { display: block; color: #fff; font-size: 15px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cd-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cd-stats b small { color: var(--yellow); font-size: 12px; margin-left: 4px; }
.cd-trade { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.cd-trade-note { color: var(--dim); font-size: 12px; line-height: 1.6; }
.cd-recycle-all { margin-top: 8px; }
.cd-list-form { margin-top: 10px; }
.cd-list-form .ig-btn.btn-green { background: var(--green); color: #05080a; }

/* ---------- 拍賣市場 ---------- */
.page-market { position: relative; }
.mk-tabs { margin: 0; }
.mk-tabs button { padding: 7px 16px; white-space: nowrap; }
.mk-note { background: var(--panel); border-left: 4px solid var(--yellow); border-radius: 8px; padding: 12px 16px; color: var(--muted); margin-bottom: 14px; line-height: 1.7; }
.mk-note b { color: #fff; }
.mk-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.mk-tools .input { flex: 1; min-width: 180px; }
.mk-tools .select { min-width: 140px; }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.mk-item { display: flex; gap: 12px; background: var(--panel); border-radius: 10px; padding: 12px; border-top: 3px solid var(--rc); }
/* the same card face as the album (same proportions, number, rarity and name) */
.mk-card { position: relative; width: 124px; flex-shrink: 0; aspect-ratio: 124 / 182; --art: 50px; cursor: pointer; transition: transform .15s; }
.mk-card:hover { transform: translateY(-3px); }
.mk-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mk-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mk-rarity { color: var(--rc); font-size: 12px; font-weight: 700; }
.mk-seller { color: var(--dim); font-size: 12px; font-weight: 600; }
.mk-seller em { color: var(--green); font-style: normal; }
.mk-price { font-size: 20px; font-weight: 900; color: var(--yellow); margin: auto 0 4px; font-variant-numeric: tabular-nums; }
.pl-search { margin-bottom: 12px; }
.pl-search .input { width: 100%; }

/* ---------- 玩家頁 ---------- */
.page-profile { display: flex; flex-direction: column; gap: 16px; }
.pf-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; border-radius: 12px; padding: 22px 24px;
  background: radial-gradient(circle at 90% 20%, rgba(34,211,238,.18), transparent 45%), radial-gradient(circle at 70% 100%, rgba(99,102,241,.22), transparent 50%), var(--panel); }
.pf-avatar { width: 84px; height: 84px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: 50px; box-shadow: 0 0 0 3px var(--line-2); flex-shrink: 0; }
.pf-id { flex: 1; min-width: 200px; }
.pf-id h2 { margin: 0 0 4px; display: flex; align-items: center; gap: 6px; font-size: 24px; }
.pf-name-input { max-width: 240px; font-size: 18px; }
.pf-meta { color: var(--muted); font-weight: 600; font-size: 13px; }
.pf-tip { margin-top: 10px; color: var(--dim); font-size: 12px; line-height: 1.6; max-width: 520px; }
.pf-numbers { display: flex; gap: 22px; }
.pf-numbers div { color: var(--muted); font-size: 12px; font-weight: 600; }
.pf-numbers b { display: block; color: #fff; font-size: 20px; margin-top: 2px; }
.pf-numbers small { color: var(--dim); font-size: 13px; }
.pf-section { background: var(--panel); border-radius: 10px; padding: 16px 20px 18px; }
.pf-sec-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.pf-sec-head h3 { margin: 0; font-size: 16px; }
.pf-sec-head .sub { color: var(--dim); font-size: 12px; }
.pf-tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.pf-tiers div { background: var(--bg); border-radius: 6px; padding: 8px 10px; font-size: 12px; font-weight: 700; border-left: 3px solid var(--rc); color: var(--rc); }
.pf-tiers b { float: right; color: #fff; font-variant-numeric: tabular-nums; }
.pf-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.pf-stats div { background: var(--bg); border-radius: 6px; padding: 10px 12px; color: var(--muted); font-size: 12px; font-weight: 600; }
.pf-stats b { display: block; color: #fff; font-size: 17px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.pf-stats b.pos { color: var(--green); } .pf-stats b.neg { color: var(--red); }

/* ---------- 玩家列表 ---------- */
.pl-sort { margin: 0; }
.pl-sort button { padding: 7px 14px; font-size: 13px; white-space: nowrap; }
.pl-note { background: var(--panel); border-left: 4px solid #22d3ee; border-radius: 8px; padding: 12px 16px; color: var(--muted); margin-bottom: 14px; line-height: 1.6; }
.pl-note b { color: #fff; }
.pl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.pl-card { display: block; background: var(--panel); border-radius: 10px; padding: 14px 16px; transition: transform .15s, box-shadow .15s; }
.pl-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.pl-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.pl-head b { display: block; font-size: 15px; }
.pl-head small { color: var(--muted); font-weight: 600; }
.pl-avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--bg); display: grid; place-items: center; font-size: 28px; flex-shrink: 0; }
.pl-you { font-size: 11px; background: var(--green); color: #05080a; border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: middle; }

@media (max-width: 800px) {
  .page-album { padding: 14px 12px; }
  .alb-sum, .pf-tiers { grid-template-columns: repeat(2, 1fr); }
  .alb-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
  .alb-card { --art: 34px; }
  .mk-grid { grid-template-columns: 1fr; }
  .mk-card { width: 96px; --art: 38px; }
  .mk-card .pc-name { font-size: 9px; } .mk-card .pc-mult { font-size: 13px; }
  .pf-stats { grid-template-columns: repeat(2, 1fr); }
  .pf-numbers { width: 100%; }
  .pl-list { grid-template-columns: 1fr; }
}

/* ---------- 收藏 (sets) ---------- */
.nav-item { position: relative; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--green); color: #05290c; font-size: 11px; font-weight: 900; display: inline-grid; place-items: center; }
.st-intro { color: var(--muted); font-size: 13px; line-height: 1.6; margin: -6px 0 12px; }
.st-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: color-mix(in srgb, var(--green) 12%, var(--panel)); border: 1px solid color-mix(in srgb, var(--green) 45%, transparent); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; font-weight: 700; }
.st-banner b { color: #fff; }
.st-banner[hidden] { display: none; }
.st-badge { font-style: normal; background: var(--green); color: #05290c; border-radius: 999px; padding: 0 6px; margin-left: 4px; font-size: 11px; }
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.st-card { background: var(--panel); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; border: 1px solid var(--line); transition: transform .15s, border-color .15s; }
.st-card:hover { transform: translateY(-2px); border-color: var(--line-2); }
.st-card.st-ready { border-color: color-mix(in srgb, var(--green) 70%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 35%, transparent), 0 0 18px color-mix(in srgb, var(--green) 18%, transparent); }
.st-card.st-claimed { opacity: .72; }
.st-head { display: flex; gap: 12px; align-items: center; }
.st-icon { font-size: 30px; width: 46px; height: 46px; display: grid; place-items: center; background: var(--bg); border-radius: 10px; flex-shrink: 0; }
.st-head b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-head > div { min-width: 0; }
.st-head b + small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 12.5px; font-weight: 500; line-height: 1.55; height: 3.1em; }
/* every set card has the same height: two rows of chips, the rest folded into a +N tag (see fitChips in pages/sets.js) */
.st-chips { display: flex; flex-wrap: wrap; gap: 4px; height: 60px; overflow: hidden; align-content: flex-start; position: relative; }
.st-chip.st-more { width: auto; min-width: 28px; padding: 0 6px; font-size: 12px; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-2); }
.st-chip { width: 28px; height: 28px; display: grid; place-items: center; font-size: 13px; font-weight: 900; color: var(--line-2); border-radius: 7px; background: var(--bg); box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--rc) 60%, transparent); }
.st-chip.own { font-size: 17px; box-shadow: inset 0 -2px 0 var(--rc), inset 0 0 0 1px color-mix(in srgb, var(--rc) 40%, transparent); }
.st-bar { height: 6px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.st-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #22d3ee); border-radius: 999px; transition: width .4s; }
.st-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.st-count { font-weight: 800; font-variant-numeric: tabular-nums; }
.st-reward { color: var(--yellow); font-weight: 800; font-size: 13px; }
.st-done { color: var(--green); font-weight: 800; font-size: 13px; }
.st-desc { margin: 0 0 14px; padding: 2px 0 2px 12px; border-left: 3px solid var(--line-2); color: var(--muted); font-size: 14px; line-height: 1.65; }
.st-desc p { margin: 0; } .st-desc p + p { margin-top: 4px; }
.st-dhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; font-weight: 700; }
.st-dhead b { color: #fff; }
.st-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-top: 14px; }
.st-dcard { position: relative; aspect-ratio: 124 / 182; --art: 40px; }
.st-dcard.own { cursor: pointer; transition: transform .15s; }
.st-dcard.own:hover { transform: translateY(-3px); }
.st-missing { position: absolute; inset: 0; border-radius: 10px; background: var(--bg); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--rc) 45%, var(--line)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px; text-align: center; }
.st-missing span { font-size: 30px; font-weight: 900; color: var(--line-2); }
.st-missing b { font-size: 11px; color: var(--muted); }
.st-missing small { font-size: 10px; color: var(--rc); font-weight: 800; }
.st-hint { color: var(--dim); font-size: 12px; margin: 12px 0 0; }
@media (max-width: 800px) { .st-grid { grid-template-columns: 1fr; } .st-cards { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); } .st-dcard { --art: 32px; } }
/* 收藏等級 (SET_TIERS in data/sets.js): pill next to the name, a tier-coloured edge, a filter row with progress per tier */
.st-tiers { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.st-tiers button { background: var(--panel); border: 1px solid color-mix(in srgb, var(--tc) 35%, var(--line)); color: var(--tc); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 800; }
.st-tiers button b { color: var(--muted); font-weight: 700; margin-left: 2px; font-variant-numeric: tabular-nums; }
.st-tiers button:hover { background: color-mix(in srgb, var(--tc) 10%, var(--panel)); }
.st-tiers button.active { background: color-mix(in srgb, var(--tc) 22%, var(--panel)); border-color: var(--tc); }
.st-tiers button.full b { color: var(--green); }
.st-tier { display: inline-block; vertical-align: 2px; margin-left: 4px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 800; line-height: 18px; white-space: nowrap;
  color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 45%, transparent); }
.st-card { border: 3px solid color-mix(in srgb, var(--tc) 85%, transparent); background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 10%, var(--panel)), var(--panel) 45%); }
.st-card:hover { border-color: var(--tc); }
.st-card.st-t-gold { box-shadow: 0 0 14px color-mix(in srgb, var(--tc) 22%, transparent); }
.st-card.st-t-platinum { box-shadow: 0 0 18px color-mix(in srgb, var(--tc) 30%, transparent); }
/* claimable: the tier border stays, a green ring goes around it */
.st-card.st-ready { border-color: color-mix(in srgb, var(--tc) 85%, transparent); box-shadow: 0 0 0 2px var(--green), 0 0 20px color-mix(in srgb, var(--green) 30%, transparent); }
.st-card.st-t-diamond { border-color: transparent; box-shadow: 0 0 22px color-mix(in srgb, var(--tc) 35%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--tc) 12%, var(--panel)), var(--panel) 45%) padding-box, linear-gradient(120deg, #b98cff, #5fe3d3, #ffc94a, #b98cff) border-box;
  background-size: 100% 100%, 300% 300%; animation: stDiamond 6s linear infinite; }
.st-card.st-t-diamond:hover, .st-card.st-t-diamond.st-ready { border-color: transparent; }
.st-card.st-t-diamond.st-ready { box-shadow: 0 0 0 2px var(--green), 0 0 22px color-mix(in srgb, var(--tc) 35%, transparent); }
@keyframes stDiamond { to { background-position: 0 0, 300% 0; } }
@media (prefers-reduced-motion: reduce) { .st-card.st-t-diamond { animation: none; } }

/* ---------- 卡面圖鑑 (pages/gallery.js) ---------- */
.gl-intro { margin: -6px 0 0; color: var(--muted); max-width: 70ch; line-height: 1.6; }
.gl-try { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; color: var(--muted); font-size: 13px; }
.gl-try button { font-size: 18px; line-height: 1; padding: 6px 8px; border: 0; border-radius: 8px; background: var(--panel); }
.gl-try .gl-reset { font-size: 13px; }
.gl-try button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--yellow); }
.gl-jump { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.gl-jump button { border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); }
.gl-jump button:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--c, var(--muted)); }
.gl-jump i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }
.gl-tier { padding-top: 30px; scroll-margin-top: 70px; }
.gl-tier header { border-left: 3px solid var(--c); padding-left: 12px; margin-bottom: 16px; }
.gl-tier h3 { margin: 0; font-size: 20px; color: var(--c); display: flex; align-items: center; gap: 10px; }
.gl-tier h3 i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 12px var(--c); }
.gl-meta { margin: 2px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.gl-note { margin: 4px 0 0; color: var(--dim); font-size: 13px; max-width: 70ch; line-height: 1.6; }
.gl-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 18px; }
.gl-item { margin: 0; min-width: 0; }
.gl-card { position: relative; width: 150px; height: 220px; margin: 0 auto 10px; --art: 62px; }
.gl-card .pk-back { position: absolute; inset: 0; }
.gl-item figcaption { text-align: center; display: grid; gap: 2px; }
.gl-item figcaption b { font-size: 14px; }
.gl-item figcaption span { color: var(--dim); font-size: 12px; line-height: 1.5; }
.gl-sub { margin: 22px 0 12px; font-size: 13px; font-weight: 700; color: var(--c); letter-spacing: .5px; }
.gl-new figcaption b::after { content: "候選"; margin-left: 6px; font-size: 11px; color: var(--c); box-shadow: inset 0 0 0 1px var(--c); padding: 0 6px; border-radius: 999px; vertical-align: 1px; }
.gl-old figcaption b::after { content: "未採用"; margin-left: 6px; font-size: 11px; color: var(--dim); box-shadow: inset 0 0 0 1px var(--line); padding: 0 6px; border-radius: 999px; vertical-align: 1px; }
@media (max-width: 480px) { .gl-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 10px; } .gl-card { width: 132px; height: 194px; --art: 54px; } }

/* ---------- profile: avatar, title, bio, follows, privacy, showcase editing ---------- */
.pf-avatar { position: relative; }
.pf-avatar.mine { cursor: pointer; }
.pf-avatar.mine i { position: absolute; bottom: -4px; left: 50%; translate: -50% 0; font-style: normal; font-size: 10px; font-weight: 800; background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 1px 8px; opacity: 0; transition: opacity .15s; }
.pf-avatar.mine:hover i { opacity: 1; }
.pf-title { display: inline-block; font-size: 12px; font-weight: 800; color: var(--tc); background: color-mix(in srgb, var(--tc) 14%, transparent); border: 1px solid color-mix(in srgb, var(--tc) 40%, transparent); border-radius: 999px; padding: 2px 10px; margin-bottom: 6px; }
.pf-bio { color: #e2e8f0; font-size: 14px; margin: 2px 0 6px; line-height: 1.5; }
.pf-bio.empty { color: var(--dim); }
.pf-bio[data-bio] { cursor: pointer; border-radius: 6px; }
.pf-bio[data-bio]:hover { background: var(--panel-2); }
.pf-bio-edit { display: flex; gap: 6px; margin: 2px 0 6px; max-width: 460px; }
.pf-bio-edit .input { flex: 1; }
.pf-privacy { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--muted); }
.pf-privacy .sub { color: var(--dim); font-size: 12px; font-weight: 600; }
.pf-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.pf-actions .liked { border-color: color-mix(in srgb, var(--yellow) 60%, transparent); color: var(--yellow); }
.pf-follows-me, .pl-rel { font-size: 12px; font-weight: 800; color: var(--muted); background: var(--panel-2); border-radius: 999px; padding: 2px 9px; }
.pf-following, .pl-following { color: var(--green); }
.pf-locked { color: var(--dim); font-weight: 700; font-size: 13px; }
.sc-edit-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; font-size: 13px; font-weight: 700; color: var(--muted); }
.sc-edit-bar label { display: flex; align-items: center; gap: 8px; }
.sc-edit-bar .input { width: 220px; }
.sc-edit-bar .sub { color: var(--dim); font-size: 12px; font-weight: 600; }
.sc-row.editing .sc-slot.empty { cursor: pointer; border-color: var(--green); color: var(--green); }
.sc-tools { position: absolute; left: 4px; right: 4px; bottom: -26px; z-index: 3; display: flex; justify-content: center; gap: 3px; }
.sc-tools button { border: 1px solid var(--line-2); background: var(--panel-2); color: #fff; border-radius: 6px; font-size: 11px; padding: 3px 6px; cursor: pointer; }
.sc-tools button:hover:not(:disabled) { border-color: var(--green); }
.sc-tools button:disabled { opacity: .35; cursor: default; }
.sc-row.editing { margin-bottom: 30px; }
.pf-highlights { grid-template-columns: repeat(6, 1fr); max-width: 800px; }
.pf-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-badge { font: inherit; cursor: pointer; background: var(--bg); border: 1px solid color-mix(in srgb, var(--green) 40%, var(--line)); border-radius: 999px; padding: 4px 11px; font-size: 13px; font-weight: 700; color: #fff; text-decoration: none; }
.pf-badge:hover { border-color: var(--green); }

/* ---------- card picker ---------- */
.cpk-hint { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.cpk-tools { margin-bottom: 10px; }
.cpk-tools .input { width: 100%; }
.cpk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; max-height: 60vh; overflow-y: auto; padding: 4px 2px; }
.cpk-card { position: relative; aspect-ratio: 124 / 182; --art: 38px; cursor: pointer; transition: transform .15s; }
.cpk-card:hover { transform: translateY(-3px); }
.cpk-arts-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; font-weight: 700; color: var(--muted); }
.cpk-arts-head b { color: #fff; }
.cpk-art-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.cpk-art { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; }
.cpk-art .cpk-card { margin-bottom: 6px; --art: 46px; }

/* ---------- players: follows ---------- */
.pl-tabs { margin: 0; }
.pl-tabs button { padding: 7px 16px; white-space: nowrap; }
.pl-search { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pl-search .input { flex: 1; min-width: 220px; width: auto; }
.pl-card:hover { transform: none; box-shadow: none; }
.pl-head { color: inherit; text-decoration: none; }
.pl-head small { display: block; }
.pl-bio { color: #cbd5e1 !important; margin-top: 2px; }
.pl-acts { display: flex; align-items: center; gap: 6px; margin: -4px 0 10px; min-height: 28px; }
.pl-likes { margin-left: auto; color: var(--dim); font-size: 12px; font-weight: 700; }
.pl-sub { grid-column: 1 / -1; margin: 6px 0 -4px; font-size: 14px; color: var(--muted); }
.pl-card .sc-mini { color: inherit; text-decoration: none; }
@media (max-width: 800px) { .pf-highlights { grid-template-columns: repeat(3, 1fr); } .sc-edit-bar .input { width: 100%; } }

/* another player's completed 收藏 (looks only) */
.pf-set-desc { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.pf-set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; max-height: 64vh; overflow-y: auto; padding: 4px 2px; }
.pf-set-card { position: relative; aspect-ratio: 124 / 182; --art: 40px; cursor: pointer; transition: transform .15s; }
.pf-set-card:hover { transform: translateY(-3px); }

/* card detail: actions sit under the card; long text scrolls inside its own column */
.cd-side { width: 240px; }
.cd-side .cd-actions, .cd-side .cd-trade { width: 100%; }
.cd-side .cd-actions { gap: 6px; }
.cd-side .cd-actions .btn { padding-left: 4px; padding-right: 4px; white-space: nowrap; }
.cd-side .cd-trade { margin-top: 2px; padding-top: 10px; }
@media (min-width: 760px) {
  .cd-wrap { flex-wrap: nowrap; }
  .cd-info { max-height: calc(90vh - 110px); overflow-y: auto; padding-right: 8px; }
}

/* card detail: backgrounds and 收藏 as one scrolling row each (no wrapping) */
.cd-sec-head { margin: 14px 0 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.cd-sec-head b { color: #fff; margin-left: 4px; }
.cd-arts .cd-sec-head { margin-top: 10px; }
.cd-strip { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 2px 2px 8px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent); }
.cd-strip::-webkit-scrollbar { height: 6px; }
.cd-strip::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
.cd-strip > * { flex: 0 0 auto; scroll-snap-align: start; }
.cd-strip > :last-child { margin-right: 20px; }
.cd-art { position: relative; width: 70px; padding: 4px 4px 5px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 9px; color: #fff; font: inherit; cursor: pointer; transition: border-color .15s, transform .15s; }
.cd-art:hover:not(:disabled) { border-color: var(--rc); transform: translateY(-2px); }
.cd-art.on { border-color: var(--rc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--rc) 35%, transparent); background: color-mix(in srgb, var(--rc) 14%, var(--bg)); }
.cd-art:disabled { cursor: default; }
.cd-sw { display: block; width: 60px; height: 44px; border-radius: 6px; overflow: hidden; }
.cd-sw .pc-art { display: block; width: 100%; height: 100%; margin: 0; border-radius: 6px; }
.cd-sw-lock { display: grid; place-items: center; font-size: 15px; background: repeating-linear-gradient(135deg, var(--panel-2) 0 6px, var(--panel) 6px 12px); opacity: .7; }
.cd-art em { position: absolute; top: 6px; right: 6px; z-index: 2; font-style: normal; font-size: 10px; font-weight: 800; background: rgba(0,0,0,.65); border-radius: 999px; padding: 0 5px; }
.cd-art-name { font-size: 11px; font-weight: 700; line-height: 1.2; max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-art.locked .cd-art-name { color: var(--dim); }
.cd-set { width: 150px; display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: var(--bg); border: 1.5px solid var(--line); border-radius: 9px;
  color: #fff; text-decoration: none; transition: border-color .15s, transform .15s; }
.cd-set:hover { border-color: var(--line-2); transform: translateY(-2px); }
.cd-set.done { border-color: color-mix(in srgb, var(--green) 55%, transparent); }
.cd-set-ico { font-size: 22px; line-height: 1; }
.cd-set-txt { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.cd-set-txt b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cd-set-txt small { font-size: 11px; font-weight: 700; color: var(--muted); }
.cd-set.done .cd-set-txt small { color: var(--green); }
.cd-set-txt i { display: block; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--green) var(--p), var(--line) var(--p)); }
