/* ============================================================
   MEDALLERO
   ============================================================ */
.medallero {
  overflow: hidden;
  overflow: clip;
}

.medallero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -15%;
  width: 70vw;
  height: 70vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(252, 211, 77, 0.07), transparent 60%);
  pointer-events: none;
}

.medallero__meta {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-dim);
}

.medallero__meta i {
  font-style: normal;
  color: var(--sage);
  margin-inline: 8px;
}

/* Contadores */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 36px;
}

.stat {
  position: relative;
  display: grid;
  gap: 6px;
  padding: clamp(20px, 2.6vw, 32px);
  background: var(--ink-900);
  overflow: hidden;
}

.stat::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--accent, var(--sage));
  transform-origin: left;
  transform: scaleX(0.2);
  transition: transform 0.8s var(--ease-out);
}

.stat:hover::after {
  transform: scaleX(1);
}

.stat__value {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--accent, #fff);
  font-variant-numeric: tabular-nums;
}

.stat__label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--fg-dim);
}

@media (max-width: 760px) {
  .stats {
    grid-template-columns: 1fr 1fr;
  }
}

/* Tabs */
.medal-tabs {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.medal-tabs__pill {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 13px;
  background: var(--tab-color, var(--forest-800));
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.medal-tabs button {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  padding: 14px 18px;
  border-radius: 13px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--fg-dim);
  transition: color 0.3s;
}

.medal-tabs button:hover,
.medal-tabs button[aria-selected='true'] {
  color: #fff;
}

.medal-desc {
  margin: 18px 0 32px;
  max-width: 80ch;
  font-size: 14.5px;
  font-weight: 300;
  color: var(--fg-muted);
}

.medal-desc strong {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--sage);
  margin-right: 6px;
}

/* Torneo */
.tourney {
  display: grid;
  gap: 28px;
}

.tourney__head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  padding: clamp(22px, 3vw, 36px);
  border-radius: var(--radius-xl);
  background: linear-gradient(140deg, var(--forest-800), var(--forest-900));
  border: 1px solid var(--line);
}

.tourney__edition {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--sage);
  margin-bottom: 10px;
}

.tourney__name {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.4vw, 2.8rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.tourney__venue {
  margin-top: 10px;
  font-size: 13px;
  color: var(--fg-muted);
}

.day-toggle {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.3);
}

.day-toggle__pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  border-radius: 11px;
  background: var(--sage);
  transition: transform 0.55s var(--ease-out), width 0.55s var(--ease-out);
}

.day-toggle button {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--fg-muted);
  transition: color 0.3s;
}

.day-toggle button b {
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
}

.day-toggle button[aria-pressed='true'] {
  color: var(--ink-900);
}

/* Podio top 6 */
.top6__title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.top6__title h4 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  letter-spacing: -0.02em;
}

.top6__title span {
  font-size: 13px;
  color: var(--fg-dim);
}

.top6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.honor {
  --accent: var(--gold-300);
  position: relative;
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  overflow: hidden;
  transform-style: preserve-3d;
  will-change: transform;
}

.honor[data-pos='2'] {
  --accent: #dfe5ea;
}

.honor[data-pos='3'] {
  --accent: #f0a467;
}

.honor::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--accent) 18%, transparent), transparent 65%);
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
}

.honor:hover::before {
  opacity: 1;
}

.honor__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.honor__rank {
  position: absolute;
  right: 14px;
  bottom: -18px;
  font-family: var(--font-display);
  font-size: 110px;
  font-weight: 700;
  line-height: 1;
  color: color-mix(in srgb, var(--accent) 12%, transparent);
  pointer-events: none;
}

.honor__who {
  display: flex;
  align-items: center;
  gap: 12px;
}

.honor__who strong {
  display: block;
  font-size: 16px;
}

.honor__who small {
  font-size: 12px;
  color: var(--fg-dim);
}

.honor__note {
  position: relative;
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  color: var(--fg-muted);
}

.honor__note::before {
  content: '✦';
  color: var(--sage);
}

.cat-chip {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(164, 190, 123, 0.12);
  color: var(--sage-300);
}

@media (max-width: 960px) {
  .top6 {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .top6 {
    grid-template-columns: 1fr;
  }

  .tourney__head {
    grid-template-columns: 1fr;
  }
}

/* Filtro de categorías + lista completa */
.cat-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.cat-filter > span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--fg-dim);
  margin-right: 6px;
}

.cat-filter button {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.cat-filter button:hover {
  border-color: var(--sage);
  color: #fff;
}

.cat-filter button[aria-pressed='true'] {
  background: var(--sage);
  border-color: var(--sage);
  color: var(--ink-900);
}

.results__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 12px;
}

.results__head h4 {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.results__head span {
  font-size: 13px;
  color: var(--fg-dim);
}

.results {
  display: grid;
  gap: 6px;
}

.result {
  display: grid;
  grid-template-columns: 56px 1.4fr 1fr 1.6fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  transition: background 0.35s, border-color 0.35s, transform 0.5s var(--ease-out);
}

.result:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(164, 190, 123, 0.3);
  transform: translateX(4px);
}

.result__pos {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.06);
}

.result[data-pos='1'] .result__pos {
  background: var(--gold-soft);
  color: var(--gold-300);
}

.result[data-pos='2'] .result__pos {
  background: rgba(169, 180, 190, 0.16);
  color: #dfe5ea;
}

.result[data-pos='3'] .result__pos {
  background: rgba(180, 83, 9, 0.2);
  color: #f0a467;
}

.result__name {
  font-weight: 600;
}

.result__name small {
  display: block;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--fg-dim);
}

.result__note {
  font-size: 13px;
  color: var(--fg-muted);
}

@media (max-width: 860px) {
  .result {
    grid-template-columns: 48px 1fr auto;
  }

  .result .cat-chip,
  .result__note {
    grid-column: 2 / -1;
  }

  .result__note {
    font-size: 12px;
  }
}

/* Estado vacío */
.medal-empty {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: clamp(40px, 7vw, 90px) 24px;
  border-radius: var(--radius-xl);
  border: 1px dashed var(--line-strong);
  text-align: center;
}

.medal-empty__icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 24px;
  background: color-mix(in srgb, var(--tab-color, var(--forest-700)) 40%, transparent);
  color: #fff;
}

.medal-empty__icon .i {
  width: 34px;
  height: 34px;
}

.medal-empty h4 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  letter-spacing: -0.03em;
  text-transform: uppercase;
}

.medal-empty p {
  max-width: 56ch;
  color: var(--fg-muted);
  font-weight: 300;
}

.medal-empty__label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--sage);
}

.medal-empty__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}

/* Ranking beca */
.beca-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.beca-head h4 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  margin: 8px 0 12px;
}

.beca-head p {
  max-width: 70ch;
  color: var(--fg-muted);
  font-weight: 300;
  font-size: 14.5px;
}

.beca-quota {
  display: grid;
  justify-items: end;
  gap: 4px;
  text-align: right;
}

.beca-quota b {
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 1;
  color: var(--sage);
}

.beca-quota span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: var(--fg-dim);
}

.beca-legend {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}

.beca-legend div {
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}

.beca-legend strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--sage);
}

.beca-legend span {
  font-size: 11px;
  color: var(--fg-dim);
}

.beca-list {
  display: grid;
  gap: 8px;
}

.beca-row {
  display: grid;
  grid-template-columns: 54px minmax(180px, 1.1fr) 2.6fr 110px;
  gap: 18px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.beca-row[data-rank='1'] {
  background: linear-gradient(90deg, rgba(252, 211, 77, 0.1), rgba(255, 255, 255, 0.03) 40%);
  border-color: rgba(252, 211, 77, 0.3);
}

.beca-row__rank {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--fg-dim);
}

.beca-row[data-rank='1'] .beca-row__rank {
  color: var(--gold-300);
}

.beca-row[data-rank='2'] .beca-row__rank {
  color: #dfe5ea;
}

.beca-row[data-rank='3'] .beca-row__rank {
  color: #f0a467;
}

.beca-row__who strong {
  display: block;
  font-size: 15px;
}

.beca-row__who small {
  font-size: 11.5px;
  color: var(--fg-dim);
}

.beca-row__badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: rgba(164, 190, 123, 0.14);
  color: var(--sage-300);
}

.beca-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  align-items: end;
}

.beca-bar {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.beca-bar__track {
  position: relative;
  width: 100%;
  height: 46px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.beca-bar__fill {
  position: absolute;
  inset: auto 0 0;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(0deg, var(--forest-500), var(--sage));
  transform-origin: bottom;
  transform: scaleY(var(--v, 0));
}

.beca-bar b {
  font-family: var(--font-mono);
  font-size: 11px;
}

.beca-bar small {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.06em;
  color: var(--fg-dim);
  text-align: center;
  line-height: 1.2;
}

.beca-row__total {
  text-align: right;
}

.beca-row__total b {
  display: block;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
  color: var(--sage);
}

.beca-row__total small {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
}

@media (max-width: 1080px) {
  .beca-legend {
    grid-template-columns: repeat(4, 1fr);
  }

  .beca-row {
    grid-template-columns: 44px 1fr 90px;
  }

  .beca-bars {
    grid-column: 1 / -1;
    order: 4;
  }
}

@media (max-width: 600px) {
  .beca-legend {
    grid-template-columns: 1fr 1fr;
  }

  .beca-head {
    grid-template-columns: 1fr;
  }

  .beca-quota {
    justify-items: start;
    text-align: left;
  }
}

.medallero__foot {
  display: grid;
  gap: 8px;
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.medallero__foot strong {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--sage);
}

.medallero__foot p {
  max-width: 90ch;
  font-size: 13px;
  color: var(--fg-dim);
}

.medal-panel {
  min-height: 300px;
}
