/* ByteForge store cosmetics. All animations are CSS only and stop for prefers-reduced-motion. */

/* ---- Avatar frames ---- */
.av-frame { position: relative; display: inline-grid; flex: none; isolation: isolate; border-radius: 10px; --ring: 4px; width: fit-content; height: fit-content; align-self: flex-start; justify-self: start; }
.row .av-frame, .member-card .av-frame, .row-last .av-frame, .item-preview .av-frame, .store-hero-frame .av-frame, .mock-body .av-frame { align-self: center; }
.av-frame-sm { border-radius: 8px; --ring: 3px; }
.av-frame-xs { border-radius: 6px; --ring: 2px; }
.av-frame-lg { border-radius: 14px; --ring: 5px; }
.av-frame-xl { border-radius: 16px; --ring: 6px; }
.frame-asset { position: absolute; inset: -11%; width: 122%; height: 122%; object-fit: contain; pointer-events: none; z-index: 2; }
.av-frame::before, .av-frame::after { content: none; position: absolute; pointer-events: none; }

@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes fx-spin { to { --spin: 360deg; } }

.fx-frame-neon::before { content: ""; inset: calc(var(--ring) * -1); border-radius: inherit; z-index: -1; background: conic-gradient(from var(--spin), #1877f2, #22d3ee, #a855f7, #ec4899, #1877f2); animation: fx-spin 3.5s linear infinite; }
.fx-frame-neon::after { content: ""; inset: calc(var(--ring) * -1); border-radius: inherit; z-index: -2; background: conic-gradient(from var(--spin), #1877f2, #22d3ee, #a855f7, #ec4899, #1877f2); filter: blur(10px); opacity: .7; animation: fx-spin 3.5s linear infinite; }

.fx-frame-ember::before { content: ""; inset: calc(var(--ring) * -1); border-radius: inherit; z-index: -1; background: linear-gradient(0deg, #ff3d00, #ff9100 45%, #ffd54f); animation: fx-ember 1.8s ease-in-out infinite alternate; }
.fx-frame-ember::after { content: ""; inset: calc(var(--ring) * -1.6); border-radius: inherit; z-index: -2; background: radial-gradient(closest-side, rgba(255, 110, 0, .85), transparent); filter: blur(8px); animation: fx-ember-glow 1.3s ease-in-out infinite alternate; }
@keyframes fx-ember { from { filter: brightness(.85) saturate(1); } to { filter: brightness(1.25) saturate(1.3); } }
@keyframes fx-ember-glow { from { opacity: .45; transform: scale(.98); } to { opacity: .95; transform: scale(1.06); } }

.fx-frame-aurora::before { content: ""; inset: calc(var(--ring) * -1); border-radius: inherit; z-index: -1; background: linear-gradient(120deg, #34d399, #22d3ee, #818cf8, #e879f9, #34d399); background-size: 300% 300%; animation: fx-aurora 5s ease-in-out infinite; }
.fx-frame-aurora::after { content: ""; inset: calc(var(--ring) * -2); border-radius: inherit; z-index: -2; background: inherit; background: linear-gradient(120deg, #34d399, #22d3ee, #818cf8, #e879f9, #34d399); background-size: 300% 300%; filter: blur(14px); opacity: .55; animation: fx-aurora 5s ease-in-out infinite; }
@keyframes fx-aurora { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.fx-frame-orbit::before { content: ""; inset: calc(var(--ring) * -1); border-radius: inherit; z-index: -1; border: 2px solid rgba(108, 176, 255, .45); }
.fx-frame-orbit::after { content: ""; width: 9px; height: 9px; left: 50%; top: 50%; margin: -4.500px; border-radius: 50%; z-index: 3; background: #fff; box-shadow: 0 0 10px 3px #6cb0ff; offset-path: inset(calc(var(--ring) * -1) round 16px); animation: fx-orbit 2.8s linear infinite; }
.fx-frame-orbit::after { left: 0; top: 0; margin: 0; }
@keyframes fx-orbit { from { offset-distance: 0%; } to { offset-distance: 100%; } }

.fx-frame-glitch::before, .fx-frame-glitch::after { content: ""; inset: calc(var(--ring) * -1); border-radius: inherit; z-index: -1; }
.fx-frame-glitch::before { background: #22d3ee; animation: fx-glitch-a 1.6s steps(2, end) infinite; }
.fx-frame-glitch::after { background: #f43f5e; mix-blend-mode: screen; animation: fx-glitch-b 1.3s steps(2, end) infinite; }
@keyframes fx-glitch-a { 0%, 86%, 100% { transform: translate(0, 0); } 88% { transform: translate(-3px, 2px); } 92% { transform: translate(3px, -2px); } 96% { transform: translate(-2px, -3px); } }
@keyframes fx-glitch-b { 0%, 80%, 100% { transform: translate(0, 0); } 84% { transform: translate(3px, 3px); } 90% { transform: translate(-3px, 1px); } 94% { transform: translate(2px, -3px); } }

/* ---- Profile banners ---- */
.profile-banner { position: relative; height: clamp(150px, 22vw, 260px); overflow: hidden; background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent-user, var(--accent)) 55%, #070a10)); }
.profile-banner img, .profile-banner video { display: block; width: 100%; height: 100%; object-fit: cover; }
.fx-banner-aurora { background: linear-gradient(120deg, #052e2b, #0ea5a4, #312e81, #a21caf, #052e2b); background-size: 400% 400%; animation: fx-aurora 14s ease-in-out infinite; }
.fx-banner-grid { background: linear-gradient(180deg, #0a0420 0%, #2b0b57 55%, #ff2e88 56%, #120633 57%); }
.fx-banner-grid::before { content: ""; position: absolute; left: -50%; right: -50%; bottom: 0; height: 44%; background-image: linear-gradient(rgba(255, 46, 136, .75) 2px, transparent 2px), linear-gradient(90deg, rgba(255, 46, 136, .75) 2px, transparent 2px); background-size: 44px 44px; transform: perspective(240px) rotateX(58deg); transform-origin: top; animation: fx-grid 1.6s linear infinite; }
@keyframes fx-grid { to { background-position: 0 44px; } }
.fx-banner-stars { background: radial-gradient(ellipse at 30% 110%, #1b2a6b 0%, #060818 62%); }
.fx-banner-stars::before, .fx-banner-stars::after { content: ""; position: absolute; inset: 0; background-repeat: repeat; }
.fx-banner-stars::before { background-image: radial-gradient(1.5px 1.5px at 20px 30px, #fff, transparent), radial-gradient(1px 1px at 90px 70px, #cfe3ff, transparent), radial-gradient(1.5px 1.5px at 160px 20px, #fff, transparent), radial-gradient(1px 1px at 230px 110px, #fff, transparent), radial-gradient(1.5px 1.5px at 300px 60px, #cfe3ff, transparent); background-size: 340px 150px; animation: fx-twinkle 3.2s ease-in-out infinite alternate; }
.fx-banner-stars::after { background-image: radial-gradient(2px 2px at 60px 110px, #fff, transparent), radial-gradient(1px 1px at 140px 40px, #fff, transparent), radial-gradient(2px 2px at 270px 130px, #a5c8ff, transparent); background-size: 300px 170px; animation: fx-twinkle 2.300s ease-in-out .9s infinite alternate, fx-drift 60s linear infinite; }
@keyframes fx-twinkle { from { opacity: .35; } to { opacity: 1; } }
@keyframes fx-drift { to { background-position: 300px 0; } }
.fx-banner-molten { background: radial-gradient(circle at 20% 90%, #ffd54f, transparent 28%), radial-gradient(circle at 70% 80%, #ff9100, transparent 34%), radial-gradient(circle at 45% 110%, #ff3d00, transparent 48%), #230500; background-size: 200% 200%; animation: fx-molten 9s ease-in-out infinite alternate; }
@keyframes fx-molten { from { background-position: 0% 100%; filter: brightness(.9); } to { background-position: 100% 60%; filter: brightness(1.15); } }

/* ---- Profile effects ---- */
.fx-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; border-radius: inherit; }
.fx-overlay-asset { width: 100%; height: 100%; object-fit: cover; }
.fx-effect-snow { background-image: radial-gradient(3px 3px at 30px 20px, #fff, transparent), radial-gradient(2px 2px at 120px 70px, #dbeafe, transparent), radial-gradient(3px 3px at 210px 30px, #fff, transparent), radial-gradient(2px 2px at 300px 90px, #fff, transparent), radial-gradient(2px 2px at 70px 120px, #dbeafe, transparent), radial-gradient(3px 3px at 260px 140px, #fff, transparent); background-size: 340px 170px; animation: fx-snow 7s linear infinite; }
@keyframes fx-snow { to { background-position: 40px 170px; } }
.fx-effect-sparks { background-image: radial-gradient(2.5px 2.5px at 40px 150px, #ffd54f, transparent), radial-gradient(2px 2px at 120px 90px, #ff9100, transparent), radial-gradient(3px 3px at 200px 130px, #ffb74d, transparent), radial-gradient(2px 2px at 290px 60px, #ff6d00, transparent), radial-gradient(2.5px 2.5px at 340px 120px, #ffd54f, transparent); background-size: 380px 180px; animation: fx-sparks 3.400s linear infinite; }
@keyframes fx-sparks { to { background-position: -30px -180px; } }

/* ---- Name styles ---- */
.fx-name-gradient { background: linear-gradient(90deg, #22d3ee, #818cf8, #ec4899, #22d3ee); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent !important; animation: fx-name-flow 4s linear infinite; }
@keyframes fx-name-flow { to { background-position: 300% 0; } }
.fx-name-glow { text-shadow: 0 0 8px var(--role, #6cb0ff), 0 0 18px var(--role, #6cb0ff); animation: fx-name-pulse 2.400s ease-in-out infinite alternate; }
@keyframes fx-name-pulse { from { filter: brightness(.95); } to { filter: brightness(1.3); } }
.fx-name-shimmer { background: linear-gradient(100deg, var(--role, #a6b2c4) 40%, #fff 50%, var(--role, #a6b2c4) 60%); background-size: 240% 100%; -webkit-background-clip: text; background-clip: text; color: transparent !important; animation: fx-name-sweep 2.800s linear infinite; }
@keyframes fx-name-sweep { from { background-position: 120% 0; } to { background-position: -120% 0; } }

/* ---- Badges ---- */
.item-badge { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-left: 5px; vertical-align: -3px; border-radius: 5px; --ia: currentColor; }
.item-badge .i { width: 15px; height: 15px; }
.rarity-common.item-badge { color: #a6b2c4; }
.rarity-rare.item-badge { color: #6cb0ff; }
.rarity-epic.item-badge { color: #c084fc; }
.rarity-legendary.item-badge { color: #ffb020; filter: drop-shadow(0 0 4px rgba(255, 176, 32, .7)); }
.rarity { font: 600 11.500px ui-monospace, Consolas, monospace; }
.rarity-common { color: #a6b2c4; } .rarity-rare { color: #6cb0ff; } .rarity-epic { color: #c084fc; } .rarity-legendary { color: #ffb020; }

/* ---- Store ---- */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 14px; margin-bottom: 18px; }
.store-card { padding: 0; margin: 0; overflow: hidden; color: var(--text); display: flex; flex-direction: column; transition: border-color .12s, transform .15s var(--ease); }
a.store-card:hover { border-color: var(--accent); transform: translateY(-3px); text-decoration: none; }
.store-card.is-equipped { border-color: var(--good); }
.store-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; flex: 1; }
.store-card-body h2 { font-size: 17px; margin: 0; }
.store-card-body form { margin: 4px 0 0; }
.store-card-foot { margin-top: auto; padding-top: 6px; }
.store-price { font: 800 18px var(--display); letter-spacing: -.03em; }
.item-preview { position: relative; height: 150px; display: flex; align-items: center; justify-content: center; gap: 3px; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.item-preview .profile-banner { position: absolute; inset: 0; height: auto; }
.preview-name { font: 800 21px var(--display); letter-spacing: -.03em; }
.item-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.item-layout > .card { margin: 0; }
.item-stage { padding: 0; overflow: hidden; }
.item-stage .item-preview { height: clamp(240px, 32vw, 380px); border-bottom: 0; }
.item-stage .preview-name { font-size: 38px; }
.item-price { font: 800 44px/1 var(--display); letter-spacing: -.05em; margin: 10px 0 12px; }
.pay-buttons { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 0; }

/* ---- Plans ---- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 16px; align-items: stretch; margin-bottom: 16px; }
.plan { display: flex; flex-direction: column; margin: 0; }
.plan h2 { margin-bottom: 8px; }
.plan-highlight { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plan-flag { position: absolute; top: -11px; left: 20px; padding: 2px 10px; border-radius: 6px; background: var(--accent); color: #fff; font: 800 12px var(--font); }
.plan-action { margin-top: auto; display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.plan-action .badge { align-self: flex-start; }

/* ---- Profile hero ---- */
.profile-hero { margin-bottom: 18px; }
.profile-avatar { position: relative; z-index: 2; margin-top: -40px; flex: none; }
.profile-avatar .av { outline: 4px solid var(--surface); width: 128px; height: 128px; font-size: 44px; border-radius: 20px; }
.profile-id { position: relative; z-index: 2; flex: 1; min-width: 200px; padding-top: 14px; display: block; }
.profile-id h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1.05; overflow-wrap: anywhere; }
.profile-id .muted { margin: 6px 0 0; }
.profile-actions { position: relative; z-index: 2; }
.profile-actions form { margin: 0; }
.custom-title { font-size: 13px; font-weight: 700; color: var(--muted); margin: 2px 0 0; overflow-wrap: anywhere; }
.role-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.stat-value-sm { font-size: clamp(18px, 1.6vw, 22px); }
.about-list { margin-top: 14px; }
.signature { margin-top: 14px; padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: 13px; color: var(--muted); }
.section-title { font-size: clamp(24px, 3vw, 38px); margin: 30px 0 14px; }
.sub-title { font-size: 18px; margin: 0; }
.category-head form { margin: 0; }

@media (max-width: 760px) {
  .item-layout { grid-template-columns: 1fr; }
  .profile-avatar .av { width: 96px; height: 96px; font-size: 32px; }
}

/* ---- v3: fx.js draws the particles and shaders; these are the rings and fallbacks ---- */
.fx-canvas { position: absolute; pointer-events: none; }
.av-frame > .fx-canvas { inset: -32%; width: 164%; height: 164%; z-index: 3; }
.fx-overlay > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.profile-banner > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
[data-fx-banner] { background: linear-gradient(120deg, #0a1030, #1b1464, #30115e); }

.fx-frame-flame::before { content: ""; inset: calc(var(--ring) * -.7); border-radius: inherit; z-index: -1; background: linear-gradient(0deg, #ff3d00, #ff9100 55%, #ffd54f); box-shadow: 0 0 22px 4px rgba(255, 98, 0, .6); animation: fx-ember 1.4s ease-in-out infinite alternate; }
.fx-frame-lightning::before { content: ""; inset: calc(var(--ring) * -.7); border-radius: inherit; z-index: -1; background: #bcd8ff; box-shadow: 0 0 18px 4px rgba(120, 170, 255, .75); animation: fx-flicker 2.400s steps(1, end) infinite; }
.fx-frame-galaxy::before { content: ""; inset: calc(var(--ring) * -.7); border-radius: inherit; z-index: -1; background: conic-gradient(from var(--spin), #6d28d9, #1d4ed8, #0ea5e9, #6d28d9); box-shadow: 0 0 20px 3px rgba(99, 102, 241, .55); animation: fx-spin 5s linear infinite; }
.fx-frame-frost::before { content: ""; inset: calc(var(--ring) * -.7); border-radius: inherit; z-index: -1; background: linear-gradient(135deg, #e0f2fe, #7dd3fc 45%, #bae6fd); box-shadow: 0 0 18px 3px rgba(125, 211, 252, .55); }
.fx-frame-sakura::before { content: ""; inset: calc(var(--ring) * -.7); border-radius: inherit; z-index: -1; background: linear-gradient(135deg, #fbcfe8, #f472b6); box-shadow: 0 0 14px 2px rgba(244, 114, 182, .45); }
.fx-frame-toxic::before { content: ""; inset: calc(var(--ring) * -.7); border-radius: inherit; z-index: -1; background: linear-gradient(0deg, #16a34a, #a3e635); box-shadow: 0 0 18px 3px rgba(132, 204, 22, .6); animation: fx-ember 1.8s ease-in-out infinite alternate; }
.fx-frame-hearts::before { content: ""; inset: calc(var(--ring) * -.7); border-radius: inherit; z-index: -1; background: linear-gradient(135deg, #fb7185, #e11d48); animation: fx-beat 1.100s ease-in-out infinite; }
@keyframes fx-flicker { 0%, 40%, 44%, 70%, 73%, 100% { opacity: 1; filter: brightness(1.3); } 42%, 72% { opacity: .35; filter: none; } }
@keyframes fx-beat { 0%, 50%, 100% { transform: scale(1); } 15% { transform: scale(1.05); } 30% { transform: scale(1.01); } }

/* Name styles */
.fx-name-rainbow { background: linear-gradient(90deg, #ff4d4d, #ffb020, #fff04d, #3ddc97, #38bdf8, #a78bfa, #ff4d4d); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent !important; animation: fx-name-flow 3.500s linear infinite; }
.fx-name-fire { background: linear-gradient(0deg, #ff3d00, #ff9100 50%, #ffe082); background-size: 100% 200%; -webkit-background-clip: text; background-clip: text; color: transparent !important; filter: drop-shadow(0 0 6px rgba(255, 90, 0, .75)); animation: fx-name-burn 1.100s ease-in-out infinite alternate; }
@keyframes fx-name-burn { from { background-position: 0 0; filter: drop-shadow(0 0 4px rgba(255, 90, 0, .6)); } to { background-position: 0 100%; filter: drop-shadow(0 0 10px rgba(255, 140, 0, .95)); } }
.fx-name-ice { background: linear-gradient(100deg, #e0f2fe, #38bdf8 35%, #ffffff 50%, #38bdf8 65%, #e0f2fe); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent !important; filter: drop-shadow(0 0 5px rgba(56, 189, 248, .6)); animation: fx-name-sweep 4s linear infinite; }
.fx-name-neon { color: #fff !important; text-shadow: 0 0 4px #fff, 0 0 10px var(--neon, #ff2e88), 0 0 22px var(--neon, #ff2e88); animation: fx-neon 3.200s steps(1, end) infinite; }
@keyframes fx-neon { 0%, 18%, 22%, 62%, 66%, 100% { opacity: 1; } 20%, 64% { opacity: .55; text-shadow: none; } }
.fx-name-glitch { position: relative; display: inline-block; color: var(--text) !important; }
.fx-name-glitch::before, .fx-name-glitch::after { content: attr(data-text); position: absolute; left: 0; top: 0; pointer-events: none; }
.fx-name-glitch::before { color: #22d3ee; animation: fx-glitch-a 1.400s steps(2, end) infinite; clip-path: inset(0 0 55% 0); }
.fx-name-glitch::after { color: #f43f5e; animation: fx-glitch-b 1.100s steps(2, end) infinite; clip-path: inset(50% 0 0 0); }

/* Badges */
.item-badge { position: relative; overflow: hidden; }
.rarity-epic.item-badge, .rarity-legendary.item-badge { animation: fx-badge 2.600s ease-in-out infinite; }
@keyframes fx-badge { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-1px) scale(1.12); } }

/* Store */
.store-hero { position: relative; border-radius: 16px; overflow: hidden; margin: 22px auto 18px; border: 1px solid var(--line); min-height: 260px; display: flex; align-items: stretch; background: var(--surface); }
.store-hero .profile-banner { position: absolute; inset: 0; height: auto; }
.store-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5, 7, 12, .85), rgba(5, 7, 12, .25) 70%); pointer-events: none; }
.store-hero-copy { position: relative; z-index: 2; padding: 30px; color: #fff; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: 620px; }
.store-hero-copy h1 { font-size: clamp(38px, 6vw, 76px); color: #fff; }
.store-hero-copy p { font-size: 16px; font-weight: 600; margin: 0 0 8px; }
.store-hero-frame { display: inline-flex; align-items: center; gap: 22px; padding: 16px 20px 16px 22px; background: rgba(7, 10, 16, .55); border-radius: 12px; color: #fff; backdrop-filter: blur(4px); }
.store-hero-frame:hover { text-decoration: none; background: rgba(7, 10, 16, .75); }
.store-hero-frame strong { display: block; font: 800 18px var(--display); }
.store-hero-frame .av-lg { width: 64px; height: 64px; font-size: 22px; }
.store-desc { margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rarity-card-rare:hover { box-shadow: 0 0 0 1px #6cb0ff, 0 10px 34px -10px rgba(108, 176, 255, .6); border-color: #6cb0ff; }
.rarity-card-epic:hover { box-shadow: 0 0 0 1px #c084fc, 0 10px 34px -10px rgba(192, 132, 252, .65); border-color: #c084fc; }
.rarity-card-legendary { border-color: rgba(255, 176, 32, .4); }
.rarity-card-legendary:hover { box-shadow: 0 0 0 1px #ffb020, 0 12px 40px -8px rgba(255, 176, 32, .7); border-color: #ffb020; }
.item-preview-frame, .item-preview-effect { background: radial-gradient(circle at 50% 60%, var(--surface-3), var(--surface-2) 70%); }
.item-preview { height: 170px; }
.mock-profile { padding: 14px 16px 18px; border-top: 1px solid var(--line); }
.mock-card { margin-top: 8px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.mock-card .profile-banner { height: 110px; }
.mock-body { position: relative; display: flex; gap: 22px; align-items: center; padding: 16px 24px; background: var(--surface); min-height: 110px; overflow: hidden; }
.mock-body .av-lg { width: 64px; height: 64px; font-size: 22px; }
.mock-name { font: 800 20px var(--display); }
.mock-body p { margin: 0; }
.item-stage .item-preview { height: clamp(200px, 26vw, 300px); border-bottom: 0; }
