/* ═══════════════════════════════════════════════════════════════════════════
   ZAD Portal Gateway — Pure CSS cosmic HUD (4 distinct styles)
   No reference PNGs — gradients, transforms, animations only
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design tokens ── */
.portal-gateway-shell {
  --pg-mx: 0;
  --pg-my: 0;
  --pg-text: #f0f4ff;
  --pg-muted: rgba(240, 244, 255, 0.68);
  --pg-c1: #22d3ee;
  --pg-c2: #a78bfa;
  --pg-c3: #f472b6;
  --pg-glass: rgba(6, 10, 22, 0.72);
  --pg-glass-border: rgba(103, 232, 249, 0.22);
  --pg-glow-cyan: rgba(34, 211, 238, 0.45);
  --pg-glow-magenta: rgba(232, 121, 249, 0.4);
  --pg-glow-orange: rgba(249, 115, 22, 0.5);
  --pg-font: "Outfit", "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  color: var(--pg-text);
  background: #020208;
  font-family: var(--pg-font);
}

.portal-gateway-shell.pg-force-dark,
.theme-zad-light .portal-gateway-shell.pg-force-dark {
  --pg-text: #f0f4ff;
  --pg-muted: rgba(240, 244, 255, 0.68);
  color: var(--pg-text);
  background: #020208;
}

/* Style-specific palette overrides */
.portal-gateway-shell.pg-style-orbit {
  --pg-accent: #22d3ee;
  --pg-accent-2: #e879f9;
  --pg-scene-bg: #0a0218;
  --pg-nebula-a: rgba(126, 34, 206, 0.55);
  --pg-nebula-b: rgba(236, 72, 153, 0.45);
}

.portal-gateway-shell.pg-style-nexus {
  --pg-accent: #38bdf8;
  --pg-accent-2: #6366f1;
  --pg-scene-bg: #030818;
  --pg-nebula-a: rgba(30, 58, 138, 0.5);
  --pg-nebula-b: rgba(99, 102, 241, 0.35);
}

.portal-gateway-shell.pg-style-ring {
  --pg-accent: #06b6d4;
  --pg-accent-2: #f97316;
  --pg-scene-bg: #020818;
  --pg-nebula-a: rgba(249, 115, 22, 0.42);
  --pg-nebula-b: rgba(6, 182, 212, 0.28);
}

.portal-gateway-shell.pg-style-cosmos {
  --pg-accent: #2dd4bf;
  --pg-accent-2: #fb923c;
  --pg-scene-bg: #120608;
  --pg-nebula-a: rgba(251, 146, 60, 0.58);
  --pg-nebula-b: rgba(45, 212, 191, 0.38);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCENE — full-screen cosmic backdrop
   ═══════════════════════════════════════════════════════════════════════════ */

.pg-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: var(--pg-scene-bg, #020208);
  transform: translate(
    calc(var(--pg-mx) * 6px),
    calc(var(--pg-my) * 4px)
  );
  transition: transform 0.12s ease-out;
}

.pg-scene-stars {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.9) 0%, transparent 100%),
    radial-gradient(1px 1px at 30% 65%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 55% 15%, rgba(255,255,255,0.85) 0%, transparent 100%),
    radial-gradient(1px 1px at 72% 42%, rgba(255,255,255,0.6) 0%, transparent 100%),
    radial-gradient(1px 1px at 88% 78%, rgba(255,255,255,0.75) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 88%, rgba(255,255,255,0.55) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 45% 38%, rgba(200,220,255,0.8) 0%, transparent 100%),
    radial-gradient(1px 1px at 62% 92%, rgba(255,255,255,0.65) 0%, transparent 100%),
    radial-gradient(1px 1px at 95% 28%, rgba(255,255,255,0.7) 0%, transparent 100%),
    radial-gradient(1px 1px at 38% 52%, rgba(255,255,255,0.5) 0%, transparent 100%);
  background-size: 100% 100%;
  animation: pg-stars-twinkle 8s ease-in-out infinite alternate;
  opacity: 0.85;
}

.pg-scene-stars::before,
.pg-scene-stars::after {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: repeat;
  background-size: 280px 280px;
}

.pg-scene-stars::before {
  background-image:
    radial-gradient(1px 1px at 20px 40px, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 80px 120px, rgba(255,255,255,0.35), transparent),
    radial-gradient(1.5px 1.5px at 140px 60px, rgba(200,230,255,0.5), transparent),
    radial-gradient(1px 1px at 200px 180px, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 240px 30px, rgba(255,255,255,0.45), transparent);
  animation: pg-stars-drift 120s linear infinite;
}

.pg-scene-stars::after {
  background-image:
    radial-gradient(1px 1px at 50px 90px, rgba(255,255,255,0.25), transparent),
    radial-gradient(1px 1px at 110px 200px, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 170px 140px, rgba(255,255,255,0.2), transparent),
    radial-gradient(1.5px 1.5px at 230px 70px, rgba(255,255,255,0.4), transparent);
  animation: pg-stars-drift 180s linear infinite reverse;
  opacity: 0.6;
}

.pg-scene-nebula {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 55% 45% at 20% 30%, var(--pg-nebula-a, rgba(126,34,206,0.4)) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 78% 65%, var(--pg-nebula-b, rgba(236,72,153,0.35)) 0%, transparent 68%),
    radial-gradient(ellipse 40% 35% at 50% 85%, rgba(34, 211, 238, 0.12) 0%, transparent 65%);
  filter: blur(28px);
  animation: pg-aurora 18s ease-in-out infinite alternate;
  mix-blend-mode: screen;
  opacity: 0.9;
}

.pg-scene-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.85s ease, visibility 0.85s;
}

.portal-gateway-shell.pg-style-orbit .pg-scene-orbit,
.portal-gateway-shell.pg-style-nexus .pg-scene-nexus,
.portal-gateway-shell.pg-style-ring .pg-scene-ring,
.portal-gateway-shell.pg-style-cosmos .pg-scene-cosmos {
  opacity: 1;
  visibility: visible;
}

.pg-scene-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 85% 75% at 50% 45%, transparent 35%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

.pg-scene-grain {
  position: absolute;
  inset: 0;
  opacity: 0.045;
  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.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;
  pointer-events: none;
}

/* ── Nebula clouds ── */
.pg-nebula-cloud {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  animation: pg-cloud-drift 22s ease-in-out infinite alternate;
}

.pg-nebula-cloud.c1 {
  width: min(55vw, 520px);
  height: min(45vw, 420px);
  top: 8%;
  left: -8%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.55) 0%, transparent 68%);
}

.pg-nebula-cloud.c2 {
  width: min(48vw, 460px);
  height: min(40vw, 380px);
  bottom: 5%;
  right: -6%;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.48) 0%, transparent 70%);
  animation-delay: -6s;
}

.pg-nebula-cloud.c3 {
  width: min(42vw, 400px);
  height: min(38vw, 360px);
  top: 35%;
  left: 30%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.42) 0%, transparent 72%);
  animation-delay: -11s;
}

.pg-nebula-cloud.c-orange {
  width: min(50vw, 480px);
  height: min(55vh, 500px);
  top: 15%;
  left: -12%;
  background: radial-gradient(ellipse, rgba(249, 115, 22, 0.52) 0%, rgba(234, 88, 12, 0.2) 45%, transparent 72%);
  filter: blur(36px);
}

.pg-style-ring .pg-nebula-cloud.c-orange {
  animation: pg-orange-pulse 14s ease-in-out infinite alternate;
}

.pg-style-cosmos .pg-nebula-cloud.c1 {
  background: radial-gradient(circle, rgba(251, 146, 60, 0.62) 0%, transparent 68%);
  width: min(60vw, 580px);
  height: min(50vw, 480px);
  top: -5%;
  left: -10%;
}

.pg-style-cosmos .pg-nebula-cloud.c2 {
  background: radial-gradient(circle, rgba(45, 212, 191, 0.45) 0%, transparent 70%);
  bottom: 10%;
  right: -8%;
}

.pg-style-cosmos .pg-nebula-cloud.c3 {
  background: radial-gradient(circle, rgba(251, 113, 133, 0.35) 0%, transparent 72%);
  top: 40%;
  right: 15%;
}

/* ── Lens flares ── */
.pg-lens {
  position: absolute;
  width: min(28vw, 280px);
  height: min(28vw, 280px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, rgba(34,211,238,0.06) 35%, transparent 70%);
  filter: blur(2px);
  animation: pg-lens-pulse 6s ease-in-out infinite;
}

.pg-lens-tl {
  top: 6%;
  left: 8%;
}

.pg-lens-br {
  bottom: 12%;
  right: 10%;
  animation-delay: -3s;
  background: radial-gradient(circle, rgba(232,121,249,0.1) 0%, transparent 70%);
}

/* ── Planets ── */
.pg-planet {
  position: absolute;
  border-radius: 50%;
  box-shadow: inset -8px -8px 24px rgba(0,0,0,0.5);
}

.pg-planet-sm {
  width: 28px;
  height: 28px;
}

.pg-planet-ring {
  width: min(14vw, 120px);
  height: min(14vw, 120px);
  top: 8%;
  left: 6%;
  background:
    radial-gradient(circle at 35% 35%, #c4b5fd 0%, #6366f1 35%, #312e81 70%, #1e1b4b 100%);
  box-shadow:
    0 0 40px rgba(99, 102, 241, 0.45),
    inset -6px -6px 18px rgba(0,0,0,0.45);
}

.pg-planet-ring::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180%;
  height: 42%;
  transform: translate(-50%, -50%) rotateX(72deg) rotateZ(-18deg);
  border-radius: 50%;
  border: 2px solid rgba(196, 181, 253, 0.55);
  box-shadow:
    0 0 12px rgba(167, 139, 250, 0.4),
    inset 0 0 8px rgba(167, 139, 250, 0.2);
  pointer-events: none;
}

.pg-planet-earth {
  width: min(11vw, 96px);
  height: min(11vw, 96px);
  top: 10%;
  right: 8%;
  background:
    radial-gradient(circle at 38% 32%, #7dd3fc 0%, #0284c7 28%, #0369a1 55%, #0c4a6e 100%);
  box-shadow: 0 0 36px rgba(56, 189, 248, 0.35);
}

.pg-planet-earth::before {
  content: "";
  position: absolute;
  inset: 18% 22% 28% 30%;
  border-radius: 40% 50% 45% 55%;
  background: rgba(34, 197, 94, 0.55);
  filter: blur(1px);
}

.pg-planet-blue {
  width: min(10vw, 88px);
  height: min(10vw, 88px);
  top: 12%;
  right: 10%;
  background: radial-gradient(circle at 32% 28%, #93c5fd 0%, #2563eb 45%, #1e3a8a 100%);
  box-shadow: 0 0 32px rgba(37, 99, 235, 0.4);
}

.pg-planet-gas {
  width: min(18vw, 160px);
  height: min(18vw, 160px);
  bottom: 18%;
  left: 8%;
  background:
    radial-gradient(circle at 40% 35%, #fcd34d 0%, #f97316 25%, #c2410c 50%, #7c2d12 85%);
  box-shadow: 0 0 48px rgba(249, 115, 22, 0.45);
  animation: pg-planet-rotate 90s linear infinite;
}

.pg-planet-gas::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background: repeating-linear-gradient(
    -12deg,
    transparent 0 8px,
    rgba(0,0,0,0.08) 8px 10px
  );
  opacity: 0.6;
}

/* ── Galaxies ── */
.pg-galaxy {
  position: absolute;
  width: min(22vw, 200px);
  height: min(22vw, 200px);
  top: 28%;
  left: 42%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(ellipse 100% 35% at 50% 50%, rgba(255,255,255,0.25) 0%, transparent 50%),
    conic-gradient(
      from 210deg,
      transparent 0deg,
      rgba(167, 139, 250, 0.15) 40deg,
      rgba(255,255,255,0.35) 90deg,
      rgba(129, 140, 248, 0.2) 140deg,
      transparent 200deg,
      rgba(255,255,255,0.2) 260deg,
      rgba(196, 181, 253, 0.18) 310deg,
      transparent 360deg
    );
  filter: blur(1px);
  animation: pg-galaxy-spin 360s linear infinite;
  opacity: 0.85;
}

.pg-galaxy-sm {
  width: min(14vw, 130px);
  height: min(14vw, 130px);
  top: 22%;
  left: 18%;
  opacity: 0.7;
}

/* ── Asteroids (Nexus — outside panel) ── */
.pg-asteroid {
  position: absolute;
  width: calc(4px + (var(--i, 0) * 0.8px));
  height: calc(3px + (var(--i, 0) * 0.6px));
  background: linear-gradient(135deg, #94a3b8 0%, #64748b 50%, #475569 100%);
  border-radius: 30% 70% 55% 45%;
  opacity: calc(0.35 + (var(--i, 0) * 0.05));
  animation: pg-asteroid-float calc(12s + var(--i, 0) * 1.4s) ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -0.9s);
  box-shadow: 0 0 4px rgba(148, 163, 184, 0.3);
}

.pg-style-nexus .pg-asteroid:nth-child(1)  { top: 4%;  left: 18%; transform: rotate(22deg); }
.pg-style-nexus .pg-asteroid:nth-child(2)  { top: 6%;  right: 22%; transform: rotate(-15deg); }
.pg-style-nexus .pg-asteroid:nth-child(3)  { top: 14%; left: 4%; transform: rotate(45deg); }
.pg-style-nexus .pg-asteroid:nth-child(4)  { top: 12%; right: 5%; transform: rotate(-38deg); }
.pg-style-nexus .pg-asteroid:nth-child(5)  { top: 22%; left: 2%; transform: rotate(12deg); }
.pg-style-nexus .pg-asteroid:nth-child(6)  { top: 20%; right: 3%; transform: rotate(-52deg); }
.pg-style-nexus .pg-asteroid:nth-child(7)  { bottom: 28%; left: 3%; transform: rotate(33deg); }
.pg-style-nexus .pg-asteroid:nth-child(8)  { bottom: 26%; right: 4%; transform: rotate(-28deg); }
.pg-style-nexus .pg-asteroid:nth-child(9)  { bottom: 8%; left: 12%; transform: rotate(18deg); }
.pg-style-nexus .pg-asteroid:nth-child(10) { bottom: 6%; right: 14%; transform: rotate(-42deg); }

/* ── Constellation ── */
.pg-constellation {
  position: absolute;
  width: 120px;
  height: 80px;
  top: 18%;
  right: 22%;
  opacity: 0.5;
}

.pg-constellation::before,
.pg-constellation::after {
  content: "";
  position: absolute;
  background: rgba(255,255,255,0.6);
  border-radius: 50%;
  box-shadow:
    24px 12px 0 0 rgba(255,255,255,0.45),
    48px -4px 0 0 rgba(255,255,255,0.55),
    72px 18px 0 0 rgba(255,255,255,0.4),
    96px 8px 0 1px rgba(200,230,255,0.5);
}

.pg-constellation::before {
  width: 3px;
  height: 3px;
  top: 20px;
  left: 0;
}

.pg-constellation::after {
  width: 2px;
  height: 2px;
  top: 50px;
  left: 30px;
  opacity: 0.7;
}

/* ── VR silhouettes ── */
.pg-vr-silhouette {
  position: absolute;
  bottom: 15%;
  right: 12%;
  width: min(16vw, 140px);
  height: min(28vh, 240px);
  background:
    linear-gradient(to bottom, transparent 0%, rgba(251, 146, 60, 0.08) 100%),
    radial-gradient(ellipse 60% 20% at 50% 15%, rgba(45, 212, 191, 0.25) 0%, transparent 100%);
  clip-path: polygon(35% 0%, 65% 0%, 72% 12%, 68% 18%, 75% 22%, 70% 28%, 62% 25%, 58% 32%, 55% 100%, 45% 100%, 42% 32%, 38% 25%, 30% 28%, 25% 22%, 32% 18%, 28% 12%);
  opacity: 0.55;
  filter: drop-shadow(0 0 24px rgba(251, 146, 60, 0.35));
  animation: pg-vr-glow 5s ease-in-out infinite alternate;
}

.pg-vr-figure {
  position: fixed;
  bottom: 0;
  right: 2%;
  width: min(14vw, 130px);
  height: min(38vh, 320px);
  z-index: 3;
  pointer-events: none;
  background:
    linear-gradient(180deg, transparent 0%, rgba(251, 146, 60, 0.06) 40%, rgba(45, 212, 191, 0.08) 100%);
  clip-path: polygon(38% 0%, 62% 0%, 70% 10%, 66% 16%, 78% 20%, 72% 26%, 64% 24%, 60% 30%, 56% 100%, 44% 100%, 40% 30%, 36% 24%, 28% 26%, 22% 20%, 34% 16%, 30% 10%);
  opacity: 0.65;
  filter: drop-shadow(0 0 32px rgba(249, 115, 22, 0.4));
  animation: pg-vr-glow 4s ease-in-out infinite alternate;
}

.portal-gateway-shell:not(.pg-style-cosmos) .pg-vr-figure {
  display: none;
}

/* ═══ SCENE STYLE BACKGROUNDS ═══ */
.pg-style-orbit .pg-scene {
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, #1a0533 0%, #0a0218 45%, #020208 100%);
}

.pg-style-nexus .pg-scene {
  background:
    radial-gradient(ellipse 70% 55% at 50% 35%, #0c1638 0%, #030818 50%, #010510 100%);
}

.pg-style-ring .pg-scene {
  background:
    radial-gradient(ellipse 75% 65% at 55% 45%, #041830 0%, #020818 55%, #010510 100%),
    radial-gradient(ellipse 40% 50% at 8% 35%, rgba(249, 115, 22, 0.15) 0%, transparent 70%);
}

.pg-style-cosmos .pg-scene {
  background:
    radial-gradient(ellipse 85% 70% at 45% 40%, #2a0a06 0%, #120608 48%, #050208 100%),
    radial-gradient(ellipse 50% 45% at 75% 60%, rgba(45, 212, 191, 0.12) 0%, transparent 65%);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PAGE — interactive HUD overlay
   ═══════════════════════════════════════════════════════════════════════════ */

.portal-gateway {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.portal-gateway > * {
  pointer-events: auto;
}

/* ── HUD frame & glass panel ── */
.pg-hud-frame {
  position: relative;
  width: min(920px, 94vw);
  margin-top: clamp(3.5rem, 8vh, 5.5rem);
  perspective: 1200px;
  perspective-origin: 50% 30%;
  animation: pg-hud-float 8s ease-in-out infinite;
}

.pg-hud-glass {
  position: relative;
  background: rgba(6, 10, 22, 0.72) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--pg-glass-border);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 60px rgba(34, 211, 238, 0.06);
  overflow: visible;
}

.theme-zad-light .pg-hud-glass,
.theme-zad-light .portal-gateway-shell.pg-force-dark .pg-hud-glass {
  background: rgba(6, 10, 22, 0.72) !important;
  color: var(--pg-text);
}

/* Corner accents */
.pg-hud-corner-tl,
.pg-hud-corner-tr,
.pg-hud-corner-bl,
.pg-hud-corner-br {
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
  z-index: 2;
}

.pg-hud-corner-tl {
  top: -1px;
  inset-inline-start: -1px;
  border-top: 2px solid var(--pg-accent, #22d3ee);
  border-inline-start: 2px solid var(--pg-accent, #22d3ee);
}

.pg-hud-corner-tr {
  top: -1px;
  inset-inline-end: -1px;
  border-top: 2px solid var(--pg-accent, #22d3ee);
  border-inline-end: 2px solid var(--pg-accent, #22d3ee);
}

.pg-hud-corner-bl {
  bottom: -1px;
  inset-inline-start: -1px;
  border-bottom: 2px solid var(--pg-accent, #22d3ee);
  border-inline-start: 2px solid var(--pg-accent, #22d3ee);
}

.pg-hud-corner-br {
  bottom: -1px;
  inset-inline-end: -1px;
  border-bottom: 2px solid var(--pg-accent, #22d3ee);
  border-inline-end: 2px solid var(--pg-accent, #22d3ee);
}

/* ── HUD header ── */
.pg-hud-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: clamp(0.65rem, 1.5vw, 0.9rem) clamp(1rem, 2.5vw, 1.4rem);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pg-hud-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.pg-hud-logo {
  position: relative;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.pg-hud-logo img {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.5));
}

.pg-hud-logo-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(103, 232, 249, 0.45);
  animation: pg-logo-ring-spin 12s linear infinite;
}

.pg-hud-brand-text {
  font-size: clamp(0.72rem, 1.6vw, 0.88rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e0f2fe;
  white-space: nowrap;
}

.pg-hud-brand-text strong {
  color: var(--pg-accent, #67e8f9);
  font-weight: 800;
}

.pg-hud-tools {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.pg-hud-auth {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

/* ── Side HUD bars (Orbit) ── */
.pg-hud-side {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: none;
  flex-direction: column;
  gap: 1.2rem;
  padding: 1rem 0.65rem;
  background: rgba(6, 10, 22, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(103, 232, 249, 0.18);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.pg-hud-side-l {
  inset-inline-start: clamp(0.5rem, 2vw, 1.2rem);
}

.pg-hud-side-r {
  inset-inline-end: clamp(0.5rem, 2vw, 1.2rem);
}

.pg-hud-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.pg-hud-meter {
  width: 4px;
  height: 48px;
  border-radius: 999px;
  background: linear-gradient(to top, var(--pg-accent, #22d3ee), transparent);
  opacity: 0.7;
  animation: pg-meter-pulse 3s ease-in-out infinite;
}

.pg-hud-dot-ring {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(103, 232, 249, 0.35);
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.12) 0%, transparent 70%);
  position: relative;
}

.pg-hud-dot-ring::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22d3ee, #a78bfa);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}

.pg-hud-side-r .pg-hud-dot-ring::before {
  background: linear-gradient(135deg, #f472b6, #fbbf24);
  box-shadow: 0 0 12px rgba(244, 114, 182, 0.5);
}

.pg-hud-dot-ring::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px dashed rgba(103, 232, 249, 0.25);
  animation: pg-logo-ring-spin 20s linear infinite reverse;
}

/* ── HUD body ── */
.pg-hud-body {
  padding: clamp(1.2rem, 3vw, 2rem) clamp(1rem, 2.5vw, 1.6rem) clamp(1.4rem, 3vw, 2.2rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.85rem, 2vw, 1.25rem);
}

.pg-hud-titles {
  text-align: center;
  margin-bottom: 0.25rem;
}

.pg-hud-titles h1 {
  margin: 0;
  font-size: clamp(1.1rem, 2.8vw, 1.55rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #e0f2fe 0%, var(--pg-accent, #67e8f9) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.pg-hud-sub {
  margin: 0.35rem 0 0;
  font-size: clamp(0.72rem, 1.5vw, 0.82rem);
  color: var(--pg-muted);
  letter-spacing: 0.06em;
}

.pg-hud-foot {
  padding: 0.5rem 1rem 0.75rem;
  text-align: center;
  font-size: 0.65rem;
  color: rgba(240, 244, 255, 0.4);
  letter-spacing: 0.08em;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* ── Search hero ── */
.pg-search-hero-wrap {
  position: relative;
  width: min(520px, 88%);
  margin-inline: auto;
}

.pg-search-hero-glow {
  position: absolute;
  inset: -12px -20px;
  border-radius: 999px;
  background: radial-gradient(ellipse, var(--pg-glow-cyan) 0%, transparent 70%);
  filter: blur(16px);
  opacity: 0.55;
  animation: pg-search-glow 4s ease-in-out infinite alternate;
  pointer-events: none;
}

.pg-search-hero {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.85rem 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(4, 8, 20, 0.85);
  border: 1px solid rgba(103, 232, 249, 0.28);
  box-shadow:
    0 0 24px rgba(34, 211, 238, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pg-search-hero:focus-within {
  border-color: rgba(103, 232, 249, 0.55);
  box-shadow:
    0 0 32px rgba(34, 211, 238, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.pg-search-grid-icon,
.pg-search-hero-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.65;
  background:
    linear-gradient(rgba(103,232,249,0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103,232,249,0.5) 1px, transparent 1px);
  background-size: 6px 6px;
  border-radius: 3px;
}

.pg-search-hero-icon {
  background: none;
  border: 2px solid rgba(103, 232, 249, 0.45);
  border-radius: 50%;
  position: relative;
}

.pg-search-hero-icon::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 2px;
  background: rgba(103, 232, 249, 0.55);
  bottom: 2px;
  right: -1px;
  transform: rotate(45deg);
  border-radius: 1px;
}

.pg-search-hero-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: rgba(248, 250, 252, 0.92);
  font-size: clamp(0.78rem, 1.8vw, 0.92rem);
  font-family: inherit;
  caret-color: var(--pg-accent, #67e8f9);
}

.pg-search-hero-input::placeholder {
  color: rgba(248, 250, 252, 0.38);
}

.pg-search-clear {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.15s;
}

.pg-search-clear:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ── Auth buttons ── */
.pg-auth-row-below {
  display: none;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.pg-auth-btn {
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  font-size: clamp(0.68rem, 1.6vw, 0.78rem);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pg-auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pg-auth-system {
  border: 1px solid rgba(103, 232, 249, 0.75);
  background: rgba(4, 12, 24, 0.55);
  color: #e0f2fe;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.2);
}

.pg-auth-gallery {
  border: 1px solid rgba(232, 121, 249, 0.75);
  background: linear-gradient(135deg, rgba(126, 34, 206, 0.45), rgba(190, 24, 93, 0.35));
  color: #fdf4ff;
  box-shadow: 0 0 22px rgba(232, 121, 249, 0.25);
}

.pg-auth-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════════════════
   DECOR — style-specific floating elements
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── ORBIT: 3D cubes on elliptical track ── */
.pg-deco-orbit {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  display: none;
}

.pg-style-orbit .pg-deco-orbit {
  display: block;
}

.pg-orbit-track {
  position: absolute;
  top: 58%;
  left: 50%;
  width: min(680px, 88vw);
  height: min(220px, 28vh);
  transform: translate(-50%, -50%) rotateX(68deg);
  border: 1px solid rgba(103, 232, 249, 0.15);
  border-radius: 50%;
  box-shadow:
    0 0 40px rgba(34, 211, 238, 0.08),
    inset 0 0 30px rgba(167, 139, 250, 0.06);
  animation: pg-orbit-track-pulse 6s ease-in-out infinite;
}

.pg-orbit-spinner {
  position: absolute;
  top: 58%;
  left: 50%;
  width: min(680px, 88vw);
  height: min(220px, 28vh);
  transform: translate(-50%, -50%) rotateX(68deg);
  animation: pg-orbit-spin 360s linear infinite;
  transform-style: preserve-3d;
}

.pg-orbit-node {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  transform: rotate(calc(var(--a, 0) * 1deg)) translateX(min(340px, 44vw)) rotate(calc(var(--a, 0) * -1deg));
  transform-style: preserve-3d;
}

.pg-cube {
  position: absolute;
  top: -22px;
  left: -22px;
  width: 44px;
  height: 44px;
  transform-style: preserve-3d;
  animation: pg-cube-float 4s ease-in-out infinite;
  animation-delay: calc(var(--a, 0) * -0.05s);
}

.pg-cube-face {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  backface-visibility: visible;
}

.pg-cube-face.f1 {
  transform: translateZ(22px);
}

.pg-cube-face.f2 {
  transform: rotateY(90deg) translateZ(22px);
}

.pg-cube-face.f3 {
  transform: rotateX(90deg) translateZ(22px);
}

.pg-cube.c-cyan .pg-cube-face {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.85), rgba(6, 182, 212, 0.55));
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.45);
}

.pg-cube.c-magenta .pg-cube-face {
  background: linear-gradient(135deg, rgba(232, 121, 249, 0.85), rgba(192, 38, 211, 0.55));
  box-shadow: 0 0 16px rgba(232, 121, 249, 0.45);
}

.pg-cube.c-gold .pg-cube-face {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.9), rgba(217, 119, 6, 0.6));
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.4);
}

.pg-orbit-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) rotateX(-68deg);
  margin-top: 0.45rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(240, 244, 255, 0.75);
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
}

/* ── NEXUS: isometric platforms (fixed bottom) ── */
.pg-deco-nexus {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28vh;
  z-index: 3;
  pointer-events: none;
  display: none;
}

.pg-style-nexus .pg-deco-nexus {
  display: block;
}

.pg-iso-platform {
  position: absolute;
  left: var(--x, 50%);
  bottom: var(--y, 20%);
  transform: translateX(-50%);
  animation: pg-platform-bob 5s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.pg-iso-block {
  width: 52px;
  height: 36px;
  position: relative;
  transform: skewY(-8deg) rotateX(55deg);
  transform-style: preserve-3d;
}

.pg-iso-block::before,
.pg-iso-block::after {
  content: "";
  position: absolute;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.7), rgba(99, 102, 241, 0.5));
  border: 1px solid rgba(147, 197, 253, 0.35);
}

.pg-iso-block::before {
  inset: 0;
  transform: translateY(-14px);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.8), rgba(59, 130, 246, 0.5));
}

.pg-iso-block::after {
  width: 100%;
  height: 14px;
  bottom: 0;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.6), rgba(79, 70, 229, 0.5));
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
}

.pg-iso-block.t-dome::before { filter: hue-rotate(-10deg); }
.pg-iso-block.t-pavilion { width: 60px; }
.pg-iso-block.t-market::before { background: linear-gradient(180deg, rgba(52, 211, 153, 0.75), rgba(16, 185, 129, 0.5)); }
.pg-iso-block.t-mall { width: 64px; height: 42px; }
.pg-iso-block.t-explore::before { filter: hue-rotate(20deg); }
.pg-iso-block.t-hub { width: 56px; height: 40px; }

.pg-iso-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(224, 242, 254, 0.65);
  text-align: center;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
}

.pg-nexus-grid-path {
  position: absolute;
  bottom: 8%;
  left: 5%;
  right: 5%;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(56, 189, 248, 0.35) 15%,
    rgba(99, 102, 241, 0.5) 50%,
    rgba(56, 189, 248, 0.35) 85%,
    transparent 100%
  );
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.25);
}

.pg-nexus-grid-path::before {
  content: "";
  position: absolute;
  inset: -20px 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 48px, rgba(56, 189, 248, 0.08) 48px 49px),
    repeating-linear-gradient(0deg, transparent 0 24px, rgba(56, 189, 248, 0.06) 24px 25px);
  transform: perspective(200px) rotateX(60deg);
  opacity: 0.5;
}

/* ── RING: portal ring + float tiles ── */
.pg-deco-ring,
.pg-deco-cosmos {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  display: none;
}

.pg-style-ring .pg-deco-ring,
.pg-style-cosmos .pg-deco-cosmos {
  display: block;
}

.pg-portal-ring {
  position: absolute;
  bottom: 6%;
  left: 50%;
  transform: translateX(-50%);
  width: min(280px, 55vw);
  height: min(280px, 55vw);
  border-radius: 50%;
  border: 3px solid rgba(6, 182, 212, 0.55);
  box-shadow:
    0 0 40px rgba(6, 182, 212, 0.35),
    inset 0 0 30px rgba(6, 182, 212, 0.12);
  animation: pg-portal-pulse 5s ease-in-out infinite;
}

.pg-portal-ring-lg {
  width: min(360px, 68vw);
  height: min(360px, 68vw);
  bottom: 4%;
  border-color: rgba(251, 146, 60, 0.55);
  box-shadow:
    0 0 60px rgba(249, 115, 22, 0.45),
    inset 0 0 40px rgba(45, 212, 191, 0.1);
}

.pg-portal-ring::before {
  content: "";
  position: absolute;
  inset: 12%;
  border-radius: 50%;
  border: 1px dashed rgba(103, 232, 249, 0.3);
  animation: pg-logo-ring-spin 30s linear infinite;
}

.pg-portal-city {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform: translate(-50%, 20%);
  width: 70%;
  height: 35%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
}

.pg-portal-city::before,
.pg-portal-city::after {
  content: "";
  display: block;
  background: linear-gradient(to top, rgba(6, 182, 212, 0.6), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(103, 232, 249, 0.25);
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.2);
}

.pg-portal-city::before {
  width: 12px;
  height: 28px;
  box-shadow:
    18px 0 0 0 rgba(6, 182, 212, 0.5),
    18px 0 0 1px rgba(103, 232, 249, 0.25),
    36px -8px 0 0 rgba(6, 182, 212, 0.65),
    36px -8px 0 1px rgba(103, 232, 249, 0.25),
    54px 4px 0 0 rgba(6, 182, 212, 0.45),
    54px 4px 0 1px rgba(103, 232, 249, 0.25),
    -18px 6px 0 0 rgba(6, 182, 212, 0.55),
    -18px 6px 0 1px rgba(103, 232, 249, 0.25),
    -36px -4px 0 0 rgba(6, 182, 212, 0.5),
    -36px -4px 0 1px rgba(103, 232, 249, 0.25);
}

.pg-portal-city::after {
  width: 8px;
  height: 18px;
  margin-inline-start: 8px;
}

.pg-style-cosmos .pg-portal-city::before,
.pg-style-cosmos .pg-portal-city::after {
  background: linear-gradient(to top, rgba(251, 146, 60, 0.65), rgba(45, 212, 191, 0.2));
  border-color: rgba(251, 146, 60, 0.35);
  box-shadow:
    18px 0 0 0 rgba(251, 146, 60, 0.55),
    18px 0 0 1px rgba(251, 146, 60, 0.3),
    36px -8px 0 0 rgba(45, 212, 191, 0.5),
    36px -8px 0 1px rgba(45, 212, 191, 0.3),
    -18px 4px 0 0 rgba(251, 146, 60, 0.5),
    -18px 4px 0 1px rgba(251, 146, 60, 0.3);
}

.pg-portal-avatar {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #67e8f9, #0284c7);
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.5);
}

.pg-style-cosmos .pg-portal-avatar {
  background: radial-gradient(circle at 35% 30%, #fb923c, #c2410c);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.55);
}

/* Float icons / tiles — CSS glyphs, hide emoji */
.pg-float-icon,
.pg-float-tile {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  animation: pg-float-bob 4.5s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}

.pg-float-glyph {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 0;
  background: rgba(6, 10, 22, 0.72);
  border: 1px solid rgba(6, 182, 212, 0.45);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 0 16px rgba(6, 182, 212, 0.15);
  position: relative;
  overflow: hidden;
}

.pg-float-glyph::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--pg-accent, #06b6d4), var(--pg-accent-2, #f97316));
  opacity: 0.85;
}

.pg-float-icon:nth-child(odd) .pg-float-glyph::before {
  border-radius: 50%;
  width: 16px;
  height: 16px;
}

.pg-float-icon:nth-child(3n) .pg-float-glyph {
  border-color: rgba(249, 115, 22, 0.45);
}

.pg-float-icon:nth-child(3n) .pg-float-glyph::before {
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  border-radius: 0;
}

.pg-float-icon-lg .pg-float-glyph {
  width: 48px;
  height: 48px;
  border-color: rgba(251, 146, 60, 0.5);
  box-shadow: 0 0 20px rgba(249, 115, 22, 0.2);
}

.pg-float-label {
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(240, 244, 255, 0.6);
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

/* ── COSMOS debris ── */
.pg-debris {
  position: absolute;
  width: calc(3px + var(--i, 0) * 0.5px);
  height: calc(2px + var(--i, 0) * 0.4px);
  background: linear-gradient(135deg, rgba(251, 146, 60, 0.7), rgba(45, 212, 191, 0.5));
  border-radius: 40% 60% 50% 50%;
  opacity: calc(0.3 + var(--i, 0) * 0.06);
  animation: pg-debris-drift calc(8s + var(--i, 0) * 1.2s) ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * -0.7s);
}

.pg-style-cosmos .pg-debris:nth-child(1) { top: 8%;  left: 5%; }
.pg-style-cosmos .pg-debris:nth-child(2) { top: 15%; right: 8%; }
.pg-style-cosmos .pg-debris:nth-child(3) { top: 25%; left: 3%; }
.pg-style-cosmos .pg-debris:nth-child(4) { top: 12%; right: 18%; }
.pg-style-cosmos .pg-debris:nth-child(5) { bottom: 35%; left: 8%; }
.pg-style-cosmos .pg-debris:nth-child(6) { bottom: 28%; right: 6%; }
.pg-style-cosmos .pg-debris:nth-child(7) { top: 45%; left: 2%; }
.pg-style-cosmos .pg-debris:nth-child(8) { bottom: 15%; right: 12%; }

/* ═══════════════════════════════════════════════════════════════════════════
   STYLE SWITCHER
   ═══════════════════════════════════════════════════════════════════════════ */

.pg-style-strip {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.pg-style-chip {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: rgba(6, 10, 22, 0.6);
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s;
}

.pg-style-chip:hover {
  border-color: rgba(103, 232, 249, 0.45);
}

.pg-style-chip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
}

.pg-style-orbit .pg-style-chip-dot  { background: linear-gradient(135deg, #22d3ee, #a78bfa); }
.pg-style-nexus .pg-style-chip-dot  { background: linear-gradient(135deg, #38bdf8, #6366f1); }
.pg-style-ring .pg-style-chip-dot   { background: linear-gradient(135deg, #06b6d4, #f97316); }
.pg-style-cosmos .pg-style-chip-dot { background: linear-gradient(135deg, #2dd4bf, #f97316); }

.pg-style-chip.is-active {
  border-color: var(--pg-accent, #67e8f9);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.45);
  transform: scale(1.15);
}

/* ═══════════════════════════════════════════════════════════════════════════
   PER-STYLE LAYOUT & VISUAL OVERRIDES
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── ORBIT (Metaverse) ── */
.pg-style-orbit .pg-hud-frame {
  width: min(960px, 96vw);
  margin-top: clamp(2.5rem, 6vh, 4rem);
  transform: rotateX(4deg);
  transform-origin: 50% 20%;
}

.pg-style-orbit .pg-hud-glass {
  border-radius: 28px 28px 48px 48px;
  border-color: rgba(167, 139, 250, 0.28);
  box-shadow:
    0 32px 100px rgba(0, 0, 0, 0.6),
    0 0 80px rgba(168, 85, 247, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.pg-style-orbit .pg-hud-titles {
  display: none;
}

.pg-style-orbit .pg-hud-auth {
  display: flex;
}

.pg-style-orbit .pg-auth-row-below {
  display: none;
}

.pg-style-orbit .pg-hud-side {
  display: flex;
}

.pg-style-orbit .pg-search-hero-glow {
  background: radial-gradient(ellipse, rgba(168, 85, 247, 0.45) 0%, rgba(34, 211, 238, 0.25) 50%, transparent 70%);
}

.pg-style-orbit .pg-search-hero {
  border-radius: 999px;
  border-color: rgba(167, 139, 250, 0.4);
  box-shadow: 0 0 36px rgba(168, 85, 247, 0.2);
}

.pg-style-orbit .pg-auth-system {
  border-color: rgba(255, 255, 255, 0.45);
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  box-shadow: none;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pg-style-orbit .pg-auth-gallery {
  border-color: rgba(34, 211, 238, 0.75);
  background: rgba(6, 20, 36, 0.45);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pg-style-orbit .pg-hud-corner-tl,
.pg-style-orbit .pg-hud-corner-tr,
.pg-style-orbit .pg-hud-corner-bl,
.pg-style-orbit .pg-hud-corner-br {
  border-color: rgba(167, 139, 250, 0.55);
}

/* ── NEXUS (ARX) ── */
.pg-style-nexus .pg-hud-frame {
  width: min(900px, 94vw);
  margin-top: clamp(3rem, 7vh, 5rem);
}

.pg-style-nexus .pg-hud-glass {
  border-radius: 24px 24px 40px 40px;
  border-color: rgba(56, 189, 248, 0.32);
  background: rgba(6, 10, 22, 0.72) !important;
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.55),
    0 0 70px rgba(56, 189, 248, 0.1);
  transform: perspective(900px) rotateX(3deg);
}

.pg-style-nexus .pg-hud-auth {
  display: none;
}

.pg-style-nexus .pg-auth-row-below {
  display: flex;
}

.pg-style-nexus .pg-hud-side {
  display: none;
}

.pg-style-nexus .pg-hud-titles {
  display: block;
}

.pg-style-nexus .pg-search-hero-glow {
  background: radial-gradient(ellipse, rgba(147, 51, 234, 0.5) 0%, rgba(99, 102, 241, 0.25) 55%, transparent 75%);
  opacity: 0.7;
}

.pg-style-nexus .pg-search-hero {
  border-color: rgba(147, 51, 234, 0.4);
  box-shadow: 0 0 32px rgba(147, 51, 234, 0.22);
}

.pg-style-nexus .pg-hud-corner-tl,
.pg-style-nexus .pg-hud-corner-tr,
.pg-style-nexus .pg-hud-corner-bl,
.pg-style-nexus .pg-hud-corner-br {
  border-color: rgba(56, 189, 248, 0.5);
}

.pg-style-nexus .pg-hud-brand {
  position: absolute;
  top: -2.8rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(6, 10, 22, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0.45rem 1.2rem;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.portal-gateway-shell.pg-style-nexus.is-rtl .pg-hud-brand {
  transform: translateX(50%);
}

/* ── RING ── */
.pg-style-ring .pg-hud-frame {
  width: min(880px, 92vw);
  margin-top: clamp(3rem, 7vh, 4.5rem);
  transform: none;
  animation: none;
}

.pg-style-ring .pg-hud-glass {
  border-radius: 4px;
  border: 2px solid rgba(6, 182, 212, 0.65);
  box-shadow:
    0 0 24px rgba(6, 182, 212, 0.25),
    0 24px 80px rgba(0, 0, 0, 0.5),
    inset 0 0 40px rgba(6, 182, 212, 0.04);
}

.pg-style-ring .pg-hud-auth {
  display: flex;
}

.pg-style-ring .pg-auth-row-below {
  display: none;
}

.pg-style-ring .pg-hud-titles {
  display: block;
}

.pg-style-ring .pg-search-hero-glow {
  background: radial-gradient(ellipse, rgba(6, 182, 212, 0.4) 0%, transparent 70%);
}

.pg-style-ring .pg-hud-corner-tl,
.pg-style-ring .pg-hud-corner-tr,
.pg-style-ring .pg-hud-corner-bl,
.pg-style-ring .pg-hud-corner-br {
  width: 24px;
  height: 24px;
  border-width: 3px;
  border-color: rgba(6, 182, 212, 0.8);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.35);
}

/* ── COSMOS ── */
.pg-style-cosmos .pg-hud-frame {
  width: min(880px, 92vw);
  margin-top: clamp(2.8rem, 6vh, 4rem);
  transform: none;
}

.pg-style-cosmos .pg-hud-glass {
  border-radius: 6px;
  border: 2px solid rgba(251, 146, 60, 0.45);
  box-shadow:
    0 0 40px rgba(249, 115, 22, 0.28),
    0 24px 80px rgba(0, 0, 0, 0.55),
    inset 0 0 50px rgba(251, 146, 60, 0.04);
}

.pg-style-cosmos .pg-hud-auth {
  display: flex;
}

.pg-style-cosmos .pg-auth-row-below {
  display: none;
}

.pg-style-cosmos .pg-hud-titles {
  display: block;
}

.pg-style-cosmos .pg-search-hero-glow {
  background: radial-gradient(ellipse, rgba(249, 115, 22, 0.55) 0%, rgba(45, 212, 191, 0.2) 50%, transparent 75%);
  opacity: 0.75;
}

.pg-style-cosmos .pg-search-hero {
  border-color: rgba(251, 146, 60, 0.45);
  box-shadow: 0 0 36px rgba(249, 115, 22, 0.25);
}

.pg-style-cosmos .pg-hud-corner-tl,
.pg-style-cosmos .pg-hud-corner-tr,
.pg-style-cosmos .pg-hud-corner-bl,
.pg-style-cosmos .pg-hud-corner-br {
  border-color: rgba(251, 146, 60, 0.65);
}

.pg-style-cosmos .pg-hud-titles h1 {
  background: linear-gradient(135deg, #fed7aa 0%, #fb923c 50%, #2dd4bf 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESULTS, SUGGESTIONS & PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

.pg-results-panel,
.pg-ref-panel {
  width: min(880px, 92vw);
  max-height: 38vh;
  overflow-y: auto;
  margin-top: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(103, 232, 249, 0.3) transparent;
}

.pg-results-panel:empty,
.pg-ref-panel:empty {
  display: none;
}

.pg-suggest {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0.35rem;
  border-radius: 14px;
  border: 1px solid rgba(103, 232, 249, 0.22);
  background: rgba(6, 10, 22, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 56px rgba(0, 0, 0, 0.65);
  max-height: 260px;
  overflow-y: auto;
}

.pg-suggest-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--pg-text);
  text-align: start;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.pg-suggest-item:hover,
.pg-suggest-item.is-active {
  background: rgba(103, 232, 249, 0.1);
}

.pg-suggest-body {
  flex: 1;
  min-width: 0;
}

.pg-suggest-body strong {
  font-size: 0.85rem;
  display: block;
  font-weight: 600;
}

.pg-suggest-body small {
  font-size: 0.72rem;
  color: var(--pg-muted);
  display: block;
  margin-top: 0.1rem;
}

.pg-suggest-kind {
  font-size: 0.65rem;
  color: var(--pg-accent, #67e8f9);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pg-suggest-glyph {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(103, 232, 249, 0.12);
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.pg-hint,
.pg-empty {
  text-align: center;
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  background: rgba(6, 10, 22, 0.92);
  border: 1px solid rgba(103, 232, 249, 0.2);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.pg-hint.is-error {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(40, 8, 8, 0.85);
}

.pg-loading {
  display: flex;
  justify-content: center;
  padding: 1.2rem;
}

.pg-results {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pg-section h2 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pg-accent, #67e8f9);
  margin: 0 0 0.45rem;
}

.pg-org-grid,
.pg-product-grid,
.pg-service-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pg-card {
  border-radius: 14px;
  border: 1px solid rgba(103, 232, 249, 0.16);
  background: rgba(6, 10, 22, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.8rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pg-card:hover {
  border-color: rgba(103, 232, 249, 0.28);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.pg-org-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: center;
}

.pg-org-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(103, 232, 249, 0.1);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--pg-accent, #67e8f9);
  flex-shrink: 0;
}

.pg-org-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pg-org-meta h3 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
}

.pg-org-meta p {
  margin: 0.12rem 0 0;
  font-size: 0.72rem;
  color: var(--pg-muted);
}

.pg-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.pg-chip {
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(103, 232, 249, 0.4);
  background: rgba(34, 211, 238, 0.08);
  color: #e0f2fe;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background 0.15s, transform 0.15s;
}

.pg-chip:hover {
  background: rgba(34, 211, 238, 0.16);
  transform: translateY(-1px);
}

.pg-chip.is-ghost {
  border-color: rgba(255, 255, 255, 0.18);
  background: transparent;
  color: var(--pg-muted);
}

.pg-product-card {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 0.7rem;
}

.pg-product-visual {
  width: 68px;
  height: 68px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(103, 232, 249, 0.08);
  display: grid;
  place-items: center;
}

.pg-product-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pg-product-fallback {
  color: var(--pg-accent, #67e8f9);
  font-size: 1.2rem;
}

.pg-product-body h3 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
}

.pg-offer-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.45rem;
  align-items: center;
  padding: 0.32rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
}

.pg-offer-org {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.pg-offer-org img {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  flex-shrink: 0;
}

.pg-offer-price strong {
  color: var(--pg-accent, #67e8f9);
}

.pg-service-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
}

.pg-service-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(103, 232, 249, 0.1);
  display: grid;
  place-items: center;
  color: var(--pg-accent, #67e8f9);
  font-size: 0.9rem;
}

.pg-service-cat {
  margin: 0;
  font-size: 0.65rem;
  color: var(--pg-accent, #67e8f9);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pg-service-card h3 {
  margin: 0.1rem 0;
  font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LEGACY pg-ref-* ALIASES (backward compat with current markup)
   ═══════════════════════════════════════════════════════════════════════════ */

.pg-ref-tools {
  position: fixed;
  top: clamp(0.4rem, 1.2vw, 0.75rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(6, 10, 22, 0.82);
  border: 1px solid rgba(103, 232, 249, 0.28);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.pg-ref-mask-brand {
  position: fixed;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 10px;
  background: rgba(6, 10, 22, 0.92);
  border: 1px solid rgba(103, 232, 249, 0.35);
  box-shadow: 0 0 28px rgba(34, 211, 238, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #e0f2fe;
  white-space: nowrap;
}

.pg-ref-mask-brand img {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.5));
}

.pg-ref-mask-brand strong {
  color: #67e8f9;
  font-weight: 800;
}

.pg-ref-auth {
  position: fixed;
  z-index: 16;
  display: flex;
  gap: 0.45rem;
  flex-wrap: nowrap;
}

.pg-ref-btn {
  padding: 0.42rem 0.95rem;
  border-radius: 999px;
  font-size: clamp(0.68rem, 1.6vw, 0.78rem);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.pg-ref-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pg-ref-btn-system {
  border: 1px solid rgba(103, 232, 249, 0.75);
  background: rgba(4, 12, 24, 0.55);
  color: #e0f2fe;
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.25);
}

.pg-ref-btn-gallery {
  border: 1px solid rgba(232, 121, 249, 0.75);
  background: linear-gradient(135deg, rgba(126, 34, 206, 0.5), rgba(190, 24, 93, 0.4));
  color: #fdf4ff;
  box-shadow: 0 0 22px rgba(232, 121, 249, 0.3);
}

.pg-ref-btn:hover:not(:disabled) { transform: translateY(-1px); }

.pg-ref-search {
  position: fixed;
  z-index: 14;
  left: 50%;
  transform: translateX(-50%);
}

.pg-ref-search-inner {
  display: block;
  position: relative;
}

.pg-ref-search-input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: rgba(248, 250, 252, 0.92);
  font-size: clamp(0.78rem, 1.8vw, 0.92rem);
  font-family: inherit;
  padding: 0.7rem 1rem;
  caret-color: #67e8f9;
}

.pg-ref-search-input::placeholder {
  color: rgba(248, 250, 252, 0.42);
}

.pg-ref-search-clear {
  position: absolute;
  inset-inline-end: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.pg-ref-panel {
  position: fixed;
  z-index: 12;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.pg-ref-panel > * { pointer-events: auto; }

/* Legacy per-style positioning */
.pg-style-orbit .pg-ref-mask-brand { display: none; }
.pg-style-orbit .pg-ref-auth-header { top: 5.5%; inset-inline-end: 5%; }
.pg-style-orbit .pg-ref-auth-below { display: none; }
.pg-style-orbit .pg-ref-search { top: 44%; width: min(480px, 58vw); height: 46px; }
.pg-style-orbit .pg-ref-panel { top: 54%; }
.pg-style-orbit .pg-ref-btn-system {
  border-color: rgba(255, 255, 255, 0.5);
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  box-shadow: none;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.pg-style-orbit .pg-ref-btn-gallery {
  border-color: rgba(34, 211, 238, 0.8);
  background: rgba(6, 20, 36, 0.4);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pg-style-nexus .pg-ref-mask-brand {
  top: 15.5%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1.4rem;
  font-size: 0.85rem;
}
.pg-style-nexus.is-rtl .pg-ref-mask-brand { transform: translateX(50%); }
.pg-style-nexus .pg-ref-auth-header { display: none; }
.pg-style-nexus .pg-ref-auth-below { top: 49.5%; left: 50%; transform: translateX(-50%); }
.pg-style-nexus.is-rtl .pg-ref-auth-below { transform: translateX(50%); }
.pg-style-nexus .pg-ref-search { top: 37%; width: min(520px, 62vw); height: 44px; }
.pg-style-nexus .pg-ref-panel { top: 58%; }

.pg-style-ring .pg-ref-mask-brand { top: 7%; inset-inline-start: 7%; }
.pg-style-ring .pg-ref-auth-header { top: 6.5%; inset-inline-end: 6%; }
.pg-style-ring .pg-ref-auth-below { display: none; }
.pg-style-ring .pg-ref-search { top: 41%; width: min(500px, 60vw); height: 42px; }
.pg-style-ring .pg-ref-panel { top: 52%; }

.pg-style-cosmos .pg-ref-mask-brand { top: 5.5%; inset-inline-start: 5.5%; }
.pg-style-cosmos .pg-ref-auth-header { top: 5%; inset-inline-end: 5%; }
.pg-style-cosmos .pg-ref-auth-below { display: none; }
.pg-style-cosmos .pg-ref-search { top: 37.5%; width: min(510px, 61vw); height: 42px; }
.pg-style-cosmos .pg-ref-panel { top: 48%; max-height: 34vh; }

/* Hide legacy ref-bg if present in DOM */
.pg-ref-bg,
.pg-ref-shimmer {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   RTL SUPPORT
   ═══════════════════════════════════════════════════════════════════════════ */

.portal-gateway-shell.is-rtl .pg-ref-tools {
  transform: translateX(50%);
}

.portal-gateway-shell.is-rtl .pg-suggest-body,
.portal-gateway-shell.is-rtl .pg-org-meta,
.portal-gateway-shell.is-rtl .pg-hud-titles {
  text-align: start;
}

.portal-gateway-shell.is-rtl .pg-hud-head {
  flex-direction: row-reverse;
}

.portal-gateway-shell.is-rtl .pg-search-hero {
  flex-direction: row-reverse;
}

.portal-gateway-shell.is-rtl .pg-auth-row-below,
.portal-gateway-shell.is-rtl .pg-hud-auth {
  flex-direction: row-reverse;
}

.portal-gateway-shell.is-rtl .pg-orbit-label {
  direction: rtl;
}

.portal-gateway-shell.is-rtl .pg-iso-label,
.portal-gateway-shell.is-rtl .pg-float-label {
  direction: rtl;
}

.portal-gateway-shell.is-rtl .pg-vr-figure {
  right: auto;
  left: 2%;
  transform: scaleX(-1);
}

.portal-gateway-shell.is-rtl .pg-vr-silhouette {
  right: auto;
  left: 12%;
}

.portal-gateway-shell.is-rtl .pg-planet-earth,
.portal-gateway-shell.is-rtl .pg-planet-blue {
  right: auto;
  left: 8%;
}

.portal-gateway-shell.is-rtl .pg-planet-ring {
  left: auto;
  right: 6%;
}

.portal-gateway-shell.is-rtl .pg-offer-row {
  direction: rtl;
}

.portal-gateway-shell.is-rtl .pg-card-actions {
  align-items: flex-start;
}

/* ═══════════════════════════════════════════════════════════════════════════
   KEYFRAME ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes pg-stars-twinkle {
  0%, 100% { opacity: 0.75; }
  50% { opacity: 1; }
}

@keyframes pg-stars-drift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-40px, -30px); }
}

@keyframes pg-aurora {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 0.75;
  }
  50% {
    transform: translate(calc(var(--pg-mx) * 12px), calc(var(--pg-my) * 8px)) scale(1.06);
    opacity: 0.95;
  }
  100% {
    transform: translate(-2%, 1%) scale(1.03);
    opacity: 0.8;
  }
}

@keyframes pg-cloud-drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(3%, -2%) scale(1.08); }
}

@keyframes pg-orange-pulse {
  0%, 100% { opacity: 0.85; filter: blur(36px); }
  50% { opacity: 1; filter: blur(42px); }
}

@keyframes pg-lens-pulse {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.08); }
}

@keyframes pg-planet-rotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pg-galaxy-spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes pg-asteroid-float {
  0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); }
  50% { transform: translateY(-8px) rotate(calc(var(--r, 0deg) + 15deg)); }
}

@keyframes pg-vr-glow {
  0%, 100% { opacity: 0.5; filter: drop-shadow(0 0 20px rgba(251, 146, 60, 0.3)); }
  50% { opacity: 0.75; filter: drop-shadow(0 0 36px rgba(251, 146, 60, 0.55)); }
}

@keyframes pg-hud-float {
  0%, 100% { transform: translateY(0) rotateX(4deg); }
  50% { transform: translateY(-6px) rotateX(4deg); }
}

@keyframes pg-logo-ring-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pg-meter-pulse {
  0%, 100% { opacity: 0.5; transform: scaleY(0.85); }
  50% { opacity: 1; transform: scaleY(1); }
}

@keyframes pg-search-glow {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.04); }
}

@keyframes pg-orbit-spin {
  0% { transform: translate(-50%, -50%) rotateX(68deg) rotateZ(0deg); }
  100% { transform: translate(-50%, -50%) rotateX(68deg) rotateZ(360deg); }
}

@keyframes pg-orbit-track-pulse {
  0%, 100% { opacity: 0.6; box-shadow: 0 0 40px rgba(34, 211, 238, 0.08); }
  50% { opacity: 1; box-shadow: 0 0 60px rgba(34, 211, 238, 0.15); }
}

@keyframes pg-cube-float {
  0%, 100% { transform: translateY(0) rotateX(-12deg) rotateY(18deg); }
  50% { transform: translateY(-6px) rotateX(-8deg) rotateY(24deg); }
}

@keyframes pg-platform-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

@keyframes pg-portal-pulse {
  0%, 100% {
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.35), inset 0 0 30px rgba(6, 182, 212, 0.12);
    transform: translateX(-50%) scale(1);
  }
  50% {
    box-shadow: 0 0 60px rgba(6, 182, 212, 0.5), inset 0 0 40px rgba(6, 182, 212, 0.18);
    transform: translateX(-50%) scale(1.03);
  }
}

@keyframes pg-float-bob {
  0%, 100% { transform: translate(-50%, -50%) translateY(0); }
  50% { transform: translate(-50%, -50%) translateY(-10px); }
}

@keyframes pg-debris-drift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); opacity: 0.4; }
  33% { transform: translate(6px, -12px) rotate(45deg); opacity: 0.7; }
  66% { transform: translate(-4px, -6px) rotate(-30deg); opacity: 0.55; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE — 720px breakpoint
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 720px) {
  .pg-hud-frame {
    width: 96vw;
    margin-top: clamp(4rem, 10vh, 5rem);
    perspective: none;
    transform: none !important;
    animation: none;
  }

  .pg-hud-glass {
    border-radius: 16px !important;
    transform: none !important;
  }

  .pg-hud-head {
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.6rem 0.75rem;
    gap: 0.5rem;
  }

  .pg-hud-auth,
  .pg-auth-row-below,
  .pg-ref-auth-header,
  .pg-ref-auth-below {
    flex-direction: column;
    align-items: stretch;
    width: min(280px, 88vw);
  }

  .pg-hud-side {
    display: none !important;
  }

  .pg-style-orbit .pg-hud-side {
    display: none !important;
  }

  .pg-ref-tools {
    left: 0.5rem;
    right: 0.5rem;
    transform: none;
    justify-content: center;
    flex-wrap: wrap;
  }

  .portal-gateway-shell.is-rtl .pg-ref-tools {
    transform: none;
  }

  .pg-style-orbit .pg-ref-auth-header {
    top: auto;
    bottom: 1rem;
    inset-inline-end: 50%;
    transform: translateX(50%);
  }

  .portal-gateway-shell.is-rtl.pg-style-orbit .pg-ref-auth-header {
    transform: translateX(-50%);
  }

  .pg-style-nexus .pg-ref-auth-below,
  .pg-style-nexus .pg-auth-row-below {
    width: min(300px, 88vw);
  }

  .pg-style-nexus .pg-hud-brand {
    position: static;
    transform: none;
    margin-bottom: 0.5rem;
  }

  .pg-search-hero-wrap {
    width: 100%;
  }

  .pg-orbit-spinner,
  .pg-orbit-track {
    width: 92vw;
    height: 18vh;
  }

  .pg-orbit-node {
    transform: rotate(calc(var(--a, 0) * 1deg)) translateX(42vw) rotate(calc(var(--a, 0) * -1deg));
  }

  .pg-cube {
    width: 32px;
    height: 32px;
    top: -16px;
    left: -16px;
  }

  .pg-cube-face.f1 { transform: translateZ(16px); }
  .pg-cube-face.f2 { transform: rotateY(90deg) translateZ(16px); }
  .pg-cube-face.f3 { transform: rotateX(90deg) translateZ(16px); }

  .pg-orbit-label {
    font-size: 0.52rem;
  }

  .pg-deco-nexus {
    height: 22vh;
  }

  .pg-iso-block {
    width: 40px;
    height: 28px;
  }

  .pg-iso-label {
    font-size: 0.5rem;
  }

  .pg-portal-ring {
    width: min(220px, 70vw);
    height: min(220px, 70vw);
    bottom: 4%;
  }

  .pg-portal-ring-lg {
    width: min(280px, 78vw);
    height: min(280px, 78vw);
  }

  .pg-float-glyph {
    width: 34px;
    height: 34px;
  }

  .pg-float-glyph::before {
    width: 14px;
    height: 14px;
  }

  .pg-float-label {
    display: none;
  }

  .pg-vr-figure {
    width: min(20vw, 90px);
    height: min(28vh, 200px);
    opacity: 0.45;
  }

  .pg-planet-ring,
  .pg-planet-earth,
  .pg-planet-blue {
    transform: scale(0.75);
  }

  .pg-galaxy {
    width: min(30vw, 140px);
    height: min(30vw, 140px);
  }

  .pg-org-card,
  .pg-service-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .pg-org-logo {
    margin-inline: auto;
  }

  .pg-card-actions {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }

  .pg-offer-row {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .pg-product-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .pg-product-visual {
    margin-inline: auto;
  }

  .pg-results-panel,
  .pg-ref-panel {
    max-height: 42vh;
    width: 94vw;
  }

  .pg-style-orbit .pg-ref-search,
  .pg-style-nexus .pg-ref-search,
  .pg-style-ring .pg-ref-search,
  .pg-style-cosmos .pg-ref-search {
    width: min(340px, 88vw);
  }
}

@media (min-width: 721px) and (max-width: 1024px) {
  .pg-hud-frame {
    width: min(860px, 92vw);
  }

  .pg-hud-side {
    padding: 0.75rem 0.5rem;
  }

  .pg-hud-dot-ring {
    width: 30px;
    height: 30px;
  }
}

@media (min-width: 1400px) {
  .pg-scene {
    transform: translate(
      calc(var(--pg-mx) * 10px),
      calc(var(--pg-my) * 6px)
    );
  }

  .pg-hud-frame {
    width: min(980px, 88vw);
  }

  .pg-orbit-spinner,
  .pg-orbit-track {
    width: 720px;
    height: 240px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PREFERS REDUCED MOTION
   ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .pg-scene,
  .pg-scene-stars,
  .pg-scene-stars::before,
  .pg-scene-stars::after,
  .pg-scene-nebula,
  .pg-nebula-cloud,
  .pg-lens,
  .pg-planet-gas,
  .pg-galaxy,
  .pg-asteroid,
  .pg-vr-silhouette,
  .pg-vr-figure,
  .pg-hud-frame,
  .pg-hud-logo-ring,
  .pg-hud-dot-ring::after,
  .pg-hud-meter,
  .pg-search-hero-glow,
  .pg-orbit-spinner,
  .pg-orbit-track,
  .pg-cube,
  .pg-iso-platform,
  .pg-portal-ring,
  .pg-portal-ring::before,
  .pg-float-icon,
  .pg-float-tile,
  .pg-debris {
    animation: none !important;
    transition: none !important;
  }

  .pg-scene {
    transform: none !important;
  }

  .pg-cube {
    transform: rotateX(-10deg) rotateY(15deg);
  }

  .pg-style-orbit .pg-hud-frame {
    transform: rotateX(2deg);
  }

  .pg-style-nexus .pg-hud-glass {
    transform: perspective(900px) rotateX(2deg);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACCESSIBILITY & FOCUS
   ═══════════════════════════════════════════════════════════════════════════ */

.pg-search-hero-input:focus-visible,
.pg-ref-search-input:focus-visible {
  outline: 2px solid rgba(103, 232, 249, 0.5);
  outline-offset: 2px;
  border-radius: 4px;
}

.pg-auth-btn:focus-visible,
.pg-ref-btn:focus-visible,
.pg-style-chip:focus-visible,
.pg-chip:focus-visible,
.pg-suggest-item:focus-visible {
  outline: 2px solid rgba(103, 232, 249, 0.65);
  outline-offset: 2px;
}

.pg-scene,
.pg-deco-orbit,
.pg-deco-nexus,
.pg-deco-ring,
.pg-deco-cosmos,
.pg-vr-figure,
.pg-vr-silhouette {
  user-select: none;
}

/* High-contrast text on cards */
.pg-card[data-look="luxury"] {
  border-color: rgba(251, 191, 36, 0.3);
}

.pg-card[data-look="modern"] {
  border-color: rgba(56, 189, 248, 0.3);
}

.pg-card[data-look="classic"] {
  border-color: rgba(167, 139, 250, 0.3);
}

.pg-offer-row[data-look="luxury"] .pg-offer-price strong {
  color: #fbbf24;
}

/* Print — hide decorative layers */
@media print {
  .pg-scene,
  .pg-deco-orbit,
  .pg-deco-nexus,
  .pg-deco-ring,
  .pg-deco-cosmos,
  .pg-vr-figure,
  .pg-hud-side,
  .pg-ref-tools,
  .pg-style-strip {
    display: none !important;
  }

  .portal-gateway-shell {
    background: #fff;
    color: #000;
  }

  .pg-hud-glass {
    background: #fff !important;
    border: 1px solid #ccc;
    box-shadow: none;
  }
}

/* ── Extensions: orbit diamond, cube sizes, nexus tag, tile glyphs ── */
.pg-hud-tag-en {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(240, 244, 255, 0.55);
}

.pg-style-orbit .pg-hud-tag-en,
.pg-style-ring .pg-hud-tag-en,
.pg-style-cosmos .pg-hud-tag-en {
  display: none;
}

.pg-style-nexus .pg-hud-tag-en {
  display: block;
}

.pg-orbit-node {
  transform: rotate(calc(var(--a, 0) * 1deg)) translateX(min(calc(var(--r, 340) * 1px), 44vw)) rotate(calc(var(--a, 0) * -1deg));
}

.pg-cube.c-lg {
  width: 56px;
  height: 56px;
  top: -28px;
  left: -28px;
}

.pg-cube.c-lg .pg-cube-face.f1 { transform: translateZ(28px); }
.pg-cube.c-lg .pg-cube-face.f2 { transform: rotateY(90deg) translateZ(28px); }
.pg-cube.c-lg .pg-cube-face.f3 { transform: rotateX(90deg) translateZ(28px); }
.pg-cube.c-lg .pg-cube-face.f4 { transform: rotateY(180deg) translateZ(28px); }
.pg-cube.c-lg .pg-cube-face.f5 { transform: rotateY(-90deg) translateZ(28px); }
.pg-cube.c-lg .pg-cube-face.f6 { transform: rotateX(-90deg) translateZ(28px); }

.pg-cube.c-xl {
  width: 64px;
  height: 64px;
  top: -32px;
  left: -32px;
}

.pg-cube.c-xl .pg-cube-face.f1 { transform: translateZ(32px); }
.pg-cube.c-xl .pg-cube-face.f2 { transform: rotateY(90deg) translateZ(32px); }
.pg-cube.c-xl .pg-cube-face.f3 { transform: rotateX(90deg) translateZ(32px); }
.pg-cube.c-xl .pg-cube-face.f4 { transform: rotateY(180deg) translateZ(32px); }
.pg-cube.c-xl .pg-cube-face.f5 { transform: rotateY(-90deg) translateZ(32px); }
.pg-cube.c-xl .pg-cube-face.f6 { transform: rotateX(-90deg) translateZ(32px); }

.pg-diamond {
  position: absolute;
  top: -32px;
  left: -32px;
  width: 64px;
  height: 64px;
  transform-style: preserve-3d;
  animation: pg-cube-float 4s ease-in-out infinite;
  transform: rotateX(45deg) rotateZ(45deg);
}

.pg-diamond-face {
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  backface-visibility: visible;
}

.pg-diamond.c-gold .pg-diamond-face {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.95), rgba(245, 158, 11, 0.65));
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.55);
}

.pg-diamond-face.f1 { transform: translateZ(24px); }
.pg-diamond-face.f2 { transform: rotateY(90deg) translateZ(24px); }
.pg-diamond-face.f3 { transform: rotateX(90deg) translateZ(24px); }
.pg-diamond-face.f4 { transform: rotateX(-90deg) translateZ(24px); }

.pg-float-glyph.t-fashion::before { clip-path: polygon(30% 0%, 70% 0%, 100% 40%, 70% 100%, 30% 100%, 0% 40%); border-radius: 0; }
.pg-float-glyph.t-tech::before { border-radius: 2px; width: 22px; height: 14px; }
.pg-float-glyph.t-gaming::before { clip-path: polygon(0 35%, 35% 35%, 35% 0, 65% 0, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0 65%); border-radius: 0; }
.pg-float-glyph.t-vr::before { border-radius: 50%; width: 20px; height: 12px; }
.pg-float-glyph.t-food::before { border-radius: 50% 50% 4px 4px; width: 18px; height: 14px; background: linear-gradient(#f97316, #ea580c); }
.pg-float-glyph.t-health::before { clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); border-radius: 0; background: #ef4444; }
.pg-float-glyph.t-shop::before { width: 16px; height: 18px; border-radius: 2px 2px 0 0; }
.pg-float-glyph.t-cafe::before { border-radius: 50%; width: 14px; height: 14px; background: #92400e; }

.pg-style-orbit .pg-hud-brand {
  display: none;
}

.pg-style-orbit .pg-hud-head {
  justify-content: space-between;
  border-bottom: none;
  padding-bottom: 0.35rem;
}

.pg-style-orbit .pg-hud-tools {
  position: absolute;
  left: 50%;
  top: 0.85rem;
  transform: translateX(-50%);
  z-index: 3;
}

.portal-gateway-shell.pg-style-orbit.is-rtl .pg-hud-tools {
  transform: translateX(50%);
}

.pg-style-orbit .pg-hud-frame {
  width: min(1280px, 96vw);
  margin-top: clamp(1.2rem, 3vh, 2rem);
}

.pg-style-orbit .pg-hud-glass {
  min-height: min(640px, 76vh);
  border-radius: 40px 40px 140px 140px / 40px 40px 100px 100px;
  padding-bottom: 0.5rem;
}

.pg-style-orbit .pg-hud-body {
  padding-top: clamp(2rem, 5vh, 3rem);
  min-height: min(520px, 62vh);
  justify-content: center;
}

.pg-style-orbit .pg-search-hero-wrap {
  width: min(540px, 78%);
}

.pg-style-orbit .pg-search-grid-icon {
  display: none;
}

.pg-style-orbit .pg-search-hero-input {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: clamp(0.72rem, 1.6vw, 0.86rem);
}

.pg-style-orbit .pg-cube {
  animation: pg-cube-spin 12s linear infinite, pg-cube-float 4s ease-in-out infinite;
}

@keyframes pg-cube-spin {
  from { transform: rotateX(-18deg) rotateY(0deg); }
  to { transform: rotateX(-18deg) rotateY(360deg); }
}
