/* ===========================================================
   ENESE Academy — Components
   Botones, inputs, cards, alerts, avatars
   =========================================================== */

/* ---------- Button ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 44px;
  padding: 0 var(--sp-5);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.01em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
  user-select: none;
}

.btn:disabled { cursor: not-allowed; opacity: 0.55; }

.btn-primary {
  background: var(--primary);
  color: var(--text-inverse);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-primary:active:not(:disabled) { background: var(--primary-active); }
.btn-primary:focus-visible {
  box-shadow: var(--shadow-focus);
}

.btn-accent {
  background: var(--accent);
  color: var(--primary);
}
.btn-accent:hover:not(:disabled) { background: var(--accent-hover); }
.btn-accent:focus-visible { box-shadow: var(--shadow-focus-accent); }

.btn-ghost {
  background: transparent;
  color: var(--primary);
}
.btn-ghost:hover:not(:disabled) { background: var(--primary-05); }

.btn-outline {
  background: var(--white);
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover:not(:disabled) {
  border-color: var(--border-strong);
  background: var(--surface);
}

.btn-danger {
  background: var(--danger);
  color: var(--text-inverse);
}
.btn-danger:hover:not(:disabled) { filter: brightness(0.92); }

.btn-sm { height: 36px; padding: 0 var(--sp-4); font-size: var(--fs-xs); }
.btn-lg { height: 52px; padding: 0 var(--sp-6); font-size: var(--fs-md); }
.btn-block { display: flex; width: 100%; }

/* ---------- Input ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.field-label {
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  color: var(--text);
}

.field-hint {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.input {
  height: 48px;
  padding: 0 var(--sp-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  font-size: var(--fs-md);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  width: 100%;
}

.input::placeholder { color: var(--text-subtle); }

.input:hover { border-color: var(--border-strong); }

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

.input:disabled {
  background: var(--surface);
  color: var(--text-muted);
  cursor: not-allowed;
}

.field-error .input { border-color: var(--danger); }
.field-error .field-hint { color: var(--danger); }

textarea.input {
  height: auto;
  min-height: 120px;
  padding: var(--sp-3) var(--sp-4);
  line-height: var(--lh-normal);
  resize: vertical;
}

/* ---------- Card ---------- */
.card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t-base), border-color var(--t-base), transform var(--t-base);
}

.card-interactive {
  cursor: pointer;
}
.card-interactive:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.card-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--sp-2);
}

.card-subtitle {
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.card-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #1C2079 100%);
  color: var(--text-inverse);
  border: none;
  padding: var(--sp-7);
  position: relative;
  overflow: hidden;
}

.card-hero::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.25;
  pointer-events: none;
}

.card-hero * { position: relative; }

.card-hero h1, .card-hero h2, .card-hero h3 { color: var(--text-inverse); }

/* ---------- Alert ---------- */
.alert {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  border: 1px solid transparent;
}
.alert-error { background: var(--danger-soft); color: var(--danger); border-color: rgba(217, 59, 92, 0.2); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: rgba(31, 169, 116, 0.2); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(199, 135, 0, 0.2); }
.alert-info { background: var(--primary-softer); color: var(--primary); border-color: var(--primary-soft); }

/* ---------- Avatar ---------- */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  flex-shrink: 0;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 32px; height: 32px; font-size: var(--fs-xs); }
.avatar-lg { width: 56px; height: 56px; font-size: var(--fs-md); }

/* ---------- Badge ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px var(--sp-2);
  border-radius: var(--radius-pill);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  background: var(--primary-soft);
  color: var(--primary);
}
.badge-accent { background: var(--accent); color: var(--primary); }
.badge-muted { background: var(--surface); color: var(--text-muted); }

/* ---------- Skeleton ---------- */
@keyframes skeleton-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.skeleton {
  background: var(--surface-hover);
  border-radius: var(--radius-sm);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* ---------- Icon helper ---------- */
.icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.8;
  flex-shrink: 0;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

/* ---------- Favorite button ---------- */
.btn-fav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.btn-fav:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-soft);
}
.btn-fav.active {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: var(--danger);
}
.btn-fav.active .icon { fill: var(--danger); stroke: var(--danger); }
.btn-fav-lg { width: 44px; height: 44px; }

/* ---------- Module card (grid en categoria) ---------- */
.module-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.card-cover {
  height: 140px;
  background-color: var(--primary-soft);
  background-size: cover;
  background-position: center;
  position: relative;
}
.card-cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
}
.module-card-body {
  padding: var(--sp-4) var(--sp-5) var(--sp-3);
  flex: 1;
  min-height: 0;
}
.module-card-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--sp-2);
  line-height: var(--lh-snug);
}
.module-card-desc {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: 0;
  line-height: var(--lh-snug);
}
.module-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-5) var(--sp-4);
  border-top: 1px solid var(--border-soft);
}

/* ---------- Content list (dentro de modulo) ---------- */
.content-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: 0;
  margin: 0;
  list-style: none;
}
.content-row {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-4);
  background: var(--surface-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
  min-height: 72px;
}
.content-row:hover {
  border-color: var(--border);
  background: var(--surface);
}
.content-row-status {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background: var(--primary-softer);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
  font-weight: var(--fw-semibold);
}
.content-status-index { font-size: var(--fs-md); }
.content-status-progress {
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}
.content-status-done { color: var(--success); }
.content-row-body {
  flex: 1;
  min-width: 0;
}
.content-row-title {
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
  color: var(--text);
  margin: 0 0 var(--sp-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.content-row-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-shrink: 0;
}

/* ---------- Progress bar ---------- */
.progress-bar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.progress-bar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.card:not(.card-hero) .progress-bar-track {
  background: var(--primary-softer);
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transition: width var(--t-slow);
}
.card:not(.card-hero) .progress-bar-fill {
  background: var(--primary);
}
.progress-bar-label {
  font-size: var(--fs-xs);
  color: rgba(255, 255, 255, 0.75);
}
.card:not(.card-hero) .progress-bar-label {
  color: var(--text-muted);
}

/* ---------- Video frame ---------- */
.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--text);
  box-shadow: var(--shadow-md);
}
.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Progress controls (en content) ---------- */
.progress-controls {
  padding: var(--sp-5);
  background: var(--surface-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
}
.progress-controls-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}
.progress-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-3);
}

/* ---------- Text support (markdown-ish) ---------- */
.text-support {
  font-size: var(--fs-md);
  line-height: var(--lh-relaxed);
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* ---------- Attachment list ---------- */
.attachment-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-3);
}
.attachment-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--surface-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.attachment-item:hover {
  border-color: var(--primary);
  background: var(--primary-softer);
}
.attachment-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.attachment-body {
  flex: 1;
  min-width: 0;
}
.attachment-body strong {
  display: block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Link list ---------- */
.link-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}
.link-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  color: var(--text);
  text-decoration: none;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.link-item:hover {
  border-color: var(--primary);
  background: var(--primary-softer);
}
.link-item span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Community composer ---------- */
.community-composer {
  padding: var(--sp-5);
}
.composer-form {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.composer-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--text);
  font-size: var(--fs-sm);
}
.composer-row {
  display: flex;
  gap: var(--sp-3);
}
.composer-select {
  width: 200px;
  flex-shrink: 0;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%235A5E78' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
  cursor: pointer;
}
.composer-body {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
  line-height: var(--lh-normal);
}
.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

/* ---------- Community filters (chips) ---------- */
.community-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.chip {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-pill);
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  min-height: 36px;
}
.chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.chip.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* ---------- Community feed ---------- */
.community-feed {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

/* ---------- Post card ---------- */
.post-card {
  background: var(--surface-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t-base), border-color var(--t-base);
}
.post-card:hover {
  box-shadow: var(--shadow-sm);
}
.post-header {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.post-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.post-meta strong {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text);
}
.post-meta .text-subtle {
  font-size: var(--fs-xs);
}
.post-category {
  font-weight: var(--fw-medium);
}
.post-menu {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-subtle);
  transition: background var(--t-fast), color var(--t-fast);
}
.post-menu:hover {
  background: var(--danger-soft);
  color: var(--danger);
}
.post-title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  margin-bottom: var(--sp-2);
  line-height: var(--lh-snug);
}
.post-body {
  font-size: var(--fs-md);
  color: var(--text);
  line-height: var(--lh-normal);
  margin: 0;
  word-wrap: break-word;
  max-width: none;
}

/* ---------- Post actions ---------- */
.post-actions {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border-soft);
}
.post-action {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
  min-height: 36px;
}
.post-action:hover {
  background: var(--surface);
  color: var(--primary);
}
.post-action.active {
  color: var(--danger);
}
.post-action.active .icon {
  fill: var(--danger);
  stroke: var(--danger);
}

/* ---------- Post comments ---------- */
.post-comments {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border-soft);
}
.comment-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.comment-item {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-4);
}
.comment-body {
  flex: 1;
  min-width: 0;
}
.comment-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-bottom: var(--sp-1);
}
.comment-head strong {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text);
}
.comment-head .text-subtle {
  font-size: var(--fs-xs);
}
.comment-body p {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text);
  line-height: var(--lh-normal);
  word-wrap: break-word;
  max-width: none;
}
.comment-delete {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-subtle);
  transition: background var(--t-fast), color var(--t-fast);
  flex-shrink: 0;
}
.comment-delete:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.comment-form {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
}
.comment-form input {
  flex: 1;
}

/* ---------- Load more ---------- */
.community-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: var(--sp-5);
}

/* ---------- Ranking ---------- */
.ranking-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  background: var(--primary-softer);
  border: 1px solid var(--primary-soft);
  border-radius: var(--radius-md);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}
.ranking-info-window {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--primary);
}
.ranking-info-weights {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--text-muted);
}
.ranking-info-weights strong {
  color: var(--primary);
  font-weight: var(--fw-semibold);
}

/* Podium */
.ranking-podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--sp-5);
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  margin-bottom: var(--sp-6);
  background: linear-gradient(135deg, var(--primary) 0%, #1C2079 100%);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.ranking-podium::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  opacity: 0.18;
  pointer-events: none;
}
.podium-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  position: relative;
  flex: 0 0 140px;
}
.podium-block.podium-1 {
  transform: translateY(-12px);
}
.podium-avatar {
  position: relative;
}
.podium-avatar .avatar {
  width: 72px;
  height: 72px;
  font-size: var(--fs-lg);
  background: var(--white);
  color: var(--primary);
  border: 3px solid var(--accent);
}
.podium-1 .podium-avatar .avatar {
  width: 84px;
  height: 84px;
  font-size: var(--fs-xl);
  border-width: 4px;
}
.podium-medal {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  border: 2px solid var(--white);
}
.podium-1 .podium-medal {
  width: 30px;
  height: 30px;
  font-size: var(--fs-sm);
}
.podium-name {
  color: var(--white);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-align: center;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.podium-1 .podium-name { font-size: var(--fs-md); }
.podium-score {
  color: var(--accent);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}

/* Ranking list (completa en pagina ranking + compacta en widget dashboard) */
.ranking-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  list-style: none;
  padding: 0;
  margin: 0;
}
.ranking-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--surface-elevated);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
}
.ranking-row.is-me {
  background: var(--primary-softer);
  border-color: var(--primary-soft);
  box-shadow: var(--shadow-xs);
}
.ranking-position {
  width: 28px;
  text-align: center;
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  flex-shrink: 0;
}
.ranking-row.is-me .ranking-position {
  color: var(--primary);
}
.ranking-name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.ranking-name strong {
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.ranking-name .text-subtle {
  font-size: var(--fs-xs);
}
.ranking-score {
  display: flex;
  align-items: baseline;
  gap: var(--sp-1);
  flex-shrink: 0;
}
.ranking-score strong {
  font-size: var(--fs-lg);
  font-weight: var(--fw-bold);
  color: var(--primary);
  line-height: 1;
}
.ranking-row.is-me .ranking-score strong {
  color: var(--primary);
}
.ranking-score span {
  font-size: var(--fs-xs);
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Variante compacta para widget dashboard */
.ranking-list-compact .ranking-row {
  padding: var(--sp-2) var(--sp-3);
  background: transparent;
  border: none;
  min-height: 44px;
}
.ranking-list-compact .ranking-row.is-me {
  background: var(--primary-softer);
}

/* Divider "..." antes de la fila "Tu" cuando estas fuera del top */
.ranking-me-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-3) 0;
  color: var(--text-subtle);
}
.ranking-me-divider span {
  font-size: var(--fs-md);
  letter-spacing: 0.5em;
  padding-left: 0.5em;
}

/* ---------- Responsive (<640px) ---------- */
@media (max-width: 640px) {
  .composer-row { flex-direction: column; }
  .composer-select { width: 100%; }
  .community-filters { overflow-x: auto; flex-wrap: nowrap; padding-bottom: var(--sp-2); }
  .chip { flex-shrink: 0; }
  .ranking-podium { gap: var(--sp-3); padding: var(--sp-5) var(--sp-3) var(--sp-4); }
  .podium-block { flex: 0 0 100px; }
  .podium-avatar .avatar { width: 56px; height: 56px; font-size: var(--fs-md); }
  .podium-1 .podium-avatar .avatar { width: 64px; height: 64px; }
  .ranking-name strong { font-size: var(--fs-xs); }
  .ranking-name .text-subtle { display: none; }
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: var(--sp-5);
}
.tab {
  padding: var(--sp-3) var(--sp-5);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: var(--fw-medium);
  font-size: var(--fs-sm);
  cursor: pointer;
  position: relative;
  transition: color var(--t-fast);
  min-height: 44px;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--primary);
  font-weight: var(--fw-semibold);
}
.tab.active::after {
  content: "";
  position: absolute;
  left: var(--sp-5);
  right: var(--sp-5);
  bottom: -1px;
  height: 2px;
  background: var(--primary);
  border-radius: var(--radius-pill);
}
