/* ============================================================
   rank-table.css — Tabla de ranking + modal <ranking-panel>.
   Todo esto vive únicamente en la landing (index.html): el ranking
   ya no es accesible desde dentro de la partida (visible.html /
   blind.html) — se centralizó aquí como vista propia.
   ============================================================ */
.rank-table { background: var(--surface); border: 1px solid var(--border); clip-path: var(--cut); transition: opacity 0.15s ease; }
.rank-table.loading { opacity: 0.35; }
.rank-table .row { display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 14px; padding: 14px 22px; border-bottom: 1px solid var(--border); font-size: 0.94rem; }
.rank-table .row:last-child { border-bottom: none; }
.rank-table .row.head { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.rank-table .pos { font-family: var(--font-display); font-weight: 700; color: var(--muted); }
.rank-table .row:nth-child(2) .pos { color: var(--cyan); text-shadow: 0 0 10px rgba(0,229,255,0.5); }
.rank-table .lvl { font-family: var(--font-mono); color: var(--text); }
.rank-table .row.you { background: linear-gradient(90deg, rgba(191,90,242,0.12), transparent); border-left: 2px solid var(--violet); }
.rank-table .row.you .nick { color: var(--violet); }
.rank-table .row.you .pos { color: var(--violet); text-shadow: 0 0 10px rgba(191,90,242,0.5); }

/* ============================================================
   Teaser compacto en la landing (top 1 por modo + botón al modal)
   ============================================================ */
.rank-teaser {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px 24px;
  background:
    linear-gradient(120deg, rgba(191,90,242,0.06), transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--violet);
  clip-path: var(--cut);
}
.rank-teaser-stats { display: flex; gap: 34px; flex-wrap: wrap; }
.rank-teaser-stat { display: flex; flex-direction: column; gap: 3px; }
.rank-teaser-top {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  line-height: 1.15;
  color: var(--violet);
  text-shadow: 0 0 14px rgba(191,90,242,0.35);
}
.rank-teaser-top i { font-style: normal; font-size: 0.82rem; color: var(--muted); text-shadow: none; margin-left: 4px; }
.rank-teaser-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.rank-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  color: var(--bg);
  background: var(--violet);
  border: none;
  padding: 13px 22px;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  box-shadow: 0 0 20px -6px var(--violet);
  transition: transform 0.14s ease, filter 0.16s ease, box-shadow 0.2s ease;
}
.rank-cta svg { width: 16px; height: 16px; transition: transform 0.16s ease; }
.rank-cta:hover { transform: translateY(-2px); filter: brightness(1.08); box-shadow: 0 0 26px -4px var(--violet); }
.rank-cta:hover svg { transform: translateX(3px); }
.rank-cta:active { transform: translateY(0); }

@media (max-width: 560px) {
  .rank-teaser { flex-direction: column; align-items: stretch; }
  .rank-teaser-stats { justify-content: space-around; gap: 18px; }
  .rank-cta { justify-content: center; }
}

/* ============================================================
   Modal <ranking-panel> — mismo lenguaje visual que <missions-panel>
   ============================================================ */
.rank-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8,8,16,0.78);
  backdrop-filter: blur(7px);
  animation: rankFade 0.22s ease;
}
.rank-overlay[hidden] { display: none; }
@keyframes rankFade { from { opacity: 0; } to { opacity: 1; } }

.rank-modal {
  width: min(520px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  background:
    linear-gradient(180deg, rgba(191,90,242,0.06), transparent 140px),
    rgba(15,15,26,0.98);
  border: 1px solid var(--border);
  border-left: 2px solid var(--violet);
  clip-path: var(--cut);
  padding: 22px 22px 24px 26px;
  overflow-y: auto;
  overscroll-behavior: contain; /* al llegar al final del scroll, no arrastra el scroll de la landing detrás */
  animation: rankRise 0.28s cubic-bezier(0.2, 0.9, 0.2, 1);
}
@keyframes rankRise { from { opacity: 0; transform: translateY(16px) scale(0.99); } to { opacity: 1; transform: none; } }

.rank-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rank-titles { display: flex; flex-direction: column; gap: 2px; }
.rank-title { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; letter-spacing: 0.02em; color: var(--text); margin: 0; }

.rank-tabs { display: flex; gap: 6px; margin-left: auto; }
.rank-tab {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(8,8,16,0.5);
  border: 1px solid var(--border);
  padding: 7px 14px;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.rank-tab:hover { color: var(--text); }
.rank-tab.active {
  color: var(--bg);
  background: var(--violet);
  border-color: var(--violet);
  box-shadow: 0 0 14px -4px var(--violet);
}

.rank-you-line {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  color: var(--text);
  text-align: center;
  margin: 0;
}
.rank-you-line[hidden] { display: none; }
.rank-you-line b { color: var(--violet); }

@media (max-width: 560px) {
  .rank-modal { padding: 18px 14px 18px 18px; }
  .rank-head { flex-direction: column; align-items: stretch; }
  .rank-tabs { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .rank-overlay, .rank-modal { animation: none; }
  .rank-table { transition: none; }
}
