/* EFFECTS LAYER (separate from painted-skin.css, delete this file + its <link> to remove).
   The game's ambient motion ported to pure CSS: nebula drift, dust, motes, light rays, slowly turning circle, selection breath, spring pop-in.
   Rules: decorative pseudo-elements only, pointer-events none, transform/opacity animation only, nothing on buttons or the hero class tabs,
   everything inside overflow:hidden boxes, all of it off under prefers-reduced-motion. Phones get fewer specks (second tile). */
@media (prefers-reduced-motion: no-preference) {
  :root { --fx-out: cubic-bezier(.2, .8, .3, 1); --fx-pop: cubic-bezier(.2, .8, .3, 1.4); }
  .home .title-bg::before, .home .title-bg::after, .home .title-core::before, .home .title-core::after, .portal-view::before, .portal-view::after, .hero-show::after,
  .g-panel[data-for="loading"]::after, .g-panel[data-for="loading"] .g-status::before { content: ""; position: absolute; pointer-events: none; }

  /* 1. title: nebula, rays behind the logo, dust, motes */
  .home .title-bg::before { inset: -18%; background: radial-gradient(circle at 22% 28%, rgba(157, 107, 255, .2), transparent 38%), radial-gradient(circle at 78% 72%, rgba(232, 163, 61, .09), transparent 42%), radial-gradient(circle at 70% 18%, rgba(157, 107, 255, .16), transparent 36%), radial-gradient(circle at 30% 80%, rgba(157, 107, 255, .12), transparent 40%); animation: fxNebula 46s ease-in-out infinite alternate; will-change: transform; }
  .home .title-bg::after { left: 50%; top: 36%; width: min(120vmin, 1100px); aspect-ratio: 1; translate: -50% -50%; background: repeating-conic-gradient(from 0deg, rgba(255, 226, 150, .22) 0 3deg, transparent 3deg 15deg); -webkit-mask-image: radial-gradient(closest-side, #000 0, transparent 70%); mask-image: radial-gradient(closest-side, #000 0, transparent 70%); opacity: .25; animation: fxRays 5s ease-in-out infinite alternate; will-change: opacity; }
  .home .title-core::before { z-index: -1; left: 0; top: -520px; width: calc(100% + 840px); height: calc(100% + 1040px); background:
    radial-gradient(circle 3px at 201px 475px, rgba(255,244,214,.7) 0 2px, transparent 3px),
    radial-gradient(circle 2.6px at 514px 482px, rgba(214,196,255,.5) 0 1.6px, transparent 2.6px),
    radial-gradient(circle 2.6px at 41px 445px, rgba(255,244,214,.5) 0 1.6px, transparent 2.6px),
    radial-gradient(circle 3px at 303px 28px, rgba(214,196,255,.7) 0 2px, transparent 3px),
    radial-gradient(circle 2.6px at 58px 512px, rgba(255,244,214,.5) 0 1.6px, transparent 2.6px),
    radial-gradient(circle 2.6px at 817px 276px, rgba(214,196,255,.5) 0 1.6px, transparent 2.6px),
    radial-gradient(circle 3px at 380px 285px, rgba(255,244,214,.7) 0 2px, transparent 3px),
    radial-gradient(circle 2.6px at 508px 404px, rgba(214,196,255,.5) 0 1.6px, transparent 2.6px); background-repeat: repeat; opacity: .8; animation: fxDust 70s linear infinite; will-change: transform; }
  .home .title-core::after { z-index: -1; left: 0; top: 0; width: calc(100% + 700px); height: calc(100% + 600px); background:
    radial-gradient(circle 5px at 64px 449px, #eadcff 0 1.3px, rgba(185,140,255,.55) 1.7px, transparent 5px),
    radial-gradient(circle 5px at 584px 215px, #ffe9a8 0 1.3px, rgba(255,210,77,.55) 1.7px, transparent 5px),
    radial-gradient(circle 5px at 125px 589px, #eadcff 0 1.3px, rgba(185,140,255,.55) 1.7px, transparent 5px),
    radial-gradient(circle 5px at 85px 273px, #ffe9a8 0 1.3px, rgba(255,210,77,.55) 1.7px, transparent 5px),
    radial-gradient(circle 5px at 319px 65px, #eadcff 0 1.3px, rgba(185,140,255,.55) 1.7px, transparent 5px),
    radial-gradient(circle 5px at 80px 373px, #ffe9a8 0 1.3px, rgba(255,210,77,.55) 1.7px, transparent 5px); background-repeat: repeat; opacity: .85; animation: fxRise 26s linear infinite; will-change: transform; }

  /* 2 + 3. headquarters viewer: dust over the island, turning circle, selection breath on the lit tab */
  .portal-view::before, .hero-show::after { aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; border: 2px solid rgba(255, 210, 77, .9);
    background: radial-gradient(closest-side, transparent 0 44%, rgba(255, 210, 77, .9) 44% 45%, transparent 45% 62%, rgba(255, 210, 77, .8) 62% 63%, transparent 63%), repeating-conic-gradient(rgba(255, 210, 77, .85) 0 2deg, transparent 2deg 12deg);
    -webkit-mask-image: radial-gradient(closest-side, #000 0 44%, transparent 44% 62%, #000 62%); mask-image: radial-gradient(closest-side, #000 0 44%, transparent 44% 62%, #000 62%);
    animation: fxCircle 90s linear infinite; will-change: transform; }
  .portal-view::before { z-index: 1; left: 50%; top: 50%; width: min(88%, 460px); opacity: .13; }
  .hero-show::after { z-index: -1; left: 50%; top: 46%; width: min(92%, 400px); opacity: .16; }
  .portal-view::after { z-index: 1; left: 0; top: -420px; width: calc(100% + 560px); height: calc(100% + 840px); background:
    radial-gradient(circle 3px at 198px 131px, rgba(255,244,214,.7) 0 2px, transparent 3px),
    radial-gradient(circle 2.6px at 287px 299px, rgba(214,196,255,.5) 0 1.6px, transparent 2.6px),
    radial-gradient(circle 2.6px at 173px 66px, rgba(255,244,214,.5) 0 1.6px, transparent 2.6px),
    radial-gradient(circle 3px at 490px 263px, rgba(214,196,255,.7) 0 2px, transparent 3px),
    radial-gradient(circle 2.6px at 212px 418px, rgba(255,244,214,.5) 0 1.6px, transparent 2.6px); background-repeat: repeat; opacity: .8; animation: fxDustS 80s linear infinite; will-change: transform; }
  .portal-side a:first-child::before { animation: fxBreath 1.8s ease-in-out infinite alternate; }

  /* 4. spring pop-in on the section reveal that already exists (same transition, new easing; nothing else animates) */
  .icard.reveal, .frame.reveal { transition: opacity .6s var(--fx-out), transform .6s var(--fx-pop), filter .18s; }
  .icard.reveal:not(.in) { transform: translateY(20px) scale(.92); }
  .frame.reveal:not(.in) { transform: translateY(26px) scale(.975); }

  /* 5. Play launcher loading screen: motes + a turning circle behind the progress bar */
  .g-panel[data-for="loading"] { overflow: hidden; }
  .g-panel[data-for="loading"]::after { z-index: -1; left: 50%; top: 40%; width: 300px; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; border: 2px solid rgba(255, 210, 77, .9);
    background: radial-gradient(closest-side, transparent 0 44%, rgba(255, 210, 77, .9) 44% 45%, transparent 45% 62%, rgba(255, 210, 77, .8) 62% 63%, transparent 63%), repeating-conic-gradient(rgba(255, 210, 77, .85) 0 2deg, transparent 2deg 12deg);
    -webkit-mask-image: radial-gradient(closest-side, #000 0 44%, transparent 44% 62%, #000 62%); mask-image: radial-gradient(closest-side, #000 0 44%, transparent 44% 62%, #000 62%);
    opacity: .2; animation: fxCircle 60s linear infinite; will-change: transform; }
  .g-panel[data-for="loading"] .g-status::before { z-index: -1; left: 0; top: 0; width: calc(100% + 520px); height: calc(100% + 380px); background:
    radial-gradient(circle 5px at 91px 165px, #eadcff 0 1.3px, rgba(185,140,255,.55) 1.7px, transparent 5px),
    radial-gradient(circle 5px at 93px 1px, #ffe9a8 0 1.3px, rgba(255,210,77,.55) 1.7px, transparent 5px),
    radial-gradient(circle 5px at 360px 289px, #eadcff 0 1.3px, rgba(185,140,255,.55) 1.7px, transparent 5px),
    radial-gradient(circle 5px at 75px 206px, #ffe9a8 0 1.3px, rgba(255,210,77,.55) 1.7px, transparent 5px),
    radial-gradient(circle 5px at 386px 335px, #eadcff 0 1.3px, rgba(185,140,255,.55) 1.7px, transparent 5px); background-repeat: repeat; opacity: .8; animation: fxRiseL 14s linear infinite; will-change: transform; }

  @keyframes fxNebula { from { transform: translate3d(-2%, -1%, 0) scale(1); } to { transform: translate3d(2%, 1.5%, 0) scale(1.06); } }
  @keyframes fxRays { from { opacity: .18; } to { opacity: .36; } }
  @keyframes fxDust { to { transform: translate3d(-840px, 520px, 0); } }
  @keyframes fxRise { to { transform: translate3d(0, -600px, 0); } }
  @keyframes fxDustS { to { transform: translate3d(-560px, 420px, 0); } }
  @keyframes fxRiseL { to { transform: translate3d(0, -380px, 0); } }
  @keyframes fxCircle { to { rotate: 360deg; } }
  @keyframes fxBreath { from { transform: scale(1); } to { transform: scale(1.04); } }

  /* phones: fewer specks (the lighter tile), same layers */
  @media (max-width: 720px), (pointer: coarse) {
    .home .title-core::before { top: -560px; width: calc(100% + 480px); height: calc(100% + 1120px); background:
    radial-gradient(circle 3px at 374px 234px, rgba(255,244,214,.7) 0 2px, transparent 3px),
    radial-gradient(circle 2.6px at 228px 477px, rgba(214,196,255,.5) 0 1.6px, transparent 2.6px),
    radial-gradient(circle 2.6px at 174px 270px, rgba(255,244,214,.5) 0 1.6px, transparent 2.6px); background-repeat: repeat; animation-name: fxDustP; }
    .home .title-core::after { width: calc(100% + 420px); height: calc(100% + 600px); background:
    radial-gradient(circle 5px at 325px 51px, #eadcff 0 1.3px, rgba(185,140,255,.55) 1.7px, transparent 5px),
    radial-gradient(circle 5px at 254px 556px, #ffe9a8 0 1.3px, rgba(255,210,77,.55) 1.7px, transparent 5px),
    radial-gradient(circle 5px at 112px 354px, #eadcff 0 1.3px, rgba(185,140,255,.55) 1.7px, transparent 5px); background-repeat: repeat; animation-duration: 22s; }
    .portal-view::after { width: calc(100% + 360px); height: calc(100% + 840px); background:
    radial-gradient(circle 3px at 174px 75px, rgba(255,244,214,.7) 0 2px, transparent 3px),
    radial-gradient(circle 2.6px at 91px 387px, rgba(214,196,255,.5) 0 1.6px, transparent 2.6px),
    radial-gradient(circle 2.6px at 212px 207px, rgba(255,244,214,.5) 0 1.6px, transparent 2.6px); background-repeat: repeat; animation-name: fxDustSP; }
    .g-panel[data-for="loading"] .g-status::before { width: calc(100% + 360px); background:
    radial-gradient(circle 5px at 134px 155px, #eadcff 0 1.3px, rgba(185,140,255,.55) 1.7px, transparent 5px),
    radial-gradient(circle 5px at 230px 315px, #ffe9a8 0 1.3px, rgba(255,210,77,.55) 1.7px, transparent 5px),
    radial-gradient(circle 5px at 181px 183px, #eadcff 0 1.3px, rgba(185,140,255,.55) 1.7px, transparent 5px); background-repeat: repeat; }
    @keyframes fxDustP { to { transform: translate3d(-480px, 560px, 0); } }
    @keyframes fxDustSP { to { transform: translate3d(-360px, 420px, 0); } }
  }
}
