/**
 * CASER homepage — premium surface layer (Vercel / infra aesthetic).
 * Loaded after Tailwind; only visual overrides. Does not alter copy.
 */

body.premium-site {
  --surface-0: #0a0b0d;
  --surface-1: #121318;
  --surface-2: #181a20;
  --line-hair: rgba(255, 255, 255, 0.045);
  --line-soft: rgba(255, 255, 255, 0.08);
  --glow-gold: rgba(240, 180, 0, 0.12);
  --shadow-nav: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 8px 40px -12px rgba(0, 0, 0, 0.55);
  --shadow-elevated: 0 0 0 1px var(--line-hair), 0 2px 4px rgba(0, 0, 0, 0.25), 0 24px 48px -24px rgba(0, 0, 0, 0.65);
  letter-spacing: -0.012em;
  background-color: var(--surface-0) !important;
  background-image:
    radial-gradient(ellipse 100% 70% at 50% -30%, var(--glow-gold), transparent 55%),
    radial-gradient(ellipse 55% 45% at 100% 20%, rgba(99, 102, 241, 0.04), transparent 50%),
    radial-gradient(ellipse 50% 40% at 0% 75%, rgba(240, 180, 0, 0.05), transparent 48%),
    linear-gradient(180deg, var(--surface-0) 0%, var(--surface-1) 42%, var(--surface-0) 100%) !important;
}

/* Ultra-subtle grid + grain (non-interactive) */
body.premium-site::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 85% 70% at 50% 40%, black 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 85% 70% at 50% 40%, black 20%, transparent 75%);
}

body.premium-site::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

body.premium-site > header,
body.premium-site > main,
body.premium-site > footer {
  position: relative;
  z-index: 1;
}

/* Nav — glass rail */
body.premium-site header nav.fixed {
  background: rgba(10, 11, 13, 0.72) !important;
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
  border-bottom-color: var(--line-hair) !important;
  box-shadow: var(--shadow-nav);
}

body.premium-site header nav .text-zinc-400 {
  letter-spacing: 0.01em;
}

body.premium-site header nav a.text-zinc-400:hover {
  color: rgba(255, 255, 255, 0.92) !important;
}

/* Brand lockup */
body.premium-site header nav .group img {
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line-soft), 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* Primary CTA — precision chrome */
body.premium-site a[href*="init-openId.php"] {
  border-radius: 10px !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.2),
    0 12px 36px -10px rgba(240, 180, 0, 0.45) !important;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background-color 0.15s ease !important;
}

body.premium-site a[href*="init-openId.php"]:hover {
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.16),
    0 4px 8px rgba(0, 0, 0, 0.25),
    0 18px 44px -8px rgba(240, 180, 0, 0.5) !important;
}

body.premium-site a[href*="init-openId.php"]:active {
  transform: translateY(0);
}

/* Secondary / outline CTAs in hero */
body.premium-site main a.border.border-white\/10 {
  border-color: var(--line-soft) !important;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  border-radius: 10px !important;
}

body.premium-site main a.border.border-white\/10:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(240, 180, 0, 0.28) !important;
}

/* Pills & badges */
body.premium-site .rounded-full.border.border-\[\#F0B400\]\/30 {
  box-shadow: 0 0 0 1px rgba(240, 180, 0, 0.08) inset, 0 4px 20px -6px rgba(240, 180, 0, 0.2);
}

/* Striped section surfaces — infra panels */
body.premium-site #how-it-works,
body.premium-site #why-choose,
body.premium-site #fairness,
body.premium-site #faq,
body.premium-site #topics {
  background: linear-gradient(180deg, rgba(20, 22, 28, 0.97) 0%, rgba(12, 13, 16, 0.99) 100%) !important;
  border-color: var(--line-hair) !important;
}

body.premium-site main section.border-y.border-white\/5 {
  border-color: var(--line-hair) !important;
}

/* Cards — floating panels */
body.premium-site main article.rounded-2xl.border.border-white\/5,
body.premium-site main article.rounded-xl.border.border-white\/5 {
  transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.22s ease;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

body.premium-site main article.rounded-2xl.border.border-white\/5:hover,
body.premium-site main article.rounded-xl.border.border-white\/5:hover {
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: var(--shadow-elevated);
}

body.premium-site main article.rounded-2xl.border.border-white\/5:not(.transform):hover,
body.premium-site main article.rounded-xl.border.border-white\/5:not(.transform):hover {
  transform: translateY(-2px);
}

body.premium-site main .glass-card {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

/* KPI / stat tiles */
body.premium-site main article.glass-card.rounded-2xl {
  border-radius: 14px !important;
}

/* Laptop mock — tighter bezel */
body.premium-site .laptop-screen {
  border-radius: 14px !important;
  box-shadow:
    0 0 0 1px var(--line-soft),
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    0 28px 64px -16px rgba(0, 0, 0, 0.75) !important;
}

body.premium-site .phone-frame {
  border-radius: 2.25rem !important;
  box-shadow:
    0 0 0 1px var(--line-soft),
    0 16px 48px -12px rgba(0, 0, 0, 0.75) !important;
}

/* Headline rhythm */
body.premium-site main h1,
body.premium-site main h2 {
  letter-spacing: -0.03em;
}

body.premium-site main h3 {
  letter-spacing: -0.02em;
}

/* Topic cluster links */
body.premium-site #topics a.block.p-4.rounded-xl {
  border-radius: 12px !important;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

body.premium-site #topics a.block.p-4.rounded-xl:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.04) !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05) inset, 0 12px 32px -16px rgba(0, 0, 0, 0.5);
}

/* FAQ */
body.premium-site #faq .faq-button {
  border-radius: 8px;
  padding: 0.5rem 0.25rem;
  margin: 0 -0.25rem;
  transition: background 0.15s ease;
}

body.premium-site #faq .faq-button:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Footer */
body.premium-site footer[role="contentinfo"] {
  background: linear-gradient(180deg, rgba(10, 11, 13, 0.95) 0%, #08090b 100%) !important;
  border-top-color: var(--line-hair) !important;
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.04);
}

/* ============================================================
   Top drops 24h — premium loot cards
   ============================================================ */
body.premium-site #top-drops-24h {
  position: relative;
  isolation: isolate;
  background: transparent !important;
}

body.premium-site #top-drops-24h::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(240, 180, 0, 0.06), transparent 65%),
    radial-gradient(ellipse 40% 35% at 8% 100%, rgba(99, 102, 241, 0.04), transparent 60%);
}

body.premium-site .drop-card {
  --rarity: #F0B400;
  --rarity-soft: rgba(240, 180, 0, 0.18);
  --rarity-glow: rgba(240, 180, 0, 0.35);
  position: relative;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(28, 30, 38, 0.85) 0%, rgba(14, 15, 19, 0.95) 100%);
  border: 1px solid var(--line-hair);
  border-radius: 16px !important;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.3s ease;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset, 0 1px 2px rgba(0, 0, 0, 0.3), 0 16px 40px -24px rgba(0, 0, 0, 0.6);
}

body.premium-site .drop-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, var(--rarity-soft) 0%, transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
  transition: opacity 0.25s ease;
}

body.premium-site .drop-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 8px 16px -8px rgba(0, 0, 0, 0.4),
    0 32px 64px -28px var(--rarity-glow);
}

body.premium-site .drop-card:hover::before { opacity: 1; }

/* Rarity tints */
body.premium-site .drop-card--covert {
  --rarity: #eb4b4b;
  --rarity-soft: rgba(235, 75, 75, 0.22);
  --rarity-glow: rgba(235, 75, 75, 0.32);
}
body.premium-site .drop-card--classified {
  --rarity: #d32ce6;
  --rarity-soft: rgba(211, 44, 230, 0.22);
  --rarity-glow: rgba(211, 44, 230, 0.32);
}
body.premium-site .drop-card--restricted {
  --rarity: #8847ff;
  --rarity-soft: rgba(136, 71, 255, 0.22);
  --rarity-glow: rgba(136, 71, 255, 0.3);
}

/* Media — image area with rarity halo */
body.premium-site .drop-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 70% 55% at 50% 50%, var(--rarity-soft), transparent 70%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0%, rgba(0, 0, 0, 0.15) 100%);
  border-bottom: 1px solid var(--line-hair);
  overflow: hidden;
}

body.premium-site .drop-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, transparent 35%, transparent 65%, rgba(0, 0, 0, 0.2) 100%);
  pointer-events: none;
}

body.premium-site .drop-card__media img {
  position: relative;
  z-index: 1;
  max-width: 78%;
  max-height: 78%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 18px var(--rarity-glow));
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}

body.premium-site .drop-card:hover .drop-card__media img {
  transform: scale(1.06) rotate(-2deg);
}

/* Fade knife: animated chromatic shimmer ring */
body.premium-site .drop-card--fade .drop-card__media {
  background:
    conic-gradient(from 180deg at 50% 50%, rgba(235, 75, 75, 0.15), rgba(211, 44, 230, 0.18), rgba(136, 71, 255, 0.18), rgba(72, 105, 255, 0.15), rgba(235, 75, 75, 0.15)),
    radial-gradient(ellipse 65% 50% at 50% 50%, rgba(0, 0, 0, 0.45), transparent 70%);
}

/* Rank badge */
body.premium-site .drop-card__rank {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-feature-settings: "tnum";
}

/* Rarity badge */
body.premium-site .drop-card__rarity {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rarity);
  background: color-mix(in srgb, var(--rarity) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--rarity) 35%, transparent);
  padding: 4px 9px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Body */
body.premium-site .drop-card__body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.premium-site .drop-card__name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.premium-site .drop-card__meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  margin: 0;
  letter-spacing: 0.01em;
}

body.premium-site .drop-card__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line-hair);
}

body.premium-site .drop-card__price {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #F0B400;
  font-feature-settings: "tnum";
}

body.premium-site .drop-card__time {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
  font-feature-settings: "tnum";
}

body.premium-site .drop-card__player {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

body.premium-site .drop-card__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, color-mix(in srgb, var(--rarity) 50%, transparent), rgba(0, 0, 0, 0.4));
  color: rgba(255, 255, 255, 0.92);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.premium-site .drop-card__nick {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

@media (prefers-reduced-motion: reduce) {
  body.premium-site .drop-card:hover { transform: none; }
  body.premium-site .drop-card:hover .drop-card__media img { transform: none; }
}

/* Focus rings — accessibility + polish */
body.premium-site a:focus-visible,
body.premium-site button:focus-visible {
  outline: 2px solid rgba(240, 180, 0, 0.55);
  outline-offset: 3px;
}

/* ============================================================
   Premium motion layer
   - Activated only when <html> has .caser-anim (JS is loaded).
   - All effects honor prefers-reduced-motion via .caser-reduce-motion.
   - Default cubic-bezier(.2,.7,.2,1) — Apple/Vercel-grade easing.
   ============================================================ */

/* 1. Page-enter — soft single fade-in, no movement */
html.caser-anim body {
  opacity: 0;
  transition: opacity 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
html.caser-anim.caser-loaded body {
  opacity: 1;
}

/* 2. Scroll reveal — single element */
html.caser-anim [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 14px, 0);
  transition:
    opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
html.caser-anim [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* 2b. Scroll reveal — staggered children */
html.caser-anim [data-reveal-stagger] > * {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition:
    opacity 0.65s cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 0.65s cubic-bezier(0.2, 0.7, 0.2, 1);
  will-change: opacity, transform;
}
html.caser-anim [data-reveal-stagger].is-revealed > * {
  opacity: 1;
  transform: none;
}
html.caser-anim [data-reveal-stagger].is-revealed > *:nth-child(1) { transition-delay: 0ms; }
html.caser-anim [data-reveal-stagger].is-revealed > *:nth-child(2) { transition-delay: 80ms; }
html.caser-anim [data-reveal-stagger].is-revealed > *:nth-child(3) { transition-delay: 160ms; }
html.caser-anim [data-reveal-stagger].is-revealed > *:nth-child(4) { transition-delay: 240ms; }
html.caser-anim [data-reveal-stagger].is-revealed > *:nth-child(5) { transition-delay: 320ms; }
html.caser-anim [data-reveal-stagger].is-revealed > *:nth-child(6) { transition-delay: 400ms; }

/* 3. Pointer spotlight — cursor-aware soft glow on premium cards */
body.premium-site [data-spotlight] {
  position: relative;
  isolation: isolate;
}
body.premium-site [data-spotlight]::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    320px circle at var(--mx, 50%) var(--my, 50%),
    rgba(240, 180, 0, 0.14),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
  mix-blend-mode: plus-lighter;
}
body.premium-site [data-spotlight]:hover::before {
  opacity: 1;
}
/* Make the card's actual content sit above the spotlight glow */
body.premium-site [data-spotlight] > * {
  position: relative;
  z-index: 1;
}

/* 4. Hero word shimmer — single chromatic sweep, ~2.4s, then static */
.caser-shimmer {
  position: relative;
  display: inline-block;
  background: linear-gradient(
    100deg,
    #F0B400 0%,
    #F0B400 38%,
    #FFE490 50%,
    #F0B400 62%,
    #F0B400 100%
  );
  background-size: 250% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.caser-shimmer--play {
  animation: caserShimmer 2.4s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s 1 forwards;
}
@keyframes caserShimmer {
  0%   { background-position: 130% 0; }
  100% { background-position: -30% 0; }
}

/* 5. Live-drop pulse — already exists in inline <style>; gently tighten */
body.premium-site .pulse-dot {
  box-shadow: 0 0 0 0 rgba(240, 180, 0, 0.45);
  animation: caserPulse 2.4s cubic-bezier(0.2, 0.7, 0.2, 1) infinite;
}
@keyframes caserPulse {
  0%   { box-shadow: 0 0 0 0 rgba(240, 180, 0, 0.5); }
  70%  { box-shadow: 0 0 0 10px rgba(240, 180, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(240, 180, 0, 0); }
}

/* 6. Reduced-motion override — kill anything that animates */
html.caser-anim.caser-reduce-motion body { opacity: 1 !important; }
html.caser-anim.caser-reduce-motion [data-reveal],
html.caser-anim.caser-reduce-motion [data-reveal-stagger] > * {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}
html.caser-anim.caser-reduce-motion .caser-shimmer {
  background: none;
  color: #F0B400;
  -webkit-text-fill-color: #F0B400;
  animation: none !important;
}
html.caser-anim.caser-reduce-motion .pulse-dot {
  animation: none !important;
  box-shadow: none !important;
}
@media (prefers-reduced-motion: reduce) {
  html.caser-anim body { opacity: 1 !important; }
  html.caser-anim [data-reveal],
  html.caser-anim [data-reveal-stagger] > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .caser-shimmer { animation: none !important; }
  body.premium-site .pulse-dot { animation: none !important; box-shadow: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  body.premium-site main article.rounded-2xl.border.border-white\/5:not(.transform):hover,
  body.premium-site main article.rounded-xl.border.border-white\/5:not(.transform):hover,
  body.premium-site #topics a.block.p-4.rounded-xl:hover,
  body.premium-site a[href*="init-openId.php"]:hover {
    transform: none;
  }
}
