/* =========================================================
   PERF LITE — cheap-rendering overrides for weak devices.
   Loaded LAST. Active only when perf.js adds `perf-lite`
   to <html>. Nothing here changes the interface: the same
   elements stay visible in the same places with the same
   colors — only continuous animations are frozen and
   per-frame GPU work (blur, refraction, pointer FX) is cut.
   ========================================================= */

/* ---------------------------------------------------------
   1. FREEZE AMBIENT ANIMATIONS
   The aurora blobs + starfield stay visible but stop moving.
   A static huge blur costs one paint; an animated one costs
   a full backdrop-filter recompute on EVERY frame.
   --------------------------------------------------------- */
html.perf-lite .app-bg::before,
html.perf-lite .app-bg::after {
    animation: none;
    will-change: auto;
    filter: blur(48px); /* softer blur, visually near-identical */
}
html.perf-lite .wow-stars {
    animation: none;
}

/* shimmering text gradients: keep the gradient, stop the pan */
html.perf-lite .wc-brand-name,
html.perf-lite .logo-name,
html.perf-lite .wc-title {
    animation: none;
}

/* pulsing/breathing dots and buttons */
html.perf-lite .hdr .logo-dot { animation: none; }
html.perf-lite .dock-btn.active,
html.perf-lite .dock-btn.on { animation: none; }

/* ---------------------------------------------------------
   2. CHEAPER GLASS
   Smaller blur radii for every backdrop-filter surface.
   Still glassy, ~4x cheaper to composite.
   --------------------------------------------------------- */
html.perf-lite {
    --lg-blur: 8px;
    --lg-sat: 130%;
    --lgc-blur: 8px;
    --lgc-sat: 130%;
}

/* drop the SVG displacement refraction (very expensive) but
   keep the plain blur so the dock/header look the same */
html.perf-lite .dock,
html.perf-lite .hdr {
    backdrop-filter: blur(8px) saturate(130%);
    -webkit-backdrop-filter: blur(8px) saturate(130%);
}

/* ---------------------------------------------------------
   3. POINTER EFFECTS OFF
   Shine/spotlight layers repaint on every mouse move.
   They are hover-only decorations — removing them does not
   change the resting interface at all.
   --------------------------------------------------------- */
html.perf-lite .lg-shine { display: none; }
html.perf-lite .wow-spot::after { display: none; }
html.perf-lite .welcome-card.wow-spot::before {
    display: none !important;
    content: none !important;
}

/* shimmer sweep on primary buttons (hover-only decoration) */
html.perf-lite .btn-primary::after,
html.perf-lite #joinBtn::after { display: none; }

/* ---------------------------------------------------------
   4. LAZY RENDERING FOR LONG LISTS
   Off-screen chat messages and member rows skip layout and
   paint entirely until scrolled into view.
   --------------------------------------------------------- */
html.perf-lite .chat-row,
html.perf-lite .member {
    content-visibility: auto;
    contain-intrinsic-size: auto 48px;
}

/* ---------------------------------------------------------
   5. SHORTER TRANSITIONS
   Interactions still glide, just quicker (fewer animated
   frames per interaction on a slow GPU).
   --------------------------------------------------------- */
html.perf-lite {
    --sm-fast: 100ms;
    --sm-med: 160ms;
    --sm-slow: 240ms;
}
