/* Estilos específicos de vistas (grupo b): social, perfil, rankings
   Todo va prefijado con .xb- para no pisar a nadie. */

/* ---------- Utilidades comunes de las 3 vistas ---------- */
.xb-view .pill svg { width: 13px; height: 13px; flex: none; }
.xb-view .card-title svg { width: 17px; height: 17px; flex: none; }
.xb-view .btn.xs svg { width: 15px; height: 15px; }
.xb-view a.small svg, .xb-view .section-head a svg { display: inline-block; width: 15px; height: 15px; vertical-align: -3px; margin-right: 2px; }
.xb-view .list-item > svg.muted { width: 18px; height: 18px; flex: none; }
.xb-view .tabs button { display: inline-flex; align-items: center; gap: 2px; }

@keyframes xb-pulse-pink { 0% { box-shadow: 0 0 0 0 rgba(255, 79, 139, .55); } 70% { box-shadow: 0 0 0 7px rgba(255, 79, 139, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 79, 139, 0); } }
@keyframes xb-pulse-green { 0% { box-shadow: 0 0 0 0 rgba(107, 214, 107, .6); } 70% { box-shadow: 0 0 0 6px rgba(107, 214, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(107, 214, 107, 0); } }
@keyframes xb-pop { 0% { transform: scale(1); } 40% { transform: scale(1.2) rotate(-6deg); } 100% { transform: scale(1); } }
@keyframes xb-drop { from { opacity: 0; transform: translateY(-6px); } }
@keyframes xb-bar { from { transform: scaleX(0); } }
@keyframes xb-rise { from { transform: scaleY(0); opacity: .3; } }
@keyframes xb-pop-in { from { opacity: 0; transform: translateY(10px) scale(.85); } }
@keyframes xb-bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-3px) rotate(4deg); } }

/* Avatar con insignias */
.xb-av { position: relative; flex: none; display: inline-block; line-height: 0; }
.xb-av-badge {
  --c: var(--amber);
  position: absolute; right: -6px; bottom: -6px;
  width: 22px; height: 22px; border-radius: 8px;
  display: grid; place-items: center; font-size: 12.5px; line-height: 1;
  background: color-mix(in srgb, var(--c) 30%, var(--surface-2));
  border: 2px solid var(--surface);
}
.xb-live-dot {
  position: absolute; right: -2px; bottom: -2px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--green); border: 2.5px solid var(--surface);
  animation: xb-pulse-green 2s infinite;
}
.pill.xb-live::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none;
  animation: xb-pulse-pink 1.8s infinite;
}
.xb-pink { color: var(--pink); }

/* Botón de brindis */
.xb-cheer { min-width: 50px; gap: 5px; flex: none; align-self: center; }
.xb-cheer .num:empty { display: none; }
.xb-cheer.xb-pop > span:first-child { display: inline-block; animation: xb-pop .45s var(--ease-spring); }
.xb-cheer-static { flex: none; align-self: center; }

/* ==========================================================================
   Social
   ========================================================================== */
.xb-search { position: relative; }
.xb-search .input-icon { display: block; }
.xb-search .input { padding-right: 46px; }
.xb-search input[type='search']::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.xb-search-clear {
  position: absolute; right: 7px; top: 50%; translate: 0 -50%;
  width: 34px; height: 34px; border-radius: 10px; border: 0;
  background: transparent; color: var(--text-3);
  display: grid; place-items: center; transition: background .2s, color .2s;
}
.xb-search-clear:hover { background: var(--surface-2); color: var(--text); }
.input-icon .xb-search-clear svg { position: static; translate: none; width: 16px; height: 16px; color: inherit; }
.xb-search-results {
  margin-top: 8px; max-height: min(380px, 60vh); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  animation: xb-drop .22s var(--ease);
}
.xb-search-results .list-item { gap: 10px; }
.xb-search-loading { display: flex; align-items: center; gap: 10px; padding: 16px; }
.xb-search-empty { display: flex; align-items: center; gap: 12px; padding: 16px; }
.xb-search-empty > span { font-size: 28px; line-height: 1; }

.xb-tabs .count.xb-count-neutral { background: var(--surface-3); color: var(--text-2); }

/* Tira "de fiesta ahora" */
.xb-party { background: linear-gradient(120deg, rgba(255, 79, 139, .08), transparent 55%), var(--surface); border-color: rgba(255, 79, 139, .18); }
.xb-party-list { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -4px; padding: 4px; }
.xb-party-list::-webkit-scrollbar { display: none; }
.xb-party-item {
  flex: none; width: 82px; padding: 8px 4px; border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  color: var(--text); transition: background .2s, transform .2s var(--ease);
}
.xb-party-item:hover { background: var(--surface-2); color: var(--text); transform: translateY(-2px); }
.xb-party-item b { font-size: 12.5px; max-width: 100%; margin-top: 4px; }
.xb-party-item .xb-live-dot { width: 15px; height: 15px; }

/* Feed */
.xb-day + .xb-day { margin-top: 20px; }
.xb-day-head { font: 800 12px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); margin: 0 4px 10px; }
.xb-feed-item { align-items: flex-start; animation: view-in .4s var(--ease) both; }
.xb-feed-item .xb-av { margin-top: 2px; }
.xb-feed-item.xb-mine { background: rgba(245, 184, 61, .035); }
.xb-feed-line { font-size: 14.5px; line-height: 1.4; }
.xb-feed-line b { font-weight: 800; color: var(--text); }
.xb-name { font-weight: 800; color: var(--text); margin-right: 2px; }
.xb-name:hover { color: var(--amber); }
.pill.xb-you { height: 20px; padding: 0 7px; font-size: 11px; margin-right: 4px; vertical-align: 1px; }
.xb-feed-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 12px; margin-top: 3px; }
.xb-feed-meta span { display: inline-flex; align-items: center; gap: 3px; min-width: 0; max-width: 100%; }
.xb-feed-meta svg { width: 13px; height: 13px; flex: none; }
.xb-note {
  margin-top: 8px; padding: 8px 12px; border-radius: 12px;
  background: var(--bg-2); border-left: 3px solid var(--line);
  color: var(--text-2); font-size: 13.5px; font-style: italic; overflow-wrap: anywhere;
}

/* Lista de amigos */
.xb-friend { transition: background .2s; }
.xb-friend.xb-partying { background: linear-gradient(90deg, rgba(255, 79, 139, .07), transparent 65%); }
.xb-friend-main { color: var(--text); }
.xb-friend-main:hover { color: var(--text); }
.xb-friend-main:hover .title { color: var(--amber); }
.xb-friend-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; text-align: right; }
.xb-remove { color: var(--text-3); flex: none; width: 36px; height: 36px; }
.xb-remove svg { width: 18px; height: 18px; }
.xb-remove:hover { color: var(--red); background: rgba(255, 90, 90, .1); }
.xb-friends-head { padding: 0 4px; }
.xb-req-actions { gap: 6px; flex: none; }

@media (max-width: 420px) {
  .xb-view .list-item { padding: 12px 12px; gap: 10px; }
  .xb-hide-xs { display: none; }
  .xb-friend-side .meta + .meta { display: none; }
}

/* ==========================================================================
   Perfil
   ========================================================================== */
.xb-profile-hero {
  --c: var(--amber);
  background:
    radial-gradient(520px 280px at 0% 0%, color-mix(in srgb, var(--c) 26%, transparent), transparent 65%),
    radial-gradient(500px 260px at 100% 0%, rgba(255, 210, 122, .12), transparent 60%),
    linear-gradient(160deg, #241d15 0%, #1b1712 60%);
  border-color: color-mix(in srgb, var(--c) 30%, transparent);
}
.xb-profile-hero > * { position: relative; z-index: 1; }
.xb-profile-top { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px; }
.xb-profile-av .avatar { animation: xb-pop-in .5s var(--ease-spring) both; box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--c) 60%, transparent), 0 14px 34px -14px color-mix(in srgb, var(--c) 70%, transparent); }
.xb-profile-id { min-width: 0; }
.xb-profile-id .eyebrow { margin-bottom: 4px; }
.xb-profile-name { font-size: clamp(24px, 6vw, 32px); overflow-wrap: anywhere; }
.xb-profile-rel { grid-column: 1 / -1; }
.xb-profile-rel > .btn { width: 100%; }
.xb-profile-rel > .row > .btn { flex: 1; }
.xb-bio { margin-top: 16px; color: var(--text-2); max-width: 62ch; overflow-wrap: anywhere; white-space: pre-line; }
.xb-profile-pills { margin-top: 14px; gap: 8px; }

.xb-rel-friends { --b-bg: rgba(107, 214, 107, .12); --b-fg: var(--green); --b-bd: rgba(107, 214, 107, .3); }
.xb-rel-friends .xb-rel-on, .xb-rel-friends .xb-rel-off { display: inline-flex; align-items: center; gap: 6px; }
.xb-rel-friends .xb-rel-off { display: none; }
@media (hover: hover) {
  .xb-rel-friends:hover { --b-bg: rgba(255, 90, 90, .12); --b-fg: var(--red); --b-bd: rgba(255, 90, 90, .3); background: var(--b-bg); }
  .xb-rel-friends:hover .xb-rel-on { display: none; }
  .xb-rel-friends:hover .xb-rel-off { display: inline-flex; }
}

@media (min-width: 640px) {
  .xb-profile-top { grid-template-columns: auto minmax(0, 1fr) auto; gap: 20px; }
  .xb-profile-rel { grid-column: auto; align-self: start; }
  .xb-profile-rel > .btn { width: auto; }
  .xb-profile-rel > .row > .btn { flex: none; }
}

.xb-quick-link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.xb-quick-link b { display: block; font-size: 14.5px; }
.xb-quick-link .muted.small { display: block; }
.xb-quick-link > svg { width: 18px; height: 18px; flex: none; transition: transform .2s var(--ease); }
.xb-quick-link:hover > svg { transform: translateX(3px); }
.xb-quick-ico { width: 42px; height: 42px; border-radius: 14px; flex: none; display: grid; place-items: center; background: rgba(245, 184, 61, .12); color: var(--amber); }
.xb-quick-ico svg { width: 21px; height: 21px; }
@media (max-width: 480px) {
  .xb-quick { grid-template-columns: minmax(0, 1fr); gap: 10px; }
}

.xb-profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 480px) {
  .xb-profile-stats .stat-card { padding: 12px; }
  .xb-profile-stats .stat-value { font-size: 20px; }
  .xb-profile-stats .stat-label { font-size: 10.5px; letter-spacing: .04em; }
  .xb-profile-stats .ico { font-size: 18px; margin-bottom: 4px; }
}

.xb-locked { text-align: center; padding: 26px 20px 30px; }
.xb-locked-ico { width: 54px; height: 54px; border-radius: 18px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--amber); }
.xb-locked-ico svg { width: 24px; height: 24px; }
.xb-locked h3 { margin-bottom: 6px; }
.xb-locked p { max-width: 330px; margin: 0 auto; }

.xb-fav { --c: var(--amber); display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--c) 13%, var(--surface-2)); }
.xb-fav-emoji { font-size: 40px; line-height: 1; transition: transform .3s var(--ease-spring); }
.xb-fav:hover .xb-fav-emoji { transform: scale(1.1) rotate(-8deg); }
.xb-fav-name { font: 800 20px/1.1 var(--font-display); }
.xb-grow { transform-origin: left center; animation: xb-bar .9s var(--ease) both; }

.xb-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.xb-badge {
  display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center;
  padding: 12px 8px; border-radius: 14px;
  background: linear-gradient(180deg, rgba(245, 184, 61, .08), transparent), var(--surface-2);
  border: 1px solid rgba(245, 184, 61, .16);
  transition: transform .2s var(--ease), border-color .2s;
}
.xb-badge:hover { transform: translateY(-2px); border-color: rgba(245, 184, 61, .35); }
.xb-badge-e { font-size: 26px; line-height: 1.1; }
.xb-badge b { font-size: 13px; line-height: 1.2; }
.xb-badge .tiny { line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ==========================================================================
   Rankings
   ========================================================================== */
.xb-filters { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }
.xb-filter-row { display: flex; flex-wrap: wrap; gap: 14px 22px; }
.xb-filter { display: flex; flex-direction: column; gap: 6px; min-width: 0; max-width: 100%; }
.xb-filter-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.xb-club-pick .select { max-width: 380px; height: 44px; }
.segmented.xb-scope { display: flex; width: 100%; }
.segmented.xb-scope button { flex: 1; }
@media (min-width: 700px) {
  .segmented.xb-scope { display: inline-flex; width: auto; }
}
@media (max-width: 420px) {
  .xb-view .segmented button { padding: 0 10px; }
}

.xb-board {
  background:
    radial-gradient(480px 220px at 50% 0%, rgba(245, 184, 61, .12), transparent 70%),
    var(--surface);
  padding-bottom: 6px;
}
.xb-board-head { margin-bottom: 6px; flex-wrap: wrap; gap: 4px 12px; }
.xb-board-head h2 { font-size: 18px; min-width: 0; }

.xb-podium { margin: 18px 0 0; gap: 8px; }
.xb-podium .podium-step { position: relative; color: var(--text); transition: transform .25s var(--ease); }
.xb-podium a.podium-step:hover { transform: translateY(-3px); color: var(--text); }
.xb-podium .podium-block { transform-origin: bottom; animation: xb-rise .7s var(--ease) both; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 -10px 30px -18px rgba(245, 184, 61, .5); }
.xb-podium .p2 .podium-block { animation-delay: .08s; }
.xb-podium .p1 .podium-block { animation-delay: .16s; }
.xb-podium .p3 .podium-block { animation-delay: .24s; }
.xb-podium-av { display: inline-block; animation: xb-pop-in .5s var(--ease-spring) both; }
.xb-podium .p2 .xb-podium-av { animation-delay: .3s; }
.xb-podium .p1 .xb-podium-av { animation-delay: .4s; }
.xb-podium .p3 .xb-podium-av { animation-delay: .5s; }
.xb-podium .p1 .avatar.lg { width: 78px; height: 78px; border-radius: 26px; font-size: 40px; box-shadow: inset 0 0 0 2px #ffd27a, 0 0 0 4px rgba(255, 210, 122, .14), 0 14px 30px -10px rgba(245, 184, 61, .55); }
.xb-podium .p2 .avatar.lg { box-shadow: inset 0 0 0 2px #d6dbe3; }
.xb-podium .p3 .avatar.lg { box-shadow: inset 0 0 0 2px #e3a172; }
.xb-podium .crown { display: inline-block; animation: xb-bob 3s ease-in-out infinite; }
.xb-podium .val { font-variant-numeric: tabular-nums; }
.xb-podium .xb-me .name { color: var(--amber); }
.xb-you-dot { color: var(--amber); font-size: 9px; vertical-align: 2px; }
.xb-podium-empty { opacity: .4; }
.xb-podium-empty .podium-block { filter: grayscale(1); }
.xb-ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--text-3); border: 1.5px dashed var(--line); font: 800 22px var(--font-display); }
.xb-podium-skel .podium-step { gap: 10px; }
.xb-podium-skel .podium-block { animation: skel 1.3s infinite linear; }
@media (max-width: 420px) {
  .xb-podium .avatar.lg { width: 52px; height: 52px; border-radius: 18px; font-size: 26px; }
  .xb-podium .p1 .avatar.lg { width: 64px; height: 64px; border-radius: 22px; font-size: 32px; }
  .xb-podium .podium-step .name { font-size: 12.5px; }
  .xb-podium .podium-step .val { font-size: 13.5px; }
  .xb-podium .p1 .podium-block { height: 84px; }
  .xb-podium .p2 .podium-block { height: 62px; }
  .xb-podium .p3 .podium-block { height: 48px; }
}
@media (min-width: 900px) {
  .xb-podium { max-width: 620px; margin-left: auto; margin-right: auto; gap: 16px; }
}

.xb-me-card { display: flex; align-items: center; gap: 14px; border-color: rgba(245, 184, 61, .3); background: linear-gradient(90deg, rgba(245, 184, 61, .1), transparent 70%), var(--surface); animation: view-in .4s var(--ease) both; }
.xb-me-pos { display: flex; flex-direction: column; align-items: center; flex: none; min-width: 56px; line-height: 1.1; }
.xb-me-pos b { font: 800 28px/1 var(--font-display); color: var(--amber); font-variant-numeric: tabular-nums; margin: 2px 0; }
.xb-me-val b { font: 800 18px var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 420px) { .xb-me-val { display: none; } }

.xb-rank-list .rank-row .rank-pos { color: var(--text-3); }
.xb-view a.rank-row { transition: background .15s; }
.xb-view a.rank-row:hover { background: var(--surface-2); color: var(--text); }
.xb-view a.rank-row.me:hover { background: rgba(245, 184, 61, .12); }
.xb-rank-list .rank-row.me { box-shadow: inset 3px 0 0 var(--amber); }
.xb-rank-list .rank-row.me .rank-pos { color: var(--amber); }
.xb-rank-info { display: flex; flex-direction: column; min-width: 0; }
.xb-rank-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.xb-rank-name b { min-width: 0; font-size: 14.5px; }
.xb-fav-ico { font-size: 15px; line-height: 1; flex: none; }
.pill.xb-pill-xs { height: 18px; padding: 0 6px; font-size: 10.5px; flex: none; }
.xb-zero { opacity: .55; }
.xb-zero:hover { opacity: .85; }
@media (max-width: 420px) {
  .xb-view .rank-row { grid-template-columns: 24px 36px minmax(0, 1fr) auto; gap: 10px; padding: 10px 12px; }
  .xb-view .rank-row .avatar { width: 36px; height: 36px; border-radius: 12px; font-size: 18px; }
  .xb-view .rank-val { font-size: 15px; }
}

.pill.xb-wrap-pill { white-space: normal; height: auto; min-height: 24px; padding: 4px 10px; text-align: left; line-height: 1.3; }
