/* Surcouche finale 3D : corrige la profondeur sans toucher aux contrôles ni à la logique du jeu. */
.arcade-stage > .absolute,
.arcade-stage > .pointer-events-none.absolute,
.arcade-stage > [class*="absolute"] {
  position: absolute;
}

.arcade-stage > canvas {
  position: relative;
  z-index: 1;
}

.arcade-stage > .absolute {
  z-index: 6;
}

.shop-fit-screen header,
.level-fit-screen header,
.level-side-panel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.shop-fit-screen header > *,
.level-fit-screen header > * {
  position: relative;
  z-index: 1;
}

.home-rocket-image {
  background:
    radial-gradient(circle at 48% 16%, hsl(0 0% 100% / 0.18), transparent 21%),
    radial-gradient(ellipse at 50% 96%, var(--rocket-flame, hsl(var(--warning))) 0%, transparent 36%),
    linear-gradient(145deg, hsl(var(--background) / 0.55), hsl(var(--card) / 0.18)) !important;
}

.home-rocket-stage::before,
.shop-fit-screen div:has(> img[src^="data:image/svg+xml"])::before,
.level-fit-screen div:has(> img[src^="data:image/svg+xml"])::before {
  content: "";
  position: absolute;
  inset: 8% 14% 2%;
  border-radius: 999px;
  background:
    radial-gradient(ellipse at center, hsl(var(--primary) / 0.26), transparent 68%),
    radial-gradient(ellipse at center, hsl(var(--accent) / 0.18), transparent 78%);
  filter: blur(18px);
  transform: translateZ(-42px) rotateX(70deg);
  pointer-events: none;
  z-index: -1;
}

.home-rocket-image,
.shop-fit-screen img[src^="data:image/svg+xml"],
.level-fit-screen img[src^="data:image/svg+xml"] {
  border: 1px solid hsl(0 0% 100% / 0.14);
}

.game-app .arcade-stage {
  transform: translateZ(0) rotateX(1.4deg);
}

@media (max-width: 639px) {
  .game-app .arcade-stage {
    transform: translateZ(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-app .arcade-stage,
  .home-rocket-image,
  .shop-fit-screen img[src^="data:image/svg+xml"],
  .level-fit-screen img[src^="data:image/svg+xml"] {
    transform: none !important;
  }
}

/* Espace skin allégé : moins de 3D et de profondeur pour faciliter le scroll et les taps. */
.shop-skins-panel {
  perspective: none !important;
  transform-style: flat !important;
  overflow: visible;
  touch-action: pan-y;
}

.shop-skins-panel,
.shop-skins-panel article,
.shop-skins-panel button,
.shop-skins-panel input,
.shop-skins-panel img[src^="data:image/svg+xml"] {
  backface-visibility: visible !important;
  transform-style: flat !important;
  will-change: auto !important;
}

.shop-skins-panel article,
.shop-skins-panel button {
  transform: none !important;
  box-shadow: 0 8px 22px hsl(229 75% 4% / 0.18), inset 0 1px 0 hsl(0 0% 100% / 0.12) !important;
}

.shop-skins-panel button:hover:not(:disabled),
.shop-skins-panel button:focus-visible:not(:disabled) {
  transform: translateY(-0.08rem) !important;
  box-shadow: 0 10px 24px hsl(229 75% 4% / 0.20), inset 0 1px 0 hsl(0 0% 100% / 0.14) !important;
}

.shop-skins-panel img[src^="data:image/svg+xml"] {
  transform: none !important;
  filter: saturate(1.05) contrast(1.02) drop-shadow(0 0 0.55rem hsl(var(--accent) / 0.18)) !important;
}

.shop-skins-panel div:has(> img[src^="data:image/svg+xml"])::before,
.shop-skins-panel div:has(> img[src^="data:image/svg+xml"])::after {
  display: none !important;
}

.shop-skin-card {
  contain: layout paint;
}

@media (max-width: 639px) {
  .shop-skins-panel article,
  .shop-skins-panel button,
  .shop-skins-panel button:hover:not(:disabled),
  .shop-skins-panel button:focus-visible:not(:disabled),
  .shop-skins-panel img[src^="data:image/svg+xml"] {
    transform: none !important;
  }

  .shop-skin-card {
    box-shadow: 0 5px 14px hsl(229 75% 4% / 0.14) !important;
  }
}

/* Icônes “à gagner” visibles directement dans le Pass : 1 badge Libre, 2 badges Nova+ payant. */
.pass-rail button[aria-label^="Palier"] > span.relative.z-10 {
  position: relative;
  isolation: isolate;
}

.pass-rail button[aria-label*="Gratuit"] > span.relative.z-10::after,
.pass-rail button[aria-label*="Premium"] > span.relative.z-10::before,
.pass-rail button[aria-label*="Premium"] > span.relative.z-10::after {
  position: absolute;
  z-index: 8;
  display: grid;
  place-items: center;
  width: 1.55rem;
  height: 1.55rem;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
  font-size: 0.82rem;
  line-height: 1;
  transform-style: preserve-3d;
  pointer-events: none;
  animation: pass-win-icon-pop 1.75s ease-in-out infinite;
}

.pass-rail button[aria-label*="Gratuit"] > span.relative.z-10::after {
  content: "🏆";
  top: -1.02rem;
  right: -1.08rem;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.95), transparent 28%),
    linear-gradient(145deg, #67e8f9, #2563eb 54%, #7c3aed);
  box-shadow:
    0 0 0.95rem rgba(34, 211, 238, 0.94),
    0 0 1.7rem rgba(96, 165, 250, 0.55),
    inset 0 0 0.5rem rgba(255, 255, 255, 0.32);
}

.pass-rail button[aria-label*="Premium"] > span.relative.z-10::before {
  content: "👑";
  top: -1.03rem;
  left: -1.12rem;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, 0.96), transparent 27%),
    linear-gradient(145deg, #fde68a, #f59e0b 50%, #db2777);
  box-shadow:
    0 0 1rem rgba(251, 191, 36, 0.98),
    0 0 1.8rem rgba(236, 72, 153, 0.58),
    inset 0 0 0.52rem rgba(255, 255, 255, 0.36);
}

.pass-rail button[aria-label*="Premium"] > span.relative.z-10::after {
  content: "💎";
  right: -1.1rem;
  top: -0.42rem;
  background:
    radial-gradient(circle at 34% 22%, rgba(255, 255, 255, 0.95), transparent 27%),
    linear-gradient(145deg, #f0abfc, #a855f7 52%, #06b6d4);
  box-shadow:
    0 0 1rem rgba(217, 70, 239, 0.9),
    0 0 1.75rem rgba(34, 211, 238, 0.54),
    inset 0 0 0.5rem rgba(255, 255, 255, 0.34);
  animation-delay: 0.22s;
}

.pass-rail button[aria-label*="Gratuit"]::before {
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,0.45), transparent 30%),
    conic-gradient(from 18deg, transparent, rgba(34, 211, 238, 0.48), transparent 32%, rgba(96, 165, 250, 0.36), transparent 72%) !important;
}

.pass-rail button[aria-label*="Premium"]::before {
  background:
    radial-gradient(circle at 50% 18%, rgba(255,255,255,0.5), transparent 30%),
    conic-gradient(from 18deg, transparent, rgba(251, 191, 36, 0.54), transparent 28%, rgba(236, 72, 153, 0.42), transparent 54%, rgba(168, 85, 247, 0.34), transparent 78%) !important;
}

.pass-rail button[aria-label*="Gratuit"]::after,
.pass-rail button[aria-label*="Premium"]::after {
  height: 1.55rem;
  bottom: -1.2rem;
}

.pass-rail button[aria-label*="Gratuit"]:hover > span.relative.z-10::after,
.pass-rail button[aria-label*="Gratuit"]:focus-visible > span.relative.z-10::after,
.pass-rail button[aria-label*="Premium"]:hover > span.relative.z-10::before,
.pass-rail button[aria-label*="Premium"]:hover > span.relative.z-10::after,
.pass-rail button[aria-label*="Premium"]:focus-visible > span.relative.z-10::before,
.pass-rail button[aria-label*="Premium"]:focus-visible > span.relative.z-10::after {
  animation-duration: 0.9s;
  filter: saturate(1.25) brightness(1.1);
}

@keyframes pass-win-icon-pop {
  0%, 100% {
    transform: translate3d(0, 0, 48px) rotateX(9deg) rotateZ(-7deg) scale(1);
  }
  50% {
    transform: translate3d(0, -0.22rem, 68px) rotateX(18deg) rotateZ(8deg) scale(1.12);
  }
}

@media (max-width: 639px) {
  .pass-rail button[aria-label*="Gratuit"] > span.relative.z-10::after,
  .pass-rail button[aria-label*="Premium"] > span.relative.z-10::before,
  .pass-rail button[aria-label*="Premium"] > span.relative.z-10::after {
    width: 1.38rem;
    height: 1.38rem;
    font-size: 0.72rem;
  }

  .pass-rail button[aria-label*="Premium"] > span.relative.z-10::before {
    left: -0.9rem;
  }

  .pass-rail button[aria-label*="Premium"] > span.relative.z-10::after,
  .pass-rail button[aria-label*="Gratuit"] > span.relative.z-10::after {
    right: -0.92rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pass-rail button[aria-label*="Gratuit"] > span.relative.z-10::after,
  .pass-rail button[aria-label*="Premium"] > span.relative.z-10::before,
  .pass-rail button[aria-label*="Premium"] > span.relative.z-10::after {
    animation: none !important;
  }
}

/* Carte des niveaux revue : une galaxie 3D entière et visible, sans grille de cartes séparées. */
.level-fit-screen .level-space-shell:has(.grid-cols-2.sm\:grid-cols-5.py-4) {
  border-color: transparent !important;
  background:
    radial-gradient(circle at 50% 48%, rgba(251, 191, 36, 0.10), transparent 13rem),
    radial-gradient(circle at 12% 16%, rgba(34, 211, 238, 0.12), transparent 18rem),
    radial-gradient(circle at 88% 82%, rgba(217, 70, 239, 0.12), transparent 17rem),
    linear-gradient(180deg, rgba(2, 6, 23, 0.26), rgba(2, 6, 23, 0.58)) !important;
  box-shadow: none !important;
}

.level-fit-screen .level-space-content > .grid:has(.grid-cols-2.sm\:grid-cols-5.py-4) {
  display: block !important;
}

.level-fit-screen .level-space-content > .grid:has(.grid-cols-2.sm\:grid-cols-5.py-4) > div:first-child {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: clamp(0.5rem, 1.8vw, 1.4rem) !important;
}

.level-fit-screen .level-space-content > .grid:has(.grid-cols-2.sm\:grid-cols-5.py-4) > aside {
  display: none !important;
}

.level-fit-screen .level-space-content > .grid:has(.grid-cols-2.sm\:grid-cols-5.py-4) > div:first-child > .flex:first-child {
  position: absolute;
  z-index: 8;
  top: clamp(0.5rem, 1.5vw, 1rem);
  left: clamp(0.5rem, 1.5vw, 1rem);
  right: clamp(0.5rem, 1.5vw, 1rem);
  border-bottom: 0 !important;
  border-radius: 1.35rem;
  padding: 0.55rem 0.7rem !important;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.72), rgba(15, 23, 42, 0.28));
  box-shadow: 0 1.3rem 3.5rem rgba(0, 0, 0, 0.20), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.level-fit-screen .level-space-content > .grid:has(.grid-cols-2.sm\:grid-cols-5.py-4) > div:first-child > .flex:first-child h1::after {
  content: " · système solaire 3D complet";
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.62em;
  font-weight: 800;
}

.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 {
  --galaxy-tilt: 60deg;
  position: relative;
  display: block !important;
  width: min(100%, 72rem);
  height: clamp(31rem, 72vh, 46rem);
  margin: 0 auto !important;
  padding: 0 !important;
  overflow: hidden;
  perspective: 1600px;
  transform-style: preserve-3d;
  border-radius: clamp(1.5rem, 4vw, 3.2rem);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 214, 102, 0.12), transparent 8%),
    radial-gradient(ellipse at 50% 54%, rgba(125, 211, 252, 0.10), transparent 32%),
    radial-gradient(ellipse at 50% 51%, rgba(168, 85, 247, 0.12), transparent 50%),
    radial-gradient(circle at 22% 22%, rgba(255, 255, 255, 0.22) 0 1px, transparent 1.6px),
    radial-gradient(circle at 78% 74%, rgba(255, 255, 255, 0.18) 0 1px, transparent 1.7px),
    linear-gradient(145deg, rgba(3, 7, 18, 0.10), rgba(3, 7, 18, 0.62));
  background-size: auto, auto, auto, 7rem 7rem, 9rem 9rem, auto;
  box-shadow:
    inset 0 0 5.5rem rgba(2, 6, 23, 0.92),
    inset 0 0 0 1px rgba(255, 255, 255, 0.07),
    0 2rem 7rem rgba(0, 0, 0, 0.34);
  isolation: isolate;
}

.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4::before {
  content: "";
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: clamp(5.4rem, 13vw, 9.5rem);
  aspect-ratio: 1;
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 26%, rgba(255, 255, 255, 0.98), rgba(254, 240, 138, 0.92) 18%, rgba(251, 146, 60, 0.88) 42%, rgba(220, 38, 38, 0.76) 69%, rgba(127, 29, 29, 0.15) 100%),
    conic-gradient(from 20deg, rgba(255,255,255,0.36), rgba(251,191,36,0.2), rgba(249,115,22,0.34), rgba(255,255,255,0.25));
  box-shadow:
    0 0 1.3rem rgba(255, 255, 255, 0.95),
    0 0 3rem rgba(251, 191, 36, 0.9),
    0 0 7rem rgba(249, 115, 22, 0.64),
    0 0 11rem rgba(220, 38, 38, 0.36),
    0 0 0 3.2rem rgba(255, 255, 255, 0.012),
    0 0 0 6.2rem rgba(125, 211, 252, 0.018),
    0 0 0 9.1rem rgba(168, 85, 247, 0.018),
    0 0 0 12.1rem rgba(255, 255, 255, 0.014),
    0 0 0 15.2rem rgba(34, 211, 238, 0.018),
    0 0 0 18.2rem rgba(236, 72, 153, 0.016),
    0 0 0 21.3rem rgba(255, 255, 255, 0.012),
    0 0 0 24.2rem rgba(34, 197, 94, 0.014),
    0 0 0 27rem rgba(255, 255, 255, 0.012);
  filter: saturate(1.15);
  transform: translate(-50%, -50%) translateZ(28px);
  animation: realistic-sun-breathe 4.8s ease-in-out infinite;
  pointer-events: none;
}

.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 5% 2%;
  border-radius: 50%;
  background:
    conic-gradient(from 8deg, transparent 0 8%, rgba(34, 211, 238, 0.12) 10%, transparent 14% 21%, rgba(217, 70, 239, 0.11) 24%, transparent 29% 44%, rgba(251, 191, 36, 0.10) 48%, transparent 54% 100%),
    repeating-radial-gradient(ellipse at center, transparent 0 2.2rem, rgba(255, 255, 255, 0.10) 2.25rem 2.32rem, transparent 2.38rem 3.95rem);
  opacity: 0.88;
  transform: rotateX(var(--galaxy-tilt)) rotateZ(-11deg) translateZ(-65px);
  transform-style: preserve-3d;
  filter: drop-shadow(0 0 2.5rem rgba(34, 211, 238, 0.18));
  animation: galaxy-disk-drift 26s linear infinite;
  pointer-events: none;
}

.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button {
  --orbit: 12rem;
  --angle: 0deg;
  --planet-size: 4.4rem;
  position: absolute !important;
  z-index: 3;
  left: 50%;
  top: 50%;
  display: grid !important;
  place-items: center;
  width: var(--planet-size) !important;
  height: var(--planet-size) !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 1 !important;
  transform-style: preserve-3d;
  transform:
    translate(-50%, -50%)
    rotateX(var(--galaxy-tilt))
    rotateZ(var(--angle))
    translateX(var(--orbit))
    rotateZ(calc(-1 * var(--angle)))
    rotateX(calc(-1 * var(--galaxy-tilt)))
    translateZ(36px);
  animation: planet-orbital-bob 5.6s ease-in-out infinite;
  transition: filter 220ms ease, transform 220ms ease;
}

.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button:hover,
.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button:focus-visible {
  filter: brightness(1.18) saturate(1.18);
}

.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -34%;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.20), rgba(34, 211, 238, 0.14) 34%, transparent 68%);
  filter: blur(0.65rem);
  transform: translateZ(-16px);
}

.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button:not(.opacity-50)::after {
  content: "";
  position: absolute;
  inset: -0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.35);
  box-shadow: 0 0 1.3rem rgba(34, 211, 238, 0.24), inset 0 0 0.9rem rgba(255,255,255,0.08);
  animation: planet-unlock-aura 2.7s ease-in-out infinite;
  pointer-events: none;
}

.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button.opacity-50 {
  filter: grayscale(0.85) brightness(0.58);
}

.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button:nth-child(1) { --angle: -102deg; --orbit: clamp(5.8rem, 14vw, 9.2rem); --planet-size: clamp(3rem, 7vw, 4.5rem); animation-delay: -0.2s; }
.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button:nth-child(2) { --angle: -55deg; --orbit: clamp(7.3rem, 18vw, 12rem); --planet-size: clamp(3.2rem, 7.4vw, 4.9rem); animation-delay: -1.1s; }
.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button:nth-child(3) { --angle: -8deg; --orbit: clamp(8.9rem, 22vw, 15rem); --planet-size: clamp(3.45rem, 7.9vw, 5.15rem); animation-delay: -2.6s; }
.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button:nth-child(4) { --angle: 38deg; --orbit: clamp(10.1rem, 26vw, 17.8rem); --planet-size: clamp(3.65rem, 8.4vw, 5.35rem); animation-delay: -0.7s; }
.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button:nth-child(5) { --angle: 82deg; --orbit: clamp(11rem, 30vw, 20.6rem); --planet-size: clamp(3.55rem, 8.1vw, 5.25rem); animation-delay: -3.3s; }
.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button:nth-child(6) { --angle: 127deg; --orbit: clamp(12.2rem, 33vw, 23.2rem); --planet-size: clamp(3.9rem, 8.9vw, 5.75rem); animation-delay: -1.8s; }
.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button:nth-child(7) { --angle: 171deg; --orbit: clamp(13rem, 36vw, 25.4rem); --planet-size: clamp(3.55rem, 8.2vw, 5.3rem); animation-delay: -4.2s; }
.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button:nth-child(8) { --angle: 215deg; --orbit: clamp(13.7rem, 39vw, 27.2rem); --planet-size: clamp(3.45rem, 7.9vw, 5.15rem); animation-delay: -2.2s; }
.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button:nth-child(9) { --angle: 259deg; --orbit: clamp(14.1rem, 41vw, 28.8rem); --planet-size: clamp(3.4rem, 7.7vw, 5rem); animation-delay: -0.5s; }
.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button:nth-child(10) { --angle: 304deg; --orbit: clamp(14.5rem, 43vw, 30.4rem); --planet-size: clamp(3.8rem, 8.7vw, 5.7rem); animation-delay: -3.8s; }

.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button > div:first-child {
  width: var(--planet-size) !important;
  height: var(--planet-size) !important;
  margin: 0 !important;
  transform: translateZ(28px);
}

.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button canvas {
  width: var(--planet-size) !important;
  height: var(--planet-size) !important;
  max-width: none !important;
  border: 0 !important;
  filter: drop-shadow(0 0 1.05rem rgba(255, 255, 255, 0.20));
}

.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button .text-xs.font-black.truncate,
.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button .text-\[9px\].text-white\/50 {
  position: absolute;
  left: 50%;
  width: 8.5rem;
  transform: translateX(-50%) translateZ(52px);
  text-align: center;
  text-shadow: 0 0 0.6rem rgba(0, 0, 0, 0.96), 0 0 1rem rgba(34, 211, 238, 0.34);
  white-space: normal;
  pointer-events: none;
}

.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button .text-xs.font-black.truncate {
  top: calc(var(--planet-size) + 0.35rem);
  color: rgba(255, 255, 255, 0.95);
  font-size: clamp(0.56rem, 1.2vw, 0.78rem);
  letter-spacing: 0.02em;
}

.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button .text-\[9px\].text-white\/50 {
  top: calc(var(--planet-size) + 1.32rem);
  color: rgba(255, 255, 255, 0.58) !important;
  font-size: clamp(0.48rem, 1vw, 0.62rem);
}

.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button .absolute.top-2.right-2,
.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button .absolute.-bottom-1\.5 {
  transform: translateZ(60px);
}

.level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 + .mt-5 {
  margin-top: -7.2rem !important;
  margin-left: auto;
  margin-right: clamp(0.4rem, 2vw, 1.3rem);
  position: relative;
  z-index: 8;
  width: min(100%, 29rem);
  border-color: rgba(255, 255, 255, 0.10) !important;
  background: linear-gradient(135deg, rgba(2, 6, 23, 0.74), rgba(15, 23, 42, 0.42)) !important;
  box-shadow: 0 1.2rem 3.8rem rgba(0, 0, 0, 0.36), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
}

.level-fit-screen .level-space-content > .grid:has(.grid-cols-2.sm\:grid-cols-5.py-4) > div:first-child > .mt-5:last-child {
  border-radius: 1.35rem !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: rgba(2, 6, 23, 0.42) !important;
  backdrop-filter: blur(10px);
}

@keyframes realistic-sun-breathe {
  0%, 100% {
    transform: translate(-50%, -50%) translateZ(28px) rotate(0deg) scale(1);
    filter: saturate(1.15) brightness(1);
  }
  50% {
    transform: translate(-50%, -50%) translateZ(44px) rotate(10deg) scale(1.045);
    filter: saturate(1.35) brightness(1.12);
  }
}

@keyframes galaxy-disk-drift {
  from {
    transform: rotateX(var(--galaxy-tilt)) rotateZ(-11deg) translateZ(-65px);
  }
  to {
    transform: rotateX(var(--galaxy-tilt)) rotateZ(349deg) translateZ(-65px);
  }
}

@keyframes planet-orbital-bob {
  0%, 100% {
    margin-top: 0;
  }
  50% {
    margin-top: -0.75rem;
  }
}

@keyframes planet-unlock-aura {
  0%, 100% {
    opacity: 0.42;
    transform: scale(0.96) translateZ(0);
  }
  50% {
    opacity: 1;
    transform: scale(1.16) translateZ(0);
  }
}

@media (max-width: 820px) {
  .level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 {
    height: clamp(30rem, 70vh, 39rem);
    border-radius: 1.8rem;
  }

  .level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4::before {
    width: clamp(4.4rem, 17vw, 6.2rem);
    box-shadow:
      0 0 1.2rem rgba(255, 255, 255, 0.82),
      0 0 2.7rem rgba(251, 191, 36, 0.75),
      0 0 5.5rem rgba(249, 115, 22, 0.50),
      0 0 0 2.6rem rgba(255, 255, 255, 0.012),
      0 0 0 5.1rem rgba(125, 211, 252, 0.018),
      0 0 0 7.5rem rgba(168, 85, 247, 0.018),
      0 0 0 9.8rem rgba(255, 255, 255, 0.014),
      0 0 0 12rem rgba(34, 211, 238, 0.018),
      0 0 0 14rem rgba(236, 72, 153, 0.016),
      0 0 0 16rem rgba(255, 255, 255, 0.012);
  }

  .level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button:nth-child(7),
  .level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button:nth-child(8),
  .level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button:nth-child(9),
  .level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button:nth-child(10) {
    --orbit: min(var(--orbit), 43vw);
  }

  .level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 + .mt-5 {
    margin-top: -5.8rem !important;
    width: min(100%, 25rem);
  }
}

@media (max-width: 560px) {
  .level-fit-screen .level-space-content > .grid:has(.grid-cols-2.sm\:grid-cols-5.py-4) > div:first-child > .flex:first-child {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    margin-bottom: 0.6rem;
  }

  .level-fit-screen .level-space-content > .grid:has(.grid-cols-2.sm\:grid-cols-5.py-4) > div:first-child > .flex:first-child h1::after,
  .level-fit-screen .level-space-content > .grid:has(.grid-cols-2.sm\:grid-cols-5.py-4) > div:first-child > .flex:first-child p {
    display: none;
  }

  .level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 {
    --galaxy-tilt: 55deg;
    height: 31.5rem;
  }

  .level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button .text-xs.font-black.truncate,
  .level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button .text-\[9px\].text-white\/50 {
    width: 5.4rem;
  }

  .level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 + .mt-5 {
    margin-top: 0.7rem !important;
    margin-right: 0;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4,
  .level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4::before,
  .level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4::after,
  .level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button,
  .level-fit-screen .grid.grid-cols-2.gap-3.sm\:grid-cols-5.py-4 > button::after {
    animation: none !important;
  }
}
