/* Tailwind's display utilities (flex, grid...) would otherwise beat the [hidden] attribute and keep "hidden" panels, chips and badges on screen. */
[hidden] { display: none !important; }

/* Deterministic gradient fallback for covers without artwork. */
.cover-fallback {
  background: linear-gradient(135deg,
    hsl(calc(var(--seed) * 47deg), 85%, 55%),
    hsl(calc(var(--seed) * 47deg + 50deg), 80%, 42%));
}
.cd-box { min-width: 2.75rem; border-radius: .5rem; background: #18181b; padding: .35rem .25rem; text-align: center; }
.cd-box b { display: block; font-size: 1.15rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.cd-box small { display: block; font-size: .6rem; text-transform: uppercase; letter-spacing: .08em; color: #a1a1aa; }
.nav-link.is-active { background: #18181b; color: #b366ff; }
#sidebar.open { transform: translateX(0); }

/* Cambria Bold for headings, wordmark and labels. Cambria has only Regular and Bold,
   so any weight of 600+ renders as true Bold. Body copy stays Regular for readability. */
h1, h2, h3, h4, .font-display, button, .nav-link, label { font-weight: 700; }

/* ======================================================================================================
   Heat: the more 🔥 a song has (fire minus trash), the more the edges of its card / row burn.
   Tiers are set by data-heat on the song:  ember 10+ · spark 50+ · flame-s 150+ · flame-m 500+ ·
   flame-l 1500+ · ash 5000+ (purple crystallised, sparkling ash).  Keep the numbers in sync with
   heat_tier() in apps/music/templatetags/music_extras.py and heatTier() in static/js/app.js.
   The ember / spark / fire animations themselves are drawn on a <canvas> by static/js/app.js (random,
   never repeating); this file only adds the irregular glow around the edges and the purple ash.
   ====================================================================================================== */
@property --heat-angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

[data-heat]:not([data-heat=""]) { position: relative; isolation: isolate; }
.heat-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; border-radius: inherit; }

/* Glow: irregular flicker (uneven keyframe timing so it never looks like a steady pulse) */
[data-heat="ember"] { --glow: rgba(255,120,30,.55); animation: heat-glow 3.7s linear infinite; }
[data-heat="spark"] { --glow: rgba(255,185,60,.6);  animation: heat-glow 2.3s linear infinite; }
[data-heat="flame-s"] { --glow: rgba(255,110,20,.7);  animation: heat-glow 1.9s linear infinite; }
[data-heat="flame-m"] { --glow: rgba(255,90,15,.85);  animation: heat-glow 1.5s linear infinite; }
[data-heat="flame-l"] { --glow: rgba(255,70,10,.95);  animation: heat-glow 1.2s linear infinite; }
@keyframes heat-glow {
  0%   { box-shadow: inset 0 -10px 18px -8px var(--glow), inset 0 0 10px -4px var(--glow), 0 0 8px 0 var(--glow); }
  9%   { box-shadow: inset 0 -16px 26px -8px var(--glow), inset 0 0 16px -4px var(--glow), 0 0 15px 2px var(--glow); }
  17%  { box-shadow: inset 0 -8px 15px -8px var(--glow),  inset 0 0 9px -4px var(--glow),  0 0 7px 0 var(--glow); }
  31%  { box-shadow: inset 0 -14px 22px -8px var(--glow), inset 0 0 13px -4px var(--glow), 0 0 12px 1px var(--glow); }
  38%  { box-shadow: inset 0 -19px 30px -8px var(--glow), inset 0 0 18px -4px var(--glow), 0 0 18px 3px var(--glow); }
  52%  { box-shadow: inset 0 -9px 16px -8px var(--glow),  inset 0 0 10px -4px var(--glow), 0 0 9px 0 var(--glow); }
  64%  { box-shadow: inset 0 -15px 24px -8px var(--glow), inset 0 0 15px -4px var(--glow), 0 0 14px 2px var(--glow); }
  73%  { box-shadow: inset 0 -11px 19px -8px var(--glow), inset 0 0 11px -4px var(--glow), 0 0 10px 1px var(--glow); }
  88%  { box-shadow: inset 0 -17px 27px -8px var(--glow), inset 0 0 17px -4px var(--glow), 0 0 16px 2px var(--glow); }
  100% { box-shadow: inset 0 -10px 18px -8px var(--glow), inset 0 0 10px -4px var(--glow), 0 0 8px 0 var(--glow); }
}

/* ---- 5000+  PURPLE CRYSTALLISED, SPARKLING ASH ---- */
[data-heat="ash"] { animation: heat-glow-ash 3s ease-in-out infinite; }
[data-heat="ash"]::before, [data-heat="ash"]::after { content: ""; position: absolute; pointer-events: none; z-index: 2; border-radius: inherit; }
[data-heat="ash"]::before {   /* a shimmering faceted crystal border */
  inset: 0; padding: 3px;
  background: conic-gradient(from var(--heat-angle), #7400ce, #c9a0ff, #ffffff, #a855f7, #3b0764, #d8b4fe, #7400ce);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: heat-spin 5s linear infinite;
}
[data-heat="ash"]::after {    /* sparkles, drifting ash and a light glint sweeping across the crystal */
  inset: 0;
  background:
    linear-gradient(115deg, transparent 42%, rgba(255,255,255,.35) 50%, transparent 58%) 0 0 / 250% 100%,
    radial-gradient(circle, #ffffff 0 1.2px, transparent 2.4px) 12% 20% / 52px 61px,
    radial-gradient(circle, #e9d5ff 0 1px, transparent 2.2px) 64% 70% / 43px 49px,
    radial-gradient(circle, #c084fc 0 1.4px, transparent 2.6px) 88% 35% / 57px 47px,
    radial-gradient(circle, rgba(216,180,254,.8) 0 .8px, transparent 1.8px) 40% 90% / 31px 37px;
  animation: heat-glint 3.2s ease-in-out infinite, heat-twinkle-soft 1.3s ease-in-out infinite alternate;
}
@keyframes heat-glow-ash {
  0%, 100% { box-shadow: inset 0 0 16px -2px rgba(168,85,247,.55), 0 0 12px 1px rgba(116,0,206,.6); }
  50%      { box-shadow: inset 0 0 26px -2px rgba(192,132,252,.8), 0 0 22px 3px rgba(139,40,230,.8); }
}
@keyframes heat-twinkle-soft { from { opacity: .55; } to { opacity: 1; } }
@keyframes heat-spin    { to { --heat-angle: 360deg; } }
@keyframes heat-glint   { 0% { background-position: 150% 0, 12% 20%, 64% 70%, 88% 35%, 40% 90%; }
                          60%, 100% { background-position: -50% 0, 12% 20%, 64% 70%, 88% 35%, 40% 90%; } }

li[data-heat]:not([data-heat=""]) { overflow: hidden; }

/* ======================================================================================================
   Rot: the more 🗑️ a song has, the dirtier it looks.  grime -10 · dirty -50 · drip-s -150 · drip-m -500 ·
   litter -1500 · dookie -5000.  Each stage keeps everything from the one before.  Here: the dirt, stains and
   murky edges.  The dripping trash juice, the pieces of trash and the dookie are drawn by static/js/app.js.
   ====================================================================================================== */
[data-heat="grime"]   { --grime: .16; --vig: .35; --mold: 0; --hue: 0deg; }
[data-heat="dirty"]   { --grime: .28; --vig: .5; --mold: .1; --hue: 5deg; }
[data-heat="drip-s"]  { --grime: .38; --vig: .6; --mold: .16; --hue: 11deg; }
[data-heat="drip-m"]  { --grime: .5;  --vig: .72; --mold: .22; --hue: 17deg; }
[data-heat="litter"]  { --grime: .62; --vig: .84; --mold: .3; --hue: 22deg; }
[data-heat="dookie"]  { --grime: .74; --vig: .95; --mold: .38; --hue: 30deg; }
:is([data-heat="grime"], [data-heat="dirty"], [data-heat="drip-s"], [data-heat="drip-m"], [data-heat="litter"], [data-heat="dookie"]) {
  filter: sepia(calc(var(--grime) * .8)) hue-rotate(var(--hue, 0deg)) saturate(calc(1 - var(--grime) * .45)) brightness(calc(1 - var(--grime) * .3));
  box-shadow: inset 0 0 22px 3px rgba(38, 30, 6, var(--vig)), inset 0 -16px 26px -6px rgba(28, 38, 4, var(--vig));
}
:is([data-heat="grime"], [data-heat="dirty"], [data-heat="drip-s"], [data-heat="drip-m"], [data-heat="litter"], [data-heat="dookie"])::before {      /* dirt: dark build-up along the bottom, blotchy stains and fine grit */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  mix-blend-mode: multiply; opacity: calc(var(--grime) * 1.15);
  background:
    linear-gradient(to top, rgba(28, 22, 5, .85), transparent 40%),
    linear-gradient(to right, rgba(34, 28, 6, .45), transparent 14%, transparent 86%, rgba(34, 28, 6, .45)),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='360' height='360'><filter id='s' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.012 .02' numOctaves='4' seed='11'/><feColorMatrix values='0 0 0 0 .24  0 0 0 0 .17  0 0 0 0 .05  2.1 0 0 0 -.82'/></filter><rect width='100%' height='100%' filter='url(%23s)'/></svg>") 0 0 / cover,
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' seed='7'/><feColorMatrix values='0 0 0 0 .27  0 0 0 0 .2  0 0 0 0 .06  0 0 0 1.1 -.3'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
:is([data-heat="grime"], [data-heat="dirty"], [data-heat="drip-s"], [data-heat="drip-m"], [data-heat="litter"], [data-heat="dookie"])::after {       /* greasy mould-coloured spots that spread as it gets worse */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  mix-blend-mode: multiply; opacity: var(--mold, 0);
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='m' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='.07 .09' numOctaves='3' seed='5'/><feColorMatrix values='0 0 0 0 .07  0 0 0 0 .1  0 0 0 0 .03  6 0 0 0 -3.7'/></filter><rect width='100%' height='100%' filter='url(%23m)'/></svg>") 0 0 / cover;
}


@media (prefers-reduced-motion: reduce) {
  [data-heat], [data-heat]::before, [data-heat]::after { animation: none !important; }
}

/* ===== Supporter name styles (BetterTTV-style) =====
   Applied as <span class="nm nm-<style>">. Gradient styles clip the gradient to the text. */
.nm { font-weight: 700; }
.nm-pink   { color: #ff4fa3; }
.nm-cyan   { color: #22d3ee; }
.nm-gold   { color: #fbbf24; }
.nm-lime   { color: #a3e635; }
.nm-orange { color: #fb923c; }
.nm-violet { color: #a78bfa; }

.nm-sunset, .nm-ocean, .nm-neon, .nm-candy, .nm-goldleaf, .nm-rainbow, .nm-fire, .nm-chrome, .nm-aurora {
  color: transparent; -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  background-size: 200% 100%;
}
.nm-sunset   { background-image: linear-gradient(90deg, #ff9a3c, #ff3d77, #b44cff); background-size: 100% 100%; }
.nm-ocean    { background-image: linear-gradient(90deg, #22d3ee, #3b82f6, #6366f1); background-size: 100% 100%; }
.nm-neon     { background-image: linear-gradient(90deg, #39ff14, #00e5ff); background-size: 100% 100%; }
.nm-candy    { background-image: linear-gradient(90deg, #ff8ad8, #8be9ff, #ff8ad8); background-size: 100% 100%; }
.nm-goldleaf { background-image: linear-gradient(90deg, #b8860b, #ffe27a, #d4a017, #fff3b0, #b8860b); background-size: 100% 100%; }

.nm-glow-purple { color: #e9d5ff; text-shadow: 0 0 6px #a855f7, 0 0 14px #7400ce; }
.nm-glow-cyan   { color: #cffafe; text-shadow: 0 0 6px #22d3ee, 0 0 14px #0891b2; }
.nm-glow-red    { color: #fee2e2; text-shadow: 0 0 6px #ef4444, 0 0 14px #b91c1c; }

.nm-rainbow { background-image: linear-gradient(90deg, #ff4d4d, #ffb84d, #f6ff4d, #4dff88, #4dc3ff, #b84dff, #ff4d4d); animation: nm-slide 4s linear infinite; }
.nm-fire    { background-image: linear-gradient(90deg, #ff3d00, #ff9100, #ffd54a, #ff9100, #ff3d00); animation: nm-slide 1.8s linear infinite; }
.nm-chrome  { background-image: linear-gradient(110deg, #9ca3af 20%, #ffffff 40%, #9ca3af 60%, #e5e7eb 80%); animation: nm-slide 3s linear infinite; }
.nm-aurora  { background-image: linear-gradient(90deg, #34d399, #38bdf8, #a78bfa, #f472b6, #34d399); animation: nm-slide 6s linear infinite; }
@keyframes nm-slide { from { background-position: 0% 0; } to { background-position: -200% 0; } }

.sup-badge { display: inline-block; margin-left: .3em; font-size: .8em; line-height: 1; vertical-align: .05em; }
.sup-badge-default {
  padding: .1em .35em; border-radius: 9999px; font-size: .65em; font-weight: 800; color: #fff; vertical-align: .2em;
  background: linear-gradient(135deg, #7400ce, #c026d3);
}
@media (prefers-reduced-motion: reduce) {
  .nm-rainbow, .nm-fire, .nm-chrome, .nm-aurora { animation: none; }
}

/* ===== Donate button: a faceted purple crystal ===== */
.gem-btn {
  position: relative; display: inline-flex; align-items: center; gap: .5rem; overflow: hidden; isolation: isolate; text-decoration: none; cursor: pointer;
  padding: .3rem 1.1rem .3rem .55rem; border-radius: 9999px; color: #fff; font-weight: 800; letter-spacing: .02em; line-height: 1.2;
  background:
    linear-gradient(115deg, rgba(255,255,255,.28) 0%, rgba(255,255,255,0) 32%, rgba(255,255,255,.12) 52%, rgba(255,255,255,0) 70%),
    linear-gradient(135deg, #b25cff 0%, #7400ce 45%, #45007f 100%);
  border: 1px solid rgba(233, 213, 255, .55);
  box-shadow: 0 0 0 1px rgba(116, 0, 206, .6), 0 6px 22px rgba(116, 0, 206, .55), inset 0 1px 0 rgba(255,255,255,.55), inset 0 -8px 14px rgba(40, 0, 80, .45);
  text-shadow: 0 1px 2px rgba(40, 0, 80, .7);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.gem-btn:hover { transform: translateY(-1px) scale(1.03); filter: brightness(1.12); box-shadow: 0 0 0 1px rgba(196, 130, 255, .8), 0 8px 30px rgba(150, 50, 255, .75), inset 0 1px 0 rgba(255,255,255,.65), inset 0 -8px 14px rgba(40, 0, 80, .4); }
.gem-btn:active { transform: translateY(0) scale(.99); }
.gem-btn:focus-visible { outline: 2px solid #e9d5ff; outline-offset: 3px; }
.gem-btn::before {                                   /* a glint that sweeps across now and then */
  content: ""; position: absolute; top: -20%; bottom: -20%; left: -60%; width: 40%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.75), transparent); transform: skewX(-20deg);
  animation: gem-glint 4.5s ease-in-out infinite;
}
.gem-btn .gem-icon { width: 1.6rem; height: 1.6rem; flex: none; filter: drop-shadow(0 1px 3px rgba(30, 0, 60, .8)); }
.gem-btn .gem-spark { transform-origin: center; transform-box: fill-box; animation: gem-spark 2.6s ease-in-out infinite; }
.gem-btn-lg { padding: .6rem 1.6rem .6rem .8rem; font-size: 1.05rem; }
.gem-btn-lg .gem-icon { width: 2rem; height: 2rem; }
@keyframes gem-glint { 0%, 55% { left: -60%; } 80%, 100% { left: 130%; } }
@keyframes gem-spark { 0%, 100% { opacity: .25; transform: scale(.6) rotate(0deg); } 50% { opacity: 1; transform: scale(1.1) rotate(45deg); } }
@media (prefers-reduced-motion: reduce) { .gem-btn::before, .gem-btn .gem-spark { animation: none; } .gem-btn:hover { transform: none; } }
