/*
   RuniverseHub · REP-2.0 Rankings Public UI
   Lovable-first dark/glass visual layer. No altera motores REP.
*/
:root {
  --rh-rank-bg: #050913;
  --rh-rank-panel: rgba(12, 24, 38, .76);
  --rh-rank-panel-strong: rgba(15, 31, 48, .92);
  --rh-rank-border: rgba(125, 211, 252, .18);
  --rh-rank-border-strong: rgba(52, 211, 153, .28);
  --rh-rank-text: #e5f4ff;
  --rh-rank-muted: #9fb2c8;
  --rh-rank-soft: #6f8299;
  --rh-rank-green: #34d399;
  --rh-rank-cyan: #22d3ee;
  --rh-rank-blue: #60a5fa;
  --rh-rank-glow: 0 24px 80px rgba(34, 211, 238, .12), 0 12px 48px rgba(52, 211, 153, .10);
}

body.rh-rankings-public-page {
  margin: 0;
  min-height: 100vh;
  color: var(--rh-rank-text);
  background:
    radial-gradient(circle at 10% 5%, rgba(34, 211, 238, .18), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(52, 211, 153, .15), transparent 24rem),
    linear-gradient(180deg, #050913 0%, #08111f 48%, #050913 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}


/* REP-2.2.1 · Detail page shell marker
   El test REP-2.2 valida esta clase en CSS y el body la usa en /ranking/detail.php. */
body.rh-ranking-detail-page {
  min-height: 100vh;
}

.rh-ranking-detail-page .rh-rankings-shell {
  position: relative;
}

.rh-rankings-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 72px;
}

.rh-rankings-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 24px;
  align-items: stretch;
  margin-top: 18px;
}

.rh-rankings-hero-copy,
.rh-rankings-hero-card,
.rh-rankings-context-card,
.rh-ranking-board,
.rh-rankings-filters,
.rh-ranking-error {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rh-rank-border);
  background: linear-gradient(135deg, rgba(15, 31, 48, .88), rgba(10, 20, 33, .68));
  border-radius: 28px;
  box-shadow: var(--rh-rank-glow);
  backdrop-filter: blur(18px);
}

.rh-rankings-hero-copy { padding: 38px; }
.rh-rankings-hero-copy::before,
.rh-ranking-board::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(52, 211, 153, .12), transparent 42%, rgba(34, 211, 238, .10));
}

.rh-ranking-kicker {
  position: relative;
  margin: 0 0 10px;
  color: var(--rh-rank-green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.rh-rankings-hero h1 {
  position: relative;
  margin: 0;
  max-width: 860px;
  font-size: clamp(36px, 6vw, 76px);
  line-height: .94;
  letter-spacing: -.055em;
}

.rh-rankings-hero-copy > p:not(.rh-ranking-kicker) {
  position: relative;
  max-width: 780px;
  margin: 18px 0 0;
  color: var(--rh-rank-muted);
  font-size: 16px;
  line-height: 1.7;
}

.rh-rankings-policy-row,
.rh-ranking-chips,
.rh-ranking-components {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rh-rankings-policy-row { margin-top: 24px; }
.rh-rankings-policy-row span,
.rh-ranking-chips span,
.rh-ranking-components span {
  border: 1px solid rgba(125, 211, 252, .16);
  border-radius: 999px;
  background: rgba(6, 15, 28, .64);
  color: #c8e7ff;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 11px;
}

.rh-rankings-hero-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 280px;
}

.rh-rankings-orbit {
  position: absolute;
  right: -50px;
  top: -50px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: 1px solid rgba(34, 211, 238, .30);
  box-shadow: 0 0 70px rgba(34, 211, 238, .16) inset, 0 0 90px rgba(52, 211, 153, .10);
}

.rh-rankings-hero-card strong {
  position: relative;
  font-size: 26px;
  letter-spacing: -.03em;
}

.rh-rankings-hero-card > p {
  position: relative;
  margin: 8px 0 26px;
  color: var(--rh-rank-muted);
}

.rh-rankings-summary-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.rh-rankings-summary-grid span {
  min-height: 92px;
  border-radius: 20px;
  border: 1px solid rgba(52, 211, 153, .16);
  background: rgba(5, 12, 23, .62);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 14px;
  color: var(--rh-rank-soft);
  font-size: 12px;
  font-weight: 800;
}

.rh-rankings-summary-grid b {
  color: var(--rh-rank-text);
  font-size: 28px;
  line-height: 1;
  margin-bottom: 8px;
}

.rh-rankings-mode-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 14px;
}

.rh-rankings-mode-nav a {
  text-decoration: none;
  border: 1px solid rgba(125, 211, 252, .16);
  color: var(--rh-rank-muted);
  background: rgba(9, 19, 32, .72);
  border-radius: 999px;
  padding: 11px 15px;
  font-weight: 900;
  font-size: 13px;
  transition: transform .16s ease, border-color .16s ease, color .16s ease, background .16s ease;
}

.rh-rankings-mode-nav a:hover,
.rh-rankings-mode-nav a.is-active {
  transform: translateY(-1px);
  border-color: rgba(52, 211, 153, .48);
  color: #eafff7;
  background: linear-gradient(135deg, rgba(52, 211, 153, .18), rgba(34, 211, 238, .10));
}

.rh-rankings-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  margin: 0 0 18px;
}

.rh-rankings-filters label {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.rh-rankings-filters span {
  color: var(--rh-rank-soft);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .10em;
}

.rh-rankings-filters input,
.rh-rankings-filters select {
  width: 100%;
  box-sizing: border-box;
  color: var(--rh-rank-text);
  background: rgba(4, 11, 22, .78);
  border: 1px solid rgba(125, 211, 252, .16);
  border-radius: 16px;
  min-height: 44px;
  padding: 0 12px;
  outline: none;
}

.rh-rankings-filters button {
  align-self: end;
  min-height: 44px;
  border: 0;
  border-radius: 16px;
  color: #03110d;
  background: linear-gradient(135deg, var(--rh-rank-green), var(--rh-rank-cyan));
  font-weight: 950;
  cursor: pointer;
}

.rh-rankings-context-card {
  display: grid;
  grid-template-columns: minmax(220px, .4fr) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 22px;
  margin: 16px 0 22px;
}

.rh-rankings-context-card h2,
.rh-ranking-board h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -.035em;
}

.rh-rankings-context-card p:last-child,
.rh-ranking-board-head p {
  margin: 0;
  color: var(--rh-rank-muted);
  line-height: 1.55;
}

.rh-rankings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.rh-ranking-board {
  padding: 18px;
  min-width: 0;
}

.rh-ranking-board-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.rh-ranking-count {
  white-space: nowrap;
  color: var(--rh-rank-green);
  font-weight: 900;
  font-size: 12px;
  border: 1px solid rgba(52, 211, 153, .20);
  background: rgba(52, 211, 153, .08);
  border-radius: 999px;
  padding: 8px 10px;
}

.rh-ranking-list {
  position: relative;
  display: grid;
  gap: 12px;
}

.rh-ranking-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid rgba(125, 211, 252, .13);
  border-radius: 22px;
  background: rgba(4, 11, 22, .56);
  padding: 12px;
}

.rh-ranking-place span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  color: #02130f;
  background: linear-gradient(135deg, var(--rh-rank-green), var(--rh-rank-cyan));
  font-weight: 950;
  box-shadow: 0 10px 30px rgba(52, 211, 153, .18);
}

.rh-ranking-body { min-width: 0; }
.rh-ranking-row-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.rh-ranking-name {
  display: inline-block;
  max-width: 100%;
  color: var(--rh-rank-text);
  font-weight: 950;
  text-decoration: none;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

a.rh-ranking-name:hover { color: var(--rh-rank-cyan); }

.rh-ranking-meta {
  margin: 4px 0 0;
  color: var(--rh-rank-soft);
  font-size: 12px;
  line-height: 1.45;
}

.rh-ranking-score {
  text-align: right;
  min-width: 58px;
}

.rh-ranking-score strong {
  display: block;
  font-size: 28px;
  line-height: .95;
  color: var(--rh-rank-green);
}

.rh-ranking-score span {
  color: var(--rh-rank-soft);
  font-size: 11px;
  font-weight: 900;
}

.rh-ranking-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(125, 211, 252, .10);
  margin: 12px 0 10px;
}

.rh-ranking-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rh-rank-green), var(--rh-rank-cyan));
}

.rh-ranking-chips,
.rh-ranking-components { gap: 6px; }
.rh-ranking-chips span,
.rh-ranking-components span { padding: 6px 8px; font-size: 11px; }
.rh-ranking-components { margin-top: 8px; }
.rh-ranking-components b { color: var(--rh-rank-green); }

.rh-ranking-empty,
.rh-ranking-error {
  position: relative;
  color: var(--rh-rank-muted);
  border-radius: 20px;
  padding: 18px;
  background: rgba(4, 11, 22, .46);
  border: 1px dashed rgba(125, 211, 252, .18);
}

.rh-ranking-error { margin: 18px 0; color: #fecaca; border-color: rgba(248, 113, 113, .28); }

@media (max-width: 1180px) {
  .rh-rankings-grid { grid-template-columns: 1fr; }
  .rh-rankings-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .rh-rankings-shell { width: min(100% - 20px, 720px); padding: 18px 0 52px; }
  .rh-rankings-hero { grid-template-columns: 1fr; }
  .rh-rankings-hero-copy { padding: 24px; }
  .rh-rankings-hero-card { min-height: 220px; }
  .rh-rankings-filters { grid-template-columns: 1fr; }
  .rh-rankings-context-card { grid-template-columns: 1fr; }
  .rh-ranking-board { padding: 14px; border-radius: 24px; }
  .rh-ranking-item { grid-template-columns: 42px minmax(0, 1fr); }
  .rh-ranking-place span { width: 38px; height: 38px; border-radius: 14px; font-size: 13px; }
  .rh-ranking-score strong { font-size: 24px; }
  .rh-ranking-actions { gap: 8px; }
  .rh-ranking-actions .rh-ranking-action-link { flex: 1 1 calc(50% - 4px); }
  .rh-ranking-podium-action { width: 100%; }
}

/* REP-2.1 · Podio, accesos rápidos y filtros activos */
.rh-rankings-active-filters {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.rh-rankings-active-filters span {
  border: 1px solid rgba(34, 211, 238, .20);
  border-radius: 999px;
  background: rgba(34, 211, 238, .08);
  color: #d9fbff;
  font-size: 12px;
  font-weight: 900;
  padding: 8px 11px;
}

.rh-rankings-quick-actions {
  border: 1px solid rgba(125, 211, 252, .14);
  border-radius: 24px;
  background: rgba(7, 18, 32, .66);
  padding: 14px 16px;
  margin: 0 0 16px;
  backdrop-filter: blur(14px);
}

.rh-rankings-quick-actions .rh-ranking-kicker {
  margin-bottom: 10px;
}

.rh-rankings-quick-actions > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.rh-rankings-quick-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  border: 1px solid rgba(52, 211, 153, .18);
  border-radius: 999px;
  background: rgba(4, 11, 22, .58);
  color: #d8f8ff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 900;
  padding: 0 13px;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.rh-rankings-quick-actions a:hover {
  transform: translateY(-1px);
  border-color: rgba(52, 211, 153, .48);
  background: rgba(52, 211, 153, .10);
}

.rh-rankings-podium {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(52, 211, 153, .24);
  border-radius: 30px;
  background:
    radial-gradient(circle at 18% 0%, rgba(52, 211, 153, .16), transparent 24rem),
    radial-gradient(circle at 92% 12%, rgba(34, 211, 238, .14), transparent 22rem),
    linear-gradient(135deg, rgba(15, 31, 48, .88), rgba(7, 14, 26, .70));
  box-shadow: var(--rh-rank-glow);
  padding: 20px;
  margin: 0 0 18px;
  backdrop-filter: blur(18px);
}

.rh-rankings-podium-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.rh-rankings-podium-head h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -.045em;
}

.rh-rankings-podium-head > span {
  white-space: nowrap;
  border: 1px solid rgba(34, 211, 238, .24);
  background: rgba(34, 211, 238, .08);
  color: #a7f3ff;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
}

.rh-rankings-podium-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.rh-rankings-podium-card {
  min-height: 190px;
  border: 1px solid rgba(125, 211, 252, .15);
  border-radius: 24px;
  background: rgba(4, 11, 22, .58);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rh-rankings-podium-card-1 {
  border-color: rgba(52, 211, 153, .34);
  background: linear-gradient(135deg, rgba(52, 211, 153, .13), rgba(4, 11, 22, .64));
}

.rh-rankings-podium-rank {
  width: max-content;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--rh-rank-green), var(--rh-rank-cyan));
  color: #02130f;
  font-size: 12px;
  font-weight: 950;
  padding: 7px 10px;
}

.rh-rankings-podium-type {
  color: var(--rh-rank-soft);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.rh-rankings-podium-card a,
.rh-rankings-podium-card strong {
  color: var(--rh-rank-text);
  text-decoration: none;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.08;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}

.rh-rankings-podium-card a:hover { color: var(--rh-rank-cyan); }

.rh-rankings-podium-score {
  margin-top: auto;
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.rh-rankings-podium-score b {
  color: var(--rh-rank-green);
  font-size: 42px;
  line-height: .9;
}

.rh-rankings-podium-score span {
  color: var(--rh-rank-soft);
  font-size: 13px;
  font-weight: 900;
}


/* REP-2.3 · Rankings Mobile / UX Polish */
.rh-ranking-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.rh-ranking-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, .18);
  background: rgba(8, 17, 34, .78);
  color: #e6fbff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -.01em;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .16), inset 0 1px 0 rgba(255,255,255,.04);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}

.rh-ranking-action-link span { line-height: 1; }
.rh-ranking-action-link i {
  font-style: normal;
  font-size: 12px;
  line-height: 1;
  opacity: .9;
}

.rh-ranking-action-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .22), 0 0 0 1px rgba(255,255,255,.02) inset;
}

.rh-ranking-action-primary {
  color: #03130f !important;
  background: linear-gradient(135deg, var(--rh-rank-green), var(--rh-rank-cyan)) !important;
  border-color: transparent !important;
}

.rh-ranking-action-secondary {
  color: #dff8ff !important;
  background: rgba(15, 23, 42, .76) !important;
  border-color: rgba(125, 211, 252, .24) !important;
}

.rh-ranking-action-secondary:hover {
  color: #5eead4 !important;
  border-color: rgba(94, 234, 212, .52) !important;
}

.rh-ranking-podium-action {
  margin-top: 10px;
  width: max-content;
}

.rh-ranking-profile-link { text-decoration: none; }

@media (max-width: 980px) {
  .rh-rankings-podium-grid { grid-template-columns: 1fr; }
  .rh-rankings-podium-card { min-height: auto; }
}

@media (max-width: 820px) {
  .rh-rankings-podium { padding: 14px; border-radius: 24px; }
  .rh-rankings-podium-head { flex-direction: column; }
  .rh-rankings-quick-actions { border-radius: 22px; }
}

/* REP-2.2 · Ranking Detail / Deep View */
.rh-ranking-detail-link { text-decoration: none; }

.rh-ranking-detail-link:hover { color: inherit; }

.rh-ranking-detail-shell {
  gap: 22px;
}

.rh-ranking-detail-hero {
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 34px;
  padding: clamp(22px, 4vw, 46px);
  background:
    radial-gradient(circle at 18% 18%, rgba(52, 211, 153, .18), transparent 32%),
    radial-gradient(circle at 92% 12%, rgba(56, 189, 248, .16), transparent 32%),
    linear-gradient(135deg, rgba(2, 6, 23, .9), rgba(8, 17, 34, .82));
  box-shadow: 0 24px 80px rgba(0, 0, 0, .34);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 330px);
  gap: 26px;
  align-items: center;
}

.rh-ranking-detail-hero h1 {
  margin: 10px 0 8px;
  color: #f8fafc;
  font-size: clamp(40px, 7vw, 82px);
  line-height: .92;
  letter-spacing: -.065em;
}

.rh-ranking-detail-hero p {
  color: rgba(226, 232, 240, .74);
  max-width: 780px;
  font-size: 18px;
  line-height: 1.5;
}

.rh-ranking-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.rh-ranking-detail-actions a { text-decoration: none; }

.rh-ranking-detail-score-card {
  border: 1px solid rgba(94, 234, 212, .2);
  border-radius: 30px;
  padding: 26px;
  background: rgba(9, 28, 36, .74);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}

.rh-ranking-detail-score-card span {
  color: rgba(226, 232, 240, .72);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .14em;
  font-weight: 950;
}

.rh-ranking-detail-score-card strong {
  display: inline-block;
  color: var(--rh-rank-green);
  font-size: clamp(60px, 9vw, 104px);
  line-height: .9;
  margin-top: 10px;
}

.rh-ranking-detail-score-card small {
  color: rgba(226, 232, 240, .68);
  font-size: 20px;
  font-weight: 900;
}

.rh-ranking-detail-score-card p {
  color: rgba(226, 232, 240, .76);
  margin: 14px 0 0;
  font-weight: 900;
}

.rh-ranking-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.rh-ranking-detail-panel {
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 28px;
  padding: 22px;
  background: rgba(8, 17, 34, .76);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .24);
}

.rh-ranking-detail-panel h2 {
  margin: 8px 0 8px;
  color: #f8fafc;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -.045em;
}

.rh-ranking-detail-panel p {
  color: rgba(226, 232, 240, .68);
  line-height: 1.48;
}

.rh-ranking-detail-wide { margin-top: 0; }

.rh-ranking-detail-components,
.rh-ranking-detail-timeline,
.rh-ranking-detail-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.rh-ranking-detail-components article,
.rh-ranking-detail-timeline article,
.rh-ranking-detail-facts span {
  border: 1px solid rgba(148, 163, 184, .11);
  border-radius: 20px;
  padding: 14px;
  background: rgba(2, 6, 23, .46);
}

.rh-ranking-detail-components span,
.rh-ranking-detail-timeline span,
.rh-ranking-detail-facts span {
  color: rgba(226, 232, 240, .68);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 950;
}

.rh-ranking-detail-components strong,
.rh-ranking-detail-timeline strong,
.rh-ranking-detail-facts b {
  display: block;
  color: #f8fafc;
  font-size: 26px;
  margin-top: 6px;
}

.rh-ranking-meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rh-rank-green), var(--rh-rank-cyan));
}

@media (max-width: 980px) {
  .rh-ranking-detail-hero,
  .rh-ranking-detail-grid,
  .rh-ranking-detail-components,
  .rh-ranking-detail-timeline,
  .rh-ranking-detail-facts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .rh-ranking-detail-hero { border-radius: 26px; }
  .rh-ranking-detail-actions a { width: 100%; text-align: center; }
  .rh-ranking-detail-panel { border-radius: 24px; padding: 18px; }
}

@media (max-width: 640px) {
  .rh-ranking-actions .rh-ranking-action-link { flex: 1 1 100%; }
}

/* REP-2.4 · Ranking CTAs compactos e integración de navegación */
.rh-ranking-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 10px;
}

.rh-ranking-action-link {
  width: auto;
  min-width: 0;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 900;
  box-shadow: none;
  transform: none;
}

.rh-ranking-action-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, .18);
}

.rh-ranking-action-primary {
  color: #04130f !important;
  background: linear-gradient(135deg, rgba(94, 234, 212, .95), rgba(34, 211, 238, .92)) !important;
  border: 1px solid rgba(94, 234, 212, .28) !important;
  box-shadow: 0 8px 20px rgba(34, 211, 238, .10);
}

.rh-ranking-action-secondary {
  color: #dff8ff !important;
  background: rgba(8, 17, 34, .72) !important;
  border: 1px solid rgba(125, 211, 252, .22) !important;
}

.rh-ranking-action-link i {
  display: none;
}

.rh-ranking-podium-action {
  width: auto;
  margin-top: 8px;
  align-self: flex-start;
}

.rh-ranking-detail-actions .rh-ranking-action-link {
  min-height: 38px;
  padding: 10px 14px;
}

@media (max-width: 820px) {
  .rh-ranking-actions { gap: 8px; }
  .rh-ranking-actions .rh-ranking-action-link {
    flex: 0 0 auto;
    width: auto;
    min-height: 36px;
    padding: 9px 12px;
  }
  .rh-ranking-action-primary,
  .rh-ranking-action-secondary { box-shadow: none; }
}

@media (max-width: 420px) {
  .rh-ranking-actions .rh-ranking-action-link {
    flex: 1 1 calc(50% - 4px);
    max-width: calc(50% - 4px);
    padding-inline: 10px;
  }
  .rh-ranking-podium-action {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
  }
}


/* REP-2.6 · AJAX UX + CTAs refinados finales */
.rh-rankings-dynamic {
  position: relative;
}

.rh-rankings-dynamic.is-loading {
  opacity: .58;
  filter: saturate(.86);
  pointer-events: none;
  transition: opacity .18s ease, filter .18s ease;
}

.rh-rankings-ajax-status {
  position: sticky;
  top: 76px;
  z-index: 40;
  width: max-content;
  max-width: calc(100% - 24px);
  margin: 10px auto;
  border: 1px solid rgba(94, 234, 212, .28);
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(2, 6, 23, .82);
  color: #a7f3d0;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .28);
}

.rh-ranking-actions {
  gap: 7px;
  margin-top: 9px;
}

.rh-ranking-action-link {
  min-height: 30px;
  padding: 7px 10px;
  border-radius: 12px;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -.01em;
}

.rh-ranking-action-primary {
  background: linear-gradient(135deg, rgba(94, 234, 212, .88), rgba(34, 211, 238, .84)) !important;
  box-shadow: 0 7px 16px rgba(34, 211, 238, .08) !important;
}

.rh-ranking-action-secondary {
  background: rgba(8, 17, 34, .56) !important;
  border-color: rgba(125, 211, 252, .18) !important;
}

.rh-ranking-action-link i {
  display: none;
}

.rh-ranking-podium-action {
  min-height: 32px;
  padding: 8px 11px;
  border-radius: 12px;
}

.rh-ranking-detail-actions .rh-ranking-action-link {
  min-height: 34px;
  padding: 9px 12px;
  border-radius: 13px;
}

@media (max-width: 820px) {
  .rh-ranking-actions {
    gap: 7px;
  }

  .rh-ranking-actions .rh-ranking-action-link {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    min-height: 31px;
    padding: 7px 10px;
    font-size: 11px;
  }
}

@media (max-width: 420px) {
  .rh-ranking-actions .rh-ranking-action-link {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
  }
}


/* REP-2.6.1 · AJAX PHP boundary hotfix: CSS cache refresh only */

/* ========================================================================== */
/* RANK-UI-1.0C · Lovable Public Rankings UI                                  */
/* Basado visualmente en RuniverseHub_Lovable_Final/src/pages/Rankings.tsx.     */
/* No altera motores REP ni convierte mock visual en dato real.                 */
/* ========================================================================== */

body.rh-rankings-public-page {
  --rh-rank-lovable-card: rgba(15, 23, 42, .74);
  --rh-rank-lovable-card-strong: rgba(15, 23, 42, .92);
  --rh-rank-lovable-primary: #34d399;
  --rh-rank-lovable-accent: #22d3ee;
  --rh-rank-lovable-gold: #facc15;
  --rh-rank-lovable-silver: #cbd5e1;
  --rh-rank-lovable-bronze: #fb923c;
  overflow-x: hidden;
}

.rh-rankings-shell {
  width: min(1180px, calc(100% - 32px));
  padding-top: clamp(22px, 3vw, 42px);
}

.rh-rankings-lovable-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: clamp(18px, 4vw, 34px);
  margin: 0 0 22px;
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 32px;
  background:
    radial-gradient(circle at 88% 0%, rgba(52, 211, 153, .22), transparent 34%),
    radial-gradient(circle at 0% 100%, rgba(34, 211, 238, .16), transparent 38%),
    linear-gradient(135deg, rgba(15, 23, 42, .96), rgba(2, 6, 23, .90));
  box-shadow: 0 28px 95px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .05);
}

.rh-rankings-lovable-hero::before,
.rh-rankings-lovable-hero::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(52px);
  pointer-events: none;
  opacity: .58;
  animation: rhRankGlowFloat 10s ease-in-out infinite alternate;
}

.rh-rankings-lovable-hero::before {
  top: -180px;
  right: -120px;
  background: rgba(52, 211, 153, .28);
}

.rh-rankings-lovable-hero::after {
  left: -160px;
  bottom: -180px;
  background: rgba(34, 211, 238, .18);
  animation-delay: -3s;
}

.rh-rankings-hero-copy,
.rh-rankings-lovable-orbit-card {
  position: relative;
  z-index: 1;
}

.rh-rankings-lovable-hero .rh-ranking-kicker {
  display: inline-flex;
  width: auto;
  margin: 0 0 16px;
  padding: 8px 12px;
  border: 1px solid rgba(52, 211, 153, .22);
  border-radius: 999px;
  background: rgba(52, 211, 153, .10);
  color: var(--rh-rank-lovable-primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}

.rh-rankings-lovable-hero h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: .92;
  letter-spacing: -.065em;
}

.rh-rankings-lovable-hero h1 span {
  color: var(--rh-rank-lovable-primary);
  text-shadow: 0 0 36px rgba(52, 211, 153, .18);
}

.rh-rankings-lovable-hero p {
  max-width: 720px;
  margin: 16px 0 0;
  color: #a8b5c8;
  font-size: 15px;
  line-height: 1.65;
}

.rh-rankings-hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-top: 24px;
}

.rh-rankings-hero-stats div {
  display: grid;
  gap: 1px;
}

.rh-rankings-hero-stats strong {
  color: var(--rh-rank-lovable-primary);
  font-size: 24px;
  line-height: 1;
}

.rh-rankings-hero-stats span {
  color: #94a3b8;
  font-size: 12px;
}

.rh-rankings-real-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: max-content;
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid rgba(52, 211, 153, .28);
  border-radius: 999px;
  background: rgba(52, 211, 153, .10);
  color: #8af3c9;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.rh-rankings-real-badge::before {
  content: "✓";
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: rgba(52, 211, 153, .18);
}

.rh-rankings-lovable-orbit-card {
  min-height: 260px;
  align-self: stretch;
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(15, 23, 42, .92), rgba(15, 23, 42, .52)),
    radial-gradient(circle at 50% 0%, rgba(34, 211, 238, .22), transparent 58%);
  animation: rhRankCardIn .65s ease-out both;
}

.rh-rankings-lovable-context {
  margin: 18px 0;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(15, 23, 42, .78), rgba(15, 23, 42, .48));
}

.rh-rankings-dynamic-lovable {
  display: block;
  position: relative;
}

.rh-rankings-dynamic-lovable.is-loading {
  opacity: .58;
  filter: saturate(.85);
  pointer-events: none;
}

.rh-rankings-mode-nav-lovable,
.rh-rankings-entity-tabs {
  display: grid;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 24px;
  background: rgba(15, 23, 42, .72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
  backdrop-filter: blur(18px);
}

.rh-rankings-mode-nav-lovable {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0 0 14px;
}

.rh-rankings-mode-nav-lovable a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 17px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: transform .18s ease, color .18s ease, background .18s ease, box-shadow .18s ease;
}

.rh-rankings-mode-nav-lovable a:hover {
  color: #e5f4ff;
  transform: translateY(-1px);
}

.rh-rankings-mode-nav-lovable a.is-active {
  color: #04111d;
  background: linear-gradient(135deg, var(--rh-rank-lovable-primary), var(--rh-rank-lovable-accent));
  box-shadow: 0 16px 34px rgba(52, 211, 153, .22);
}

.rh-rankings-entity-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 18px;
}

.rh-rankings-entity-tab {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 74px;
  padding: 14px;
  border-radius: 20px;
  color: #dbeafe;
  text-decoration: none;
  overflow: hidden;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.rh-rankings-entity-tab::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(52, 211, 153, .18), rgba(34, 211, 238, .10));
  opacity: 0;
  transition: opacity .18s ease;
}

.rh-rankings-entity-tab:hover,
.rh-rankings-entity-tab.is-active {
  transform: translateY(-1px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .24);
}

.rh-rankings-entity-tab.is-active::before { opacity: 1; }

.rh-rankings-tab-icon,
.rh-rankings-entity-tab > span,
.rh-rankings-entity-tab em {
  position: relative;
  z-index: 1;
}

.rh-rankings-tab-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 15px;
  background: rgba(15, 23, 42, .50);
  font-size: 20px;
}

.rh-rankings-entity-tab b {
  display: block;
  color: #f8fafc;
  font-size: 14px;
}

.rh-rankings-entity-tab small {
  display: block;
  margin-top: 3px;
  color: #94a3b8;
  font-size: 11px;
}

.rh-rankings-entity-tab em {
  display: grid;
  place-items: center;
  min-width: 38px;
  min-height: 30px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(2, 6, 23, .42);
  color: var(--rh-rank-lovable-primary);
  font-style: normal;
  font-weight: 900;
  font-size: 12px;
}

.rh-rankings-lovable-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(180px, 1fr) repeat(3, minmax(130px, .8fr)) auto;
  gap: 10px;
  align-items: end;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 24px;
  background: var(--rh-rank-lovable-card);
  backdrop-filter: blur(18px);
}

.rh-rankings-filter-title {
  display: none;
}

.rh-rankings-lovable-filters label {
  display: grid;
  gap: 7px;
}

.rh-rankings-lovable-filters label span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.rh-rankings-lovable-filters input,
.rh-rankings-lovable-filters select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(148, 163, 184, .16);
  border-radius: 13px;
  background: rgba(2, 6, 23, .40);
  color: #e5f4ff;
  padding: 0 12px;
  outline: none;
}

.rh-rankings-lovable-filters input:focus,
.rh-rankings-lovable-filters select:focus {
  border-color: rgba(52, 211, 153, .50);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .10);
}

.rh-rankings-lovable-filters button {
  min-height: 42px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--rh-rank-lovable-primary), var(--rh-rank-lovable-accent));
  color: #03131d;
  font-weight: 900;
  cursor: pointer;
  padding: 0 18px;
  box-shadow: 0 16px 36px rgba(52, 211, 153, .18);
}

.rh-rankings-active-filters {
  margin-bottom: 18px;
}

.rh-rankings-lovable-podium {
  margin-top: 20px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(15, 23, 42, .88), rgba(15, 23, 42, .50));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .24), inset 0 1px 0 rgba(255, 255, 255, .04);
  overflow: hidden;
}

.rh-rankings-podium-stage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 2.5vw, 22px);
  align-items: end;
  padding: 8px clamp(12px, 3vw, 24px) 24px;
}

.rh-rankings-podium-step {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-width: 0;
  animation: rhRankPodiumCardIn .55s ease-out both;
}

.rh-rankings-podium-step:nth-child(2) { animation-delay: .08s; }
.rh-rankings-podium-step:nth-child(3) { animation-delay: .16s; }

.rh-rankings-podium-avatar {
  display: grid;
  place-items: center;
  width: clamp(52px, 7vw, 68px);
  height: clamp(52px, 7vw, 68px);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: linear-gradient(145deg, rgba(52, 211, 153, .22), rgba(34, 211, 238, .10));
  color: #f8fafc;
  font-size: 18px;
  font-weight: 950;
  box-shadow: 0 16px 38px rgba(0, 0, 0, .26);
}

.rh-rankings-podium-step-1 .rh-rankings-podium-avatar {
  background: linear-gradient(145deg, rgba(250, 204, 21, .38), rgba(250, 204, 21, .10));
  color: #fde68a;
}

.rh-rankings-podium-step-2 .rh-rankings-podium-avatar {
  background: linear-gradient(145deg, rgba(203, 213, 225, .32), rgba(203, 213, 225, .08));
  color: #f1f5f9;
}

.rh-rankings-podium-step-3 .rh-rankings-podium-avatar {
  background: linear-gradient(145deg, rgba(251, 146, 60, .34), rgba(251, 146, 60, .08));
  color: #fed7aa;
}

.rh-rankings-podium-name {
  display: grid;
  justify-items: center;
  min-height: 54px;
  text-align: center;
}

.rh-rankings-podium-name a,
.rh-rankings-podium-name strong {
  max-width: 100%;
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 900;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rh-rankings-podium-name small {
  max-width: 100%;
  margin-top: 3px;
  color: #94a3b8;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rh-rankings-podium-bar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: var(--rh-podium-height);
  padding-top: 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, rgba(52, 211, 153, .20), rgba(52, 211, 153, .04));
  overflow: hidden;
  animation: rhRankPodiumRise .75s cubic-bezier(.22, .91, .36, 1) both;
}

.rh-rankings-podium-step-1 .rh-rankings-podium-bar {
  background: linear-gradient(180deg, rgba(250, 204, 21, .32), rgba(250, 204, 21, .06));
  border-color: rgba(250, 204, 21, .28);
}

.rh-rankings-podium-step-2 .rh-rankings-podium-bar {
  background: linear-gradient(180deg, rgba(203, 213, 225, .24), rgba(203, 213, 225, .05));
  border-color: rgba(203, 213, 225, .20);
}

.rh-rankings-podium-step-3 .rh-rankings-podium-bar {
  background: linear-gradient(180deg, rgba(251, 146, 60, .28), rgba(251, 146, 60, .05));
  border-color: rgba(251, 146, 60, .22);
}

.rh-rankings-podium-number {
  color: #f8fafc;
  font-size: clamp(28px, 4.5vw, 44px);
  line-height: .9;
  font-weight: 950;
}

.rh-rankings-podium-bar em {
  margin-top: 5px;
  color: #94a3b8;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rh-rankings-podium-bar b {
  margin-top: 10px;
  color: #f8fafc;
  font-size: 18px;
}

.rh-rankings-podium-bar small {
  color: #94a3b8;
  font-size: 10px;
}

.rh-rankings-podium-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-height: 28px;
  font-size: 11px;
}

.rh-rankings-podium-meta span,
.rh-rankings-podium-meta a {
  padding: 5px 8px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(2, 6, 23, .34);
  text-decoration: none;
}

.rh-rankings-table-card {
  margin-top: 22px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 28px;
  background: var(--rh-rank-lovable-card);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .04);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.rh-rankings-table-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.rh-rankings-table-head div {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f8fafc;
}

.rh-rankings-table-head b {
  font-size: 15px;
}

.rh-rankings-table-head small {
  color: #94a3b8;
}

.rh-rankings-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.rh-rankings-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 14px;
}

.rh-rankings-table th,
.rh-rankings-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, .10);
  text-align: left;
  vertical-align: middle;
}

.rh-rankings-table th {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.rh-rankings-table tr {
  transition: background .16s ease, transform .16s ease;
}

.rh-rankings-table tbody tr:hover {
  background: rgba(148, 163, 184, .06);
}

.rh-rankings-table-row.is-filtered-out {
  display: none;
}

.rh-rankings-rank-pill {
  display: inline-grid;
  place-items: center;
  min-width: 31px;
  height: 31px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .12);
  color: #cbd5e1;
  font-weight: 950;
}

.rh-rankings-rank-pill-1 { background: rgba(250, 204, 21, .18); color: #fde047; }
.rh-rankings-rank-pill-2 { background: rgba(203, 213, 225, .16); color: #f1f5f9; }
.rh-rankings-rank-pill-3 { background: rgba(251, 146, 60, .18); color: #fdba74; }

.rh-rankings-trend-pill,
.rh-rankings-evidence-chip {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 8px;
  border: 1px solid rgba(52, 211, 153, .18);
  border-radius: 999px;
  background: rgba(52, 211, 153, .08);
  color: #86efac;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.rh-rankings-table-identity {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.rh-rankings-table-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(52, 211, 153, .18), rgba(34, 211, 238, .08));
  color: #f8fafc;
  font-size: 13px;
  font-weight: 950;
}

.rh-rankings-table-identity a,
.rh-rankings-table-identity b {
  display: block;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.rh-rankings-row-detail {
  margin-top: 3px;
  color: #7dd3fc !important;
  font-size: 11px !important;
  font-weight: 750 !important;
}

.rh-score-col {
  text-align: right !important;
}

.rh-score-col strong {
  color: var(--rh-rank-lovable-primary);
  font-size: 17px;
}

@keyframes rhRankGlowFloat {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(18px, -10px, 0) scale(1.08); }
}

@keyframes rhRankCardIn {
  from { opacity: 0; transform: translateY(20px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes rhRankPodiumCardIn {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rhRankPodiumRise {
  from { min-height: 0; opacity: .42; }
  to { min-height: var(--rh-podium-height); opacity: 1; }
}

@media (max-width: 980px) {
  .rh-rankings-shell {
    width: min(100% - 20px, 1180px);
  }

  .rh-rankings-lovable-hero {
    grid-template-columns: 1fr;
    padding: 26px 18px;
    border-radius: 26px;
  }

  .rh-rankings-lovable-orbit-card {
    min-height: 220px;
  }

  .rh-rankings-mode-nav-lovable {
    grid-template-columns: repeat(5, max-content);
    overflow-x: auto;
    justify-content: flex-start;
  }

  .rh-rankings-mode-nav-lovable a {
    min-width: max-content;
  }

  .rh-rankings-entity-tabs {
    grid-template-columns: 1fr;
  }

  .rh-rankings-lovable-filters {
    grid-template-columns: 1fr 1fr;
  }

  .rh-rankings-filter-title,
  .rh-rankings-search-label {
    grid-column: 1 / -1;
  }

  .rh-rankings-filter-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #cbd5e1;
  }

  .rh-rankings-filter-title b,
  .rh-rankings-filter-title small {
    display: block;
  }

  .rh-rankings-filter-title small {
    color: #94a3b8;
    font-size: 11px;
  }
}

@media (max-width: 720px) {
  .rh-rankings-lovable-hero h1 {
    font-size: clamp(32px, 12vw, 46px);
  }

  .rh-rankings-policy-row,
  .rh-rankings-hero-stats {
    gap: 8px;
  }

  .rh-rankings-hero-stats div {
    min-width: calc(50% - 8px);
  }

  .rh-rankings-lovable-filters {
    grid-template-columns: 1fr;
  }

  .rh-rankings-podium-stage {
    grid-template-columns: 1fr;
  }

  .rh-rankings-podium-step {
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: center;
    justify-items: stretch;
  }

  .rh-rankings-podium-avatar {
    grid-row: 1 / span 3;
  }

  .rh-rankings-podium-name {
    justify-items: start;
    min-height: auto;
    text-align: left;
  }

  .rh-rankings-podium-bar {
    min-height: 78px !important;
    border-radius: 16px;
    padding: 10px 12px;
    align-items: flex-start;
  }

  .rh-rankings-podium-meta {
    justify-content: flex-start;
  }

  .rh-rankings-table {
    min-width: 680px;
    font-size: 13px;
  }

  .rh-rankings-table th,
  .rh-rankings-table td {
    padding: 12px 10px;
  }

  .rh-hide-sm {
    display: none;
  }
}

@media (max-width: 520px) {
  .rh-rankings-shell {
    width: min(100% - 14px, 1180px);
  }

  .rh-rankings-lovable-hero,
  .rh-rankings-table-card,
  .rh-rankings-lovable-podium,
  .rh-rankings-lovable-filters,
  .rh-rankings-entity-tabs,
  .rh-rankings-mode-nav-lovable {
    border-radius: 20px;
  }

  .rh-hide-md {
    display: none;
  }
}

/* RANK-UI-1.0C-MOBILE · Paridad mobile Lovable
   Ajuste visual no destructivo: conserva datos reales del contrato 1.0B y replica en celular
   la composición del prototipo Lovable: hero compacto, tabs de entidad, filtros, podio 3 columnas y tabla sin scroll horizontal. */
.rh-rankings-mode-select-label {
  display: none;
}

@media (max-width: 720px) {
  body.rh-rankings-public-page {
    background: #05070c;
  }

  .rh-rankings-shell {
    width: min(100% - 18px, 420px);
    padding: 10px 0 44px;
  }

  .rh-rankings-lovable-hero {
    display: block;
    margin-top: 8px;
    padding: 0;
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .rh-rankings-lovable-hero::before,
  .rh-rankings-lovable-hero::after {
    display: none;
  }

  .rh-rankings-hero-copy {
    padding: 28px 24px 30px;
    border-radius: 26px;
    border: 1px solid rgba(52, 211, 153, .18);
    background:
      radial-gradient(circle at 18% 0%, rgba(52, 211, 153, .22), transparent 17rem),
      radial-gradient(circle at 78% 100%, rgba(59, 130, 246, .18), transparent 14rem),
      linear-gradient(145deg, rgba(6, 30, 28, .92), rgba(8, 13, 27, .96));
    box-shadow: 0 28px 78px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .04);
  }

  .rh-rankings-hero-copy::before {
    background: linear-gradient(135deg, rgba(52, 211, 153, .10), transparent 46%, rgba(59, 130, 246, .10));
  }

  .rh-rankings-hero-copy .rh-ranking-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: max-content;
    max-width: 100%;
    margin-bottom: 20px;
    padding: 7px 12px;
    border: 1px solid rgba(52, 211, 153, .22);
    border-radius: 999px;
    background: rgba(52, 211, 153, .08);
    color: #34d399;
    font-size: 11px;
    letter-spacing: 0;
    text-transform: none;
    white-space: normal;
  }

  .rh-rankings-hero h1 {
    font-size: clamp(40px, 12.4vw, 52px);
    line-height: 1.02;
    letter-spacing: -.055em;
  }

  .rh-rankings-hero-copy > p:not(.rh-ranking-kicker) {
    margin-top: 20px;
    font-size: 15px;
    line-height: 1.55;
    color: rgba(203, 213, 225, .72);
  }

  .rh-rankings-policy-row {
    display: none;
  }

  .rh-rankings-hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 18px;
    margin-top: 26px;
  }

  .rh-rankings-hero-stats div {
    min-width: auto;
    flex: 0 1 auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .rh-rankings-hero-stats strong {
    display: inline;
    margin-right: 4px;
    color: #34d399;
    font-size: 25px;
    line-height: 1;
  }

  .rh-rankings-hero-stats span {
    display: inline;
    color: rgba(203, 213, 225, .66);
    font-size: 13px;
  }

  .rh-rankings-real-badge {
    min-height: 30px;
    align-self: center;
    color: #93c5fd;
    background: rgba(37, 99, 235, .18);
    border-color: rgba(96, 165, 250, .22);
  }

  .rh-rankings-lovable-orbit-card,
  .rh-rankings-lovable-context,
  .rh-rankings-mode-nav-lovable,
  .rh-rankings-active-filters,
  .rh-rankings-quick-actions {
    display: none;
  }

  .rh-rankings-dynamic-lovable {
    display: flex;
    flex-direction: column;
    margin-top: 28px;
  }

  .rh-rankings-entity-tabs {
    order: 1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    margin: 0 0 16px;
    padding: 5px;
    border-radius: 22px;
    background: rgba(15, 23, 42, .70);
  }

  .rh-rankings-entity-tab {
    display: flex;
    justify-content: center;
    gap: 7px;
    min-height: 56px;
    padding: 0 7px;
    border-radius: 17px;
    text-align: center;
  }

  .rh-rankings-entity-tab.is-active {
    color: #03131d;
    background: linear-gradient(135deg, #34d399, #22d3ee);
    box-shadow: 0 18px 38px rgba(52, 211, 153, .28);
  }

  .rh-rankings-entity-tab.is-active::before {
    opacity: 0;
  }

  .rh-rankings-tab-icon {
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 15px;
  }

  .rh-rankings-entity-tab b {
    color: inherit;
    font-size: 13px;
    line-height: 1;
  }

  .rh-rankings-entity-tab small,
  .rh-rankings-entity-tab em {
    display: none;
  }

  .rh-rankings-lovable-filters {
    order: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 0 0 28px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(15, 23, 42, .76);
    border-color: rgba(148, 163, 184, .10);
    box-shadow: 0 20px 48px rgba(0, 0, 0, .22);
  }

  .rh-rankings-filter-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
  }

  .rh-rankings-filter-title b {
    display: block;
    font-size: 13px;
    font-weight: 800;
  }

  .rh-rankings-filter-title small {
    display: none;
  }

  .rh-rankings-mode-select-label {
    display: grid;
  }

  .rh-rankings-lovable-filters label > span {
    display: none;
  }

  .rh-rankings-lovable-filters input,
  .rh-rankings-lovable-filters select {
    min-height: 56px;
    border-radius: 14px;
    border-color: transparent;
    background: rgba(39, 38, 50, .94);
    color: #f8fafc;
    font-size: 16px;
    padding: 0 18px;
  }

  .rh-rankings-lovable-filters input::placeholder {
    color: rgba(203, 213, 225, .46);
  }

  .rh-rankings-lovable-filters button {
    min-height: 52px;
    border-radius: 14px;
  }

  .rh-rankings-lovable-podium {
    order: 3;
    margin-top: 0;
    margin-bottom: 24px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .rh-rankings-lovable-podium .rh-rankings-podium-head {
    display: none;
  }

  .rh-rankings-podium-stage {
    grid-template-columns: .88fr 1.04fr .88fr;
    gap: 9px;
    align-items: end;
    padding: 6px 0 0;
  }

  .rh-rankings-podium-step {
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: end;
    gap: 7px;
    min-width: 0;
  }

  .rh-rankings-podium-avatar {
    grid-row: auto;
    width: 56px;
    height: 56px;
    border-radius: 18px;
    font-size: 15px;
    margin-bottom: 3px;
  }

  .rh-rankings-podium-step-1 .rh-rankings-podium-avatar {
    width: 62px;
    height: 62px;
  }

  .rh-rankings-podium-name {
    justify-items: center;
    min-height: 48px;
    text-align: center;
  }

  .rh-rankings-podium-name a,
  .rh-rankings-podium-name strong {
    max-width: 100%;
    font-size: 12px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .rh-rankings-podium-name small {
    max-width: 100%;
    font-size: 10px;
  }

  .rh-rankings-podium-bar {
    width: 100%;
    min-height: var(--rh-podium-height) !important;
    border-radius: 16px 16px 0 0;
    padding: 13px 5px 0;
    align-items: center;
  }

  .rh-rankings-podium-step-1 .rh-rankings-podium-bar {
    --rh-podium-height: 160px !important;
  }

  .rh-rankings-podium-step-2 .rh-rankings-podium-bar {
    --rh-podium-height: 120px !important;
  }

  .rh-rankings-podium-step-3 .rh-rankings-podium-bar {
    --rh-podium-height: 100px !important;
  }

  .rh-rankings-podium-number {
    font-size: 30px;
  }

  .rh-rankings-podium-bar b {
    margin-top: 8px;
    font-size: 15px;
  }

  .rh-rankings-podium-bar small,
  .rh-rankings-podium-bar em {
    font-size: 9px;
  }

  .rh-rankings-podium-step > .rh-ranking-meter,
  .rh-rankings-podium-meta {
    display: none;
  }

  .rh-rankings-table-card {
    order: 4;
    margin-top: 0;
    border-radius: 20px;
    background: rgba(15, 23, 42, .70);
    border-color: rgba(148, 163, 184, .12);
  }

  .rh-rankings-table-head {
    padding: 15px 14px;
  }

  .rh-rankings-table-head small,
  .rh-rankings-table-head .rh-rankings-real-badge {
    display: none;
  }

  .rh-rankings-table-wrap {
    overflow-x: visible;
  }

  .rh-rankings-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 13px;
  }

  .rh-rankings-table th,
  .rh-rankings-table td {
    padding: 13px 9px;
  }

  .rh-rankings-table th:nth-child(1),
  .rh-rankings-table td:nth-child(1) { width: 42px; }
  .rh-rankings-table th:nth-child(2),
  .rh-rankings-table td:nth-child(2) { width: 62px; }
  .rh-rankings-table th.rh-score-col,
  .rh-rankings-table td.rh-score-col { width: 64px; }

  .rh-rankings-table-avatar,
  .rh-rankings-row-detail,
  .rh-hide-sm,
  .rh-hide-md {
    display: none !important;
  }

  .rh-rankings-table-identity {
    gap: 0;
  }

  .rh-rankings-table-identity a,
  .rh-rankings-table-identity b {
    font-size: 13px;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .rh-rankings-trend-pill {
    min-height: 24px;
    padding: 4px 7px;
    font-size: 10px;
  }

  .rh-score-col strong {
    font-size: 15px;
  }
}

@media (max-width: 380px) {
  .rh-rankings-shell {
    width: min(100% - 12px, 420px);
  }

  .rh-rankings-podium-stage {
    gap: 6px;
  }

  .rh-rankings-podium-avatar {
    width: 50px;
    height: 50px;
  }

  .rh-rankings-podium-step-1 .rh-rankings-podium-avatar {
    width: 56px;
    height: 56px;
  }

  .rh-rankings-table th,
  .rh-rankings-table td {
    padding-left: 7px;
    padding-right: 7px;
  }
}

/* RANK-UI-1.0C-MOBILE-WIDE · Ajuste ancho completo mobile
   Corrección puntual: elimina el max-width tipo preview Lovable en celular y usa el viewport completo.
   No cambia datos, motores, contrato ni estructura visual ya aprobada. */
@media (max-width: 720px) {
  .rh-rankings-shell {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 10px clamp(8px, 2.6vw, 12px) 44px !important;
    box-sizing: border-box;
  }

  .rh-rankings-dynamic-lovable,
  .rh-rankings-lovable-hero,
  .rh-rankings-hero-copy,
  .rh-rankings-entity-tabs,
  .rh-rankings-lovable-filters,
  .rh-rankings-lovable-podium,
  .rh-rankings-table-card {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
  }

  .rh-rankings-podium-stage {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 380px) {
  .rh-rankings-shell {
    width: 100% !important;
    max-width: none !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
  }
}

/* RANK-UI-1.0C-TREND · Indicador visual de cambio de posición
   Replica el comportamiento Lovable de subida/bajada/estabilidad, pero solo muestra
   movimiento real cuando el contrato trae snapshot/rank_delta. Sin snapshot, queda neutral. */
.rh-rankings-trend-pill {
  gap: 4px;
  justify-content: center;
  min-width: 54px;
  border-color: rgba(148, 163, 184, .18);
  background: rgba(148, 163, 184, .08);
  color: #94a3b8;
}

.rh-rankings-trend-icon,
.rh-rankings-trend-count {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.rh-rankings-trend-icon {
  font-size: 14px;
  font-weight: 950;
}

.rh-rankings-trend-count {
  font-size: 11px;
  font-weight: 950;
}

.rh-rankings-trend-pill-up {
  border-color: rgba(52, 211, 153, .34);
  background: rgba(52, 211, 153, .12);
  color: #5eead4;
}

.rh-rankings-trend-pill-down {
  border-color: rgba(248, 113, 113, .34);
  background: rgba(248, 113, 113, .10);
  color: #fb7185;
}

.rh-rankings-trend-pill-same {
  border-color: rgba(148, 163, 184, .22);
  background: rgba(148, 163, 184, .08);
  color: #94a3b8;
}

.rh-rankings-trend-pill-new {
  border-color: rgba(96, 165, 250, .30);
  background: rgba(96, 165, 250, .10);
  color: #93c5fd;
}

.rh-rankings-trend-pill-pending {
  opacity: .86;
}

@media (max-width: 720px) {
  .rh-rankings-table th:nth-child(2),
  .rh-rankings-table td:nth-child(2) {
    width: 68px;
  }

  .rh-rankings-trend-pill {
    min-width: 50px;
    padding: 4px 6px;
    gap: 3px;
  }

  .rh-rankings-trend-icon {
    font-size: 13px;
  }

  .rh-rankings-trend-count {
    font-size: 10px;
  }
}

@media (max-width: 380px) {
  .rh-rankings-table th:nth-child(2),
  .rh-rankings-table td:nth-child(2) {
    width: 62px;
  }
}

/* RANK-UI-1.0D4 · Integraciones públicas perfiles/eventos/resultados */
.rh-rankings-snapshot-strip {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(20, 184, 166, .18);
  border-radius: 22px;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(15, 23, 42, .82), rgba(20, 184, 166, .08));
  box-shadow: 0 18px 48px rgba(2, 6, 23, .22);
}

.rh-rankings-snapshot-strip > div {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.rh-rankings-snapshot-strip span {
  width: 36px;
  height: 36px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  background: rgba(20, 184, 166, .12);
  border: 1px solid rgba(20, 184, 166, .22);
}

.rh-rankings-snapshot-strip b,
.rh-rankings-snapshot-strip small {
  display: block;
}

.rh-rankings-snapshot-strip b {
  color: #f8fafc;
  font-size: 13px;
}

.rh-rankings-snapshot-strip small {
  color: #94a3b8;
  font-size: 11px;
  margin-top: 2px;
}

.rh-rankings-snapshot-strip em,
.rh-rankings-integration-chip,
.rh-rankings-row-integrations a {
  font-style: normal;
  border: 1px solid rgba(34, 211, 238, .20);
  background: rgba(34, 211, 238, .08);
  color: #67e8f9;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.rh-rankings-row-integrations {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.rh-rankings-row-integrations a {
  text-decoration: none;
  padding: 5px 8px;
}

.rh-rankings-row-integrations a:hover {
  border-color: rgba(45, 212, 191, .42);
  color: #ccfbf1;
}

.rh-rankings-integration-chip {
  display: inline-flex;
  align-items: center;
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rh-ranking-integration-panel {
  border-color: rgba(34, 211, 238, .18);
  background: linear-gradient(135deg, rgba(15, 23, 42, .92), rgba(14, 165, 233, .08));
}

.rh-ranking-integration-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.rh-ranking-integration-facts span {
  border-color: rgba(34, 211, 238, .16);
}

@media (max-width: 720px) {
  .rh-rankings-snapshot-strip {
    align-items: flex-start;
    flex-direction: column;
    border-radius: 18px;
    padding: 12px;
  }

  .rh-rankings-snapshot-strip em {
    align-self: flex-start;
  }

  .rh-rankings-row-integrations {
    gap: 5px;
  }

  .rh-rankings-row-integrations a {
    padding: 4px 7px;
    font-size: 10px;
  }
}
