/* The local next-design preview uses a warm palette over the existing layouts. */
body[data-studio-next] {
  --vibe-ink: #140d19;
  --vibe-low: #1b1123;
  --vibe-panel: #24172d;
  --vibe-raised: #302039;
  --vibe-paper: #faf0f5;
  --vibe-muted: #d0bfd0;
  --vibe-dim: #bbabc0;
  --vibe-rule: #57425b;
  --vibe-rule-strong: #927d95;
  --vibe-coral: #ffa48d;
  --vibe-lilac: #d9b5fd;
  --vibe-mint: #a9e9cd;
  --vibe-sunset: linear-gradient(116deg, #ffa48d 0%, #fbb0c9 55%, #dfb9f9 100%);
  --vibe-radius: 14px;
}

body[data-studio-next][data-studio-preview] {
  --next-ink: var(--vibe-ink);
  --next-slate: var(--vibe-raised);
  --next-paper: var(--vibe-paper);
  --next-lime: var(--vibe-coral);
  --next-ice: var(--vibe-lilac);
  --bg2: var(--vibe-low);
  --panel: var(--vibe-panel);
  --muted: var(--vibe-muted);
  --dim: var(--vibe-dim);
  --accent2: var(--vibe-mint);
  --accent3: var(--vibe-lilac);
  --line: var(--vibe-rule);
  --line-strong: var(--vibe-rule-strong);
  --field: #1b1323;
  --field-hover: #241931;
  --field-line: var(--vibe-rule-strong);
  --radius: 10px;
  --radius-sm: 8px;
}

body[data-studio-next][data-studio-preview][data-theme='nightwave'] {
  --accent: var(--vibe-mint);
  --accent2: var(--vibe-lilac);
}

body[data-studio-next][data-studio-preview][data-theme='apps'] {
  --accent: var(--vibe-mint);
  --accent2: var(--vibe-lilac);
  --accent3: var(--vibe-coral);
}

body[data-studio-next] ::selection {
  color: var(--vibe-ink);
  background: var(--vibe-lilac);
}

body[data-studio-next] :is(.studio-nav, .studio-footer, .studio-next-palette) {
  --next-nav-ink: var(--vibe-ink);
  --next-nav-panel: var(--vibe-panel);
  --next-nav-paper: var(--vibe-paper);
  --next-nav-muted: var(--vibe-muted);
  --next-nav-rule: var(--vibe-rule);
  --next-nav-lime: var(--vibe-coral);
  --studio-nav-coral: var(--vibe-mint);
}

body[data-studio-next] .studio-nav {
  background: rgb(20 13 25 / .96);
}

body[data-studio-next] .studio-nav-brand img {
  border-radius: 50%;
  outline-color: var(--vibe-lilac);
}

body[data-studio-next] :is(.studio-nav-play, .studio-next-find) {
  border-radius: 999px;
}

body[data-studio-next] .studio-nav-play {
  background: var(--vibe-sunset);
  border-color: transparent;
}

body[data-studio-next] .studio-nav-play:hover {
  background: #ffd2d0;
  border-color: #ffd2d0;
}

body[data-studio-next] .studio-nav-panel {
  background: radial-gradient(ellipse at 88% 0%, #3c2148, transparent 58%), var(--vibe-low);
}

body[data-studio-next] :is(.studio-nav-group, .studio-nav-location strong) {
  border-radius: 11px;
}

body[data-studio-next] .studio-nav-group h2 {
  color: var(--vibe-lilac);
}

body[data-studio-next] .studio-next-find kbd {
  border-radius: 5px;
}

body[data-studio-next] .studio-next-palette {
  border-radius: 22px;
  background: radial-gradient(ellipse at 100% 0%, #42244c, transparent 52%), var(--vibe-panel);
  border-color: var(--vibe-rule-strong);
  border-top-color: var(--vibe-coral);
}

body[data-studio-next] .studio-next-palette::backdrop {
  background: rgb(12 6 18 / .82);
}

body[data-studio-next] .studio-next-palette-close {
  border-radius: 50%;
}

body[data-studio-next] :is(.studio-next-palette-field, .studio-next-palette-list a) {
  border-radius: 10px;
}

body[data-studio-next] .studio-next-palette-list a:is(:hover, :focus-visible) {
  color: var(--vibe-paper);
  background: #3a2649;
}

body[data-studio-next] .studio-next-palette-arrow {
  color: var(--vibe-mint);
}

body[data-studio-next] .studio-footer {
  background: radial-gradient(ellipse at 6% 5%, #35203b, transparent 47%), var(--vibe-ink);
}

body[data-studio-next] .studio-footer-brand span {
  color: var(--vibe-mint);
}

/* Only the shared page heroes use these quiet concentric shapes. */
body[data-studio-next] #main > .hero:not([data-vibe-studio]) {
  background: radial-gradient(ellipse at 95% 8%, #49203b 0, transparent 61%);
}

body[data-studio-next] #main > .hero:not([data-vibe-studio]) .hero-grid {
  inset: -16% -7% auto auto;
  width: min(64%, 840px);
  height: auto;
  aspect-ratio: 1.18;
  border-radius: 50%;
  opacity: .65;
  transform: rotate(-19deg);
  background: radial-gradient(ellipse at 45% 49%, #ffa48d22, transparent 49%),
              repeating-radial-gradient(ellipse at 52% 50%, transparent 0 23px, #f5b6dc22 24px 25px);
  mask-image: radial-gradient(ellipse at center, #000 16%, transparent 70%);
}

body[data-studio-next] #main .section-head > .eyebrow::before {
  border-radius: 50%;
}

body[data-studio-next] #main .btn:not(:where([data-vibe-studio] *, .next-home *)) {
  border-radius: 999px;
}

body[data-studio-next] #main .btn-primary:not(:where([data-vibe-studio] *, .next-home *)) {
  color: var(--vibe-ink);
  background: var(--vibe-sunset);
  border-color: transparent;
}

body[data-studio-next] #main .btn-primary:not(:where([data-vibe-studio] *, .next-home *)):hover {
  background: #ffd1ce;
}

body[data-studio-next] #main :is(.form.card, .callout, .notice):not(:where([data-vibe-studio] *, .next-home *)) {
  border-radius: var(--vibe-radius);
}

body[data-studio-next] #main .form :is(input:not([type='radio'], [type='checkbox'], [type='hidden']), select, textarea):not(:where([data-vibe-studio] *, .next-home *)) {
  border-radius: 8px;
}

body[data-studio-next] #main .form .segmented label:not(:where([data-vibe-studio] *, .next-home *)) {
  border-radius: 999px;
}

body[data-studio-next] #main :is(.post-list .card, .forum-main .post, .wiki-facts, .wiki-cards a) {
  border-radius: 11px;
}

body[data-studio-next][data-site^='blog-'] #main .post-list .card:first-of-type {
  background: linear-gradient(124deg, #352137, var(--vibe-panel) 65%);
}

body[data-studio-next] #main.forum-main :is(.list, .post, .login-box) {
  border-radius: var(--vibe-radius);
}

body[data-studio-next][data-site='account'] #main .login-box {
  background: radial-gradient(ellipse at 50% 0%, #34203b, transparent 55%), var(--vibe-panel);
}

/* Featured frames retain the source artwork and add color around its edges. */
body[data-studio-next][data-site='games'] #main :is(#games, #browser) .card-media {
  border-radius: 13px 13px 4px 4px;
}

body[data-studio-next][data-site='games'] #main #browser .card:not(:has(.card-media)) {
  border-radius: 13px;
  border-inline-start-color: var(--vibe-mint);
  background: linear-gradient(135deg, #253035, var(--vibe-panel) 66%);
}

body[data-studio-next][data-site='nightwave'] #main > .nw-hero {
  background: #180e20;
}

body[data-studio-next][data-site='nightwave'] #main .nw-hero::after {
  background: linear-gradient(90deg, #180e20 17%, #180e20db 32%, #180e2026 70%, transparent),
              linear-gradient(0deg, #180e20f1, transparent 76%);
}

body[data-studio-next][data-site='nightwave'] #main :is(#lands .land, #media .gallery button, #about img) {
  border-radius: 10px;
}

body[data-studio-next][data-site='nightwave'] #main #features .card {
  border-radius: 0 0 11px 11px;
  background: linear-gradient(148deg, #2d223b, var(--vibe-panel));
}

body[data-studio-next][data-site='nightwave'] #main #updates .callout {
  background: linear-gradient(125deg, #26313a, var(--vibe-panel) 70%);
}

/* The label stays dark and uses the covers as the brightest surfaces. */
body[data-studio-next][data-site='music'] #main {
  --bg: #100a17;
  --bg2: #1a1023;
  --panel: #20132b;
  --panel2: #2c1c39;
  --text: var(--vibe-paper);
  --muted: var(--vibe-muted);
  --dim: var(--vibe-dim);
  --accent: var(--vibe-lilac);
  --accent2: var(--vibe-mint);
  --line: var(--vibe-rule);
  --line-strong: var(--vibe-rule-strong);
  --field: #160e20;
  --field-hover: #261834;
  --field-line: var(--vibe-rule-strong);
}

body[data-studio-next][data-site='music'] #main > .hero {
  background: radial-gradient(ellipse at 84% 30%, #38203b 0, transparent 66%);
}

body[data-studio-next][data-site='music'] #main :is(.artist-art, .artist .embed) {
  border-radius: 9px;
}

body[data-studio-next][data-site='music'] #main .artist-art {
  box-shadow: 0 16px 42px #0005;
}

body[data-studio-next][data-site='music'] #main #demo {
  background: radial-gradient(ellipse at 0% 0%, #39213d, transparent 63%), #1c1127;
}

body[data-studio-next][data-site='music'] #main #demo .form {
  --panel: #21152d;
}

body[data-studio-next][data-site='apps'] #main .ftva-hero {
  background: radial-gradient(ellipse at 84% 20%, #443052, transparent 54%),
              radial-gradient(ellipse at 65% 85%, #263337, transparent 45%), var(--vibe-ink);
}

body[data-studio-next][data-site='apps'] #main .ftva-hero::after {
  inset: -18% 0 auto auto;
  width: min(60%, 760px);
  aspect-ratio: 1.17;
  background: repeating-radial-gradient(ellipse at 52% 50%, transparent 0 20px, #dfb9f92b 21px 22px);
  transform: rotate(-24deg);
  mask-image: radial-gradient(ellipse at center, #000 10%, transparent 67%);
}

body[data-studio-next][data-site='apps'] #main .ftva-console {
  border-color: #86668d;
  background: linear-gradient(137deg, #583969, #352441 52%, #241c31);
  box-shadow: 0 29px 58px #0b061aa9, 0 0 42px #db93e324;
}

body[data-studio-next][data-site='apps'] #main :is(.ftva-app, .ftva-post, .ftva-icon) {
  border-radius: 12px;
}

body[data-studio-next][data-site='apps'] #main .ftva-app:first-child {
  background: linear-gradient(123deg, #3b2948, var(--vibe-panel) 70%);
}

body[data-studio-next][data-site='apps'] #main .ftva-app:first-child:is(:hover, :focus-within) {
  background: linear-gradient(123deg, #4a3655, var(--vibe-raised) 70%);
}

/* Only the storefront and the Aethercraft marketing page use these tokens. */
body[data-studio-next][data-site='play'] .play-next {
  --play-next-ink: var(--vibe-ink);
  --play-next-slate: var(--vibe-panel);
  --play-next-paper: var(--vibe-paper);
  --play-next-muted: var(--vibe-muted);
  --play-next-rule: var(--vibe-rule);
  --play-next-lime: var(--vibe-mint);
  background: radial-gradient(ellipse 95% 490px at 95% 4%, #432339, transparent 72%), var(--vibe-ink);
}

body[data-studio-next][data-site='play'] .play-next :is(.play-next-feature, .play-next-card, .play-next-development article) {
  border-radius: var(--vibe-radius);
}

body[data-studio-next][data-site='play'] .play-next .play-next-card {
  overflow: hidden;
}

body[data-studio-next][data-site='play'] .play-next .play-next-feature::after {
  background: linear-gradient(90deg, #140d19f0, #140d197c 48%, transparent 84%),
              linear-gradient(0deg, #140d19da, transparent 70%);
}

body[data-studio-next][data-site='play'] .ac-preview[data-ac-next] {
  --ac-ink: var(--vibe-ink);
  --ac-paper: var(--vibe-paper);
  --ac-lime: var(--vibe-mint);
  --ac-muted: var(--vibe-muted);
  --ac-rule: var(--vibe-rule);
  --ac-next-slate: var(--vibe-panel);
}

body[data-studio-next][data-site='play'] .ac-preview[data-ac-next] .ac-preview-opening::after {
  background: linear-gradient(0deg, #140d19 0, #140d19c7 22%, transparent 64%),
              linear-gradient(90deg, #140d19bb, #140d192b 53%, transparent 86%),
              linear-gradient(180deg, #140d19a8, transparent 19%);
}

body[data-studio-next][data-site='play'] :is(.play-next .play-next-cta, .ac-preview[data-ac-next] .ac-preview-play) {
  border-radius: 999px;
  background: var(--vibe-sunset);
  color: var(--vibe-ink);
}

body[data-studio-next][data-site='play'] :is(.play-next .play-next-cta, .ac-preview[data-ac-next] .ac-preview-play):hover {
  background: #ffd1ce;
  color: var(--vibe-ink);
}

body[data-studio-next][data-site='play'] .ac-preview[data-ac-next] :is(.ac-preview-frame, .ac-preview-thumbs a, .ac-preview-lightbox) {
  border-radius: 10px;
  overflow: hidden;
}

body[data-studio-next][data-site='play'] .ac-preview[data-ac-next] .ac-preview-lightbox {
  overflow: auto;
}

body[data-studio-next][data-site='play'] .ac-preview[data-ac-next] :is(.ac-next-steppers button, .ac-preview-lightbox-bar button) {
  border-radius: 8px;
}

@media (max-width: 760px) {
  body[data-studio-next] #main > .hero:not([data-vibe-studio]) .hero-grid {
    inset-block-start: 0;
    width: min(85%, 590px);
  }

  body[data-studio-next][data-site='nightwave'] #main .nw-hero::after {
    background: linear-gradient(0deg, #180e20f4 9%, #180e20bb 60%, #180e2030);
  }

  body[data-studio-next][data-site='play'] .play-next .play-next-feature::after {
    background: linear-gradient(0deg, #140d19fa 4%, #140d19c9 42%, transparent 90%);
  }

  body[data-studio-next][data-site='play'] .ac-preview[data-ac-next] .ac-preview-opening::after {
    background: linear-gradient(0deg, #140d19 2%, #140d19ed 27%, #140d1960 58%, transparent 82%),
                linear-gradient(180deg, #140d19a8, transparent 21%);
  }
}

@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    body[data-studio-next]::after { background-image: var(--vibe-sunset); }
  }
}
