/* ================= MARKET TRENDS WIDGET ================= */
.market-trends-widget {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .market-trends-widget {
    grid-template-columns: 1fr;
  }
}

.trend-column {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-subtle);
}

.trend-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.trend-head h4 {
  font-size: 0.95rem;
  font-weight: 800;
}

.trend-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trend-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-card-soft);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
}

.trend-item-row:hover {
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.08);
}

.trend-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trend-thumb {
  width: 32px;
  height: 42px;
  object-fit: cover;
  border-radius: 4px;
}

.trend-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.trend-pct {
  font-size: 0.85rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

.trend-pct.gainer {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.trend-pct.loser {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

/* ================= PLAYER PROFILE LOOKUP ================= */
.user-lookup-bar {
  margin-bottom: 24px;
}

.lookup-input-box {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 6px 8px 6px 20px;
  box-shadow: var(--shadow-subtle);
}

.lookup-input-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 600;
}

.lookup-btn {
  background: var(--primary-red);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  transition: transform 0.2s;
}

.profile-empty-hint {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.profile-stats-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  box-shadow: var(--shadow-subtle);
}

.profile-user-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar-wrap {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-card-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border: 2px solid var(--primary-red);
}

.profile-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-values-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  flex: 1;
  min-width: min(100%, 540px);
}

@media (max-width: 1180px) {
  .profile-stats-card {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px 16px;
  }
  .profile-values-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    width: 100%;
  }
}

@media (max-width: 600px) {
  .profile-values-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .profile-values-grid .m-stat-pill:last-child {
    grid-column: 1 / -1;
  }
}

.restock-chip {
  display: flex;
  align-items: center;
  gap: 0;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 0;
  min-height: 42px;
  border-radius: 13px;
  font-size: 0.82rem;
  overflow: hidden;
}

body.dark-mode .restock-chip {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.restock-chip .lbl {
  color: var(--text-muted);
  font-weight: 700;
}

.restock-chip .val {
  color: var(--primary-red);
  font-weight: 800;
  font-family: monospace;
  background: rgba(239, 68, 68, 0.12);
  padding: 2px 8px;
  border-radius: 8px;
}

body.dark-mode .restock-chip .val {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.22);
}


/* ================= FULL-WIDTH POKEMON CARDS GRID (RESPONSIVE AUTO-FILL) ================= */
.pokemon-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
  align-content: start;
}

@media (min-width: 1600px) {
  .pokemon-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
    gap: 18px;
  }
}

@media (max-width: 1200px) {
  .pokemon-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 14px;
  }
}

@media (max-width: 900px) {
  .pokemon-cards-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
  }
}

.pokemon-clean-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease;
  position: relative;
}

.pokemon-clean-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-hover);
  border-color: rgba(239, 68, 68, 0.35);
}

.pokemon-clean-card:active {
  transform: scale(0.97);
}

.card-pokemon-img-box {
  width: 100%;
  aspect-ratio: 2.5 / 3.5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-card-soft);
}

.card-pokemon-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.pokemon-clean-card:hover .card-pokemon-img-box img {
  transform: scale(1.05);
}

.card-poke-id {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.card-poke-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.card-badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.type-pill {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  color: #ffffff;
  letter-spacing: 0.5px;
}

.type-pill.grass { background-color: #4ade80; }
.type-pill.fire { background-color: #fb923c; }
.type-pill.water { background-color: #60a5fa; }
.type-pill.electric { background-color: #facc15; color: #854d0e; }
.type-pill.psychic { background-color: #f472b6; }
.type-pill.fighting { background-color: #f87171; }
.type-pill.dark { background-color: #64748b; }
.type-pill.metal { background-color: #94a3b8; }
.type-pill.colorless { background-color: #cbd5e1; color: #475569; }
.type-pill.dragon { background-color: #a855f7; }
.type-pill.double-rare {
  background: linear-gradient(120deg, #DBF4FF 0%, #2F5CFF 52%, #DBF4FF 100%);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.72);
  --pill-aura: rgba(47, 92, 255, 0.48);
}
.type-pill.illustration-rare {
  background: linear-gradient(120deg, #FFDCA9 0%, #BAE9F4 32%, #F7F7ED 58%, #A1D0F7 84%, #FFDCA9 100%);
  color: #1e293b;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
  --pill-aura: rgba(161, 208, 247, 0.56);
}
.type-pill.ultra-rare {
  background: linear-gradient(120deg, #020D33 0%, #116AF8 24%, #20BCED 48%, #A0E9FF 68%, #CDF5FD 82%, #116AF8 100%);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(2, 13, 51, 0.92), 0 0 6px rgba(17, 106, 248, 0.55);
  --pill-aura: rgba(32, 188, 237, 0.64);
}
.type-pill.special-illustration-rare {
  background: linear-gradient(125deg, #f7e7d8 0%, #f3a2bd 26%, #c9dae7 54%, #b6b1d9 80%, #f7e7d8 100%);
  color: #1e1b4b;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
  --pill-aura: rgba(243, 162, 189, 0.72);
}
.type-pill.hyper-rare {
  background: linear-gradient(120deg, #b45309 0%, #f59e0b 26%, #fef08a 50%, #fffbeb 62%, #f59e0b 80%, #b45309 100%);
  color: #451a03;
  text-shadow: 0 1px 0 rgba(255, 251, 235, 0.85);
  --pill-aura: rgba(250, 204, 21, 0.72);
}
.type-pill.rgb-rare {
  background: linear-gradient(120deg, #ff4d6d 0%, #ffb703 20%, #4ade80 40%, #38bdf8 60%, #a855f7 80%, #ff4d6d 100%);
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.82), 0 0 6px rgba(15, 23, 42, 0.45);
  --pill-aura: rgba(168, 85, 247, 0.68);
}
.type-pill.bwr {
  background: linear-gradient(135deg, #1f2937 0%, #09090b 58%, #27272a 100%);
  color: #ffffff;
  font-family: 'Cinzel Decorative', Georgia, serif;
  font-weight: 800;
  letter-spacing: 0.05em;
  border: 1.5px solid rgba(248, 250, 252, 0.72);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}
.type-pill.bwr.bwr-emblem {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  background: transparent;
  color: #ffffff;
  border: 1.5px solid transparent;
  border-radius: 5px;
  padding: 5px 15px;
  margin: 4px 20px;
  font-family: 'Cinzel Decorative', Georgia, serif;
  font-weight: 900;
  font-size: 0.56rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  isolation: isolate;
}

.bwr-emblem .bwr-plaque-fx {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, #1d1e26 0%, #09090d 62%, #020204 100%);
  border: 1.5px solid rgba(248, 250, 252, 0.85);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.16),
    inset 0 2px 6px rgba(255, 255, 255, 0.14),
    inset 0 -3px 8px rgba(0, 0, 0, 0.92),
    0 2px 10px rgba(0, 0, 0, 0.65);
  animation: bwrPlaqueBreath 8.4s ease-in-out infinite;
  z-index: 2;
}

.bwr-emblem .bwr-plaque-fx::after {
  content: '';
  position: absolute;
  top: -20%;
  left: 0;
  width: 50%;
  height: 140%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.18) 44%,
    rgba(255, 255, 255, 0.48) 50%,
    rgba(255, 255, 255, 0.18) 56%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-180%) skewX(-24deg);
  animation: bwrChromeGlint 8.4s ease-in-out infinite;
}

/* Hậu cảnh SVG đa lớp: Trăng khuyết la bàn ↔ Tia wireframe ↔ Vòng sao quỹ đạo 3D */
.bwr-emblem .bwr-bg-sigil {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 144%;
  height: 245%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  overflow: visible;
  z-index: 3;
}

.bwr-crescent-compass {
  transform-box: fill-box;
  transform-origin: center;
  animation: bwrCrescentPhase 8.4s ease-in-out infinite;
}

.bwr-crescent-arc {
  fill: rgba(226, 232, 240, 0.28);
  stroke: rgba(255, 255, 255, 0.48);
  stroke-width: 0.75;
}

.bwr-compass-star {
  fill: rgba(248, 250, 252, 0.34);
}

.bwr-compass-diag {
  fill: rgba(148, 163, 184, 0.3);
}

.bwr-wireframe-burst {
  transform-box: fill-box;
  transform-origin: center;
  animation: bwrWireframeScale 8.4s ease-in-out infinite;
}

.bwr-wf-path {
  fill: none;
  stroke: rgba(255, 255, 255, 0.9);
  stroke-width: 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: bwrWireframeTrace 8.4s ease-in-out infinite;
}

.bwr-wf-shard {
  fill: rgba(255, 255, 255, 0.72);
  stroke: rgba(226, 232, 240, 0.92);
  stroke-width: 0.95;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: bwrShardTrace 8.4s ease-in-out infinite;
}

.bwr-orbit-track {
  fill: none;
  stroke: rgba(226, 232, 240, 0.24);
  stroke-width: 0.85;
  stroke-dasharray: 4 3;
  animation: bwrOrbitPulse 8.4s ease-in-out infinite;
}

.bwr-halo-back {
  fill: rgba(203, 213, 225, 0.38);
  transform-box: fill-box;
  transform-origin: center;
  animation: bwrHaloBackGlide 8.4s ease-in-out infinite;
}

.bwr-halo-front {
  fill: #ffffff;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.85));
  transform-box: fill-box;
  transform-origin: center;
  animation: bwrHaloFrontGlide 8.4s ease-in-out infinite;
}

/* Đôi cánh vẩy động 3 dáng tách nền từ assets người dùng (tương phản đen/trắng Light-Dark) */
.bwr-wing-dock {
  position: absolute;
  top: 46%;
  width: 44px;
  height: 36px;
  pointer-events: none;
  z-index: 1;
}

.bwr-wing-dock.left {
  left: -34px;
  transform: translateY(-50%);
}

.bwr-wing-dock.right {
  right: -34px;
  transform: translateY(-50%) scaleX(-1);
}

.bwr-wing-flap {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: 86% 58%;
  animation: bwrWingFlapBeat 2.8s cubic-bezier(0.45, 0.05, 0.25, 0.95) infinite;
  will-change: transform;
}

.bwr-wing-sprite {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 1;
  pointer-events: none;
  will-change: transform;
}

.bwr-wing-flap {
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.92)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.dark-mode .bwr-wing-flap {
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.7));
}

.dark-mode .bwr-wing-sprite {
  filter: invert(1) brightness(1.06);
}

/* Nhát cắt sao 4 cánh xuyên tâm nằm phía sau/viền nhẹ để KHÔNG che chữ */
.bwr-emblem .bwr-slash-spear {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 114%;
  height: 175%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  overflow: visible;
  z-index: 4;
}

.bwr-spear-beam {
  fill: rgba(255, 255, 255, 0.78);
  filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.85));
  transform-box: fill-box;
  transform-origin: center;
  animation: bwrSpearPierce 8.4s ease-in-out infinite;
}

.bwr-apex-star {
  fill: #ffffff;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.95));
  transform-box: fill-box;
  transform-origin: center;
  animation: bwrApexTwinkle 8.4s ease-in-out infinite;
}

/* Typography Neo-Gothic ánh Chrome Bạc đặt lớp Z cao nhất (z-index: 6) và ghi đè * { font-family } của base.css */
.bwr-emblem .bwr-title-stage {
  position: relative;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.bwr-emblem .bwr-word-inline,
.bwr-emblem .bwr-word-top,
.bwr-emblem .bwr-sub-txt,
.bwr-emblem .bwr-cap {
  font-family: 'Cinzel Decorative', Georgia, serif !important;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 46%, #cbd5e1 55%, #ffffff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #ffffff;
  filter: drop-shadow(0 1.5px 1px rgba(0, 0, 0, 0.98)) drop-shadow(0 0 4px rgba(0, 0, 0, 0.92));
  white-space: nowrap;
}

/* ---------------- SIGNATURE HERO MODE (MODAL SHOWCASE) ---------------- */
.type-pill.bwr.bwr-emblem.bwr-hero {
  padding: 11px 28px;
  margin: 14px 56px;
  min-width: 190px;
  border-radius: 6px;
}

.bwr-emblem.bwr-hero .bwr-plaque-fx {
  border-width: 1.8px;
  background: radial-gradient(ellipse at 50% 45%, #232530 0%, #09090d 62%, #020204 100%);
}

.bwr-emblem.bwr-hero .bwr-bg-sigil {
  width: 152%;
  height: 215%;
}

.bwr-emblem.bwr-hero .bwr-wing-dock {
  width: 82px;
  height: 66px;
  top: 44%;
}

.bwr-emblem.bwr-hero .bwr-wing-dock.left {
  left: -62px;
}

.bwr-emblem.bwr-hero .bwr-wing-dock.right {
  right: -62px;
}

.bwr-wordmark-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.bwr-word-top {
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.05;
}

.bwr-word-top .bwr-cap {
  font-size: 0.96rem;
}

.bwr-word-sub {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  line-height: 1;
}

.bwr-sub-txt {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  padding-left: 0.28em;
}

.bwr-ornament-bar {
  width: 18px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

.bwr-emblem.bwr-hero .bwr-slash-spear {
  width: 120%;
  height: 162%;
}

/* Tương phản âm-dương cho tia sáng vươn ra ngoài nền sáng (Light Mode) vs nền tối (Dark Mode) */
body:not(.dark-mode) .bwr-emblem .bwr-bg-sigil,
body:not(.dark-mode) .bwr-emblem .bwr-slash-spear {
  filter: drop-shadow(0 0 1.2px rgba(5, 5, 10, 0.92)) drop-shadow(0 0 2px rgba(15, 23, 42, 0.55));
}

body.dark-mode .bwr-emblem .bwr-bg-sigil,
body.dark-mode .bwr-emblem .bwr-slash-spear {
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.35));
}

/* Hover Interactive Acceleration */
.pokemon-clean-card:hover .type-pill.bwr.bwr-emblem .bwr-plaque-fx,
.type-pill.bwr.bwr-emblem:hover .bwr-plaque-fx {
  border-color: #ffffff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.34),
    inset 0 2px 8px rgba(255, 255, 255, 0.22),
    0 0 18px rgba(255, 255, 255, 0.46);
}

.pokemon-clean-card:hover .type-pill.bwr.bwr-emblem .bwr-wing-flap,
.type-pill.bwr.bwr-emblem:hover .bwr-wing-flap {
  animation-duration: 1.75s;
}

/* ---------------- BWR CHOREOGRAPHED KEYFRAMES (8.4s CYCLE) ---------------- */
@keyframes bwrPlaqueBreath {
  0%, 100% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.14),
      inset 0 2px 6px rgba(255, 255, 255, 0.12),
      0 2px 10px rgba(0, 0, 0, 0.65),
      0 0 8px rgba(255, 255, 255, 0.16);
  }
  38%, 62% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.32),
      inset 0 2px 10px rgba(255, 255, 255, 0.22),
      0 4px 14px rgba(0, 0, 0, 0.8),
      0 0 18px rgba(255, 255, 255, 0.38);
  }
}

@keyframes bwrChromeGlint {
  0%, 56% {
    transform: translateX(-180%) skewX(-24deg);
  }
  82%, 100% {
    transform: translateX(300%) skewX(-24deg);
  }
}

/* Pha 1: Trăng khuyết & la bàn Bắc Đẩu hiện từ mờ rồi nhật thực tan biến trước khi wireframe vẽ */
@keyframes bwrCrescentPhase {
  0%, 100% {
    opacity: 0.16;
    transform: translateX(-4px) rotate(-8deg) scale(0.92);
  }
  18%, 34% {
    opacity: 0.92;
    transform: translateX(0px) rotate(0deg) scale(1.02);
  }
  48%, 74% {
    opacity: 0.08;
    transform: translateX(4px) rotate(10deg) scale(0.88);
  }
}

/* Pha 2: Tia Wireframe 8 hướng tự vẽ nét từ tâm rồi rút nét */
@keyframes bwrWireframeScale {
  0%, 34% {
    opacity: 0;
    transform: scale(0.86);
  }
  44%, 66% {
    opacity: 1;
    transform: scale(1.03);
  }
  78%, 100% {
    opacity: 0;
    transform: scale(0.92);
  }
}

@keyframes bwrWireframeTrace {
  0%, 34% {
    stroke-dashoffset: 100;
  }
  48%, 62% {
    stroke-dashoffset: 0;
  }
  76%, 100% {
    stroke-dashoffset: -100;
  }
}

@keyframes bwrShardTrace {
  0%, 40% {
    stroke-dashoffset: 100;
    fill-opacity: 0;
  }
  52%, 64% {
    stroke-dashoffset: 0;
    fill-opacity: 0.78;
  }
  78%, 100% {
    stroke-dashoffset: -100;
    fill-opacity: 0;
  }
}

/* Vòng sao phối cảnh 3D ẩn/hiện tiền cảnh vs hậu cảnh */
@keyframes bwrOrbitPulse {
  0%, 100% {
    opacity: 0.25;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes bwrHaloFrontGlide {
  0%, 100% {
    opacity: 0.35;
    transform: translate(-10px, 2px) scale(0.95);
  }
  28%, 55% {
    opacity: 1;
    transform: translate(0px, 0px) scale(1.02);
  }
  78% {
    opacity: 0.22;
    transform: translate(10px, -2px) scale(0.93);
  }
}

@keyframes bwrHaloBackGlide {
  0%, 100% {
    opacity: 0.85;
    transform: translate(8px, 1px) scale(1);
  }
  42%, 65% {
    opacity: 0.18;
    transform: translate(-8px, -1px) scale(0.92);
  }
}

/* Nhịp cánh vẩy động tự nhiên */
@keyframes bwrWingFlapBeat {
  0%, 100% {
    transform: rotate(7deg) scaleY(1.03) scaleX(1.02) translateY(-1px);
  }
  26% {
    transform: rotate(16deg) scaleY(1.09) scaleX(1.05) translateY(-3px);
  }
  48% {
    transform: rotate(-14deg) scaleY(0.84) scaleX(0.95) translateY(2px);
  }
  66% {
    transform: rotate(5deg) scaleY(1) scaleX(1) translateY(0px);
  }
  82% {
    transform: rotate(-6deg) scaleY(0.92) scaleX(0.97) translateY(1px);
  }
}

/* Nhát cắt sao 4 cánh xuyên tâm & đỉnh sao góc phải */
@keyframes bwrSpearPierce {
  0%, 48% {
    opacity: 0.22;
    transform: translate(-12px, 10px) scale(0.72);
  }
  62%, 72% {
    opacity: 1;
    transform: translate(0px, 0px) scale(1.04);
  }
  86%, 100% {
    opacity: 0.18;
    transform: translate(10px, -8px) scale(0.68);
  }
}

@keyframes bwrApexTwinkle {
  0%, 16%, 100% {
    opacity: 0.28;
    transform: scale(0.55) rotate(-18deg);
  }
  30%, 66% {
    opacity: 1;
    transform: scale(1.16) rotate(8deg);
  }
  82% {
    opacity: 0.35;
    transform: scale(0.6) rotate(24deg);
  }
}

.type-pill.has-sparkle-fx {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  background-size: 250% 250%;
  animation:
    pillColorFlow 3.6s ease-in-out infinite,
    pillAuraPulse 2.8s ease-in-out infinite;
}

.type-pill.has-sparkle-fx .pill-txt {
  position: relative;
  z-index: 2;
  line-height: 1.15;
}

.pill-fx-layer {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}

.pill-fx-layer::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 35%, rgba(255, 255, 255, 0.88) 0 1.1px, transparent 2px),
    radial-gradient(circle at 46% 72%, rgba(255, 255, 255, 0.78) 0 1px, transparent 1.8px),
    radial-gradient(circle at 74% 28%, rgba(255, 255, 255, 0.92) 0 1.2px, transparent 2.1px),
    radial-gradient(circle at 86% 68%, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.8px),
    linear-gradient(108deg, transparent 22%, rgba(255, 255, 255, 0.28) 32%, transparent 42%, transparent 62%, rgba(255, 255, 255, 0.24) 72%, transparent 82%);
  background-size: 160% 160%;
  opacity: 0.45;
  animation: pillGlitterPulse 2.4s ease-in-out infinite;
}

.pill-fx-layer::after {
  content: '';
  position: absolute;
  top: -15%;
  left: 0;
  width: 58%;
  height: 130%;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.14) 24%,
    rgba(255, 255, 255, 0.56) 44%,
    rgba(255, 255, 255, 0.14) 56%,
    rgba(255, 255, 255, 0.36) 70%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: translateX(-160%) skewX(-22deg);
  animation: pillDoubleSweep 3.4s ease-in-out infinite;
}

.pill-star {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  background: url('/static/assets/star-flare.png') center / contain no-repeat;
  opacity: 0;
  transform: scale(0.14) rotate(-24deg);
  will-change: transform, opacity;
}

.pill-star.s1 {
  width: 18px;
  height: 18px;
  top: -7px;
  right: -7px;
  animation: pillAssetTwinkle 2.2s ease-in-out infinite 0s;
}

.pill-star.s2 {
  width: 15px;
  height: 15px;
  bottom: -6px;
  left: -6px;
  animation: pillAssetTwinkleAlt 2.6s ease-in-out infinite 0.75s;
}

.pill-star.s3 {
  width: 13px;
  height: 13px;
  top: -6px;
  left: 18%;
  animation: pillAssetTwinkle 2.4s ease-in-out infinite 1.35s;
}

.pill-star.s4 {
  width: 14px;
  height: 14px;
  bottom: -6px;
  right: 18%;
  animation: pillAssetTwinkleAlt 2.8s ease-in-out infinite 1.9s;
}

.type-pill.hyper-rare .pill-star {
  filter: sepia(0.28) saturate(1.45) brightness(1.05);
}

.pokemon-clean-card:hover .type-pill.has-sparkle-fx,
.type-pill.has-sparkle-fx:hover {
  animation:
    pillColorFlow 2.1s ease-in-out infinite,
    pillAuraPulse 1.6s ease-in-out infinite;
}

.pokemon-clean-card:hover .pill-fx-layer::after,
.type-pill.has-sparkle-fx:hover .pill-fx-layer::after {
  animation-duration: 2s;
}

@keyframes pillColorFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes pillAuraPulse {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.48),
      inset 0 -2px 0 rgba(0, 0, 0, 0.24),
      2px 2px 0 rgba(15, 23, 42, 0.25),
      0 0 6px -1px var(--pill-aura, rgba(255, 255, 255, 0.3));
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.7),
      inset 0 -2px 0 rgba(0, 0, 0, 0.2),
      2px 2px 0 rgba(15, 23, 42, 0.25),
      0 0 13px 2px var(--pill-aura, rgba(255, 255, 255, 0.58));
  }
}

@keyframes pillGlitterPulse {
  0%, 100% {
    opacity: 0.26;
    background-position: 0% 0%;
  }
  50% {
    opacity: 0.82;
    background-position: 100% 100%;
  }
}

@keyframes pillDoubleSweep {
  0%, 14% {
    transform: translateX(-160%) skewX(-22deg);
  }
  56%, 100% {
    transform: translateX(270%) skewX(-22deg);
  }
}

@keyframes pillAssetTwinkle {
  0%, 14%, 100% {
    opacity: 0;
    transform: scale(0.12) rotate(-28deg);
  }
  32% {
    opacity: 0.98;
    transform: scale(1.16) rotate(8deg);
  }
  46% {
    opacity: 0.45;
    transform: scale(0.76) rotate(18deg);
  }
  58% {
    opacity: 1;
    transform: scale(1.06) rotate(26deg);
  }
  78% {
    opacity: 0;
    transform: scale(0.18) rotate(42deg);
  }
}

@keyframes pillAssetTwinkleAlt {
  0%, 18%, 100% {
    opacity: 0;
    transform: scale(0.12) rotate(24deg);
  }
  38% {
    opacity: 0.95;
    transform: scale(1.12) rotate(-8deg);
  }
  52% {
    opacity: 0.42;
    transform: scale(0.72) rotate(-18deg);
  }
  65% {
    opacity: 0.98;
    transform: scale(1.02) rotate(-26deg);
  }
  84% {
    opacity: 0;
    transform: scale(0.16) rotate(-40deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .type-pill.has-sparkle-fx,
  .pill-fx-layer::before,
  .pill-fx-layer::after,
  .pill-star,
  .type-pill.bwr.bwr-emblem,
  .bwr-emblem .bwr-plaque-fx::after,
  .bwr-crescent-compass,
  .bwr-wireframe-burst,
  .bwr-wf-path,
  .bwr-wf-shard,
  .bwr-orbit-track,
  .bwr-halo-back,
  .bwr-halo-front,
  .bwr-emblem .bwr-wing-flap,
  .bwr-wing-sprite,
  .bwr-spear-beam,
  .bwr-apex-star {
    animation: none !important;
  }
  .pill-star.s1 {
    opacity: 0.9;
    transform: scale(0.95) rotate(0deg);
  }
  .bwr-wf-path,
  .bwr-wf-shard {
    stroke-dashoffset: 0;
  }
  .bwr-spear-beam,
  .bwr-apex-star,
  .bwr-halo-front,
  .bwr-wing-sprite {
    opacity: 1;
  }
}

/* Tắt hiệu ứng huy hiệu độ hiếm (Chế độ Huy Hiệu Tĩnh tối ưu cho di động cấu hình thấp) */
html.badge-fx-off .type-pill.has-sparkle-fx,
body.badge-fx-off .type-pill.has-sparkle-fx,
html.badge-fx-off .type-pill.bwr.bwr-emblem,
body.badge-fx-off .type-pill.bwr.bwr-emblem,
html.badge-fx-off .type-pill.bwr.bwr-emblem .bwr-plaque-fx,
body.badge-fx-off .type-pill.bwr.bwr-emblem .bwr-plaque-fx {
  animation: none !important;
  transition: none !important;
  background-size: 100% 100% !important;
}

html.badge-fx-off .type-pill.bwr.bwr-emblem,
body.badge-fx-off .type-pill.bwr.bwr-emblem {
  margin: 0 !important;
  padding: 4px 10px !important;
  min-width: auto !important;
}

html.badge-fx-off .pill-fx-layer,
body.badge-fx-off .pill-fx-layer,
html.badge-fx-off .pill-star,
body.badge-fx-off .pill-star,
html.badge-fx-off .bwr-wing-dock,
body.badge-fx-off .bwr-wing-dock,
html.badge-fx-off .bwr-bg-sigil,
body.badge-fx-off .bwr-bg-sigil,
html.badge-fx-off .bwr-slash-spear,
body.badge-fx-off .bwr-slash-spear,
html.badge-fx-off .bwr-plaque-fx::after,
body.badge-fx-off .bwr-plaque-fx::after {
  display: none !important;
  animation: none !important;
}

.card-market-sub {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-light);
  font-size: 0.8rem;
  white-space: nowrap;
}

.card-market-price {
  font-weight: 800;
  color: var(--accent-gold);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.card-market-supply {
  color: var(--text-secondary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ================= POPUP CARD DETAIL MODAL ================= */
.clean-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.clean-modal-overlay.open {
  display: flex;
}

.clean-modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 900px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
}

.modal-close-x {
  position: absolute;
  top: 28px;
  right: 24px;
  background: var(--bg-card-soft);
  border: 1px solid var(--border-light);
  width: 38px;
  height: 38px;
  padding: 0;
  line-height: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all 0.2s;
  z-index: 200;
}

.modal-close-x svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

.modal-close-x:hover {
  color: var(--primary-red);
  background: rgba(239, 68, 68, 0.1);
}

.detail-modal-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
}

@media (max-width: 768px) {
  .detail-modal-layout {
    grid-template-columns: 1fr;
  }
}

.detail-modal-art {
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-modal-art img {
  width: 100%;
  max-width: 270px;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.15);
}

.detail-modal-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-section-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-top: 4px;
}

.market-stats-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.m-stat-pill {
  background: var(--bg-card-soft);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  text-align: center;
}

.m-stat-pill .lbl {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.m-stat-pill .val {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 2px;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.chart-box-clean {
  background: var(--bg-card-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  padding: 12px;
  height: 180px;
}

.owners-clean-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 130px;
  overflow-y: auto;
}

.owner-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--bg-card-soft);
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  font-weight: 600;
}

.owner-row-item .tag {
  color: var(--accent-blue);
  font-weight: 700;
}

.owner-row-item .qty {
  font-weight: 800;
  color: var(--text-primary);
}

/* ================= PAGINATION ================= */
.pagination-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

.clean-page-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
  transition: all 0.2s;
}

.clean-page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.clean-page-btn:hover:not(:disabled) {
  background: var(--bg-card-soft);
  border-color: var(--primary-red);
}

.page-info {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* ================= PACKS & LEADERBOARDS ================= */
.packs-modern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.pack-clean-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  position: relative;
  overflow: hidden;
}

.pack-clean-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-red);
}

.pack-clean-card.flash-sale::before {
  content: "20% OFF";
  position: absolute;
  top: 14px;
  right: -32px;
  background: var(--primary-red);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 900;
  padding: 4px 34px;
  transform: rotate(45deg);
}

.pack-clean-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.pack-clean-pool {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 12px;
}

.pack-pricing-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 14px;
}

.pack-gold {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--accent-gold);
}

.pack-gold del {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 4px;
}

.pack-gem {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.1);
  padding: 3px 8px;
  border-radius: 6px;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 700;
  margin-bottom: 6px;
}

.meter-track {
  width: 100%;
  height: 8px;
  background: var(--bg-card-soft);
  border-radius: var(--radius-pill);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.meter-bar {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #10b981);
  border-radius: var(--radius-pill);
}

.pack-last-sold {
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pack-last-sold-time {
  color: var(--text-secondary);
  font-weight: 700;
}

.pack-tap-view {
  margin-top: 12px;
  background: var(--bg-card-soft);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary-red);
}

.leaderboard-dual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

@media (max-width: 1180px) {
  .leaderboard-dual-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

.clean-white-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
}

.panel-heading {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.clean-lb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-weight: 700;
  font-size: 0.88rem;
}

.lb-user-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  cursor: pointer;
  user-select: none;
}

.lb-user-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s ease, text-decoration 0.15s ease;
}

.lb-user-cell:hover .lb-user-name {
  color: var(--primary-accent, #3b82f6);
  text-decoration: underline;
}

.lb-val-cell {
  flex-shrink: 0;
  text-align: right;
  white-space: nowrap;
}

.bot-nav-emoji {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  object-fit: contain;
  display: inline-block;
}

.bot-status-emoji {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  object-fit: contain;
  display: inline-block;
}

.anime-emoji-rank {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  object-fit: contain;
  display: inline-block;
}

.anime-emoji {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  object-fit: contain;
  display: inline-block;
  flex-shrink: 0 !important;
  margin-left: 2px;
}

.tab-view {
  display: none;
}
.tab-view.active {
  display: block;
}

/* Ẩn hoàn toàn các thành phần Mobile Bottom Bar trên Desktop (> 768px) */
@media (min-width: 769px) {
  .mobile-bottom-dock,
  .mobile-nav-sheet,
  .mobile-nav-backdrop,
  .mobile-top-restock-pill,
  .mobile-top-scroll-btn,
  .mobile-login-icon-btn,
  .mobile-user-avatar-wrap {
    display: none !important;
  }
}

/* ================= TABLET RESPONSIVE FOR LEFT SIDEBAR ================= */
@media (min-width: 769px) and (max-width: 1100px) {
  .page-container {
    padding: 20px 18px 20px 104px;
  }
}

/* ================= COMPREHENSIVE MOBILE RESPONSIVE ================= */
@media (max-width: 768px) {
  body {
    -webkit-tap-highlight-color: transparent;
  }

  .page-container {
    padding: 68px 10px 12px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    overflow-x: hidden;
  }

  .live-modal-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
  }

  .live-modal-stat-row .live-modal-stat-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(0.78rem, 3.2vw, 0.88rem);
  }

  .live-modal-stat-row .price-val-card,
  .live-modal-stat-row .price-val-total {
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
    font-size: clamp(0.85rem, 3.5vw, 1.05rem) !important;
  }

  /* 1. Compact Mobile Micro-Header (1 dòng cố định gọn trên đỉnh ~46px) + Bottom Floating Dock */
  .top-nav-card,
  .top-nav-card:hover {
    position: fixed;
    top: 8px;
    left: 10px;
    right: 10px;
    bottom: auto;
    transform: none;
    height: auto;
    max-height: none;
    width: auto;
    z-index: 590;
    flex-direction: column;
    gap: 0;
    padding: 6px 8px 6px 12px;
    margin-bottom: 12px;
    border-radius: var(--radius-pill);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  }

  body.dark-mode .top-nav-card,
  body.dark-mode .top-nav-card:hover {
    background: rgba(12, 13, 18, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.13);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.82);
  }

  .sidebar-top-block,
  .sidebar-bottom-divider,
  .sidebar-account-row,
  .nav-section-divider,
  .restock-mini-time,
  .floating-theme-dock,
  .hamburger-menu-btn,
  .nav-pills,
  .nav-right {
    display: none !important;
  }

  .nav-mobile-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 34px;
  }

  .nav-mobile-brand {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 800;
    font-size: 0.96rem;
    color: var(--text-primary);
    flex-shrink: 0;
  }

  .nav-mobile-brand .bot-nav-avatar {
    width: 28px !important;
    height: 28px !important;
  }

  .nav-mobile-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
  }

  .mobile-top-restock-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 32px;
    padding: 0 10px;
    border-radius: var(--radius-pill);
    background: var(--bg-card-soft);
    border: 1px solid var(--border-light);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
  }

  body.dark-mode .mobile-top-restock-pill {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.11);
  }

  .mobile-top-restock-icon {
    width: 15px;
    height: 15px;
    object-fit: contain;
    flex-shrink: 0;
  }

  .mobile-top-restock-val {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 800;
    font-size: 0.74rem;
    color: var(--primary-red);
    letter-spacing: -0.02em;
  }

  body.dark-mode .mobile-top-restock-val {
    color: #fca5a5;
  }

  .sun-moon-toggle-mobile {
    width: 34px;
    height: 34px;
  }

  .mobile-top-scroll-btn {
    width: 0;
    height: 34px;
    margin-right: -6px;
    padding: 0;
    border-radius: 50%;
    border: 0 solid var(--border-light);
    background: var(--bg-card-soft);
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.75);
    transition:
      width 0.24s cubic-bezier(0.22, 1, 0.36, 1),
      margin 0.24s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.2s ease,
      transform 0.24s cubic-bezier(0.22, 1, 0.36, 1),
      background-color 0.2s ease,
      border-color 0.2s ease;
  }

  .mobile-top-scroll-btn.visible {
    width: 34px;
    margin-right: 0;
    border-width: 1px;
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
    box-shadow: var(--shadow-subtle);
  }

  .mobile-top-scroll-btn:active {
    transform: scale(0.92);
  }

  body.dark-mode .mobile-top-scroll-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    color: #f4f4f6;
  }

  .mobile-login-icon-btn,
  .mobile-user-avatar-wrap {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
  }

  /* Bottom Floating Pill Dock + Nút tròn '+' tách rời */
  .mobile-bottom-dock {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    max-width: 440px;
    margin: 0 auto;
    z-index: 620;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
  }

  .mobile-bottom-pill {
    flex: 1;
    min-width: 0;
    height: 58px;
    padding: 5px;
    border-radius: 9999px;
    pointer-events: auto;
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: stretch;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    box-shadow:
      0 12px 32px rgba(15, 23, 42, 0.14),
      0 2px 8px rgba(15, 23, 42, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.92);
  }

  body.dark-mode .mobile-bottom-pill {
    background: rgba(16, 17, 23, 0.9);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow:
      0 16px 38px rgba(0, 0, 0, 0.84),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  .mobile-pill-indicator {
    position: absolute;
    top: 5px;
    left: 0;
    height: calc(100% - 10px);
    border-radius: 9999px;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    background: rgba(15, 23, 42, 0.07);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transition:
      transform 0.36s cubic-bezier(0.22, 1, 0.36, 1),
      width 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.2s ease;
    will-change: transform, width;
  }

  .mobile-pill-indicator.is-instant {
    transition: none !important;
  }

  body.dark-mode .mobile-pill-indicator {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
  }

  .mobile-pill-btn {
    position: relative;
    z-index: 2;
    border: none;
    background: transparent;
    border-radius: 9999px;
    padding: 3px 4px;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    cursor: pointer;
    color: var(--text-secondary);
    font-family: inherit;
    transition: color 0.2s ease, transform 0.16s ease;
    min-width: 0;
  }

  .mobile-pill-btn:active {
    transform: scale(0.94);
  }

  .mobile-pill-btn.active {
    color: var(--primary-red);
    font-weight: 800;
  }

  body.dark-mode .mobile-pill-btn.active {
    color: #ffffff;
  }

  .mobile-pill-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .mobile-pill-emoji {
    width: 21px;
    height: 21px;
    object-fit: contain;
    display: block;
  }

  .mobile-pill-text {
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.01em;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-pill-btn.active .mobile-pill-text {
    font-weight: 800;
  }

  .mobile-bottom-more-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    flex-shrink: 0;
    pointer-events: auto;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(22px) saturate(180%);
    -webkit-backdrop-filter: blur(22px) saturate(180%);
    box-shadow:
      0 12px 32px rgba(15, 23, 42, 0.16),
      0 2px 8px rgba(15, 23, 42, 0.06),
      inset 0 1px 0 rgba(255, 255, 255, 0.92);
    transition: transform 0.2s ease, background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
  }

  body.dark-mode .mobile-bottom-more-btn {
    background: rgba(16, 17, 23, 0.92);
    border-color: rgba(255, 255, 255, 0.16);
    color: #f4f4f6;
    box-shadow:
      0 16px 38px rgba(0, 0, 0, 0.84),
      inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }

  .mobile-bottom-more-btn:active {
    transform: scale(0.93);
  }

  .mobile-bottom-more-btn.has-overflow-active {
    border-color: rgba(239, 68, 68, 0.45);
    color: var(--primary-red);
  }

  body.dark-mode .mobile-bottom-more-btn.has-overflow-active {
    border-color: rgba(255, 255, 255, 0.42);
    color: #ffffff;
  }

  .mobile-bottom-more-btn.open {
    background: #1e293b;
    border-color: #1e293b;
    color: #ffffff;
  }

  body.dark-mode .mobile-bottom-more-btn.open {
    background: #f4f4f6;
    border-color: #ffffff;
    color: #09090b;
  }

  .mobile-more-icon {
    display: block;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .mobile-bottom-more-btn.open .mobile-more-icon {
    transform: rotate(45deg);
  }

  .mobile-more-dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-red);
    box-shadow: 0 0 0 2px #ffffff, 0 0 8px rgba(239, 68, 68, 0.8);
    opacity: 0;
    transform: scale(0.4);
    transition: opacity 0.2s ease, transform 0.22s ease;
    pointer-events: none;
  }

  body.dark-mode .mobile-more-dot {
    box-shadow: 0 0 0 2px #101117, 0 0 8px rgba(239, 68, 68, 0.85);
  }

  .mobile-more-dot.visible {
    opacity: 1;
    transform: scale(1);
  }

  .mobile-bottom-more-btn.open .mobile-more-dot {
    opacity: 0;
    transform: scale(0.4);
  }

  /* Backdrop & Bảng Menu Lưới Sổ Ra phía trên Bottom Dock */
  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 610;
    background: rgba(15, 23, 42, 0.32);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.24s ease, visibility 0.24s ease;
  }

  body.dark-mode .mobile-nav-backdrop {
    background: rgba(0, 0, 0, 0.58);
  }

  .mobile-nav-backdrop.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .mobile-nav-sheet {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(80px + env(safe-area-inset-bottom));
    max-width: 440px;
    margin: 0 auto;
    z-index: 615;
    max-height: calc(100vh - 108px - env(safe-area-inset-bottom));
    overflow-y: auto;
    border-radius: 26px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(26px) saturate(185%);
    -webkit-backdrop-filter: blur(26px) saturate(185%);
    box-shadow:
      0 22px 54px rgba(15, 23, 42, 0.22),
      0 4px 14px rgba(15, 23, 42, 0.08),
      inset 0 1px 0 rgba(255, 255, 255, 0.95);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform-origin: calc(100% - 28px) 100%;
    transform: translateY(16px) scale(0.94);
    transition:
      opacity 0.24s ease,
      transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
      visibility 0.26s ease;
  }

  body.dark-mode .mobile-nav-sheet {
    background: rgba(14, 15, 20, 0.96);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow:
      0 24px 62px rgba(0, 0, 0, 0.88),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }

  .mobile-nav-sheet.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .mobile-sheet-utility {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px dashed var(--border-light);
    flex-wrap: wrap;
  }

  .mobile-sheet-restock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 11px;
    border-radius: var(--radius-pill);
    background: var(--bg-card-soft);
    border: 1px solid var(--border-light);
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-secondary);
  }

  body.dark-mode .mobile-sheet-restock {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .mobile-sheet-restock-icon {
    width: 17px;
    height: 17px;
    object-fit: contain;
  }

  .mobile-sheet-restock-val {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 800;
    color: var(--primary-red);
  }

  body.dark-mode .mobile-sheet-restock-val {
    color: #fca5a5;
  }

  .mobile-sheet-auth {
    display: flex;
    align-items: center;
    min-width: 0;
  }

  .mobile-sheet-login-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    background: rgba(88, 101, 242, 0.12);
    border: 1px solid rgba(88, 101, 242, 0.34);
    color: #5865F2;
    font-size: 0.76rem;
    font-weight: 800;
    text-decoration: none;
    transition: background-color 0.2s ease;
  }

  body.dark-mode .mobile-sheet-login-pill {
    background: rgba(88, 101, 242, 0.22);
    border-color: rgba(88, 101, 242, 0.45);
    color: #8a93ff;
  }

  .mobile-sheet-user-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 6px 4px 6px;
    border-radius: var(--radius-pill);
    background: var(--bg-card-soft);
    border: 1px solid var(--border-light);
    max-width: 210px;
  }

  body.dark-mode .mobile-sheet-user-pill {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
  }

  .mobile-sheet-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid #22c55e;
    flex-shrink: 0;
  }

  .mobile-sheet-user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.15;
  }

  .mobile-sheet-user-name {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-sheet-user-sub {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-sheet-logout-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
  }

  body.dark-mode .mobile-sheet-logout-btn {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.16);
  }

  .mobile-sheet-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 6px;
  }

  .mobile-sheet-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    padding: 4px 2px;
    background: transparent;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-family: inherit;
    color: var(--text-secondary);
    transition: transform 0.16s ease, color 0.2s ease;
    min-width: 0;
  }

  .mobile-sheet-tile:active {
    transform: scale(0.93);
  }

  .mobile-tile-box {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card-soft);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  }

  body.dark-mode .mobile-tile-box {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f4f4f6;
  }

  .mobile-sheet-tile.active {
    color: var(--primary-red);
  }

  .mobile-sheet-tile.active .mobile-tile-box {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.42);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.16);
  }

  body.dark-mode .mobile-sheet-tile.active {
    color: #ffffff;
  }

  body.dark-mode .mobile-sheet-tile.active .mobile-tile-box {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.42);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  }

  .mobile-tile-emoji {
    width: 24px;
    height: 24px;
    object-fit: contain;
    display: block;
  }

  .mobile-tile-label {
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-sheet-tile.active .mobile-tile-label {
    font-weight: 800;
  }

  @media (max-width: 375px) {
    .mobile-top-restock-lbl {
      display: none;
    }
    .mobile-bottom-pill {
      height: 54px;
    }
    .mobile-bottom-more-btn {
      width: 54px;
      height: 54px;
    }
    .mobile-tile-box {
      width: 44px;
      height: 44px;
      border-radius: 13px;
    }
    .mobile-tile-label {
      font-size: 0.66rem;
    }
  }

  /* 2. Control Panel & Filters */
  .control-panel {
    gap: 12px;
    margin-bottom: 16px;
  }

  .search-bar {
    padding: 4px 6px 4px 16px;
  }

  .search-bar input {
    font-size: 0.88rem;
  }

  .search-btn-icon {
    width: 38px;
    height: 38px;
  }

  .filter-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .filter-pill-select {
    padding: 6px 14px;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: var(--radius-pill);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    align-items: center;
    gap: 4px;
    box-sizing: border-box;
    min-width: 0;
  }

  .filter-row .range-selector {
    grid-column: 1 / -1;
  }

  .filter-row .active-badge {
    grid-column: 1 / -1;
  }

  .custom-dropdown {
    flex: 1;
    min-width: 0;
  }

  .custom-dropdown-btn {
    padding: 2px 0;
    font-size: 0.82rem;
    width: 100%;
    min-width: 0;
  }

  .custom-dropdown-text {
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .filter-pill-select .custom-dropdown {
    position: static;
  }

  .custom-dropdown-menu {
    left: -2px !important;
    right: -2px !important;
    width: calc(100% + 4px) !important;
    min-width: calc(100% + 4px) !important;
    max-width: calc(100% + 4px) !important;
  }

  .filter-pill-select .pill-label {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-right: 2px;
    min-width: auto;
    color: var(--text-muted);
    flex-shrink: 0;
  }

  .modern-select {
    font-size: 0.86rem;
    padding: 6px 26px 6px 4px;
    width: 100%;
  }

  .range-selector {
    justify-content: center;
    padding: 8px 14px;
    border-radius: var(--radius-pill);
    width: 100%;
  }

  .range-input {
    width: 75px;
    font-size: 0.85rem;
    padding: 6px 8px;
  }

  .active-badge {
    text-align: center;
    margin: 6px 0 0 0;
    font-size: 0.84rem;
  }

  /* 3. Cards Grid (2 Cột cân đối cực đẹp trên điện thoại) */
  .pokemon-cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 20px;
  }

  .pokemon-clean-card {
    padding: 10px 8px;
    border-radius: var(--radius-sm);
  }

  .card-pokemon-img-box {
    margin-bottom: 8px;
    border-radius: 8px;
  }

  .card-poke-id {
    font-size: 0.65rem;
  }

  .card-poke-name {
    font-size: 0.88rem;
    margin-bottom: 4px;
  }

  .type-pill {
    font-size: 0.58rem;
    padding: 2px 7px;
  }

  .card-market-sub {
    font-size: clamp(0.66rem, 2.8vw, 0.75rem);
    padding-top: 6px;
    gap: 4px;
  }

  /* 4. Modal Dialogs */
  .clean-modal-overlay {
    padding: 10px;
  }

  .clean-modal-card {
    padding: 20px 14px;
    max-height: 90vh;
    border-radius: var(--radius-md);
  }

  .modal-close-x {
    top: 18px;
    right: 14px;
    width: 34px;
    height: 34px;
  }

  .detail-modal-layout {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .detail-modal-art img {
    max-width: 190px;
  }

  .detail-modal-info h2 {
    font-size: 1.3rem !important;
  }

  .market-stats-pills {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }

  .m-stat-pill {
    padding: 6px 8px;
  }

  .m-stat-pill .val {
    font-size: 0.88rem;
  }

  .chart-box-clean {
    height: 140px;
    padding: 8px;
  }

  /* 5. Packs Tab & Leaderboard Mobile */
  .packs-modern-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .pack-clean-card {
    padding: 16px 14px;
  }

  .pack-gold {
    font-size: 1.15rem;
  }

  .leaderboard-dual-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .clean-white-panel {
    padding: 16px 14px;
  }

  .clean-lb-row {
    font-size: 0.8rem;
    padding: 8px 10px;
  }
}


/* ================= FLOATING SCROLL TO TOP BUTTON (GÓC DƯỚI BÊN PHẢI) ================= */
.floating-scroll-top-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  padding: 0;
  line-height: 0;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.16);
  font-size: 1.3rem;
  font-weight: 800;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px) scale(0.9);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.floating-scroll-top-btn svg {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

.floating-scroll-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.floating-scroll-top-btn:hover {
  background: var(--primary-red);
  border-color: var(--primary-red);
  color: #ffffff;
  transform: translateY(-4px) scale(1.08);
  box-shadow: 0 14px 28px rgba(239, 68, 68, 0.35);
}

body.dark-mode .floating-scroll-top-btn {
  background: #121216;
  border-color: #2e2e36;
  color: #f4f4f6;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.85);
}

body.dark-mode .floating-scroll-top-btn:hover {
  background: #e4e4e7;
  border-color: #ffffff;
  color: #09090b;
  box-shadow: 0 14px 28px rgba(255, 255, 255, 0.16);
}

body.dark-mode .clean-page-btn:hover:not(:disabled),
body.dark-mode .pokemon-clean-card:hover,
body.dark-mode .pack-clean-card:hover {
  border-color: #d4d4d8;
}

body.dark-mode .lang-option-card:hover,
body.dark-mode .theme-choice-card:hover {
  border-color: rgba(255, 255, 255, 0.45);
}

body.dark-mode .lang-option-card.active,
body.dark-mode .theme-choice-card.active {
  border-color: #e4e4e7;
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .lang-check-badge {
  color: #ffffff;
}

/* ================= SETTINGS TAB STYLES ================= */
.settings-container {
  max-width: 840px;
  margin: 0 auto;
}

.settings-card {
  padding: 30px 34px;
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.settings-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 18px;
}

.settings-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.settings-sub {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin: 0;
}

.status-badge-online {
  font-size: 0.8rem;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.setting-group-box {
  background: var(--bg-card-soft);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.2s ease;
}

.setting-group-box:hover {
  border-color: var(--border-hover);
}

.setting-group-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-label {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary);
}

.setting-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Language selector cards */
.lang-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.lang-option-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 2px solid var(--border-light);
  border-radius: 14px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.lang-option-card:hover {
  border-color: rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

.lang-option-card.active {
  border-color: var(--primary-red);
  background: rgba(239, 68, 68, 0.06);
}

body.dark-mode .lang-option-card.active {
  background: rgba(239, 68, 68, 0.14);
}

.lang-flag {
  font-size: 1.8rem;
  line-height: 1;
}

.lang-text-group {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.lang-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.lang-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.lang-check-badge {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--primary-red);
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.2s ease;
}

.lang-option-card.active .lang-check-badge {
  opacity: 1;
  transform: scale(1);
}

/* Theme choices grid */
.theme-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.theme-choice-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 2px solid var(--border-light);
  border-radius: 14px;
  padding: 14px 18px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.theme-choice-card:hover {
  border-color: rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

.theme-choice-card.active {
  border-color: var(--primary-red);
  background: rgba(239, 68, 68, 0.06);
}

body.dark-mode .theme-choice-card.active {
  background: rgba(239, 68, 68, 0.14);
}

.theme-choice-icon {
  font-size: 1.6rem;
}

.theme-choice-text {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.theme-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
}

.theme-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.theme-radio-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.theme-choice-card.active .theme-radio-circle {
  border-color: var(--primary-red);
  background: var(--primary-red);
  box-shadow: inset 0 0 0 3px var(--bg-card);
}

.badge-fx-preview-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1.5px dashed var(--border-light);
}

.badge-fx-preview-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
}

.badge-fx-preview-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 18px;
}

/* Setting input row */
.setting-input-row {
  display: flex;
  gap: 10px;
}

.setting-text-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 11px 18px;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.setting-text-input:focus {
  border-color: var(--primary-red);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.btn-save-setting {
  background: var(--primary-red);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 11px 24px;
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-save-setting:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.setting-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-action-outline {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-action-outline:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--primary-red);
}

.setting-status-pill {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
}

/* Setting system info footer */
.setting-system-info {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
  font-size: 0.82rem;
}

.system-info-item {
  display: flex;
  gap: 6px;
}

.sys-lbl {
  color: var(--text-muted);
}

.sys-val {
  color: var(--text-primary);
}

/* Toast message for settings */
.settings-toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: #f8fafc;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.settings-toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

body.dark-mode .settings-toast {
  background: #0b0b0e;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

/* Modal Styling for Terms & Privacy */
.legal-modal-card {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  max-width: 780px;
  max-height: 82vh;
  overflow-y: auto;
  border-radius: var(--radius-lg);
  padding: 34px 32px;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

body.dark-mode .legal-modal-card {
  background: #0b0b0e;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
}

.legal-article h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.legal-date {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  display: block;
}

.legal-article p {
  font-size: 0.92rem;
  line-height: 1.68;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.legal-article h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-red);
  margin: 22px 0 10px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 6px;
}

body.dark-mode .legal-article h3 {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-article ul {
  padding-left: 20px;
  margin-bottom: 16px;
}

.legal-article li {
  font-size: 0.88rem;
  line-height: 1.62;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.legal-alert-box {
  background: rgba(239, 68, 68, 0.08);
  border-left: 4px solid #ef4444;
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  margin: 16px 0;
  font-size: 0.86rem;
  color: #ef4444;
  line-height: 1.55;
  font-weight: 500;
}

body.dark-mode .legal-alert-box {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
}

.legal-tip-box {
  background: rgba(245, 158, 11, 0.08);
  border-left: 4px solid #f59e0b;
  padding: 12px 16px;
  border-radius: var(--radius-xs);
  margin: 16px 0;
  font-size: 0.86rem;
  color: #d97706;
  line-height: 1.55;
  font-weight: 500;
}

body.dark-mode .legal-tip-box {
  background: rgba(245, 158, 11, 0.15);
  color: #fde047;
}

@media (max-width: 768px) {
  .legal-modal-card {
    padding: 24px 18px;
  }
  .floating-scroll-top-btn {
    display: none !important;
  }
  .settings-toast {
    bottom: calc(82px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
    padding: 10px 18px;
    font-size: 0.82rem;
    text-align: center;
  }
  .settings-card {
    padding: 20px 16px;
  }
  .setting-group-box {
    padding: 16px;
  }
  .setting-input-row {
    flex-direction: column;
  }
  .btn-save-setting {
    width: 100%;
  }
}

/* ================= LIVE OPENING FEED STYLES ================= */
/* ================= 1. HEADER BANNER ================= */
.live-feed-header-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, #fff5f5 100%);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px -5px rgba(239, 68, 68, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(12px);
  gap: 20px;
  flex-wrap: wrap;
  transition: all 0.25s ease;
}

body.dark-mode .live-feed-header-banner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.14) 0%, rgba(12, 12, 15, 0.98) 100%);
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.85);
}

.live-stream-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 30px;
  padding: 4px 14px;
  margin-bottom: 8px;
}

body.dark-mode .live-stream-status {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.live-dot-pulse {
  width: 9px;
  height: 9px;
  background: #ef4444;
  border-radius: 50%;
  box-shadow: 0 0 10px #ef4444;
  animation: liveBlink 1s infinite alternate;
}

@keyframes liveBlink {
  from {
    opacity: 0.5;
  }

  to {
    opacity: 1;
    transform: scale(1.15);
  }
}

.live-badge-title {
  font-size: 0.82rem;
  font-weight: 800;
  color: #dc2626;
  letter-spacing: 0.8px;
}

body.dark-mode .live-badge-title {
  color: #f87171;
}

.live-badge-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.live-feed-main-title {
  margin: 4px 0 6px 0;
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.live-feed-desc {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-secondary);
  max-width: 650px;
  line-height: 1.5;
}

.live-feed-stats-pill {
  display: flex;
  gap: 16px;
}

.live-stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  text-align: center;
  min-width: 140px;
  box-shadow: var(--shadow-subtle);
  transition: all 0.25s ease;
}

body.dark-mode .live-stat-box {
  background: var(--bg-card-soft);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.live-stat-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 600;
}

.live-stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
}

.live-stat-val.text-gold {
  color: #b45309;
}

body.dark-mode .live-stat-val.text-gold {
  color: #fbbf24;
}

/* ================= 2. LIVE HIT ROWS LIST ================= */
.live-feed-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.live-feed-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
}

.empty-feed-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(239, 68, 68, 0.15);
  border-top-color: #ef4444;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 14px auto;
}

.live-hit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px 22px;
  gap: 20px;
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background-color 0.22s ease;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.live-hit-row:hover {
  transform: translateY(-2px);
  background: var(--bg-card-soft);
  border-color: #f59e0b;
  box-shadow: 0 12px 28px -6px rgba(245, 158, 11, 0.16), 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.dark-mode .live-hit-row {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .live-hit-row:hover {
  background: var(--bg-card-soft);
  border-color: rgba(245, 158, 11, 0.6);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 158, 11, 0.2);
}

.live-hit-row.slide-in-new {
  animation: liveRowSlideDown 0.45s ease-out;
}

@keyframes liveRowSlideDown {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.97);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Thumbnail */
.live-card-thumb-wrap {
  position: relative;
  width: 68px;
  height: 94px;
  flex-shrink: 0;
  border-radius: var(--radius-xs);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border-light);
}

body.dark-mode .live-card-thumb-wrap {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.live-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.live-hit-row:hover .live-card-thumb {
  transform: scale(1.08);
}

/* Main card info */
.live-hit-main {
  flex: 1;
  min-width: 0;
}

.live-user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.live-user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-light);
}

body.dark-mode .live-user-avatar {
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.live-user-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.live-time-ago {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 4px;
}

.live-card-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.live-card-id {
  font-size: 0.8rem;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: 6px;
}

body.dark-mode .live-card-id {
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.live-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.live-pack-tag {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pack-badge-pill {
  font-size: 0.75rem;
  font-weight: 600;
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.22);
  padding: 3px 10px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pack-badge-pill img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}

body.dark-mode .pack-badge-pill {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.live-click-hint {
  font-size: 0.75rem;
  color: #d97706;
  opacity: 0.95;
  font-style: italic;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s ease, text-decoration 0.15s ease;
}

.live-click-hint:hover {
  opacity: 1;
  text-decoration: underline;
}

body.dark-mode .live-click-hint {
  color: #fbbf24;
}

/* Pricing column on the right */
.live-hit-pricing {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 170px;
  text-align: right;
  flex-shrink: 0;
}

.live-price-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.price-type-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
}

.price-val-card {
  font-size: 1.15rem;
  font-weight: 800;
  color: #b45309;
}

body.dark-mode .price-val-card {
  color: #fbbf24;
}

.price-val-card,
.price-val-total {
  font-size: 0.98rem;
  font-weight: 800;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 4px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.price-val-card img.anime-emoji,
.price-val-total img.anime-emoji {
  flex-shrink: 0 !important;
  display: inline-block !important;
  vertical-align: middle !important;
}

.price-val-total {
  color: #047857;
}

body.dark-mode .price-val-total {
  color: #34d399;
}

/* ================= 3. POPUP MODAL FOR HIT DETAIL ================= */
#liveHitDetailModal .clean-modal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  color: var(--text-primary);
}

body.dark-mode #liveHitDetailModal .clean-modal-card {
  background: #0b0b0e;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.92);
}

.live-modal-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.live-modal-header {
  display: flex;
  gap: 24px;
  align-items: center;
}

.live-modal-card-art {
  width: 140px;
  height: 195px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}

body.dark-mode .live-modal-card-art {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.live-modal-meta {
  flex: 1;
}

.live-modal-title {
  margin: 0 0 6px 0;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.live-modal-user-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.live-modal-user-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.live-modal-stats-card {
  background: var(--bg-card-soft);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

body.dark-mode .live-modal-stats-card {
  background: rgba(8, 8, 10, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.live-modal-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap !important;
  min-height: 28px;
}

.live-modal-stat-label {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 600;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-modal-stat-highlight {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  flex-shrink: 0 !important;
}

.live-modal-actions {
  display: flex;
  gap: 12px;
}

.live-modal-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px;
  white-space: nowrap !important;
}

.live-modal-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
}

.live-modal-btn-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
}

.live-modal-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

.live-modal-btn-secondary {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

.live-modal-btn-secondary:hover {
  background: #e2e8f0;
}

body.dark-mode .live-modal-btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
}

body.dark-mode .live-modal-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* ================= 4. LIVE FEED PAGINATION ================= */
.live-pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
  padding: 16px 0;
  flex-wrap: wrap;
}

.live-page-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-subtle);
}

.live-page-btn:hover:not(:disabled) {
  background: var(--bg-card-soft);
  border-color: #f59e0b;
  transform: translateY(-1px);
}

.live-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.live-page-numbers {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.live-page-num {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-subtle);
}

.live-page-num:hover:not(.active) {
  background: var(--bg-card-soft);
  border-color: #f59e0b;
}

.live-page-num.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  border-color: #f59e0b;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.live-page-ellipsis {
  padding: 0 4px;
  color: var(--text-muted);
  font-weight: 700;
}

@media (max-width: 768px) {
  .live-feed-header-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 20px;
  }

  .live-feed-stats-pill {
    width: 100%;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin-top: 14px;
  }

  .live-stat-box {
    flex: 1;
    min-width: 0;
    padding: 10px 8px !important;
    text-align: center;
    box-sizing: border-box;
  }

  .live-stat-label {
    font-size: 0.74rem !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
  }

  .live-stat-val {
    font-size: clamp(0.88rem, 3.8vw, 1.22rem) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .live-stat-val img.anime-emoji {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
  }

  .live-hit-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
  }

  .live-hit-pricing {
    width: 100%;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-light);
    padding-top: 10px;
  }

  body.dark-mode .live-hit-pricing {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .live-price-item {
    align-items: flex-start;
  }

  .live-modal-header {
    flex-direction: column;
    text-align: center;
  }

  .live-modal-card-art {
    margin: 0 auto;
  }

  .live-modal-actions {
    flex-direction: column !important;
    gap: 10px !important;
    width: 100% !important;
  }

  .live-modal-btn {
    width: 100% !important;
    padding: 12px 16px !important;
    font-size: 0.88rem !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .live-modal-stat-label {
    font-size: 0.82rem !important;
  }

  .price-val-card,
  .price-val-total,
  .live-modal-stat-highlight {
    font-size: 0.88rem !important;
  }
}

/* ================= TAB DONATE (QUYÊN GÓP) ================= */
.donate-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.donate-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.donate-card-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 20px;
}

.donate-badge-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.donate-status-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.8);
  animation: pulse 1.8s infinite ease-in-out;
}

.donate-dev-pill {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #b45309;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
}

body.dark-mode .donate-dev-pill {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.45);
}

.donate-title {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.3px;
}

.donate-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.donate-body-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.donate-hero-banner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(245, 158, 11, 0.08) 100%);
  border: 1px solid rgba(239, 68, 68, 0.18);
}

body.dark-mode .donate-hero-banner {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.16) 0%, rgba(245, 158, 11, 0.14) 100%);
  border-color: rgba(239, 68, 68, 0.28);
}

.donate-gift-icon-bounce {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border-radius: 20px;
  box-shadow: 0 10px 25px rgba(239, 68, 68, 0.15);
}

.donate-big-gif {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.donate-hero-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.donate-dev-heading {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.donate-dev-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.donate-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.donate-feature-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: var(--bg-card-soft);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.donate-feature-box:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.donate-feature-box .df-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.donate-feature-box h4 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
}

.donate-feature-box p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.donate-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-card-soft);
  border: 1px dashed var(--border-light);
  flex-wrap: wrap;
}

.donate-cta-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.donate-cta-text strong {
  font-size: 0.98rem;
  color: var(--text-primary);
}

.donate-cta-text span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.btn-discord-join {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  background: #5865F2;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.22s ease;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.35);
}

.btn-discord-join:hover {
  background: #4752c4;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.45);
}
