/* Badges, volunteer profile, document studio and verification. */

/* ---------- Medal artwork motion ---------- */
.vb { width: 100%; height: auto; overflow: visible; }
.vb-rays { transform-origin: 100px 100px; animation: vb-spin 28s linear infinite; }
.vb-glint path { transform-box: fill-box; transform-origin: center; animation: vb-glint 3.6s ease-in-out infinite; }
.vb-glint path + path { animation-delay: 1.8s; }
@keyframes vb-spin { to { transform: rotate(360deg); } }
@keyframes vb-glint { 0%, 55%, 100% { transform: scale(0) rotate(0); opacity: 0; } 70% { transform: scale(1) rotate(45deg); opacity: 1; } 85% { transform: scale(0) rotate(90deg); opacity: 0; } }

.bar-s { display: block; width: 100%; height: 6px; border-radius: 9px; background: var(--mist-2); overflow: hidden; }
.bar-s i { display: block; height: 100%; width: var(--v, 0%); border-radius: inherit; background: linear-gradient(to left, var(--plum), var(--saff) 55%, var(--sky)); transition: width 1s var(--ease); }
.bar-s.lg { height: 10px; }

/* ---------- Level ---------- */
.lvl { display: flex; flex-direction: column; gap: .45rem; padding: 1rem 1.2rem; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line-2); margin-bottom: 1.2rem; }
.lvl-top { display: flex; justify-content: space-between; gap: .8rem; flex-wrap: wrap; align-items: baseline; }
.lvl-top b { font-family: var(--f-disp); font-size: 1.15rem; }
.lvl-top span, .lvl small { color: var(--mut); font-size: 13px; }

/* ---------- Almost there ---------- */
.next { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: .8rem; margin-bottom: 1.8rem; }
.next-i { display: flex; align-items: center; gap: .9rem; padding: .85rem 1rem; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--sh-1); }
.next-art { position: relative; width: 78px; flex: none; }
.next-veil { position: absolute; inset: 0; clip-path: inset(0 0 calc(var(--p) * 1%) 0); }
.next-i > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .2rem; }
.next-i b { font-size: 15px; } .next-i small { color: var(--mut); font-size: 13px; }
.next-i em { font-style: normal; font-weight: 800; color: var(--plum); font-size: 1.1rem; }

/* ---------- Cabinet ---------- */
.cab { display: flex; flex-direction: column; gap: 1.1rem; margin-bottom: 1rem; }
.cab-filter { display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .2rem; }
.cab-filter button { flex: none; display: inline-flex; align-items: center; gap: .45rem; min-height: 42px; padding: 0 1.1rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 14px; }
.cab-filter button i { font-style: normal; font-size: 12px; opacity: .65; }
.cab-filter button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.cab-fam { border-radius: var(--r-xl); padding: 1.2rem; color: #fff; background: radial-gradient(70% 120% at 100% 0%, rgba(163, 19, 79, .38), transparent 60%), radial-gradient(60% 100% at 0% 100%, rgba(10, 139, 208, .28), transparent 65%), #1E1230; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), var(--sh-2); }
.cab-fam header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .9rem; }
.cab-fam h3 { font-family: var(--f-disp); font-size: 1.3rem; }
.cab-fam header p { color: rgba(255, 255, 255, .62); font-size: 13px; }
.cab-count { flex: none; font-weight: 800; font-size: 13px; padding: .2rem .75rem; border-radius: 99px; background: rgba(255, 255, 255, .1); }
.cab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: .6rem; }
.medal { position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .8rem .5rem .75rem; border: 1px solid rgba(255, 255, 255, .06); border-radius: 20px; background: rgba(255, 255, 255, .035); color: #fff; text-align: center; transition: transform .25s var(--ease), background .25s; }
.medal:hover { transform: translateY(-4px); background: rgba(255, 255, 255, .09); }
.medal:active { transform: scale(.96); }
.medal-art { width: 92px; max-width: 100%; transition: transform .35s var(--ease), filter .35s; }
.medal:hover .medal-art { transform: scale(1.09) rotate(-3deg); }
.medal b { font-size: 13.5px; line-height: 1.4; }
.medal small { font-size: 11.5px; color: rgba(255, 255, 255, .55); }
.medal .bar-s { width: 74%; height: 5px; background: rgba(255, 255, 255, .13); }
.medal:not(.is-on) .medal-art { opacity: .5; }
.medal:not(.is-on) b { color: rgba(255, 255, 255, .6); }
.medal.is-on.r-rare { border-color: rgba(120, 200, 255, .28); }
.medal.is-on.r-epic { border-color: rgba(255, 120, 175, .42); background: linear-gradient(170deg, rgba(210, 40, 110, .22), rgba(255, 255, 255, .03)); }
.medal.is-on.r-legendary { border-color: rgba(255, 205, 90, .65); background: linear-gradient(170deg, rgba(255, 184, 50, .24), rgba(10, 139, 208, .1)); box-shadow: 0 0 30px -8px rgba(255, 190, 60, .45); }
.medal.is-on .medal-r { color: #FFD88A; font-weight: 700; }
.medal:not(.is-on) .vb-glint, .medal:not(.is-on) .vb-rays { display: none; }

/* ---------- Details sheet ---------- */
.hsheet { width: min(400px, calc(100vw - 24px)); max-height: 92vh; border: 0; border-radius: 30px; padding: 1.6rem 1.4rem 1.5rem; text-align: center; color: #fff; background: radial-gradient(90% 60% at 50% 0%, rgba(163, 19, 79, .55), transparent 70%), #1B102C; box-shadow: 0 40px 90px -20px rgba(0, 0, 0, .7); }
.hsheet[open] { display: flex; flex-direction: column; align-items: center; gap: .45rem; animation: sheet-in .35s var(--ease); }
.hsheet::backdrop { background: rgba(18, 10, 30, .7); backdrop-filter: blur(8px); }
.hs-x { position: absolute; top: 14px; left: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: #fff; }
.hs-art { width: 190px; margin: .6rem 0 .2rem; animation: medal-in .8s var(--ease); }
.hs-r { font-weight: 800; color: #FFD88A; }
.hsheet h3 { font-family: var(--f-disp); font-size: 1.7rem; }
.hsheet p { color: rgba(255, 255, 255, .75); }
.hsheet blockquote { margin: .3rem 0; padding: .7rem 1rem; border-radius: 16px; background: rgba(255, 255, 255, .08); font-size: 14px; }
.hsheet .bar-s { background: rgba(255, 255, 255, .14); margin-top: .4rem; }
.hs-st { font-size: 13.5px; font-weight: 700; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(40px) scale(.96); } }
@keyframes medal-in { from { transform: perspective(600px) rotateY(-180deg) scale(.5); opacity: 0; } }

/* ---------- Unlock celebration ---------- */
.party { position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .8rem; padding: 1.5rem; text-align: center; color: #fff; background: radial-gradient(60% 55% at 50% 42%, rgba(163, 19, 79, .75), transparent 70%), rgba(18, 9, 31, .96); }
.party canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.party-i { position: relative; display: flex; flex-direction: column; align-items: center; gap: .4rem; }
.party-i > small { font-weight: 800; color: #FFD88A; animation: rise .5s var(--ease) .35s both; }
.party-art { width: min(260px, 62vw, 36vh); animation: medal-in 1s var(--ease) both; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .5)); }
.party h2 { font-size: clamp(1.9rem, 7vw, 2.8rem); animation: rise .5s var(--ease) .5s both; }
.party p { max-width: 36ch; color: rgba(255, 255, 255, .8); animation: rise .5s var(--ease) .62s both; }
.party-xp { padding: .3rem 1rem; border-radius: 99px; background: rgba(255, 255, 255, .12); animation: rise .5s var(--ease) .75s both; }
.party > button { position: relative; min-width: 180px; justify-content: center; }
.party-more { position: relative; color: rgba(255, 255, 255, .55); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* ---------- Public profile ---------- */
.pf-hero { position: relative; overflow: hidden; color: #fff; background: #170D27; padding: clamp(1.6rem, 5vw, 3.6rem) 0 clamp(2rem, 5vw, 3.4rem); isolation: isolate; }
.pf-aurora { position: absolute; inset: -30%; z-index: -1; background: radial-gradient(35% 40% at 70% 30%, rgba(194, 29, 100, .6), transparent 70%), radial-gradient(30% 35% at 28% 68%, rgba(10, 139, 208, .55), transparent 70%), radial-gradient(22% 28% at 45% 22%, rgba(245, 154, 11, .35), transparent 70%); animation: aurora 18s ease-in-out infinite alternate; }
@keyframes aurora { to { transform: translate3d(6%, -4%, 0) rotate(8deg) scale(1.08); } }
.pf-in { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.pf-private { grid-column: 1 / -1; display: flex; gap: .6rem; align-items: center; padding: .7rem 1rem; border-radius: 16px; background: rgba(255, 255, 255, .1); font-size: 14px; }
.pf-private a { font-weight: 800; text-decoration: underline; }
.pf-pass { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 20%; position: relative; justify-self: center; width: 100%; max-width: 360px; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 1.3rem 1.3rem 1.1rem; border-radius: 32px; overflow: hidden; background: linear-gradient(165deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .04) 60%); border: 1px solid rgba(255, 255, 255, .2); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8); backdrop-filter: blur(18px); transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .25s var(--ease); }
.pf-pass.r-legendary { border-color: rgba(255, 205, 90, .75); }
.pf-pass.r-epic { border-color: rgba(255, 120, 175, .6); }
.pf-holo { position: absolute; inset: 0; pointer-events: none; mix-blend-mode: color-dodge; opacity: .35; background: radial-gradient(240px circle at var(--mx) var(--my), rgba(255, 255, 255, .7), transparent 60%), repeating-linear-gradient(115deg, transparent 0 18px, rgba(80, 190, 255, .16) 22px, rgba(255, 90, 160, .16) 28px, transparent 34px 52px); }
.pf-pass-top { width: 100%; display: flex; align-items: center; gap: .6rem; text-align: start; }
.pf-pass-top img { border-radius: 50%; background: #fff; }
.pf-pass-top b { display: block; font-size: 14px; line-height: 1.3; } .pf-pass-top small { font-size: 11.5px; opacity: .7; }
.pf-chip { margin-inline-start: auto; display: inline-flex; align-items: center; gap: .25rem; font-size: 12px; font-weight: 700; padding: .2rem .65rem; border-radius: 99px; background: rgba(255, 255, 255, .14); }
.pf-chip .ic { width: 14px; height: 14px; }
.pf-ava { position: relative; width: 150px; height: 150px; margin: 1.3rem 0 .8rem; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#FFB02E calc(var(--p) * .5%), #FF5B9E calc(var(--p) * 1%), rgba(255, 255, 255, .14) 0); }
.pf-ava span { width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(150deg, #A3134F, #2A1B3D 75%); font-family: var(--f-disp); font-size: 4rem; font-weight: 700; box-shadow: 0 0 0 4px #1E1230; }
.pf-ava b { position: absolute; bottom: -4px; left: 50%; transform: translateX(-50%); min-width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #FFC44D; color: #2A1B3D; font-weight: 800; box-shadow: 0 0 0 4px #1E1230; }
.pf-pass h1 { font-size: clamp(1.8rem, 6vw, 2.3rem); line-height: 1.3; }
.pf-handle { opacity: .65; font-size: 13.5px; }
.pf-title { margin-top: .3rem; font-weight: 700; color: #FFD88A; }
.pf-pass-bot { width: 100%; display: flex; align-items: center; justify-content: space-between; margin-top: 1rem; padding-top: .8rem; border-top: 1px dashed rgba(255, 255, 255, .22); font-size: 12.5px; opacity: .85; }
.pf-ring { width: 34px; height: 34px; }
.pf-side { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.pf-bio { font-family: var(--f-disp); font-size: clamp(1.25rem, 2.6vw, 1.75rem); line-height: 1.7; }
.pf .lvl { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .12); margin: 0; }
.pf .lvl-top span, .pf .lvl small { color: rgba(255, 255, 255, .65); }
.pf .lvl .bar-s { background: rgba(255, 255, 255, .13); }
.pf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.pf-stats li { padding: .9rem .6rem; border-radius: 20px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); text-align: center; }
.pf-stats b { display: block; font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 800; line-height: 1.2; }
.pf-stats span { display: block; font-size: 12.5px; color: rgba(255, 255, 255, .65); line-height: 1.4; }
.pf-act { display: flex; flex-wrap: wrap; gap: .5rem; align-items: flex-start; }
.pf-btn { background: #fff; color: var(--ink); }
.pf-btn.ghost { background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .2); }
.pf-qr summary { list-style: none; cursor: pointer; } .pf-qr summary::-webkit-details-marker { display: none; }
.pf-qr div { width: 190px; margin-top: .6rem; padding: .6rem; border-radius: 18px; background: #fff; }
.pf-podium { display: flex; justify-content: center; align-items: flex-end; gap: clamp(.4rem, 3vw, 2.4rem); margin-top: clamp(1.8rem, 5vw, 3rem); }
.pf-top { margin: 0; display: flex; flex-direction: column; align-items: center; text-align: center; width: clamp(96px, 26vw, 170px); }
.pf-top span { width: 100%; animation: float 6s ease-in-out infinite; filter: drop-shadow(0 24px 30px rgba(0, 0, 0, .45)); }
.pf-top.p0 { order: 2; width: clamp(128px, 34vw, 220px); } .pf-top.p1 { order: 1; } .pf-top.p2 { order: 3; }
.pf-top.p1 span { animation-delay: -2s; } .pf-top.p2 span { animation-delay: -4s; }
.pf-top figcaption b { display: block; font-size: 14px; } .pf-top figcaption small { color: #FFD88A; font-size: 12px; }
@keyframes float { 50% { transform: translateY(-10px); } }
.pulse { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: clamp(3px, 1vw, 10px); height: 190px; padding: 1rem; margin-bottom: 2.4rem; border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line-2); }
.pulse li { display: grid; grid-template-rows: 20px 1fr 20px; justify-items: center; align-items: end; min-width: 0; }
.pulse b { font-size: 12px; }
.pulse i { width: 100%; max-width: 34px; height: calc(6px + var(--h) * (100% - 6px)); border-radius: 99px; background: var(--mist-2); }
.pulse li.on i { background: linear-gradient(to top, var(--plum), var(--saff)); }
.pulse small { color: var(--mut); font-size: 11px; white-space: nowrap; overflow: hidden; max-width: 100%; }

/* ---------- Studio ---------- */
.studio { padding: clamp(1.4rem, 4vw, 2.6rem) 0 3rem; }
.studio-head { margin-bottom: 1.4rem; }
.studio-head h1 { font-size: clamp(2rem, 6vw, 3rem); } .studio-head p { color: var(--mut); max-width: 60ch; }
.studio-back { display: inline-flex; align-items: center; gap: .2rem; color: var(--plum); font-weight: 700; font-size: 14px; }
.studio-in { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.studio-opt { display: flex; flex-direction: column; gap: 1.1rem; }
.studio fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.studio legend { font-weight: 800; margin-bottom: .5rem; padding: 0; }
.studio fieldset label { position: relative; display: block; cursor: pointer; }
.studio fieldset input { position: absolute; opacity: 0; pointer-events: none; }
.studio-types { display: flex; flex-direction: column; }
.studio-types label > span { display: flex; align-items: center; gap: .8rem; padding: .8rem .9rem; margin-bottom: .5rem; border-radius: 18px; border: 2px solid var(--line-2); background: var(--card); }
.studio-types label > span > .ic { width: 26px; height: 26px; color: var(--plum); }
.studio-types b { display: block; } .studio-types small { display: block; color: var(--mut); font-size: 12.5px; line-height: 1.5; }
.studio-types input:checked + span { border-color: var(--plum); background: var(--plum-t); }
.studio-types .is-locked { cursor: not-allowed; } .studio-types .is-locked > span { opacity: .65; }
.studio input:focus-visible + span { outline: 2.5px solid var(--sky); outline-offset: 2px; }
.studio-themes { display: flex; flex-wrap: wrap; gap: .5rem; }
.studio-themes span { display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 .9rem; border-radius: 99px; border: 2px solid var(--line-2); background: var(--card); font-weight: 700; font-size: 13.5px; }
.studio-themes i { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.sw-night { background: linear-gradient(135deg, #1B102C 55%, #E8C26A 56%); } .sw-ivory { background: linear-gradient(135deg, #FBF6EA 55%, #B58B32 56%); } .sw-club { background: conic-gradient(#A3134F 33%, #F59A0B 0 66%, #0A8BD0 0); }
.studio-themes input:checked + span { border-color: var(--ink); }
.studio-act { display: flex; flex-wrap: wrap; gap: .5rem; }
.studio-act .btn { flex: 1 1 140px; justify-content: center; }
.studio-act .btn:disabled { opacity: .5; pointer-events: none; }
.studio-code { font-size: 14px; } .studio-code a { font-weight: 800; color: var(--plum); letter-spacing: .08em; } .studio-code small { color: var(--mut); }
.studio-view { position: sticky; top: calc(var(--hdr) + 16px); min-width: 0; }
.studio-stage { position: relative; display: grid; place-items: center; min-height: 320px; padding: clamp(.6rem, 3vw, 1.8rem); border-radius: var(--r-xl); background: radial-gradient(80% 80% at 50% 0%, #3A2456, #150C22); }
.studio-stage canvas { display: block; max-width: 100%; max-height: 76vh; width: auto; height: auto; border-radius: 8px; box-shadow: 0 30px 70px -20px rgba(0, 0, 0, .75); }
.studio-wait { position: absolute; color: #fff; font-weight: 700; }
.studio-empty { text-align: center; padding: 3rem 1.5rem; border-radius: var(--r-xl); background: var(--card); border: 2px dashed var(--line); display: flex; flex-direction: column; align-items: center; gap: .7rem; }

/* ---------- Verification ---------- */
.verify { padding: clamp(2rem, 6vw, 4rem) 0; }
.verify-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .6rem; padding: clamp(1.4rem, 5vw, 2.6rem); border-radius: var(--r-xl); background: var(--card); border: 1px solid var(--line-2); box-shadow: var(--sh-2); }
.verify-ic { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: var(--mist); }
.verify-ic .ic { width: 38px; height: 38px; }
.verify-card.ok { border-top: 6px solid var(--ok); } .verify-card.ok .verify-ic { background: var(--ok-t); color: var(--ok); }
.verify-card ul { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; margin: .6rem 0; }
.verify-card li { min-width: 100px; padding: .7rem 1rem; border-radius: 16px; background: var(--mist); }
.verify-card li b { display: block; font-size: 1.8rem; font-weight: 800; } .verify-card li span { font-size: 12.5px; color: var(--mut); }
.verify-medals { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; }
.verify-medals figure { margin: 0; width: 86px; font-size: 12px; font-weight: 700; }
.verify-card code { font-size: 1.1rem; letter-spacing: .15em; padding: .3rem .9rem; border-radius: 10px; background: var(--mist); }
.verify-card form { display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center; width: 100%; }
.verify-card input { min-height: 48px; width: min(280px, 100%); text-align: center; letter-spacing: .15em; text-transform: uppercase; border: 1px solid var(--line); border-radius: 14px; }

@media (max-width: 900px) {
	.pf-in, .studio-in { grid-template-columns: minmax(0, 1fr); }
	.studio-view { position: static; order: -1; }
	.studio-stage canvas { max-height: 62vh; }
}
@media (max-width: 620px) {
	.pf-stats { grid-template-columns: 1fr 1fr; }
	.cab-fam { padding: .95rem .7rem; border-radius: 24px; }
	.cab-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
	.medal { padding: .6rem .25rem; } .medal-art { width: 76px; } .medal b { font-size: 12px; }
	.pf-act .btn { flex: 1 1 140px; justify-content: center; }
	.hsheet { margin-bottom: 0; width: 100%; max-width: 100%; border-radius: 30px 30px 0 0; }
	.pulse { padding: .7rem .5rem; } .pulse small { font-size: 9px; } .pulse b { font-size: 10px; }
}
@media (max-width: 360px) { .cab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) {
	.vb-rays, .vb-glint path, .pf-aurora, .pf-top span, .hsheet[open], .hs-art, .party-art, .party-i > *, .party h2 { animation: none !important; }
	.pf-pass { transform: none; }
}
