/* ============================================================
   JUEGOS / CASINO — minimalist Apple-glass hub.
   Just a search bar + Netflix-style portrait cover cards with
   live player counts. Covers are admin-chosen (falls back to a
   branded placeholder with the game's colorful icon).
   ============================================================ */
:root {
  --jg-glass: rgba(255, 255, 255, 0.045);
  --jg-glass-hi: rgba(255, 255, 255, 0.08);
  --jg-line: rgba(255, 255, 255, 0.09);
  --jg-ink: #f5f5f7;
  --jg-dim: #a6a6b0;
  --jg-faint: #6f6f7a;
}
:root[data-theme="light"] {
  --jg-glass: rgba(255, 255, 255, 0.66);
  --jg-glass-hi: rgba(255, 255, 255, 0.92);
  --jg-line: rgba(0, 0, 0, 0.08);
  --jg-ink: #1d1d1f;
  --jg-dim: #565660;
  --jg-faint: #86868b;
}

/* Calm ambient canvas (replaces the shared animated blobs) */
.tienda-content:has(.jg-content)::before,
.tienda-content:has(.jg-content)::after { display: none; }
.tienda-content:has(.jg-content) {
  background:
    radial-gradient(1100px 620px at 80% -10%, rgba(124, 58, 237, 0.10), transparent 62%),
    radial-gradient(900px 540px at 4% 0%, rgba(6, 182, 212, 0.05), transparent 55%),
    #050507;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', 'Segoe UI', sans-serif;
}
:root[data-theme="light"] .tienda-content:has(.jg-content) {
  background:
    radial-gradient(1100px 620px at 80% -10%, rgba(124, 58, 237, 0.06), transparent 62%),
    radial-gradient(900px 540px at 4% 0%, rgba(6, 182, 212, 0.05), transparent 55%),
    #eae8e2;
}

.jg-content { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 24px 22px 96px; }

/* ── Search ── */
.jg-search { position: relative; margin: 0 0 24px; }
.jg-search svg {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  width: 19px; height: 19px; color: var(--jg-faint); pointer-events: none;
}
.jg-search input {
  width: 100%; height: 54px; padding: 0 18px 0 50px;
  border-radius: 15px; border: 1px solid var(--jg-line);
  background: var(--jg-glass);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  color: var(--jg-ink); font-family: inherit; font-size: 0.98rem; font-weight: 500;
  outline: none; transition: border-color .15s ease, background .15s ease;
}
.jg-search input::placeholder { color: var(--jg-faint); }
.jg-search input:focus { border-color: rgba(255, 255, 255, 0.24); background: var(--jg-glass-hi); }
:root[data-theme="light"] .jg-search input:focus { border-color: rgba(0, 0, 0, 0.22); }
.jg-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* ── Cover-art grid ── */
.jg-section { margin-bottom: 8px; }
.jg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
.jg-empty { color: var(--jg-faint); font-size: 0.92rem; padding: 40px 4px; text-align: center; }

.jg-card { --c: #7c3aed; display: block; text-decoration: none; color: var(--jg-ink); }
.jg-cover {
  position: relative; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 55%, #101018), #0b0c12 80%);
  border: 1px solid var(--jg-line);
  transition: transform .22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .2s ease, border-color .2s ease;
}
.jg-card:hover .jg-cover {
  transform: translateY(-6px);
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
  box-shadow: 0 22px 44px -18px rgba(0, 0, 0, 0.8), 0 12px 40px -14px color-mix(in srgb, var(--c) 42%, transparent);
}
.jg-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Branded placeholder (no admin cover yet) — colorful minimalist icon */
.jg-ph { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 14px; text-align: center; }
.jg-ph::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--c) 30%, transparent), transparent 60%);
}
.jg-ph-ic {
  position: relative; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--c) 22%, #0d0e15);
  box-shadow: 0 0 24px color-mix(in srgb, var(--c) 34%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.jg-ph-ic .uvs-gic { width: 40px; height: 40px; display: block; }
.jg-ph-nm { position: relative; font-weight: 700; font-size: 0.95rem; line-height: 1.15; letter-spacing: -0.01em; color: #fff; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
.jg-ph-pv { position: relative; font-size: 0.64rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.09em; color: rgba(255, 255, 255, 0.55); }

/* Studio badge (top-left) */
.jg-badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(6, 6, 12, 0.66); border: 1px solid rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.jg-badge img { width: 15px; height: 15px; border-radius: 4px; display: block; }

/* Name overlay on real covers */
.jg-cover.has-img .jg-name-ov {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: 24px 11px 10px; font-weight: 650; font-size: 0.84rem; letter-spacing: -0.01em; color: #fff;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), transparent);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

/* Live count under the card */
.jg-live { display: flex; align-items: center; gap: 6px; margin: 10px 2px 0; font-size: 0.76rem; font-weight: 600; color: var(--jg-faint); }
.jg-live .dot { width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--jg-faint) 60%, transparent); flex: 0 0 auto; }
.jg-live.is-live { color: #6ee7b7; }
:root[data-theme="light"] .jg-live.is-live { color: #059669; }
.jg-live.is-live .dot { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.7); }

/* ── Responsive ── */
@media (max-width: 560px) {
  .jg-content { padding: 16px 14px 84px; }
  .jg-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 13px; }
  .jg-ph-ic { width: 52px; height: 52px; border-radius: 15px; }
  .jg-ph-ic .uvs-gic { width: 32px; height: 32px; }
  .jg-search input { height: 48px; }
}
