/* Profile effects polish (2026-11-19): colour themes that show, GIF banners under effects, page backgrounds that fill
   the screen and card replays. Loaded last, after customize.css. */

/* ---------- Colour theme ----------
   The theme used to colour only the empty banner, so with a picture or a banner effect it changed nothing.
   Like a Discord profile theme it now tints the whole card: a soft gradient from the top, a tinted rim and avatar ring.
   An own card colour or a background effect still wins over it. */
.theme-sunset { --th-a: #ff785e; --th-b: #ad3f61; }
.theme-bloom { --th-a: #ed59df; --th-b: #8134b2; }
.theme-sky { --th-a: #63e5ff; --th-b: #285fc0; }
.theme-night { --th-a: #9b78ff; --th-b: #4a3290; }
.theme-aurora { --th-a: #4fe3b0; --th-b: #0f6a64; }
.theme-gold { --th-a: #ffc857; --th-b: #a3621a; }
.theme-crimson { --th-a: #ff4d6d; --th-b: #8a1434; }
.theme-ocean { --th-a: #3aa0ff; --th-b: #0d3a86; }
.theme-sakura { --th-a: #ffa3c7; --th-b: #a24a78; }
.theme-mono { --th-a: #c3c7d4; --th-b: #4a4e5c; }
:is(.reel-card, .hero-card, .pop-card, .studio-preview, .pp)[class*="theme-"]:not(.has-card-color):not(.pp-neutral) {
  --th-top: color-mix(in srgb, var(--th-b) 34%, var(--surface, #1b161e));
  --th-mid: color-mix(in srgb, var(--th-a) 10%, var(--surface, #1b161e));
}
:is(.reel-card, .hero-card, .pop-card, .studio-preview, .pp)[class*="theme-"]:not(.has-card-color):not(.pp-neutral):not(:has(> .fx-background)):not(:has(> .studio-content > .fx-background)) {
  background: linear-gradient(170deg, var(--th-top) 0%, var(--th-mid) 46%, var(--surface, #1b161e) 100%);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--th-a) 22%, transparent), 0 18px 40px -26px color-mix(in srgb, var(--th-b) 70%, transparent);
}
.pp[class*="theme-"]:not(.has-card-color):not(.pp-neutral):not(.has-fx-bg) { background: linear-gradient(180deg, var(--th-top) 0, var(--th-mid) 380px, var(--surface, #1b161e) 900px); border-color: color-mix(in srgb, var(--th-a) 26%, var(--line)); }
.reel-card[class*="theme-"]:not(.has-card-color) .reel-avatar .avatar { box-shadow: 0 0 0 5px var(--th-top, var(--surface)); }

/* ---------- Banner effects over a picture or GIF ----------
   The scene drops its own sky (scenes.js) and dims the picture at the edges, so the GIF stays visible under the effect. */
.fx-canvas[data-image="true"] { z-index: 1; }

/* ---------- The plain banner ----------
   Without a picture or effect the banner showed big outline glyphs (asterisk, ring). Now it is the theme gradient with a
   soft sheen and a slow light that drifts across, closer to a Discord profile without a banner image. */
:is(.profile-banner, .detail-banner, .studio-banner, .hero-card-banner):not(:has(.fx-canvas, .sakura-canvas, .mtf, .pp-banner-img))::before {
  content: ''; position: absolute; inset: 0; z-index: 0; font-size: 0; pointer-events: none;
  background: radial-gradient(70% 120% at 82% -10%, rgb(255 255 255 / .22), transparent 60%), radial-gradient(60% 90% at 10% 120%, rgb(0 0 0 / .32), transparent 70%);
  transform: none; left: 0; top: 0; right: 0; bottom: 0; width: auto; height: auto; border: 0; border-radius: 0;
}
:is(.profile-banner, .detail-banner, .studio-banner, .hero-card-banner):not(:has(.fx-canvas, .sakura-canvas, .mtf, .pp-banner-img))::after {
  content: ''; position: absolute; z-index: 0; pointer-events: none; font-size: 0; border: 0; border-radius: 50%;
  left: -20%; top: -60%; bottom: auto; right: auto; width: 60%; height: 220%; transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / .1), transparent); filter: blur(6px);
}
.effect-motion:is(.profile-banner, .detail-banner, .studio-banner, .hero-card-banner):not(:has(.fx-canvas, .sakura-canvas, .mtf, .pp-banner-img))::after { animation: banner-sheen 9s ease-in-out infinite; }
@keyframes banner-sheen { 0%, 100% { translate: 0 0; opacity: 0; } 15% { opacity: 1; } 55% { translate: 230% 0; opacity: 1; } 70% { opacity: 0; } }
.effect-particle { display: none; }
@media (prefers-reduced-motion: reduce) { :is(.profile-banner, .detail-banner, .studio-banner, .hero-card-banner)::after { animation: none !important; } }

/* ---------- Background effect on the profile page ----------
   It used to span the whole (tall) profile and draw its art at a fixed size, so everything hung at the top and the rest
   stayed empty. Now it is one screen high and sticks while you scroll: the art always fills what you see. */
.pp > .fx-background[data-fit="page"] { position: sticky; top: 0; display: block; width: 100%; height: 100vh; height: 100dvh; margin-bottom: -100vh; margin-bottom: -100dvh; inset: auto; border-radius: inherit; }
.pp.has-fx-bg:not(.has-fx-border):has(> .fx-background[data-fit="page"]) { overflow: clip; }
/* With a card border the card must not clip: the border art reaches past the card edge (see borders.css).
   The sticky background never gets taller than the card (scenes.js) and rounds its own corners, so it needs no clip. */
.pp.has-fx-bg.has-fx-border:has(> .fx-background[data-fit="page"]) { overflow: visible; }

/* ---------- Replays ----------
   effects.js plays an effect's intro again now and then; the old frame fades out first, so the restart never jumps. */
:is(.fx-canvas, .fx-border, .sakura-canvas) { transition: opacity .5s ease; }
:is(.fx-canvas, .fx-border, .sakura-canvas).fx-replay-out { opacity: 0; }
