/* ============================================================
   SISTEMA VISUAL BLOXYFRUTAS (V3.14)
   Tokens y componentes compartidos por home, /tienda/ y /mercado/.
   Derivado de la calculadora V3.13 (assets/css/calculadora.css):
   mismos colores, radios, sombras y estados.
   Todo va bajo .ds (el contenedor raíz de cada página) para ganar a
   los estilos genéricos de Astra sin !important.
   ============================================================ */

:root {
  --ds-bg:      #0a0a0f;
  --ds-card:    #111118;
  --ds-card2:   #171722;
  --ds-card3:   #1e1e2c;
  --ds-line:    rgba(255,255,255,0.07);
  --ds-line2:   rgba(255,255,255,0.12);
  --ds-text:    #f0f0f5;
  --ds-muted:   #9090ad;
  --ds-gold:    #F5C518;
  --ds-gold-2:  #ffd84d;
  --ds-blue:    #5b9cff;
  --ds-win:     #22c55e;
  --ds-lose:    #ef4444;
  --ds-perm:    #a78bfa;
  --ds-radius:  16px;
  --ds-shadow:  0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 32px rgba(0,0,0,0.45);
  --ds-ease:    cubic-bezier(0.2, 0.8, 0.2, 1);

  --rar-comun:      #8a8a8a;
  --rar-poco-comun: #22d3a0;
  --rar-raro:       #378ADD;
  --rar-legendario: #7c6dfa;
  --rar-mitico:     #FF6B35;
  --rar-limitado:   #F5C518;
  --rar-gamepass:   #D4537E;
}

/* ── Base de página ───────────────────────────────────────── */
.ds {
  --ds-accent: var(--ds-gold);
  color: var(--ds-text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.ds *, .ds *::before, .ds *::after { box-sizing: border-box; }
.ds :where(button) { font: inherit; }
.ds-page {
  background-color: var(--ds-bg);
  background-image:
    radial-gradient(ellipse 80% 420px at 50% -60px, rgba(245,197,24,0.10), transparent 70%),
    radial-gradient(rgba(245,197,24,0.035) 1px, transparent 1px);
  background-size: 100% 100%, 28px 28px;
  background-repeat: no-repeat, repeat;
}
.ds .ds-shell {
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 12px;
  padding-right: 12px;
}

/* ── Hero ─────────────────────────────────────────────────── */
.ds .ds-hero {
  max-width: 680px;
  margin: 0 auto;
  padding: 1.5rem 12px 1.25rem;
  text-align: center;
}
.ds .ds-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid rgba(245,197,24,0.25);
  border-radius: 999px;
  background: rgba(245,197,24,0.07);
  color: #e9d38a;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}
.ds .ds-badge b { color: var(--ds-gold); font-weight: 800; }
.ds .ds-pulse {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ds-win);
  animation: ds-pulse 2.4s infinite;
}
@keyframes ds-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}
.ds .ds-title {
  margin: 0.75rem 0 0.4rem;
  font-size: clamp(1.75rem, 7vw, 2.75rem);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--ds-text);
}
.ds .ds-title span,
.ds .ds-h2 span {
  background: linear-gradient(180deg, var(--ds-gold-2), var(--ds-gold) 60%, #d9a90c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ds .ds-sub {
  margin: 0;
  color: var(--ds-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ── Cabecera de sección ──────────────────────────────────── */
.ds .ds-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.ds .ds-h2 {
  margin: 0;
  font-size: clamp(1.3rem, 5vw, 1.75rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ds-text);
}
.ds .ds-head__sub {
  margin: 4px 0 0;
  color: var(--ds-muted);
  font-size: 14px;
  line-height: 1.45;
}
.ds .ds-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 44px;
  color: var(--ds-gold);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.ds .ds-link:hover,
.ds .ds-link:focus-visible { color: var(--ds-gold-2); text-decoration: underline; }

/* ── Tarjeta ──────────────────────────────────────────────── */
.ds .ds-card {
  position: relative;
  border: 1px solid var(--ds-line);
  border-radius: var(--ds-radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--ds-accent) 7%, transparent), transparent 120px),
    var(--ds-card);
  box-shadow: var(--ds-shadow);
}
.ds .ds-card--topline::before {
  content: "";
  position: absolute;
  inset: 0 16px auto;
  height: 2px;
  border-radius: 0 0 2px 2px;
  background: linear-gradient(90deg, transparent, var(--ds-accent), transparent);
  opacity: 0.8;
}

/* ── Botones ──────────────────────────────────────────────── */
.ds .ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  margin: 0;
  padding: 0 20px;
  border: 1px solid var(--ds-line2);
  border-radius: 12px;
  background: var(--ds-card2);
  color: var(--ds-text);
  box-shadow: none;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.12s;
}
.ds .ds-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.ds .ds-btn:hover,
.ds .ds-btn:focus-visible { background: var(--ds-card3); border-color: rgba(255,255,255,0.2); color: var(--ds-text); }
.ds .ds-btn:focus { outline: none; }
.ds .ds-btn:focus-visible { outline: 2px solid var(--ds-gold); outline-offset: 2px; }
.ds .ds-btn:active { transform: scale(0.98); }
.ds .ds-btn--primary {
  border-color: transparent;
  background: linear-gradient(180deg, var(--ds-gold-2), var(--ds-gold));
  color: #17140a;
  box-shadow: 0 6px 20px rgba(245,197,24,0.22), inset 0 1px 0 rgba(255,255,255,0.35);
}
.ds .ds-btn--primary:hover,
.ds .ds-btn--primary:focus-visible {
  border-color: transparent;
  background: linear-gradient(180deg, #ffe37a, var(--ds-gold-2));
  color: #17140a;
}
.ds .ds-btn--ghost { background: transparent; }

/* ── Chips de filtro ──────────────────────────────────────── */
.ds .ds-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.ds .ds-chips::-webkit-scrollbar { display: none; }
.ds .ds-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  min-height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--ds-line);
  border-radius: 999px;
  background: var(--ds-card2);
  color: var(--ds-muted);
  box-shadow: none;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ds .ds-chip:hover,
.ds .ds-chip:focus-visible { background: var(--ds-card3); color: var(--ds-text); border-color: var(--ds-line2); }
.ds .ds-chip.is-active,
.ds .ds-chip.is-active:hover {
  background: color-mix(in srgb, var(--ds-accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--ds-accent) 55%, transparent);
  color: var(--ds-accent);
}
.ds .ds-chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rar, var(--ds-muted)); }

/* ── Rareza ───────────────────────────────────────────────── */
.ds .ds-rar {
  --rar: var(--rar-comun);
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid color-mix(in srgb, var(--rar) 40%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--rar) 15%, transparent);
  color: var(--rar);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}
.ds .rar-comun,      .ds .ds-rar--comun      { --rar: var(--rar-comun); }
.ds .rar-poco-comun, .ds .ds-rar--poco-comun { --rar: var(--rar-poco-comun); }
.ds .rar-raro,       .ds .ds-rar--raro       { --rar: var(--rar-raro); }
.ds .rar-legendario, .ds .ds-rar--legendario { --rar: var(--rar-legendario); }
.ds .rar-mitico,     .ds .ds-rar--mitico     { --rar: var(--rar-mitico); }
.ds .rar-limitado,   .ds .ds-rar--limitado   { --rar: var(--rar-limitado); }
.ds .rar-gamepass,   .ds .ds-rar--gamepass   { --rar: var(--rar-gamepass); }

/* ── Stats ────────────────────────────────────────────────── */
.ds .ds-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.ds .ds-stat {
  min-width: 0;
  padding: 14px 12px;
  border: 1px solid var(--ds-line);
  border-radius: 14px;
  background: var(--ds-card);
  box-shadow: var(--ds-shadow);
  text-align: center;
}
.ds .ds-stat__num {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ds-gold);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.ds .ds-stat__label {
  display: block;
  margin-top: 4px;
  color: var(--ds-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

/* ── Buscador ─────────────────────────────────────────────── */
.ds .ds-search { position: relative; }
.ds .ds-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--ds-muted);
  pointer-events: none;
}
.ds .ds-search input {
  width: 100%;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0 14px 0 42px;
  border: 1px solid var(--ds-line2);
  border-radius: 12px;
  background: var(--ds-bg);
  color: var(--ds-text);
  box-shadow: none;
  font-size: 16px; /* 16px: iOS no hace zoom al enfocar */
  line-height: 48px;
  -webkit-appearance: none;
  appearance: none;
}
.ds .ds-search input::placeholder { color: #6c6c88; }
.ds .ds-search input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--ds-accent) 70%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-accent) 18%, transparent);
}

/* ── Tendencia y demanda ──────────────────────────────────── */
.ds .ds-trend {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 8px;
  background: var(--ds-card3);
  color: var(--ds-muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.ds .ds-trend--up     { background: rgba(34,197,94,0.13);  color: #4ade80; }
.ds .ds-trend--down   { background: rgba(239,68,68,0.13);  color: #f87171; }
.ds .ds-trend--stable { background: rgba(144,144,173,0.12); color: #b4b4cc; }

.ds .ds-demand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ds .ds-demand__bar {
  position: relative;
  flex: 1 1 auto;
  min-width: 40px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--ds-card3);
}
.ds .ds-demand__bar::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--d, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #ef4444, #F5C518 50%, #22c55e);
  background-size: 200px 100%;
}
.ds .ds-demand__num {
  flex: 0 0 auto;
  color: var(--ds-text);
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.ds .ds-demand__num small { color: var(--ds-muted); font-size: 12px; font-weight: 600; }

/* ── Bloque de anuncio manual (AdSense) ───────────────────── */
.ds .ds-ad {
  margin: 0 auto;
  text-align: center;
}
.ds .ds-ad__label {
  display: block;
  margin-bottom: 6px;
  color: #6c6c88;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ds .ds-ad__slot {
  min-height: 250px;
  overflow: hidden;
  border: 1px solid var(--ds-line);
  border-radius: 14px;
  background: var(--ds-card);
}
/* Si Google no rellena la unidad, fuera el hueco vacío de 250px */
.ds .ds-ad:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }

/* ── Móvil: el contenido no puede ensanchar la página ──────
   Auto Ads a veces desborda un instante al cargar y Chrome Android deja
   la página ampliada. clip (no hidden) no crea contenedor de scroll, así
   que sticky sigue funcionando; los anuncios a ancho completo (0–100vw)
   caben enteros dentro del borde del contenedor. */
@media (max-width: 599px) {
  .ds .ds-shell,
  .ds .td-shell { overflow-x: clip; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (min-width: 600px) {
  .ds .ds-shell { padding-left: 20px; padding-right: 20px; }
  .ds .ds-hero { padding: 2.5rem 20px 1.75rem; }
  .ds .ds-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
  .ds .ds-stat { padding: 18px 14px; }
  .ds .ds-stat__num { font-size: 2rem; }
  .ds .ds-head { margin-bottom: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .ds *, .ds *::before, .ds *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
