/* ---------- PROFILE STAGE SHARED CHROME ---------- */

.me-page-shell,
.player-page-shell {
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--profile-stage-page-background);
}

.me-page-shell .arcade-shell,
.player-page-shell .arcade-shell {
  width: 100%;
  min-height: 100vh;
  padding: 0;
}

.me-page-shell::before,
.player-page-shell::before {
  background: var(--profile-stage-page-overlay);
}

.me-stage,
.player-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 18px;
  width: 100%;
  min-height: 100vh;
  padding: 18px clamp(16px, 4vw, 36px) 42px;
  background: var(--profile-stage-background);
}

.me-stage::before,
.player-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at 50% 42%, rgba(255, 177, 165, 0.14), transparent 18%);
  pointer-events: none;
  z-index: 1;
}

.me-stage::after,
.player-stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46%;
  background: var(--profile-stage-floor-fade);
  pointer-events: none;
  z-index: 0;
}

.me-stage__stars,
.player-stage__stars {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 8% 12%, rgba(153, 255, 255, 0.95) 0 1px, transparent 1.8px),
    radial-gradient(circle at 16% 28%, rgba(255, 232, 167, 0.95) 0 1.2px, transparent 2px),
    radial-gradient(circle at 24% 19%, rgba(255, 255, 255, 0.82) 0 1px, transparent 1.8px),
    radial-gradient(circle at 40% 26%, rgba(153, 255, 255, 0.82) 0 1.1px, transparent 2px),
    radial-gradient(circle at 58% 15%, rgba(255, 255, 255, 0.86) 0 1px, transparent 1.8px),
    radial-gradient(circle at 66% 31%, rgba(255, 232, 167, 0.96) 0 1.2px, transparent 2px),
    radial-gradient(circle at 78% 14%, rgba(153, 255, 255, 0.84) 0 1.1px, transparent 2px),
    radial-gradient(circle at 88% 27%, rgba(255, 232, 167, 0.9) 0 1px, transparent 1.9px),
    radial-gradient(circle at 10% 47%, rgba(255, 255, 255, 0.75) 0 1px, transparent 1.9px),
    radial-gradient(circle at 82% 45%, rgba(153, 255, 255, 0.82) 0 1.1px, transparent 1.9px);
  opacity: 0.95;
  pointer-events: none;
  z-index: 0;
  animation: homeStageDrift 18s linear infinite;
}

.me-stage__scene,
.player-stage__scene {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.me-stage__sun,
.player-stage__sun {
  position: absolute;
  left: 50%;
  bottom: 49%;
  width: min(34vw, 340px);
  aspect-ratio: 1 / 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    linear-gradient(180deg, #ffd7b9 0%, #ffbfaa 38%, #ee86b3 72%, #d154a2 100%);
  box-shadow:
    0 0 70px rgba(255, 185, 165, 0.22),
    0 0 120px rgba(255, 136, 178, 0.1);
  z-index: 0;
}

.me-stage__sun::after,
.player-stage__sun::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0 14px,
      rgba(255, 107, 158, 0.48) 14px 18px
    );
  opacity: 0.3;
}

.me-stage__skyline,
.player-stage__skyline {
  position: absolute;
  left: 50%;
  bottom: 44%;
  width: min(84vw, 860px);
  height: min(10vw, 118px);
  transform: translateX(-50%);
  background: linear-gradient(180deg, #2a2b69, #19153d);
  clip-path: polygon(
    0 100%, 0 92%, 4% 92%, 4% 72%, 6% 72%, 6% 88%, 8% 88%, 8% 64%, 10% 64%,
    10% 84%, 12% 84%, 12% 52%, 14% 52%, 14% 78%, 16% 78%, 16% 46%, 18% 46%,
    18% 82%, 20% 82%, 20% 58%, 22% 58%, 22% 86%, 25% 86%, 25% 34%, 27% 34%,
    27% 80%, 29% 80%, 29% 24%, 31% 24%, 31% 86%, 34% 86%, 34% 56%, 36% 56%,
    36% 76%, 39% 76%, 39% 42%, 41% 42%, 41% 18%, 43% 18%, 43% 82%, 46% 82%,
    46% 38%, 48% 38%, 48% 22%, 50% 22%, 50% 86%, 53% 86%, 53% 44%, 55% 44%,
    55% 84%, 58% 84%, 58% 48%, 60% 48%, 60% 74%, 63% 74%, 63% 56%, 66% 56%,
    66% 86%, 69% 86%, 69% 40%, 71% 40%, 71% 70%, 74% 70%, 74% 84%, 77% 84%,
    77% 58%, 80% 58%, 80% 86%, 84% 86%, 84% 66%, 87% 66%, 87% 82%, 91% 82%,
    91% 74%, 94% 74%, 94% 90%, 100% 90%, 100% 100%
  );
  box-shadow: 0 -1px 0 rgba(255, 164, 209, 0.22);
  z-index: 3;
}

.me-stage__floor,
.player-stage__floor {
  position: absolute;
  left: -10%;
  right: -10%;
  top: 54%;
  bottom: -22%;
  background:
    linear-gradient(180deg, rgba(255, 116, 191, 0.12) 0%, rgba(78, 59, 178, 0.18) 10%, rgba(52, 43, 152, 0.36) 30%, rgba(36, 32, 119, 0.86) 62%, rgba(31, 29, 102, 1) 100%),
    linear-gradient(90deg, rgba(255, 73, 168, 0.96) 0 2px, transparent 2px 76px),
    linear-gradient(180deg, rgba(255, 73, 168, 0.96) 0 2px, transparent 2px 50px);
  background-size: 100% 100%, 76px 100%, 100% 50px;
  transform: perspective(980px) rotateX(74deg);
  transform-origin: center top;
  z-index: 1;
}

.me-stage__controls,
.me-stage__header,
.me-layout,
.me-panel,
.me-hero-card,
.player-card,
.player-stage__controls,
.player-stage__header,
.player-layout,
.player-panel,
.player-hero-card {
  position: relative;
}

.me-stage__controls,
.player-stage__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(92vw, 980px);
  padding-top: 8px;
}

.me-stage__edit-chip {
  position: absolute;
  top: 18px;
  right: clamp(16px, 4vw, 36px);
  z-index: 10;
}

.me-stage__header,
.player-stage__header {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: min(82vw, 760px);
  text-align: center;
  padding-top: 4px;
}

.me-page-shell .pixel-text,
.player-page-shell .pixel-text {
  color: transparent !important;
  text-shadow: none !important;
  font-size: 0 !important;
  line-height: 0 !important;
}

.me-stage__subtitle,
.player-stage__subtitle {
  margin: 0;
  color: #fff8ff;
  font-size: clamp(0.95rem, 1.8vw, 1.35rem);
  line-height: 1.3;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.34);
}

.me-stage__nav {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

@media (max-width: 980px) {
  .me-stage__sun,
  .player-stage__sun {
    width: min(42vw, 260px);
  }
}

@media (max-width: 640px) {
  .me-stage,
  .player-stage {
    padding: 16px 12px 30px;
  }

  .me-stage__controls,
  .player-stage__controls {
    flex-direction: column;
    align-items: stretch;
  }

  .me-stage__edit-chip {
    position: static;
    align-self: center;
  }

  .me-stage__header,
  .player-stage__header {
    width: 100%;
    padding-top: 0;
  }

  .me-stage__title,
  .me-stage__subtitle,
  .player-stage__title,
  .player-stage__subtitle {
    width: 100%;
  }
}

/* ---------- STATIC BACKGROUND MODE ---------- */

.me-page-shell--bg-static,
.player-page-shell--bg-static {
  background-image: var(--profile-static-bg-image);
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
  background-color: rgb(7, 6, 20);
}

.me-page-shell--bg-static::before,
.player-page-shell--bg-static::before {
  display: none;
}

.me-page-shell--bg-static .me-stage,
.player-page-shell--bg-static .player-stage {
  background: transparent;
}

.me-page-shell--bg-static .me-stage::before,
.me-page-shell--bg-static .me-stage::after,
.player-page-shell--bg-static .player-stage::before,
.player-page-shell--bg-static .player-stage::after {
  display: none;
}

.me-page-shell--bg-static .me-stage__stars,
.me-page-shell--bg-static .me-stage__scene,
.player-page-shell--bg-static .player-stage__stars,
.player-page-shell--bg-static .player-stage__scene {
  display: none;
}
