/**
 * FIRE RATING — holographic flame styling
 *
 * Layers:
 *   .fr-rating  — wrapper (number + glyph)
 *   .fr-svg     — the SVG glyph itself
 *   .fr-tier-N  — detail tier (0-5), drives drop-shadow intensity
 *   .fr-v-rating / .fr-v-heat — palette variant
 *   .fr-pick    — interactive picker button
 *
 * Animations:
 *   fr-shimmer  — slow hue-rotate for holographic chromatic shift
 *   fr-flicker  — subtle scale/translate for "live fire" feel on tier ≥3
 *   fr-spark-*  — particles drift up from the flame top on tier 5
 */

.fr-rating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  vertical-align: middle;
  line-height: 1;
}

.fr-number {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #FFFFFF 0%, #FFE080 40%, #FF9500 80%, #E05252 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 14px rgba(255, 149, 0, 0.25);
}

.fr-v-heat .fr-number {
  background: linear-gradient(180deg, #FFFFFF 0%, #FFE080 40%, #FF9500 80%, #E05252 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 14px rgba(255, 149, 0, 0.25);
}

.fr-svg {
  display: inline-block;
  flex-shrink: 0;
  overflow: visible;
  transform-origin: 50% 90%;
}

/* Tier-based drop shadow — warm fire palette across all variants */
.fr-tier-0 { filter: drop-shadow(0 0 0 transparent); opacity: 0.55; }
.fr-tier-1 { filter: drop-shadow(0 0 2px rgba(224, 82, 82, 0.35)); }
.fr-tier-2 { filter: drop-shadow(0 0 4px rgba(255, 149, 0, 0.45)); }
.fr-tier-3 { filter: drop-shadow(0 0 7px rgba(255, 149, 0, 0.55)); }
.fr-tier-4 { filter: drop-shadow(0 0 10px rgba(255, 149, 0, 0.6)) drop-shadow(0 0 18px rgba(224, 82, 82, 0.35)); }
.fr-tier-5 {
  filter:
    drop-shadow(0 0 12px rgba(255, 255, 255, 0.7))
    drop-shadow(0 0 22px rgba(255, 149, 0, 0.55))
    drop-shadow(0 0 30px rgba(224, 82, 82, 0.4));
}

/* Holographic shimmer — chromatic hue cycle */
@keyframes fr-shimmer {
  0%   { filter: hue-rotate(0deg); }
  50%  { filter: hue-rotate(28deg); }
  100% { filter: hue-rotate(0deg); }
}

/* Live-fire breathing — tier-3+ glyphs subtly inhale */
@keyframes fr-flicker {
  0%, 100% { transform: translateY(0)        scaleY(1);     }
  25%      { transform: translateY(-0.5px)   scaleY(1.025); }
  50%      { transform: translateY(0.3px)    scaleY(0.985); }
  75%      { transform: translateY(-0.2px)   scaleY(1.015); }
}

/* Sparks drift up + fade */
@keyframes fr-spark-rise {
  0%   { transform: translate(0, 0) scale(1);   opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translate(2px, -14px) scale(0.4); opacity: 0; }
}

.fr-animate.fr-tier-3,
.fr-animate.fr-tier-4,
.fr-animate.fr-tier-5 {
  animation: fr-flicker 2.6s ease-in-out infinite;
}

.fr-animate .fr-spark { transform-origin: center; }
.fr-animate .fr-spark-a { animation: fr-spark-rise 2.2s ease-out infinite; animation-delay: 0s; }
.fr-animate .fr-spark-b { animation: fr-spark-rise 2.2s ease-out infinite; animation-delay: 0.7s; }
.fr-animate .fr-spark-c { animation: fr-spark-rise 2.2s ease-out infinite; animation-delay: 1.4s; }

/* Inner gradient hue cycle — applied to a wrapping span via CSS variable
   trick: we use mix-blend-mode on a pseudo overlay for shimmer without
   re-rendering SVG */
.fr-rating::after { content: none; }

/* Size presets — bumped to compensate for the larger viewBox that
   accommodates the extended top tongue and tier-5 stamp frame */
.fr-size-sm .fr-svg { width: 28px; height: 28px; }
.fr-size-md .fr-svg { width: 42px; height: 42px; }
.fr-size-lg .fr-svg { width: 64px; height: 64px; }

/* ── Interactive picker (write-review form) ───────────────────────────── */

.fr-picker {
  display: inline-flex;
  align-items: flex-end;       /* anchor flames at the base so they grow upward */
  gap: 8px;
}

.fr-pick {
  background: transparent;
  border: 0;
  padding: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: 10px;
  transition: transform .14s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.fr-pick:hover {
  transform: translateY(-2px) scale(1.06);
  background: rgba(232, 199, 106, 0.06);
}

.fr-pick:active { transform: scale(0.96); }

.fr-pick:focus-visible {
  outline: 2px solid rgba(232, 199, 106, 0.7);
  outline-offset: 2px;
}

/* Per-tier rest opacity — bigger tier glyphs hold more presence even
   when unlit so the user can see the unlock progression */
.fr-pick-tier-1:not(.on) .fr-pick-svg { opacity: 0.55; }
.fr-pick-tier-2:not(.on) .fr-pick-svg { opacity: 0.6; }
.fr-pick-tier-3:not(.on) .fr-pick-svg { opacity: 0.65; }
.fr-pick-tier-4:not(.on) .fr-pick-svg { opacity: 0.7; }
.fr-pick-stamp:not(.on) .fr-pick-svg { opacity: 0.6; }

/* Filled glow — warm fire escalation */
.fr-pick-tier-1.on .fr-pick-svg { filter: drop-shadow(0 0 4px rgba(224, 82, 82, 0.55)); }
.fr-pick-tier-2.on .fr-pick-svg { filter: drop-shadow(0 0 6px rgba(255, 149, 0, 0.6)); }
.fr-pick-tier-3.on .fr-pick-svg { filter: drop-shadow(0 0 8px rgba(255, 149, 0, 0.65)); }
.fr-pick-tier-4.on .fr-pick-svg {
  filter: drop-shadow(0 0 10px rgba(255, 149, 0, 0.7))
          drop-shadow(0 0 16px rgba(224, 82, 82, 0.45));
}

/* Tier 5 STAMP — Cannalyze seal of approval, full chromatic blowout */
.fr-pick-stamp.on .fr-pick-svg {
  filter:
    drop-shadow(0 0 14px rgba(255, 255, 255, 0.65))
    drop-shadow(0 0 24px rgba(255, 224, 128, 0.7))
    drop-shadow(0 0 38px rgba(255, 149, 0, 0.55))
    drop-shadow(0 0 54px rgba(224, 82, 82, 0.4));
  animation: fr-stamp-pulse 3.4s ease-in-out infinite;
}

@keyframes fr-stamp-pulse {
  0%, 100% { transform: scale(1)     rotate(0deg);   }
  50%      { transform: scale(1.045) rotate(0.4deg); }
}

/* Hover preview — light up the hovered glyph */
.fr-pick:hover .fr-pick-svg {
  filter: drop-shadow(0 0 6px rgba(255, 149, 0, 0.6));
}
.fr-pick-stamp:hover .fr-pick-svg {
  filter: drop-shadow(0 0 10px rgba(255, 224, 128, 0.7))
          drop-shadow(0 0 20px rgba(255, 149, 0, 0.45));
}

/* Mobile sizing — generous tap target while keeping size differential */
@media (max-width: 640px) {
  .fr-picker { gap: 4px; }
  .fr-pick { padding: 6px; min-width: 44px; min-height: 44px; }
}

/* Scoped: when a fire glyph appears in the trophy meta row, drop the
   gap so the number sits flush against the flame */
.trophy-meta .fr-rating { gap: 3px; }
.trophy-meta .fr-number { font-size: 10px; }

/* Hero rating-summary card — give the flame more room */
.rating-summary-card .fr-rating { font-size: 12px; }
.rating-summary-card .fr-svg { width: 56px; height: 56px; }

/* Community rating distribution — large flame next to score */
.cr-stars .fr-svg { width: 56px; height: 56px; }

/* Review row (rev-role) — small flame after the username */
.rev-role .fr-svg { width: 22px; height: 22px; }
.rev-role .fr-rating { gap: 2px; }

/* Hot 20 card heat overlay — pinned to top-right of the art panel */
.trophy-card.hot .trophy-art { position: relative; }
.trophy-heat {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  display: inline-flex;
  pointer-events: none;
}
.trophy-heat .fr-svg { width: 50px; height: 50px; }

/* Feature card (home sidebar) — keep flame compact next to gold rating text */
.feature-rating .fr-rating { gap: 4px; }
.feature-rating .fr-svg { width: 24px; height: 24px; }
.feature-rating .fr-number { font-size: 10px; }

/* Spotlight (home review spotlight) — small flame */
.spotlight-top .fr-svg { width: 22px; height: 22px; }

/* Onboarding strain card preview */
.ob-strain-card .fr-svg { width: 20px; height: 20px; }
.ob-strain-card .fr-number { font-size: 10px; }

/* rh-rating row (similar/profile widgets) — tight 5-flame substitute */
.rh-rating .fr-svg { width: 24px; height: 24px; }

/* Honour reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fr-animate,
  .fr-animate .fr-spark { animation: none !important; }
}
