/* Khung trang trí avatar (frames.js). Khung rộng 136% avatar, căn giữa; màu gốc --fc / --fc2, xoay màu --fh. */
.avFrame { position: absolute; inset: -18%; pointer-events: none; z-index: 2; filter: hue-rotate(var(--fh, 0deg)); --fc: #ff2a3d; --fc2: #ffb347; }
.avFrame svg { width: 100%; height: 100%; display: block; overflow: visible; }
.avFrame .s { fill: none; stroke: var(--fc); }
.avFrame .s2 { fill: none; stroke: var(--fc2); }
.avFrame .f { fill: var(--fc); }
.avFrame .f2 { fill: var(--fc2); }
.avFrame .glow { filter: drop-shadow(0 0 2px var(--fc)) drop-shadow(0 0 5px var(--fc)); }
.avFrame .spin { transform-origin: 50px 50px; animation: frSpin 9s linear infinite; }
.avFrame .spin.slow { animation-duration: 28s; }
.avFrame .spin.rev { animation-direction: reverse; animation-duration: 6s; }
@keyframes frSpin { to { transform: rotate(360deg); } }
.avFrame .pulse { animation: frPulse 2.4s ease-in-out infinite; }
@keyframes frPulse { 50% { opacity: .55; } }

/* màu gốc từng khung (thanh "Xoay màu" đổi từ đây) */
.fr-neon { --fc: #ff2a8a; }
.fr-orbit { --fc: #8ab4ff; }
.fr-twin { --fc: #7c5cff; --fc2: #2de2e6; }
.fr-thorns { --fc: #d7d7dc; }
.fr-chain { --fc: #c9c9cf; }
.fr-flame { --fc: #ff3b1f; --fc2: #ffd23f; }
.fr-glitch { --fc: #f4f4f5; }
.fr-sparkle { --fc: #ffe27a; }
.fr-hearts { --fc: #ff5c9a; }
.fr-bolt { --fc: #6ad7ff; }
.fr-halo { --fc: #ffe08a; }
.fr-horns { --fc: #e0213a; }
.fr-ears { --fc: #1b1b1f; --fc2: #ff8fb8; }
.fr-crown { --fc: #ffcc33; --fc2: #ff4f7b; }

/* RGB: vòng conic-gradient xoay, cắt thành vành bằng mask */
.fr-rgb { background: conic-gradient(#ff2a3d, #ffb02e, #f5ff3d, #2dff8a, #2de2e6, #3d6bff, #c23dff, #ff2a3d);
  -webkit-mask: radial-gradient(circle closest-side, transparent 74%, #000 75.5%, #000 82%, transparent 83.5%);
  mask: radial-gradient(circle closest-side, transparent 74%, #000 75.5%, #000 82%, transparent 83.5%);
  border-radius: 50%; animation: frSpin 4s linear infinite; }
.fr-flame .flick { transform-box: fill-box; transform-origin: 50% 100%; animation: frFlick .9s ease-in-out infinite alternate; }
@keyframes frFlick { 0% { transform: scaleY(.75) scaleX(1.05); opacity: .8; } 100% { transform: scaleY(1.12) scaleX(.92); opacity: 1; } }
.fr-flame svg { filter: drop-shadow(0 0 4px #ff5a1f); }
.fr-glitch .gl { fill: none; stroke-width: 2; mix-blend-mode: screen; }
.fr-glitch .gl1 { stroke: #ff2a6d; animation: frGlA 1.6s steps(1) infinite; }
.fr-glitch .gl2 { stroke: #2de2e6; animation: frGlB 1.6s steps(1) infinite; }
@keyframes frGlA { 0%, 100% { transform: translate(1.2px, 0); } 30% { transform: translate(-1.6px, .8px); } 60% { transform: translate(2px, -.6px); } 80% { transform: translate(0, 0); } }
@keyframes frGlB { 0%, 100% { transform: translate(-1.2px, 0); } 30% { transform: translate(1.6px, -.8px); } 60% { transform: translate(-2px, .6px); } 80% { transform: translate(0, 0); } }
.fr-sparkle .twinkle { animation: frTwinkle 2.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes frTwinkle { 0%, 100% { transform: scale(.35); opacity: .25; } 50% { transform: scale(1); opacity: 1; } }
.fr-sparkle svg { filter: drop-shadow(0 0 3px var(--fc)); }
.fr-hearts svg { filter: drop-shadow(0 0 3px var(--fc)); }
.fr-bolt .zap { animation: frZap 1.8s steps(1) infinite; filter: drop-shadow(0 0 3px var(--fc)); }
@keyframes frZap { 0%, 100% { opacity: 1; } 12% { opacity: .2; } 18% { opacity: 1; } 55% { opacity: .35; } 60% { opacity: 1; } }
.fr-halo .bob { animation: frBob 3s ease-in-out infinite; }
@keyframes frBob { 50% { transform: translateY(-2px); } }
.fr-horns svg, .fr-thorns svg, .fr-chain svg { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .55)); }
.fr-horns .f { filter: drop-shadow(0 0 3px rgba(224, 33, 58, .6)); }
.fr-crown svg { filter: drop-shadow(0 0 4px rgba(255, 204, 51, .55)); }

@media (prefers-reduced-motion: reduce) {
  .avFrame *, .avFrame { animation: none !important; }
}
