/* Badges (badges.js, migrations v89 + v94). Theme tokens only; the badge art itself (gold / silver / bronze
   metal) is drawn the same in every theme, like a photo. */
.bg-art { display: block; flex-shrink: 0; }
.bg-art-img { display: block; flex-shrink: 0; object-fit: contain; }
.bg-art-img.locked, .bg-born.locked, .bg-protein.locked { filter: grayscale(1); opacity: .35; }
/* Protein Pro's Steak | Plant switch, under the art */
.seg.bg-variant { width: 220px; margin: 6px 0 0; }
.bg-variant-hint { font-size: 12px; color: var(--text2); }
/* A picture earned again (v103): the ×N tab over it */
.bg-art-pic { position: relative; }
.bg-art-pic > .bg-art-img { width: 100%; height: 100%; }
.bg-art-pic > .bg-tab { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Today: the chip by the title, the Almost line */
.hm-head h1 { display: flex; align-items: center; gap: 10px; }
.bg-chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px 0 7px; border-radius: 99px; border: var(--card-bw, 1px) solid var(--card-border, var(--border));
  background: var(--bg2); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; letter-spacing: 0; text-transform: none; -webkit-text-fill-color: currentColor; }
.bg-chip b { font-weight: 800; font-variant-numeric: tabular-nums; }
.bg-go { color: var(--text3); font-size: 20px; line-height: 1; flex-shrink: 0; }
.bg-bar { display: block; height: 5px; border-radius: 3px; background: var(--bg3); overflow: hidden; }
.bg-bar > i { display: block; height: 100%; border-radius: 3px; background: var(--accent); }

/* The Badges page */
.bg-sum { width: fit-content; max-width: 100%; background: var(--ghost-bg); border-radius: 8px; box-shadow: 0 0 0 4px var(--ghost-bg), 0 0 0 calc(4px + var(--card-bw, 1px)) var(--ghost-line); display: flex; align-items: baseline; gap: 8px; margin: max(-4px, var(--ghost-gap)) 0 calc(14px + var(--ghost-gap)) var(--ghost-gap); color: var(--text2); font-size: 14px; }
.bg-sum b { font-size: 30px; font-weight: 900; color: var(--text); font-variant-numeric: tabular-nums; }
.bg-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 6px; padding: 12px 0 4px; }
.bg-tile { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; padding: 0; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; text-align: center; }
.bg-tile span { font-size: 11.5px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.bg-tile.off span { font-weight: 500; color: var(--text3); }
.bg-tile.secret { cursor: default; }
.bg-close { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; text-align: left; }
.bg-close + .bg-close { border-top: 1px solid var(--border); }
.bg-close-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bg-close-tx > span { display: flex; justify-content: space-between; gap: 8px; }
.bg-close-tx b { font-size: 14px; font-weight: 700; }
.bg-close-tx small { font-size: 12px; color: var(--text2); white-space: nowrap; }
.bg-loading { height: 160px; border-radius: 12px; background: var(--bg3); opacity: .5; }

/* One badge */
.bg-one { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding-top: 22px; }
.bg-one h2 { margin: 6px 0 0; font-size: 24px; font-weight: 900; }
.bg-one .subtitle { margin: 0; max-width: 320px; line-height: 1.4; }
.bg-what { margin: 0; font-size: 13px; color: var(--text2); }
/* Equal columns while they fit; a long value ("Uncommon") widens its own column, and on a narrower phone it moves to a second row, never past the card. */
.bg-stats { display: flex; flex-wrap: wrap; gap: 12px 8px; width: 100%; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.bg-stats div { flex: 1 1 52px; display: flex; flex-direction: column; gap: 2px; }
.bg-stats b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bg-stats span { font-size: 11.5px; color: var(--text2); }
.bg-stats b .bg-rare { font-size: inherit; color: var(--pr-text); }
.bg-prog { width: 100%; max-width: 300px; display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.bg-prog small, .bg-who-n { font-size: 12.5px; color: var(--text2); }
.bg-big3 { width: 100%; max-width: 300px; display: flex; flex-direction: column; margin: 4px 0 6px; }
.bg-big3:empty { display: none; }
.bg-big3 > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; text-align: left; }
.bg-big3 > div:last-child { border-bottom: 1px solid var(--border); }
.bg-big3 span small { margin-left: 6px; font-size: 12px; color: var(--text2); }
.bg-big3 b { font-weight: 800; }
.bg-big3 em { font-style: normal; font-size: 13px; color: var(--text2); }
/* Meet Day (v107): the best 60 minutes, How it counts, the club page's link to it, the Minted line */
.bg-meet { margin-top: 12px; }
.bg-meet-hd { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--text2); }
.bg-meet-hd em { font-style: normal; font-weight: 600; letter-spacing: 0; text-transform: none; }
.bg-big3 > .bg-meet-tot { justify-content: center; font-size: 15px; }
.bg-meet-none { margin: 0; font-size: 13px; color: var(--text2); }
.bg-how p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--text2); }
.bg-how p + p { margin-top: 8px; }
/* Badges › MODE Challenges: the way to every challenge, finished ones too */
.bg-mc-go { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 4px; padding: 12px 2px 4px; border: 0; border-top: 1px solid var(--border); background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.card-hd + .bg-mc-go { margin-top: 0; border-top: 0; }
.bg-mc-go > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bg-mc-go b { font-size: 14.5px; font-weight: 700; }
.bg-mc-go small { font-size: 12.5px; color: var(--text2); }
.bg-mc-go i { font-style: normal; font-size: 20px; color: var(--text3); }
.bg-meet-go { display: flex; align-items: center; gap: 12px; width: 100%; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.bg-meet-go > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bg-meet-go b { font-size: 14.5px; font-weight: 700; }
.bg-meet-go small { font-size: 12.5px; color: var(--text2); }
.bg-acts { padding-top: 4px; padding-bottom: 4px; }
.bg-act { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 0; border: 0; background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.bg-act + .bg-act { border-top: 1px solid var(--border); }
.bg-act > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bg-act b { font-size: 14.5px; font-weight: 700; }
.bg-act small { font-size: 12px; color: var(--text2); }
.bg-act-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--accent-soft); color: var(--accent); }
.bg-act-ic svg { width: 19px; height: 19px; }
.bg-act.busy { opacity: .6; pointer-events: none; }
.bg-sw { width: 22px; height: 22px; accent-color: var(--accent); flex-shrink: 0; }
.bg-mates { display: flex; align-items: center; gap: 12px; font-size: 13.5px; color: var(--text2); line-height: 1.35; }
.bg-avs { display: flex; flex-shrink: 0; }
.bg-avs i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--bg3); color: var(--text); font-size: 11px; font-weight: 800; font-style: normal; border: 2px solid var(--bg2); }
.bg-avs i + i { margin-left: -9px; }
.bg-avs img { width: 100%; height: 100%; object-fit: cover; }

/* Unlock (one badge, or several) */
.bg-unlock { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 8px 4px 2px; }
.bg-kick { font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--pr-text, var(--accent)); }
.bg-unlock h2 { margin: 2px 0 0; font-size: 28px; font-weight: 900; }
.bg-unlock p { margin: 0; font-size: 14.5px; color: var(--text2); line-height: 1.4; max-width: 300px; }
.bg-unlock small { font-size: 12.5px; color: var(--text3); }
.bg-unlock-btns { width: 100%; display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.bg-unlock-btns > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* The art's extras (BADGES_PLAN.md phase 1): a shadow on big art, the sheen that passes and waits */
.bg-art.fx, .bg-art-fx { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
.bg-art-fx { display: block; flex-shrink: 0; width: fit-content; padding: 28px; margin: -28px; }
.bg-sheen { animation: bg-sheen 4.2s cubic-bezier(.45, 0, .25, 1) infinite; }
@keyframes bg-sheen { 0% { transform: translateX(-110px); } 50%, 100% { transform: translateX(160px); } }

/* The Minted screen: one entrance per kind of badge (forge / reveal / halves / levelup), once, ~1.6 s,
   then the words fade in. The art stays in the metal's colors in every theme; the stage uses tokens. */
.bg-mint .bm-stage { position: relative; width: 100%; height: 220px; margin: 2px 0 4px; overflow-x: clip; }
.bm-slot { position: absolute; left: 50%; top: 50%; width: 176px; height: 176px; margin: -88px 0 0 -88px; }
.bm-slot > .bg-art { display: block; }
.bm-after { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; animation: bm-after .5s ease-out 1.5s both; }
@keyframes bm-after { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.bm-meet { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.bm-meet > b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bm-meet > span { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.bm-meet i { font-style: normal; font-size: 13.5px; padding: 5px 11px; border-radius: 99px; background: var(--bg3); }
.bm-serial { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 2px; padding: 12px 14px; border-radius: 14px; background: var(--bg3); text-align: left; }
.bm-serial > b { flex-shrink: 0; padding: 8px 10px; border-radius: 9px; background: linear-gradient(135deg, #f6d77a, #b8861c); color: #2a1d05; font: 800 19px/1 'Barlow Condensed', system-ui, sans-serif; letter-spacing: .5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bm-serial > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bm-serial strong { font-size: 14.5px; font-weight: 700; color: var(--text); }
.bm-serial small { font-size: 12.5px; color: var(--text2); }

/* Forge: glows hot, a hammer flash, cools to its metal while embers rise */
.bm-forge { animation: bm-forge 1.6s ease-in-out both; box-sizing: content-box; padding: 40px; margin: -128px 0 0 -128px; } /* room for the glow and shadow */
@keyframes bm-forge {
  0% { filter: brightness(0); opacity: 0; transform: scale(.94); }
  12% { opacity: 1; }
  38% { filter: brightness(1.7) sepia(1) saturate(7) hue-rotate(-28deg) drop-shadow(0 0 22px #ff6b35); transform: scale(1); }
  46% { transform: scale(1.04); }
  54% { transform: scale(1); filter: brightness(1.6) sepia(1) saturate(6) hue-rotate(-28deg) drop-shadow(0 0 18px #ff6b35); }
  100% { filter: none; opacity: 1; transform: scale(1); } }
.bm-heat { position: absolute; left: 50%; top: 50%; width: 250px; height: 250px; margin: -125px 0 0 -125px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 107, 53, .5), rgba(255, 107, 53, 0) 65%); opacity: 0; animation: bm-heat 1.8s ease-in-out both; }
@keyframes bm-heat { 0% { opacity: 0; } 40%, 55% { opacity: 1; } 100% { opacity: 0; } }
.bm-ember { position: absolute; bottom: 30px; width: 4px; height: 4px; border-radius: 50%; background: #ffb070; opacity: 0; animation: bm-ember 1.8s ease-out both; }
@keyframes bm-ember { 0%, 25% { transform: translateY(0); opacity: 0; } 32% { opacity: 1; } 100% { transform: translate(var(--dx), -190px); opacity: 0; } }
.bm-clang { position: absolute; left: 50%; top: 14px; width: 90px; height: 4px; margin-left: -45px; border-radius: 2px; background: #fff; opacity: 0; animation: bm-clang 1.6s ease-out both; }
@keyframes bm-clang { 0%, 40% { opacity: 0; transform: scaleX(.2); } 44% { opacity: .9; transform: scaleX(1); } 60%, 100% { opacity: 0; transform: scaleX(1.6); } }

/* Secret revealed: the riddle fades, light breaks out of the "?", the badge opens from the center */
.bm-riddle { position: absolute; left: 0; right: 0; top: -2px; margin: 0; font-size: 14px; font-style: italic; color: var(--text2); animation: bm-riddle 1.7s ease-in-out both; }
@keyframes bm-riddle { 0%, 45% { opacity: 1; } 65%, 100% { opacity: 0; } }
.bm-blank { animation: bm-blank 1.7s ease-in-out both; }
@keyframes bm-blank { 0%, 45% { opacity: 1; transform: scale(1); } 52% { transform: scale(.96); } 70%, 100% { opacity: 0; transform: scale(.96); } }
.bm-open { clip-path: circle(75% at 50% 50%); animation: bm-open 1.7s cubic-bezier(.6, 0, .2, 1) both; }
@keyframes bm-open { 0%, 48% { clip-path: circle(0% at 50% 50%); } 78%, 100% { clip-path: circle(75% at 50% 50%); } }
.bm-ring { position: absolute; left: 50%; top: 50%; width: 176px; height: 176px; margin: -88px 0 0 -88px; border-radius: 50%; border: 3px solid transparent;
  background: linear-gradient(#0000, #0000) padding-box, linear-gradient(90deg, #ff9ad5, #ffd36e, #9cf6c4, #7fd3ff, #b49bff) border-box; opacity: 0; animation: bm-ring 1.7s ease-out both; }
@keyframes bm-ring { 0%, 50% { transform: scale(.4); opacity: 0; } 56% { opacity: 1; } 100% { transform: scale(2); opacity: 0; } }

/* Two halves: yours and theirs slide in and lock, a rainbow flash, then a tilt that catches the light */
.bm-tilt { animation: bm-tilt 2.6s ease-in-out both; }
@keyframes bm-tilt { 0%, 55% { transform: perspective(700px); } 72% { transform: perspective(700px) rotateY(-16deg) rotateX(6deg); } 88% { transform: perspective(700px) rotateY(12deg) rotateX(-4deg); } 100% { transform: perspective(700px); } }
.bm-half { position: absolute; inset: 0; }
.bm-half.l { clip-path: inset(-40px 50% -40px -40px); animation: bm-half-l 1.4s cubic-bezier(.5, 0, .2, 1) both; }
.bm-half.r { clip-path: inset(-40px -40px -40px 50%); animation: bm-half-r 1.4s cubic-bezier(.5, 0, .2, 1) both; }
@keyframes bm-half-l { 0% { transform: translateX(-150px) rotate(-12deg); opacity: 0; } 25% { opacity: 1; } 75%, 100% { transform: none; opacity: 1; } }
@keyframes bm-half-r { 0% { transform: translateX(150px) rotate(12deg); opacity: 0; } 25% { opacity: 1; } 75%, 100% { transform: none; opacity: 1; } }
.bm-seam { position: absolute; left: 50%; top: 50%; width: 6px; height: 190px; margin: -95px 0 0 -3px; border-radius: 3px; background: linear-gradient(#ff9ad5, #ffd36e, #9cf6c4, #7fd3ff, #b49bff); filter: blur(2px); opacity: 0; animation: bm-seam 1.6s ease-out both; }
@keyframes bm-seam { 0%, 70% { opacity: 0; transform: scaleY(.3); } 76% { opacity: 1; transform: scaleY(1.1); } 100% { opacity: 0; transform: scaleY(1.3); } }

/* Level up: the old stage shakes and bursts, the next one pops out */
.bm-old { animation: bm-old 1.4s ease-in both; }
@keyframes bm-old { 0%, 40% { transform: none; } 48% { transform: rotate(-3deg); } 56% { transform: rotate(3deg); } 64% { transform: scale(1.06); filter: brightness(2.5); opacity: 1; } 80%, 100% { transform: scale(1.5); filter: brightness(4); opacity: 0; } }
.bm-new { animation: bm-new 1.8s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes bm-new { 0%, 50% { opacity: 0; transform: scale(.3) rotate(-30deg); } 80% { opacity: 1; transform: scale(1.08) rotate(0); } 100% { opacity: 1; transform: scale(1); } }
.bm-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 55%); opacity: 0; animation: bm-flash 1.6s ease-out both; }
@keyframes bm-flash { 0%, 55% { opacity: 0; } 62% { opacity: 1; } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .bg-sheen, .bm-after, .bm-forge, .bm-heat, .bm-ember, .bm-clang, .bm-riddle, .bm-blank, .bm-open, .bm-ring, .bm-tilt, .bm-half, .bm-seam, .bm-old, .bm-new, .bm-flash { animation: none; }
  .bm-heat, .bm-ember, .bm-clang, .bm-riddle, .bm-blank, .bm-ring, .bm-seam, .bm-old, .bm-flash { opacity: 0; }
}
.bg-many-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 6px; width: 100%; margin-top: 6px; }
.bg-many-grid button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; }
.bg-many-grid span { font-size: 11px; font-weight: 700; line-height: 1.2; }

/* Squad profile pins */
.bg-pins { display: flex; justify-content: center; gap: 8px; margin-top: 2px; }
.bg-pins button { padding: 0; border: 0; background: none; cursor: pointer; }

/* Profile picture maker */
.bg-pfp-prev { display: grid; place-items: center; margin: 4px 0 14px; }
.bg-pfp-prev canvas { width: 210px; height: 210px; border-radius: 50%; }
.bg-pfp-seg { margin-bottom: 10px; }
.bg-pfp-photo { display: flex; align-items: center; gap: 8px; min-height: 44px; margin-bottom: 14px; font-size: 14px; cursor: pointer; }
.bg-pfp-photo > span:first-child { color: var(--text2); }
.bg-pfp-src { flex: 1; text-align: right; color: var(--text); }
.bg-pfp-photo b { color: var(--accent); font-weight: 700; }
.bg-pfp-note { display: block; margin-top: 10px; text-align: center; font-size: 12px; color: var(--text3); }

/* Share card (drawn by share.js at 1080 px) */
.bg-shc { align-items: center; text-align: center; }
.bg-shc .bg-art { margin: 10px auto 0; }
.bg-shc-k { margin-top: 30px; font-size: 40px; font-weight: 900; letter-spacing: .3em; color: var(--accent); }
.bg-shc-n { margin: 10px 0 0; line-height: .95; overflow-wrap: anywhere; }
.bg-shc-l { margin-top: 24px; font-size: 46px; line-height: 1.25; color: var(--text2); max-width: 880px; }
.bg-shc .shc-chips { justify-content: center; }
.bg-shc.more .bg-shc-k { margin-top: 20px; }
.bg-shc-pct { display: flex; flex-direction: column; align-items: center; margin-top: 20px; }
.bg-shc-pct b { font: 900 120px/.9 'Barlow Condensed', sans-serif; color: var(--accent); }
.shc.sq .bg-shc-pct b { font-size: 76px; }
.bg-shc-pct span { margin-top: 6px; font: 800 34px 'Barlow Condensed', sans-serif; letter-spacing: 3px; text-transform: uppercase; color: var(--text2); }
.bg-shc-time { width: 100%; margin-top: 22px; }
.bg-shc-clock { display: flex; align-items: baseline; justify-content: center; gap: 16px; color: var(--red); }
.bg-shc-clock b { font: 900 140px/.85 'Barlow Condensed', sans-serif; }
.bg-shc-clock span { font: 800 40px 'Barlow Condensed', sans-serif; letter-spacing: 3px; text-transform: uppercase; }
.shc.sq .bg-shc-clock b { font-size: 80px; }
.shc.sq .bg-shc-clock span { font-size: 28px; }
.bg-shc-tl { position: relative; height: 104px; margin: 16px 30px 0; }
.shc.sq .bg-shc-tl { height: 84px; margin-top: 8px; }
.bg-shc-rail, .bg-shc-fill { position: absolute; left: 0; top: 30px; height: 14px; border-radius: 7px; }
.bg-shc-rail { right: 0; background: var(--bg4); }
.bg-shc-fill { background: var(--red); }
.bg-shc-tick { position: absolute; top: 10px; width: 54px; height: 54px; margin-left: -27px; border-radius: 50%; background: var(--bg2); border: 6px solid var(--red);
  font: 900 26px/42px 'Barlow Condensed', sans-serif; text-align: center; color: var(--red); }
.bg-shc-tl small { position: absolute; top: 74px; font: 800 26px 'Barlow Condensed', sans-serif; letter-spacing: 2px; text-transform: uppercase; color: var(--text2); }
.shc.sq .bg-shc-tl small { top: 64px; font-size: 20px; }
.bg-shc-lifts { width: 100%; margin-top: 24px; padding: 10px 40px; background: var(--bg2); border: var(--shc-bw) solid var(--card-border); box-shadow: var(--card-shadow); border-radius: 28px; text-align: left; }
.bg-shc-lifts.sq { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; padding: 18px 26px; }
.bg-shc-lr { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 2px solid var(--border);
  font: 800 38px 'Barlow Condensed', sans-serif; letter-spacing: 3px; text-transform: uppercase; color: var(--text2); }
.bg-shc-lr em { margin-left: 18px; font-style: normal; font-weight: 700; letter-spacing: 1px; color: var(--red); }
.bg-shc-lr b { font: 900 66px/1 'Barlow Condensed', sans-serif; letter-spacing: 0; color: var(--text); white-space: nowrap; }
.bg-shc-lr.tot { border: 0; color: var(--accent); }
.bg-shc-lr.tot b { color: var(--accent); font-size: 74px; }
.bg-shc-lifts.sq .bg-shc-lr { flex-direction: column; align-items: center; gap: 6px; padding: 0; border: 0; font-size: 24px; }
.bg-shc-lifts.sq .bg-shc-lr em { display: none; }
.bg-shc-lifts.sq .bg-shc-lr b { font-size: 50px; }
.bg-shc-lifts.sq .bg-shc-lr.tot b { font-size: 54px; }
.shs-badge { display: grid; place-items: center; }

/* Living badges (v95): a family's tile, its page (current stage, the next one, the stages) */
.bg-tile-st { font-size: 10.5px; color: var(--text2); margin-top: -3px; }
.bg-tile.off .bg-tile-st { color: var(--text3); }
.bg-fam-hd { display: flex; align-items: center; gap: 16px; }
.bg-fam-t { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bg-fam-t .bg-kick { font-size: 11px; }
.bg-fam-t h2 { margin: 0; font-size: 26px; font-weight: 900; line-height: 1.05; }
.bg-fam-v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bg-fam-t small { font-size: 12.5px; color: var(--text2); line-height: 1.35; }
.bg-fam-next { display: flex; flex-direction: column; gap: 9px; }
.bg-fam-next > small { font-size: 13px; color: var(--text2); line-height: 1.4; }
.bg-fam-next .bg-bar { height: 9px; border-radius: 5px; }
.bg-fam-next .bg-bar > i { background: linear-gradient(90deg, #ff9ad5, #ffd36e, #9cf6c4, #7fd3ff); }
.bg-fam-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bg-fam-row b { font-size: 15px; font-weight: 700; }
.bg-fam-row small { font-size: 13px; color: var(--text2); white-space: nowrap; }
.bg-fam-st { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 8px 0; border: 0; border-top: 1px solid var(--border); background: none; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.card-hd + .bg-fam-st { border-top: 0; }
.bg-fam-st:disabled { cursor: default; color: var(--text); opacity: 1; }
.bg-fam-st.here .bg-fam-m b { color: var(--accent); }
.bg-fam-m { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bg-fam-m b { font-size: 14.5px; font-weight: 700; }
.bg-fam-m small, .bg-fam-r small { font-size: 12px; color: var(--text2); }
.bg-fam-r { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; flex-shrink: 0; }
.bg-fam-r b { font-size: 13.5px; font-weight: 700; }
.bg-fam-r b.ok { color: var(--green); }

/* Secrets (v96): riddles until found */
.bg-tile.secret.go { cursor: pointer; }
.bg-rd-sum { width: fit-content; max-width: 100%; background: var(--ghost-bg); border-radius: 8px; box-shadow: 0 0 0 4px var(--ghost-bg), 0 0 0 calc(4px + var(--card-bw, 1px)) var(--ghost-line); margin: -4px 0 14px; font-size: 14px; color: var(--text2); }
.bg-rd { display: flex; align-items: flex-start; gap: 14px; padding: 12px 0; border-top: 1px solid var(--border); }
.card-hd + .bg-rd { border-top: 0; }
.bg-rd-m { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.bg-rd-m q { font-size: 15.5px; font-style: italic; font-weight: 500; line-height: 1.35; color: var(--text); quotes: '“' '”'; }
.bg-rd-m small { font-size: 12px; color: var(--text2); }
.bg-rd-m small b { color: var(--accent); font-weight: 600; }
.bg-rd-hint { margin: 2px 0 0; font-size: 13px; color: var(--text); padding: 7px 10px; border-radius: 9px; background: var(--accent-faint, var(--bg3)); }
.bg-rd-btn { align-self: flex-start; min-height: 32px; margin-top: 2px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.bg-rd-btn:disabled { opacity: .5; }

/* ═══ Your photo flips to a badge (v108) ═══ */
/* The coin sits inside any round avatar box (header button, .acc-av, .cr-av): front = photo, back = badge. */
.bgf { position: relative; display: block; width: 100%; height: 100%; }
.bgf-c { position: absolute; inset: 0; transform-style: preserve-3d; animation: bgf-flip 9s cubic-bezier(.6, 0, .3, 1) infinite; }
.bgf-f { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.bgf-f img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bgf-b { transform: rotateY(180deg); background: radial-gradient(circle at 50% 35%, var(--bg4), var(--bg)); }
.bgf-b > svg, .bgf-b > img, .bgf-b > .bg-art-pic { width: 94% !important; height: 94% !important; border-radius: 0; object-fit: contain; }
@keyframes bgf-flip {
  0%, 56% { transform: perspective(300px) rotateY(0); }
  62%, 92% { transform: perspective(300px) rotateY(180deg); }
  100% { transform: perspective(300px) rotateY(360deg); }
}
@media (prefers-reduced-motion: reduce) { .bgf-c { animation: none; } }
/* The badge page's switch row: your photo flipping to this badge, as its icon */
.bg-act-ic.bg-act-coin { border-radius: 50%; overflow: hidden; background: var(--bg3); box-shadow: 0 0 0 2px var(--border); font-size: 13px; font-weight: 800; color: var(--text2); }
.bg-act-ic.bg-act-coin.on { box-shadow: 0 0 0 2px var(--accent); }
.bg-act-ic.bg-act-coin svg { width: 100%; height: 100%; }
.bg-act-ic.bg-act-coin .bgf-b > svg { width: 88% !important; height: 88% !important; }
/* The grid's mark on the badge that's on your photo */
.bg-tile { position: relative; }
.bg-onphoto { position: absolute; top: -3px; right: calc(50% - 34px); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 2px var(--bg2); }
.bg-onphoto svg { width: 13px; height: 13px; }
/* Settings › You: "Flips to 100 Workouts ›" */
.set-flip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 12px; margin-top: 2px; border: 1px solid var(--border); border-radius: 22px;
  background: var(--bg3); color: var(--text2); font: inherit; font-size: 13.5px; cursor: pointer; }
.set-flip b { color: var(--text); }
.set-flip i { font-style: normal; color: var(--text3); font-size: 17px; }
.set-flip-ic { width: 26px; height: 26px; display: grid; place-items: center; }
.set-flip:empty { display: none; }
/* Tap a photo to see it big (Squad member pages) */
.bgv { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-top: 6px; }
.bgv-coin { width: min(260px, 68vw); aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.bgv-coin:disabled { cursor: default; }
.bgv-c { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.5, 0, .25, 1);
  transform: perspective(900px) rotateY(0); }
.bgv-c.flipped { transform: perspective(900px) rotateY(180deg); }
.bgv-f { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; overflow: hidden; background: var(--bg3);
  backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 14px 36px rgba(0, 0, 0, .35); }
.bgv-f img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bgv-f > b { font-size: 76px; color: var(--text2); }
.bgv-b { transform: rotateY(180deg); background: radial-gradient(circle at 50% 35%, var(--bg4), var(--bg)); }
.bgv-b > svg, .bgv-b > img, .bgv-b > .bg-art-pic, .bgv-b > .bg-art-fx { width: 86% !important; height: 86% !important; }
.bgv-b > .bg-art-fx { padding: 0; margin: 0; }
.bgv-b > .bg-art-fx > svg { width: 100% !important; height: 100% !important; }
.bgv-t { min-height: 58px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }
.bgv-t b { font-size: 20px; }
.bgv-t small { font-size: 13px; color: var(--text2); }
.bgv-seg { width: 200px; }
@media (prefers-reduced-motion: reduce) { .bgv-c { transition: none; } }
