/* =========================================================
   klaskranking.com — Leaderboard
   ========================================================= */

:root {
  --page: #eceff4;
  --shell: #fbfcfd;
  --surface: #ffffff;
  --ink: #0d1626;
  --ink-2: #2a3446;
  --muted: #576072;
  --muted-2: #687284;
  --line: #e5e8ee;
  --line-soft: #eef0f4;
  --head: #f5f6f9;
  --navy: #13213b;

  /* Medals */
  --gold: #d29b1e;
  --gold-ink: #b98510;
  --gold-bg: linear-gradient(135deg, #fffaf0 0%, #fdf0cf 100%);
  --gold-line: #efd08a;
  --gold-row: #fdf3da;

  --silver: #8d96a4;
  --silver-ink: #7d8694;
  --silver-bg: linear-gradient(135deg, #fbfcfd 0%, #eef1f5 100%);
  --silver-line: #d8dde5;
  --silver-row: #eef1f6;

  --bronze: #b65b2c;
  --bronze-ink: #ae5426;
  --bronze-bg: linear-gradient(135deg, #fdf3ec 0%, #f8e2d4 100%);
  --bronze-line: #e7b597;
  --bronze-row: #fbe9df;

  --c-int: #2f5bd3;
  --c-nat: #d29b1e;
  --c-loc: #24998a;
  --c-kls: #13213b;

  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Inter Tight", "Inter", system-ui, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "tnum" 0;
}

a { color: inherit; }
button, input, select { font: inherit; color: inherit; }

[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Shell ---------- */
.shell {
  max-width: 1400px;
  margin: 20px auto;
  background: var(--shell);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(16, 26, 44, .04), 0 24px 70px -20px rgba(16, 26, 44, .14);
  overflow: hidden;
  position: relative;
}

/* ---------- Top bar ---------- */
.topbar {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  height: 78px;
  padding: 0 40px 0 42px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(251, 252, 253, .9);
  backdrop-filter: blur(8px);
}

.logo {
  font-family: var(--font);
  font-size: 27px;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: #344360;
  font-weight: 400;
  margin-right: 70px;
}
.logo { display: inline-flex; align-items: center; gap: 12px; }
.logo b { color: var(--ink); font-weight: 700; }
.logo__ika {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  box-shadow: 0 4px 12px -4px rgba(210, 155, 30, .55);
  transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
@media (hover: hover) and (pointer: fine) {
  .logo:hover .logo__ika { transform: rotate(-12deg) scale(1.06); }
}

.nav { display: flex; gap: 58px; height: 100%; }
.nav__link {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  text-decoration: none;
  color: var(--muted);
  font-size: 15px;
  transition: color .2s;
}
.nav__link:hover { color: var(--ink); }
.nav__link.is-active { color: var(--ink); font-weight: 500; }
.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: #c9cfd9; box-shadow: 0 0 0 4px rgba(19, 33, 59, .06); }
.search svg { width: 19px; height: 19px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 14.5px; }
.search input::placeholder { color: var(--muted-2); }

.account {
  width: 54px;
  height: 43px;
  border: 0;
  border-radius: 9px;
  background: var(--navy);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 6px 14px -6px rgba(19, 33, 59, .6);
  transition: transform .15s, background .2s;
}
.account:hover { background: #1c2d4d; }
.account:active { transform: scale(.96); }
.account svg { width: 20px; height: 20px; fill: none; stroke: rgba(255,255,255,.75); stroke-width: 1.8; stroke-linecap: round; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 246px;
  padding: 44px 42px 40px;
}

.hero__media {
  position: absolute;
  top: 0;
  right: 0;
  width: 63%;
  height: calc(100% + 70px);
  z-index: 0;
  -webkit-mask-image:
    linear-gradient(90deg, transparent 0%, rgba(0,0,0,.35) 18%, #000 48%),
    linear-gradient(180deg, #000 55%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(90deg, transparent 0%, rgba(0,0,0,.35) 18%, #000 48%),
    linear-gradient(180deg, #000 55%, transparent 100%);
  mask-composite: intersect;
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 18% 8%;
  filter: saturate(.42) brightness(1.18) contrast(.86);
  transform: scale(1);
  animation: heroIn 1.6s cubic-bezier(.2, .7, .2, 1) both;
}
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(240, 244, 250, .38), rgba(240, 244, 250, .18));
}
@keyframes heroIn {
  from { opacity: 0; transform: scale(1.1); }
  to   { opacity: 1; transform: scale(1); }
}

.hero__text { position: relative; z-index: 1; max-width: 560px; }

.eyebrow {
  margin: 0 0 22px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: #3e4757;
}

.hero__title {
  margin: 0 0 22px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 78px;
  line-height: .92;
  letter-spacing: -0.045em;
  color: #0a1222;
}

.hero__lead {
  margin: 0;
  font-size: 18.5px;
  line-height: 1.5;
  color: var(--muted);
}

.hero__tagline {
  position: absolute;
  z-index: 1;
  right: 26px;
  top: 136px;
  margin: 0;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.75;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: #4a5465;
}
.hero__tagline::after {
  content: "";
  display: block;
  width: 50px;
  height: 1px;
  margin-top: 14px;
  background: #8a93a2;
}

/* ---------- Board ---------- */
.board {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 534px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 0 18px 24px 20px;
}

/* ---------- Podium cards ---------- */
.podium { display: grid; gap: 20px; }

.pod {
  position: relative;
  padding: 22px 20px 16px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-left-width: 3px;
  background: var(--surface);
  opacity: 0;
  transform: translateY(14px);
  animation: rise .7s cubic-bezier(.2, .7, .2, 1) forwards;
  transition: box-shadow .25s, transform .25s;
}
.pod:nth-child(2) { animation-delay: .08s; }
.pod:nth-child(3) { animation-delay: .16s; }
.pod { cursor: pointer; }
.pod:hover { transform: translateY(-2px); }
.pod:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }

.pod--1 { background: var(--gold-bg); border-color: var(--gold-line); box-shadow: 0 14px 34px -18px rgba(210, 155, 30, .55); --medal: var(--gold); --medal-ink: var(--gold-ink); }
.pod--2 { background: var(--silver-bg); border-color: var(--silver-line); box-shadow: 0 14px 34px -20px rgba(70, 85, 110, .35); --medal: var(--silver); --medal-ink: var(--silver-ink); }
.pod--3 { background: var(--bronze-bg); border-color: var(--bronze-line); box-shadow: 0 14px 34px -18px rgba(182, 91, 44, .4); --medal: var(--bronze); --medal-ink: var(--bronze-ink); }

@keyframes rise { to { opacity: 1; transform: none; } }

.pod__head {
  display: grid;
  grid-template-columns: 40px 106px minmax(0, 1fr) 138px;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(13, 22, 38, .08);
}

.pod__rank {
  position: relative;
  font-family: var(--display);
  font-weight: 800;
  font-size: 56px;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--medal);
  text-align: center;
}
.pod__crown {
  position: absolute;
  left: 50%;
  top: -27px;
  width: 28px;
  transform: translateX(-50%);
  fill: var(--gold);
}

.avatar {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(120% 120% at 30% 20%, #2b3b5c 0%, #121c30 70%);
  color: #fff;
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -0.02em;
  user-select: none;
}
.pod .avatar {
  width: 106px;
  height: 106px;
  font-size: 34px;
  border: 4px solid #fff;
  box-shadow: 0 10px 24px -10px rgba(13, 22, 38, .55), 0 0 0 1px rgba(13, 22, 38, .06);
  color: var(--medal);
}
.pod--1 .avatar { color: #f4c24f; }
.pod--2 .avatar { color: #d7dde6; }
.pod--3 .avatar { color: #e79a6c; }

.pod__id { min-width: 0; }
.pod__name {
  margin: 0 0 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 27px;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.pod__name--sm { font-size: 23px; }
.pod__name--xs { font-size: 19px; }
.pod__country {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 14.5px;
  color: var(--ink-2);
}
.pod__team {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pod__score {
  position: relative;
  display: grid;
  place-items: center;
  width: 138px;
  height: 84px;
  text-align: center;
}
.pod__score .laurel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--medal);
  opacity: .9;
}
.pod__score strong {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 32px;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--medal-ink);
  font-variant-numeric: tabular-nums;
}
.pod__score strong.is-long { font-size: 24px; }
.pod__score span {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--medal-ink);
}
.pod--2 .pod__score strong { color: #5e6774; }
.pod--2 .pod__score span { color: var(--muted); }

.pod__stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding-top: 14px;
}
.pod__stat {
  text-align: center;
  padding: 0 6px;
}
.pod__stat + .pod__stat { border-left: 1px solid rgba(13, 22, 38, .08); }
.pod__stat b {
  display: block;
  font-size: 17.5px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.pod__stat span { display: block; margin-top: 2px; font-size: 13.5px; color: var(--muted); }

/* ---------- Flags ---------- */
.flag {
  width: 26px;
  height: 18px;
  flex: none;
  border-radius: 2px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(13, 22, 38, .08);
  background: var(--line-soft);
}

/* ---------- Table card ---------- */
.table-card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 22px 20px 18px;
  box-shadow: 0 1px 2px rgba(16, 26, 44, .03), 0 18px 40px -26px rgba(16, 26, 44, .25);
  opacity: 0;
  animation: rise .7s .12s cubic-bezier(.2, .7, .2, 1) forwards;
  transform: translateY(14px);
}

.table-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 0 6px;
}
.table-card__head h2 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 31px;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.table-card__head p { margin: 0; color: var(--muted); font-size: 15.5px; }

/* Selects */
.select {
  position: relative;
  display: inline-flex;
}
.select::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid var(--ink-2);
  border-bottom: 1.6px solid var(--ink-2);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.select select {
  appearance: none;
  -webkit-appearance: none;
  height: 36px;
  padding: 0 38px 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.select select:hover { border-color: #cfd5de; }
.select select:focus-visible { outline: 0; border-color: #b8c0cc; box-shadow: 0 0 0 4px rgba(19, 33, 59, .07); }
.select--lg select { height: 42px; min-width: 164px; font-size: 14.5px; padding-left: 15px; }
.select--lg::after { right: 18px; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 6px 14px;
}
.toolbar__count { margin-left: auto; font-size: 13px; color: var(--muted-2); }

/* Table */
.table-wrap { overflow-x: auto; }

.ranking {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.ranking thead th {
  height: 56px;
  padding: 0 10px;
  background: var(--head);
  font-size: 13.5px;
  font-weight: 400;
  color: var(--muted);
  text-align: center;
  line-height: 1.25;
}
.ranking thead th:first-child { border-radius: 9px 0 0 9px; }
.ranking thead th:last-child { border-radius: 0 9px 9px 0; }
.ranking thead th.c-player { text-align: left; }

.ranking th button {
  border: 0;
  background: none;
  padding: 4px 0;
  cursor: pointer;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-align: inherit;
}
.ranking th button:hover { color: var(--ink); }
.ranking th button.is-sorted::after {
  content: "";
  border-left: 4.5px solid transparent;
  border-right: 4.5px solid transparent;
  border-top: 5.5px solid var(--ink);
}
.ranking th button.is-asc::after { transform: rotate(180deg); }
.ranking th button.is-sorted { color: var(--ink); }

.ranking td {
  height: 43px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
  font-size: 15px;
  color: var(--ink-2);
  white-space: nowrap;
}
.ranking tbody tr { animation: rowIn .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } }

.ranking tbody tr { cursor: pointer; }
.ranking tbody tr:hover td { background: #f8f9fb; }
.ranking tbody tr:hover td.c-player { text-decoration: underline; text-decoration-color: #c3c9d3; text-underline-offset: 3px; }
.ranking tbody tr:focus-visible { outline: 2px solid var(--navy); outline-offset: -2px; }

.c-rank { width: 46px; }
.ranking td.c-rank { font-size: 15px; color: var(--ink-2); }
.ranking td.c-player {
  text-align: left;
  color: var(--ink);
  font-size: 15.5px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.c-player small {
  display: block;
  margin-top: -2px;
  font-size: 11.5px;
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
}
.c-nat { width: 92px; }
.ranking td.c-nat { text-align: left; }
.nat { display: inline-flex; align-items: center; gap: 9px; font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }
.nat .flag { width: 24px; height: 16px; }

.ranking td.c-total {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.ranking td.is-zero { color: #b7bdc7; }

/* Top-3 highlighted rows */
.ranking tr.is-top td { border-bottom: 4px solid var(--surface); }
.ranking tr.is-top td:first-child { border-radius: 9px 0 0 9px; }
.ranking tr.is-top td:last-child { border-radius: 0 9px 9px 0; }
.ranking tr.is-top td.c-player { font-weight: 600; }
.ranking tr.top-1 td, .ranking tr.top-1:hover td { background: var(--gold-row); }
.ranking tr.top-2 td, .ranking tr.top-2:hover td { background: var(--silver-row); }
.ranking tr.top-3 td, .ranking tr.top-3:hover td { background: var(--bronze-row); }
.ranking tr.top-3 td.c-rank { color: #8f3f17; font-weight: 600; }
.ranking tr.is-top + tr:not(.is-top) td { border-top: 0; }

.empty { margin: 32px 0; text-align: center; color: var(--muted); }

.table-card__foot { display: flex; justify-content: center; padding-top: 16px; }
.table-card__foot:empty, .table-card__foot[hidden] { display: none; }
.more {
  height: 40px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.more:hover { background: var(--head); border-color: #d6dbe3; }

/* ---------- Footer ---------- */
.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  padding: 16px 42px 22px;
  font-size: 12px;
  color: var(--muted-2);
}
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  padding: 11px 18px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 50;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .logo { margin-right: 24px; }
  .nav { gap: 32px; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .podium { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pod__head { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .pod__rank { position: absolute; left: 20px; top: 34px; font-size: 44px; }
  .pod__crown { top: -22px; width: 24px; }
  .pod__country { justify-content: center; }
  .pod__score { margin-top: 4px; }
  .pod__stat span { font-size: 12px; }
}

@media (max-width: 900px) {
  .shell { margin: 0; border-radius: 0; }
  .topbar { grid-template-columns: 1fr; height: auto; padding: 14px 16px 0; row-gap: 6px; }
  .logo { font-size: 23px; margin: 0; gap: 9px; }
  .logo__ika { width: 30px; height: 30px; }
  .account { width: 44px; height: 40px; }
  .nav { grid-column: 1 / -1; order: 4; gap: 26px; height: 46px; overflow-x: auto; scrollbar-width: none; }
  .hero { padding: 30px 16px 26px; min-height: 0; }
  .hero__media { width: 100%; opacity: .55; }
  .hero__title { font-size: 56px; }
  .hero__lead { font-size: 16px; }
  .hero__lead br { display: none; }
  .hero__tagline { display: none; }
  .board { padding: 0 12px 18px; }
  .podium { grid-template-columns: 1fr; }
  .pod__head { grid-template-columns: 34px 76px minmax(0, 1fr) 104px; justify-items: stretch; text-align: left; }
  .pod__rank { position: relative; left: auto; top: auto; font-size: 40px; }
  .pod .avatar { width: 76px; height: 76px; font-size: 25px; border-width: 3px; }
  .pod__name { font-size: 21px; }
  .pod__country { justify-content: flex-start; }
  .pod__score { width: 104px; height: 70px; }
  .pod__score strong { font-size: 25px; }
  .pod__score strong.is-long { font-size: 20px; }
  .table-card { padding: 18px 10px 14px; }
  .table-card__head { flex-direction: column; }
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .toolbar .select, .toolbar .select select { width: 100%; min-width: 0; }
  .toolbar__count { grid-column: 1 / -1; margin-left: 0; }
  .toolbar #country-wrap[hidden] + .select { grid-column: 1 / -1; }
  .c-pts { display: none; }
  .foot { padding: 14px 16px 20px; }
}

@media (max-width: 520px) {
  .logo { font-size: 20px; }
  .hero__title { font-size: 46px; }
  .pod { padding: 16px 14px 12px; }
  .pod__head { grid-template-columns: 26px 58px minmax(0, 1fr) 84px; gap: 8px; }
  .pod__rank { font-size: 32px; }
  .pod__crown { width: 20px; top: -18px; }
  .pod .avatar { width: 58px; height: 58px; font-size: 20px; }
  .pod__name { font-size: 17px; }
  .pod__country { font-size: 13px; gap: 7px; }
  .pod__team { display: none; }
  .pod__score { width: 84px; height: 58px; }
  .pod__score strong { font-size: 20px; }
  .pod__score strong.is-long { font-size: 16px; }
  .pod__score span { font-size: 10px; }
  .pod__stat b { font-size: 15px; }
  .pod__stat span { font-size: 11px; }
  .c-nat { width: 70px; }
  .ranking td.c-player { max-width: 150px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* Por debajo de 1240px el podio empuja la tabla hacia abajo: se oculta (movil incluido) */
@media (max-width: 1240px) {
  .board .podium { display: none; }
}

/* ---------- Boton + popup "How ranking points work" ---------- */
.pts-open {
  position: absolute;
  z-index: 2;
  right: 26px;
  top: 26px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px -14px rgba(13, 22, 38, .5);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.pts-open:hover { background: #fff; transform: translateY(-1px); }
.pts-open:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; }
.pts-open span { color: var(--gold-ink); transition: transform .2s; }
.pts-open:hover span { transform: translateX(3px); }

.pts-dialog .ph__inner { width: min(720px, 100%); }
.pts { padding: 36px 40px 30px; font-size: 14.5px; color: var(--ink-2); }
.pts .eyebrow { margin-bottom: 10px; }
.pts__title {
  margin: 0 0 12px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 34px;
  letter-spacing: -0.035em;
  color: var(--ink);
}
.pts > p { margin: 0 0 18px; color: var(--muted); }
.pts .table-wrap { margin: 0 0 18px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pts .tpoints__table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; background: var(--surface); }
.pts .tpoints__table th, .pts .tpoints__table td { padding: 9px 12px; text-align: right; white-space: nowrap; }
.pts .tpoints__table th:first-child, .pts .tpoints__table td:first-child { text-align: left; color: var(--muted); }
.pts .tpoints__table th { font-weight: 500; font-size: 12px; color: var(--muted); background: var(--head); }
.pts .tpoints__table tbody tr + tr td { border-top: 1px solid var(--line-soft); }
.pts .tpoints__table tbody tr:first-child td { font-weight: 700; color: var(--gold-ink); }
.pts ul { margin: 0; padding-left: 18px; color: var(--muted); }
.pts li + li { margin-top: 6px; }
.pts b { color: var(--ink); }

.pts .tpoints__table .sm { display: none; }

@media (max-width: 600px) {
  .pts .tpoints__table { font-size: 12.5px; }
  .pts .tpoints__table th, .pts .tpoints__table td { padding: 8px 5px; }
  .pts .tpoints__table th:first-child, .pts .tpoints__table td:first-child { padding-left: 10px; }
  .pts .tpoints__table th:last-child, .pts .tpoints__table td:last-child { padding-right: 10px; }
  .pts .tpoints__table th { font-size: 11px; }
  .pts .tpoints__table .lg { display: none; }
  .pts .tpoints__table .sm { display: inline; }
}

@media (max-width: 900px) {
  .pts-open { position: static; margin-top: 16px; height: 36px; font-size: 13px; }
  .pts { padding: 30px 18px 22px; }
  .pts__title { font-size: 27px; }
}

/* Buscador dentro de las tarjetas */
.search--card { width: auto; margin: 18px 6px 0; height: 44px; }
.search--card input { font-size: 15px; }
.tlist-card .search--card { width: auto; margin: 14px 8px 0; height: 40px; }

/* Separacion entre la cabecera de la tabla y la primera fila */
.ranking tbody tr:first-child td { border-top: 6px solid var(--surface); height: 49px; }

/* Entre 1241 y 1440px: podio + tabla en dos columnas sin que se corte "Total Points" */
@media (min-width: 1241px) and (max-width: 1440px) {
  .board { grid-template-columns: minmax(0, 430px) minmax(0, 1fr); gap: 18px; }
  .pod { padding: 18px 16px 14px 18px; }
  .pod__head { grid-template-columns: 34px 84px minmax(0, 1fr) 118px; gap: 10px; }
  .pod .avatar { width: 84px; height: 84px; font-size: 28px; }
  .pod__rank { font-size: 46px; }
  .pod__name { font-size: 23px; }
  .pod__name--sm { font-size: 20px; }
  .pod__name--xs { font-size: 17px; }
  .pod__score { width: 118px; height: 76px; }
  .pod__score strong { font-size: 27px; }
  .pod__score strong.is-long { font-size: 21px; }
  .pod__stat b { font-size: 15.5px; }
  .pod__stat span { font-size: 12px; }
  .table-card { padding-left: 14px; padding-right: 14px; }
  #ranking .ranking th, #ranking .ranking td { padding: 0 6px; }
  #ranking .ranking .c-nat { width: 40px; }
  #ranking .ranking .nat { font-size: 0; gap: 0; }
  #ranking .ranking td.c-player { max-width: 190px; }
}

/* Menu a la derecha en escritorio (ya no hay buscador ni perfil en la barra) */
@media (min-width: 901px) {
  .nav { justify-self: end; }
}

/* ---------- Pestañas tipo pildora (sustituye a la raya inferior) ---------- */
.nav { gap: 6px; align-items: center; }
.nav__link {
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 500;
  color: var(--ink-2);
  transition: background .2s, color .2s, box-shadow .2s;
}
.nav__link:hover { background: var(--line-soft); color: var(--ink); }
.nav__link.is-active,
.nav__link.is-active:hover {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px -8px rgba(19, 33, 59, .7);
}
.nav__link.is-active::after { display: none; }
.nav__link:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

@media (max-width: 900px) {
  .nav { gap: 4px; height: auto; padding: 4px 0 12px; }
  .nav__link { height: 36px; padding: 0 14px; font-size: 14px; flex: none; }
}

/* Alineacion de la tabla: todo centrado en vertical y numeros a la derecha */
.ranking td { vertical-align: middle; }
.ranking .nat { display: flex; align-items: center; height: 20px; line-height: 1; }
.ranking .nat .flag { display: block; }
.ranking td.c-num, .ranking th.c-num { text-align: right; }
.ranking th.c-num button { justify-content: flex-end; text-align: right; }

/* ---------- Buscador + boton de filtros ---------- */
.search-row { display: flex; gap: 8px; margin: 18px 6px 0; }
.search-row .search--card { flex: 1; margin: 0; }
.filters-toggle { display: none; }

@media (max-width: 900px) {
  .filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: none;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
  }
  .filters-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .filters-toggle__n {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--gold);
    color: #fff;
    font-size: 11.5px;
    line-height: 20px;
    text-align: center;
  }
  .filters-open .filters-toggle { background: var(--navy); border-color: var(--navy); color: #fff; }

  /* plegado: ocultos el tipo de ranking y los selectores de pais/equipo */
  #ranking:not(.filters-open) .toolbar .select { display: none !important; }
  #ranking.filters-open .toolbar .select { animation: rise .25s ease both; }
  #ranking .table-card__head .select--lg { width: 100%; }
  #ranking .table-card__head .select--lg select { width: 100%; }
  #ranking .table-card__head { gap: 12px; }
  #ranking .table-card__head p { font-size: 14px; }

  /* cabecera superior con mas aire */
  .topbar { padding: 20px 18px 6px; row-gap: 14px; }
  .logo { font-size: 25px; gap: 11px; }
  .logo__ika { width: 36px; height: 36px; }
  .nav { padding: 0 0 12px; }
}


/* Objetivos tactiles de al menos 40px en movil */
@media (max-width: 900px) {
  .nav__link { height: 40px; }
  .pts-open { height: 40px; }
}

/* Foto de jugador dentro del avatar */
.avatar { overflow: hidden; }
.avatar__img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; display: block; }

/* ---------- Moviles pequeños (≤ 400px): que todo quepa ---------- */
@media (max-width: 400px) {
  .nav { gap: 2px; justify-content: space-between; }
  .nav__link { padding: 0 11px; font-size: 13.5px; }
  .ranking th, .ranking td { padding: 0 5px; }
  .ranking .c-rank { width: 34px; }
  .ranking .c-nat { width: 30px; }
  .ranking .nat { font-size: 0; gap: 0; }
  .ranking td.c-total { font-size: 15.5px; }
  .ranking th.c-total { font-size: 12px; }
  .table-card { padding-left: 8px; padding-right: 8px; }
}

/* ---------- Arranque sin saltos ----------
   boot.js marca <html data-view="..."> antes de pintar: la cabecera y el menu salen
   ya con la pestaña correcta y el contenido espera a que la app lo monte. */
[data-for] { display: none; }
html[data-view="rankings"] [data-for~="rankings"],
html[data-view="tournaments"] [data-for~="tournaments"],
html[data-view="teams"] [data-for~="teams"],
html[data-view="news"] [data-for~="news"] { display: inline; }

html.booting main,
html.booting .foot { visibility: hidden; }
html.booting:not([data-view="rankings"]) .pts-open { display: none; }

/* menu durante el arranque segun la pestaña de la URL */
html.booting:not([data-view="rankings"]) .nav__link.is-active { background: none; color: var(--ink-2); box-shadow: none; font-weight: 500; }
html.booting[data-view="tournaments"] .nav__link[data-view="tournaments"],
html.booting[data-view="teams"] .nav__link[data-view="teams"],
html.booting[data-view="news"] .nav__link[data-view="news"] {
  background: var(--navy); color: #fff; font-weight: 600; box-shadow: 0 6px 16px -8px rgba(19, 33, 59, .7);
}

/* pestaña Organize en el arranque */
html.booting[data-view="organize"] .nav__link[data-view="organize"] { background: var(--navy); color: #fff; font-weight: 600; box-shadow: 0 6px 16px -8px rgba(19, 33, 59, .7); }

/* Menu con 5 pestañas en movil: se desliza de lado, con aviso de que hay mas */
@media (max-width: 900px) {
  .nav { overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .nav.is-end { -webkit-mask-image: none; mask-image: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav__link { scroll-snap-align: start; }
}
@media (max-width: 400px) { .nav { justify-content: flex-start; } }
