/* ============================================================
   KODACRAFT RANKING — Premium Gaming UI
   Estilo: Glassmorphism · Esports · Dark · Fluid
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --rk-bg:       #05070d;
  --rk-panel:    rgba(10, 14, 24, 0.84);
  --rk-glass:    rgba(255, 255, 255, 0.055);
  --rk-line:     rgba(255, 255, 255, 0.1);
  --rk-line-hi:  rgba(34, 216, 255, 0.28);
  --rk-text:     #eef1fa;
  --rk-muted:    #7a85a0;
  --rk-cyan:     #22d8ff;
  --rk-blue:     #4a78ff;
  --rk-gold:     #ffd94a;
  --rk-silver:   #b8c4d8;
  --rk-bronze:   #cd8f52;
  --rk-shadow:   0 24px 64px rgba(0, 0, 0, 0.42);
  --rk-radius:   28px;
  --rk-ease:     cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Base overrides ─────────────────────────────────────────── */
html { overflow-x: hidden !important; overflow-y: auto !important; height: auto !important; background-color: #05070d !important; }

body {
  color: var(--rk-text);
  background-color: #05070d;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  height: auto !important;
  min-height: 100vh;
}

/* ── Shared container ───────────────────────────────────────── */
.container,
.luxury-layout {
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

nav .container { padding-left: 2rem; padding-right: 2rem; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 0 !important;
  height: auto !important;
  padding: 7.5rem 0 3.5rem !important;
  background: transparent !important;
  position: relative;
  overflow: hidden;
  display: block !important;
}

/* Ambient glows behind hero content */
.hero::before {
  content: '';
  position: absolute;
  inset: -25% -5% auto auto;
  width: 44rem; height: 44rem;
  background: radial-gradient(circle, rgba(34, 216, 255, 0.18), transparent 68%);
  filter: blur(48px);
  pointer-events: none;
  z-index: 0;
}
.hero::after {
  content: '';
  position: absolute;
  inset: auto auto -15% -10%;
  width: 30rem; height: 30rem;
  background: radial-gradient(circle, rgba(74, 120, 255, 0.15), transparent 70%);
  filter: blur(42px);
  pointer-events: none;
  z-index: 0;
}

.hero .container { position: relative; z-index: 2; margin-top: 0 !important; }

/* Live badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(16px);
  color: #c8d8f4;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
  font-weight: 700;
}

.hero > .container > p:not(.hero-subtitle) {
  font-size: 0.95rem;
  color: var(--rk-muted);
  max-width: 580px;
  margin: 0 auto 1.8rem;
}

.hero-subtitle { display: none; }

.live-dot {
  width: 0.65rem; height: 0.65rem;
  border-radius: 50%;
  background: var(--rk-cyan);
  box-shadow: 0 0 0 0 rgba(34, 216, 255, 0.7);
  animation: livePulse 2s infinite;
  flex-shrink: 0;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0   rgba(34, 216, 255, 0.8); }
  70%  { box-shadow: 0 0 0 9px rgba(34, 216, 255, 0); }
  100% { box-shadow: 0 0 0 0   rgba(34, 216, 255, 0); }
}

/* Main title */
.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #fff;
  margin-bottom: 0.5rem;
  text-shadow: none;
}
.hero h1 span {
  color: var(--rk-cyan);
  text-shadow: none;
}

.hero > .container > p:not(.hero-subtitle) {
  font-size: 0.95rem;
  color: var(--rk-muted);
  max-width: 580px;
  margin-bottom: 1.8rem;
}

.hero-subtitle { display: none; }

/* Hero quick-stats grid */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.2rem;
}

.hero-stat-card {
  padding: 1.2rem 1.3rem;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border: 1px solid var(--rk-line);
  box-shadow: var(--rk-shadow);
  backdrop-filter: blur(20px);
  transition: transform 0.28s var(--rk-ease), border-color 0.28s ease, box-shadow 0.28s ease;
}
.hero-stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--rk-line-hi);
  box-shadow: 0 28px 52px rgba(0, 0, 0, 0.3);
}

.hero-stat-label {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--rk-muted);
  margin-bottom: 0.45rem;
  font-weight: 700;
}
.hero-stat-card strong {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--rk-text);
}

/* ============================================================
   LAYOUT WRAPPER
   ============================================================ */
.luxury-layout {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  margin-top: 0;
  margin-bottom: 5rem;
}

/* ============================================================
   SEARCH / TOOLBAR
   ============================================================ */
.ranking-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-shell {
  position: relative;
  width: min(100%, 420px);
  margin-left: auto;
}

.search-shell i {
  position: absolute;
  left: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--rk-muted);
  font-size: 1rem;
  pointer-events: none;
  transition: color 0.25s ease;
}

.search-shell input {
  width: 100%;
  border: 1px solid var(--rk-line);
  background: rgba(255, 255, 255, 0.06);
  color: var(--rk-text);
  padding: 1rem 1.2rem 1rem 3rem;
  border-radius: 999px;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
  backdrop-filter: blur(18px);
  font-size: 0.95rem;
  font-family: inherit;
}
.search-shell input::placeholder { color: #5a6480; }
.search-shell input:focus {
  border-color: rgba(34, 216, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(34, 216, 255, 0.1);
  background: rgba(255, 255, 255, 0.09);
}
.search-shell:focus-within i { color: var(--rk-cyan); }


/* ============================================================
   PODIO
   ============================================================ */
.podium-container {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  margin: 0;
  width: 100%;
  perspective: 1200px;
}

.podium-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 2rem 1.4rem 1.8rem;
  min-height: 360px;
  border-radius: var(--rk-radius);
  border: 1px solid var(--rk-line);
  background: linear-gradient(160deg, rgba(255,255,255,0.08) 0%, rgba(10,14,26,0.92) 100%);
  backdrop-filter: blur(28px);
  box-shadow: var(--rk-shadow);
  overflow: hidden;
  transition: transform 0.32s var(--rk-ease), box-shadow 0.32s ease, border-color 0.32s ease;
  cursor: pointer;
  text-align: center;
}

/* Ambient glow orb inside card */
.podium-card::after {
  content: '';
  position: absolute;
  bottom: -3rem; right: -3rem;
  width: 10rem; height: 10rem;
  background: radial-gradient(circle, rgba(34,216,255,0.18), transparent 70%);
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.podium-card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: 0 40px 80px rgba(0,0,0,0.5);
  border-color: var(--rk-line-hi);
}

/* First place elevated */
.podium-card.first {
  transform: translateY(-14px);
  border-color: rgba(255,255,255,0.18);
  background: linear-gradient(160deg, rgba(34,216,255,0.1) 0%, rgba(10,14,26,0.96) 100%);
  box-shadow: 0 36px 80px rgba(34,216,255,0.14), var(--rk-shadow);
  min-height: 400px;
  z-index: 2;
}
.podium-card.first:hover { transform: translateY(-20px) scale(1.015); }

.podium-card.second { transform: translateY(-5px); }
.podium-card.third  { transform: translateY(-2px); }

/* Crown */
.crown {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 0.2rem;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

/* Avatar ring */
.avatar-ring {
  width: 110px; height: 110px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, rgba(34,216,255,0.8), rgba(74,120,255,0.75));
  box-shadow: 0 0 0 1px rgba(255,255,255,0.14), 0 18px 36px rgba(34,216,255,0.2);
  flex-shrink: 0;
}

/* Larger ring for first place */
.podium-card.first .avatar-ring {
  width: 130px; height: 130px;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.2), 0 24px 48px rgba(34,216,255,0.3);
}

.podium-avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.85);
  image-rendering: pixelated;
}

/* Podium text */
.podium-name {
  font-size: 1.15rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.01em;
  margin-top: 0.2rem;
}
.podium-card.first .podium-name { font-size: 1.35rem; }

.podium-score {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--rk-cyan);
  letter-spacing: -0.02em;
  line-height: 1;
}
.podium-card.first .podium-score { font-size: 1.85rem; }

/* Stats row inside podium card */
.podium-stats-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}
.podium-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}
.podium-stat-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}
.podium-stat-lbl {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--rk-muted);
  font-weight: 700;
}

/* Rank badge inside podium */
.rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #dce7ff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-top: auto;
}

/* VIP badge (corner) */
.vip-badge {
  position: absolute;
  top: 1rem; right: 1rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(34,216,255,0.9), rgba(74,120,255,0.85));
  box-shadow: 0 8px 20px rgba(34,216,255,0.22);
  border: 1px solid rgba(255,255,255,0.2);
  z-index: 10;
  line-height: 1;
}

/* Position number overlay */
.podium-position {
  position: absolute;
  top: 1rem; left: 1.2rem;
  font-size: 2.8rem;
  font-weight: 950;
  color: rgba(255,255,255,0.04);
  line-height: 1;
  letter-spacing: -0.05em;
  user-select: none;
  pointer-events: none;
}

/* Region tag */
.podium-region {
  font-size: 0.78rem;
  color: var(--rk-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}


/* ============================================================
   RANKING BOARD (tabla)
   ============================================================ */
.ranking-board {
  border-radius: var(--rk-radius);
  border: 1px solid var(--rk-line);
  background: var(--rk-panel);
  backdrop-filter: blur(26px);
  box-shadow: var(--rk-shadow);
  overflow: hidden;
  position: relative;
}

/* Subtle gradient line at the top */
.ranking-board::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--rk-cyan), transparent);
  opacity: 0.45;
  pointer-events: none;
}

.ranking-board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem 1.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.02);
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rk-cyan);
  font-weight: 800;
  margin-bottom: 0.3rem;
}

.ranking-board-head h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
}

.ranking-board-meta {
  color: var(--rk-muted);
  font-size: 0.88rem;
  font-weight: 600;
}

/* List container */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0.6rem 0.8rem;
}

/* ── Row card ──────────────────────────────────────────────── */
.ranking-row-card {
  display: grid;
  grid-template-columns: 58px minmax(220px, 1.6fr) repeat(6, minmax(72px, 1fr));
  align-items: center;
  gap: 0.8rem;
  padding: 0.95rem 1.1rem;
  border-radius: 18px;
  border: 1px solid transparent;
  background: transparent;
  transition: background 0.22s ease, border-color 0.22s ease, transform 0.22s var(--rk-ease);
  cursor: pointer;
  position: relative;
}

.ranking-row-card:not(:last-child) {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  border-radius: 0;
}

.ranking-row-card:first-child { border-radius: 16px 16px 0 0; }
.ranking-row-card:last-child  { border-radius: 0 0 16px 16px; }

.ranking-row-card:hover {
  background: rgba(34, 216, 255, 0.04);
  border-color: rgba(34, 216, 255, 0.13) !important;
  transform: translateX(3px);
  border-radius: 18px !important;
}

/* Accent left bar on hover */
.ranking-row-card::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 3px;
  background: linear-gradient(180deg, var(--rk-cyan), var(--rk-blue));
  border-radius: 0 3px 3px 0;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.ranking-row-card:hover::before { opacity: 1; }

/* Rank number pill */
.rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.9rem;
  font-weight: 900;
  color: var(--rk-muted);
}

/* Top-3 rank pills get color */
.ranking-row-card:nth-child(1) .rank-pill { color: var(--rk-gold); border-color: rgba(255,217,74,0.3); background: rgba(255,217,74,0.08); }
.ranking-row-card:nth-child(2) .rank-pill { color: var(--rk-silver); border-color: rgba(184,196,216,0.3); background: rgba(184,196,216,0.06); }
.ranking-row-card:nth-child(3) .rank-pill { color: var(--rk-bronze); border-color: rgba(205,143,82,0.3); background: rgba(205,143,82,0.06); }

/* Player cell */
.player-main {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.player-avatar-wrap {
  flex-shrink: 0;
  width: 44px; height: 44px;
  border-radius: 14px;
  padding: 2px;
  background: linear-gradient(135deg, rgba(34,216,255,0.65), rgba(74,120,255,0.6));
}
.player-avatar-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 12px;
  border: 1.5px solid rgba(255,255,255,0.18);
  image-rendering: pixelated;
  display: block;
}

.player-meta { min-width: 0; display: grid; gap: 0.2rem; }

.player-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.player-name {
  font-weight: 800;
  font-size: 0.97rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-sub {
  color: var(--rk-muted);
  font-size: 0.78rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-weight: 600;
}

/* Metric columns */
.metric-block {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.metric-label {
  font-size: 0.68rem;
  color: var(--rk-muted);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}
.metric-value {
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  white-space: nowrap;
}

/* Table badges */
.table-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid rgba(255,255,255,0.15);
  line-height: 1.4;
  flex-shrink: 0;
}

/* Empty / loading states */
.empty-card,
.loading-card {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--rk-muted);
  font-size: 1rem;
  font-weight: 600;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--rk-line);
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: all 0.25s var(--rk-ease);
  font-family: inherit;
}
.page-btn:hover:not(:disabled) {
  border-color: var(--rk-line-hi);
  background: rgba(34,216,255,0.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(34,216,255,0.12);
}
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.page-info {
  color: var(--rk-muted);
  font-weight: 800;
  font-size: 0.88rem;
  padding: 0.6rem 1.1rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--rk-line);
}


/* ============================================================
   MODAL
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(3, 6, 14, 0.82);
  backdrop-filter: blur(22px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 2000;
}
.modal.active {
  opacity: 1;
  pointer-events: auto;
}
.modal.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-content {
  position: relative;
  width: min(1100px, 100%);
  max-height: 92vh;
  display: grid;
  grid-template-columns: minmax(300px, 340px) 1fr;
  gap: 1.4rem;
  padding: 1.4rem;
  border-radius: 34px;
  background: linear-gradient(150deg, rgba(14, 20, 34, 0.97), rgba(8, 11, 22, 0.98));
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 40px 100px rgba(0,0,0,0.55), 0 0 80px rgba(34,216,255,0.06);
  overflow: hidden;
  transform: scale(0.93) translateY(16px);
  transition: transform 0.4s var(--rk-ease);
}

/* Top glow line */
.modal-content::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, var(--rk-cyan) 40%, var(--rk-blue) 60%, transparent 95%);
  opacity: 0.5;
  pointer-events: none;
}

/* Close button */
.close-modal {
  position: absolute;
  top: 1.1rem; right: 1.1rem;
  width: 2.4rem; height: 2.4rem;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.07);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.22s ease, transform 0.22s ease;
  z-index: 10;
  font-family: inherit;
}
.close-modal:hover {
  background: #ef4444;
  transform: rotate(90deg) scale(1.1);
  border-color: transparent;
}

/* Left column */
.modal-side,
.modal-left {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.skin-shell,
#skin-container {
  min-height: 400px;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.1);
  background: radial-gradient(circle at 50% 40%, rgba(34,216,255,0.06), rgba(0,0,0,0.5) 70%);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.skin-shell canvas, #skin-container canvas { display: block; width: 100% !important; height: 100% !important; }

.modal-identity {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.15rem 0.2rem;
}

#modal-name,
.modal-name {
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  word-break: break-word;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

#modal-rank,
.modal-rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: #dce7ff;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Right column */
.modal-main,
.modal-right {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  overflow-y: auto;
  max-height: calc(92vh - 3rem);
  scrollbar-width: thin;
  scrollbar-color: rgba(34,216,255,0.3) transparent;
}
.modal-main::-webkit-scrollbar { width: 4px; }
.modal-main::-webkit-scrollbar-thumb { background: rgba(34,216,255,0.3); border-radius: 99px; }

.modal-header-row,
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.modal-action-btn {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, rgba(34,216,255,0.22), rgba(74,120,255,0.2));
  border: 1px solid rgba(34,216,255,0.3);
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: 0.06em;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.modal-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(34,216,255,0.18);
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.stat-box {
  padding: 0.9rem 0.85rem;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  text-align: center;
  transition: border-color 0.22s ease, transform 0.22s var(--rk-ease);
}
.stat-box:hover {
  border-color: rgba(34,216,255,0.22);
  transform: translateY(-3px);
}

.stat-icon { font-size: 1.2rem; }
.stat-label {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--rk-muted);
  font-weight: 700;
}
.stat-value {
  font-size: 1.05rem;
  font-weight: 900;
  color: #fff;
}

/* Icon color helpers */
.i-elo    { color: #38bdf8; }
.i-wins   { color: #fbbf24; }
.i-kills  { color: #f87171; }
.i-streak { color: #c084fc; }
.i-rate   { color: #4ade80; }
.i-generic{ color: #94a3b8; }

/* Insights row */
.modal-insights {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 0.8rem;
}

.insight-card {
  padding: 1.1rem;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
}

.insight-title {
  color: #fff;
  font-weight: 800;
  font-size: 0.88rem;
  margin-bottom: 0.9rem;
  letter-spacing: 0.02em;
}

/* Bar chart */
.bar-chart { display: grid; gap: 0.7rem; }

.bar-row {
  display: grid;
  grid-template-columns: 78px 1fr 46px;
  gap: 0.6rem;
  align-items: center;
  color: #c8d4ee;
  font-size: 0.82rem;
  font-weight: 600;
}

.bar-track {
  height: 0.55rem;
  background: rgba(255,255,255,0.08);
  border-radius: 999px;
  overflow: hidden;
}
.bar-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--rk-cyan), var(--rk-blue));
  border-radius: inherit;
  transition: width 0.8s var(--rk-ease);
}
.bar-row strong { color: #fff; font-weight: 800; }

/* Recent battles */
.recent-battles { display: grid; gap: 0.55rem; }

.battle-pill {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.07);
  color: #b0bcda;
  font-size: 0.82rem;
  font-weight: 600;
  gap: 0.5rem;
}
.battle-pill strong { color: #fff; font-weight: 800; }

/* Badge wrapper */
.badge-wrapper { display: inline-flex; overflow: hidden; border-radius: 999px; }

.shine-effect { position: relative; overflow: hidden; }
.shine-effect::after {
  content: '';
  position: absolute;
  top: -50%; left: -100%;
  width: 50%; height: 200%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.35) 50%, rgba(255,255,255,0) 100%);
  transform: rotate(25deg);
  animation: badgeShine 2.5s infinite;
}
@keyframes badgeShine {
  0%   { left: -100%; }
  20%  { left: 150%; }
  100% { left: 150%; }
}


/* ============================================================
   RANK BADGE COLORS (ELO tiers)
   ============================================================ */
.r-cobre       { background: linear-gradient(135deg, #8f5a2a, #c17a3f); color: #fff; }
.r-hierro      { background: linear-gradient(135deg, #7f8489, #d9dde2); color: #000; }
.r-lapislazuli { background: linear-gradient(135deg, #2d5bd1, #6ea8ff); color: #fff; }
.r-oro         { background: linear-gradient(135deg, #d99a00, #ffe066); color: #000; }
.r-redstone    { background: linear-gradient(135deg, #8a0000, #ff4d4d); color: #fff; }
.r-esmeralda   { background: linear-gradient(135deg, #00a86b, #5cffb2); color: #000; }
.r-diamante    { background: linear-gradient(135deg, #32d6d6, #b6ffff); color: #000; }
.r-obsidiana   { background: linear-gradient(135deg, #2c1b47, #6d4db3); color: #fff; }
.r-netherita   { background: linear-gradient(135deg, #4b3a3a, #8c6a6a); color: #fff; border: 1px solid rgba(255,255,255,0.2); }

/* Badge colors (table/modal) */
.b-vip     { background: linear-gradient(135deg, #00f3ff, #0077ff) !important; color: #fff !important; }
.b-mod     { background: linear-gradient(135deg, #3366ff, #00008b) !important; color: #fff !important; }
.b-staff   { background: linear-gradient(135deg, #ffd700, #ffae00) !important; color: #000 !important; }
.b-admin   { background: linear-gradient(135deg, #ff4d4d, #8a0000) !important; color: #fff !important; }
.b-helper  { background: #ffcc00 !important; color: #000 !important; }
.b-partner { background: linear-gradient(135deg, #ffd700, #b8860b) !important; color: #000 !important; }
.b-prime   { background: linear-gradient(90deg, #ff4e00, #ff8c00) !important; color: #fff !important; box-shadow: 0 0 14px rgba(255,78,0,0.5); }
.b-hacker  { background: linear-gradient(135deg, #004d00, #001a00) !important; color: #00ff00 !important; border: 1px solid #00ff00 !important; font-family: 'Courier New', monospace; }
.b-rose    { background: linear-gradient(90deg, #ff007f, #8b00ff, #ff007f) !important; background-size: 200% 100% !important; color: #fff !important; animation: roseBadgeShimmer 2s linear infinite; box-shadow: 0 0 12px rgba(255,0,127,0.5); }
.b-reina   { background: linear-gradient(135deg, #ff69b4, #ffb6c1) !important; color: #fff !important; }
.b-auramorada { background: linear-gradient(90deg, #bf00ff, #7a00a3) !important; color: #fff !important; }
.b-aurablanca { background: linear-gradient(90deg, #fff, #dcdcdc) !important; color: #000 !important; }
.b-kaisen  { background: linear-gradient(135deg, #00ffff, #ff0000) !important; color: #fff !important; text-shadow: 0 0 5px #000; }
.b-zerotwo { background: linear-gradient(135deg, #ff4db8, #ff0000) !important; color: #fff !important; animation: zerotwoBadgeGlow 2s ease-in-out infinite; }

@keyframes roseBadgeShimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@keyframes zerotwoBadgeGlow {
  0%, 100% { filter: brightness(1); }
  50%       { filter: brightness(1.3); }
}

/* ============================================================
   SPECIAL PLAYER THEMES — Row colors
   ============================================================ */
.vip-row        .player-name { color: #00f3ff !important; }
.staff-row      .player-name { color: #ffd700 !important; }
.mod-row        .player-name { color: #3366ff !important; }
.admin-row      .player-name { color: #ff4d4d !important; }
.helper-row     .player-name { color: #ffcc00 !important; }
.prime-row      .player-name { color: #ff4e00 !important; }
.hacker-row     .player-name { color: #00ff00 !important; font-family: 'Courier New', monospace; }
.rose-row       .player-name { color: #ff007f !important; text-shadow: 0 0 8px rgba(255,0,127,0.5); animation: roseNamePulse 3s ease-in-out infinite; }
.auramorada-row .player-name { color: #bf00ff !important; }
.aurablanca-row .player-name { color: #ffffff !important; }
.kaisen-row     .player-name { color: #ffffff !important; text-shadow: 0 0 10px #00ffff; }
.zerotwo-row    .player-name { color: #ff4db8 !important; }
.reina-row      .player-name { color: #ff69b4 !important; }
.partner-row    .player-name { color: #ffd700 !important; }

@keyframes roseNamePulse {
  0%, 100% { text-shadow: 0 0 8px rgba(255,0,127,0.4); }
  50%       { text-shadow: 0 0 16px rgba(255,0,127,0.9), 0 0 30px rgba(139,0,255,0.4); }
}

/* ============================================================
   MATRIX / FIRE CANVASES (special modal effects)
   ============================================================ */
#matrix-canvas, #fire-canvas {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
}
#matrix-canvas { opacity: 0.3; }
#fire-canvas   { opacity: 0.55; z-index: 1; }

.skin-scanner {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 2px;
  background: rgba(0,255,0,0.6);
  box-shadow: 0 0 14px #00ff00;
  z-index: 5;
  animation: hackerScan 3s linear infinite;
  pointer-events: none;
}
@keyframes hackerScan {
  0%   { top: 0; }
  100% { top: 100%; }
}

.hacker-console {
  position: absolute;
  bottom: 10px; left: 10px;
  font-family: 'Courier New', monospace;
  font-size: 0.62rem;
  color: #00ff00;
  opacity: 0.8;
  z-index: 5;
  text-shadow: 0 0 5px #00ff00;
  line-height: 1.25;
  background: rgba(0,0,0,0.42);
  padding: 5px 8px;
  border-left: 2px solid #00ff00;
  pointer-events: none;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 1024px) {
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ranking-row-card {
    grid-template-columns: 52px minmax(180px, 1.4fr) repeat(3, minmax(72px, 1fr));
  }

  /* Hide last 3 metrics on tablet */
  .ranking-row-card .metric-block:nth-child(n+7) { display: none; }

  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .modal-insights { grid-template-columns: 1fr; }
}

/* Mobile */
@media (max-width: 768px) {
  .hero { padding-top: 6rem !important; }

  .hero h1 { font-size: clamp(2.2rem, 8vw, 3.2rem); }

  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }

  .ranking-toolbar { flex-direction: column; align-items: stretch; }
  .search-shell { width: 100%; max-width: 100%; }

  /* Podium: stack vertically, first on top */
  .podium-container {
    grid-template-columns: 1fr;
    max-width: 360px;
    margin-inline: auto;
  }
  .podium-card {
    min-height: 0 !important;
    padding: 1.6rem 1.2rem !important;
    transform: none !important;
  }
  .podium-card.first {
    order: -1;
    border-color: rgba(34,216,255,0.25);
  }

  /* Table rows: simplified on mobile */
  .ranking-row-card {
    grid-template-columns: 46px 1fr;
    gap: 0.6rem;
    padding: 0.85rem 0.9rem;
  }
  .ranking-row-card .metric-block { display: none; }
  .ranking-row-card .metric-block:nth-child(3) {
    display: flex;
    grid-column: 2;
  }

  /* Modal */
  .modal { padding: 0.75rem; align-items: flex-end; }
  .modal-content {
    grid-template-columns: 1fr !important;
    border-radius: 28px 28px 20px 20px;
    max-height: 95vh;
    overflow-y: auto;
    padding: 1.1rem;
    gap: 1rem;
  }
  #skin-container, .skin-shell { min-height: 260px !important; }
  .modal-name, #modal-name { font-size: 1.3rem !important; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .modal-insights { grid-template-columns: 1fr; }

  .pagination-container { flex-direction: column; gap: 0.75rem; }

  .ranking-board-head { flex-direction: column; gap: 0.5rem; }
}

/* Very small */
@media (max-width: 420px) {
  .hero-stats { grid-template-columns: 1fr 1fr; gap: 0.6rem; }
  .hero-stat-card { padding: 0.9rem 0.8rem; }
  .hero-stat-card strong { font-size: 1.05rem; }
  .podium-score { font-size: 1.25rem !important; }
  .podium-card.first .podium-score { font-size: 1.5rem !important; }
}

/* Scrollbar in modal */
.modal-content::-webkit-scrollbar { width: 4px; }
.modal-content::-webkit-scrollbar-thumb { background: rgba(34,216,255,0.3); border-radius: 99px; }
