/* 一闪 CARD — 集卡游戏界面 */
:root {
  --bg: #07060f;
  --bg2: #120c26;
  --ink: #f4f1ff;
  --dim: #9a93bd;
  --line: rgba(255,255,255,.1);
  --gold: #ffd54a;
  --gold2: #ff9d2e;
  --pink: #ff4fa3;
  --cyan: #38e1ff;
  --violet: #8b5cff;
  --r-common: #9aa3b8;
  --r-rare: #3da5ff;
  --r-epic: #b86bff;
  --r-legendary: #ffc83d;
  --font-d: "Bungee", "Noto Sans SC", system-ui, sans-serif;
  --font: "Noto Sans SC", -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --cw: min(300px, 74vw);
  --ch: calc(var(--cw) * 1.42);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font); color: var(--ink); background: var(--bg);
  overflow-x: hidden; user-select: none; -webkit-user-select: none;
  background:
    radial-gradient(1200px 700px at 50% -10%, #2a1561 0%, transparent 60%),
    radial-gradient(900px 600px at 100% 100%, #4a0f55 0%, transparent 55%),
    radial-gradient(800px 600px at 0% 90%, #08334d 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
[hidden] { display: none !important; }
#stars, #fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#stars { z-index: 0; }
#fx { z-index: 60; }
.vignette { position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%); }
.flash { position: fixed; inset: 0; z-index: 70; pointer-events: none; opacity: 0; background: #fff; mix-blend-mode: screen; }
.flash.go { animation: flash .7s ease-out; }
@keyframes flash { 0% { opacity: .95 } 100% { opacity: 0 } }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
  padding: calc(env(safe-area-inset-top) + 12px) 20px 12px;
  backdrop-filter: blur(14px) saturate(1.4); background: linear-gradient(#07060fcc, #07060f00);
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.bolt { width: 26px; height: 26px; fill: var(--gold); filter: drop-shadow(0 0 8px #ffb400aa); animation: boltPulse 2.6s ease-in-out infinite; }
@keyframes boltPulse { 0%,100% { filter: drop-shadow(0 0 6px #ffb400aa) } 50% { filter: drop-shadow(0 0 16px #ffe27a) } }
.logo-cn { font-weight: 900; font-size: 22px; letter-spacing: .04em; }
.logo-en { font-family: var(--font-d); font-size: 22px; letter-spacing: .06em;
  background: linear-gradient(90deg, var(--gold), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tabs { display: flex; gap: 4px; margin: 0 auto; padding: 4px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.tab { padding: 8px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--dim); transition: all .3s var(--ease-out); }
.tab i { font-style: normal; margin-left: 4px; font-size: 11px; padding: 1px 6px; border-radius: 99px; background: rgba(255,255,255,.12); }
.tab.is-on { color: #1a1030; background: linear-gradient(135deg, var(--gold), var(--gold2)); box-shadow: 0 4px 18px #ffa6002e; }
.tab.is-on i { background: #1a103022; }
.hud { display: flex; gap: 8px; }
.chip { display: flex; align-items: center; gap: 4px; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--line); font-size: 14px; }
.chip b { font-weight: 900; font-size: 16px; color: var(--gold); }
.chip small { color: var(--dim); }
.btn-sound { width: 38px; justify-content: center; }
@media (max-width: 560px) { .logo-cn { display: none; } .tab { padding: 8px 12px; } }

main { position: relative; z-index: 5; }
.view { display: none; min-height: calc(100vh - 66px); }
.view.is-on { display: block; animation: viewIn .6s var(--ease-out); }
@keyframes viewIn { from { opacity: 0; transform: translateY(18px) } to { opacity: 1; transform: none } }

/* ---------- 舞台 ---------- */
.stage { position: relative; min-height: calc(100vh - 70px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 10px 16px 40px; overflow: hidden; }
.aura { position: absolute; width: 640px; height: 640px; max-width: 120vw; left: 50%; top: 42%; translate: -50% -50%;
  background: conic-gradient(from 0deg, #ff4fa355, #ffd54a44, #38e1ff55, #8b5cff55, #ff4fa355); filter: blur(70px); opacity: .55; border-radius: 50%;
  animation: spin 18s linear infinite; }
@keyframes spin { to { rotate: 360deg } }
.ring { position: absolute; left: 50%; top: 42%; translate: -50% -50%; border-radius: 50%; border: 1px dashed rgba(255,255,255,.16); pointer-events: none; }
.ring-a { width: 460px; height: 460px; animation: spin 40s linear infinite; }
.ring-b { width: 620px; height: 620px; border-style: solid; border-color: rgba(255,255,255,.06); animation: spin 70s linear infinite reverse; }
.ring::after { content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 14px var(--gold); }

/* ---------- 卡包 ---------- */
.pack-wrap { position: relative; perspective: 1100px; z-index: 3; margin-top: -10px; }
.pack {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  position: relative; width: 250px; height: 380px; outline: none; cursor: grab; transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  transition: transform .25s var(--ease-out);
  animation: float 4.2s ease-in-out infinite;
  filter: drop-shadow(0 30px 40px #000a) drop-shadow(0 0 40px #a35bff55);
}
.pack:active { cursor: grabbing; }
@keyframes float { 0%,100% { translate: 0 0 } 50% { translate: 0 -14px } }
.pack-top, .pack-body { position: absolute; left: 0; width: 100%; overflow: hidden; }
.pack-top { top: 0; height: 52px; z-index: 3; border-radius: 16px 16px 0 0; transform-origin: 0% 100%;
  clip-path: polygon(0 0, 100% 0, 100% 78%, 94% 100%, 88% 76%, 82% 100%, 76% 76%, 70% 100%, 64% 76%, 58% 100%, 52% 76%, 46% 100%, 40% 76%, 34% 100%, 28% 76%, 22% 100%, 16% 76%, 10% 100%, 5% 76%, 0 100%); }
.pack-body { top: 40px; bottom: 0; border-radius: 0 0 16px 16px; clip-path: polygon(0 0, 5% 6%, 10% 0, 16% 6%, 22% 0, 28% 6%, 34% 0, 40% 6%, 46% 0, 52% 6%, 58% 0, 64% 6%, 70% 0, 76% 6%, 82% 0, 88% 6%, 94% 0, 100% 6%, 100% 100%, 0 100%); }
.foil { position: absolute; inset: 0;
  background:
    linear-gradient(115deg, transparent 20%, rgba(255,255,255,.42) 32%, transparent 44%),
    repeating-linear-gradient(90deg, #ffffff12 0 2px, transparent 2px 7px),
    linear-gradient(160deg, #3b1d8a 0%, #7a2fe0 38%, #e0408f 72%, #ff9a3c 100%);
  background-size: 250% 100%, auto, auto; animation: foilSweep 4s ease-in-out infinite; }
@keyframes foilSweep { 0% { background-position: 130% 0, 0 0, 0 0 } 60%, 100% { background-position: -80% 0, 0 0, 0 0 } }
.crimp { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, #0000002e 0 2px, #ffffff1c 2px 4px); }
.pack-art { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding-top: 20px; text-align: center; }
.pack-bolt { width: 112px; height: 112px; fill: var(--gold); filter: drop-shadow(0 0 18px #ffd54acc) drop-shadow(0 4px 0 #b36b00); animation: boltPulse 2.2s ease-in-out infinite; }
.pack-title { display: flex; flex-direction: column; align-items: center; line-height: 1; margin-top: 6px; }
.pack-title span { font-weight: 900; font-size: 46px; letter-spacing: .08em; color: #fff; text-shadow: 0 3px 0 #5a1a9a, 0 0 22px #ffffff66; }
.pack-title em { font-style: normal; font-family: var(--font-d); font-size: 32px; letter-spacing: .16em; color: var(--gold); text-shadow: 0 3px 0 #8a3d00; }
.pack-sub { font-size: 11px; letter-spacing: .24em; color: #ffffffcc; margin-top: 12px; }
.pack-sub b { color: var(--gold); font-weight: 700; }
.pack-chips { display: flex; gap: 6px; margin-top: 8px; }
.pack-chips i { font-style: normal; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: #00000040; border: 1px solid #ffffff44; }
.pack-shine { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: overlay;
  background: radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.75), transparent 45%); }
.pack-beam { position: absolute; left: 6%; right: 6%; top: 38px; height: 0; z-index: 2; opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 100%, #fff 0%, #ffe27a 25%, #ff9d2e55 55%, transparent 75%); filter: blur(6px); transform-origin: 50% 100%; }

.pack.shake { animation: shake .55s linear; }
@keyframes shake {
  0%,100% { translate: 0 0; rotate: 0 } 10% { translate: -9px 2px; rotate: -3deg } 20% { translate: 10px -3px; rotate: 3deg }
  30% { translate: -12px 3px; rotate: -4deg } 40% { translate: 12px -2px; rotate: 4deg } 50% { translate: -9px 1px; rotate: -3deg }
  60% { translate: 9px -1px; rotate: 3deg } 70% { translate: -5px 0; rotate: -2deg } 80% { translate: 4px 0; rotate: 1deg }
}
.pack.tearing { animation: none; }
.pack.tearing .pack-top { animation: tearOff .9s cubic-bezier(.5,0,.8,.4) forwards; }
@keyframes tearOff { 0% { transform: none; opacity: 1 } 25% { transform: rotate(-14deg) translate(-6px,-14px) } 100% { transform: rotate(-70deg) translate(-90px,-420px); opacity: 0 } }
.pack.tearing .pack-beam { animation: beam 1.1s ease-out forwards; }
@keyframes beam { 0% { height: 0; opacity: 0 } 30% { height: 330px; opacity: 1 } 100% { height: 560px; opacity: 0; filter: blur(18px) } }
.pack.tearing .pack-body { animation: bodyDrop 1.1s .45s var(--ease-out) forwards; }
@keyframes bodyDrop { to { transform: translateY(260px) scale(.8); opacity: 0 } }
.pack.gone { visibility: hidden; }

.cta { position: relative; z-index: 4; text-align: center; margin-top: 38px; }
.btn-primary { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 10px; padding: 16px 38px; border-radius: 999px; font-weight: 900; font-size: 18px; letter-spacing: .06em; color: #2a1200;
  background: linear-gradient(135deg, #ffe27a, var(--gold2)); box-shadow: 0 6px 0 #a85a00, 0 14px 36px #ff9d2e66, inset 0 2px 0 #fff8; transition: transform .2s var(--ease-spring), box-shadow .2s; animation: btnPulse 2.4s ease-in-out infinite; }
.btn-primary i { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, #fff9 50%, transparent 70%); translate: -120% 0; animation: btnShine 2.8s ease-in-out infinite; }
@keyframes btnShine { 0%, 50% { translate: -120% 0 } 100% { translate: 120% 0 } }
@keyframes btnPulse { 0%,100% { scale: 1 } 50% { scale: 1.045 } }
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:active { transform: translateY(4px); box-shadow: 0 2px 0 #a85a00, 0 6px 18px #ff9d2e66, inset 0 2px 0 #fff8; }
.btn-primary.sm { font-size: 15px; padding: 12px 26px; animation: none; }
.btn-ghost { padding: 12px 22px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255,255,255,.06); font-weight: 700; font-size: 14px; transition: all .25s; }
.btn-ghost:hover { background: rgba(255,255,255,.14); transform: translateY(-2px); }
.hint { margin-top: 14px; font-size: 13px; color: var(--dim); letter-spacing: .08em; }

.locked { position: relative; z-index: 4; text-align: center; margin-top: 30px; }
.locked-t { font-weight: 900; font-size: 22px; }
.locked-c { margin-top: 8px; color: var(--dim); }
.locked-c b { font-family: var(--font-d); font-size: 24px; color: var(--gold); letter-spacing: .08em; margin-left: 6px; }
.locked-act { margin-top: 18px; display: flex; gap: 10px; justify-content: center; }
.stage.is-locked .pack { filter: grayscale(.85) brightness(.6) drop-shadow(0 30px 40px #000a); animation: none; cursor: default; }
.stage.is-locked .aura { opacity: .2; }

/* ---------- 卡牌 ---------- */
.card { --ch: calc(var(--cw) * 1.42); --c: #8b5cff; --rc: var(--r-common); --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%;
  position: relative; width: var(--cw); height: var(--ch); perspective: 1200px; }
.card.r-common { --rc: var(--r-common); } .card.r-rare { --rc: var(--r-rare); }
.card.r-epic { --rc: var(--r-epic); } .card.r-legendary { --rc: var(--r-legendary); }
.card-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .9s var(--ease-out);
  transform: rotateX(var(--rx)) rotateY(calc(var(--ry) + var(--flip, 0deg))); }
.card.is-flipped { --flip: 180deg; }
.card.is-flipped .card-inner { transition: transform .9s var(--ease-out); }
.card.tilting .card-inner { transition: transform .08s linear; }
.face { position: absolute; inset: 0; border-radius: 22px; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.back { background: radial-gradient(circle at 50% 40%, #3a1f86 0%, #150a38 70%); border: 3px solid var(--rc);
  box-shadow: 0 0 0 1px #000, 0 0 36px -4px var(--rc), inset 0 0 40px #0008; }
.back::before { content: ""; position: absolute; inset: 10px; border-radius: 14px; border: 1px solid #ffffff2e;
  background: repeating-conic-gradient(from 0deg at 50% 50%, #ffffff0a 0 10deg, transparent 10deg 20deg); }
.back-bolt { position: absolute; left: 50%; top: 50%; width: 46%; translate: -50% -50%; fill: var(--gold); filter: drop-shadow(0 0 16px #ffd54acc); animation: boltPulse 2s ease-in-out infinite; }
.back-glow { position: absolute; inset: -30%; background: radial-gradient(circle, var(--rc) 0%, transparent 55%); opacity: .35; mix-blend-mode: screen; animation: breathe 2s ease-in-out infinite; }
@keyframes breathe { 0%,100% { opacity: .22; scale: .9 } 50% { opacity: .55; scale: 1.05 } }
.back-txt { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; font-family: var(--font-d); letter-spacing: .3em; font-size: 12px; color: #ffffffaa; }

.front { transform: rotateY(180deg); color: #fff; border: 3px solid var(--rc);
  background:
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--c) 70%, #fff 0%) 0%, transparent 62%),
    linear-gradient(180deg, color-mix(in srgb, var(--c) 40%, #0b0719) 0%, #0b0719 70%);
  box-shadow: 0 0 0 1px #000, 0 0 44px -6px var(--rc), 0 24px 40px #0009; display: flex; flex-direction: column; padding: 14px; }
.front::before { content: ""; position: absolute; inset: 6px; border-radius: 16px; border: 1px solid #ffffff30; pointer-events: none; }
.f-top { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; z-index: 2; }
.f-co { padding: 3px 10px; border-radius: 99px; background: #00000055; border: 1px solid #ffffff2e; }
.f-kind { font-family: var(--font-d); font-size: 10px; letter-spacing: .14em; padding: 3px 8px; border-radius: 6px; background: var(--rc); color: #10081f; }
.f-art { position: relative; height: 38%; margin: 10px 0 8px; border-radius: 14px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 55%, color-mix(in srgb, var(--c) 60%, #fff) 0%, var(--c) 40%, #0b0719 100%); border: 1px solid #ffffff3a; box-shadow: inset 0 0 30px #0007; }
.f-art::before { content: ""; position: absolute; inset: -50%; background: repeating-conic-gradient(from 0deg, #ffffff22 0 6deg, transparent 6deg 16deg); animation: spin 24s linear infinite; }
.f-glyph { position: relative; font-weight: 900; font-size: 58px; line-height: 1; text-shadow: 0 4px 0 #0006, 0 0 28px #fff9; }
.f-title { font-weight: 900; font-size: 17px; line-height: 1.28; z-index: 2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-shadow: 0 2px 8px #0008; }
.f-sum { margin-top: 6px; font-size: 12px; line-height: 1.55; color: #ffffffd0; z-index: 2; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.f-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 11px; color: #ffffffa8; z-index: 2; }
.f-src { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60%; }
.f-stars { color: var(--rc); letter-spacing: 2px; font-size: 13px; text-shadow: 0 0 10px var(--rc); }
.f-new { position: absolute; top: 56px; left: 22px; z-index: 5; padding: 2px 9px; border-radius: 6px; font-family: var(--font-d); font-size: 11px; letter-spacing: .12em; color: #2a0010; background: linear-gradient(90deg, #ff6a8a, #ffb36a); box-shadow: 0 2px 10px #0008; animation: newPop 1.6s ease-in-out infinite; }
@keyframes newPop { 50% { transform: scale(1.12) rotate(-3deg) } }
.card.k-knowledge .f-sum { font-size: 14px; line-height: 1.7; -webkit-line-clamp: 7; }
.card.k-knowledge .f-title { font-size: 19px; }

.holo { position: absolute; inset: 0; z-index: 4; pointer-events: none; border-radius: 20px; mix-blend-mode: color-dodge; opacity: 0; transition: opacity .3s;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.65) 0%, transparent 38%),
    linear-gradient(115deg, transparent 25%, #ff4fa388 38%, #ffd54a88 46%, #38e1ff88 54%, #8b5cff88 62%, transparent 75%);
  background-size: 100% 100%, 250% 250%; background-position: 0 0, calc(var(--mx) * 1.2) calc(var(--my) * 1.2); }
.card.is-flipped:hover .holo, .card.holo-on .holo { opacity: .65; }
.card.r-common .holo { opacity: 0 !important; }
.card.r-rare.is-flipped .holo { opacity: .28; }
.card.r-legendary .front { animation: legendGlow 2.4s ease-in-out infinite; }
@keyframes legendGlow { 0%,100% { box-shadow: 0 0 0 1px #000, 0 0 40px -6px #ffc83d, 0 24px 40px #0009 } 50% { box-shadow: 0 0 0 1px #000, 0 0 90px 4px #ffc83d, 0 24px 40px #0009 } }
.card.r-epic .front { animation: epicGlow 2.8s ease-in-out infinite; }
@keyframes epicGlow { 0%,100% { box-shadow: 0 0 0 1px #000, 0 0 36px -6px #b86bff, 0 24px 40px #0009 } 50% { box-shadow: 0 0 0 1px #000, 0 0 70px 0 #b86bff, 0 24px 40px #0009 } }
.card.r-legendary .front::after { content: ""; position: absolute; inset: 0; border-radius: 20px; padding: 3px; pointer-events: none;
  background: conic-gradient(from var(--ang, 0deg), #ffd54a, #ff4fa3, #38e1ff, #8b5cff, #ffd54a); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: ang 3s linear infinite; }
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes ang { to { --ang: 360deg } }

/* ---------- 抽卡牌堆 ---------- */
.deck { position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-bottom: 40px; }
.deck-card { position: relative; cursor: pointer; }
.deck-card.enter { animation: dealIn 1s var(--ease-out) both; }
@keyframes dealIn { 0% { transform: translateY(420px) scale(.4) rotate(14deg); opacity: 0 } 60% { opacity: 1 } 100% { transform: none; opacity: 1 } }
.deck-card.leave { animation: dealOut .6s cubic-bezier(.6,-.2,.7,.4) forwards; }
@keyframes dealOut { to { transform: translate(var(--tx, -40vw), var(--ty, 40vh)) scale(.25) rotate(-24deg); opacity: 0 } }
.deck-card .card { filter: drop-shadow(0 30px 40px #000a); }
.deck-card .card.hint-r-epic, .deck-card .card.hint-r-legendary { animation: jig .5s linear infinite; }
@keyframes jig { 0%,100% { rotate: 0 } 25% { rotate: -1.4deg } 75% { rotate: 1.4deg } }
.deck-hint { margin-top: 26px; font-size: 14px; letter-spacing: .2em; color: var(--dim); animation: blink 1.6s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35 } }
.tray { position: absolute; left: 0; right: 0; bottom: 14px; z-index: 9; display: flex; justify-content: center; gap: 8px; pointer-events: none; }
.mini { width: 40px; height: 56px; border-radius: 7px; border: 2px solid var(--rc); background: linear-gradient(160deg, var(--c), #0b0719); box-shadow: 0 0 14px -2px var(--rc); display: grid; place-items: center; font-weight: 900; font-size: 15px; animation: miniIn .6s var(--ease-spring) both; }
@keyframes miniIn { from { transform: translateY(40px) scale(.2); opacity: 0 } }
.progress { position: absolute; top: 14px; left: 0; right: 0; z-index: 9; display: flex; justify-content: center; gap: 8px; }
.progress i { width: 26px; height: 5px; border-radius: 9px; background: rgba(255,255,255,.18); transition: all .4s; }
.progress i.on { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.skip { position: absolute; right: 18px; top: 10px; z-index: 12; padding: 8px 14px; font-size: 13px; font-weight: 700; color: var(--dim); border-radius: 99px; border: 1px solid var(--line); background: rgba(255,255,255,.05); }
.skip:hover { color: #fff; }

.shake-screen { animation: screenShake .6s linear; }
@keyframes screenShake { 0%,100% { transform: none } 15% { transform: translate(-7px, 4px) } 30% { transform: translate(8px, -5px) } 45% { transform: translate(-6px, -3px) } 60% { transform: translate(6px, 4px) } 80% { transform: translate(-3px, 2px) } }

/* ---------- 战果 ---------- */
.summary { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px 16px;
  background: radial-gradient(circle at 50% 30%, #2a1561f2, #07060ffa); backdrop-filter: blur(8px); animation: viewIn .6s var(--ease-out); overflow-y: auto; }
.sum-title { font-weight: 900; font-size: 34px; letter-spacing: .08em; background: linear-gradient(90deg, var(--gold), var(--pink), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sum-sub { color: var(--dim); font-size: 14px; }
.sum-grid { --cw: min(172px, 28vw); display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 14px 0; max-width: 1000px; }
.sum-grid .card { animation: dealIn .9s var(--ease-out) both; cursor: pointer; }
.sum-act { display: flex; gap: 10px; }
.sum-grid .f-sum, .sum-grid .f-foot { display: none; }
.sum-grid .f-title { font-size: 13px; -webkit-line-clamp: 4; }
.sum-grid .f-glyph { font-size: 38px; }
.sum-grid .f-art { height: 40%; }

.offline { position: fixed; left: 50%; bottom: 18px; translate: -50% 0; z-index: 20; padding: 8px 16px; font-size: 12px; color: #ffd9a8; background: #3a1f0a; border: 1px solid #ff9d2e66; border-radius: 99px; }

/* ---------- 图鉴 ---------- */
.view-album { padding: 18px 20px 80px; max-width: 1180px; margin: 0 auto; }
.album-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.album-head h1 { font-size: 32px; font-weight: 900; letter-spacing: .06em; }
.album-head p { color: var(--dim); font-size: 14px; margin-top: 4px; }
.meter { position: relative; width: 72px; height: 72px; }
.meter svg { width: 100%; height: 100%; rotate: -90deg; }
.m-bg, .m-fg { fill: none; stroke-width: 4; } .m-bg { stroke: rgba(255,255,255,.1); }
.m-fg { stroke: url(#g); stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 113; stroke-dashoffset: 113; transition: stroke-dashoffset 1.2s var(--ease-out); filter: drop-shadow(0 0 5px var(--gold)); }
.meter b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; font-weight: 900; }
.rar-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.rs { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); font-size: 13px; }
.rs i { width: 10px; height: 10px; border-radius: 50%; background: var(--rc); box-shadow: 0 0 10px var(--rc); }
.rs b { font-size: 16px; }
.filter { display: flex; gap: 6px; margin-bottom: 18px; overflow-x: auto; padding-bottom: 4px; }
.filter button { white-space: nowrap; padding: 7px 14px; border-radius: 99px; font-size: 13px; font-weight: 700; color: var(--dim); border: 1px solid var(--line); background: rgba(255,255,255,.04); transition: all .25s; }
.filter button.on { color: #1a1030; background: #fff; border-color: #fff; }
.co-sec { margin-bottom: 30px; animation: viewIn .6s var(--ease-out) both; }
.co-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.co-badge { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; font-size: 18px; background: linear-gradient(135deg, var(--c), #0b0719); box-shadow: 0 0 20px -4px var(--c); border: 1px solid #ffffff40; }
.co-name { font-weight: 900; font-size: 18px; } .co-meta { font-size: 12px; color: var(--dim); }
.co-count { margin-left: auto; font-family: var(--font-d); font-size: 14px; color: var(--dim); } .co-count b { color: var(--gold); }
.co-grid { --cw: 150px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.slot { position: relative; aspect-ratio: 1 / 1.42; border-radius: 16px; }
.slot .card { --cw: 100%; --ch: 100%; width: 100%; height: 100%; cursor: pointer; transition: transform .35s var(--ease-spring); }
.slot .card:hover { transform: translateY(-6px) scale(1.03); z-index: 3; }
.slot .f-sum, .slot .f-foot, .slot .f-top .f-co { display: none; }
.slot .f-title { font-size: 12px; -webkit-line-clamp: 4; } .slot .f-glyph { font-size: 36px; } .slot .face { border-radius: 14px; }
.slot .front { padding: 10px; }
.slot.empty { border: 2px dashed rgba(255,255,255,.14); background: repeating-linear-gradient(135deg, #ffffff06 0 8px, transparent 8px 16px); display: grid; place-items: center; color: #ffffff30; font-family: var(--font-d); font-size: 34px; }
.slot .cnt { position: absolute; right: 6px; bottom: 6px; z-index: 6; min-width: 24px; text-align: center; font-size: 11px; font-weight: 900; padding: 2px 7px; border-radius: 99px; background: #000b; border: 1px solid #fff4; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; }
.modal-bg { position: absolute; inset: 0; background: #05030ccc; backdrop-filter: blur(10px); animation: viewIn .3s; }
.modal-body { position: relative; --cw: min(340px, 80vw); display: flex; flex-direction: column; align-items: center; gap: 16px; animation: dealIn .7s var(--ease-out) both; }
.modal-body .card { filter: drop-shadow(0 30px 50px #000c); }
.modal-link { padding: 10px 22px; border-radius: 99px; background: #fff; color: #1a1030; font-weight: 800; font-size: 14px; text-decoration: none; }
.modal-reason { max-width: 340px; text-align: center; font-size: 13px; color: var(--dim); line-height: 1.6; }
.modal-x { position: absolute; top: 18px; right: 20px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.1); font-size: 16px; z-index: 2; }

@media (max-width: 560px) { .pack { width: 220px; height: 336px; } .pack-title span { font-size: 40px; } .pack-bolt { width: 92px; height: 92px; } .aura { width: 420px; height: 420px; } .co-grid { grid-template-columns: repeat(2, 1fr); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

.f-co { max-width: 66%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-grid .f-top, .slot .f-top { font-size: 10px; }
.sum-grid .f-kind, .slot .f-kind { font-size: 8px; padding: 2px 5px; }
.sum-grid .f-new, .slot .f-new { top: 44px; left: 16px; font-size: 9px; }

/* ---------- 等级徽章 R / S / SR / SSR ---------- */
.f-co b { font-weight: 900; margin-right: 2px; }
.f-tier { font-family: var(--font-d); font-size: 15px; letter-spacing: .06em; padding: 3px 11px; border-radius: 8px; color: #10081f; border: 1px solid #fff6; box-shadow: 0 2px 10px #0007; position: relative; overflow: hidden; }
.t-common { background: linear-gradient(135deg, #d5dbea, #8d96ad); }
.t-rare { background: linear-gradient(135deg, #8fd0ff, #3d7bff); color: #04153a; }
.t-epic { background: linear-gradient(135deg, #e4b8ff, #a24bff); color: #230045; box-shadow: 0 0 14px #b86bff99; }
.t-legendary { font-size: 17px; background: linear-gradient(135deg, #fff2a8, #ffc83d 45%, #ff8a1f); color: #3a1c00; box-shadow: 0 0 18px #ffc83dcc; }
.t-legendary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, #fff9 50%, transparent 70%); translate: -120% 0; animation: btnShine 2.2s ease-in-out infinite; }
.f-art .f-kind { position: absolute; left: 8px; top: 8px; z-index: 2; background: #000a; color: #fff; border: 1px solid #fff5; font-size: 9px; padding: 2px 6px; }
.f-co { max-width: 70%; }
.sum-grid .f-tier, .slot .f-tier { font-size: 11px; padding: 2px 7px; }
.sum-grid .f-co, .slot .f-co { font-size: 10px; padding: 2px 7px; }
.slot .f-top .f-co { display: inline-block; }
.rs { border-color: color-mix(in srgb, var(--rc) 50%, transparent); }
.rs b { color: var(--rc); }

/* ---------- 开包：蓄力 / 爆发 ---------- */
.stage { --burst: #ffd54a; }
.stage.charging .aura { animation-duration: 1.4s; opacity: 1; filter: blur(55px) brightness(1.4); transition: all .9s; background: conic-gradient(from 0deg, var(--burst), #fff, var(--burst), #ff4fa3, var(--burst)); }
.stage.charging .ring-a, .stage.charging .ring-b { animation-duration: 3s; border-color: var(--burst); }
.pack.charging { animation: charge .9s ease-in forwards; filter: drop-shadow(0 0 30px var(--burst)) drop-shadow(0 0 80px var(--burst)); }
@keyframes charge {
  0% { translate: 0 0; scale: 1; rotate: 0 }
  20% { translate: -3px 1px; rotate: -1deg; scale: 1.02 } 40% { translate: 5px -2px; rotate: 1.4deg; scale: 1.05 }
  60% { translate: -7px 2px; rotate: -2deg; scale: 1.08 } 80% { translate: 9px -3px; rotate: 2.6deg; scale: 1.12 }
  100% { translate: -10px 3px; rotate: -3deg; scale: 1.18 }
}
.pack.charging .foil { filter: brightness(1.6) saturate(1.4); animation-duration: .5s; }
.pack.charging .pack-shine { background: radial-gradient(circle at 50% 30%, #fff, transparent 55%); mix-blend-mode: screen; animation: breathe .25s ease-in-out infinite; }
.pack-beam { background: radial-gradient(ellipse at 50% 100%, #fff 0%, var(--burst) 30%, transparent 75%) !important; }
.shock { position: fixed; z-index: 58; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; pointer-events: none;
  border: 6px solid var(--sc); box-shadow: 0 0 40px var(--sc), inset 0 0 40px var(--sc); animation: shock 1.1s cubic-bezier(.1,.8,.3,1) both; }
@keyframes shock { from { transform: scale(.2); opacity: 1; border-width: 14px } to { transform: scale(calc(30 * var(--sz, 1))); opacity: 0; border-width: 1px } }
.stage.speedlines::after { content: ""; position: absolute; inset: -20%; z-index: 7; pointer-events: none;
  background: repeating-conic-gradient(from 0deg at 50% 42%, transparent 0 4deg, color-mix(in srgb, var(--burst) 70%, #fff) 4deg 4.6deg, transparent 4.6deg 9deg);
  -webkit-mask: radial-gradient(circle at 50% 42%, transparent 14%, #000 60%); mask: radial-gradient(circle at 50% 42%, transparent 14%, #000 60%);
  animation: speed .9s ease-out forwards; }
@keyframes speed { from { opacity: 1; transform: scale(.6) } to { opacity: 0; transform: scale(1.6) rotate(8deg) } }
.fan { position: fixed; inset: 0; z-index: 57; pointer-events: none; }
.fan-card { position: absolute; width: 112px; height: 160px; margin: -80px 0 0 -56px; border-radius: 14px; border: 3px solid var(--rc, #9aa3b8);
  background: radial-gradient(circle at 50% 40%, #3a1f86, #150a38 75%); box-shadow: 0 0 30px -2px var(--rc, #fff), 0 20px 30px #000a; display: grid; place-items: center;
  animation: fanOut 1.1s cubic-bezier(.16, 1, .3, 1) both; animation-delay: var(--d); }
.fan-card svg { width: 46%; fill: var(--gold); filter: drop-shadow(0 0 10px #ffd54a); }
.fan-card.r-common { --rc: var(--r-common); } .fan-card.r-rare { --rc: var(--r-rare); } .fan-card.r-epic { --rc: var(--r-epic); } .fan-card.r-legendary { --rc: var(--r-legendary); }
@keyframes fanOut { 0% { transform: translate(0, 120px) scale(.3) rotate(0); opacity: 0 } 25% { opacity: 1 } 100% { transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--rot)) } }
.fan-card.collapse { animation: collapse .5s cubic-bezier(.6, -.3, .7, .3) forwards; }
@keyframes collapse { from { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) } to { transform: translate(0, -60px) scale(.6) rotate(0); opacity: 0 } }

/* ---------- 图鉴：资料库 ---------- */
.slot.uncollected .card { filter: saturate(.3) brightness(.78); opacity: .85; }
.slot.uncollected .card:hover { filter: saturate(.8) brightness(1); opacity: 1; }
.slot .lock { position: absolute; left: 6px; bottom: 6px; z-index: 6; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #000b; border: 1px solid #fff3; color: #ffffffb0; }
.more-row { display: flex; justify-content: center; margin-top: 14px; }
.more-btn { padding: 11px 28px; border-radius: 99px; font-weight: 700; font-size: 14px; border: 1px solid color-mix(in srgb, var(--c) 60%, #fff3); background: color-mix(in srgb, var(--c) 18%, transparent); transition: all .25s var(--ease-spring); }
.more-btn b { color: var(--c); filter: brightness(1.5); } .more-btn i { font-style: normal; margin-left: 4px; }
.more-btn:hover { transform: translateY(-2px) scale(1.04); background: color-mix(in srgb, var(--c) 32%, transparent); }
.more-btn.busy { opacity: .6; pointer-events: none; }
.more-end { font-size: 12px; color: var(--dim); }

/* ---------- 登录 ---------- */
.btn-user { max-width: 160px; font-weight: 700; font-size: 13px; }
.btn-user span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-user:hover { background: rgba(255,255,255,.14); }
.login-card { position: relative; width: min(380px, 90vw); padding: 30px 26px 24px; border-radius: 24px; border: 1px solid #ffffff2e;
  background: linear-gradient(160deg, #241254f2, #0d0822f2); box-shadow: 0 30px 80px #000c, 0 0 80px -10px #8b5cff88; text-align: center; animation: dealIn .7s var(--ease-out) both; user-select: text; }
.login-bolt { width: 54px; fill: var(--gold); filter: drop-shadow(0 0 14px #ffd54acc); animation: boltPulse 2.4s ease-in-out infinite; }
.login-card h2 { margin-top: 8px; font-size: 22px; font-weight: 900; letter-spacing: .04em; }
.login-sub { margin: 6px 0 18px; font-size: 13px; color: var(--dim); }
.field { display: block; text-align: left; margin-bottom: 12px; }
.field span { display: block; margin-bottom: 6px; font-size: 12px; color: var(--dim); letter-spacing: .06em; }
.field input { width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.07); color: var(--ink); font: inherit; font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s; }
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px #ffd54a33; }
#codeIn { text-align: center; letter-spacing: .5em; font-family: var(--font-d); font-size: 22px; }
.login-err { margin: 2px 0 10px; font-size: 13px; color: #ff8aa0; }
.login-card .btn-primary { width: 100%; justify-content: center; margin-top: 4px; }
.login-link { margin-top: 12px; font-size: 13px; color: var(--dim); text-decoration: underline; }
.login-link:disabled { opacity: .5; text-decoration: none; cursor: default; }
.login-card .modal-x { top: 12px; right: 12px; width: 34px; height: 34px; }

/* ---------- 手机适配 ---------- */
:root { --tabbar: 78px; }
@media (max-width: 640px) {
  html, body { overscroll-behavior-y: none; }
  .topbar { padding: calc(env(safe-area-inset-top) + 8px) 14px 8px; gap: 8px; backdrop-filter: none; -webkit-backdrop-filter: none; background: linear-gradient(#07060f 40%, #07060f00); }
  .logo-cn { display: inline; font-size: 19px; }
  .logo-en { font-size: 19px; }
  .bolt { width: 22px; height: 22px; }
  .hud { margin-left: auto; gap: 6px; }
  .chip { padding: 6px 10px; font-size: 13px; }
  .chip b { font-size: 14px; }
  .btn-user { max-width: 118px; }
  /* 导航移到底部，拇指够得着 */
  .tabs { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 12px); translate: -50% 0; z-index: 45; margin: 0;
    padding: 5px; background: rgba(14, 9, 34, .88); backdrop-filter: blur(16px) saturate(1.4); box-shadow: 0 10px 34px #000b, 0 0 0 1px #ffffff1a; }
  .tab { white-space: nowrap; padding: 11px 30px; font-size: 15px; }
  .stage { min-height: calc(100svh - 54px); padding: 4px 14px calc(var(--tabbar) + 8px); }
  .view { min-height: calc(100svh - 54px); }
  .aura { width: 360px; height: 360px; }
  .ring-a { width: 330px; height: 330px; } .ring-b { width: 460px; height: 460px; }
  .pack { width: 214px; height: 326px; }
  .pack-bolt { width: 84px; height: 84px; } .pack-title span { font-size: 38px; } .pack-title em { font-size: 27px; }
  .cta { margin-top: 28px; }
  .btn-primary { padding: 14px 32px; font-size: 17px; }
  .deck { padding-bottom: calc(var(--tabbar) + 40px); }
  .tray { bottom: calc(var(--tabbar) + 4px); }
  .skip { top: 6px; right: 10px; }
  .progress { top: 10px; }
  .summary { justify-content: flex-start; padding: calc(env(safe-area-inset-top) + 28px) 12px calc(var(--tabbar) + 16px); }
  .sum-title { font-size: 28px; }
  .sum-grid { --cw: calc((100vw - 24px - 20px) / 3); gap: 10px; margin: 10px 0; }
  .sum-grid .f-title { font-size: 11px; -webkit-line-clamp: 4; }
  .sum-grid .f-glyph { font-size: 30px; }
  .view-album { padding: 10px 14px calc(var(--tabbar) + 24px); }
  .album-head h1 { font-size: 26px; }
  .meter { width: 58px; height: 58px; }
  .rar-stats { gap: 6px; }
  .rs { padding: 6px 10px; font-size: 12px; }
  .filter { margin: 0 -14px 14px; padding: 0 14px 6px; scrollbar-width: none; }
  .filter::-webkit-scrollbar { display: none; }
  .co-head { gap: 10px; flex-wrap: wrap; }
  .co-count { margin-left: 0; width: 100%; font-size: 12px; }
  .co-grid { --cw: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .slot .front { padding: 9px; }
  .modal-body { --cw: min(300px, 78vw); gap: 12px; }
  .modal-reason { max-width: 86vw; }
  .modal-x { top: calc(env(safe-area-inset-top) + 12px); right: 14px; }
  .login-card { padding: 26px 20px 20px; max-height: 92svh; overflow-y: auto; }
  .offline { bottom: calc(var(--tabbar) + 8px); max-width: 92vw; text-align: center; }
  .locked-act { flex-wrap: wrap; }
  .locked-c b { font-size: 20px; }
}
@media (max-width: 380px) {
  .tab { padding: 10px 24px; }
  .logo-en { display: none; }
}
/* 登录输入框在 iOS 上字号 < 16px 会触发页面缩放 */
@media (pointer: coarse) { .field input { font-size: 16px; } }

/* 小卡片：主题只留图标，NEW 标签挪到右侧，免得和 NEWS/知识 标签叠在一起 */
.f-new { left: auto; right: 22px; }
.sum-grid .f-new, .slot .f-new { right: 14px; top: 42px; }
.sum-grid .f-coname { display: none; }
.sum-grid .f-co { padding: 2px 7px; }
@media (max-width: 640px) {
  .slot .f-new { top: 40px; right: 12px; font-size: 8px; padding: 1px 6px; }
}
.sum-grid .f-kind { display: none; }
.sum-grid .f-new { left: 12px; right: auto; top: 44px; font-size: 8px; padding: 1px 5px; letter-spacing: .06em; }
.sum-grid .f-title { margin-top: 2px; }

/* 登录后账号不再占顶栏：手机上只显示头像圆点（邮箱首字母），点一下可退出 */
.btn-user.is-in { max-width: 190px; }
@media (max-width: 640px) {
  .btn-user.is-in { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--pink)); border: 0; color: #23102f; }
  .btn-user.is-in #userTxt { display: none; }
  .btn-user.is-in::before { content: attr(data-initial); font-family: var(--font-d); font-size: 15px; font-weight: 900; }
  .sum-grid .f-art { height: 34%; }
}

/* ---------- 保存 / 分享卡片 ---------- */
.modal-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.modal-save { padding: 10px 22px; border-radius: 99px; font-weight: 800; font-size: 14px; color: #2a1200; background: linear-gradient(135deg, #ffe27a, var(--gold2)); box-shadow: 0 4px 0 #a85a00, 0 10px 24px #ff9d2e55; transition: transform .2s var(--ease-spring); }
.modal-save b { font-weight: 900; margin-right: 2px; }
.modal-save:hover { transform: translateY(-2px); }
.modal-save:active { transform: translateY(3px); box-shadow: 0 1px 0 #a85a00; }
.modal-save.alt { color: #fff; background: rgba(255,255,255,.12); box-shadow: 0 0 0 1px #ffffff40; }
