:root {
  /* Clean Light Digital Theme (100bcards airy bright table + crisp Digimon pixel texture!) */
  --bg: #f3f5f9;
  --bg2: #e9edf4;
  --panel: rgba(255, 255, 255, 0.94);
  --border: #cbd5e1;
  --border-soft: #dce3ec;
  --ink: #1e242c;
  --muted: #64748b;
  --gold: #d4a017;
  --gold-bright: #ffd12f;
  --gold-dim: #9a7410;
  --gold-bg: #181c22;
  --font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* 7-Tier Rarity Palette (N-MR: 白 / 绿 / 蓝 / 紫 / 橙 / 红 / 彩) */
  --g-N:   linear-gradient(135deg, #cbd5e1, #f8fafc, #94a3b8);
  --g-R:   linear-gradient(135deg, #16a34a, #4ade80);
  --g-SR:  linear-gradient(135deg, #0284c7, #38bdf8);
  --g-SSR: linear-gradient(135deg, #7c3aed, #c084fc);
  --g-UR:  linear-gradient(135deg, #ea580c, #fb923c, #fde047);
  --g-EX:  linear-gradient(135deg, #b91c1c, #ef4444, #fca5a5);
  --g-MR:  linear-gradient(125deg, #fb7185, #fde047 25%, #34d399 50%, #38bdf8 75%, #c084fc);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0; padding: 0; min-height: 100vh; min-height: 100svh;
  background: var(--bg); color: var(--ink); font-family: var(--font);
  text-rendering: optimizeLegibility; overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }

.app-bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(110% 55% at 50% -8%, rgba(56, 189, 248, 0.10), transparent 65%),
    radial-gradient(90% 50% at 50% 108%, rgba(251, 191, 36, 0.09), transparent 65%),
    linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

/* 1:1 100bcards centered mobile-first column with safe-area & dynamic viewport height */
.frame {
  position: relative; z-index: 1;
  max-width: 520px; min-height: 100vh; min-height: 100dvh;
  margin: 0 auto; padding: 6px 14px calc(126px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column;
}
.topbar {
  height: 0; flex: none; position: relative; overflow: visible;
}
.sound-btn {
  position: fixed; top: 14px; right: 14px; z-index: 50;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.92); border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.10);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: 15px; display: grid; place-items: center; color: var(--ink);
}
.sound-btn.muted { opacity: .5; }
.main-area { flex: 1; display: flex; flex-direction: column; }
.view { display: none; flex-direction: column; }
.view.active { display: flex; animation: viewEnter .26s cubic-bezier(.22,1,.36,1) both; }
@keyframes viewEnter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fly-pack-clone {
  position: fixed; z-index: 96; pointer-events: none; margin: 0;
  object-fit: contain; filter: drop-shadow(0 12px 24px rgba(255,209,47,0.5));
  transition: transform .42s cubic-bezier(.22,1,.36,1), opacity .42s ease;
}

/* ---------- Home (1:1 100bcards Commanding Hero Proportions) ---------- */
.intro { text-align: center; padding: 6px 40px 2px; }
.intro h1 { margin: 0; font-size: 28px; font-weight: 900; letter-spacing: .06em; color: var(--ink); line-height: 1.15; }
.brand-logo-wrap { display: flex; justify-content: center; align-items: center; }
.brand-logo {
  display: block; height: 48px; width: auto; max-width: min(82vw, 272px);
  object-fit: contain; -webkit-user-drag: none;
  filter: drop-shadow(0 3px 6px rgba(15, 23, 42, 0.14));
}
.tagline { margin: 3px 0 0; font-size: 12px; color: var(--muted); }

/* 1:1 100bcards Sleek Frameless Level + 10-cell bar + Chest */
.level-row {
  display: flex; align-items: center; gap: 8px;
  padding: 2px 6px; border-radius: 10px;
  background: transparent; border: none;
  width: min(100%, 372px);
  margin: 2px auto 0;
}
.level-num {
  font-size: 12px; font-weight: 800; color: #ffd12f; min-width: 44px; text-align: center;
  padding: 2px 8px; border-radius: 99px;
  background: linear-gradient(180deg, #262932, #15171d);
  border: 1px solid rgba(255, 209, 47, 0.48);
}
.level-info {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 1px solid var(--border); color: var(--muted); font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}
.level-info:hover { border-color: var(--gold); color: var(--gold); }
.level-bar { flex: 1; display: flex; gap: 3px; height: 8px; }
.level-bar i {
  flex: 1; border-radius: 2px; background: #121416; border: 1px solid #32393f;
  transition: background .28s ease, border-color .28s ease, transform .28s cubic-bezier(.22,1,.36,1);
}
.level-bar i.lit { background: linear-gradient(180deg, #ffe266, #d4a017); border-color: #ffd12f; }
.level-bar i.lit.tc-0 { background: var(--g-N); border-color: #e2e8f0; }
.level-bar i.lit.tc-1 { background: var(--g-R); border-color: #86efac; }
.level-bar i.lit.tc-2 { background: var(--g-SR); border-color: #7dd3fc; }
.level-bar i.lit.tc-3 { background: var(--g-SSR); border-color: #d8b4fe; }
.level-bar i.lit.tc-4 { background: var(--g-UR); border-color: #fdba74; }
.level-bar i.lit.tc-5 { background: var(--g-EX); border-color: #fca5a5; }
.level-bar i.lit.tc-6 { background: var(--g-MR); border-color: #fde68a; }
.level-bar i.pop { animation: expCellPop .42s cubic-bezier(.22,1.25,.36,1) both; }
@keyframes expCellPop {
  0% { transform: scaleY(0.5); filter: brightness(2.2); }
  55% { transform: scaleY(1.45); filter: brightness(1.5); }
  100% { transform: scaleY(1); filter: brightness(1); }
}
.level-chest {
  position: relative; width: 30px; height: 28px; flex: none;
  display: grid; place-items: center; border-radius: 6px;
  background: #161a1e; border: 1px solid var(--border-soft); font-size: 15px;
  transition: transform .18s cubic-bezier(.22,1,.36,1), border-color .18s;
}
.level-chest:hover { transform: scale(1.1); border-color: var(--gold); }
.level-chest:active { transform: scale(0.92); }
.level-chest.ready { border-color: var(--gold); background: var(--gold-bg); animation: pulseChest 1.4s infinite; }
.level-chest.chest-pop { animation: chestOpenBurst .52s cubic-bezier(.22,1.2,.36,1); }
@keyframes chestOpenBurst {
  0% { transform: scale(1); }
  35% { transform: scale(1.38) rotate(-10deg); filter: drop-shadow(0 0 14px #ffd12f); }
  70% { transform: scale(0.92) rotate(6deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes pulseChest { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.chest-ico-img { width: 22px; height: 22px; object-fit: contain; display: block; -webkit-user-drag: none; }
.chest-badge {
  position: absolute; top: -5px; right: -5px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 800;
  font-style: normal; display: grid; place-items: center;
}

/* Commanding 1:1 100bcards Hero 3D Foil Booster Stage (wide 1:1.45 pouch filling ~50% viewport height!) */
.stage-3d {
  position: relative; width: 100%; height: clamp(316px, 50dvh, 472px);
  display: grid; place-items: center; margin: 0;
  touch-action: none; user-select: none; overflow: visible;
}
.stage-3d::after {
  content: ''; position: absolute; left: 50%; bottom: 4px; z-index: 0;
  width: 228px; height: 24px; pointer-events: none;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.22) 0%, rgba(15, 23, 42, 0.06) 48%, transparent 74%);
  animation: packShadowBreathe 3.8s ease-in-out infinite;
}
@keyframes packShadowBreathe {
  0%, 100% { transform: translateX(-50%) scaleX(1.0); opacity: 0.92; }
  50% { transform: translateX(-50%) scaleX(0.90); opacity: 0.68; }
}
.stage-3d.is-empty::after { display: none; }
.home-empty-pack {
  position: relative; z-index: 5;
  width: min(100%, 300px); padding: 26px 20px; border-radius: 16px;
  border: 1.5px dashed #cbd5e1;
  background: rgba(255, 255, 255, 0.82);
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.empty-pack-title { font-size: 16px; font-weight: 800; color: var(--ink); }
.empty-pack-desc { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--muted); }
.empty-pack-desc b { color: var(--gold-dim); }
.pack-3d-canvas { animation: packFloatIdle 3.8s ease-in-out infinite; }
@keyframes packFloatIdle {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}
.pack-wrap {
  position: relative; width: 100%; height: 100%; display: grid; place-items: center;
  transition: transform .26s cubic-bezier(.22,.8,.22,1), opacity .22s ease;
}
.stage-3d.swapping .pack-wrap {
  transform: translateX(var(--swap-dir, -48px)) scale(0.88) rotate(var(--swap-rot, -6deg));
  opacity: 0;
}
.pile-count {
  position: absolute; right: 11%; bottom: 26px; z-index: 4;
  padding: 4px 12px; border-radius: 99px; font-size: 13px; font-weight: 800;
  font-variant-numeric: tabular-nums; color: #fff;
  background: linear-gradient(135deg, #3b3354, #1d1830);
  box-shadow: 0 3px 8px rgba(0,0,0,0.42), inset 0 0 0 1px rgba(255,255,255,0.2);
  transition: opacity .22s ease;
}
.stage-3d.swapping .pile-count { opacity: 0; }
.pack-ribbons, .pack-3d-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
.pack-ribbons { z-index: 1; }
.pack-3d-canvas { z-index: 2; }
.pack-hit {
  position: relative; z-index: 3; width: 280px; height: 416px;
  cursor: grab; border-radius: 10px; background: transparent;
}
.pack-hit:active { cursor: grabbing; }

/* 1:1 100bcards Base Pack Multi-Open Button (always cleanly BELOW 3D pack, never overlapped!) */
.batch-row { position: relative; z-index: 6; display: flex; justify-content: center; min-height: 8px; margin: 4px 0 6px; }
.base-batch {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 5px 18px; border-radius: 10px;
  border: 1.5px solid rgba(255, 209, 47, 0.72);
  background: linear-gradient(180deg, #272a33, #15171d);
  color: #ffd12f; font-size: 12px; font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 3px 10px rgba(15,23,42,0.22);
  transition: transform .12s;
}
.base-batch:active { transform: scale(.96); }
.base-batch:disabled { opacity: .55; }

/* Bottom Owned Pack Tray (1:1 100bcards recessed pill tray — ZERO box-in-box!) */
#homeView.active {
  min-height: calc(100dvh - 134px);
  justify-content: space-between;
}
.tray-wrap { margin-top: 2px; }
.tray {
  display: flex; align-items: center; gap: 9px; overflow-x: auto; padding: 8px 12px;
  background: rgba(226, 229, 236, 0.72);
  border: 1px solid rgba(203, 213, 225, 0.9);
  box-shadow: inset 0 2px 8px rgba(15, 23, 42, 0.09), 0 1px 0 rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  scrollbar-width: none; -ms-overflow-style: none; scroll-behavior: smooth;
}
.tray::-webkit-scrollbar { display: none; }
.tray-item {
  flex: none; width: 58px; padding: 2px; border-radius: 0;
  background: transparent; border: none; position: relative;
  display: flex; flex-direction: column; align-items: center;
  transform: rotate(-2.5deg);
  transition: transform .18s cubic-bezier(.22, 1.3, .36, 1), filter .18s ease;
}
.tray-item:nth-child(even) { transform: rotate(2.5deg); }
.tray-item:hover { transform: translateY(-4px) scale(1.06) rotate(0deg); }
.tray-item.active {
  transform: translateY(-6px) scale(1.08) rotate(0deg);
  filter: drop-shadow(0 7px 12px rgba(15, 23, 42, 0.28));
}
.tray-thumb {
  width: 54px; height: 78px; object-fit: contain; display: block;
  border-radius: 4px;
  filter: drop-shadow(0 4px 8px rgba(15,23,42,0.24));
}
.tray-qty {
  position: absolute; top: -2px; right: -4px; z-index: 2;
  padding: 2px 7px; border-radius: 99px; font-size: 11px; font-weight: 800;
  background: #232236; border: 1px solid rgba(255,255,255,0.25); color: #ffffff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.28);
}
.tray-name {
  font-size: 10px; font-weight: 700; color: var(--ink); width: 100%; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- Result View (1:1 100bcards Minimal: Card + Share + Next CTA ALWAYS 100% on-screen!) ---------- */
#resultView.active {
  min-height: calc(100dvh - 16px);
  justify-content: space-between;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
.result-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 6px; padding-right: 40px;
}
.back-btn {
  padding: 6px 12px; border-radius: 10px; font-size: 13px; font-weight: 700;
  background: var(--panel); border: 1px solid var(--border-soft); color: var(--ink);
}
.result-progress { font-size: 13px; font-weight: 800; color: var(--gold); }
.fav-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--border-soft);
  font-size: 17px; color: var(--muted); display: grid; place-items: center;
}
.fav-btn.active { color: #f43f5e; border-color: #f43f5e; }

/* Responsive Card Stage: scales cleanly on mobile viewports (<=860px) so Share + Next NEVER clip! */
.card-stage {
  --card-scale: 1;
  position: relative; width: 300px; height: 492px; margin: 2px auto 8px;
  display: flex; justify-content: center; align-items: center;
  touch-action: pan-y; user-select: none;
  transform-origin: center center;
}
@media (max-height: 860px) {
  .card-stage {
    --card-scale: 0.85;
    height: calc(492px * var(--card-scale));
    margin: 0 auto 6px;
  }
  .card-stage .card-stack,
  .card-stage .card-viewport {
    transform: scale(var(--card-scale));
    transform-origin: center center;
  }
}
@media (max-height: 720px) {
  .card-stage { --card-scale: 0.75; }
}
.card-stack {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
}
.stack-card {
  position: absolute; inset: 0; border-radius: 13px; overflow: hidden;
  clip-path: inset(0 round 13px);
  background: #0d1016;
  border: 1.5px solid rgba(255, 255, 255, 0.26);
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.34), inset 0 0 0 1px rgba(255, 209, 47, 0.14);
  transform: translate3d(calc(var(--si, 1) * var(--stack-step-x, 5px)), calc(var(--si, 1) * var(--stack-step-y, 5px)), 0);
  transition: transform .24s cubic-bezier(.22,1,.36,1), opacity .22s ease;
  --back-stops: #B6BCC4 0%, #7A838E 50%, #4C535E 100%;
  --back-angle: 135deg;
}
.stack-card.tier-0 { --back-stops: #B6BCC4 0%, #7A838E 50%, #4C535E 100%; }
.stack-card.tier-1 { --back-stops: #4ADE80 0%, #16A34A 50%, #166534 100%; }
.stack-card.tier-2 { --back-stops: #38BDF8 0%, #0284C7 50%, #075985 100%; }
.stack-card.tier-3 { --back-stops: #C084FC 0%, #7C3AED 50%, #5B21B6 100%; }
.stack-card.tier-4 { --back-stops: #FB923C 0%, #EA580C 50%, #9A3412 100%; }
.stack-card.tier-5 { --back-stops: #EF4444 0%, #B91C1C 50%, #7F1D1D 100%; }
.stack-card.tier-6 { --back-stops: #D08E9E 0%, #CFB477 25%, #71AC98 50%, #6B9BB4 75%, #9D89B6 100%; --back-angle: 125deg; }
.stack-card::before,
.stack-card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
}
.stack-card::before {
  background: linear-gradient(var(--back-angle), var(--back-stops));
  background-size: 135% 135%;
  -webkit-mask: url('../assets/card-backs/d-circuit/02_trace-mask.png') center / cover no-repeat;
  mask: url('../assets/card-backs/d-circuit/02_trace-mask.png') center / cover no-repeat;
  mask-mode: alpha;
  animation: dm-back-flow 8s ease-in-out infinite;
}
.stack-card::after {
  background: url('../assets/card-backs/d-circuit/03_logo.png') center / cover no-repeat;
}
.card-viewport {
  position: relative; z-index: 2; width: 300px; height: 492px;
  display: flex; justify-content: center; align-items: center;
}
.card-viewport .dm-card-wrap {
  transform: translate3d(var(--swipe-x, 0px), var(--swipe-y, 0px), 0) rotate(var(--swipe-angle, 0deg));
}
.card-viewport .dm-card-wrap.swipe-reset {
  transition: transform .24s cubic-bezier(.22,.8,.22,1);
}

/* Share row on Result View */
.share-row { display: flex; justify-content: center; margin: -6px 0 10px; }
.share-btn {
  padding: 7px 16px; border-radius: 10px; font-size: 12.5px; font-weight: 700;
  background: rgba(255, 255, 255, 0.94); border: 1px solid var(--border); color: var(--ink);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  transition: transform .16s, border-color .16s, color .16s, box-shadow .16s;
}
.share-btn:hover { transform: translateY(-1px); border-color: var(--gold); color: var(--gold-dim); box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12); }
.share-btn:active { transform: scale(.96); }

/* Cohesive Black-Gold Primary Button (matches Black-Gold Dock & Digimon UI!) */
.cta-row { display: flex; justify-content: center; margin-top: 4px; width: 100%; }
.primary-cta {
  width: min(100%, 300px); height: 46px; padding: 0 24px; border-radius: 10px;
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 14px; font-weight: 800; letter-spacing: .2em; text-indent: .2em;
  color: #ffd12f;
  background: linear-gradient(180deg, #2d281b 0%, #17150f 100%);
  border: 1.5px solid #ffd12f;
  box-shadow: 0 4px 0 #705819, 0 12px 24px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,236,160,0.32);
  transition: transform .12s cubic-bezier(.22,1,.36,1), box-shadow .12s, filter .15s;
}
.primary-cta::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 36%, rgba(255,209,47,0.34) 50%, transparent 64%) no-repeat;
  background-size: 260% 100%; animation: primarySheen 4.0s ease-in-out infinite;
}
@keyframes primarySheen {
  0%, 56% { background-position: 180% 0; }
  100% { background-position: -90% 0; }
}
.primary-cta:hover { filter: brightness(1.1); transform: translateY(-1px); }
.primary-cta:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #705819, 0 6px 14px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,236,160,0.32);
}
.cta-lead { position: absolute; left: 18px; font-size: 12px; opacity: .88; letter-spacing: 0; text-indent: 0; }
.cta-arrow { position: absolute; right: 18px; font-size: 15px; font-weight: 900; letter-spacing: 0; text-indent: 0; }
.again-dots { display: inline-flex; gap: 5px; align-items: center; letter-spacing: 0; text-indent: 0; margin-left: -4px; }
.again-dots:empty { display: none; }
.again-dots i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,209,47,0.25); transition: background .25s, transform .25s;
}
.again-dots i.lit { background: #ffd12f; transform: scale(1.18); }

/* ---------- ULTRA-CLEAN DIGIMON CARD (Crisp Animated Flow-Light Border, NO Muddy Grey Wash!) ---------- */
.dm-card-wrap {
  width: 300px; height: 492px; position: relative; perspective: 1100px; flex: none;
}
.dm-card-wrap.compact { width: 292px; height: 478px; }
.dm-card-inner {
  width: 100%; height: 100%; position: relative;
  transform-style: preserve-3d; transition: transform .58s cubic-bezier(.22,.8,.22,1);
}
.dm-card-wrap.flipped .dm-card-inner { transform: rotateY(180deg); }
.dm-card-wrap.reveal-hold .dm-card-inner { transition: none; transform: rotateY(180deg) scale(1); }
.dm-face, .dm-back {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: 13px; backface-visibility: hidden; overflow: hidden;
}
/* Crisp animated flow-light border & clean specular glint (Point 5: ZERO grey veil on dark card!) */
.tier-3 .dm-face, .tier-4 .dm-face, .tier-5 .dm-face, .tier-6 .dm-face {
  background-size: 260% 260%;
  animation: frameFlow 4.2s linear infinite;
}
@keyframes frameFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.dm-holo-foil {
  position: absolute; inset: 0; z-index: 6; pointer-events: none; border-radius: 13px;
  opacity: 0; background-repeat: no-repeat;
  background-image: linear-gradient(120deg,
    transparent 38%,
    rgba(255,255,255,0.16) 47%,
    rgba(255,244,196,0.26) 50%,
    rgba(165,243,252,0.16) 53%,
    transparent 62%);
  background-size: 320% 320%;
}
.tier-2 .dm-holo-foil { animation: cardGlint 4.8s ease-in-out infinite; }
.tier-3 .dm-holo-foil { animation: cardGlint 3.8s ease-in-out infinite; }
.tier-4 .dm-holo-foil, .tier-5 .dm-holo-foil, .tier-6 .dm-holo-foil {
  background-image: linear-gradient(118deg,
    transparent 36%,
    rgba(251,146,60,0.22) 45%,
    rgba(253,224,71,0.32) 50%,
    rgba(239,68,68,0.22) 55%,
    transparent 64%);
  background-size: 320% 320%;
  animation: cardGlint 3.2s ease-in-out infinite;
}
/* Image 1 fix: opacity=0 at rest and starts strictly off-card -> ZERO static left-edge residue! */
@keyframes cardGlint {
  0%, 48% { opacity: 0; background-position: 220% 0%; }
  54%     { opacity: 0.75; }
  92%     { opacity: 0.75; }
  100%    { opacity: 0; background-position: -120% 100%; }
}
.dm-face {
  padding: 6px; background: var(--card-frame, #485158);
  box-shadow: 0 12px 28px rgba(0,0,0,0.55), 0 0 20px var(--card-glow, transparent);
}
.tier-0 { --card-frame: var(--g-N);   --card-accent: #f1f5f9; --card-glow: rgba(241,245,249,0.16); }
.tier-1 { --card-frame: var(--g-R);   --card-accent: #4ade80; --card-glow: rgba(74,222,128,0.26); }
.tier-2 { --card-frame: var(--g-SR);  --card-accent: #38bdf8; --card-glow: rgba(56,189,248,0.30); }
.tier-3 { --card-frame: var(--g-SSR); --card-accent: #c084fc; --card-glow: rgba(192,132,252,0.34); }
.tier-4 { --card-frame: var(--g-UR);  --card-accent: #fb923c; --card-glow: rgba(251,146,60,0.40); }
.tier-5 { --card-frame: var(--g-EX);  --card-accent: #ef4444; --card-glow: rgba(239,68,68,0.46); }
.tier-6 { --card-frame: var(--g-MR);  --card-accent: #ffd12f; --card-glow: rgba(255,209,47,0.55); }

.dm-face-core {
  width: 100%; height: 100%; border-radius: 9px;
  background: #171b1f; border: 1px solid rgba(255,255,255,0.14);
  display: flex; flex-direction: column; overflow: hidden;
}
.dm-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px 7px; background: #202529; border-bottom: 1px solid var(--border-soft);
}
.dm-head-left { display: flex; align-items: center; gap: 7px; min-width: 0; }
.rarity-pill {
  flex: none; padding: 2px 7px; border-radius: 5px; font-weight: 700; font-size: 12px;
  color: #121416; background: var(--card-frame);
}
.tier-5 .rarity-pill { color: #ffffff; }
.tier-6 .rarity-pill { color: #1a1204; }
.dm-names { min-width: 0; }
.dm-name { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.2; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-en { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dm-attr-badge { width: 24px; height: 24px; flex: none; object-fit: contain; image-rendering: pixelated; }

/* Exact 272x186 dmdd stage (NO scene name, NO extra bottom labels!) */
.dm-stage-outer {
  padding: 6px 0; background: #0f1215; border-bottom: 1px solid var(--border);
  display: flex; justify-content: center; align-items: center; flex: none;
}
.dm-stage {
  position: relative; width: 272px; height: 186px; flex: none;
  overflow: hidden; border-radius: 4px; border: 1px solid #32393f;
  background: #0b0e11; cursor: default;
}
.dm-stage-canvas { display: block; width: 272px; height: 186px; image-rendering: pixelated; }
.dm-stage-top-chips {
  position: absolute; top: 6px; left: 6px; right: 6px; z-index: 3;
  display: flex; justify-content: space-between; align-items: center; pointer-events: none;
}
.dm-serial {
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px;
  background: rgba(18,20,22,0.82); border: 1px solid rgba(255,255,255,0.2); color: #F0F2E6;
}
.dm-dp {
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px;
  background: rgba(18,20,22,0.88); border: 1px solid var(--gold-dim); color: var(--gold);
}
.dm-shiny-chip {
  position: absolute; bottom: 6px; right: 6px; z-index: 3;
  font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 4px;
  background: var(--gold); color: #121416; pointer-events: none;
}

/* Simplified Card Body (3-cell meta NEVER squished!) */
.dm-body {
  flex: 1; padding: 9px 11px 10px; display: flex; flex-direction: column; gap: 8px;
  background: #171b1f; min-height: 0;
}
.dm-meta-3 {
  flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
}
.dm-meta-3 span {
  display: block; text-align: center; font-size: 12px; font-weight: 700; color: var(--ink);
  padding: 6px 4px; border-radius: 6px;
  background: var(--panel); border: 1px solid var(--border-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dm-evo-meter {
  flex: none; background: var(--panel); border: 1px solid var(--border-soft); border-radius: 6px;
  padding: 6px 9px;
}
.dm-evo-top {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 5px;
}
.dm-evo-top span { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dm-evo-top b { color: var(--card-accent, var(--gold)); flex: none; }
.dm-evo-cells { display: flex; gap: 4px; height: 6px; }
.dm-evo-cells i { flex: 1; border-radius: 2px; background: #121416; border: 1px solid #384047; }
.dm-evo-cells i.filled {
  background: var(--card-accent, var(--gold));
  border-color: var(--card-accent, #ffe885);
  box-shadow: 0 0 6px color-mix(in srgb, var(--card-accent, #ffd12f) 65%, transparent);
}

.dm-skills-box { flex: 1; display: flex; flex-direction: column; gap: 5px; min-height: 0; }
.dm-sec-title { flex: none; font-size: 11px; font-weight: 700; color: var(--gold); }
.dm-skills-list { display: flex; flex-direction: column; gap: 5px; }
.dm-skill-item {
  flex: none; display: flex; align-items: center; gap: 7px;
  padding: 5px 9px; border-radius: 6px;
  background: #202529; border: 1px solid var(--border-soft); border-left: 3px solid var(--card-accent);
}
.dm-skill-ico { color: var(--card-accent); font-size: 11px; flex: none; }
.dm-skill-name { font-size: 13px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* D-Style Layered Dynamic Circuit Card Back (300x492 / 292x478, crisp 13px clip-path radius, always rarity-colored & flowing!) */
.dm-back {
  transform: rotateY(180deg); padding: 0; background: #0d1016;
  border: none; border-radius: 13px; overflow: hidden;
  clip-path: inset(0 round 13px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.55);
  --back-stops: #B6BCC4 0%, #7A838E 50%, #4C535E 100%;
  --back-angle: 135deg;
  --back-dur: 7.2s;
}
.dm-back-base,
.dm-back-logo {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; pointer-events: none;
  -webkit-user-drag: none; user-drag: none;
}
.dm-back-traces {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
  background-image: linear-gradient(var(--back-angle), var(--back-stops));
  background-size: 240% 240%;
  background-position: 0% 0%;
  -webkit-mask: url('../assets/card-backs/d-circuit/02_trace-mask.png') center / cover no-repeat;
  mask: url('../assets/card-backs/d-circuit/02_trace-mask.png') center / cover no-repeat;
  mask-mode: alpha;
  animation: dm-back-flow var(--back-dur) ease-in-out infinite;
}
/* Vivid moving specular crest inside each tier's exact hue so circuit flow is unmistakably alive! */
.tier-0 .dm-back { --back-stops: #4C535E 0%, #8A94A0 34%, #E2E8F0 50%, #7A838E 66%, #4C535E 100%; --back-dur: 5.4s; }
.tier-1 .dm-back { --back-stops: #166534 0%, #22C55E 34%, #BBF7D0 50%, #16A34A 66%, #14532D 100%; --back-dur: 5.2s; }
.tier-2 .dm-back { --back-stops: #075985 0%, #0EA5E9 32%, #E0F2FE 50%, #38BDF8 68%, #0369A1 100%; --back-dur: 4.8s; }
.tier-3 .dm-back { --back-stops: #5B21B6 0%, #9333EA 32%, #F3E8FF 50%, #C084FC 68%, #4C1D95 100%; --back-dur: 4.8s; }
.tier-4 .dm-back { --back-stops: #9A3412 0%, #EA580C 32%, #FFEDD5 50%, #FB923C 68%, #7C2D12 100%; --back-dur: 4.6s; }
.tier-5 .dm-back { --back-stops: #7F1D1D 0%, #DC2626 32%, #FECACA 50%, #EF4444 68%, #7F1D1D 100%; --back-dur: 4.6s; }
.tier-6 .dm-back {
  --back-stops: #D08E9E 0%, #CFB477 25%, #71AC98 50%, #6B9BB4 75%, #9D89B6 100%;
  --back-angle: 125deg;
  --back-dur: 7.5s;
}
@keyframes dm-back-flow {
  0%, 100% { background-position: 0% 0%; }
  50%      { background-position: 100% 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .dm-back-traces { animation: none !important; }
}
@supports not ((mask-mode: alpha) or (-webkit-mask-image: url(''))) {
  .dm-back-traces { background: url('../assets/card-backs/d-circuit/04_MR_柔彩圆角预览.png') center / cover no-repeat; }
}
.dm-evo-marquee {
  overflow: hidden; white-space: nowrap; flex: 1; min-width: 0;
}
.dm-evo-marquee > span {
  display: inline-block; padding-left: 100%;
  animation: evoMarquee 9s linear infinite;
}
@keyframes evoMarquee { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* ---------- Binder / 图鉴 (1:1 100bcards Controls + 2-per-row) ---------- */
.view-head { margin-bottom: 10px; }
.view-head h2 { margin: 0; font-size: 20px; font-weight: 800; display: flex; align-items: baseline; gap: 8px; }
.view-head p { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.trophy-total { font-size: 13px; color: var(--gold); font-weight: 700; }

.binder-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 10px;
  flex-wrap: wrap; margin: 10px 0 10px;
}
.binder-tabs {
  display: inline-flex; padding: 3px; border-radius: 99px;
  background: var(--panel); border: 1px solid var(--border-soft);
}
.binder-tabs button {
  padding: 5px 14px; border-radius: 99px; font-size: 13px; font-weight: 700;
  color: var(--muted); background: transparent; white-space: nowrap;
}
.binder-tabs button[aria-pressed="true"] {
  background: linear-gradient(180deg, #262932, #15171d);
  color: #ffd12f;
  border: 1px solid rgba(255, 209, 47, 0.52);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
}
.binder-sort {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 99px;
  background: var(--panel); border: 1px solid var(--border-soft); color: var(--ink);
}
.binder-sort svg { width: 14px; height: 14px; flex: none; color: var(--muted); }
.binder-sort select {
  appearance: none; background: transparent; border: none; color: var(--ink);
  font: inherit; font-size: 12px; font-weight: 700; padding-right: 4px; outline: none; cursor: pointer;
}
.binder-sort select option { background: #ffffff; color: #1e242c; }

/* 7-Color Rarity Filter Pills (N-MR: 白 / 绿 / 蓝 / 紫 / 橙 / 红 / 彩) */
.tier-filter { display: flex; gap: 7px; flex-wrap: wrap; margin: 0 0 12px; }
.tier-pill {
  position: relative; overflow: hidden;
  padding: 5px 12px; border-radius: 99px; font-size: 12px; font-weight: 800;
  color: #fff; border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 2px 5px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.42);
  transition: opacity .2s, transform .2s cubic-bezier(.22,1,.36,1), box-shadow .2s;
}
.tier-pill:hover { transform: translateY(-1px) scale(1.04); }
.tier-pill:active { transform: scale(.95); }
.tier-pill.tp-all { background: linear-gradient(180deg, #3a4149, #24292f); color: #e2e8f0; }
.tier-pill.tp-0   { background: linear-gradient(180deg, #f8fafc, #cbd5e1); color: #121416; }
.tier-pill.tp-1   { background: linear-gradient(180deg, #4ade80, #15803d); color: #052e16; }
.tier-pill.tp-2   { background: linear-gradient(180deg, #38bdf8, #0369a1); color: #fff; }
.tier-pill.tp-3   { background: linear-gradient(180deg, #c084fc, #6d28d9); color: #fff; }
.tier-pill.tp-4   { background: linear-gradient(180deg, #fb923c, #c2410c); color: #fff; }
.tier-pill.tp-5   { background: linear-gradient(180deg, #f87171, #b91c1c); color: #fff; }
.tier-pill.tp-6   { background: linear-gradient(110deg, #fb7185, #fde047 35%, #34d399 65%, #38bdf8 85%, #c084fc); color: #121416; }
.tier-filter.filtering .tier-pill:not(.active) { opacity: .42; }
.tier-pill.active {
  transform: scale(1.1);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #181c20, 0 4px 12px rgba(0,0,0,0.5);
}

.dex-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dex-empty {
  grid-column: 1 / -1;
  min-height: 180px;
  display: grid; place-items: center;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
  color: #94a3b8;
  font-size: 14px; font-weight: 700; letter-spacing: 0.04em;
}
.dex-item {
  background: var(--panel); border: 2px solid var(--border); border-radius: 10px;
  overflow: hidden; text-align: left; display: flex; flex-direction: column; padding: 0;
  position: relative; transition: transform .15s, box-shadow .15s;
}
.dex-item:hover { transform: translateY(-2px); }
.dex-item.locked { opacity: .62; filter: grayscale(0.25); }

/* Tiered Rarity VFX Frames in Binder (N白 / R绿 / SR蓝 / SSR紫 / UR橙 / EX红 / MR彩) */
.dex-item.t-border-0 { border-color: #cbd5e1; }
.dex-item.t-border-1 {
  border-color: #4ade80;
  box-shadow: 0 0 12px rgba(74,222,128,0.24), inset 0 0 0 1px rgba(134,239,172,0.3);
}
.dex-item.t-border-2 {
  border-color: #38bdf8;
  box-shadow: 0 0 14px rgba(56,189,248,0.28), inset 0 0 0 1px rgba(147,197,253,0.35);
}
.dex-item.t-border-3 {
  border-color: #c084fc;
  box-shadow: 0 0 18px rgba(192,132,252,0.38), inset 0 0 0 1px rgba(233,213,255,0.4);
}
.dex-item.t-border-4 {
  border-color: #fb923c;
  box-shadow: 0 0 20px rgba(251,146,60,0.44), inset 0 0 0 1px rgba(254,215,170,0.45);
}
.dex-item.t-border-5 {
  border-color: #ef4444;
  box-shadow: 0 0 22px rgba(239,68,68,0.52), inset 0 0 0 1px rgba(254,202,202,0.45);
}
.dex-item.t-border-6 {
  border: 2px solid transparent;
  background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--g-MR) border-box;
  box-shadow: 0 0 24px rgba(255,209,47,0.62);
}
.dex-item.t-border-3::after,
.dex-item.t-border-4::after,
.dex-item.t-border-5::after,
.dex-item.t-border-6::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: linear-gradient(120deg, transparent 32%, rgba(255,255,255,0.18) 48%, transparent 64%);
  background-size: 240% 240%; animation: binderSheen 4.5s linear infinite;
}
@keyframes binderSheen { 0% { background-position: 140% 0%; } 100% { background-position: -140% 100%; } }

.dex-thumb-box { position: relative; width: 100%; aspect-ratio: 272 / 186; background: #0d1014; overflow: hidden; }
.dex-thumb-canvas { display: block; width: 100%; height: 100%; }
.dex-thumb-id {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
  background: rgba(18,20,22,0.82); color: #F0F2E6;
}
.dex-thumb-badge {
  position: absolute; top: 6px; right: 6px; z-index: 2; overflow: hidden;
  font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.dex-thumb-fav {
  position: absolute; right: 6px; bottom: 6px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(18, 20, 26, 0.82);
  border: 1px solid rgba(255, 77, 109, 0.58);
  color: #ff4d6d; font-size: 13px; line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.36);
}
.dex-item-foot { width: 100%; padding: 8px 10px; background: #181c22; border-top: 1px solid rgba(255,255,255,0.08); }
.dex-item-name { font-size: 14px; font-weight: 700; color: #f8fafc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.t-N   { background: #f1f5f9; color: #121416; }
.t-R   { background: #22c55e; color: #052e16; }
.t-SR  { background: #0284c7; color: #fff; }
.t-SSR { background: #7c3aed; color: #fff; }
.t-UR  { background: #ea580c; color: #fff; }
.t-EX  { background: #dc2626; color: #fff; }
.t-MR  { background: linear-gradient(90deg, #fb7185, #fde047, #34d399, #38bdf8, #c084fc); color: #121416; }

.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 14px; }

/* Fusion Forge */
.fusion-list { display: flex; flex-direction: column; gap: 9px; }
.fusion-row {
  background: var(--panel); border: 1px solid var(--border); border-radius: 9px;
  padding: 10px; display: flex; flex-direction: column; gap: 7px;
}
.fusion-row.mr { border-color: var(--gold-dim); background: #262118; }
.fusion-target { display: flex; align-items: center; gap: 8px; }
.fusion-target img { width: 42px; height: 42px; object-fit: contain; image-rendering: pixelated; background: #121416; border-radius: 6px; padding: 2px; }
.fusion-mats { display: flex; flex-wrap: wrap; gap: 6px; }
.mat-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px; border-radius: 5px; font-size: 12px;
  background: #14181c; border: 1px solid var(--border-soft);
}
.mat-chip.ok { border-color: #22c55e; color: #86efac; }
.mat-chip img { width: 20px; height: 20px; object-fit: contain; image-rendering: pixelated; }
.fusion-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ---------- Trophies (210 Digimon IP Trophies with 5 Grades: W/B/P/O/X) ---------- */
.trophy-list { display: flex; flex-direction: column; gap: 8px; }
.trophy-item {
  background: var(--panel); border: 1px solid var(--border-soft); border-radius: 10px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 6px;
}
.trophy-item.done { border-color: #d4a017; background: linear-gradient(180deg, #fffdf5, #fef9e7); }
.trophy-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.trophy-name { font-size: 14px; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 7px; }
.trophy-digivice-ico {
  width: 28px; height: 28px; object-fit: contain; flex: none; display: block;
  filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.22));
}
.trophy-rung {
  font-size: 11px; font-weight: 800; padding: 3px 10px; border-radius: 99px;
  background: linear-gradient(180deg, #262932, #15171d);
  border: 1px solid rgba(255, 209, 47, 0.52);
  color: #ffd12f;
}
.trophy-desc { font-size: 12px; color: var(--muted); }
.trophy-bar { height: 7px; border-radius: 99px; background: #e2e8f0; overflow: hidden; }
.trophy-bar i { display: block; height: 100%; background: linear-gradient(90deg, #d4a017, #ffd12f); border-radius: 99px; }

/* ---------- Market (1:1 100bcards: Level Pack + Free Base Supply + 6 Rarity-Colored Shelf Packs) ---------- */
.market-free { margin-bottom: 10px; }
.offer {
  position: relative; border-radius: 14px; padding: 11px 12px; overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 8px 20px rgba(0,0,0,0.42);
}
.offer.free {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(140deg, #d97706 0%, #9a3412 58%, #451a03 100%);
  border-color: rgba(253,186,116,0.68);
  box-shadow: 0 8px 22px rgba(217,119,6,0.28), inset 0 1px 0 rgba(255,255,255,0.25);
}
.offer.free.base {
  background: linear-gradient(140deg, #1d4ed8 0%, #1e3a8a 60%, #0f172a 100%);
  border-color: rgba(147,197,253,0.55);
}
.offer.taken, .offer.locked { opacity: .68; }
.offer-pack {
  flex: none; display: grid; place-items: center; perspective: 420px; position: relative;
}
.offer-pack img {
  width: 74px; height: 108px; object-fit: contain; display: block;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.62));
  transform-style: preserve-3d;
  animation: miniPackSway 4.6s ease-in-out var(--ph, 0s) infinite;
  transition: transform .22s cubic-bezier(.22,1,.36,1), filter .22s;
}
.offer:hover .offer-pack img {
  filter: drop-shadow(0 10px 16px rgba(15, 23, 42, 0.28));
}
@keyframes miniPackSway {
  0%, 100% { transform: translateY(0px) rotateY(-8deg) rotateZ(-1.5deg); }
  50% { transform: translateY(-4px) rotateY(9deg) rotateZ(1.5deg); }
}
.offer.claim-burst { animation: offerClaimPop .46s cubic-bezier(.22,1.25,.36,1); }
@keyframes offerClaimPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); box-shadow: 0 0 28px rgba(255,209,47,0.65); }
  100% { transform: scale(1); }
}
.free-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.offer-name { font-size: 15px; font-weight: 800; color: #fff; }
.offer-name span { color: var(--gold); font-size: 13px; }
.free-timer { margin: 0; font-size: 12px; color: rgba(255,255,255,0.78); }
.offer .claim {
  align-self: flex-start; padding: 6px 16px; border-radius: 10px;
  background: var(--gold); color: #121416; font-size: 12px; font-weight: 800;
}
.offer .claim:disabled { background: rgba(255,255,255,0.18); color: rgba(255,255,255,0.65); }

.market-bar { display: flex; justify-content: center; margin: 12px 0 10px; }
.market-timer {
  margin: 0; font-size: 12px; font-weight: 700; color: var(--muted);
  padding: 4px 12px; border-radius: 99px; background: var(--panel); border: 1px solid var(--border-soft);
}
.market-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.offer.shelf-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 11px 10px 11px;
}
.offer.shelf-card .offer-pack img { width: 72px; height: 104px; }
.offer.shelf-card .offer-name { font-size: 11.5px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.offer.shelf-card .claim { align-self: center; width: 100%; padding: 5px 6px; font-size: 11.5px; border-radius: 7px; }
.offer.shelf-white {
  background: linear-gradient(170deg, #333b44 0%, #1b2026 100%);
  border-color: rgba(203, 213, 225, 0.36);
}
.offer.shelf-green {
  background: linear-gradient(170deg, #166534 0%, #0a2e1a 100%);
  border-color: rgba(74, 222, 128, 0.45);
}
.offer.shelf-blue {
  background: linear-gradient(170deg, #2146a8 0%, #0c1c57 100%);
  border-color: rgba(127,176,255,0.48);
}
.offer.shelf-purple {
  background: linear-gradient(170deg, #5626b4 0%, #1f0d4f 100%);
  border-color: rgba(194,155,255,0.50);
}
.offer.shelf-gold {
  background: linear-gradient(165deg, #ea580c 0%, #9a3412 58%, #431407 100%);
  border-color: rgba(253,186,116,0.72);
  box-shadow: 0 8px 22px rgba(234,88,12,0.26), inset 0 1px 0 rgba(255,255,255,0.24);
}

/* 1:1 100bcards Level-Up Celebration Dialog */
.level-dialog {
  position: fixed; inset: 0; z-index: 85; background: rgba(6,8,12,0.72);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: grid; place-items: center; padding: 16px;
}
.lu-panel {
  width: 100%; max-width: 360px; border-radius: 14px; padding: 20px 18px 18px;
  background: linear-gradient(180deg, #232730, #13161b); border: 2px solid #ffd12f;
  box-shadow: 0 20px 60px rgba(0,0,0,0.75), 0 0 36px rgba(255,209,47,0.28);
  text-align: center; position: relative; overflow: hidden;
}
.lu-title { margin: 0; font-size: 14px; font-weight: 800; letter-spacing: .18em; color: #ffd12f; }
.lu-levels {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 10px 0 14px; font-size: 30px; font-weight: 900;
}
.lu-old { color: #94a3b8; font-size: 24px; }
.lu-new { color: #ffd12f; font-size: 28px; text-shadow: 0 0 18px rgba(255,209,47,0.55); }
.lu-levels i, .lu-arr-big { font-style: normal; font-size: 20px; font-weight: 800; color: #f8fafc; }
.lu-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.lu-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px; border-radius: 7px; background: #101318; font-size: 12px;
}
.lu-row .lu-a { color: #94a3b8; margin-left: auto; }
.lu-row .lu-arr { color: #94a3b8; }
.lu-row .lu-b { font-weight: 800; min-width: 58px; text-align: right; }
.lu-row.up .lu-b, .lu-row.up .lu-arr { color: #4ade80; }
.lu-row.down .lu-b { color: #94a3b8; }
.lu-chest-note { font-size: 12px; color: #ffd12f; margin: 0 0 14px; }
.lu-ok {
  width: 100%; padding: 11px; border-radius: 10px;
  background: linear-gradient(180deg, #332c19 0%, #1b170d 100%);
  border: 1.5px solid #ffd12f; color: #ffd12f;
  box-shadow: 0 6px 18px rgba(255,209,47,0.22), inset 0 1px 0 rgba(255,255,255,0.14);
  font-size: 15px; font-weight: 800;
}

/* ---------- Shared Dock (图3黑金配色 + Codex 黑金图标 + 市场红色数字角标) ---------- */
.shared-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: linear-gradient(180deg, rgba(243,245,249,0) 0%, rgba(243,245,249,0.88) 34%, rgba(243,245,249,0.98) 100%);
  padding: 10px 12px 9px;
}
.dock-nav {
  position: relative;
  max-width: 460px; margin: 0 auto 8px;
  display: grid; grid-template-columns: repeat(4, 1fr); align-items: stretch;
  padding: 3px; border-radius: 99px;
  background: linear-gradient(180deg, #22252a 0%, #121417 100%);
  border: 1px solid rgba(255,209,47,0.34);
  box-shadow: 0 10px 26px rgba(0,0,0,0.62), inset 0 1px 0 rgba(255,255,255,0.1);
}
.dock-slider {
  position: absolute; top: 3px; bottom: 3px; left: 3px; z-index: 0;
  width: calc((100% - 6px) / 4);
  border-radius: 99px; pointer-events: none;
  background: linear-gradient(180deg, #3c341d 0%, #241f11 100%);
  border: 1.5px solid #ffd12f;
  box-shadow: 0 4px 14px rgba(255,209,47,0.24), inset 0 1px 0 rgba(255,255,255,0.18);
  transform: translateX(calc(var(--tab-idx, 0) * 100%));
  transition: transform 0.28s cubic-bezier(0.22, 1.12, 0.36, 1);
  will-change: transform;
}
.dock-btn {
  position: relative; z-index: 1; padding: 9px 6px; border-radius: 99px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: 13px; font-weight: 700; color: rgba(240,242,230,0.72);
  background: transparent; border: 1.5px solid transparent;
  transition: transform .16s cubic-bezier(.22,1,.36,1), color .2s;
}
.dock-btn:not(:last-child)::after {
  content: ''; position: absolute; right: 0; top: 24%; bottom: 24%; width: 1px;
  background: rgba(255,209,47,0.18); pointer-events: none;
}
.dock-btn.active::after, .dock-btn:has(+ .dock-btn.active)::after { opacity: 0; }
.dock-btn:hover { color: #ffd12f; }
.dock-btn:active { transform: scale(.95); }
.dock-btn.active {
  color: #ffd12f;
}
.dock-ico-img { width: 18px; height: 18px; object-fit: contain; display: block; flex: none; -webkit-user-drag: none; }
.entry-badge {
  position: absolute; top: -4px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 99px; background: #ef4444; color: #fff; font-size: 11px; font-weight: 800;
  font-style: normal; display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(239,68,68,0.55), 0 0 0 1.5px #121417;
}
.dock-foot {
  max-width: 460px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.foot-left-grp { display: inline-flex; align-items: center; gap: 6px; }
.foot-btn.icon-only { width: 26px; height: 26px; padding: 0; display: grid; place-items: center; font-weight: 800; font-style: normal; }
.foot-btn {
  font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 10px;
  background: rgba(34,40,46,0.9); border: 1px solid var(--border-soft); color: var(--muted);
  transition: transform .15s, border-color .15s, color .15s;
}
.foot-btn.icon-only { border-radius: 50%; }
.foot-btn:hover { transform: translateY(-1px); border-color: var(--gold-dim); color: var(--ink); }
.foot-btn:active { transform: scale(.95); }
.foot-btn.gold { border-color: rgba(200,167,104,0.45); color: #f6e6bd; }
.gift-pill { display: inline-flex; align-items: center; gap: 5px; }
.gift-ico-img { width: 15px; height: 15px; object-fit: contain; display: block; -webkit-user-drag: none; }
.counter { margin: 0; font-size: 12px; color: var(--muted); }
.counter b { color: var(--gold); }

/* ---------- Generic Buttons / Toast / Modals / Evolution Cinema ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 13px;
  border: 1px solid var(--border); background: var(--panel); color: var(--ink);
}
.btn.primary {
  background: linear-gradient(180deg, #272a33, #15171d);
  color: #ffd12f;
  border-color: rgba(255, 209, 47, 0.65);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.16);
}
.btn.ghost { background: #181c20; color: #f8fafc; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.toast-banner {
  position: fixed; bottom: 112px; left: 50%; transform: translateX(-50%); z-index: 90;
  padding: 9px 18px; border-radius: 99px; font-size: 13px; font-weight: 700;
  background: linear-gradient(180deg, #2b2718, #16140d); border: 1.5px solid #ffd12f; color: #ffd12f;
  box-shadow: 0 10px 28px rgba(0,0,0,0.65), 0 0 16px rgba(255,209,47,0.28); white-space: nowrap;
}
.toast-banner.pop-in { animation: toastPopIn .38s cubic-bezier(.22,1.25,.36,1) both; }
@keyframes toastPopIn {
  0%   { opacity: 0; transform: translate(-50%, 16px) scale(0.86); }
  100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ---------- High-Impact Charge-Shake -> Flip-Slam -> Screen-Shake Rare Reveal (Image 7!) ---------- */
.dm-card-wrap.charge-1 { animation: chargeShake1 .32s linear infinite; filter: drop-shadow(0 0 18px #4ade80); }
.dm-card-wrap.charge-2 { animation: chargeShake2 .22s linear infinite; filter: drop-shadow(0 0 26px #38bdf8); }
.dm-card-wrap.charge-3 { animation: chargeShake3 .16s linear infinite; filter: drop-shadow(0 0 36px #c084fc); }
.dm-card-wrap.charge-4 { animation: chargeShake4 .12s linear infinite; filter: drop-shadow(0 0 48px #fb923c); }
@keyframes chargeShake1 { 0%,100%{transform:translate(0,0) scale(0.95)} 25%{transform:translate(-2px,1px) scale(0.97)} 75%{transform:translate(2px,-1px) scale(0.97)} }
@keyframes chargeShake2 { 0%,100%{transform:translate(0,0) scale(0.96)} 25%{transform:translate(-4px,2px) rotate(-1.2deg) scale(0.99)} 75%{transform:translate(4px,-2px) rotate(1.2deg) scale(0.99)} }
@keyframes chargeShake3 { 0%,100%{transform:translate(0,0) scale(0.98)} 25%{transform:translate(-6px,3px) rotate(-2deg) scale(1.03)} 75%{transform:translate(6px,-3px) rotate(2deg) scale(1.03)} }
@keyframes chargeShake4 { 0%,100%{transform:translate(0,0) scale(1.0)} 20%{transform:translate(-9px,4px) rotate(-3deg) scale(1.06)} 50%{transform:translate(9px,-4px) rotate(3deg) scale(1.08)} 80%{transform:translate(-6px,-3px) rotate(-2deg) scale(1.05)} }

.dm-card-wrap.slam-1 { animation: cardSlam1 .36s cubic-bezier(.2,.9,.3,1.2) both; }
.dm-card-wrap.slam-2 { animation: cardSlam2 .42s cubic-bezier(.2,.9,.3,1.2) both; }
.dm-card-wrap.slam-3 { animation: cardSlam3 .48s cubic-bezier(.18,.95,.28,1.22) both; }
.dm-card-wrap.slam-4 { animation: cardSlam4 .56s cubic-bezier(.16,.98,.25,1.25) both; }
@keyframes cardSlam1 { 0%{transform:scale(1.12)} 55%{transform:scale(0.96)} 100%{transform:scale(1)} }
@keyframes cardSlam2 { 0%{transform:scale(1.22) translateY(-14px)} 50%{transform:scale(0.93) translateY(5px)} 100%{transform:scale(1)} }
@keyframes cardSlam3 { 0%{transform:scale(1.34) translateY(-24px)} 48%{transform:scale(0.90) translateY(8px)} 100%{transform:scale(1)} }
@keyframes cardSlam4 { 0%{transform:scale(1.48) translateY(-34px)} 45%{transform:scale(0.86) translateY(12px)} 75%{transform:scale(1.04)} 100%{transform:scale(1)} }

.frame.shake-1 { animation: screenShake1 .24s ease-out; }
.frame.shake-2 { animation: screenShake2 .32s ease-out; }
.frame.shake-3 { animation: screenShake3 .42s ease-out; }
.frame.shake-4 { animation: screenShake4 .54s ease-out; }
@keyframes screenShake1 { 0%,100%{transform:translate(0,0)} 30%{transform:translate(-3px,2px)} 65%{transform:translate(3px,-2px)} }
@keyframes screenShake2 { 0%,100%{transform:translate(0,0)} 20%{transform:translate(-6px,4px)} 50%{transform:translate(6px,-4px)} 80%{transform:translate(-3px,2px)} }
@keyframes screenShake3 { 0%,100%{transform:translate(0,0)} 15%{transform:translate(-9px,6px)} 38%{transform:translate(9px,-6px)} 62%{transform:translate(-5px,4px)} 82%{transform:translate(4px,-3px)} }
@keyframes screenShake4 { 0%,100%{transform:translate(0,0)} 12%{transform:translate(-13px,8px) rotate(-0.8deg)} 30%{transform:translate(13px,-8px) rotate(0.8deg)} 50%{transform:translate(-9px,6px) rotate(-0.5deg)} 72%{transform:translate(7px,-4px)} 88%{transform:translate(-3px,2px)} }

/* ---------- 1:1 100bcards R/SR/SSR/UR Reveal Ceremony ---------- */
.dim {
  position: fixed; inset: 0; z-index: 25; pointer-events: none;
  background: #05060a; opacity: 0; transition: opacity .35s ease;
}
/* Fix Point 1 (Image 1): Center rays strictly on (--ray-x, --ray-y) with translate(-50%,-50%) — ZERO bottom-right offset! */
.ur-rays {
  position: fixed; inset: 0; z-index: 26; pointer-events: none; opacity: 0;
  overflow: hidden; transition: opacity .4s ease;
}
.ur-rays.go { opacity: 1; }
.ur-rays i {
  position: fixed; left: var(--ray-x, 50%); top: var(--ray-y, 44%);
  width: 160vmax; height: 160vmax; display: block;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, rgba(192,132,252,0.18) 0 8deg, transparent 8deg 22deg);
  animation: raySpin 14s linear infinite;
}
.ur-rays.ur i {
  background: repeating-conic-gradient(from 0deg, rgba(251,146,60,0.22) 0 7deg, rgba(253,224,71,0.16) 7deg 13deg, transparent 13deg 22deg);
}
@keyframes raySpin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 7-Color Synced Flash & Splash (R绿 / SR蓝 / SSR紫 / UR橙 / EX红 / MR彩) */
.flash {
  position: fixed; inset: 0; z-index: 55; pointer-events: none; opacity: 0;
}
.flash.R   { background: radial-gradient(circle at 50% 44%, #dcfce7 0%, #22c55e 30%, transparent 70%); }
.flash.SR  { background: radial-gradient(circle at 50% 44%, #e0f2fe 0%, #38bdf8 32%, transparent 72%); }
.flash.SSR { background: radial-gradient(circle at 50% 44%, #f3e8ff 0%, #a855f7 34%, transparent 74%); }
.flash.UR  { background: radial-gradient(circle at 50% 44%, #fff7ed 0%, #fb923c 30%, #ea580c 52%, transparent 76%); }
.flash.go  { animation: flashPop .72s ease-out both; }
@keyframes flashPop { 0% { opacity: 0; } 14% { opacity: .88; } 100% { opacity: 0; } }

.ur-splash {
  position: fixed; inset: 0; z-index: 56; pointer-events: none;
  display: grid; place-items: center; opacity: 0;
}
.ur-splash b {
  font-size: 74px; font-weight: 900; letter-spacing: .12em;
  text-shadow: 0 6px 32px rgba(0,0,0,0.75);
}
.ur-splash.SR b  { color: #bae6fd; text-shadow: 0 0 28px #38bdf8; }
.ur-splash.SSR b { color: #e9d5ff; text-shadow: 0 0 34px #a855f7; }
.ur-splash.UR b  {
  background: linear-gradient(90deg, #fde047, #fb923c, #ef4444);
  -webkit-background-clip: text; color: transparent;
  filter: drop-shadow(0 0 26px rgba(251,146,60,0.85));
}
.ur-splash.go { animation: splashBurst 1.15s cubic-bezier(.2,.8,.2,1) both; }
@keyframes splashBurst {
  0% { opacity: 0; transform: scale(2.1); }
  22% { opacity: 1; transform: scale(0.96); }
  68% { opacity: 1; transform: scale(1.02); }
  100% { opacity: 0; transform: scale(1.25); }
}

.fx-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%; z-index: 54; pointer-events: none;
}

/* Soft luminous veil for Evolution intro (Point 2: NO harsh blinding white flash!) */
.evo-flash-white {
  position: fixed; inset: 0; z-index: 95; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 45%, rgba(254,243,199,0.72) 0%, rgba(186,230,253,0.45) 45%, rgba(15,23,42,0.2) 100%);
}
.evo-flash-white.go { animation: evoWhiteSweep .52s ease-out both; }
@keyframes evoWhiteSweep {
  0% { opacity: 0; }
  35% { opacity: 0.68; }
  100% { opacity: 0; }
}

.evo-overlay { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 14px; }
.evo-backdrop {
  position: absolute; inset: 0; background: rgba(7, 9, 13, 0.84);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.evo-stage {
  position: relative; z-index: 2; width: 100%; max-width: 360px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.evo-card-stage { margin: 0 auto; }
.evo-card-slot { position: relative; z-index: 2; width: 300px; height: 492px; }
.evo-card-wipe {
  position: absolute; inset: 0; width: 300px; height: 492px; z-index: 12;
  border-radius: 13px; pointer-events: none; image-rendering: pixelated;
}
.evo-stage-video {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 8;
  display: block; pointer-events: none;
}
.dm-body { transition: opacity .45s ease, filter .45s ease; }
.dm-body.evo-fade-out { opacity: 0.04; filter: brightness(0); }
.dm-head { transition: opacity .45s ease, filter .45s ease; }
.dm-head.evo-fade-out { opacity: 0.06; filter: brightness(0); }
.evo-cta-row { min-height: 46px; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 80; background: rgba(8,10,13,0.68);
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  display: grid; place-items: center; padding: 14px;
}
.odds-list { display: flex; flex-direction: column; gap: 8px; }
.odds-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-radius: 10px;
  background: #161a1f; border: 1px solid var(--border-soft);
}
.odds-badge {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
  min-width: 56px; padding: 4px 12px; border-radius: 99px; font-size: 12px; font-weight: 800;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.45);
}
.odds-badge::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,0.55) 50%, transparent 70%) no-repeat;
  background-size: 260% 100%; animation: primarySheen 3.4s ease-in-out infinite;
}
.odds-pct { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.odds-warn {
  margin: 4px 0 0; text-align: center; font-size: 11.5px; color: var(--muted);
}
.modal-box {
  width: 100%; max-width: 400px; max-height: 90vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--gold); border-radius: 10px;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; border-bottom: 1px solid var(--border-soft);
}
.modal-head h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--gold); }
.modal-close { font-size: 22px; line-height: 1; color: var(--muted); padding: 0 4px; }
.modal-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.code-box {
  font-family: ui-monospace, Consolas, monospace; font-size: 14px; font-weight: 700;
  padding: 10px; border-radius: 6px; background: #121416; border: 1px solid var(--gold-dim);
  color: var(--gold); text-align: center; word-break: break-all;
}
.modal-input {
  width: 100%; padding: 9px 10px; border-radius: 6px;
  background: #121416; border: 1px solid var(--border); color: var(--ink);
}
.modal-note { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.modal-warn {
  padding: 9px 10px; border-radius: 6px; background: rgba(239,68,68,0.14);
  border: 1px solid #ef4444; color: #fecaca; font-size: 12px; line-height: 1.5;
}
.odds-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.odds-table th, .odds-table td { padding: 6px 8px; border-bottom: 1px solid var(--border-soft); text-align: left; }
.odds-table th { color: var(--muted); }
.odds-table td:last-child { text-align: right; font-weight: 700; color: var(--gold); }
.demo-list { display: flex; flex-direction: column; gap: 7px; }
.demo-row-btn {
  text-align: left; padding: 9px 11px; border-radius: 7px;
  background: #161a1e; border: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; font-weight: 700;
}
.demo-row-btn:hover { border-color: var(--gold); }


/* ---------- 100bcards 1:1 UI Entry, Chest Pack-Out, Swap, Shop Burst & Card Idle Animations ---------- */
@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(22px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes tileIn {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes trayIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
@keyframes trayPackIn {
  from { opacity: 0; transform: translateY(10px) scale(.9); }
  to   { opacity: 1; transform: none; }
}
@keyframes offerIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes offerFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}
@keyframes offerClaim {
  0%   { transform: translateY(0) scale(1); }
  36%  { transform: translateY(-16px) scale(1.12, 0.94); filter: brightness(1.28) drop-shadow(0 14px 20px rgba(255,209,47,0.45)); }
  66%  { transform: translateY(3px) scale(0.95, 1.05); }
  100% { transform: translateY(0) scale(0.96); }
}
@keyframes chestGot {
  0%   { transform: scale(1) rotate(0); }
  35%  { transform: scale(1.36) rotate(-8deg); filter: brightness(1.35) drop-shadow(0 0 18px rgba(255,209,47,0.85)); }
  68%  { transform: scale(0.92) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes trayLanded {
  0%   { transform: translateY(0) scale(1); }
  40%  { transform: translateY(-7px) scale(1.14); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes stageArrive {
  0%   { transform: translateY(18px) scale(0.92); opacity: 0.72; }
  62%  { transform: translateY(-4px) scale(1.03); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
@keyframes cardIdleSway {
  0%, 100% { transform: rotateX(0deg) rotateY(0deg) translateY(0px); }
  25%      { transform: rotateX(2.4deg) rotateY(-6.5deg) translateY(-3px); }
  50%      { transform: rotateX(0.5deg) rotateY(0deg) translateY(-5px); }
  75%      { transform: rotateX(-2.2deg) rotateY(6.5deg) translateY(-2px); }
}
@keyframes cardIdleSheen {
  0%, 18%  { background-position: 180% 0; opacity: 0; }
  34%      { opacity: 0.24; }
  64%      { background-position: -80% 0; opacity: 0.16; }
  80%, 100%{ background-position: -80% 0; opacity: 0; }
}
@keyframes burstParticle {
  0%   { transform: translate(-50%, -50%) translate3d(0, 0, 0) scale(1.1); opacity: 1; }
  100% { transform: translate(-50%, -50%) translate3d(var(--bx), var(--by), 0) scale(0.15) rotate(var(--br, 90deg)); opacity: 0; }
}
@keyframes modalPop {
  from { opacity: 0; transform: translateY(14px) scale(0.95); }
  to   { opacity: 1; transform: none; }
}

/* Staggered UI entry animations across all views */
.view.active { animation: viewIn .24s cubic-bezier(.22,1,.36,1) both; }
#homeView.active .level-row { animation: riseIn .34s cubic-bezier(.22,1,.36,1) both; }
#homeView.active .stage-3d { animation: riseIn .38s cubic-bezier(.22,1,.36,1) .04s both; }
#homeView.active .pack-tray { animation: trayIn .36s cubic-bezier(.22,1,.36,1) .08s both; }
#homeView.active .tray-item { animation: trayPackIn .32s cubic-bezier(.22,1,.36,1) calc(var(--i, 0) * 28ms) both; }
.tray-item.landed { animation: trayLanded .44s cubic-bezier(.22,1,.36,1) both !important; }
.stage-3d.stage-arrive { animation: stageArrive .34s cubic-bezier(.22,1,.36,1) both !important; }

#binderView.active .view-head,
#trophyView.active .view-head,
#marketView.active .view-head { animation: riseIn .32s cubic-bezier(.22,1,.36,1) both; }
#binderView.active .binder-tabs,
#binderView.active .tier-tabs { animation: riseIn .32s cubic-bezier(.22,1,.36,1) .05s both; }
#binderView.active .dex-item { animation: tileIn .32s cubic-bezier(.22,1,.36,1) calc(var(--i, 0) * 22ms) both; }
#trophyView.active .trophy-item { animation: tileIn .32s cubic-bezier(.22,1,.36,1) calc(var(--i, 0) * 24ms) both; }
#marketView.active .offer { animation: offerIn .34s cubic-bezier(.22,1,.36,1) calc(var(--i, 0) * 45ms) both; }
#marketView.active .offer:not(.taken):not(.locked) .offer-pack { animation: offerFloat 3.1s ease-in-out calc(var(--i, 0) * -0.45s) infinite; }
.offer.offer-claiming .offer-pack { animation: offerClaim .48s cubic-bezier(.22,1,.36,1) both !important; }

.chest-btn.chest-got { animation: chestGot .52s cubic-bezier(.22,1,.36,1) both !important; }
.modal-backdrop:not([hidden]) .modal-box { animation: modalPop .24s cubic-bezier(.22,1,.36,1) both; }

/* Post-open & evolved card idle 3D sway on BOTH front face and flipped card back! */
@keyframes cardIdleSwayBack {
  0%, 100% { transform: rotateY(180deg) rotateX(0deg) translateY(0px); }
  25%      { transform: rotateY(173.5deg) rotateX(2.4deg) translateY(-3px); }
  50%      { transform: rotateY(180deg) rotateX(0.5deg) translateY(-5px); }
  75%      { transform: rotateY(186.5deg) rotateX(-2.2deg) translateY(-2px); }
}
.dm-card-wrap.idle-sway:not(.flipped) .dm-card-inner {
  animation: cardIdleSway 4.8s ease-in-out infinite;
  will-change: transform;
}
.dm-card-wrap.idle-sway.flipped .dm-card-inner {
  animation: cardIdleSwayBack 4.8s ease-in-out infinite;
  will-change: transform;
}
/* Clean hover lift on Shop pack offers (NO yellow aura — matches 100bcards!) */
.offer .offer-pack {
  transition: transform .22s cubic-bezier(.22, 1.3, .36, 1), filter .22s ease;
}
.offer:not(.taken):not(.locked):hover .offer-pack {
  transform: translateY(-6px) scale(1.07) !important;
  filter: drop-shadow(0 10px 14px rgba(15, 23, 42, 0.26));
}
.offer:not(.taken):not(.locked):active .offer-pack {
  transform: translateY(-2px) scale(0.97) !important;
}
/* Expand packRibbons canvas slightly upward so tear-mouth bloom stays right on the pack mouth without touching levelBar */
#packRibbons {
  top: -42px !important;
  height: calc(100% + 42px) !important;
}
.frame:has(#resultView.active) { padding-bottom: 10px; }
.dm-card-wrap.idle-sway .dm-holo-foil::after {
  content: ''; position: absolute; inset: 0; border-radius: 13px; pointer-events: none;
  background: linear-gradient(112deg, transparent 34%, rgba(255,255,255,0.42) 50%, transparent 66%) no-repeat;
  background-size: 240% 100%;
  animation: cardIdleSheen 4.8s ease-in-out infinite;
}

/* Flying pack ghost (clean natural shadow, ZERO yellow glow!) */
.fly-arc-pack {
  position: fixed; z-index: 120; pointer-events: none;
  border-radius: 6px; object-fit: contain;
  filter: drop-shadow(0 14px 22px rgba(15, 23, 42, 0.28));
  will-change: transform, opacity;
}
.fx-burst-dot {
  position: fixed; z-index: 125; pointer-events: none;
  width: var(--bs, 7px); height: var(--bs, 7px); border-radius: 50%;
  background: var(--bc, #ffd12f);
  box-shadow: 0 0 8px var(--bc, #ffd12f);
  animation: burstParticle .56s cubic-bezier(.16,.84,.44,1) both;
}
.dock-btn.dock-pulse { animation: trayLanded .42s cubic-bezier(.22,1,.36,1) both; }
.claim.is-locked { opacity: 0.48; filter: grayscale(0.55); cursor: not-allowed; }

/* Cascading EXP gain float pills & level bar tick on return to Home */
.exp-fly-pill {
  position: fixed; z-index: 130; pointer-events: none;
  padding: 4px 11px; border-radius: 99px;
  font-size: 12px; font-weight: 900; letter-spacing: 0.04em;
  color: #fff; background: rgba(18, 22, 30, 0.92);
  border: 1.5px solid var(--ep-col, #ffd12f);
  box-shadow: 0 4px 14px rgba(0,0,0,0.45), 0 0 12px var(--ep-col, #ffd12f);
  transform: translate(-50%, -50%);
  animation: expPillFloat 0.92s cubic-bezier(.16,.84,.44,1) both;
}
@keyframes expPillFloat {
  0%   { opacity: 0; transform: translate(-50%, -50%) translateY(18px) scale(0.75); }
  22%  { opacity: 1; transform: translate(-50%, -50%) translateY(-4px) scale(1.1); }
  75%  { opacity: 1; transform: translate(-50%, -50%) translateY(-38px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) translateY(-62px) scale(0.88); }
}
.level-num.lv-bump { animation: chestGot .46s cubic-bezier(.22,1,.36,1) both; }

/* Subtle dark-adapted 4x4 pixel-glyph ambient backdrop (inspired by aegis-digi.online) */
.bg-digi-matrix {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; image-rendering: pixelated;
  opacity: 0.9;
}

/* Mobile short-viewport compact tuning (matches 100bcards: everything fits cleanly above fixed dock!) */
@media (max-height: 780px) {
  .topbar { height: 28px; }
  .intro { padding: 2px 36px 2px; }
  .intro h1 { font-size: 24px; }
  .brand-logo { height: 40px; max-width: min(78vw, 236px); }
  .tagline { font-size: 11px; margin-top: 1px; }
  .level-row { margin: 1px auto 0; padding: 2px 6px; }
  .stage-3d { height: clamp(276px, 47dvh, 412px); }
  .pack-hit { width: 244px; height: 356px; }
  .tray-wrap { margin-top: 2px; }
  .tray { padding: 6px 10px; gap: 7px; }
  .tray-item { width: 52px; padding: 2px; }
  .tray-thumb { width: 48px; height: 70px; }
  .tray-name { font-size: 10px; }
}
html, body { overscroll-behavior-y: contain; }

/* Light-theme polish: keep physical card faces crisp dark obsidian, brighten shop/tray packs, and add SSR+ badge flow sheen */
.dm-face-core, .dm-head, .dm-body { --ink: #F0F2E6; --muted: #9aa5ad; --panel: #202529; --border-soft: #2e353b; --gold: #FFD12F; }
.offer .offer-pack img { filter: drop-shadow(0 8px 14px rgba(15,23,42,0.28)); }
.offer.taken .offer-pack img, .offer.locked .offer-pack img { filter: brightness(0.75) saturate(0.65); }
.offer.shelf-white { background: linear-gradient(170deg, #ffffff 0%, #e8eef6 100%); border-color: #cbd5e1; color: #1e242c; }
.offer.shelf-white .offer-name { color: #1e242c; }
.offer.shelf-green { background: linear-gradient(170deg, #dcfce7 0%, #bbf7d0 100%); border-color: #4ade80; color: #14532d; }
.offer.shelf-green .offer-name { color: #14532d; }
.offer.shelf-blue .offer-name, .offer.shelf-purple .offer-name, .offer.shelf-gold .offer-name, .offer.free .offer-name { color: #ffffff; }
.offer.free .free-timer { color: rgba(255,255,255,0.88); }
.level-bar i { background: #e2e8f0; border-color: #cbd5e1; }
.level-chest { background: #ffffff; border-color: var(--border); }
.shared-dock .dock-nav { background: rgba(24, 28, 34, 0.94); }
.dock-foot .counter { color: var(--muted); }
.dock-foot .foot-btn { background: rgba(255,255,255,0.92); color: var(--ink); border-color: var(--border); }
.odds-row { background: #f8fafc; border-color: var(--border-soft); }
.modal-box { background: #ffffff; color: var(--ink); }
.code-box, .modal-input { background: #f1f5f9; color: var(--ink); }

/* Rarity Badge Animated Sheen for SR / SSR / UR / EX / MR (Card, Binder, Filter Pills, Level-Up & Odds Modal!) */
.odds-badge { position: relative; overflow: hidden; }
.odds-badge::after { display: none; }
.odds-badge.t-SR::after,
.odds-badge.t-SSR::after,
.odds-badge.t-UR::after,
.odds-badge.t-EX::after,
.odds-badge.t-MR::after,
.tier-pill.tp-2::after,
.tier-pill.tp-3::after,
.tier-pill.tp-4::after,
.tier-pill.tp-5::after,
.tier-pill.tp-6::after,
.tier-2 .rarity-pill::after,
.tier-3 .rarity-pill::after,
.tier-4 .rarity-pill::after,
.tier-5 .rarity-pill::after,
.tier-6 .rarity-pill::after,
.dex-thumb-badge.t-SR::after,
.dex-thumb-badge.t-SSR::after,
.dex-thumb-badge.t-UR::after,
.dex-thumb-badge.t-EX::after,
.dex-thumb-badge.t-MR::after {
  content: ''; display: block; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 28%, rgba(255,255,255,0.72) 50%, transparent 72%) no-repeat;
  background-size: 260% 100%;
  animation: primarySheen 2.8s ease-in-out infinite;
}
.rarity-pill { position: relative; overflow: hidden; }
.dex-thumb-badge { overflow: hidden; }
.tier-2 .rarity-pill, .odds-badge.t-SR,  .tier-pill.tp-2 { box-shadow: 0 0 9px rgba(56,189,248,0.48); }
.tier-3 .rarity-pill, .odds-badge.t-SSR, .tier-pill.tp-3 { box-shadow: 0 0 10px rgba(192,132,252,0.55); }
.tier-4 .rarity-pill, .odds-badge.t-UR,  .tier-pill.tp-4 { box-shadow: 0 0 12px rgba(251,146,60,0.65); }
.tier-5 .rarity-pill, .odds-badge.t-EX,  .tier-pill.tp-5 { box-shadow: 0 0 12px rgba(239,68,68,0.68); }
.tier-6 .rarity-pill, .odds-badge.t-MR,  .tier-pill.tp-6 { box-shadow: 0 0 14px rgba(251,191,36,0.72); }
.tier-pill.active {
  transform: scale(1.08);
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4.5px #181c20, 0 4px 12px rgba(15,23,42,0.34) !important;
}

/* 1:1 100bcards Shop Panel Polish: high-contrast Claim buttons, high-tier panel sheen & bright packs, dimmed taken state */
.offer { position: relative; overflow: hidden; }
.offer.famous-offer {
  background: linear-gradient(135deg, #2c2516 0%, #1c1914 58%, #100f0d 100%) !important;
  border-color: rgba(255, 209, 47, 0.72) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.28), inset 0 1px 0 rgba(255, 209, 47, 0.28) !important;
}
.offer.famous-offer .offer-name span { color: #ffd12f !important; }
.offer.famous-offer .claim {
  background: linear-gradient(180deg, #382f19 0%, #1e1a0e 100%) !important;
  color: #ffd12f !important;
  border: 1.5px solid #ffd12f !important;
  box-shadow: 0 3px 12px rgba(255, 209, 47, 0.24) !important;
}
.offer.base {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 58%, #1e3a8a 100%) !important;
}

/* High-contrast 1:1 100bcards Claim buttons: Dark Black-Gold on light cards, Crisp Ivory-White on colored cards! */
.offer.shelf-white .claim,
.offer.shelf-green .claim {
  background: linear-gradient(180deg, #262436 0%, #161522 100%) !important;
  color: #ffd12f !important;
  border: 1px solid rgba(255, 209, 47, 0.45);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.18);
}
.offer.base .claim,
.offer.shelf-blue .claim,
.offer.shelf-purple .claim,
.offer.shelf-gold .claim {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%) !important;
  color: #1c192b !important;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
}

/* Animated holographic panel sheen & brighter foil glow on high-rarity unclaimed offers (Blue / Purple / Gold / Famous) */
.offer.shelf-blue:not(.taken):not(.locked)::before,
.offer.shelf-purple:not(.taken):not(.locked)::before,
.offer.shelf-gold:not(.taken):not(.locked)::before,
.offer.famous-offer:not(.taken):not(.locked)::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: linear-gradient(118deg, transparent 28%, rgba(255, 255, 255, 0.26) 48%, rgba(255, 255, 255, 0.08) 56%, transparent 72%) no-repeat;
  background-size: 260% 100%;
  animation: primarySheen 3.6s ease-in-out infinite;
}
.offer.shelf-blue > *, .offer.shelf-purple > *, .offer.shelf-gold > *, .offer.famous-offer > * {
  position: relative; z-index: 1;
}
.offer.shelf-purple:not(.taken) .offer-pack img,
.offer.shelf-gold:not(.taken) .offer-pack img,
.offer.famous-offer:not(.taken):not(.locked) .offer-pack img {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.28)) drop-shadow(0 8px 14px rgba(15, 23, 42, 0.28));
}

/* Taken / Locked state (1:1 Image 3: pack dims, sheen stops, button becomes soft frosted muted pill!) */
.offer.taken::before,
.offer.locked::before { display: none !important; animation: none !important; }
.offer.taken .offer-pack,
.offer.locked .offer-pack { animation: none !important; }
.offer.taken .offer-pack img,
.offer.locked .offer-pack img {
  opacity: 0.48;
  filter: grayscale(0.35) brightness(0.86) !important;
}
.offer.taken .claim,
.offer.locked .claim,
.offer .claim.is-locked {
  background: rgba(255, 255, 255, 0.16) !important;
  color: rgba(255, 255, 255, 0.56) !important;
  border-color: transparent !important;
  box-shadow: none !important;
  opacity: 1 !important;
  filter: none !important;
}
.offer.shelf-white.taken .claim,
.offer.shelf-green.taken .claim {
  background: rgba(15, 23, 42, 0.08) !important;
  color: rgba(15, 23, 42, 0.42) !important;
}

/* Digimon Fine-Line Digital Circuit & Micro-Grid Luxury Texture (1:1 filigree feel on Black-Gold & High-Tier UI!) */
.offer.famous-offer::after,
.offer.shelf-blue::after,
.offer.shelf-purple::after,
.offer.shelf-gold::after,
.lu-panel::after {
  content: ''; position: absolute; inset: 4px; border-radius: 10px; pointer-events: none; z-index: 0;
  border: 1px solid rgba(255, 209, 47, 0.24);
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 14px),
    linear-gradient(90deg, rgba(255,209,47,0.58) 0 9px, transparent 9px) top left / 10px 1.5px no-repeat,
    linear-gradient(180deg, rgba(255,209,47,0.58) 0 9px, transparent 9px) top left / 1.5px 10px no-repeat,
    linear-gradient(270deg, rgba(255,209,47,0.58) 0 9px, transparent 9px) top right / 10px 1.5px no-repeat,
    linear-gradient(180deg, rgba(255,209,47,0.58) 0 9px, transparent 9px) top right / 1.5px 10px no-repeat,
    linear-gradient(90deg, rgba(255,209,47,0.58) 0 9px, transparent 9px) bottom left / 10px 1.5px no-repeat,
    linear-gradient(0deg, rgba(255,209,47,0.58) 0 9px, transparent 9px) bottom left / 1.5px 10px no-repeat,
    linear-gradient(270deg, rgba(255,209,47,0.58) 0 9px, transparent 9px) bottom right / 10px 1.5px no-repeat,
    linear-gradient(0deg, rgba(255,209,47,0.58) 0 9px, transparent 9px) bottom right / 1.5px 10px no-repeat;
}
.offer.shelf-blue::after { border-color: rgba(147, 197, 253, 0.28); }
.lu-panel > * { position: relative; z-index: 1; }
.dm-face-core {
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.024) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.024) 0 1px, transparent 1px 12px);
}
.modal-box {
  border-top: 2px solid #d4a017;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.28), inset 0 1px 0 rgba(255, 209, 47, 0.25);
}
