/* ── Gamificación: misiones, tienda, ranking ────────────────────────
   Hoja aparte de estilo.css: la usan solo /logros.php y /tienda.php, así
   que el resto del portal no paga su descarga. Reusa las variables de
   tema (--surface, --border, --gold…) que estilo.css ya define, para que
   todo esto siga los 13 temas visuales sin una sola regla por tema. */

/* ── Misiones ─────────────────────────────────────────────────────── */
.misiones-grid { display: flex; flex-direction: column; gap: 10px; }

.mision-card {
    display: flex; align-items: center; gap: 14px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; padding: 14px 16px;
    transition: border-color .18s, transform .18s;
}
.mision-card.lista {
    border-color: rgba(245,158,11,.55);
    box-shadow: 0 0 0 1px rgba(245,158,11,.14);
}
.mision-card.cobrada { opacity: .5; }

.mision-icono { font-size: 26px; line-height: 1; flex-shrink: 0; }
.mision-cuerpo { flex: 1; min-width: 0; }
.mision-nombre { font-size: 14px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.mision-perido-chip {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    padding: 2px 7px; border-radius: 99px; border: 1px solid var(--border); color: var(--text-muted);
}
.mision-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.mision-barra-fila { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.mision-barra { flex: 1; height: 6px; background: var(--border); border-radius: 99px; overflow: hidden; }
.mision-barra-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 99px; transition: width .4s ease; }
.mision-cuenta { font-size: 11px; font-weight: 700; color: var(--text-muted); white-space: nowrap; }

.mision-lado { flex-shrink: 0; text-align: center; min-width: 82px; }
.mision-premio { font-size: 13px; font-weight: 800; color: var(--gold); white-space: nowrap; }
.mision-boton {
    margin-top: 6px; width: 100%;
    background: var(--gold); color: #1a1005; border: 0;
    border-radius: 99px; padding: 7px 12px;
    font-family: inherit; font-size: 12px; font-weight: 800; cursor: pointer;
    transition: filter .15s, transform .1s;
}
.mision-boton:hover:not(:disabled) { filter: brightness(1.1); }
.mision-boton:active:not(:disabled) { transform: scale(.97); }
.mision-boton:disabled { opacity: .55; cursor: default; }
.mision-cobrada-lbl { font-size: 11px; font-weight: 700; color: var(--text-muted); margin-top: 6px; }

.misiones-vacio, .tienda-vacio {
    font-size: 13px; color: var(--text-muted); text-align: center;
    padding: 20px; background: var(--surface);
    border: 1px dashed var(--border); border-radius: 12px;
}
.misiones-reset { font-size: 11px; color: var(--text-muted); text-align: center; margin: 10px 0 0; }

/* ── Tienda ───────────────────────────────────────────────────────── */
.tienda-saldo {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; padding: 22px; text-align: center; margin-bottom: 24px;
}
.tienda-saldo-num { font-family: var(--font-titulo); font-size: 42px; font-weight: 800; color: var(--gold); line-height: 1; }
.tienda-saldo-lbl { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 6px; }
.tienda-saldo-nota { font-size: 12px; color: var(--text-muted); margin: 12px 0 0; line-height: 1.5; }

.tienda-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tienda-card {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; padding: 18px 16px;
    transition: border-color .18s, transform .18s;
}
.tienda-card:hover { transform: translateY(-2px); }
.tienda-card.comprable { border-color: rgba(245,158,11,.4); }
.tienda-card.bloqueada { opacity: .58; }
.tienda-card-icono { font-size: 32px; line-height: 1; margin-bottom: 10px; }
.tienda-card-nombre { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.tienda-card-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; flex: 1; }
.tienda-card-pie { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.tienda-card-costo { font-size: 15px; font-weight: 800; color: var(--gold); white-space: nowrap; }
.tienda-card-boton {
    background: var(--gold); color: #1a1005; border: 0;
    border-radius: 99px; padding: 8px 16px;
    font-family: inherit; font-size: 12px; font-weight: 800; cursor: pointer;
    transition: filter .15s, transform .1s;
}
.tienda-card-boton:hover:not(:disabled) { filter: brightness(1.1); }
.tienda-card-boton:active:not(:disabled) { transform: scale(.97); }
.tienda-card-boton:disabled { opacity: .5; cursor: default; }
.tienda-card-motivo { font-size: 11px; font-weight: 600; color: var(--text-muted); text-align: right; }
.tienda-card-tenido { font-size: 11px; font-weight: 700; color: var(--gold); }

.tienda-historial { display: flex; flex-direction: column; gap: 6px; }
.tienda-historial-item {
    display: flex; align-items: center; gap: 10px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 9px 13px; font-size: 13px;
}
.tienda-historial-nombre { flex: 1; min-width: 0; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tienda-historial-fecha { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.tienda-historial-estado { font-size: 11px; font-weight: 700; white-space: nowrap; }
.estado-pendiente { color: var(--gold); }
.estado-entregado { color: #22c55e; }
.estado-rechazado { color: var(--text-muted); text-decoration: line-through; }

/* ── Ranking: mi posición ─────────────────────────────────────────── */
.mi-posicion {
    display: flex; align-items: center; gap: 14px;
    background: var(--surface); border: 1px solid rgba(245,158,11,.4);
    border-radius: 12px; padding: 13px 18px; margin-top: 10px;
}
.mi-posicion-pos { font-family: var(--font-titulo); font-size: 22px; font-weight: 900; color: var(--gold); white-space: nowrap; }
.mi-posicion-txt { flex: 1; min-width: 0; font-size: 13px; color: var(--text); }
.mi-posicion-txt small { display: block; font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.mi-posicion-pts { font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; }

/* ── Podio de la temporada anterior ───────────────────────────────── */
.podio-anterior { display: flex; flex-direction: column; gap: 6px; }
.podio-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 9px 14px;
}
.podio-item:nth-child(1) { border-color: rgba(245,158,11,.45); }
.podio-pos { font-size: 15px; min-width: 22px; text-align: center; flex-shrink: 0; }
.podio-nombre { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podio-pts { font-size: 12px; font-weight: 700; color: var(--text-muted); white-space: nowrap; }

/* ── Badge de misiones listas en el nav ───────────────────────────── */
.nav-badge-misiones {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 17px; height: 17px; padding: 0 5px; margin-left: 5px;
    background: var(--gold); color: #1a1005;
    border-radius: 99px; font-size: 10px; font-weight: 800; line-height: 1;
    vertical-align: middle;
}

@media (max-width: 560px) {
    .tienda-grid { grid-template-columns: 1fr; }
    .mision-card { gap: 11px; padding: 13px; }
    .mision-lado { min-width: 72px; }
    .mision-icono { font-size: 22px; }
}

/* La barra de progreso se anima al llegar a la meta; con reduced-motion
   se queda quieta, que el dato ya está en el número de al lado. */
@media (prefers-reduced-motion: reduce) {
    .mision-barra-fill, .tienda-card, .mision-card { transition: none; }
}

/* ── Escalera completa (logros.php) ─────────────────────────────── */
.rangos-escalera { display: flex; flex-direction: column; gap: 4px; }
.rango-fila {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 14px; border-radius: 10px;
    background: var(--surface); border: 1px solid var(--border);
    opacity: .45; transition: opacity .2s, border-color .2s;
}
.rango-fila.alcanzado { opacity: 1; }
.rango-fila.actual {
    border-color: rgba(245,158,11,.6);
    box-shadow: 0 0 0 1px rgba(245,158,11,.18);
    opacity: 1;
}
.rango-fila-pos    { font-size: 11px; color: var(--text-muted); min-width: 26px; font-variant-numeric: tabular-nums; }
.rango-fila-insig  { min-width: 78px; display: flex; }
.rango-fila-nombre { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--text); }
.rango-fila-actual-lbl { font-size: 11px; font-weight: 700; color: var(--gold); margin-left: 8px; }
.rango-fila-pts    { font-size: 12px; color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Colapsar la escalera: 50 filas es demasiado para mostrar de una */
.rangos-escalera.colapsada .rango-fila.lejano { display: none; }
.rangos-ver-todos {
    display: block; width: 100%; margin-top: 10px; padding: 9px;
    background: var(--surface); border: 1px dashed var(--border); border-radius: 10px;
    color: var(--gold); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.rangos-ver-todos:hover { border-color: var(--gold); }

/* ── Tarjeta de rango actual ────────────────────────────────────── */
.rango-actual-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; padding: 22px; text-align: center;
}
.rango-actual-insig  { display: flex; justify-content: center; margin-bottom: 12px; }
.rango-actual-nombre { font-family: var(--font-titulo); font-size: 24px; font-weight: 800; color: var(--text); }
.rango-actual-pos    { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ── Ranking del portal ─────────────────────────────────────────── */
.rank-tabla { display: flex; flex-direction: column; gap: 6px; }
.rank-fila {
    display: flex; align-items: center; gap: 12px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; padding: 10px 14px;
}
.rank-fila.soy-yo { border-color: rgba(245,158,11,.55); }
.rank-pos { font-size: 14px; font-weight: 900; color: var(--text-muted); min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; }
.rank-fila:nth-child(1) .rank-pos { color: var(--gold); }
.rank-fila:nth-child(2) .rank-pos { color: var(--plata); }
.rank-fila:nth-child(3) .rank-pos { color: var(--bronce); }
.rank-avatar {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center;
    font-size: 15px; font-weight: 700; color: #fff;
}
.rank-info { flex: 1; min-width: 0; }
.rank-nombre { display: block; font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-rango  { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.rank-pts    { font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
    .rango-fila-insig { min-width: 56px; }
    .rango-fila-pos   { display: none; }
}

/* ══════════════════════════════════════════════════════════════════
   LENGUAJE VISUAL: MEDIDORES DE AUDIO
   ══════════════════════════════════════════════════════════════════
   Todo lo que en estas páginas representa "progreso" se dibuja como un
   medidor de consola segmentado, no como una barra lisa. Es la única
   licencia estética de la sección y se aplica a todo por igual: progreso
   de rango, cupo diario de cada acción, avance de misión, colección de
   insignias. Un portal de música mide en decibeles, no en porcentajes.

   Los segmentos salen de un repeating-linear-gradient, así que un medidor
   son dos elementos y no veinte <i>: importa cuando hay quince en pantalla.
   ══════════════════════════════════════════════════════════════════ */

.medidor {
    position: relative; height: 10px; border-radius: 2px; overflow: hidden;
    background: repeating-linear-gradient(90deg,
        var(--surface2) 0 5px, transparent 5px 8px);
    box-shadow: inset 0 0 0 1px var(--border);
}
.medidor-fill {
    height: 100%; border-radius: 2px;
    background: repeating-linear-gradient(90deg,
        var(--medidor-color, var(--gold)) 0 5px, transparent 5px 8px);
    transition: width .5s cubic-bezier(.22,1,.36,1);
}
.medidor-lg { height: 16px; }
.medidor-lg, .medidor-lg .medidor-fill {
    background-size: auto;
}
.medidor-lg { background: repeating-linear-gradient(90deg, var(--surface2) 0 7px, transparent 7px 11px); }
.medidor-lg .medidor-fill { background: repeating-linear-gradient(90deg, var(--medidor-color, var(--gold)) 0 7px, transparent 7px 11px); }
/* El último segmento encendido late: es donde está el usuario ahora. */
.medidor-fill::after {
    content: ''; position: absolute; top: 0; bottom: 0; width: 5px;
    right: 0; background: #fff; opacity: .55;
}
@media (prefers-reduced-motion: reduce) {
    .medidor-fill { transition: none; }
}

/* ── Cabecera del cuartel ───────────────────────────────────────── */
.cuartel {
    background:
        radial-gradient(120% 90% at 50% -20%, rgba(124,58,237,.28), transparent 60%),
        var(--surface);
    border: 1px solid var(--border); border-radius: 18px;
    padding: 26px 24px 22px; text-align: center;
}
.cuartel-insignia { display: flex; justify-content: center; margin-bottom: 14px; }
.cuartel-rango {
    font-family: var(--font-titulo); font-size: clamp(26px, 7vw, 38px);
    font-weight: 800; letter-spacing: -.02em; line-height: 1.05; color: var(--text);
}
.cuartel-pos { font-size: 12px; color: var(--text-muted); margin-top: 5px; letter-spacing: .04em; }
.cuartel-medidor { max-width: 420px; margin: 18px auto 0; }
.cuartel-cifras {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 12px; color: var(--text-muted); margin-bottom: 7px;
    font-variant-numeric: tabular-nums;
}
.cuartel-cifras strong { color: var(--gold); font-size: 15px; font-weight: 800; }
.cuartel-falta { font-size: 13px; color: var(--text-muted); margin: 10px 0 0; }
.cuartel-falta b { color: var(--gold); }

.cuartel-chips { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip-dato {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--surface2); border: 1px solid var(--border);
    border-radius: 999px; padding: 7px 14px;
    font-size: 12px; color: var(--text-muted); text-decoration: none;
}
.chip-dato b { color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; }
a.chip-dato:hover { border-color: var(--gold); }

/* ── La consola: cómo sumar puntos hoy ──────────────────────────── */
.consola { display: flex; flex-direction: column; gap: 2px; }
.canal {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center; gap: 12px;
    padding: 11px 14px;
    background: var(--surface); border: 1px solid var(--border);
}
.canal:first-child { border-radius: 12px 12px 0 0; }
.canal:last-child  { border-radius: 0 0 12px 12px; }
.canal + .canal { border-top: 0; }
.canal.agotado { opacity: .5; }
.canal-icono { font-size: 20px; line-height: 1; text-align: center; }
.canal-cuerpo { min-width: 0; }
.canal-nombre { font-size: 13px; font-weight: 700; color: var(--text); }
.canal-nombre a { color: var(--gold); text-decoration: none; }
.canal-premio { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.canal-medidor { margin-top: 6px; }
.canal-cupo {
    font-size: 12px; font-weight: 800; color: var(--text-muted);
    font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right;
}
.canal-cupo small { display: block; font-size: 10px; font-weight: 600; opacity: .75; }
.canal.listo .canal-cupo { color: #22c55e; }

.consola-pie {
    font-size: 12px; color: var(--text-muted); text-align: center;
    margin: 12px 0 0; line-height: 1.6;
}

/* ── Podio del ranking ──────────────────────────────────────────── */
.podio {
    display: grid; grid-template-columns: 1fr 1.15fr 1fr;
    align-items: end; gap: 10px; margin-bottom: 26px;
}
.podio-puesto { text-align: center; }
.podio-caja {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px 14px 0 0; padding: 16px 8px 12px;
    display: flex; flex-direction: column; align-items: center; gap: 7px;
}
.podio-1 .podio-caja { border-color: rgba(245,158,11,.55); background:
    linear-gradient(180deg, rgba(245,158,11,.13), var(--surface) 70%); }
.podio-2 .podio-caja { border-color: rgba(148,163,184,.4); }
.podio-3 .podio-caja { border-color: rgba(205,124,62,.4); }
.podio-medalla { font-size: 24px; line-height: 1; }
.podio-nom {
    font-size: 13px; font-weight: 700; color: var(--text);
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.podio-rango { font-size: 11px; color: var(--text-muted); }
.podio-pts { font-size: 12px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.podio-base {
    background: var(--surface2); border: 1px solid var(--border); border-top: 0;
    border-radius: 0 0 6px 6px;
    font-family: var(--font-titulo); font-weight: 800; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
}
.podio-1 .podio-base { height: 46px; font-size: 20px; color: var(--gold); }
.podio-2 .podio-base { height: 32px; font-size: 16px; }
.podio-3 .podio-base { height: 24px; font-size: 15px; }

/* Separación entre bloques. Estaba solo dentro del <style> de perfil.php,
   así que en logros.php y ranking.php la clase no hacía nada. */
.seccion-perfil { margin-bottom: 32px; }

/* ── Encabezado de sección ──────────────────────────────────────── */
.sec-cab { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; }
.sec-cab h2 {
    font-family: var(--font-titulo); font-size: 17px; font-weight: 800;
    letter-spacing: -.01em; margin: 0; color: var(--text);
}
.sec-cab p { font-size: 12px; color: var(--text-muted); margin: 0; }

@media (max-width: 560px) {
    .canal { grid-template-columns: 26px 1fr auto; gap: 9px; padding: 10px 11px; }
    .podio { gap: 6px; }
    .podio-caja { padding: 12px 5px 10px; }
    .podio-nom { font-size: 11px; }
}

/* ── Avisos push ────────────────────────────────────────────────────
   Mismo lenguaje que los canales de la consola: franja horizontal con
   ícono a la izquierda y la acción a la derecha. */
.push-caja {
    display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
    padding: 13px 15px; margin: 0 0 18px;
}
.push-icono { font-size: 22px; line-height: 1; text-align: center; }
.push-titulo {
    font-family: var(--font-titulo); font-size: 14px; font-weight: 700;
    margin: 0 0 2px; color: var(--text);
}
.push-nota { font-size: 12px; color: var(--text-muted); margin: 0; line-height: 1.45; }
.push-btn {
    font: inherit; font-size: 12.5px; font-weight: 700; white-space: nowrap;
    padding: 9px 15px; border-radius: 8px; cursor: pointer;
    background: var(--primary); color: #fff; border: 1px solid transparent;
    transition: background .15s, opacity .15s;
}
.push-btn:hover:not(:disabled) { background: var(--accent); }
.push-btn:disabled { opacity: .55; cursor: default; }
/* Ya activados: el botón deja de competir por atención y pasa a ser una salida. */
.push-btn[data-estado="activo"] {
    background: transparent; color: var(--text-muted); border-color: var(--border);
}
.push-btn[data-estado="activo"]:hover { background: var(--surface2); color: var(--text); }

@media (max-width: 560px) {
    .push-caja { grid-template-columns: 28px 1fr; row-gap: 10px; }
    .push-btn { grid-column: 1 / -1; width: 100%; }
}
