/* RDash badges: the pictures (badges_lib.php) and their preview page (badges.php).
   Metal badges shine: a pulse of light behind, a band of light across, sparkles. Event badges stay still. */
/* profile and the Customize drawer set fill/stroke on every svg (.pf-page svg): give the badge pictures back their own defaults */
html body svg.bd { fill: #000; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; }
.bd { display: block; width: 100%; height: auto; overflow: visible; }
.bd .bd-aura { transform-box: fill-box; transform-origin: center; animation: bd-pulse 3.6s ease-in-out infinite; }
.bd .bd-rays { transform-box: fill-box; transform-origin: center; animation: bd-turn 40s linear infinite; }
.bd .bd-shine { animation: bd-shine 4.2s ease-in-out infinite; }
.bd .bd-spark { transform-box: fill-box; transform-origin: center; opacity: 0; animation: bd-twinkle 2.6s ease-in-out infinite; }
.bd-gold .bd-shine { animation-duration: 3.8s; }
.bd-diamond .bd-shine { animation-duration: 3.2s; }
.bd-exclusive .bd-shine { animation-duration: 3s; }
@keyframes bd-pulse { 0%, 100% { opacity: .55; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes bd-turn { to { transform: rotate(360deg); } }
@keyframes bd-shine { 0% { transform: translateX(0); } 55%, 100% { transform: translateX(240px); } }
@keyframes bd-twinkle { 0%, 100% { opacity: 0; transform: scale(.3) rotate(0deg); } 45% { opacity: 1; transform: scale(1) rotate(45deg); } 70% { opacity: 0; transform: scale(.4) rotate(90deg); } }
.bd-event .bd-aura, .bd-event .bd-shine, .bd-event .bd-spark { display: none; }
/* event badges: the scene belongs to the event (snow and lights / a hopping egg / bats and a pumpkin) */
.bd [class^="ev-"], .bd [class*=" ev-"] { transform-box: fill-box; transform-origin: center; }
.ev-flake { animation: ev-fall 4s linear infinite; }
.ev-blink { animation: ev-blink 1.8s ease-in-out infinite; }
.ev-pop { animation: ev-pop 2.4s ease-in-out infinite; }
.ev-hop { transform-origin: 50% 100%; animation: ev-hop 2.2s cubic-bezier(.3, .1, .3, 1) infinite; }
.ev-shadow { animation: ev-shadow 2.2s cubic-bezier(.3, .1, .3, 1) infinite; }
.ev-conf { animation: ev-rise 2.1s ease-out infinite; opacity: 0; }
.ev-bat { animation: ev-bat 7s linear infinite; }
.ev-flap { transform-origin: 50% 50%; animation: ev-flap .38s ease-in-out infinite; }
.ev-glow { animation: ev-glow 2.6s ease-in-out infinite; }
.ev-face { animation: ev-flicker 3.4s steps(1, end) infinite; }
.ev-twinkle { animation: ev-twinkle 2.4s ease-in-out infinite; }
.ev-sleigh { animation: ev-sleigh 13s linear infinite; }
.ev-wiggle { transform-origin: 50% 100%; animation: ev-wiggle 2.6s ease-in-out infinite; }
.ev-spin { animation: ev-spin 26s linear infinite; }
.ev-sway { transform-origin: 50% 100%; animation: ev-sway 2.8s ease-in-out infinite; }
.ev-bfly { animation: ev-bfly 7s ease-in-out infinite; }
.ev-wing { transform-origin: 50% 50%; animation: ev-wing .3s ease-in-out infinite; }
.ev-dangle { animation: ev-dangle 3.2s ease-in-out infinite; }
.ev-float { animation: ev-float 3s ease-in-out infinite; }
@keyframes ev-sleigh { 0% { transform: translate(-26px, 6px); } 30% { transform: translate(40px, -6px); } 55% { transform: translate(140px, 4px); } 100% { transform: translate(140px, 4px); } }
@keyframes ev-wiggle { 0%, 70%, 100% { transform: rotate(0deg); } 78% { transform: rotate(-7deg); } 86% { transform: rotate(6deg); } 94% { transform: rotate(-3deg); } }
@keyframes ev-spin { to { transform: rotate(360deg); } }
@keyframes ev-sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes ev-bfly { 0% { transform: translate(0, 0); } 25% { transform: translate(16px, -9px); } 50% { transform: translate(30px, 3px); } 75% { transform: translate(14px, 11px); } 100% { transform: translate(0, 0); } }
@keyframes ev-wing { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(.3); } }
@keyframes ev-dangle { 0%, 100% { transform: translateY(-5px); } 50% { transform: translateY(9px); } }
@keyframes ev-float { 0%, 100% { transform: translateY(-3px); opacity: .7; } 50% { transform: translateY(3px); opacity: 1; } }
@keyframes ev-fall { 0% { transform: translate(0, 0); opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { transform: translate(var(--dx, 5px), 76px); opacity: 0; } }
@keyframes ev-blink { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1.18); } }
@keyframes ev-pop { 0%, 100% { transform: scale(1) rotate(0deg); } 50% { transform: scale(1.22) rotate(10deg); } }
@keyframes ev-hop { 0% { transform: translateY(0) scale(1.06, .92); } 18% { transform: translateY(0) scale(1, 1); } 50% { transform: translateY(-9px) rotate(-5deg); } 82% { transform: translateY(0) scale(1, 1) rotate(0deg); } 100% { transform: translateY(0) scale(1.06, .92); } }
@keyframes ev-shadow { 0%, 100% { transform: scale(1); opacity: .35; } 50% { transform: scale(.6); opacity: .18; } }
@keyframes ev-rise { 0% { transform: translateY(6px) scale(.3); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(-20px) scale(1); opacity: 0; } }
@keyframes ev-bat { 0% { transform: translate(-22px, 0); } 25% { transform: translate(18px, -5px); } 50% { transform: translate(58px, 3px); } 75% { transform: translate(98px, -4px); } 100% { transform: translate(138px, 0); } }
@keyframes ev-flap { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.35); } }
@keyframes ev-glow { 0%, 100% { opacity: .55; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes ev-flicker { 0%, 100% { opacity: 1; } 8% { opacity: .55; } 12% { opacity: 1; } 55% { opacity: 1; } 58% { opacity: .65; } 62% { opacity: 1; } }
@keyframes ev-twinkle { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.bd-still [class^="ev-"], .bd-still [class*=" ev-"] { animation: none !important; }
.bd-still .ev-conf { display: none; }
/* compact = no text round the badge; it still moves. bd-still = no motion at all (long lists) */
.bd-still .bd-aura, .bd-still .bd-rays, .bd-still .bd-shine { animation: none; }
.bd-still .bd-spark { display: none; }
@media (prefers-reduced-motion: reduce) { .bd *, .bd { animation: none !important; } .bd .bd-spark { opacity: 0; } }

/* ---- preview page */
.bg-page { width: min(1100px, calc(100% - 32px)); margin: 30px auto 80px; color: #e6edf7; }
.bg-hero { margin-bottom: 22px; padding: clamp(20px, 4vw, 34px); border: 1px solid rgba(255, 255, 255, .11); border-radius: 10px; background: rgba(255, 255, 255, .03); }
.bg-hero h1 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 38px); letter-spacing: -.03em; color: #fff; }
.bg-hero p { max-width: 640px; margin: 0; color: #a8b3c6; font-size: 14.5px; line-height: 1.6; }
.bg-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 18px 0 0; padding: 0; list-style: none; color: #c6d0df; font-size: 13px; }
.bg-legend li { display: flex; align-items: center; gap: 8px; }
.bg-legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--c, #fff); }
.bg-legend i.is-rainbow { background: linear-gradient(135deg, #ffc8dc, #ffe2b6, #fff5b0, #c8f4d6, #bfe2ff, #dcc6ff); }
.bg-sec { margin-bottom: 26px; }
.bg-sec-head { margin: 0 2px 12px; }
.bg-sec-head h2 { margin: 0; font-size: 19px; letter-spacing: -.02em; color: #fff; }
.bg-sec-head p { margin: 4px 0 0; color: #8d9ab0; font-size: 13.5px; }
.bg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.bg-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 14px 18px; border: 1px solid rgba(255, 255, 255, .11); border-radius: 10px; background: rgba(255, 255, 255, .025); text-align: center; transition: border-color .25s ease, background .25s ease; }
.bg-card:hover { border-color: rgba(255, 255, 255, .22); background: rgba(255, 255, 255, .04); }
.bg-art { width: 150px; max-width: 100%; margin-bottom: 8px; }
.bg-tier { font-size: 15px; letter-spacing: -.01em; }
.bg-tier-bronze { color: #e8b184; } .bg-tier-silver { color: #d6deea; } .bg-tier-gold { color: #f6c453; } .bg-tier-diamond { color: #c084fc; }
.bg-tier-exclusive { background: linear-gradient(90deg, #ffb3cf, #ffd9a8, #f6f0a0, #b8efca, #a9d8ff, #cdb6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bg-event-christmas { color: #ff6b70; } .bg-event-easter { color: #58d69a; } .bg-event-halloween { color: #ffa94d; }
.bg-need { color: #9aa7bb; font-size: 13px; line-height: 1.4; }
.bg-sizes { display: grid; gap: 10px; padding: 18px; border: 1px solid rgba(255, 255, 255, .11); border-radius: 10px; background: rgba(255, 255, 255, .025); }
.bg-size-row { display: flex; align-items: center; gap: calc(var(--s) * .35); flex-wrap: wrap; }
.bg-size-row small { width: 48px; color: #8d9ab0; font-size: 12px; }
.bg-mini { display: block; width: var(--s); }
@media (max-width: 650px) { .bg-page { width: calc(100% - 22px); margin-top: 16px; } .bg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bg-art { width: 124px; } }

/* ---- profile: the Badges section and the pinning list in Customize */
.pf-bd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 12px 8px; }
.pf-bd { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-width: 0; }
.pf-bd .bd-tip { width: 64px; }
.pf-bd strong { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e6edf7; font-size: 12px; font-weight: 700; }
.pf-bd small { color: #8d9ab0; font-size: 11px; }
.pf-order { display: grid; gap: 6px; margin-bottom: 10px; }
.pf-orow .pf-bpthumb { flex: none; width: 30px; }
.pf-bpick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 8px; }
.pf-bpick { display: grid; place-items: center; padding: 6px; border: 1px solid rgba(255, 255, 255, .11); border-radius: 10px; background: rgba(255, 255, 255, .03); cursor: pointer; transition: border-color .2s ease, background .2s ease, opacity .2s ease; }
.pf-bpick:hover:not(:disabled) { border-color: rgba(255, 255, 255, .28); }
.pf-bpick.is-on { border-color: var(--pf-accent, #4aa8ff); background: rgba(255, 255, 255, .07); }
.pf-bpick:disabled { opacity: .35; cursor: not-allowed; }
.pf-bpick .bd-tip { width: 36px; }
