/* ==========================================================================
   SunTeam v2 — Sun Clubs (rank + income honor clubs, badges)
   ========================================================================== */
.cl { overflow-x: clip; }
.club-badge { display: block; filter: drop-shadow(0 10px 16px rgba(17,19,24,.22)); transition: transform .4s var(--ease); }
.club-badge.is-locked { filter: grayscale(1) opacity(.45); }

.cl-hero { position: relative; padding: 18px 0 26px; overflow: hidden; isolation: isolate; }
.cl-hero-bg { position: absolute; inset: 0; z-index: -1; background: radial-gradient(800px 420px at 80% 20%, rgba(77,208,225,.22), transparent 70%), radial-gradient(700px 380px at 10% 80%, rgba(255,212,0,.18), transparent 70%); }
.cl-head { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; align-items: center; margin-top: 14px; }
.cl-head > div:first-child { display: flex; flex-direction: column; gap: 12px; }
.cl-head .lead { margin: 0; }
.cl-badges-float { position: relative; height: 230px; }
.cl-badges-float span { position: absolute; animation: cl-float 6s ease-in-out infinite; animation-delay: calc(var(--d) * -1.4s); }
.cl-badges-float span:nth-child(1) { top: 30px; right: 0; }
.cl-badges-float span:nth-child(2) { top: 0; right: 32%; }
.cl-badges-float span:nth-child(3) { top: 110px; right: 20%; }
.cl-badges-float span:nth-child(4) { top: 60px; left: 4%; }
.cl-badges-float span:nth-child(4) .club-badge { width: 120px; height: 120px; }
@keyframes cl-float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-12px) rotate(4deg); } }
.cl-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.cl-stats div { padding: 12px 18px; border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--sh-1); }
.cl-stats b { display: block; font-size: var(--fs-xl); font-weight: 900; }
.cl-stats span { font-size: var(--fs-xs); color: var(--text-3); }

/* hero vector scene: trophy on a podium + orbiting club badges */
.cl-art { position: relative; width: 100%; max-width: 520px; justify-self: center; aspect-ratio: 520 / 440; container-type: inline-size; }
.cl-scene { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cl-rings { transform-origin: 260px 190px; animation: spin-slow 60s linear infinite; }
.cl-beams path { transform-origin: 50% 0; animation: cl-beam 7s ease-in-out infinite; }
.cl-beams path:nth-child(1) { animation-delay: -2s; } .cl-beams path:nth-child(3) { animation-delay: -4.5s; }
.cl-trophy { animation: cl-hover 5s ease-in-out infinite; }
.cl-laurel { transform-origin: 260px 158px; animation: cl-breathe 5s ease-in-out infinite; }
.cl-person .arm { transform-box: view-box; animation: cl-cheer 2.6s ease-in-out infinite; }
.cl-person.p2 .arm { animation-delay: -.8s; } .cl-person.p3 .arm { animation-delay: -1.6s; }
.cl-confetti rect { animation: cl-fall 4.5s ease-in infinite; animation-delay: calc(var(--i) * -.45s); }
.cl-confetti path { transform-box: fill-box; transform-origin: center; animation: ab-twinkle 2.4s ease-in-out infinite; }
.cl-orbit { position: absolute; left: 50%; top: 32%; width: 0; height: 0; animation: spin-slow 40s linear infinite; }
.cl-ob { position: absolute; left: -34px; top: -34px; transform: rotate(var(--a)) translateY(-31cqw) rotate(calc(-1 * var(--a))); }
.cl-ob { width: 68px; height: 68px; }
.cl-ob .club-badge { width: 68px; height: 68px; max-width: none; }
.cl-ob .club-badge { animation: cl-counter 40s linear infinite; }
@keyframes cl-counter { to { transform: rotate(-360deg); } }
@keyframes cl-beam { 0%, 100% { opacity: .35; transform: skewX(-4deg); } 50% { opacity: .85; transform: skewX(4deg); } }
@keyframes cl-hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes cl-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes cl-cheer { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-8deg); } }
@keyframes cl-fall { 0% { transform: translateY(-20px) rotate(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(170px) rotate(220deg); opacity: 0; } }
@keyframes ab-twinkle { 0%, 100% { transform: scale(.6); opacity: .4; } 50% { transform: scale(1.1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cl-rings, .cl-beams path, .cl-trophy, .cl-laurel, .cl-person .arm, .cl-confetti rect, .cl-confetti path, .cl-orbit, .cl-ob .club-badge { animation: none; } }
@media (max-width: 760px) { .cl-art { max-width: 380px; } .cl-ob, .cl-ob .club-badge { width: 46px; height: 46px; } .cl-ob { left: -23px; top: -23px; } }
/* my badges */
.cl-mine { display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: center; padding: 22px; border-radius: 28px; background: #111318; color: #fff; }
.cm-head { display: flex; flex-direction: column; gap: 8px; }
.cm-head .eyebrow { background: rgba(255,212,0,.14); color: #FFE45C; }
.cm-head p { margin: 0; color: rgba(255,255,255,.7); font-size: var(--fs-sm); }
.cm-head b { color: var(--sun-400); }
.cm-prog { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: rgba(255,255,255,.7); }
.cm-prog i { flex: 1; height: 8px; border-radius: 99px; background: rgba(255,255,255,.12); position: relative; overflow: hidden; }
.cm-prog i::after { content: ""; position: absolute; inset: 0 0 0 auto; width: var(--w); background: linear-gradient(90deg, #FFE45C, #F2C200); border-radius: inherit; }
.cm-list { display: flex; flex-wrap: wrap; gap: 12px; }
.cm-b { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 78px; text-align: center; }
.cm-b small { font-size: 10.5px; color: rgba(255,255,255,.75); line-height: 1.5; }
.cm-b:hover .club-badge { transform: translateY(-4px) scale(1.06); }

/* tabs */
.cl-tabs { display: flex; gap: 6px; width: fit-content; max-width: 100%; margin: 16px auto 0; padding: 6px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), var(--sh-2); overflow-x: auto; }
.cl-tabs button { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding-inline: 16px; border: 0; border-radius: 999px; background: none; font: inherit; font-weight: 800; font-size: var(--fs-sm); color: var(--text-3); cursor: pointer; white-space: nowrap; }
.cl-tabs button .num { padding: 1px 8px; border-radius: 999px; background: var(--surface-sunk); font-size: var(--fs-xs); }
.cl-tabs button.is-active { background: #111318; color: #fff; }
.cl-tabs button.is-active .num { background: var(--sun-400); color: #111318; }
[data-cl-panel][hidden] { display: none; }
.cl-note { display: flex; align-items: center; gap: 6px; margin: 0 0 14px; font-size: var(--fs-sm); color: var(--text-2); }

/* rank ladder */
.cl-ladder { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.cl-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px 16px; border: 0; border-radius: 24px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font: inherit; text-align: center; cursor: pointer; overflow: hidden; isolation: isolate; transition: transform .35s var(--ease), box-shadow .35s; }
.cl-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 70px; z-index: -1; background: linear-gradient(180deg, color-mix(in srgb, var(--c1) 45%, transparent), transparent); }
.cl-card:hover { transform: translateY(-5px); box-shadow: inset 0 0 0 1.5px var(--c2), 0 22px 40px -26px rgba(17,19,24,.5); }
.cl-card:hover .club-badge { transform: rotate(-6deg) scale(1.06); }
.cl-card.is-empty { background: var(--surface-sunk); }
.cc-lvl { font-size: var(--fs-xs); font-weight: 800; color: var(--text-3); }
.cl-card b { font-weight: 900; font-size: var(--fs-sm); line-height: 1.6; }
.cc-av { display: flex; justify-content: center; direction: ltr; min-height: 30px; }
.cc-av i { position: relative; width: 30px; height: 30px; margin-left: -8px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--amber-soft); color: var(--accent-ink); font-style: normal; font-weight: 900; font-size: 12px; box-shadow: 0 0 0 2px var(--surface); }
.cc-av i:first-child { margin-left: 0; }
.cc-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cc-count { font-size: var(--fs-xs); font-weight: 800; color: var(--c2); }
.cl-card.is-empty .cc-count { color: var(--text-3); }

/* income clubs */
.cl-income { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.ci-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 14px 18px; border: 0; border-radius: 26px; font: inherit; text-align: center; cursor: pointer; color: #fff; background: linear-gradient(160deg, var(--c2), color-mix(in srgb, var(--c2) 60%, #111318)); box-shadow: 0 26px 50px -30px var(--c2); overflow: hidden; transition: transform .35s var(--ease); }
.ci-card::after { content: ""; position: absolute; width: 180px; height: 180px; top: -90px; right: -60px; border-radius: 50%; background: rgba(255,255,255,.14); }
.ci-card:hover { transform: translateY(-6px) rotate(-.5deg); }
.ci-card b { font-size: var(--fs-md); font-weight: 900; }
.ci-card small { font-size: var(--fs-xs); color: rgba(255,255,255,.75); }
.ci-count { padding: 3px 12px; border-radius: 999px; background: rgba(255,255,255,.18); font-size: var(--fs-xs); font-weight: 800; }
.ci-card .cc-av i { box-shadow: 0 0 0 2px var(--c2); }

/* members dialog */
.cl-dlg { width: min(560px, 94vw); max-height: 86vh; padding: 22px; border: 0; border-radius: 26px; background: var(--surface); color: var(--text); box-shadow: 0 40px 100px -30px rgba(0,0,0,.5); }
.cl-dlg::backdrop { background: rgba(10,11,14,.6); backdrop-filter: blur(4px); }
.cl-dlg header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; padding-inline-end: 44px; }
.cl-dlg header b { font-size: var(--fs-lg); font-weight: 900; }
.cl-dlg header span { color: var(--text-3); font-size: var(--fs-sm); }
.cl-dlg .video-x { background: var(--surface-sunk); color: var(--text); }
.cl-members { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 60vh; overflow: auto; }
.cl-members li { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); animation: ld-fade-in .4s var(--ease) both; animation-delay: var(--d); }
.cl-members li b { display: block; font-size: var(--fs-sm); }
.cl-members li small { font-size: var(--fs-xs); color: var(--text-3); }
.cm-av { position: relative; width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--amber-soft); color: var(--accent-ink); font-weight: 900; }
.cm-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cl-empty { grid-column: 1 / -1; justify-content: center; color: var(--text-3); }
.cl-dlg [data-cl-more] { display: block; margin-top: 10px; text-align: center; }
@keyframes ld-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) { .cl-badges-float span { animation: none; } }
@media (max-width: 1100px) { .cl-ladder { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cl-income { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .cl-head, .cl-mine { grid-template-columns: 1fr; }
  .cl-badges-float { height: 170px; }
  .cl-ladder, .cl-income { grid-template-columns: 1fr 1fr; }
  .cl-members { grid-template-columns: 1fr; }
}
