/* 牌桌里 v2 新增元素的样式（TABLE 流维护）。全局 token 在 styles.css。 */

/* 本关进度条的第二圈：超过目标的部分（最多到 2 倍目标，算进排名的上限） */
.progress { position: relative; }
.progress-over { position: absolute; inset: 0; border-radius: 999px; transform-origin: left; transform: scaleX(0); transition: transform 0.6s var(--ease); background: linear-gradient(90deg, #ffd36a, #ffb13b); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.5); }
.round-score .cap-tag { display: none; align-self: center; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: #ffd36a; color: #3b2600; font: 800 11px/1.2 var(--display); letter-spacing: 0.02em; }
.round-score.capped .cap-tag { display: inline-block; }
.round-score.capped .round-score-num { color: #ffd36a; }

/* 扭蛋机里"主力牌型"的升级 */
.offer-tags .main-tag { padding: 2px 8px; border-radius: 999px; background: var(--lime); color: #1d3606; font-weight: 800; font-size: 11px; }

/* ================= 构筑系统 v1（docs/deckbuilding-v1.md）：占位美术，只用形状和图标 ================= */

/* ---------- 卡牌强化：左下角一枚小章 + 牌面质感。样子按强化 id 走，字取 ENHANCEMENTS[id].mark ---------- */
.enh-mark { position: absolute; z-index: 3; left: 6%; bottom: 5%; display: grid; place-items: center; pointer-events: none; font-family: var(--num); font-weight: 900; line-height: 1; letter-spacing: -0.03em; }
.enh-mark b { font-size: max(8px, calc(var(--cw) * 0.15)); }
/* 加仓：蓝色筹码 +30 */
.enh-bonus .enh-mark { width: calc(var(--cw) * 0.42); aspect-ratio: 1; border-radius: 50%; color: #fff; transform: rotate(-10deg);
  background: radial-gradient(circle, #3f9be0 0 50%, #fff 51% 56%, transparent 57%), repeating-conic-gradient(#2a6f9c 0 20deg, #fff 20deg 30deg);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25), 0 0 0 1.5px #1e5a82; }
/* 杠杆：红色印章 +4 */
.enh-mult .enh-mark { padding: 3% 6%; min-width: calc(var(--cw) * 0.36); border: max(1.5px, calc(var(--cw) * 0.03)) solid var(--coral-2); border-radius: calc(var(--cw) * 0.07); color: var(--coral-2); background: rgba(255, 240, 234, 0.85); transform: rotate(-12deg); box-shadow: inset 0 0 0 1px rgba(217, 68, 42, 0.35); }
.enh-mult .card-front { background: linear-gradient(170deg, #fff8f3, #fbe6dc 60%, #f3d2c2); }
/* 热钱包：半透明的玻璃，斜着两道反光 */
.enh-glass .card-front, .c-art.mini-card.enh-glass { background: linear-gradient(160deg, rgba(240, 251, 255, 0.92), rgba(196, 232, 252, 0.72) 55%, rgba(226, 246, 255, 0.9)); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.95), inset 0 0 16px rgba(143, 211, 255, 0.6), 0 4px 0 rgba(0, 0, 0, 0.2), 0 10px 18px rgba(0, 0, 0, 0.3); }
.glass-glare { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(115deg, transparent 18%, rgba(255, 255, 255, 0.85) 22%, transparent 28%, transparent 56%, rgba(255, 255, 255, 0.5) 59%, transparent 64%); }
.enh-glass .enh-mark { padding: 3% 7%; border-radius: 999px; color: #1e5a82; background: rgba(255, 255, 255, 0.85); box-shadow: 0 0 0 1.5px #8fd3ff; }
/* 钢板：拉丝钢面 + 四颗铆钉 */
.enh-steel .card-front, .c-art.mini-card.enh-steel { background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.2) 0 1px, transparent 1px 3px), linear-gradient(160deg, #f0f3f6, #b9c2ca 45%, #dfe5ea 62%, #a7b1ba); }
.steel-rivets { position: absolute; inset: 0; pointer-events: none; z-index: 1; background: radial-gradient(circle at 9% 4.5%, #7d8791 0 2px, transparent 2.5px), radial-gradient(circle at 91% 4.5%, #7d8791 0 2px, transparent 2.5px), radial-gradient(circle at 9% 95.5%, #7d8791 0 2px, transparent 2.5px), radial-gradient(circle at 91% 95.5%, #7d8791 0 2px, transparent 2.5px); }
.enh-steel .enh-mark { padding: 3% 7%; border-radius: calc(var(--cw) * 0.06); color: #eef2f5; background: linear-gradient(180deg, #6b7580, #3f4851); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6), 0 2px 0 rgba(0, 0, 0, 0.25); }
/* 稳定币：金箔描边 + 一枚金币 */
.enh-gold .card-front, .c-art.mini-card.enh-gold { background: linear-gradient(170deg, #fffbe8, #fbefc4 60%, #f3dc92); box-shadow: inset 0 0 0 max(2px, calc(var(--cw) * 0.035)) #e2ac25, inset 0 0 0 max(3.5px, calc(var(--cw) * 0.06)) #fff3c4, inset 0 0 18px rgba(245, 190, 60, 0.5), 0 4px 0 rgba(0, 0, 0, 0.22), 0 10px 18px rgba(0, 0, 0, 0.35); }
.enh-gold .enh-mark { width: calc(var(--cw) * 0.38); aspect-ratio: 1; border-radius: 50%; color: #6b4700; background: radial-gradient(circle at 35% 30%, #fff6cf, #f5c542 55%, #b8860b); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25), inset 0 0 0 1.5px #fff3c4; }
.enh-gold .enh-mark b { font-size: max(7px, calc(var(--cw) * 0.13)); }
/* 跨链桥：彩虹边 + 四个花色 */
.enh-wild .card-front, .c-art.mini-card.enh-wild { border: max(2px, calc(var(--cw) * 0.04)) solid transparent; background: linear-gradient(170deg, #fffdf4, var(--paper) 60%, #efe4c6) padding-box, conic-gradient(from 200deg, #e2841a, #f5df98, #5667d8, #8a5cd8, #4a9420, #caff60, #e2841a) border-box; }
.enh-mark.wild-strip { display: flex; gap: 1px; padding: 2% 4%; border-radius: 999px; background: rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 1px rgba(16, 32, 26, 0.12); }
.wild-strip span { display: grid; color: var(--suit); }
.wild-strip .suit-icon { width: max(6px, calc(var(--cw) * 0.1)); height: max(6px, calc(var(--cw) * 0.1)); }
/* 空投：绿色小闪光，一闪一闪 */
.enh-lucky .enh-mark { width: calc(var(--cw) * 0.36); aspect-ratio: 1; border-radius: 50%; color: #fff; background: radial-gradient(circle at 35% 30%, #b8f7cf, #3fbf6f 60%, #237a45); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.22), 0 0 10px rgba(90, 210, 138, 0.6); animation: twinkle 2.2s ease-in-out infinite; }
.enh-lucky .card-front { background: radial-gradient(circle at 20% 88%, rgba(90, 210, 138, 0.28), transparent 42%), linear-gradient(170deg, #fffdf4, var(--paper) 60%, #efe4c6); }
@keyframes twinkle { 0%, 100% { transform: rotate(0deg) scale(1); } 50% { transform: rotate(18deg) scale(1.12); } }
/* 矿机：灰色石头，没有点数花色，只有 +50 */
.enh-stone .card-front, .c-art.mini-card.enh-stone { color: #f2f4f5; background: radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.32) 0 7%, transparent 8%), radial-gradient(circle at 72% 58%, rgba(0, 0, 0, 0.13) 0 11%, transparent 12%), radial-gradient(circle at 38% 78%, rgba(0, 0, 0, 0.1) 0 8%, transparent 9%), radial-gradient(circle at 80% 18%, rgba(0, 0, 0, 0.09) 0 6%, transparent 7%), linear-gradient(160deg, #b1b5b8, #80868b 55%, #9ca2a6); }
.stone-art { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8%; }
.stone-rig { display: flex; gap: 6%; width: 58%; justify-content: center; }
.stone-rig i { flex: 1; aspect-ratio: 0.7; border-radius: 18%; background: radial-gradient(circle at 50% 42%, #5b6167 0 22%, #d7dbde 23% 30%, #5b6167 31%); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.35), 0 2px 0 rgba(0, 0, 0, 0.3); }
.stone-art b, .mini-stone { font-family: var(--num); font-weight: 900; font-size: max(9px, calc(var(--cw) * 0.24)); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); }
.card.enh-stone .card-shine { mix-blend-mode: overlay; }

/* 计分演出 */
.card.held-pulse .card-inner { animation: heldpulse 0.6s var(--spring); }
@keyframes heldpulse { 0% { scale: 1; } 35% { scale: 1.16; filter: drop-shadow(0 0 12px #cfe3ff); } 100% { scale: 1; } }
.card.glass-flash .card-front { box-shadow: 0 0 0 3px #bfe6ff, 0 0 26px rgba(143, 211, 255, 0.85), 0 10px 18px rgba(0, 0, 0, 0.35); }
.card.shatter .card-inner { animation: shatter 0.55s ease-in forwards; }
.card.shatter .card-front::after { content: ''; position: absolute; inset: 0; z-index: 5; background: linear-gradient(60deg, transparent 47%, #fff 48.5% 50.5%, transparent 52%), linear-gradient(-32deg, transparent 45%, rgba(255, 255, 255, 0.95) 46.5% 48%, transparent 49.5%), linear-gradient(100deg, transparent 58%, rgba(255, 255, 255, 0.9) 59% 60.5%, transparent 61.5%); }
@keyframes shatter { 0% { transform: none; opacity: 1; } 25% { transform: rotate(-5deg) scale(1.08); opacity: 1; } 100% { transform: translateY(46px) rotate(14deg) scale(0.55); opacity: 0; } }
.card.burning .card-inner { animation: burn 0.68s ease-in forwards; }
@keyframes burn { 0% { filter: none; } 45% { filter: sepia(1) saturate(3) hue-rotate(-18deg) brightness(1.15); transform: scale(1.05); } 100% { filter: sepia(1) brightness(0.15); transform: translateY(26px) scale(0.45); opacity: 0; } }
.card.gold-pay .card-front { box-shadow: 0 0 0 3px #ffd36a, 0 0 30px rgba(255, 211, 106, 0.9), 0 10px 18px rgba(0, 0, 0, 0.35); }
.floater.coins { background: #ffd36a; color: #3b2600; }

/* ---------- 消耗牌格（捏捏牌那排右边）和消耗牌 ---------- */
.cons-bar { margin-left: auto; display: flex; align-items: flex-end; flex: none; }
.cons-row { display: flex; gap: 8px; }
.cons, .cons-slot { width: calc(var(--jw) * 0.82); height: calc(var(--jw) * 1.36); flex: none; }
.cons-slot { border-radius: 14px; border: 2px dashed rgba(143, 211, 255, 0.2); background: rgba(143, 211, 255, 0.03); }
.cons { position: relative; cursor: pointer; border-radius: calc(var(--jw) * 0.14); outline: none; transition: transform 0.2s var(--spring); -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.cons:focus-visible { box-shadow: 0 0 0 3px var(--sky); }
.cons-inner { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; display: flex; flex-direction: column; align-items: center; padding: 0 6% 7%; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.28), 0 10px 20px rgba(0, 0, 0, 0.35); animation: jidle 4.6s ease-in-out infinite; }
.cons-top { width: 112%; margin: 0 -6%; flex: none; padding: 3px 0 2px; text-align: center; font-size: max(9px, calc(var(--jw) * 0.1)); font-weight: 900; letter-spacing: 0.06em; line-height: 1.2; white-space: nowrap; overflow: hidden; }
.cons .c-art { flex: 1 1 0; min-height: 0; width: 88%; margin-top: 9%; }
.cons-name { flex: none; margin-top: 7%; max-width: 100%; font-family: var(--display); font-weight: 800; font-size: max(10px, calc(var(--jw) * 0.13)); line-height: 1.15; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 行情卡：一块小行情屏 */
.cons.kind-planet .cons-inner { color: #eaf6ff; background: radial-gradient(rgba(202, 255, 96, 0.09) 1px, transparent 1.3px) 0 0 / 7px 7px, linear-gradient(170deg, #1b3a55, #0b1b2b); box-shadow: inset 0 0 0 2px rgba(143, 211, 255, 0.45), 0 4px 0 rgba(0, 0, 0, 0.28), 0 10px 20px rgba(0, 0, 0, 0.35); }
.cons.kind-planet .cons-top { background: var(--sky-3); color: #eaf6ff; }
.cons.kind-planet .c-art.chart { color: var(--lime); border-radius: 8px; background: rgba(0, 0, 0, 0.28); box-shadow: inset 0 0 0 1px rgba(143, 211, 255, 0.25); }
.cons.kind-planet .c-art.candles { color: #ff7a59; }
.cons.kind-planet .c-art.glyph { color: var(--gold); }
/* 操作卡：一张横线指令单 */
.cons.kind-tarot .cons-inner { color: var(--ink); background: repeating-linear-gradient(180deg, transparent 0 9px, rgba(16, 32, 26, 0.07) 9px 10px), linear-gradient(172deg, #fffcef, #efe2c0); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7), 0 4px 0 rgba(0, 0, 0, 0.28), 0 10px 20px rgba(0, 0, 0, 0.35); }
.cons.kind-tarot .cons-top { background: var(--lav-3); color: #fff; }
.cons.kind-tarot .c-art.glyph { color: var(--lav-3); }
/* 选好了手牌、这张现在能用：亮起来 */
.cons.ready { transform: translateY(-5px); }
.cons.ready .cons-inner { box-shadow: 0 0 0 3px var(--lime), 0 0 20px rgba(202, 255, 96, 0.6), 0 8px 18px rgba(0, 0, 0, 0.35); }
@media (hover: hover) and (pointer: fine) { .cons:hover { transform: translateY(-4px) scale(1.04); } }

/* 占位图：K 线、图标、小牌 */
.c-art { position: relative; display: grid; place-items: center; }
.c-art .art-svg { width: 100%; height: 100%; overflow: visible; }
.c-art.glyph b { font-family: var(--num); font-weight: 900; font-size: calc(var(--jw) * 0.3); line-height: 1; }
.c-art .art-emoji { font-size: calc(var(--jw) * 0.3); line-height: 1; }
.c-art .art-suit { width: 58%; height: 58%; color: var(--suit); }
.c-art.mini-card { --cw: calc(var(--jw) * 0.5); width: auto; aspect-ratio: 5 / 7; height: 90%; border-radius: 6px; background: linear-gradient(170deg, #fffdf4, var(--paper) 60%, #efe4c6); box-shadow: inset 0 0 0 1.5px rgba(16, 32, 26, 0.12), 0 2px 0 rgba(0, 0, 0, 0.15); overflow: hidden; }
.c-art.mini-card .enh-mark { left: 50%; bottom: 50%; transform: translate(-50%, 50%) rotate(-8deg); }
.c-art.mini-card.enh-lucky .enh-mark { animation: none; }
.c-art.mini-card .mini-stone { position: absolute; inset: 0; display: grid; place-items: center; }

/* 牌的强化说明：只看不点，不挡下面的按钮 */
.tip.passive { pointer-events: none; }
/* 提示框里的按钮 */
.tip-actions { display: flex; gap: 8px; align-items: stretch; margin-top: 8px; }
.tip-actions .sell-btn { margin-top: 0; width: auto; flex: 1; }
.tip-actions .use-btn { flex: 1.3; min-height: 40px; padding: 8px 14px; font-size: 16px; border-radius: 12px; }
.tip-actions .use-btn:disabled { filter: grayscale(0.9); opacity: 0.55; cursor: not-allowed; }
.tip-why { margin: 2px 0 0; font-size: 12px; font-weight: 800; color: var(--coral-text); }
.tip-rarity.kind-planet { background: #d8ecff; }
.tip-rarity.kind-tarot { background: #e6dcff; }
.tip-rarity.enh-tag { background: #fff3c4; }

/* ---------- 扭蛋机 v2：货架 / 主力行情 / 卡包 ---------- */
.shop-sec { margin: 4px 6px -4px; font-size: 11px; font-weight: 900; letter-spacing: 0.14em; color: var(--ink-3); }
.shop-head .deck-peek { flex: none; }
.offer.rarity-cons { --cup: var(--sky-2); --ring: rgba(74, 168, 224, 0.4); }
.offer.rarity-cons.kind-tarot { --cup: var(--lav-2); --ring: rgba(154, 134, 240, 0.45); }
.offer-medal.cons-medal { width: 78px; height: auto; border-radius: 0; background: none; box-shadow: none; display: flex; justify-content: center; }
.offer-medal.cons-medal::after { display: none; }
.offer-medal.cons-medal .cons { --jw: 64px; cursor: default; }
.offer-medal.cons-medal .cons-inner { animation: none; }
.offer-tags .cat.kind-planet { background: var(--sky-3); color: #fff; }
.offer-tags .cat.kind-tarot { background: var(--lav-3); color: #fff; }
.pack-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pack-offer { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 22px; background: #fffdf5; box-shadow: inset 0 0 0 2px rgba(16, 32, 26, 0.1), 0 4px 0 rgba(16, 32, 26, 0.08); min-width: 0; }
.pack-offer.sold { opacity: 0.45; filter: grayscale(0.8); }
.pack-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pack-info b { font-family: var(--display); font-weight: 800; font-size: 18px; color: var(--ink); }
.pack-info > span { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.pack-buy { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.pack-buy .price { display: flex; align-items: center; gap: 5px; font-family: var(--num); font-size: 20px; font-weight: 900; color: var(--ink); }

/* 卡包：锯齿封口的小袋子，四种颜色 */
.pack { --pk: #d8ccff; --pk2: #9a86f0; --pkink: #2c1d6e; position: relative; flex: none; width: 74px; height: 100px; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 0 rgba(0, 0, 0, 0.18), 0 8px 16px rgba(0, 0, 0, 0.2); }
.pack-body { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 12px 6px; background: linear-gradient(160deg, var(--pk), var(--pk2)); color: var(--pkink); }
.pack-body::before, .pack-body::after { content: ''; position: absolute; left: 0; right: 0; height: 9px; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.5) 0 2px, rgba(0, 0, 0, 0.14) 2px 4px); }
.pack-body::before { top: 0; } .pack-body::after { bottom: 0; }
.pack .c-art.pack-art { --jw: 60px; width: 72%; height: 40%; }
.pack .c-art.pack-art .art-emoji, .pack .c-art.pack-art b { font-size: 26px; }
.pack-name { font-family: var(--display); font-weight: 800; font-size: 13px; line-height: 1.1; }
.pack-size { font-size: 10px; font-weight: 800; opacity: 0.8; }
.pack-shine { position: absolute; inset: -40%; pointer-events: none; background: linear-gradient(115deg, transparent 42%, rgba(255, 255, 255, 0.55) 48%, transparent 54%); animation: sheen 4.8s ease-in-out infinite; }
.pack-planet { --pk: #1f4666; --pk2: #0b1b2b; --pkink: var(--lime); }
.pack-planet .c-art.pack-art { color: var(--lime); }
.pack-card { --pk: #2a7a5a; --pk2: #0b3326; --pkink: var(--cream); }
.pack-card .c-art.pack-art b { width: 30px; height: 40px; display: grid; place-items: center; border-radius: 5px; color: var(--eth); background: var(--paper); box-shadow: -7px 3px 0 -1px #e9dfc0, 7px 3px 0 -1px #efe4c6, 0 2px 0 rgba(0, 0, 0, 0.25); font-size: 20px; }
.pack-joker { --pk: #ffb3cf; --pk2: #ff8a5c; --pkink: #4a1a08; }
.pack.tearing { animation: tear 0.46s ease-in forwards; }
@keyframes tear { 0% { transform: none; } 20% { transform: rotate(-7deg) scale(1.08); } 40% { transform: rotate(6deg) scale(1.12); } 100% { transform: scale(1.35); opacity: 0; } }

/* 拆开的卡包：挑 1 张 */
.pack-panel .shop-head > .pack { flex: none; width: 56px; height: 76px; }
.pack-panel .shop-head > div:nth-of-type(2) { flex: 1; min-width: 0; }
.pack-panel .shop-head .pack-name, .pack-panel .shop-head .pack-size { display: none; }
.pack-panel .shop-foot { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'hint reroll'; }
.pack-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }
.pack-option { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 12px 12px; border-radius: 22px; background: #fffdf5; box-shadow: inset 0 0 0 2px rgba(16, 32, 26, 0.1), 0 4px 0 rgba(16, 32, 26, 0.08); text-align: center; }
.opt-art { height: 148px; display: grid; place-items: center; }
.opt-art .card { position: relative; --cw: 96px; transform: none !important; pointer-events: none; cursor: default; }
.opt-art .card-inner { animation: none; }
.opt-art .joker { --jw: 100px; cursor: default; }
.opt-art .cons { --jw: 102px; cursor: default; }
.opt-title { font-family: var(--display); font-weight: 800; font-size: 19px; color: var(--ink); }
.opt-sub { font-weight: 800; font-size: 12px; color: var(--lav-3); }
.opt-desc { margin: 0; flex: 1; font-size: 13px; font-weight: 700; color: var(--ink-2); }

/* ---------- 牌组视图：整副牌 + 强化图例 + 加了几张 / 少了几张 ---------- */
.deck-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.deck-stats span { padding: 3px 10px; border-radius: 999px; background: rgba(16, 32, 26, 0.07); font-weight: 800; font-size: 13px; color: var(--ink-2); }
.deck-stats .total { background: var(--ink); color: var(--gold); }
.deck-stats .plus { background: #dff5b8; color: var(--lime-text); }
.deck-stats .minus { background: #ffe0d6; color: var(--coral-text); }
.deck-row { align-items: center; }
.deck-row-label { flex: none; min-width: 42px; font-family: var(--num); font-weight: 900; font-size: 13px; color: var(--suit-ink, var(--ink-2)); text-align: right; padding-right: 4px; }
.deck-grid .card { pointer-events: auto; cursor: default; }
.enh-legend { width: 100%; display: grid; gap: 4px; text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-2); }
.enh-legend-row { display: flex; gap: 8px; align-items: baseline; }
.enh-chip { flex: none; padding: 1px 8px; border-radius: 999px; font-weight: 900; color: var(--ink); background: var(--paper-2); }
.enh-chip.enh-bonus { background: #cfe8fa; } .enh-chip.enh-mult { background: #ffd9cc; } .enh-chip.enh-glass { background: #e2f5ff; }
.enh-chip.enh-steel { background: #d5dce2; } .enh-chip.enh-gold { background: #ffe7a0; } .enh-chip.enh-wild { background: linear-gradient(90deg, #ffe1b8, #dde2ff, #e6d9ff, #d9f5c2); }
.enh-chip.enh-lucky { background: #c9f2d8; } .enh-chip.enh-stone { background: #b9bec2; color: #fff; }

/* ---------- 手机：捏捏牌那排给消耗牌让位置 ---------- */
@media (max-width: 860px) {
  .shop-sec { margin: 2px 4px -2px; }
  .pack-row { grid-template-columns: minmax(0, 1fr); }
  .pack-options { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 8px; }
  .opt-art { height: 118px; }
  .opt-art .card { --cw: 78px; }
  .opt-art .joker { --jw: 82px; }
  .opt-art .cons { --jw: 84px; }
  .offer-medal.cons-medal { width: 60px; }
  .offer-medal.cons-medal .cons { --jw: 50px; }
  .offer-medal.cons-medal .cons-top { font-size: 0; height: 4px; padding: 0; }
}
@media (max-width: 600px) and (orientation: portrait) {
  .felt { --jw: clamp(40px, min(12.6vw, 9dvh), 76px); }
  .joker-count { display: none; }
  .joker-bar { gap: 6px; }
  .cons-row { gap: 4px; }
  .cons, .cons-slot { width: calc(var(--jw) * 0.8); }
  .cons-slot { border-radius: 10px; }
  .felt .cons-top { height: 5px; padding: 0; font-size: 0; }
  .felt .cons-name { font-size: 10px; }
}
@media (max-width: 860px), (orientation: landscape) and (max-height: 500px) {
  /* 手机上集市阶段也能看牌组（牌匣、烧币之后想看一眼） */
  .table-root[data-kind='shop'] .deck-mini { display: inline-flex; }
}
@media (prefers-reduced-motion: reduce) {
  .enh-lucky .enh-mark, .pack-shine, .cons-inner { animation: none; }
}

/* ================= 万链之界（v4）：捏捏、Boss 纹章、开局三选一、卷首语（占位美术全是 src/art.js 的原创矢量图） ================= */

/* 捏捏：果冻灵体，心口的钥匙孔一明一暗；座位上 / 大厅里 / 结算页都是它 */
.portrait.nini svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.35)); }
.portrait.nini.s svg { filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35)); }
.portrait.nini .nini-glow { animation: keyglow 2.6s ease-in-out infinite; }
.portrait.nini .nini-key { animation: keyglow 2.6s ease-in-out infinite reverse; }
@keyframes keyglow { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.seat-name small.nini-perk { display: block; margin-top: 1px; font-family: var(--body); font-size: 11px; font-weight: 800; letter-spacing: 0.02em; color: #ff9a80; text-align: center; }

/* 十三魔：深色圆章里一枚原创图标；四位压花色的魔按领域上色 */
.portrait.boss-emblem .boss-medal { position: relative; z-index: 1; width: 88%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; color: #ffd6cc; background: radial-gradient(circle at 35% 28%, #6a2a4a, #2a0f1e 72%); box-shadow: inset 0 0 0 3px rgba(255, 107, 74, 0.55), inset 0 -8px 16px rgba(0, 0, 0, 0.35), 0 0 0 3px rgba(255, 255, 255, 0.12), 0 12px 20px rgba(0, 0, 0, 0.4); }
.portrait.boss-emblem.s .boss-medal { box-shadow: inset 0 0 0 2px rgba(255, 107, 74, 0.6), 0 3px 6px rgba(0, 0, 0, 0.35); }
.portrait.boss-emblem .boss-icon { width: 60%; height: 60%; overflow: visible; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.35)); }
.portrait.boss-emblem[data-boss='frost'] .boss-medal { color: #d6efff; }
.portrait.boss-emblem[data-boss='jamdragon'] .boss-medal { color: #c4cbff; }
.portrait.boss-emblem[data-boss='haltshade'] .boss-medal { color: #9ff0da; }
.portrait.boss-emblem[data-boss='abyss'] .boss-medal { color: #cdf59f; }
/* 终焉守钥者：世界尽头的石碑（中性占位），光环呼吸、钥匙孔发亮 */
.portrait.boss-emblem.keeper svg { position: relative; z-index: 1; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 12px 16px rgba(0, 0, 0, 0.45)); }
.portrait.boss-emblem.keeper .mono-aura { animation: keyglow 4s ease-in-out infinite; }
.portrait.boss-emblem.keeper .mono-key { animation: keyglow 2.2s ease-in-out infinite; }

/* 内存池集市的小图标（原来是一张扭蛋机图） */
.shop-head > .shop-machine + div { flex: 1; min-width: 0; }
.shop-head > div.shop-machine { flex: none; display: grid; place-items: center; width: 62px; height: 62px; margin: 0; border-radius: 50%; color: var(--power-3); background: radial-gradient(circle at 35% 30%, #fff, #d8efff 60%, #9fd4f5); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9), 0 4px 0 rgba(16, 32, 26, 0.12); }
.shop-head .shop-machine .icon { width: 72%; height: 72%; }

/* 开局三选一 */
.draft-panel .shop-head .portrait.s { width: 58px; height: 58px; }
.draft-hint { margin: 0; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.draft-option { gap: 5px; }
.draft-option .opt-desc { flex: none; }
.opt-lore { margin: 0 0 4px; flex: 1; font-family: var(--display); font-weight: 800; font-size: 13px; line-height: 1.35; color: var(--ink-3); }

/* 每章第一关的卷首语；过关面板上"谁被打服了" */
.epigraph { margin: -2px 0 2px; font-family: var(--display); font-weight: 800; font-size: 19px; line-height: 1.35; color: var(--ink-2); }
.clear-boss { margin: -6px 0 0; font-weight: 800; color: var(--coral-text); }

/* 牌组视图的领域标签 */
.deck-row-label { display: inline-flex; align-items: center; gap: 2px; }
.deck-row-label small { font-family: var(--num); font-weight: 900; color: var(--ink-2); }
.realm-tag { display: inline-flex; align-items: center; gap: 3px; color: var(--suit-ink, var(--suit)); font-weight: 900; white-space: nowrap; }
.realm-tag .suit-icon { width: 14px; height: 14px; color: var(--suit); }
.c-art .art-svg { overflow: visible; }

@media (max-width: 860px) {
  .opt-lore { font-size: 12px; }
  .epigraph { font-size: 16px; }
  .shop-head .shop-machine { display: none; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .epigraph { font-size: 14px; margin: 0; }
  .draft-hint { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .portrait.nini .nini-glow, .portrait.nini .nini-key, .portrait.boss-emblem.keeper .mono-aura, .portrait.boss-emblem.keeper .mono-key { animation: none; }
}

/* 真美术（插画）：Boss 头像是圆角方形的插画；集市奖章里的捏捏牌插画裁成圆形 */
.joker-art.illo { overflow: hidden; background: #0b2a1f; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85), 0 2px 0 rgba(0, 0, 0, 0.06); }
.joker-art.illo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 35%; filter: none; }

/* 有插画的捏捏牌：插画铺满整张牌（插画是 3:4 竖图，牌是 1:1.36，几乎不裁）。
   分类色条压在上沿；名字压在下沿的暗色渐变上；稀有度的材质（哑光 / 银边 / 金箔）画成最上层的边框。
   稀有度的字不写：看边框就知道，悬停提示里也有 */
.joker.illo .joker-inner { padding: 0; justify-content: flex-end; background: #0b2a1f; }
.joker.illo .joker-inner > .joker-art { position: absolute; inset: 0; width: auto; height: auto; max-width: none; max-height: none; margin: 0; border-radius: 0; aspect-ratio: auto; box-shadow: none; background: #0b2a1f; }
.joker.illo .joker-art img { object-position: 50% 40%; }
.joker.illo .joker-top { position: absolute; inset: 0 0 auto; width: auto; margin: 0; z-index: 2; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.22); }
.joker.illo .joker-inner::before { content: ''; position: absolute; inset: auto 0 0; height: 42%; z-index: 1; pointer-events: none; background: linear-gradient(to top, rgba(3, 18, 13, 0.92) 16%, rgba(3, 18, 13, 0.5) 56%, rgba(3, 18, 13, 0)); }
.joker.illo .joker-title { position: relative; z-index: 2; align-self: stretch; margin: 0 7% 8%; color: #fbf7ea; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65); }
.joker.illo .joker-owner { display: none; }
.joker.illo .joker-counter { z-index: 3; top: calc(max(10px, var(--jw) * 0.11) * 1.2 + 10px); bottom: auto; right: 7%; }
.joker-frame { position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 2px rgba(251, 247, 234, 0.8); }
.rarity-uncommon .joker-frame { box-shadow: inset 0 0 0 2.5px #c9d3dc, inset 0 0 0 4px rgba(255, 255, 255, 0.28); }
.rarity-rare .joker-frame { box-shadow: inset 0 0 0 2.5px var(--gold-2), inset 0 0 0 4.5px rgba(245, 223, 152, 0.4); }
/* 人头牌胸像（批次 C）：图已经按拱窗的比例裁好，铺满拱窗；拱窗的描边画在插画上面，名字条压在下沿 */
.face-art.illo { background: color-mix(in oklab, var(--suit) 40%, #0b2a1f); }
.face-art.illo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.face-art.illo .face-name { z-index: 1; }
.face-art.illo::after { content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--suit) 55%, #fff); }
/* 牌背插画（批次 C）：翡翠珐琅、金丝、钥匙孔；原来画在中间的圆脸标志不再画。牌堆的三层也换成同一张 */
.card-back { background: url('assets/art/cardback.webp') 50% 50% / cover no-repeat, linear-gradient(160deg, #0b4a35, #06261c); }
.card-back .back-logo { display: none; }
.deck-stack, .deck-stack::before, .deck-stack::after { background: url('assets/art/cardback.webp') 50% 50% / cover no-repeat, #0b4a35; }

/* 有插画的消耗牌（批次 D）：插画铺满，上沿色条、下沿名字；原来的小图缩成右上角的深色徽章（读牌靠它） */
.cons.illo .cons-inner { padding: 0; justify-content: flex-end; background: #0b1b2b; }
.cons.illo .cons-illo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.cons.illo .cons-inner::before { content: ''; position: absolute; inset: auto 0 0; height: 40%; z-index: 1; pointer-events: none; background: linear-gradient(to top, rgba(3, 12, 20, 0.92) 18%, rgba(3, 12, 20, 0.5) 58%, rgba(3, 12, 20, 0)); }
.cons.illo .cons-inner::after { content: ''; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none; box-shadow: inset 0 0 0 2px rgba(143, 211, 255, 0.55); }
.cons.illo.kind-tarot .cons-inner::after { box-shadow: inset 0 0 0 2px rgba(200, 184, 255, 0.75); }
.cons.illo .cons-top { position: absolute; inset: 0 0 auto; width: auto; margin: 0; z-index: 2; }
.cons.illo .cons-name { position: relative; z-index: 2; align-self: stretch; margin: 0 6% 9%; color: #fbf7ea; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); }
.cons.illo .c-art { position: absolute; z-index: 2; top: calc(max(9px, var(--jw) * 0.1) * 1.2 + 8px); right: 7%; flex: none; width: 42%; height: auto; aspect-ratio: 40 / 28; margin: 0; padding: 3%; border-radius: 7px; background: rgba(6, 14, 24, 0.74); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22); color: #fbf7ea; }
.cons.illo .c-art.chart { color: var(--lime); }
.cons.illo .c-art.candles { color: #ff7a59; }
.cons.illo .c-art.glyph b { font-size: max(9px, calc(var(--jw) * 0.15)); color: var(--gold); }
.cons.illo .c-art .art-suit { width: 78%; height: 78%; }
.cons.illo .c-art.mini-card { --cw: calc(var(--jw) * 0.3); width: auto; height: 31%; aspect-ratio: 5 / 7; padding: 0; background: linear-gradient(170deg, #fffdf4, var(--paper) 60%, #efe4c6); }
/* 有插画的卡包：插画是卡包正面的印刷图，锯齿封口压在最上面，名字压在下沿的暗色渐变上 */
.pack.illo .pack-body { justify-content: flex-end; gap: 0; padding: 0 4px 12px; background: #1b1030; }
.pack.illo .pack-illo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pack.illo .pack-scrim { position: absolute; inset: auto 0 0; height: 45%; background: linear-gradient(to top, rgba(10, 6, 20, 0.88) 25%, rgba(10, 6, 20, 0)); }
.pack.illo .pack-body::before, .pack.illo .pack-body::after { z-index: 2; }
.pack.illo :is(.pack-name, .pack-size) { position: relative; z-index: 1; color: #fbf7ea; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75); }

/* 捏捏的表情插画（批次 E）：透明底，按情绪换图。图里的表情已经带着形变（被捏是扁的、输了是瘪的），CSS 的捏、瘪只做轻一点的配合 */
.portrait.nini .nini-img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 12px 14px rgba(0, 0, 0, 0.35)); }
.portrait.nini.s .nini-img { filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35)); }
:is(.squishy-seat, .me-stage).pressed .portrait.nini.has-img { transform: scale(1.06, 0.92) translateY(4%); }
.squishy-seat.deflate .portrait.nini.has-img, .portrait.nini.has-img.deflated { transform: translateY(4%); filter: none; }

/* 集市场景图（批次 E）：集市面板上沿的横幅，比章节图矮（集市是最常待的面板，手机上别把货架往下挤太多）；
   有了它，标题旁边的小池子图标就不画了，宽度让给标题 */
.shop-panel > .chapter-art.market-art { height: clamp(78px, 15vh, 150px); }
.shop-panel > .chapter-art.market-art img { object-position: 50% 60%; }
.shop-panel:has(> .market-art) .shop-machine { display: none; }

/* 传说牌的镭射压在插画上，比纸面牌淡一点，不盖名字 */
.joker.illo.rarity-rare .joker-inner::after { opacity: 0.2; z-index: 1; }
.portrait.boss-emblem.has-img { overflow: hidden; border-radius: 22%; background: #0b2a1f; box-shadow: 0 0 0 3px rgba(251, 247, 234, 0.9), 0 10px 24px rgba(0, 0, 0, 0.45); }
.portrait.boss-emblem.has-img img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }

/* 章节主视觉：铺在面板上沿（开场面板、启程面板），底部渐隐到纸面 */
.panel > .chapter-art { position: relative; align-self: stretch; margin: calc(-1 * var(--pad-y)) calc(-1 * var(--pad-x)) 0; height: clamp(120px, 22vh, 200px); overflow: hidden; border-top-left-radius: inherit; border-top-right-radius: inherit; flex: none; }
.panel > .chapter-art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; display: block; }
.panel > .chapter-art::after { content: ''; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(to bottom, rgba(247, 240, 220, 0), var(--paper, #f7f0dc)); pointer-events: none; }
.panel > .chapter-art .chapter-art-line { position: absolute; left: 18px; bottom: 12px; z-index: 1; margin: 0; font: 800 17px/1.3 var(--display); color: #10201a; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7); }
@media (max-width: 860px) { .panel > .chapter-art { height: clamp(96px, 18vh, 150px); } .panel > .chapter-art .chapter-art-line { font-size: 15px; left: 14px; } }
