/**
 * Site Atmosphere Tech — lobby + player shell ambient layer.
 * Pure CSS: grid floor, fog, neon orbs, scanlines. GPU-friendly transforms only.
 * Loads last; does not touch Pixi reels or bonus presentation.
 */

.showcase-shell {
  --tech-cyan: #38bdf8;
  --tech-violet: #a855f7;
  --tech-gold: #fbbf24;
  --tech-emerald: #34d399;
  --tech-deep: #030308;
  --tech-glass: rgba(10, 12, 24, 0.72);
  --tech-glow-cyan: rgba(56, 189, 248, 0.22);
  --tech-glow-violet: rgba(168, 85, 247, 0.18);
  --tech-smoke: rgba(56, 189, 248, 0.07);
  position: relative;
  isolation: isolate;
}

.showcase-shell.playground-player {
  background:
    radial-gradient(ellipse 100% 55% at 50% -8%, var(--tech-glow-violet), transparent 52%),
    radial-gradient(ellipse 45% 35% at 0% 100%, rgba(52, 211, 153, 0.06), transparent 50%),
    radial-gradient(ellipse 40% 30% at 100% 85%, rgba(251, 191, 36, 0.05), transparent 48%),
    linear-gradient(168deg, #05050c 0%, var(--tech-deep) 42%, #020205 100%);
}

/* ── Atmosphere stack ── */
.site-atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.site-atmosphere__perspective {
  position: absolute;
  inset: 0;
  perspective: 620px;
  perspective-origin: 50% 100%;
}

.site-atmosphere__grid-floor {
  position: absolute;
  left: -35%;
  right: -35%;
  bottom: -8%;
  height: 62%;
  transform: rotateX(76deg) translateZ(0);
  transform-origin: center bottom;
  background:
    linear-gradient(rgba(56, 189, 248, 0.14) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.14) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to top, #000 0%, #000 35%, transparent 92%);
  opacity: 0.55;
  animation: tech-grid-breathe 10s ease-in-out infinite;
}

.site-atmosphere__smoke {
  position: absolute;
  width: 130%;
  height: 45%;
  left: -15%;
  filter: blur(48px);
  opacity: 0.55;
  will-change: transform, opacity;
}

.site-atmosphere__smoke--1 {
  bottom: 8%;
  background:
    radial-gradient(ellipse 55% 80% at 25% 60%, var(--tech-smoke), transparent 68%),
    radial-gradient(ellipse 45% 70% at 75% 40%, rgba(168, 85, 247, 0.06), transparent 65%);
  animation: tech-smoke-drift-a 32s ease-in-out infinite;
}

.site-atmosphere__smoke--2 {
  bottom: 18%;
  background:
    radial-gradient(ellipse 50% 75% at 60% 55%, rgba(52, 211, 153, 0.05), transparent 70%),
    radial-gradient(ellipse 40% 60% at 15% 45%, rgba(251, 191, 36, 0.04), transparent 62%);
  animation: tech-smoke-drift-b 38s ease-in-out infinite;
  opacity: 0.42;
}

.site-atmosphere__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  will-change: transform, opacity;
}

.site-atmosphere__orb--cyan {
  width: min(42vw, 420px);
  height: min(42vw, 420px);
  top: -8%;
  left: -6%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.2), transparent 68%);
  animation: tech-orb-float-a 18s ease-in-out infinite;
}

.site-atmosphere__orb--violet {
  width: min(36vw, 360px);
  height: min(36vw, 360px);
  top: 12%;
  right: -4%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.16), transparent 70%);
  animation: tech-orb-float-b 22s ease-in-out infinite;
}

.site-atmosphere__orb--gold {
  width: min(28vw, 280px);
  height: min(28vw, 280px);
  bottom: 22%;
  left: 38%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.1), transparent 72%);
  animation: tech-orb-float-c 26s ease-in-out infinite;
}

.site-atmosphere__beam {
  position: absolute;
  top: -20%;
  left: 50%;
  width: 2px;
  height: 55%;
  transform: translateX(-50%);
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(56, 189, 248, 0.35) 35%,
    rgba(168, 85, 247, 0.25) 65%,
    transparent 100%
  );
  filter: blur(1px);
  opacity: 0.35;
  animation: tech-beam-pulse 6s ease-in-out infinite;
}

.site-atmosphere__beam::after {
  content: '';
  position: absolute;
  inset: 0;
  width: 120px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(56, 189, 248, 0.08) 40%,
    rgba(168, 85, 247, 0.06) 70%,
    transparent 100%
  );
  filter: blur(24px);
}

.site-atmosphere__noise {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  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.85' 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;
  mix-blend-mode: overlay;
}

.site-atmosphere__scanlines {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 2px,
    rgba(0, 0, 0, 0.45) 2px,
    rgba(0, 0, 0, 0.45) 4px
  );
  mix-blend-mode: multiply;
}

.site-atmosphere__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 85% 75% at 50% 45%, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
}

@keyframes tech-grid-breathe {
  0%,
  100% {
    opacity: 0.48;
  }
  50% {
    opacity: 0.62;
  }
}

@keyframes tech-smoke-drift-a {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translate3d(3%, -2%, 0) scale(1.04);
    opacity: 0.62;
  }
}

@keyframes tech-smoke-drift-b {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(-2.5%, 1.5%, 0) scale(1.03);
  }
}

@keyframes tech-orb-float-a {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 0.85;
  }
  50% {
    transform: translate3d(2%, 3%, 0);
    opacity: 1;
  }
}

@keyframes tech-orb-float-b {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(-3%, 2%, 0);
  }
}

@keyframes tech-orb-float-c {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
    opacity: 0.7;
  }
  50% {
    transform: translate3d(1.5%, -2%, 0);
    opacity: 0.95;
  }
}

@keyframes tech-beam-pulse {
  0%,
  100% {
    opacity: 0.28;
  }
  50% {
    opacity: 0.45;
  }
}

/* ── Shell chrome elevation ── */
.showcase-sidebar,
.showcase-main {
  position: relative;
  z-index: 1;
}

.showcase-sidebar {
  background: linear-gradient(180deg, rgba(8, 10, 22, 0.88), rgba(4, 5, 12, 0.94));
  border-right: 1px solid rgba(56, 189, 248, 0.12);
  box-shadow:
    inset -1px 0 0 rgba(255, 255, 255, 0.04),
    4px 0 32px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(20px) saturate(1.2);
}

.showcase-sidebar::before {
  content: '';
  position: absolute;
  top: 8%;
  bottom: 8%;
  right: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(56, 189, 248, 0.55) 25%,
    rgba(168, 85, 247, 0.45) 75%,
    transparent
  );
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.25);
  pointer-events: none;
}

.showcase-logo-mark {
  box-shadow:
    0 0 24px rgba(56, 189, 248, 0.25),
    0 0 40px rgba(168, 85, 247, 0.2);
}

.showcase-nav-item:hover,
.showcase-nav-item.active,
.showcase-nav-item.is-active {
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.1), rgba(168, 85, 247, 0.08));
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow: inset 0 0 20px rgba(56, 189, 248, 0.06);
}

.showcase-topbar {
  position: relative;
  background: rgba(6, 8, 18, 0.82);
  border-bottom: 1px solid rgba(56, 189, 248, 0.1);
  backdrop-filter: blur(16px) saturate(1.15);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
}

.showcase-topbar::after {
  content: '';
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(56, 189, 248, 0.55) 20%,
    rgba(168, 85, 247, 0.5) 50%,
    rgba(251, 191, 36, 0.35) 80%,
    transparent
  );
  pointer-events: none;
}

.showcase-topbar-pill {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(168, 85, 247, 0.12));
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.08);
}

.showcase-balance-chip {
  border-color: rgba(52, 211, 153, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 24px rgba(52, 211, 153, 0.12);
}

.showcase-live-badge::before {
  background: var(--tech-emerald);
  box-shadow: 0 0 10px var(--tech-emerald), 0 0 20px rgba(52, 211, 153, 0.4);
}

/* ── Lobby tech polish ── */
.game-lobby-hero {
  border: 1px solid rgba(56, 189, 248, 0.14);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 40px rgba(56, 189, 248, 0.06);
}

.game-lobby-hero-glow {
  background:
    radial-gradient(circle at 30% 80%, rgba(56, 189, 248, 0.18), transparent 55%),
    radial-gradient(circle at 80% 20%, rgba(168, 85, 247, 0.12), transparent 50%);
}

.game-lobby-kicker {
  color: var(--tech-cyan);
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
}

.game-lobby-title {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 45%, #94a3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.game-lobby-tabs {
  border-color: rgba(56, 189, 248, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.game-lobby-tab.is-active {
  box-shadow:
    0 8px 24px rgba(251, 191, 36, 0.28),
    0 0 20px rgba(251, 191, 36, 0.12);
}

.game-lobby-card {
  background: linear-gradient(165deg, rgba(12, 16, 32, 0.92), rgba(6, 8, 18, 0.96));
  border-color: rgba(56, 189, 248, 0.1);
}

.game-lobby-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease;
  box-shadow:
    inset 0 0 0 1px rgba(56, 189, 248, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.game-lobby-card:hover:not([disabled]):not(.game-lobby-card--soon) {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow:
    0 24px 52px rgba(0, 0, 0, 0.42),
    0 0 36px rgba(56, 189, 248, 0.12),
    0 0 0 1px rgba(168, 85, 247, 0.15);
}

.game-lobby-card:hover:not([disabled]):not(.game-lobby-card--soon)::after {
  opacity: 1;
}

.game-lobby-card-cta {
  color: var(--tech-cyan);
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.game-embed-frame {
  border: 1px solid rgba(56, 189, 248, 0.15);
  box-shadow:
    0 20px 56px rgba(0, 0, 0, 0.45),
    0 0 32px rgba(56, 189, 248, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* ── Modals glass tech rim ── */
.slot-modal-card,
.beta-auth-card,
.beta-profile-card,
.beta-tournament-card {
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(56, 189, 248, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.showcase-companion-teaser-card {
  border-color: rgba(168, 85, 247, 0.25);
  box-shadow: 0 0 28px rgba(168, 85, 247, 0.1);
}

/* ── Slot view: subtle stage rim when not in bonus ── */
.playground--slot-active .game-stage-card--v2 {
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 12px 40px rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .site-atmosphere__grid-floor,
  .site-atmosphere__smoke,
  .site-atmosphere__orb,
  .site-atmosphere__beam {
    animation: none !important;
  }
}

@media (max-width: 900px) {
  .site-atmosphere__grid-floor {
    opacity: 0.35;
    height: 48%;
  }

  .site-atmosphere__orb--gold {
    display: none;
  }
}
