/*
 * Lightweight shared profile frame system for MainMenu, Store, Story, Stage and Party.
 * Each purchasable frame is defined by css_class only. Old class names are kept as aliases
 * so previous purchases and stored settings continue to work.
 */
.profile-frame-ring,
.frame-base {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    z-index: 0;
    transform: translateZ(0);
    transition: transform .25s ease, opacity .25s ease, box-shadow .25s ease;
    backface-visibility: hidden;
}

.profile-frame-ring::before,
.profile-frame-ring::after,
.frame-base::before,
.frame-base::after {
    content: '';
    position: absolute;
    pointer-events: none;
    border-radius: inherit;
}

/* Default/simple avatar: no rotating ring and no animated border. */
.profile-frame-ring.frame-default,
.frame-base.frame-default {
    background: rgba(30, 41, 59, .72) !important;
    border: 1px solid rgba(148, 163, 184, .34) !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), inset 0 0 10px rgba(0,0,0,.62) !important;
    animation: none !important;
}
.profile-frame-ring.frame-default::before,
.profile-frame-ring.frame-default::after,
.frame-base.frame-default::before,
.frame-base.frame-default::after { display: none !important; }
.profile-card-v3[data-frame-theme="frame-default"] .avatar-border-anim,
.game-profile-card[data-frame-theme="frame-default"] .avatar-border-anim {
    display: none !important;
    animation: none !important;
}
.profile-card-v3[data-frame-theme="frame-default"] .premium-avatar-bg {
    inset: 4px !important;
    border: 1px solid rgba(148, 163, 184, .24) !important;
}

/* Shared premium ring base. Only transform is animated for better performance. */
.profile-frame-ring:not(.frame-default),
.frame-base:not(.frame-default) {
    border: 0 !important;
    overflow: hidden;
    isolation: isolate;
    animation: profileFrameSpin var(--frame-speed, 18s) linear infinite !important;
}
.profile-frame-ring:not(.frame-default)::after,
.frame-base:not(.frame-default)::after {
    inset: 5px;
    z-index: 1;
    background: #08111f !important;
    box-shadow: inset 0 0 10px rgba(0,0,0,.78);
}
.frame-base:not(.frame-default)::after { inset: 6px; }
.profile-card-v3[data-frame-theme]:not([data-frame-theme="frame-default"]) .avatar-border-anim {
    opacity: .55 !important;
    mix-blend-mode: screen !important;
}

/* 1) ستاره صحنه */
.profile-frame-ring.frame-studio,
.frame-base.frame-studio,
.profile-frame-ring.frame-classic,
.frame-base.frame-classic {
    --frame-speed: 18s;
    background: conic-gradient(from 20deg, #78350f, #f59e0b 18%, #fef3c7 30%, #b45309 44%, #451a03 56%, #f59e0b 72%, #fff7ed 84%, #78350f) !important;
    box-shadow: 0 0 14px rgba(245,158,11,.55), 0 0 26px rgba(120,53,15,.28) !important;
}
.profile-frame-ring.frame-studio::before,
.frame-base.frame-studio::before,
.profile-frame-ring.frame-classic::before,
.frame-base.frame-classic::before {
    inset: 1px;
    z-index: 0;
    background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.45) 0 3deg, transparent 3deg 22deg) !important;
    opacity: .32;
}

/* 2) موج ترانه */
.profile-frame-ring.frame-aurora,
.frame-base.frame-aurora,
.profile-frame-ring.frame-energy,
.frame-base.frame-energy {
    --frame-speed: 20s;
    animation-direction: reverse !important;
    background: conic-gradient(from 110deg, #022c22, #34d399, #67e8f9, #2563eb, #a7f3d0, #022c22) !important;
    box-shadow: 0 0 15px rgba(34,211,238,.52), 0 0 26px rgba(16,185,129,.30) !important;
}
.profile-frame-ring.frame-aurora::before,
.frame-base.frame-aurora::before,
.profile-frame-ring.frame-energy::before,
.frame-base.frame-energy::before {
    inset: 0;
    z-index: 0;
    background: radial-gradient(circle at 30% 24%, rgba(255,255,255,.55), transparent 18%), radial-gradient(circle at 72% 82%, rgba(14,165,233,.48), transparent 22%) !important;
    opacity: .68;
}

/* 3) ستاره پاپ */
.profile-frame-ring.frame-sunset,
.frame-base.frame-sunset,
.profile-frame-ring.frame-gold,
.frame-base.frame-gold {
    --frame-speed: 19s;
    background: conic-gradient(from 220deg, #7f1d1d, #e11d48, #fb7185, #f97316, #fde047, #f43f5e, #7f1d1d) !important;
    box-shadow: 0 0 15px rgba(251,113,133,.46), 0 0 28px rgba(249,115,22,.26) !important;
}
.profile-frame-ring.frame-sunset::before,
.frame-base.frame-sunset::before,
.profile-frame-ring.frame-gold::before,
.frame-base.frame-gold::before {
    inset: 2px;
    z-index: 0;
    background: repeating-conic-gradient(from 12deg, transparent 0 12deg, rgba(255,255,255,.38) 13deg 15deg, transparent 16deg 32deg) !important;
    opacity: .48;
}

/* 4) نئون کنسرت */
.profile-frame-ring.frame-neon,
.frame-base.frame-neon,
.profile-frame-ring.frame-electronic,
.frame-base.frame-electronic {
    --frame-speed: 14s;
    background: conic-gradient(from 0deg, #0f172a, #06b6d4 10%, #22d3ee 20%, #a855f7 35%, #f0abfc 50%, #ec4899 64%, #06b6d4 80%, #0f172a) !important;
    box-shadow: 0 0 16px rgba(236,72,153,.55), 0 0 26px rgba(34,211,238,.36) !important;
}
.profile-frame-ring.frame-neon::before,
.frame-base.frame-neon::before,
.profile-frame-ring.frame-electronic::before,
.frame-base.frame-electronic::before {
    inset: 0;
    z-index: 0;
    background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.42) 0 2deg, transparent 2deg 14deg) !important;
    opacity: .38;
}

/* 5) الماس صدا */
.profile-frame-ring.frame-diamond,
.frame-base.frame-diamond,
.profile-frame-ring.frame-platinum,
.frame-base.frame-platinum {
    --frame-speed: 22s;
    animation-direction: reverse !important;
    background: conic-gradient(from 45deg, #e0f2fe, #ffffff, #7dd3fc, #94a3b8, #f8fafc, #38bdf8, #e0f2fe) !important;
    box-shadow: 0 0 18px rgba(224,242,254,.62), 0 0 28px rgba(96,165,250,.28) !important;
}
.profile-frame-ring.frame-diamond::before,
.frame-base.frame-diamond::before,
.profile-frame-ring.frame-platinum::before,
.frame-base.frame-platinum::before {
    inset: 0;
    z-index: 0;
    background: linear-gradient(45deg, rgba(255,255,255,.70), transparent 26%, rgba(125,211,252,.54) 42%, transparent 62%, rgba(255,255,255,.78)) !important;
    opacity: .60;
}

/* 6) کهکشان آواز */
.profile-frame-ring.frame-cosmic,
.frame-base.frame-cosmic,
.profile-frame-ring.frame-legend,
.frame-base.frame-legend {
    --frame-speed: 16s;
    background:
        radial-gradient(circle at 22% 18%, #fff 0 1px, transparent 2px),
        radial-gradient(circle at 78% 64%, #fde68a 0 1px, transparent 2px),
        conic-gradient(from 140deg, #020617, #7c3aed, #ec4899, #22d3ee, #f59e0b, #7c3aed, #020617) !important;
    box-shadow: 0 0 20px rgba(124,58,237,.62), 0 0 32px rgba(34,211,238,.26) !important;
}
.profile-frame-ring.frame-cosmic::before,
.frame-base.frame-cosmic::before,
.profile-frame-ring.frame-legend::before,
.frame-base.frame-legend::before {
    inset: -3px;
    z-index: 0;
    background: repeating-conic-gradient(from 0deg, transparent 0 16deg, rgba(255,255,255,.42) 17deg 18deg, transparent 19deg 34deg) !important;
    opacity: .38;
}

/* Store keeps the old compact item card layout; animations are slower there to avoid list lag. */
.store-frame-card .frame-base:not(.frame-default) { animation-duration: 28s !important; }
.store-frame-card:hover .frame-base:not(.frame-default) { transform: translateZ(0) scale(1.035); }

/* Profile card themes: purchased frames also beautify the whole user card. */
.game-profile-card.profile-card-v3[data-frame-theme="frame-studio"],
.game-profile-card.game-profile-card-user.profile-card-v3[data-frame-theme="frame-studio"],
.game-profile-card.profile-card-v3[data-frame-theme="frame-classic"],
.game-profile-card.game-profile-card-user.profile-card-v3[data-frame-theme="frame-classic"] {
    background: linear-gradient(110deg, rgba(69,26,3,.88), rgba(15,23,42,.96) 50%, rgba(146,64,14,.70)) !important;
    border-color: rgba(253,230,138,.50) !important;
    box-shadow: 0 13px 30px rgba(245,158,11,.18), 0 9px 24px rgba(0,0,0,.54), inset 0 1px 1px rgba(255,255,255,.12) !important;
}
.game-profile-card[data-frame-theme="frame-studio"] .premium-profile-name,
.game-profile-card[data-frame-theme="frame-studio"] .profile-name,
.game-profile-card[data-frame-theme="frame-classic"] .premium-profile-name,
.game-profile-card[data-frame-theme="frame-classic"] .profile-name { color: #fde68a !important; text-shadow: 0 0 9px rgba(245,158,11,.36) !important; }
.game-profile-card[data-frame-theme="frame-studio"] .premium-xp-bar,
.game-profile-card[data-frame-theme="frame-studio"] .profile-xp-bar,
.game-profile-card[data-frame-theme="frame-classic"] .premium-xp-bar,
.game-profile-card[data-frame-theme="frame-classic"] .profile-xp-bar { background: linear-gradient(to left, #f59e0b, #fef08a, #b45309) !important; }

.game-profile-card.profile-card-v3[data-frame-theme="frame-aurora"],
.game-profile-card.game-profile-card-user.profile-card-v3[data-frame-theme="frame-aurora"],
.game-profile-card.profile-card-v3[data-frame-theme="frame-energy"],
.game-profile-card.game-profile-card-user.profile-card-v3[data-frame-theme="frame-energy"] {
    background: linear-gradient(112deg, rgba(6,78,59,.84), rgba(15,23,42,.96) 52%, rgba(14,116,144,.66)) !important;
    border-color: rgba(103,232,249,.48) !important;
    box-shadow: 0 13px 30px rgba(34,211,238,.15), 0 9px 24px rgba(0,0,0,.54), inset 0 1px 1px rgba(255,255,255,.12) !important;
}
.game-profile-card[data-frame-theme="frame-aurora"] .premium-profile-name,
.game-profile-card[data-frame-theme="frame-aurora"] .profile-name,
.game-profile-card[data-frame-theme="frame-energy"] .premium-profile-name,
.game-profile-card[data-frame-theme="frame-energy"] .profile-name { color: #a7f3d0 !important; text-shadow: 0 0 9px rgba(34,211,238,.34) !important; }
.game-profile-card[data-frame-theme="frame-aurora"] .premium-xp-bar,
.game-profile-card[data-frame-theme="frame-aurora"] .profile-xp-bar,
.game-profile-card[data-frame-theme="frame-energy"] .premium-xp-bar,
.game-profile-card[data-frame-theme="frame-energy"] .profile-xp-bar { background: linear-gradient(to left, #10b981, #22d3ee, #2563eb) !important; }

.game-profile-card.profile-card-v3[data-frame-theme="frame-sunset"],
.game-profile-card.game-profile-card-user.profile-card-v3[data-frame-theme="frame-sunset"],
.game-profile-card.profile-card-v3[data-frame-theme="frame-gold"],
.game-profile-card.game-profile-card-user.profile-card-v3[data-frame-theme="frame-gold"] {
    background: linear-gradient(112deg, rgba(136,19,55,.86), rgba(15,23,42,.96) 52%, rgba(154,52,18,.72)) !important;
    border-color: rgba(251,146,60,.50) !important;
    box-shadow: 0 13px 30px rgba(244,63,94,.16), 0 9px 24px rgba(0,0,0,.54), inset 0 1px 1px rgba(255,255,255,.12) !important;
}
.game-profile-card[data-frame-theme="frame-sunset"] .premium-profile-name,
.game-profile-card[data-frame-theme="frame-sunset"] .profile-name,
.game-profile-card[data-frame-theme="frame-gold"] .premium-profile-name,
.game-profile-card[data-frame-theme="frame-gold"] .profile-name { color: #fed7aa !important; text-shadow: 0 0 9px rgba(251,113,133,.36) !important; }
.game-profile-card[data-frame-theme="frame-sunset"] .premium-xp-bar,
.game-profile-card[data-frame-theme="frame-sunset"] .profile-xp-bar,
.game-profile-card[data-frame-theme="frame-gold"] .premium-xp-bar,
.game-profile-card[data-frame-theme="frame-gold"] .profile-xp-bar { background: linear-gradient(to left, #e11d48, #fb7185, #f59e0b) !important; }

.game-profile-card.profile-card-v3[data-frame-theme="frame-neon"],
.game-profile-card.game-profile-card-user.profile-card-v3[data-frame-theme="frame-neon"],
.game-profile-card.profile-card-v3[data-frame-theme="frame-electronic"],
.game-profile-card.game-profile-card-user.profile-card-v3[data-frame-theme="frame-electronic"] {
    background: linear-gradient(112deg, rgba(76,29,149,.88), rgba(15,23,42,.96) 52%, rgba(22,78,99,.70)) !important;
    border-color: rgba(217,70,239,.56) !important;
    box-shadow: 0 13px 30px rgba(217,70,239,.18), 0 9px 24px rgba(0,0,0,.54), inset 0 1px 1px rgba(255,255,255,.12) !important;
}
.game-profile-card[data-frame-theme="frame-neon"] .premium-profile-name,
.game-profile-card[data-frame-theme="frame-neon"] .profile-name,
.game-profile-card[data-frame-theme="frame-electronic"] .premium-profile-name,
.game-profile-card[data-frame-theme="frame-electronic"] .profile-name { color: #f0abfc !important; text-shadow: 0 0 10px rgba(34,211,238,.42) !important; }
.game-profile-card[data-frame-theme="frame-neon"] .premium-xp-bar,
.game-profile-card[data-frame-theme="frame-neon"] .profile-xp-bar,
.game-profile-card[data-frame-theme="frame-electronic"] .premium-xp-bar,
.game-profile-card[data-frame-theme="frame-electronic"] .profile-xp-bar { background: linear-gradient(to left, #ec4899, #a855f7, #22d3ee) !important; }

.game-profile-card.profile-card-v3[data-frame-theme="frame-diamond"],
.game-profile-card.game-profile-card-user.profile-card-v3[data-frame-theme="frame-diamond"],
.game-profile-card.profile-card-v3[data-frame-theme="frame-platinum"],
.game-profile-card.game-profile-card-user.profile-card-v3[data-frame-theme="frame-platinum"] {
    background: linear-gradient(112deg, rgba(15,23,42,.96), rgba(51,65,85,.88) 55%, rgba(14,116,144,.42)) !important;
    border-color: rgba(224,242,254,.62) !important;
    box-shadow: 0 13px 30px rgba(224,242,254,.15), 0 9px 24px rgba(0,0,0,.54), inset 0 1px 1px rgba(255,255,255,.16) !important;
}
.game-profile-card[data-frame-theme="frame-diamond"] .premium-profile-name,
.game-profile-card[data-frame-theme="frame-diamond"] .profile-name,
.game-profile-card[data-frame-theme="frame-platinum"] .premium-profile-name,
.game-profile-card[data-frame-theme="frame-platinum"] .profile-name { color: #f8fafc !important; text-shadow: 0 0 10px rgba(186,230,253,.48) !important; }
.game-profile-card[data-frame-theme="frame-diamond"] .premium-xp-bar,
.game-profile-card[data-frame-theme="frame-diamond"] .profile-xp-bar,
.game-profile-card[data-frame-theme="frame-platinum"] .premium-xp-bar,
.game-profile-card[data-frame-theme="frame-platinum"] .profile-xp-bar { background: linear-gradient(to left, #e0f2fe, #38bdf8, #64748b) !important; }

.game-profile-card.profile-card-v3[data-frame-theme="frame-cosmic"],
.game-profile-card.game-profile-card-user.profile-card-v3[data-frame-theme="frame-cosmic"],
.game-profile-card.profile-card-v3[data-frame-theme="frame-legend"],
.game-profile-card.game-profile-card-user.profile-card-v3[data-frame-theme="frame-legend"] {
    background: linear-gradient(112deg, rgba(46,16,101,.90), rgba(15,23,42,.96) 52%, rgba(17,94,89,.72)) !important;
    border-color: rgba(167,139,250,.62) !important;
    box-shadow: 0 14px 34px rgba(124,58,237,.20), 0 9px 24px rgba(0,0,0,.56), inset 0 1px 1px rgba(255,255,255,.14) !important;
}
.game-profile-card[data-frame-theme="frame-cosmic"] .premium-profile-name,
.game-profile-card[data-frame-theme="frame-cosmic"] .profile-name,
.game-profile-card[data-frame-theme="frame-legend"] .premium-profile-name,
.game-profile-card[data-frame-theme="frame-legend"] .profile-name {
    color: #e9d5ff !important;
    text-shadow: 0 0 11px rgba(45,212,191,.40) !important;
}
.game-profile-card[data-frame-theme="frame-cosmic"] .premium-xp-bar,
.game-profile-card[data-frame-theme="frame-cosmic"] .profile-xp-bar,
.game-profile-card[data-frame-theme="frame-legend"] .premium-xp-bar,
.game-profile-card[data-frame-theme="frame-legend"] .profile-xp-bar { background: linear-gradient(to left, #7c3aed, #ec4899, #22d3ee, #facc15) !important; }

@keyframes profileFrameSpin { to { transform: rotate(360deg) translateZ(0); } }

@media (max-width: 640px) {
    .store-frame-card .frame-base:not(.frame-default) { animation-duration: 36s !important; }
}

@media (prefers-reduced-motion: reduce) {
    .profile-frame-ring,
    .frame-base,
    .profile-frame-ring::before,
    .frame-base::before,
    .game-profile-card[data-frame-theme] { animation: none !important; }
}

html[data-graphics-quality="low"] .profile-frame-ring,
html[data-graphics-quality="low"] .frame-base,
html[data-graphics-quality="medium"] .profile-frame-ring,
html[data-graphics-quality="medium"] .frame-base {
    animation-duration: 28s !important;
}
html[data-graphics-quality="low"] .profile-frame-ring::before,
html[data-graphics-quality="low"] .frame-base::before { display: none !important; }
