/* ==========================================================================
   3D Card Zoom & Holographic Parallax Viewer (card-zoom3d.css)
   ========================================================================== */

#card-zoom3d-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px 16px;
  background: radial-gradient(circle at 50% 42%, rgba(26, 33, 56, 0.92) 0%, rgba(10, 13, 24, 0.97) 100%);
  opacity: 0;
  transition: opacity 0.22s ease;
  user-select: none;
  -webkit-user-select: none;
}

#card-zoom3d-overlay.is-open {
  opacity: 1;
}

#card-zoom3d-overlay.is-closing {
  opacity: 0;
  pointer-events: none;
}

/* Generous 3D perspective stage */
.zoom3d-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 56px;
  perspective: 1150px;
  perspective-origin: 50% 50%;
}

/* Entrance wrapper */
.zoom3d-entry {
  transform-style: preserve-3d;
  animation: zoom3dCardEnter 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#card-zoom3d-overlay.is-closing .zoom3d-entry {
  animation: zoom3dCardExit 0.18s ease forwards;
}

@keyframes zoom3dCardEnter {
  0% {
    opacity: 0;
    transform: scale(0.76) rotateY(-18deg) rotateX(10deg) translateY(24px);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotateY(0deg) rotateX(0deg) translateY(0);
  }
}

@keyframes zoom3dCardExit {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.86) translateY(12px);
  }
}

/* The 3D-tilting large card */
#card-zoom3d-overlay .zoom3d-card {
  --rx: 0deg;
  --ry: 0deg;
  --px: 0;
  --py: 0;
  --holo-opacity: 0.28;
  --glare-opacity: 0.36;

  position: relative;
  width: min(312px, 84vw);
  height: min(444px, 68vh);
  min-height: 390px;
  padding: 12px 12px 12px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: grab;
  touch-action: none;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry));
  will-change: transform;
  background: var(--card-bg, linear-gradient(180deg, #fffdf8, #f5efe1));
  border: 3.5px solid var(--card-border, #78716c);
  color: #292524;
  box-shadow:
    0 26px 52px rgba(0, 0, 0, 0.58),
    0 0 0 1px rgba(255, 255, 255, 0.22) inset,
    0 0 36px var(--zoom-glow, rgba(255, 255, 255, 0.14));
  overflow: visible;
  font-family: inherit;
}

#card-zoom3d-overlay .zoom3d-card:active {
  cursor: grabbing;
}

/* 3D card thickness rim (back plate) */
.zoom3d-card-backplate {
  position: absolute;
  inset: -3.5px;
  border-radius: 16px;
  background: linear-gradient(145deg, #1e2436 0%, #0f1320 50%, #2a3147 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  transform: translateZ(-7px);
  pointer-events: none;
  z-index: -1;
}

/* Rarity themes for Zoom3D card */
#card-zoom3d-overlay .zoom3d-card.rarity-Gray {
  --card-border: #78716c;
  --card-bg: linear-gradient(180deg, #e7e5e4 0%, #f5f5f4 44%, #f2f1ef 100%);
  --card-header-line: #d6d3d1;
  --zoom-glow: rgba(148, 163, 184, 0.28);
  --holo-opacity: 0.18;
}
#card-zoom3d-overlay .zoom3d-card.rarity-White {
  --card-border: #cbd5e1;
  --card-bg: linear-gradient(180deg, #ffffff 0%, #fefefe 58%, #f8fafc 100%);
  --card-header-line: #e2e8f0;
  --zoom-glow: rgba(226, 232, 240, 0.42);
  --holo-opacity: 0.22;
}
#card-zoom3d-overlay .zoom3d-card.rarity-Green {
  --card-border: #16a34a;
  --card-bg: linear-gradient(180deg, #dcfce7 0%, #f4fdf7 38%, #fffdf8 100%);
  --card-header-line: #bbf7d0;
  --zoom-glow: rgba(34, 197, 94, 0.36);
  --holo-opacity: 0.28;
}
#card-zoom3d-overlay .zoom3d-card.rarity-Blue {
  --card-border: #2563eb;
  --card-bg: linear-gradient(180deg, #dbeafe 0%, #eff6ff 42%, #fffdf8 100%);
  --card-header-line: #bfdbfe;
  --zoom-glow: rgba(59, 130, 246, 0.44);
  --holo-opacity: 0.36;
}
#card-zoom3d-overlay .zoom3d-card.rarity-Purple {
  --card-border: #9333ea;
  --card-bg: linear-gradient(180deg, #ede9fe 0%, #faf5ff 44%, #fdfaff 100%);
  --card-header-line: #ddd6fe;
  --zoom-glow: rgba(168, 85, 247, 0.56);
  --holo-opacity: 0.48;
}
#card-zoom3d-overlay .zoom3d-card.rarity-Gold {
  --card-border: #d97706;
  --card-bg: linear-gradient(180deg, #fef08a 0%, #fef9c3 34%, #fffbeb 100%);
  --card-header-line: #fde047;
  --zoom-glow: rgba(245, 158, 11, 0.65);
  --holo-opacity: 0.58;
}
#card-zoom3d-overlay .zoom3d-card.is-mega-card {
  --card-border: #db2777;
  --zoom-glow: rgba(236, 72, 153, 0.65);
  --holo-opacity: 0.6;
}
#card-zoom3d-overlay .zoom3d-card.is-shiny-card {
  --holo-opacity: 0.62;
}
#card-zoom3d-overlay .zoom3d-card.is-curse-card {
  --card-border: #6b21a8;
  --card-bg: linear-gradient(180deg, #2e1065 0%, #3b0764 55%, #1e1b4b 100%);
  --card-header-line: rgba(192, 132, 252, 0.32);
  --zoom-glow: rgba(147, 51, 234, 0.55);
  color: #f3e8ff;
}

/* 18 Type palettes (mirrors refined-theme.css) */
#card-zoom3d-overlay .zoom3d-card.type-Normal   { --type-bg-a: #f3f1ec; --type-bg-b: #e2dfd6; --type-emblem: #78746a; --type-art-border: rgba(120, 116, 106, 0.28); }
#card-zoom3d-overlay .zoom3d-card.type-Fire     { --type-bg-a: #fff0e4; --type-bg-b: #fed7bc; --type-emblem: #ea580c; --type-art-border: rgba(234, 88, 12, 0.28); }
#card-zoom3d-overlay .zoom3d-card.type-Water    { --type-bg-a: #e6f6ff; --type-bg-b: #bae6fd; --type-emblem: #0284c7; --type-art-border: rgba(2, 132, 199, 0.28); }
#card-zoom3d-overlay .zoom3d-card.type-Grass    { --type-bg-a: #e8faee; --type-bg-b: #bbf7d0; --type-emblem: #16a34a; --type-art-border: rgba(22, 163, 74, 0.28); }
#card-zoom3d-overlay .zoom3d-card.type-Electric { --type-bg-a: #fefce0; --type-bg-b: #fef08a; --type-emblem: #ca8a04; --type-art-border: rgba(202, 138, 4, 0.3); }
#card-zoom3d-overlay .zoom3d-card.type-Ice      { --type-bg-a: #e6fbff; --type-bg-b: #baeef8; --type-emblem: #0891b2; --type-art-border: rgba(8, 145, 178, 0.28); }
#card-zoom3d-overlay .zoom3d-card.type-Fighting { --type-bg-a: #fcebe6; --type-bg-b: #f8cbc0; --type-emblem: #b91c1c; --type-art-border: rgba(185, 28, 28, 0.26); }
#card-zoom3d-overlay .zoom3d-card.type-Poison   { --type-bg-a: #f4eafd; --type-bg-b: #e0c4fc; --type-emblem: #9333ea; --type-art-border: rgba(147, 51, 234, 0.26); }
#card-zoom3d-overlay .zoom3d-card.type-Ground   { --type-bg-a: #f8efe0; --type-bg-b: #e7d1ad; --type-emblem: #a16207; --type-art-border: rgba(161, 98, 7, 0.28); }
#card-zoom3d-overlay .zoom3d-card.type-Flying   { --type-bg-a: #eef4ff; --type-bg-b: #cddffd; --type-emblem: #4f6bd6; --type-art-border: rgba(79, 107, 214, 0.26); }
#card-zoom3d-overlay .zoom3d-card.type-Psychic  { --type-bg-a: #fdecf6; --type-bg-b: #f9c8e6; --type-emblem: #db2777; --type-art-border: rgba(219, 39, 119, 0.26); }
#card-zoom3d-overlay .zoom3d-card.type-Bug      { --type-bg-a: #f2f8e3; --type-bg-b: #d8ebb0; --type-emblem: #65a30d; --type-art-border: rgba(101, 163, 13, 0.28); }
#card-zoom3d-overlay .zoom3d-card.type-Rock     { --type-bg-a: #f3ede3; --type-bg-b: #ddd0ba; --type-emblem: #856b42; --type-art-border: rgba(133, 107, 66, 0.28); }
#card-zoom3d-overlay .zoom3d-card.type-Ghost    { --type-bg-a: #efeafc; --type-bg-b: #d4c7f6; --type-emblem: #6d28d9; --type-art-border: rgba(109, 40, 217, 0.26); }
#card-zoom3d-overlay .zoom3d-card.type-Dragon   { --type-bg-a: #ebeffe; --type-bg-b: #c7d2fe; --type-emblem: #4338ca; --type-art-border: rgba(67, 56, 202, 0.28); }
#card-zoom3d-overlay .zoom3d-card.type-Dark     { --type-bg-a: #ececf1; --type-bg-b: #d2d3df; --type-emblem: #3f3f52; --type-art-border: rgba(63, 63, 82, 0.28); }
#card-zoom3d-overlay .zoom3d-card.type-Steel    { --type-bg-a: #edf2f7; --type-bg-b: #cfdbe6; --type-emblem: #475569; --type-art-border: rgba(71, 85, 105, 0.28); }
#card-zoom3d-overlay .zoom3d-card.type-Fairy    { --type-bg-a: #feeff7; --type-bg-b: #fbcfe8; --type-emblem: #e11d74; --type-art-border: rgba(225, 29, 116, 0.26); }

#card-zoom3d-overlay .zoom3d-card.sec-type-Normal   { --sec-type-bg: #e2dfd6; --sec-type-emblem: #78746a; }
#card-zoom3d-overlay .zoom3d-card.sec-type-Fire     { --sec-type-bg: #fed7bc; --sec-type-emblem: #ea580c; }
#card-zoom3d-overlay .zoom3d-card.sec-type-Water    { --sec-type-bg: #bae6fd; --sec-type-emblem: #0284c7; }
#card-zoom3d-overlay .zoom3d-card.sec-type-Grass    { --sec-type-bg: #bbf7d0; --sec-type-emblem: #16a34a; }
#card-zoom3d-overlay .zoom3d-card.sec-type-Electric { --sec-type-bg: #fef08a; --sec-type-emblem: #ca8a04; }
#card-zoom3d-overlay .zoom3d-card.sec-type-Ice      { --sec-type-bg: #baeef8; --sec-type-emblem: #0891b2; }
#card-zoom3d-overlay .zoom3d-card.sec-type-Fighting { --sec-type-bg: #f8cbc0; --sec-type-emblem: #b91c1c; }
#card-zoom3d-overlay .zoom3d-card.sec-type-Poison   { --sec-type-bg: #e0c4fc; --sec-type-emblem: #9333ea; }
#card-zoom3d-overlay .zoom3d-card.sec-type-Ground   { --sec-type-bg: #e7d1ad; --sec-type-emblem: #a16207; }
#card-zoom3d-overlay .zoom3d-card.sec-type-Flying   { --sec-type-bg: #cddffd; --sec-type-emblem: #4f6bd6; }
#card-zoom3d-overlay .zoom3d-card.sec-type-Psychic  { --sec-type-bg: #f9c8e6; --sec-type-emblem: #db2777; }
#card-zoom3d-overlay .zoom3d-card.sec-type-Bug      { --sec-type-bg: #d8ebb0; --sec-type-emblem: #65a30d; }
#card-zoom3d-overlay .zoom3d-card.sec-type-Rock     { --sec-type-bg: #ddd0ba; --sec-type-emblem: #856b42; }
#card-zoom3d-overlay .zoom3d-card.sec-type-Ghost    { --sec-type-bg: #d4c7f6; --sec-type-emblem: #6d28d9; }
#card-zoom3d-overlay .zoom3d-card.sec-type-Dragon   { --sec-type-bg: #c7d2fe; --sec-type-emblem: #4338ca; }
#card-zoom3d-overlay .zoom3d-card.sec-type-Dark     { --sec-type-bg: #d2d3df; --sec-type-emblem: #3f3f52; }
#card-zoom3d-overlay .zoom3d-card.sec-type-Steel    { --sec-type-bg: #cfdbe6; --sec-type-emblem: #475569; }
#card-zoom3d-overlay .zoom3d-card.sec-type-Fairy    { --sec-type-bg: #fbcfe8; --sec-type-emblem: #e11d74; }

/* Card surface sheen & holographic foil (clipped to card face) */
.zoom3d-fx-clip {
  position: absolute;
  inset: 0;
  border-radius: 12.5px;
  overflow: hidden;
  pointer-events: none;
  z-index: 4;
  transform: translateZ(2px);
}

.zoom3d-holo {
  position: absolute;
  inset: -25%;
  opacity: var(--holo-opacity, 0.3);
  background:
    repeating-linear-gradient(
      118deg,
      rgba(255, 80, 120, 0.22) 0%,
      rgba(255, 210, 80, 0.22) 16%,
      rgba(80, 240, 180, 0.22) 32%,
      rgba(80, 180, 255, 0.24) 48%,
      rgba(200, 110, 255, 0.22) 64%,
      rgba(255, 80, 120, 0.22) 80%
    );
  background-size: 220% 220%;
  background-position: center;
  transform: translate3d(calc(var(--px) * 13%), calc(var(--py) * 13%), 0);
}

.zoom3d-glare {
  position: absolute;
  inset: -42%;
  transform: translate3d(calc(var(--px) * 23%), calc(var(--py) * 23%), 0);
  opacity: var(--glare-opacity, 0.36);
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.92) 0%,
    rgba(255, 255, 255, 0.32) 14%,
    rgba(255, 255, 255, 0) 35%
  );
}

/* Cost orb — floating high at top-left */
.zoom3d-cost {
  position: absolute;
  top: -11px;
  left: -11px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 21px;
  font-weight: 900;
  background: #292524;
  color: #fffdf8;
  border: 2.5px solid #fffdf8;
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.38);
  transform: translateZ(34px);
  z-index: 8;
}
.zoom3d-card.rarity-Gold .zoom3d-cost {
  background: linear-gradient(180deg, #b45309, #78350f);
  border-color: #fef08a;
  color: #fef9c3;
}
.zoom3d-card.rarity-Purple .zoom3d-cost {
  background: linear-gradient(180deg, #7e22ce, #4c1d95);
  border-color: #f3e8ff;
}
.zoom3d-cost.reduced {
  background: #dc2626;
}

/* Shiny badge */
.zoom3d-shiny-badge {
  position: absolute;
  top: -10px;
  right: -8px;
  width: 30px;
  height: 30px;
  object-fit: contain;
  transform: translateZ(36px);
  filter: drop-shadow(0 4px 8px rgba(250, 204, 21, 0.65));
  z-index: 9;
  pointer-events: none;
}

/* Header */
.zoom3d-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 8px 34px;
  border-bottom: 2px solid var(--card-header-line, #e6decb);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.01em;
  transform: translateZ(18px);
  position: relative;
  z-index: 5;
}

.zoom3d-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zoom3d-types {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.zoom3d-types img {
  height: 18px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

/* Art window container — overflow: visible so the 3D Pokemon pops OUT! */
.zoom3d-art-stage {
  position: relative;
  height: 196px;
  flex-shrink: 0;
  transform-style: preserve-3d;
  z-index: 6;
}

/* Clipped art background recessed behind the Pokemon */
.zoom3d-art-bg {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--type-art-border, rgba(28, 25, 23, 0.18));
  background: radial-gradient(circle at 50% 54%, rgba(255, 255, 255, 0.78) 0%, var(--type-bg-a, #f3ede0) 54%, var(--type-bg-b, #e6ddd0) 100%);
  box-shadow: inset 0 4px 18px rgba(28, 25, 23, 0.14);
  transform: translateZ(6px);
}

.zoom3d-card[data-secondary-type] .zoom3d-art-bg {
  --dual-split: calc(50% + (var(--px, 0) + var(--py, 0)) * 28%);
  background:
    radial-gradient(circle at 50% 52%, rgba(255, 255, 255, 0.56) 0%, rgba(255, 255, 255, 0) 35%),
    linear-gradient(
      135deg,
      var(--type-bg-b) 0%,
      var(--type-bg-a) clamp(12%, calc(46% + (var(--px, 0) + var(--py, 0)) * 18%), 82%),
      var(--sec-type-bg, var(--type-bg-b)) 100%
    );
}

/* Subtle energy aura pulsing behind Pokemon */
.zoom3d-art-aura {
  position: absolute;
  inset: -15%;
  background: radial-gradient(circle at 50% 52%, var(--type-emblem, #78716c) 0%, transparent 62%);
  opacity: 0.2;
  animation: zoom3dAuraPulse 3.8s ease-in-out infinite;
  pointer-events: none;
}

.zoom3d-card[data-secondary-type] .zoom3d-art-aura {
  background:
    radial-gradient(circle at 28% 28%, var(--type-emblem, #78716c) 0%, transparent 56%),
    radial-gradient(circle at 74% 74%, var(--sec-type-emblem, var(--type-emblem, #78716c)) 0%, transparent 56%);
}

@keyframes zoom3dAuraPulse {
  0%, 100% { transform: scale(0.95); opacity: 0.16; }
  50% { transform: scale(1.08); opacity: 0.28; }
}

/* Official type emblem with reverse parallax */
.zoom3d-emblem {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.3;
  pointer-events: none;
  transform: translate3d(calc(var(--px) * -10px), calc(var(--py) * -8px), 0) scale(1.08);
  will-change: transform;
}

.zoom3d-emblem img {
  width: 136px;
  height: 136px;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.55));
}

/* Seamless 135deg diagonal dual-type emblem fusion aligned with card art gradient */
.zoom3d-emblem.is-dual {
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.55));
}

.zoom3d-emblem.is-dual img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  filter: none;
}

.zoom3d-emblem.is-dual img.emblem-primary {
  -webkit-mask-image: linear-gradient(135deg, #000 calc(var(--dual-split, 50%) - 2%), transparent calc(var(--dual-split, 50%) + 10%));
  mask-image: linear-gradient(135deg, #000 calc(var(--dual-split, 50%) - 2%), transparent calc(var(--dual-split, 50%) + 10%));
}

.zoom3d-emblem.is-dual img.emblem-secondary {
  -webkit-mask-image: linear-gradient(135deg, transparent calc(var(--dual-split, 50%) - 7%), #000 calc(var(--dual-split, 50%) + 7%));
  mask-image: linear-gradient(135deg, transparent calc(var(--dual-split, 50%) - 7%), #000 calc(var(--dual-split, 50%) + 7%));
}

/* Grounded dynamic shadow beneath the floating Pokemon */
.zoom3d-poke-shadow {
  position: absolute;
  left: 50%;
  bottom: 12px;
  width: 118px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.42) 0%, rgba(15, 23, 42, 0.14) 55%, transparent 75%);
  transform: translateX(calc(-50% - var(--px) * 14px)) translateY(calc(var(--py) * -4px)) translateZ(10px);
  filter: blur(4px);
  animation: zoom3dShadowBreath 3.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes zoom3dShadowBreath {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 0.55; }
}

/* THE 3D POP-OUT POKEMON LAYER */
.zoom3d-poke-layer {
  position: absolute;
  inset: -26px -18px -12px -18px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  transform-style: preserve-3d;
  /* Pops 54px forward off the card + moves with parallax! */
  transform: translate3d(calc(var(--px) * 18px), calc(var(--py) * 13px + var(--poke-y-nudge, 0px)), 54px);
  will-change: transform;
  z-index: 10;
}

.zoom3d-poke-float {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  animation: zoom3dPokeFloat 3.2s ease-in-out infinite;
  will-change: transform;
}

@keyframes zoom3dPokeFloat {
  0%, 100% {
    transform: translateY(3px) scale(1);
  }
  50% {
    transform: translateY(-7px) scale(1.035);
  }
}

.zoom3d-poke-img {
  zoom: 1 !important;
  max-width: 92%;
  max-height: calc(206px * var(--poke-size-scale, 1));
  width: auto;
  height: auto;
  object-fit: contain;
  /* Dynamic light-reactive 3D drop shadow */
  filter:
    drop-shadow(0 14px 12px rgba(15, 23, 42, 0.42))
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.25));
  transition: opacity 0.2s ease;
}

.zoom3d-poke-img.is-pixel-sprite {
  image-rendering: pixelated;
  min-height: 120px;
  max-height: 168px;
  transform: scale(1.18);
}

/* Badges inside art frame */
.zoom3d-cat-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  height: 20px;
  width: auto;
  transform: translateZ(24px);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.28));
  z-index: 11;
}

.zoom3d-special-tag {
  position: absolute;
  bottom: 8px;
  right: 8px;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 900;
  background: #1e293b;
  color: #fde68a;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  transform: translateZ(26px);
  z-index: 11;
}

.zoom3d-enchant-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.85);
  color: #fde68a;
  border: 1px solid rgba(253, 230, 138, 0.45);
  transform: translateZ(26px);
  z-index: 11;
}

/* Description box */
.zoom3d-desc {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.82);
  border: 1.5px solid rgba(120, 113, 108, 0.16);
  font-size: 14px;
  line-height: 1.54;
  color: #292524;
  white-space: pre-line;
  transform: translateZ(18px);
  box-shadow: 0 4px 12px rgba(28, 25, 23, 0.08);
  position: relative;
  z-index: 5;
}

.zoom3d-card.is-curse-card .zoom3d-desc {
  background: rgba(15, 10, 32, 0.62);
  color: #f3e8ff;
  border-color: rgba(192, 132, 252, 0.25);
}

.zoom3d-desc .kw { font-weight: 900; padding: 0 2px; border-radius: 3px; }

/* Midnight skin support inside 3D zoom */
#card-zoom3d-overlay .zoom3d-card.card-skin-midnight {
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #f8fafc;
}
#card-zoom3d-overlay .zoom3d-card.card-skin-midnight .zoom3d-desc {
  background: rgba(15, 23, 42, 0.78);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.25);
}

/* Footer meta strip inside card */
.zoom3d-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.72;
  padding: 0 4px;
  transform: translateZ(14px);
}

/* Floating glass toolbar below card */
.zoom3d-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(18, 24, 42, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42);
  z-index: 2;
}

.zoom3d-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 12.5px;
  font-weight: 800;
  padding: 6px 13px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.zoom3d-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.42);
  transform: translateY(-1px);
}

.zoom3d-btn.is-active {
  background: rgba(250, 204, 21, 0.22);
  border-color: rgba(250, 204, 21, 0.65);
  color: #fef08a;
}

.zoom3d-btn-primary {
  background: rgba(59, 130, 246, 0.28);
  border-color: rgba(96, 165, 250, 0.55);
  color: #dbeafe;
}

.zoom3d-btn-primary:hover {
  background: rgba(59, 130, 246, 0.44);
}

.zoom3d-hint {
  font-size: 12px;
  color: rgba(226, 232, 240, 0.72);
  letter-spacing: 0.02em;
  text-align: center;
}

/* ==========================================================================
   Dex Wiki Showcase Card 3D Enhancement (in-place interactive 3D)
   ========================================================================== */
.dex-showcase-wrap {
  perspective: 900px;
}

#app .dex-wiki-panel .dex-showcase-card.is-tilt3d {
  --cpx: var(--px, 0);
  --cpy: var(--py, 0);
  touch-action: none;
  transform-style: flat;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) !important;
  transition: box-shadow 0.2s ease !important;
  cursor: zoom-in !important;
  will-change: transform;
}

#app .dex-wiki-panel .dex-showcase-card.is-tilt3d .card-art-wrap {
  overflow: visible !important;
  transform-style: flat;
}

#app .dex-wiki-panel .dex-showcase-card.is-tilt3d .card-poke-pop {
  transform: none;
}

#app .dex-wiki-panel .dex-showcase-card.is-tilt3d .card-poke-pop img.card-sprite {
  transform: translate3d(calc(-50% + var(--px, 0) * 10px), calc(-50% + var(--py, 0) * 7px + var(--poke-y-nudge, 0px)), 0);
}

#app .poke-card[data-zoom-click="1"] {
  cursor: zoom-in !important;
}


/* ==========================================================================
   UNIFIED 3D POP-OUT CARD DESIGN FOR ALL .poke-card INSTANCES
   Replaces the old flat/compressed small card with the 3D card aesthetic:
   - Out-of-frame ("出框") high-res Pokemon artwork with grounded shadow
   - Subtle interactive 3D tilt & specular glare on mouse hover
   - Spacious, crisp typography with full readable effect text & footer meta
   ========================================================================== */

#app .poke-card.is-card3d {
  --crx: 0deg;
  --cry: 0deg;
  --cpx: 0;
  --cpy: 0;
  --hand-angle: 0deg;
  --hand-drop: 0px;

  width: 184px;
  height: 262px;
  padding: 8px 9px 7px !important;
  gap: 6px;
  border-radius: 13px !important;
  border-width: 2.6px !important;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible !important;
  transform-style: flat;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: perspective(900px) translateY(var(--hand-drop)) scale(1) rotate(var(--hand-angle)) rotateX(var(--crx)) rotateY(var(--cry));
  box-shadow:
    0 6px 16px rgba(15, 23, 42, 0.16),
    0 2px 4px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.5) inset !important;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.26s ease, margin 0.22s ease !important;
}

#app .poke-card.is-card3d.is-tilting {
  will-change: transform;
}

#app .poke-card.is-card3d:not(.unplayable):hover {
  z-index: 65;
  transform: perspective(900px) translateY(-6px) scale(1.04) rotate(0deg) rotateX(var(--crx)) rotateY(var(--cry)) !important;
  box-shadow:
    0 16px 28px rgba(15, 23, 42, 0.28),
    0 4px 10px rgba(15, 23, 42, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.65) inset !important;
}

/* Battle hand cards: slightly wider/taller with crisp fan & lift on hover */
#app .hand-row {
  height: 274px !important;
  padding-bottom: 6px;
}

#app .hand-row .poke-card.is-card3d {
  width: 184px !important;
  height: 262px !important;
  margin: 0 var(--hand-overlap, -6px);
}

#app .hand-row .poke-card.is-card3d:not(.unplayable):hover {
  transform: perspective(900px) translateY(-34px) scale(1.11) rotate(0deg) rotateX(var(--crx)) rotateY(var(--cry)) !important;
  margin: 0 14px;
  z-index: 75;
  box-shadow:
    0 22px 38px rgba(15, 23, 42, 0.42),
    0 0 22px rgba(251, 146, 60, 0.42),
    0 0 0 1px rgba(255, 255, 255, 0.72) inset !important;
}

/* Dex Grid: roomy cards so every Pokemon pops out and text reads cleanly */
#app .journal-dex-grid {
  grid-template-columns: repeat(auto-fill, minmax(182px, 1fr)) !important;
  gap: 20px 16px !important;
  padding-top: 8px;
}

#app .journal-dex-grid .poke-card.is-card3d {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 0.718 !important;
  margin: 0 !important;
}

/* Rewards / Shop / Deck / Piles / Evo */
#app .reward-cards-row .poke-card.is-card3d,
#app .shop-card-slot .poke-card.is-card3d,
#app .evo-card-col .poke-card.is-card3d {
  width: 188px !important;
  height: auto !important;
  aspect-ratio: 0.718 !important;
  margin: 0 !important;
}

#app .reward-cards-row .poke-card.is-card3d:not(.unplayable):hover,
#app .shop-card-slot .poke-card.is-card3d:not(.unplayable):hover {
  transform: perspective(900px) translateY(-8px) scale(1.05) rotate(0deg) rotateX(var(--crx)) rotateY(var(--cry)) !important;
}

#app .evo-card-col .poke-card.is-card3d:hover {
  transform: perspective(900px) translateY(0px) scale(1) rotate(0deg) rotateX(var(--crx)) rotateY(var(--cry)) !important;
}

/* Rarity subtle ambient glow on unified 3D cards */
#app .poke-card.is-card3d.rarity-Purple {
  box-shadow: 0 6px 16px rgba(107, 33, 168, 0.24), 0 0 16px rgba(168, 85, 247, 0.24) !important;
}
#app .poke-card.is-card3d.rarity-Gold {
  box-shadow: 0 6px 18px rgba(146, 64, 14, 0.28), 0 0 20px rgba(245, 158, 11, 0.34) !important;
}
#app .poke-card.is-card3d.is-mega-card {
  box-shadow: 0 6px 18px rgba(157, 23, 77, 0.28), 0 0 20px rgba(236, 72, 153, 0.34) !important;
}

/* Holographic glare & subtle rainbow sheen on hover */
.card-holo-clip {
  position: absolute;
  inset: 0;
  border-radius: 10.5px;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}

.card-holo-sheen {
  position: absolute;
  inset: -20%;
  opacity: 0;
  background: repeating-linear-gradient(
    118deg,
    rgba(255, 80, 120, 0.16) 0%,
    rgba(255, 210, 80, 0.16) 18%,
    rgba(80, 240, 180, 0.16) 36%,
    rgba(80, 180, 255, 0.18) 54%,
    rgba(200, 110, 255, 0.16) 72%,
    rgba(255, 80, 120, 0.16) 90%
  );
  background-size: 220% 220%;
  background-position: center;
  transform: translate3d(calc(var(--cpx) * 13%), calc(var(--cpy) * 13%), 0);
  transition: opacity 0.22s ease;
}

.card-holo-glare {
  position: absolute;
  inset: -42%;
  transform: translate3d(calc(var(--cpx) * 23%), calc(var(--cpy) * 23%), 0);
  opacity: 0;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(255, 255, 255, 0.24) 15%,
    rgba(255, 255, 255, 0) 35%
  );
  transition: opacity 0.22s ease;
}

#app .poke-card.is-card3d:hover .card-holo-glare {
  opacity: 0.34;
}

#app .poke-card.is-card3d:hover .card-holo-sheen {
  opacity: 0.18;
}
#app .poke-card.is-card3d.rarity-Blue:hover .card-holo-sheen { opacity: 0.26; }
#app .poke-card.is-card3d.rarity-Purple:hover .card-holo-sheen,
#app .poke-card.is-card3d.rarity-Gold:hover .card-holo-sheen,
#app .poke-card.is-card3d.is-mega-card:hover .card-holo-sheen,
#app .poke-card.is-card3d.is-shiny-card:hover .card-holo-sheen {
  opacity: 0.38;
}

/* Floating Cost Badge */
#app .poke-card.is-card3d .card-cost {
  top: -8px !important;
  left: -8px !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 7px !important;
  font-size: 14px !important;
  border: 2px solid #fffdf8 !important;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.32) !important;
  z-index: 9;
}

#app .poke-card.is-card3d .card-inspect-btn {
  top: 6px !important;
  right: 6px !important;
  width: 18px !important;
  height: 18px !important;
  border-radius: 5px !important;
  font-size: 10px !important;
  z-index: 9;
}

/* Clean Card Header */
#app .poke-card.is-card3d .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  padding: 0 18px 4px 20px !important;
  font-size: 12.8px !important;
  line-height: 1.2;
  border-bottom: 1.5px solid var(--card-header-line, #e6decb) !important;
  position: relative;
  z-index: 5;
}

#app .poke-card.is-card3d .card-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

#app .poke-card.is-card3d .card-types-mini {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

#app .poke-card.is-card3d .card-types-mini img {
  height: 12px !important;
  width: auto;
  image-rendering: auto !important;
}

/* ==========================================================================
   THE SIGNATURE POP-OUT ("出框") ARTWORK STAGE
   ========================================================================== */
#app .poke-card.is-card3d .card-art-wrap {
  position: relative;
  height: 102px !important;
  flex-shrink: 0;
  margin: 2px 0 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: visible !important;
  transform-style: flat;
  z-index: 6;
}

/* Recessed rounded frame behind the Pokemon */
#app .poke-card.is-card3d .card-art-bg {
  position: absolute;
  inset: 0;
  border-radius: 9px;
  overflow: hidden;
  border: 1.5px solid var(--type-art-border, rgba(28, 25, 23, 0.16));
  background: radial-gradient(circle at 50% 54%, rgba(255, 255, 255, 0.78) 0%, var(--type-bg-a, #f3ede0) 55%, var(--type-bg-b, #e6ddd0) 100%);
  box-shadow: inset 0 3px 12px rgba(28, 25, 23, 0.12);
}

#app .poke-card.is-card3d[data-secondary-type] .card-art-bg {
  --dual-split: calc(50% + (var(--cpx, 0) + var(--cpy, 0)) * 28%);
  background:
    radial-gradient(circle at 50% 52%, rgba(255, 255, 255, 0.56) 0%, rgba(255, 255, 255, 0) 35%),
    linear-gradient(
      135deg,
      var(--type-bg-b) 0%,
      var(--type-bg-a) clamp(12%, calc(46% + (var(--cpx, 0) + var(--cpy, 0)) * 18%), 82%),
      var(--sec-type-bg, var(--type-bg-b)) 100%
    );
}

#app .poke-card.is-card3d .card-type-bg-emblem {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.13;
  pointer-events: none;
  transform: translate3d(calc(var(--cpx, 0) * -6px), calc(var(--cpy, 0) * -4px), 0);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

#app .poke-card.is-card3d .card-type-bg-emblem.is-dual {
  opacity: 0.16;
}

#app .poke-card.is-card3d:hover .card-type-bg-emblem {
  opacity: 0.18;
}

#app .poke-card.is-card3d:hover .card-type-bg-emblem.is-dual {
  opacity: 0.22;
}

#app .poke-card.is-card3d.is-tilting .card-type-bg-emblem {
  transition: opacity 0.22s ease;
}

#app .poke-card.is-card3d .card-type-bg-emblem img {
  width: 82px;
  height: 82px;
  object-fit: contain;
}

#app .poke-card.is-card3d .card-type-bg-emblem.is-dual img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#app .poke-card.is-card3d .card-type-bg-emblem.is-dual img.emblem-primary {
  -webkit-mask-image: linear-gradient(135deg, #000 calc(var(--dual-split, 50%) - 2%), transparent calc(var(--dual-split, 50%) + 10%));
  mask-image: linear-gradient(135deg, #000 calc(var(--dual-split, 50%) - 2%), transparent calc(var(--dual-split, 50%) + 10%));
}

#app .poke-card.is-card3d .card-type-bg-emblem.is-dual img.emblem-secondary {
  -webkit-mask-image: linear-gradient(135deg, transparent calc(var(--dual-split, 50%) - 7%), #000 calc(var(--dual-split, 50%) + 7%));
  mask-image: linear-gradient(135deg, transparent calc(var(--dual-split, 50%) - 7%), #000 calc(var(--dual-split, 50%) + 7%));
}

/* Soft grounded shadow under the Pokemon */
#app .poke-card.is-card3d .card-poke-shadow {
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: 72px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(15, 23, 42, 0.34) 0%, rgba(15, 23, 42, 0.1) 56%, transparent 76%);
  filter: blur(3px);
  transform: translateX(calc(-50% - var(--cpx, 0) * 6px)) translateY(calc(var(--cpy, 0) * -2px));
  pointer-events: none;
}

/* Pop-out Pokemon container — Safari-proof fixed-anchor centering (zero top-left jump on hover!) */
#app .poke-card.is-card3d .card-poke-pop {
  position: absolute;
  inset: -14px -8px -9px -8px;
  display: block;
  pointer-events: none;
  transform: none;
  z-index: 7;
}

#app .poke-card.is-card3d .card-poke-pop img.card-sprite {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  margin: 0 !important;
  zoom: 1 !important;
  max-width: 92% !important;
  max-height: calc(134px * var(--poke-size-scale, 1)) !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  image-rendering: auto !important;
  transform: translate3d(calc(-50% + var(--cpx, 0) * 7px), calc(-50% + var(--cpy, 0) * 5px + var(--poke-y-nudge, 0px)), 0);
  filter: drop-shadow(0 6px 8px rgba(15, 23, 42, 0.3)) !important;
}

#app .poke-card.is-card3d .card-poke-pop img.card-sprite.is-pixel-sprite {
  image-rendering: pixelated !important;
  max-height: 98px !important;
}

/* Art overlay badges */
#app .poke-card.is-card3d .card-cat-badge {
  position: absolute;
  bottom: 5px;
  left: 6px;
  height: 15px;
  width: auto;
  z-index: 8;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

#app .poke-card.is-card3d .card-special-pill {
  position: absolute;
  bottom: 5px;
  right: 6px;
  z-index: 8;
  font-size: 9.5px;
  font-weight: 900;
  padding: 1.5px 6px;
  border-radius: 6px;
  color: #fde68a;
}

/* Spacious, fully readable effect description */
#app .poke-card.is-card3d .card-desc {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 8px !important;
  border-radius: 8px !important;
  background: rgba(255, 253, 248, 0.88) !important;
  border: 1px solid rgba(120, 113, 108, 0.14) !important;
  font-size: 11.6px !important;
  line-height: 1.44 !important;
  font-weight: 600;
  color: #292524 !important;
  white-space: pre-line;
  position: relative;
  z-index: 5;
}

#app .poke-card.is-card3d.card-skin-midnight .card-desc {
  background: rgba(15, 23, 42, 0.78) !important;
  color: #e2e8f0 !important;
  border-color: rgba(148, 163, 184, 0.24) !important;
}

#app .poke-card.is-card3d.is-curse-card .card-desc {
  background: rgba(15, 10, 32, 0.62) !important;
  color: #f3e8ff !important;
}

/* Subtle bottom footer (#0813 / 第 1 / 3 阶) */
#app .poke-card.is-card3d .card-footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9.8px;
  font-weight: 800;
  color: rgba(63, 58, 53, 0.58);
  padding: 0 3px;
  line-height: 1.1;
  flex-shrink: 0;
}

#app .poke-card.is-card3d.card-skin-midnight .card-footer-meta,
#app .poke-card.is-card3d.is-curse-card .card-footer-meta {
  color: rgba(226, 232, 240, 0.65);
}

/* Dex Wiki showcase card scales the unified 3D art proportionally */
#app .dex-wiki-panel .dex-showcase-card.is-card3d {
  width: 232px !important;
  height: 332px !important;
}
#app .dex-wiki-panel .dex-showcase-card.is-card3d .card-art-wrap {
  height: 138px !important;
}
#app .dex-wiki-panel .dex-showcase-card.is-card3d .card-poke-pop {
  inset: -20px -10px -10px -10px;
}
#app .dex-wiki-panel .dex-showcase-card.is-card3d .card-poke-pop img.card-sprite {
  zoom: 1 !important;
  max-width: 92% !important;
  max-height: calc(168px * var(--poke-size-scale, 1)) !important;
}

/* Mobile responsiveness */
@media (max-width: 720px) {
  #app .journal-dex-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px 10px !important;
  }
  #app .journal-dex-grid .poke-card.is-card3d {
    height: 244px !important;
  }
  #app .journal-dex-grid .poke-card.is-card3d .card-art-wrap {
    height: 86px !important;
  }
  #app .journal-dex-grid .poke-card.is-card3d .card-poke-pop img.card-sprite {
    max-height: calc(102px * var(--poke-size-scale, 1)) !important;
  }
  #app .hand-row {
    height: 224px !important;
  }
  #app .hand-row .poke-card.is-card3d {
    flex: 0 0 152px;
    width: 152px !important;
    height: 214px !important;
    padding: 6px 7px 5px !important;
    gap: 4px;
  }
  #app .hand-row .poke-card.is-card3d .card-header {
    font-size: 11.8px !important;
    padding: 0 16px 3px 18px !important;
  }
  #app .hand-row .poke-card.is-card3d .card-art-wrap {
    height: 76px !important;
  }
  #app .hand-row .poke-card.is-card3d .card-poke-pop {
    inset: -10px -6px -6px -6px;
  }
  #app .hand-row .poke-card.is-card3d .card-poke-pop img.card-sprite {
    max-height: calc(90px * var(--poke-size-scale, 1)) !important;
  }
  #app .hand-row .poke-card.is-card3d .card-desc {
    font-size: 10.6px !important;
    line-height: 1.36 !important;
    padding: 4px 6px !important;
  }
}


/* ==========================================================================
   CANONICAL POKÉMON SIZE-TIER SCALING (xs < s < m < l < xl)
   Anchored on m = 1.00 (Venusaur / Charizard / Blastoise = reference scale)
   ========================================================================== */
#app .poke-card.is-card3d[data-size-tier="xs"],
#card-zoom3d-overlay .zoom3d-card[data-size-tier="xs"] {
  --poke-size-scale: 0.70;
}
#app .poke-card.is-card3d[data-size-tier="s"],
#card-zoom3d-overlay .zoom3d-card[data-size-tier="s"] {
  --poke-size-scale: 0.85;
}
#app .poke-card.is-card3d[data-size-tier="m"],
#card-zoom3d-overlay .zoom3d-card[data-size-tier="m"] {
  --poke-size-scale: 1.00;
}
#app .poke-card.is-card3d[data-size-tier="l"],
#card-zoom3d-overlay .zoom3d-card[data-size-tier="l"] {
  --poke-size-scale: 1.12;
}
#app .poke-card.is-card3d[data-size-tier="xl"],
#card-zoom3d-overlay .zoom3d-card[data-size-tier="xl"] {
  --poke-size-scale: 1.22;
}

/* Scale grounded shadow proportionally with the Pokémon's size tier */
#app .poke-card.is-card3d .card-poke-shadow {
  width: calc(74px * var(--poke-size-scale, 1));
  height: calc(14px * var(--poke-size-scale, 1));
}
#card-zoom3d-overlay .zoom3d-poke-shadow {
  width: calc(118px * var(--poke-size-scale, 1));
  height: calc(24px * var(--poke-size-scale, 1));
}

/* ==========================================================================
   CLEAN KEYWORD TEXT & TOOLTIP BOXES (REMOVE GRAY BACKGROUNDS / GAPS)
   ========================================================================== */
/* Remove gray/tinted highlight boxes behind keywords inside card descriptions; keep crisp semantic bold color */
#app .card-desc .kw,
#card-zoom3d-overlay .zoom3d-desc .kw,
.dex-tuning-effect .kw {
  background: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

/* Remove dark gray outer container box peeking between floating .kw-card tooltip boxes */
.tooltip-box:has(.kw-card) {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tooltip-box .kw-card {
  background: #fffdf8 !important;
  color: #292524 !important;
  border: 2px solid #e6c675 !important;
  border-radius: 14px !important;
  padding: 10px 13px !important;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.24), 0 2px 6px rgba(15, 23, 42, 0.12) !important;
}


/* ==========================================================================
   STARTER SELECTION CAROUSEL — UNIFIED 3D POP-OUT CARDS
   ========================================================================== */
#app[data-screen="starter"] .starter-ring-card.is-starter-card3d-slot {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
  padding: 0 !important;
}

#app[data-screen="starter"] .starter-ring-card.is-starter-card3d-slot.is-front {
  box-shadow: none !important;
}

#app[data-screen="starter"] .starter-slot-pill {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: rgba(24, 22, 21, 0.88);
  color: #fde68a;
  border: 1.5px solid rgba(253, 230, 138, 0.45);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  white-space: nowrap;
  z-index: 12;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#app[data-screen="starter"] .starter-slot-pill.is-mega {
  background: linear-gradient(90deg, #9d174d, #7e22ce);
  color: #fff;
  border-color: rgba(249, 168, 212, 0.72);
}

#app[data-screen="starter"] .starter-ring-card.is-side .starter-slot-pill {
  opacity: 0.78;
  transform: translateX(-50%) scale(0.92);
}

#app[data-screen="starter"] .starter-poke-card.is-card3d {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  padding: 11px 12px 10px !important;
  gap: 8px;
  border-radius: 16px !important;
  border-width: 3px !important;
  box-shadow:
    0 14px 34px rgba(15, 23, 42, 0.34),
    0 4px 10px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.58) inset !important;
}

#app[data-screen="starter"] .starter-ring-card.is-front .starter-poke-card.is-card3d {
  cursor: zoom-in !important;
  box-shadow:
    0 20px 46px rgba(15, 23, 42, 0.44),
    0 0 0 2.5px rgba(255, 214, 102, 0.78),
    0 0 28px rgba(251, 191, 36, 0.28) !important;
}

#app[data-screen="starter"] .starter-ring-card.is-side .starter-poke-card.is-card3d {
  cursor: pointer !important;
}

/* Front card gets subtle 3D hover tilt; side cards keep clean carousel rotation without fighting perspective */
#app[data-screen="starter"] .starter-ring-card.is-front .starter-poke-card.is-card3d:hover {
  transform: perspective(900px) translateY(-4px) scale(1.02) rotate(0deg) rotateX(var(--crx, 0deg)) rotateY(var(--cry, 0deg)) !important;
}

#app[data-screen="starter"] .starter-ring-card.is-side .starter-poke-card.is-card3d:hover {
  transform: perspective(900px) translateY(0px) scale(1) rotate(0deg) rotateX(0deg) rotateY(0deg) !important;
}

#app[data-screen="starter"] .starter-poke-card.is-card3d .card-cost {
  width: 36px !important;
  height: 36px !important;
  top: -10px !important;
  left: -10px !important;
  border-radius: 9px !important;
  font-size: 18px !important;
  border-width: 2.5px !important;
}

#app[data-screen="starter"] .starter-poke-card.is-card3d .card-inspect-btn {
  top: 8px !important;
  right: 8px !important;
  width: 22px !important;
  height: 22px !important;
  font-size: 11.5px !important;
  border-radius: 6px !important;
}

#app[data-screen="starter"] .starter-poke-card.is-card3d .card-header {
  padding: 2px 26px 7px 28px !important;
  font-size: 16.5px !important;
}

#app[data-screen="starter"] .starter-poke-card.is-card3d .card-types-mini img {
  height: 16px !important;
}

#app[data-screen="starter"] .starter-poke-card.is-card3d .card-art-wrap {
  height: 164px !important;
}

#app[data-screen="starter"] .starter-poke-card.is-card3d .card-type-bg-emblem img {
  width: 118px;
  height: 118px;
}

#app[data-screen="starter"] .starter-poke-card.is-card3d .card-poke-pop {
  inset: -20px -10px -10px -10px;
}

#app[data-screen="starter"] .starter-poke-card.is-card3d .card-poke-pop img.card-sprite {
  zoom: 1 !important;
  max-width: 92% !important;
  max-height: calc(188px * var(--poke-size-scale, 1)) !important;
}

#app[data-screen="starter"] .starter-poke-card.is-card3d .card-poke-shadow {
  width: calc(104px * var(--poke-size-scale, 1));
  height: calc(20px * var(--poke-size-scale, 1));
  bottom: 10px;
}

#app[data-screen="starter"] .starter-poke-card.is-card3d .card-cat-badge {
  height: 18px;
  bottom: 7px;
  left: 8px;
}

#app[data-screen="starter"] .starter-poke-card.is-card3d .card-desc {
  padding: 9px 11px !important;
  font-size: 13.5px !important;
  line-height: 1.5 !important;
  border-radius: 9px !important;
}

#app[data-screen="starter"] .starter-poke-card.is-card3d .card-footer-meta {
  font-size: 11px;
  padding: 0 4px;
}

.card-effect-section + .card-effect-section,
.card-effect-traits {
  margin-top: .4em;
}

.card-effect-section > strong {
  font-weight: 850;
}

.card-effect-section .power-effect-line + .power-effect-line {
  margin-top: .32em;
}

.tooltip-box.power-field-tip {
  width: max-content;
  max-width: min(316px, calc(100vw - 24px)) !important;
  gap: 6px;
}

.tooltip-box.power-field-tip .kw-card {
  min-width: 0;
  margin: 0;
  padding: 8px 11px !important;
}

.power-tip-effects .power-effect-line + .power-effect-line {
  margin-top: .45em;
  padding-top: .45em;
  border-top: 1px solid #e5dccd;
}

.power-field-tip .kw {
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 850;
  white-space: nowrap;
}

.power-tip-glossary > div + div { margin-top: .45em; }
.power-tip-glossary dt,
.power-tip-glossary dd { display: inline; }
.power-tip-glossary dd { margin: 0 0 0 .45em; }

@media (max-height: 540px) and (min-width: 621px) {
  .tooltip-box.power-field-tip {
    flex-direction: row;
    align-items: flex-start;
    max-width: min(544px, calc(100vw - 24px)) !important;
  }

  .power-field-tip .kw-card { max-width: 270px; }
}
