/**
 * theme.css — AshemaleParadise dual-theme tokens (dark default + light).
 *
 * The whole site already references the SAME variable names on every page
 * (--bg --surface --surface2 --border --text --muted --green --purple --neon),
 * just redefined locally with dark literals. This file is the single source
 * of truth: pages that still define their own :root color block override
 * this (last-wins) until they're migrated — migrated pages delete their
 * local color :root and these tokens take over automatically.
 *
 * Theme is selected via <html data-theme="dark|light">, set by the inline
 * pre-paint script (see site-prefs.js) BEFORE first paint — no flash.
 *
 * Light-mode accent colors are intentionally darker/more saturated than their
 * dark-mode counterparts. Verified via WCAG relative-luminance contrast math
 * against the light surfaces below (not eyeballed):
 *   --green #007a4d on #ffffff  ≈ 5.6:1   (dark-mode #01FF95 on white ≈ 2.7:1 — fails AA)
 *   --purple #7a1fb0 on #ffffff ≈ 6.5:1   (dark-mode #DC86FD on white would fail similarly)
 *   --muted is a SOLID grey, not alpha-blended — alpha-over-white drifts under
 *   4.5:1 depending on what's behind it; solid #5a5764 holds ≈ 6.4:1 everywhere.
 * Components that put a dark label ON a --green/--purple background (buttons,
 * badges) are unaffected by this — that pairing already passes contrast in
 * both themes. Only "accent used as text/icon/link color on --bg/--surface"
 * needed the darker light-mode values.
 */
:root,
[data-theme="dark"] {
    --bg: #070709;
    --surface: #0f0f13;
    --surface2: #17171e;
    --border: rgba(255, 255, 255, 0.07);
    --text: #f0eef8;
    --muted: rgba(240, 238, 248, 0.45);
    --green: #01FF95;
    --purple: #DC86FD;
    --neon: #39FF14;

    /* Semantic helpers other CSS can opt into instead of raw rgba(0/255,...) literals */
    --overlay-soft: rgba(255, 255, 255, 0.05);
    --overlay-strong: rgba(255, 255, 255, 0.12);
    --shadow-color: rgba(0, 0, 0, 0.6);
    --scrim: rgba(0, 0, 0, 0.7);
    color-scheme: dark;
}

[data-theme="light"] {
    --bg: #f7f7fa;
    --surface: #ffffff;
    --surface2: #eef0f4;
    --border: rgba(0, 0, 0, 0.10);
    --text: #15131c;
    --muted: #5a5764;
    --green: #007a4d;
    --purple: #7a1fb0;
    --neon: #007a4d;

    --overlay-soft: rgba(0, 0, 0, 0.04);
    --overlay-strong: rgba(0, 0, 0, 0.10);
    --shadow-color: rgba(20, 18, 28, 0.16);
    --scrim: rgba(15, 13, 20, 0.55);
    color-scheme: light;
}

/* Site logo swap: the SVG wordmark is white/light-colored (made for the dark
   background) and disappears on the light surface. .theme-logo marks every
   <img> that renders it so light mode can swap in the black wordmark instead.
   sp-blacklogo.png is a much wider lockup (~6.3:1) than the slots were sized
   for (~1.6-3:1). Every page has its own unscoped `width:auto` rule for these
   <img> tags (e.g. `.nav-logo img{height:40px;width:auto}`) — if only height
   is overridden here, BOTH width and height end up auto and the browser falls
   back to the image's intrinsic 5509x870px size (the "logo exploded" bug).
   !important forces both dimensions so neither can fall through to auto. */
[data-theme="light"] img.theme-logo {
    content: url(/icons/sp-blacklogo.png);
    height: 24px !important;
    width: auto !important;
    max-width: 160px;
    object-fit: contain;
}

/* Respect OS preference only when the visitor hasn't made an explicit choice
   (no localStorage pref_theme yet). The pre-paint script in site-prefs.js
   already resolves this before paint — this media query is a CSS-only
   fallback for the rare case JS is disabled. */
@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
        --bg: #f7f7fa;
        --surface: #ffffff;
        --surface2: #eef0f4;
        --border: rgba(0, 0, 0, 0.10);
        --text: #15131c;
        --muted: #5a5764;
        --green: #007a4d;
        --purple: #7a1fb0;
        --neon: #007a4d;
        color-scheme: light;
    }
}

/* ── Reward username styles (rewards.php rw_styleDefinitions()) ──────────
   Shared here so the class works everywhere a username is rendered (comments,
   /user/{id}/ profile, dashboard) — previously .username-thunder only had CSS
   in dashboard/index.php's own inline <style>, so it silently no-opped
   anywhere else. Kept intentionally lightweight (CSS gradients/animation,
   no embedded images) — cheaper to ship and just as readable as a flair. */
.username-white   { color: var(--text); }
/* !important on color/background throughout this block: these classes get
   combined with a page-specific heading class wherever a username renders
   (e.g. user/profile.php's "user-hero-name username-thunder") — with equal
   selector specificity, whichever rule loads later in the cascade wins, and
   a page's own <style> (which loads after render_theme_head()'s inlined
   theme.css) was silently overriding color:transparent and killing the
   gradient. !important makes these flair rules win regardless of load order. */

/* forced-color-adjust:none on every flair class below (2026-09-08, reported
   "no effect at all on mobile"): couldn't reproduce via Playwright — real
   device emulation (iPhone 13, DPR 3) and headless mobile viewports both
   render the gradient correctly, computed styles confirm background-clip:
   text + color:transparent are applied either way. The one mobile-only
   mechanism that CAN'T be tested headless and matches "flattens to plain
   text, not literally invisible" is Android Chrome's own auto/forced-dark
   rewriting: it heuristically repaints page colors on top of the site's own
   theme, and text using color:transparent + background-clip:text is exactly
   the kind of non-standard color trick that rewrite can flatten to a solid
   color, silently killing the gradient. forced-color-adjust:none opts these
   specific elements out of that rewrite; it's a no-op everywhere else. */
.username-thunder, .username-gold, .username-neon, .username-gradient, .username-aurora {
    forced-color-adjust: none;
}

/* thunder: shimmering gradient text-clip PLUS an animated spark PARTICLE
   FIELD wrapped around it (2026-09-08: replaces the old shared GIF,
   icons/username-thunder.gif — every style pointed at the exact same file,
   so none of them actually looked distinct from each other; each style now
   gets its own generated radial-gradient texture, no image asset or extra
   request needed, see bcx-particles-drift/twinkle below), PLUS a
   lightning-strike flicker (bcx-thunder-flicker) — a bright white
   double-flash near the end of each loop, like a bolt striking, instead of
   a constant smooth glow. The particle field sits in a ::before layered
   behind the text via z-index:-1 — .username-thunder's own background is
   the gradient clipped to the glyph shapes (background-clip:text),
   transparent everywhere outside the letters, so the particles show through
   in the gaps/padding around the text. */
.username-thunder {
    position: relative; display: inline-block;
    isolation: isolate;
    padding: 1px 5px; border-radius: 3px;
    /* 2026-09-08: colores fijos, no var(--green) (reportado "no veo ningun
       efecto"; causa real: en tema claro var(--green) es #007a4d, un verde
       oscuro/apagado, y este gradiente tambien tiene tramos en blanco --
       texto blanco con background-clip sobre un fondo claro se vuelve
       literalmente invisible). Estos son efectos cosmeticos de trofeo, no
       texto de UI: deben verse igual de vibrantes sin importar el tema del
       sitio, igual que aurora ya hace (100% hardcoded, sin variables). */
    background: linear-gradient(100deg,
        #01FF95 0%, #baffe0 10%, #fff 16%, #01FF95 26%,
        #01FF95 50%, #00eaff 62%, #fff 68%, #01FF95 78%, #01FF95 100%) !important;
    background-size: 320% auto;
    -webkit-background-clip: text !important; background-clip: text !important;
    -webkit-text-fill-color: transparent !important; color: transparent !important;
    font-weight: 700;
    animation: bcx-thunder-flow 2.2s linear infinite, bcx-thunder-flicker 3.6s ease-in-out infinite;
}
@keyframes bcx-thunder-flow {
    0%   { background-position: 0% center; }
    100% { background-position: -320% center; }
}
@keyframes bcx-thunder-flicker {
    0%, 90%, 100% { filter: drop-shadow(0 0 2px rgba(1, 255, 149, .5)); }
    91%           { filter: drop-shadow(0 0 12px rgba(255, 255, 255, .95)) brightness(1.5); }
    93%           { filter: drop-shadow(0 0 2px rgba(1, 255, 149, .4)); }
    95%           { filter: drop-shadow(0 0 16px #fff) brightness(1.7); }
    97%           { filter: drop-shadow(0 0 2px rgba(1, 255, 149, .5)); }
}
.username-thunder::before {
    content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 3px;
    background-image:
        radial-gradient(circle at 15% 25%, #fff 0, transparent 2px),
        radial-gradient(circle at 55% 60%, #01FF95 0, transparent 2.2px),
        radial-gradient(circle at 80% 20%, #00eaff 0, transparent 1.8px),
        radial-gradient(circle at 35% 85%, #fff 0, transparent 1.6px);
    background-size: 34px 34px;
    animation: bcx-particles-drift 4s linear infinite, bcx-particles-twinkle 1.8s ease-in-out infinite;
}
/* All non-white styles share the same particle-wrap box model as thunder
   (position:relative + padding + border-radius, plus a ::before behind the
   text at z-index:-1 showing its own generated particle field) — the user
   wants that wrap on every style, not just thunder. For the background-clip
   ones (gold/gradient/aurora) the gradient is clipped to the glyph shapes,
   transparent everywhere else, so the particles show through the gaps
   exactly like thunder. For neon (solid color + text-shadow, no clip) the
   particles just show in the padding around the text normally. Each
   ::before below is defined individually right after its style, with its
   own colors/tile size/speed — see the shared bcx-particles-drift/twinkle
   keyframes after the aurora block for how "drift" and "twinkle" work. */
.username-gold, .username-neon, .username-gradient, .username-aurora {
    position: relative; display: inline-block;
    isolation: isolate;
    padding: 1px 5px; border-radius: 3px;
}
.username-gold {
    background: linear-gradient(100deg, #b8860b 0%, #ffd700 45%, #fff7c2 55%, #ffd700 65%, #b8860b 100%) !important;
    background-size: 250% auto;
    -webkit-background-clip: text !important; background-clip: text !important;
    -webkit-text-fill-color: transparent !important; color: transparent !important;
    font-weight: 800; animation: bcx-style-shimmer 3s linear infinite, bcx-gold-flicker 3.6s ease-in-out infinite;
}
/* gold: same coin-glint idea as thunder's lightning flicker, just warm
   instead of green/white — a bright flash near the end of each loop. */
@keyframes bcx-gold-flicker {
    0%, 90%, 100% { filter: drop-shadow(0 0 2px rgba(255, 215, 0, .5)); }
    91%           { filter: drop-shadow(0 0 12px #fff7c2) brightness(1.5); }
    93%           { filter: drop-shadow(0 0 2px rgba(255, 215, 0, .4)); }
    95%           { filter: drop-shadow(0 0 16px #fff7c2) brightness(1.7); }
    97%           { filter: drop-shadow(0 0 2px rgba(255, 215, 0, .5)); }
}
.username-gold::before {
    content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 3px;
    background-image:
        radial-gradient(circle at 20% 30%, #fff7c2 0, transparent 2px),
        radial-gradient(circle at 65% 70%, #ffd700 0, transparent 2.4px),
        radial-gradient(circle at 85% 25%, #fff7c2 0, transparent 1.6px);
    background-size: 30px 30px;
    animation: bcx-particles-drift 7s linear infinite reverse, bcx-particles-twinkle 2.6s ease-in-out infinite;
}
/* neon: no gradient/background-clip here (plain color + text-shadow), so
   the flicker pulses text-shadow intensity instead of filter — reads as an
   actual neon tube stuttering rather than a smooth glow.
   2026-09-08: color fijo #39FF14, no var(--neon) -- mismo motivo que
   thunder arriba (var(--neon) es #007a4d, verde oscuro, en tema claro:
   un tubo de neon "apagado" no se distingue de texto normal). */
.username-neon {
    color: #39FF14 !important; font-weight: 700;
    text-shadow: 0 0 6px #39FF14, 0 0 14px rgba(57, 255, 20, .5);
    animation: bcx-neon-flicker 3.6s ease-in-out infinite;
}
@keyframes bcx-neon-flicker {
    0%, 90%, 100% { text-shadow: 0 0 6px #39FF14, 0 0 14px rgba(57, 255, 20, .5); }
    91%           { text-shadow: 0 0 2px #39FF14, 0 0 4px rgba(57, 255, 20, .3); }
    93%           { text-shadow: 0 0 10px #39FF14, 0 0 22px rgba(57, 255, 20, .8); }
    95%           { text-shadow: 0 0 1px #39FF14, 0 0 3px rgba(57, 255, 20, .2); }
    97%           { text-shadow: 0 0 6px #39FF14, 0 0 14px rgba(57, 255, 20, .5); }
}
.username-neon::before {
    content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 3px;
    background-image:
        radial-gradient(circle at 25% 50%, #39FF14 0, transparent 2.6px),
        radial-gradient(circle at 75% 35%, #39FF14 0, transparent 2px);
    background-size: 42px 42px;
    animation: bcx-particles-drift 5s linear infinite, bcx-particles-twinkle 3.6s ease-in-out infinite;
}
/* gradient: was fully static (no movement at all); background-size needs
   room beyond 100% for bcx-style-shimmer to actually slide, plus its own
   purple/green flash to match the others' flicker rhythm.
   2026-09-08: colores fijos, no var(--purple)/var(--green) -- mismo motivo
   que thunder/neon arriba (en tema claro son un morado y un verde oscuros,
   pensados para texto de UI legible sobre blanco, no para un efecto
   llamativo que deberia verse igual de vibrante en cualquier tema). */
.username-gradient {
    background: linear-gradient(90deg, #DC86FD, #01FF95) !important;
    background-size: 250% auto;
    -webkit-background-clip: text !important; background-clip: text !important;
    -webkit-text-fill-color: transparent !important; color: transparent !important;
    font-weight: 800;
    animation: bcx-style-shimmer 3s linear infinite, bcx-gradient-flicker 3.6s ease-in-out infinite;
}
@keyframes bcx-gradient-flicker {
    0%, 90%, 100% { filter: drop-shadow(0 0 2px #DC86FD); }
    91%           { filter: drop-shadow(0 0 12px #01FF95) brightness(1.5); }
    93%           { filter: drop-shadow(0 0 2px #DC86FD); }
    95%           { filter: drop-shadow(0 0 16px #01FF95) brightness(1.7); }
    97%           { filter: drop-shadow(0 0 2px #DC86FD); }
}
.username-gradient::before {
    content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 3px;
    background-image:
        radial-gradient(circle at 20% 30%, #DC86FD 0, transparent 5px),
        radial-gradient(circle at 70% 65%, #01FF95 0, transparent 4px),
        radial-gradient(circle at 45% 80%, #DC86FD 0, transparent 3px);
    background-size: 50px 50px;
    animation: bcx-particles-drift 9s linear infinite reverse, bcx-particles-twinkle 4s ease-in-out infinite;
}
/* aurora ('legendary' achievement — 100,000 views on a single short, see
   rewards.php — the most exclusive style): lives IN the text itself (same
   background-clip:text technique as thunder/gold), not as a background
   behind it. Two animations run together for a "living" aurora feel: the
   multi-color gradient scrolls through the letters (bcx-aurora-flow) while
   filter:hue-rotate continuously shifts every color in that gradient
   (bcx-aurora-hue) — the combination reads as shifting northern-lights
   color rather than a single gradient just sliding sideways. */
.username-aurora {
    background: linear-gradient(120deg,
        #01FF95 0%, #39FF14 16%, #00d4ff 32%, #7a5cff 48%,
        #DC86FD 64%, #00d4ff 80%, #01FF95 100%) !important;
    background-size: 400% auto;
    -webkit-background-clip: text !important; background-clip: text !important;
    -webkit-text-fill-color: transparent !important; color: transparent !important;
    font-weight: 800;
    animation: bcx-aurora-flow 6s ease-in-out infinite, bcx-aurora-hue 9s linear infinite;
}
@keyframes bcx-aurora-flow {
    0%, 100% { background-position: 0% center; }
    50%      { background-position: 100% center; }
}
/* hue-rotate PLUS the bright-white double-flash live in the same
   `filter` value at every step — two separate `animation:` entries can't
   each own `filter`, since with simultaneous animations on one property
   the one listed later in the shorthand simply wins outright (no
   blending), which would silently cancel the hue-rotate the moment the
   flicker played. Folding the flash into this keyframe is the only way to
   keep both running together, so aurora reads as the most "alive" style
   without losing its northern-lights hue shift. */
@keyframes bcx-aurora-hue {
    0%, 89%, 100% { filter: hue-rotate(0deg); }
    91%           { filter: hue-rotate(146deg) drop-shadow(0 0 12px #fff) brightness(1.5); }
    93%           { filter: hue-rotate(219deg); }
    95%           { filter: hue-rotate(292deg) drop-shadow(0 0 16px #fff) brightness(1.7); }
    97%, 99%      { filter: hue-rotate(354deg); }
}
.username-aurora::before {
    content: ''; position: absolute; inset: 0; z-index: -1; border-radius: 3px;
    background-image:
        radial-gradient(circle at 20% 30%, #01FF95 0, transparent 7px),
        radial-gradient(circle at 60% 20%, #00d4ff 0, transparent 6px),
        radial-gradient(circle at 80% 70%, #DC86FD 0, transparent 6px),
        radial-gradient(circle at 35% 75%, #7a5cff 0, transparent 5px);
    background-size: 70px 70px;
    animation: bcx-particles-drift 12s linear infinite, bcx-particles-twinkle 5s ease-in-out infinite;
}
@keyframes bcx-style-shimmer {
    0% { background-position: 0% center; }
    100% { background-position: -250% center; }
}
/* Particle field shared by every ::before above (2026-09-08, replaces the
   single shared GIF everyone used to point at): "drift" slowly pans the
   tiled radial-gradient dots diagonally (reads as floating/scrolling since
   the background repeats), "twinkle" pulses overall opacity so the field
   feels alive rather than static. Each style keeps its own colors, tile
   size (bigger tile = sparser/larger particles) and animation duration/
   direction (see each ::before above) so thunder's fast green sparks don't
   look like aurora's slow soft wisps despite sharing these two keyframes. */
@keyframes bcx-particles-drift {
    0%   { background-position: 0 0; }
    100% { background-position: 100% 100%; }
}
@keyframes bcx-particles-twinkle {
    0%, 100% { opacity: .35; }
    50%      { opacity: .8; }
}
/* 2026-09-08: antes había un bloque @media (prefers-reduced-motion: reduce)
   que apagaba la animación de estos 5 estilos -- reportado "no veo ningún
   movimiento", confirmado en vivo que el causante era exactamente esta
   media query (activada por una preferencia de accesibilidad del SO/
   navegador, invisible desde caché o modo incógnito). A pedido explícito
   del dueño del sitio se quita: son un efecto cosmético chico (brillo/
   partículas en el nombre), no una animación a pantalla completa, así que
   se decidió que animen siempre sin importar esa preferencia. */
