/* ═══════════════════════════════════════════════════════════════════════════
   GUI UPGRADE — Premium visual polish layer  (css/gui-upgrade.css)
   ───────────────────────────────────────────────────────────────────────────
   CRT scanlines, glassmorphic nav, bigger cards with hover overlays,
   frosted auth forms, hero canvas background, logo pulse, nav animations.
   Loaded AFTER deep-polish.css so it wins the cascade.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────────
   1. CRT SCANLINE OVERLAY — subtle retro texture across the whole page
   ───────────────────────────────────────────────────────────────────────────── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9998;            /* below age-gate / cookie banner; pointer-events:none */
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.5) 0,
    rgba(0, 0, 0, 0.5) 1px,
    transparent 1px,
    transparent 3px
  );
  opacity: 0.05;            /* ~2.5% effective — faint CRT texture, still readable */
  mix-blend-mode: multiply;
}

/* ─────────────────────────────────────────────────────────────────────────────
   2. GLASSMORPHIC NAV — frosted header with deep blur
   ───────────────────────────────────────────────────────────────────────────── */
.header {
  background: rgba(10, 10, 10, 0.7) !important;
  backdrop-filter: blur(20px) saturate(1.3) !important;
  -webkit-backdrop-filter: blur(20px) saturate(1.3) !important;
  border-bottom: 1px solid rgba(0, 255, 65, 0.08) !important;
}
.header.ms-scrolled {
  background: rgba(5, 5, 5, 0.85) !important;
  backdrop-filter: blur(28px) saturate(1.4) !important;
  -webkit-backdrop-filter: blur(28px) saturate(1.4) !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   3. GREEN UNDERLINE NAV ANIMATION — active link / hover indicator
   ───────────────────────────────────────────────────────────────────────────── */
.mobile-nav-item,
.filter-chip {
  position: relative;
}
.mobile-nav-item::after,
.filter-chip::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--ms-green, #00ff41);
  border-radius: 1px;
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1), left 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
}
.mobile-nav-item:hover::after,
.mobile-nav-item.active::after,
.filter-chip:hover::after,
.filter-chip.active::after {
  width: 60%;
  left: 20%;
}

/* ─────────────────────────────────────────────────────────────────────────────
   4. LOGO PULSE GLOW ANIMATION
   ───────────────────────────────────────────────────────────────────────────── */
@keyframes logoPulseGlow {
  0%, 100% {
    filter: drop-shadow(0 0 6px rgba(0, 255, 65, 0.3));
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(0, 255, 65, 0.6))
            drop-shadow(0 0 40px rgba(0, 255, 65, 0.2));
  }
}
.header-logo {
  animation: logoPulseGlow 4s ease-in-out infinite;
}
.header-logo .logo-crown {
  animation: logoPulseGlow 4s ease-in-out infinite;
  animation-delay: 0.5s;
}

/* ─────────────────────────────────────────────────────────────────────────────
   5. BIGGER GAME CARDS — taller, rounder, with inner shadow
   ───────────────────────────────────────────────────────────────────────────── */
.game-card {
  min-height: 220px;
  border-radius: 16px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04),
              0 4px 16px rgba(0, 0, 0, 0.3);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.35s ease,
              border-color 0.35s ease;
}

/* ─────────────────────────────────────────────────────────────────────────────
   6. CARD HOVER — scale + green glow + centred play overlay
   ───────────────────────────────────────────────────────────────────────────── */
.game-card:hover {
  transform: scale(1.05) translateY(-4px) !important;
  box-shadow: 0 0 30px rgba(0, 255, 65, 0.3),
              0 16px 40px rgba(0, 0, 0, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(0, 255, 65, 0.4) !important;
  z-index: 10;
}

/* Play button overlay — injected by gui-upgrade.js on hover */
.gui-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 5;
  border-radius: 16px 16px 0 0;
}
.game-card:hover .gui-play-overlay {
  opacity: 1;
}
.gui-play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ms-green, #00ff41), var(--ms-green-deep, #00b82f));
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #04210b;
  font-size: 22px;
  box-shadow: 0 4px 20px rgba(0, 255, 65, 0.5);
  transform: scale(0.8);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}
.game-card:hover .gui-play-btn {
  transform: scale(1);
}

/* ─────────────────────────────────────────────────────────────────────────────
   7. CARD THUMBNAIL — full cover + bottom gradient for title
   ───────────────────────────────────────────────────────────────────────────── */
/* The <img class="game-thumb"> is positioned absolute:inset-0 inside
   .game-visual, so .game-visual MUST be a full-width banner with a real
   height or the image collapses. Earlier sheets squashed it: the card is
   `display:flex; flex-direction:column; align-items:center` (so the visual
   never stretches to full width) and css/performance-mobile.css forces
   `aspect-ratio: 4/3`. As the cascade's final word we pin it here: full
   card width + 16:10 ratio, never flex-squashed. Without this the giant
   .game-placeholder fallback letter showed through / beside the art —
   the "wrong thumbnails" the lobby was displaying. */
.game-visual {
  position: relative;
  width: 100% !important;
  aspect-ratio: 16 / 10 !important;
  flex: 0 0 auto !important;
  align-self: stretch !important;
  overflow: hidden;
}
.game-visual::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(10, 10, 10, 0.85), transparent);
  z-index: 2;
  pointer-events: none;
}
/* High specificity (0,3,0) so z-index:1 beats premium-redesign.css's
   `.game-card img { z-index:0 !important }` (0,1,1). Otherwise the thumb
   and the fallback letter tie at z-index:0 and DOM order paints the giant
   letter ON TOP of the loaded art. */
.game-card .game-visual .game-thumb {
  position: absolute !important;
  inset: 0 !important;
  object-fit: cover !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 1 !important;
}
/* The fallback first-letter tile must sit BEHIND the loaded image; it is
   only meant to show when the <img> errors out (onerror hides the img). */
.game-card .game-visual .game-placeholder {
  position: absolute !important;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  z-index: 0 !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   8. HERO SECTION — full-width, position relative for rain canvas
   ───────────────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  width: 100%;
  padding: 80px 24px 60px !important;
  overflow: hidden;
}

/* Hero mini-canvas sits behind hero content */
#heroRainCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}
.hero-container {
  position: relative;
  z-index: 2;
}

/* ─────────────────────────────────────────────────────────────────────────────
   9. FROSTED GLASS AUTH FORMS — for signup/login overlays
   ───────────────────────────────────────────────────────────────────────────── */
.signup-modal,
.ms-modal,
.rs-card,
.modal-content {
  backdrop-filter: blur(15px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(15px) saturate(1.2) !important;
  background: rgba(20, 20, 35, 0.8) !important;
  border: 1px solid rgba(0, 255, 65, 0.2) !important;
  border-radius: 20px !important;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6),
              0 0 0 1px rgba(0, 255, 65, 0.08),
              inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

/* Auth page shell (login.html / signup.html) — frost the card */
.rs-shell .rs-card,
.rs-shell-wide .rs-card {
  backdrop-filter: blur(15px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(15px) saturate(1.2) !important;
  background: rgba(20, 20, 35, 0.75) !important;
  border: 1px solid rgba(0, 255, 65, 0.2) !important;
  border-radius: 20px !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   10. JACKPOT TICKER IN HERO — styling for the JS-injected ticker
   ───────────────────────────────────────────────────────────────────────────── */
.gui-jackpot-ticker {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 16px;
  padding: 10px 20px;
  border-radius: 12px;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.2);
}
.gui-jackpot-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 215, 0, 0.7);
}
.gui-jackpot-amount {
  font-family: 'Inter', monospace;
  font-feature-settings: 'tnum';
  font-size: 24px;
  font-weight: 800;
  color: #FFD700;
  text-shadow: 0 0 16px rgba(255, 215, 0, 0.4);
}

/* ─────────────────────────────────────────────────────────────────────────────
   11. TYPEWRITER CURSOR for hero tagline
   ───────────────────────────────────────────────────────────────────────────── */
.gui-typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--ms-green, #00ff41);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: guiCursorBlink 0.8s step-end infinite;
}
@keyframes guiCursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   12. RESPONSIVE ADJUSTMENTS
   ───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .game-card {
    min-height: 180px;
    border-radius: 12px !important;
  }
  .game-card:hover {
    transform: scale(1.03) translateY(-2px) !important;
  }
  .gui-play-btn {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
  .gui-jackpot-amount {
    font-size: 18px;
  }
  .hero {
    padding: 60px 16px 40px !important;
  }
}

@media (max-width: 480px) {
  .game-card {
    min-height: 150px;
  }
  .gui-jackpot-ticker {
    padding: 8px 14px;
    gap: 6px;
  }
  .gui-jackpot-amount {
    font-size: 16px;
  }
}

/* ─────────────────────────────────────────────────────────────────────────────
   13. HERO TAGLINE — "120+ PREMIUM SLOTS" typewriter line above the headline
   ───────────────────────────────────────────────────────────────────────────── */
.gui-hero-tagline {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ms-green, #00ff41);
  text-shadow: 0 0 12px rgba(0, 255, 65, 0.5);
  margin: 0 0 14px;
  min-height: 1.2em;
}

/* ─────────────────────────────────────────────────────────────────────────────
   14. GLOWING "PLAY NOW" CTA in the hero
   ───────────────────────────────────────────────────────────────────────────── */
.gui-playnow {
  order: -1;                 /* lead the .hero-ctas row */
  position: relative;
  border: none;
  cursor: pointer;
  border-radius: 12px;
  padding: 14px 34px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #04130a;
  background: linear-gradient(135deg, #5dff8a, #00c853);
  animation: guiPlayGlow 2.4s ease-in-out infinite;
  transition: transform 0.2s ease;
}
.gui-playnow:hover { transform: translateY(-2px); }
.gui-playnow:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@keyframes guiPlayGlow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0,255,90,0.55), 0 8px 22px rgba(0,255,65,0.40), 0 0 22px rgba(0,255,65,0.30); }
  50%      { box-shadow: 0 0 0 1px rgba(0,255,90,0.85), 0 10px 30px rgba(0,255,65,0.60), 0 0 42px rgba(0,255,65,0.55); }
}

/* ─────────────────────────────────────────────────────────────────────────────
   15. FLOATING PREVIEW CARDS — gently bobbing in the hero showcase
   ───────────────────────────────────────────────────────────────────────────── */
.gui-float-cards {
  position: relative;
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  min-height: 220px;
}
.gui-float-card {
  width: 120px;
  height: 170px;
  border-radius: 16px;
  background-color: #0b1a10;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(0, 255, 65, 0.30);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 22px rgba(0, 255, 65, 0.22);
  position: relative;
  overflow: hidden;
}
.gui-float-badge {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 6px 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
  color: var(--ms-green, #00ff41);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
}
.gui-bob { animation: guiBob 4s ease-in-out infinite; }
@keyframes guiBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
/* Middle card rides higher and bobs around that raised position. */
.gui-float-cards .gui-float-card:nth-child(2) { transform: translateY(-18px) scale(1.06); z-index: 2; }
.gui-float-cards .gui-float-card:nth-child(2).gui-bob { animation-name: guiBob2; }
@keyframes guiBob2 {
  0%, 100% { transform: translateY(-18px) scale(1.06); }
  50%      { transform: translateY(-32px) scale(1.06); }
}

/* ─────────────────────────────────────────────────────────────────────────────
   16. AUTH — social proof + animated tracing border on the form card
   ───────────────────────────────────────────────────────────────────────────── */
.gui-trace { position: relative; }
.gui-trace::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, transparent, var(--ms-green, #00ff41), transparent, var(--ms-green, #00ff41), transparent);
  background-size: 300% 300%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
  animation: guiTrace 4s linear infinite;
  pointer-events: none;
}
@keyframes guiTrace {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}
.gui-social-proof {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}
.gui-social-proof strong { color: var(--ms-green, #00ff41); }
.gui-sp-dots { display: inline-flex; }
.gui-sp-dots i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin-left: -8px;
  border: 2px solid #0b1a10;
  background: linear-gradient(135deg, #1fff77, #009941);
}
.gui-sp-dots i:first-child { margin-left: 0; }

/* ─────────────────────────────────────────────────────────────────────────────
   17. DEPOSIT (wallet) — glowing balance, step indicator, pill presets
   ───────────────────────────────────────────────────────────────────────────── */
.gui-balance-glow {
  color: #eafff0 !important;
  text-shadow: 0 0 22px rgba(0, 255, 65, 0.55);
}
.gui-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}
.gui-step {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}
.gui-step:not(:last-child)::after {
  content: '';
  width: 22px;
  height: 2px;
  margin-left: 6px;
  background: rgba(255, 255, 255, 0.15);
}
.gui-step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.gui-step.gui-step-active { color: var(--ms-green, #00ff41); }
.gui-step.gui-step-active .gui-step-n {
  background: rgba(0, 255, 65, 0.16);
  border-color: var(--ms-green, #00ff41);
  color: var(--ms-green, #00ff41);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.4);
}
body.gui-deposit .preset-btn {
  border-radius: 999px !important;
  padding: 14px 18px !important;
  font-weight: 700;
}
body.gui-deposit .preset-btn.active {
  border-color: var(--ms-green, #00ff41) !important;
  box-shadow: 0 0 0 1px var(--ms-green, #00ff41), 0 0 18px rgba(0, 255, 65, 0.35) !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   18. REDUCED MOTION — honour user preference (MUST REMAIN LAST IN THIS FILE)
   ───────────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .header-logo,
  .header-logo .logo-crown {
    animation: none !important;
    filter: none !important;
  }
  .gui-typewriter-cursor {
    animation: none !important;
    opacity: 1;
  }
  .game-card:hover {
    transform: none !important;
  }
  .gui-play-overlay,
  .gui-play-btn {
    transition: none !important;
  }
  .gui-playnow,
  .gui-bob,
  .gui-float-card,
  .gui-float-cards .gui-float-card:nth-child(2).gui-bob,
  .gui-trace::before {
    animation: none !important;
  }
  body::after {
    display: none;
  }
  #heroRainCanvas {
    display: none;
  }
}
