/* ==========================================================================
   Tech Ranking — Global Stylesheet
   Importado desde Layout.astro — edita aquí para cambios globales.
   ========================================================================== */

/* ═══════════════════════════════════════════════
   1. DESIGN TOKENS (CSS Variables)
   ═══════════════════════════════════════════════ */
:root {
  /* Superficies — derivan de rgb(0, 34, 36) */
  --bg-base:    #001517;
  --bg-surface: #002224;

  /* Bordes */
  --border:       #003d42;
  --border-muted: #005c63;

  /* Texto — 4 niveles de jerarquía */
  --text:           #f0fafa;  /* encabezados, estados activos */
  --text-secondary: #c0e8e4;  /* texto de cuerpo y secundario */
  --text-muted:     #7bbfb9;  /* ayuda, subtítulos */
  --text-faint:     #4a8a84;  /* etiquetas, timestamps */

  /* Gradiente de marca — rgb(107, 219, 200) como acento principal */
  --accent-from:  rgb(107, 219, 200);
  --accent-to:    rgb(61, 184, 164);
  --accent-alpha: rgba(107, 219, 200, 0.125);

  /* Colores de categoría */
  --clr-cloud: #ff9ea1;
  --clr-data:  #c535ae;
  --clr-web:   #7b55e5;
  --clr-ciber: #00da00;
  --clr-uxui:  #ad60ff;

  /* Categorías con alfa (~12.5% opacidad) */
  --clr-cloud-alpha: rgba(255, 158, 161, 0.125);
  --clr-data-alpha:  rgba(197, 53, 174, 0.125);
  --clr-web-alpha:   rgba(123, 85, 229, 0.125);
  --clr-ciber-alpha: rgba(0, 218, 0, 0.125);
  --clr-uxui-alpha:  rgba(173, 96, 255, 0.125);

  /* Feedback de respuesta */
  --clr-correct:       #22c55e;
  --clr-correct-alpha: rgba(34, 197, 94, 0.125);
  --clr-wrong:         #f43f5e;
  --clr-wrong-alpha:   rgba(244, 63, 94, 0.125);

  /* Border radius */
  --radius-sm:   0.5rem;   /* q-item */
  --radius-md:   0.75rem;  /* botones, inputs, opciones, stat-card */
  --radius-lg:   1.25rem;  /* card panel, holo-card */
  --radius-pill: 99px;     /* badges, barras */
}

/* ═══════════════════════════════════════════════
   2. UTILIDADES
   ═══════════════════════════════════════════════ */

/* Texto con gradiente de marca (clip) */
.gradient-text {
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Truncar texto en una línea */
.text-truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Números de anchura fija */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* Etiqueta en mayúsculas con tracking */
.label-upper {
  text-transform: uppercase;
  font-weight: 700;
}

/* Indicador LIVE parpadeante */
.live-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--clr-correct);
  animation: blink 2s ease-in-out infinite;
}

.live-badge--offline {
  color: var(--text-muted);
  animation: none;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.25; }
}

/* ═══════════════════════════════════════════════
   3. RESET & BASE
   ═══════════════════════════════════════════════ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  font-family: sans-serif;
  color: var(--text-secondary);
  margin: 0;
}

small {
  color: var(--text-muted);
}

/* ═══════════════════════════════════════════════
   4. LAYOUT
   ═══════════════════════════════════════════════ */
.quiz-wrapper {
  width: 100%;
  max-width: 40rem;
  padding: 1.5rem;
}

/* Aviso legal inferior */
.legal-notice {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-faint);
  line-height: 1.5;
  text-wrap: balance;
}

/* ═══════════════════════════════════════════════
   5. CARD PANEL
   ═══════════════════════════════════════════════ */
.card {
  background: rgba(0, 34, 36, 0.75);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
  animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════
   6. TIPOGRAFÍA DE PANTALLA
   ═══════════════════════════════════════════════ */
h1.quiz-title {
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ═══════════════════════════════════════════════
   7. FORMULARIO DE NICKNAME
   ═══════════════════════════════════════════════ */
.nickname-form {
  display: flex;
  flex-direction: column;
  margin-top: 1rem;
}

.nickname-form label {
  margin-top: 1rem;
}

.nickname-form input {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--bg-base);
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s;
  outline: none;
  margin-top: 0.25rem;
}

.nickname-form input:focus {
  border-color: var(--accent-from);
}

.nickname-form button {
  margin-top: 1rem;
} 

.nickname-hint:empty {
  display: none;
}
.nickname-hint.checking { color: var(--text-secondary); }
.nickname-hint.ok       { color: #4ade80; }
.nickname-hint.error    { color: #f87171; }

.checkbox-label {
  display: flex;
  gap: 0.5rem;
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] {
  flex-shrink: 0;
  accent-color: var(--accent-from);
  width: 0.875rem;
  height: 0.875rem;
  margin-top: 0;
}
.checkbox-label a {
  color: inherit;
  text-decoration: underline;
}
.form-required {
  color: #f87171;
}

/* ═══════════════════════════════════════════════
   8. BOTONES
   ═══════════════════════════════════════════════ */
button.btn,
a.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.1s, opacity 0.2s;
}

button.btn:active,
a.btn:active {
  transform: scale(0.97);
}

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

/* Primary */
button.btn-primary,
a.btn-primary {
  background: linear-gradient(135deg, var(--accent-from), var(--accent-to));
  color: var(--bg-base);
  width: 100%;
}

button.btn-primary:hover:not(:disabled),
a.btn-primary:hover {
  opacity: 0.9;
}

/* Ghost */
button.btn-ghost,
a.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  width: 100%;
  margin-top: 0.5rem;
}

button.btn-ghost:hover,
a.btn-ghost:hover {
  background: var(--bg-surface);
  color: var(--text);
}

/* Back (small, auto-width) */
button.btn-back,
a.btn-back {
  width: auto;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

/* Botón flotante (FAB) para desplegar resultados en la tarjeta compartida */
.btn-results {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 201;
  padding: 0.75rem 1.5rem;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-muted);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s, transform 0.1s;
  white-space: nowrap;
}

.btn-results:active {
  transform: scale(0.97);
}

@media (hover: hover) {
  .btn-results:hover {
    border-color: var(--accent-from);
    color: var(--text);
    box-shadow: 0 6px 28px rgba(51, 217, 190, 0.25);
  }
}

.btn-prize {
  border-color: rgba(240,180,41,0.5);
  color: #f0b429;
  left: 1rem;
  right: initial;
}

.btn-prize:hover {
  border-color: #f0b429;
  color: #ffe9a0;
  box-shadow: 0 6px 28px rgba(240,180,41,0.3);
}

/* ═══════════════════════════════════════════════
   OVERLAY PREMIO
   ═══════════════════════════════════════════════ */

.prize-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.prize-overlay.is-open {
  display: flex;
}

.prize-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 360px;
  width: 100%;
  padding: 2.5rem 2rem 2rem;
  background: linear-gradient(135deg, #1a1200, #2a1f00);
  border-radius: var(--radius-md);
  outline: 2px dashed #f0b429;
  outline-offset: -8px;
  box-shadow: 0 0 0 1px #f0b42933, 0 24px 64px rgba(0,0,0,0.7), 0 0 48px rgba(240,180,41,0.15);
  animation: fadeIn 0.25s ease;
}

.prize-close {
  position: absolute;
  top: 0.6rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: rgba(240,180,41,0.6);
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.4rem;
  transition: color 0.15s;
}
.prize-close:hover { color: #f0b429; }

.coupon-body {
  text-align: center;
}

.coupon-link {
  display: inline-block;
  padding: 0.55rem 1.4rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #f0b429, #f5d06a);
  color: #1a1200;
  font-weight: 800;
  font-size: 0.88rem;
  text-decoration: none;
  letter-spacing: 0.02em;
  box-shadow: 0 4px 16px rgba(240,180,41,0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.coupon-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(240,180,41,0.5);
}

/* Fila del código copiable */
.coupon-code-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.coupon-code {
  font-family: monospace;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #f0b429;
  background: rgba(240,180,41,0.12);
  padding: 0.3rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(240,180,41,0.35);
  user-select: all;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.coupon-code:hover {
  background: rgba(240,180,41,0.22);
}

.coupon-code:active {
  transform: scale(0.96);
}

.coupon-code--copied {
  background: rgba(240,180,41,0.28);
  color: #ffe9a0;
  letter-spacing: 0.08em;
}

/* ═══════════════════════════════════════════════
   9. BARRA DE PROGRESO
   ═══════════════════════════════════════════════ */
.progress-bar-wrapper {
  margin-top: 2rem;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-faint);
  margin-top: 0.5rem;
}

.progress-bar-bg {
  background: var(--bg-base);
  border-radius: var(--radius-pill);
  height: 8px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
  transition: width 0.4s ease;
}

/* ═══════════════════════════════════════════════
   10. BADGES DE CATEGORÍA
   ═══════════════════════════════════════════════ */
.tag-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.tag-cloud { background: var(--clr-cloud-alpha); color: var(--clr-cloud); border: 1px solid var(--clr-cloud); }
.tag-data  { background: var(--clr-data-alpha);  color: var(--clr-data);  border: 1px solid var(--clr-data); }
.tag-web   { background: var(--clr-web-alpha);   color: var(--clr-web);   border: 1px solid var(--clr-web); }
.tag-ciber { background: var(--clr-ciber-alpha); color: var(--clr-ciber); border: 1px solid var(--clr-ciber); }
.tag-uxui  { background: var(--clr-uxui-alpha);  color: var(--clr-uxui);  border: 1px solid var(--clr-uxui); }

/* ═══════════════════════════════════════════════
   11. PREGUNTA Y OPCIONES
   ═══════════════════════════════════════════════ */
.question-text {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.55;
  margin-bottom: 1rem;
  color: var(--text);
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-base);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
  text-align: left;
}

.option-btn:active:not(:disabled) {
  transform: scale(0.97);
}

@media (hover: hover) {
  .option-btn:hover:not(:disabled) {
    border-color: var(--accent-from);
    background: var(--clr-cloud-alpha);
  }
}

.option-btn.selected {
  border-color: var(--accent-to);
  background: var(--accent-alpha);
  color: var(--text);
}

.option-btn.correct {
  border-color: var(--clr-correct);
  background: var(--clr-correct-alpha);
  color: var(--clr-correct);
}

.option-btn.wrong {
  border-color: var(--clr-wrong);
  background: var(--clr-wrong-alpha);
  color: var(--clr-wrong);
}

.option-btn:disabled {
  cursor: not-allowed;
}

/* Botones atenuados mientras se cumple el tiempo mínimo de lectura */
.options-list.waiting .option-btn {
  opacity: 0.4;
}

/* Barra de progreso de lectura mínima */
.read-timer {
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 1rem;
}

.read-timer-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-from), var(--accent-to));
  border-radius: var(--radius-pill);
}

.option-letter {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  flex-shrink: 0;
  border: 1px solid var(--border-muted);
}

/* ═══════════════════════════════════════════════
   12. PANTALLA DE RESULTADOS
   ═══════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(10rem, 100%), 1fr));
  gap: 0.75rem;
  margin: 1rem 0 2rem;
}

.stat-card {
  background: var(--bg-base);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  border: 1px solid var(--bg-surface);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-from);
}

/* Desglose por categoría */
.tag-breakdown {
  margin-bottom: 2rem;
}

.tag-breakdown h3,
.q-review h3 {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.tag-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.tag-bar-bg {
  flex: 1;
  background: var(--bg-base);
  border-radius: var(--radius-pill);
  height: 8px;
  overflow: hidden;
}

.tag-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
}

.tag-bar-cloud { background: var(--clr-cloud); }
.tag-bar-data  { background: var(--clr-data); }
.tag-bar-web   { background: var(--clr-web); }
.tag-bar-ciber { background: var(--clr-ciber); }
.tag-bar-uxui  { background: var(--clr-uxui); }

.tag-time {
  font-size: 0.875rem;
  color: var(--text-muted);
  min-width: 3rem;
  text-align: right;
}

/* Revisión de preguntas */
.q-review {
  margin-bottom: 2rem;
}

.q-item {
  background: var(--bg-base);
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-left: 3px solid var(--border);
  font-size: 0.85rem;
}

.q-item.q-correct { border-left-color: var(--clr-correct); }
.q-item.q-wrong   { border-left-color: var(--clr-wrong); }

.q-item-header {
  margin-bottom: 0.25rem;
}

.q-item-title { color: var(--text-secondary); }

.q-item-time {
  color: var(--text-faint);
  font-size: 0.78rem;
}

.q-item-answer {
  color: var(--text-faint);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.q-item-correct {
  color: var(--clr-correct);
  font-weight: 600;
  font-size: 0.8rem;
}

/* Panel flotante de resultados detallados */
.results-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-base);
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transform: translateY(1.5rem);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.results-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.results-drawer-inner {
  max-width: 40rem;
  margin: 0 auto;
  padding: 2rem;
}

/* ═══════════════════════════════════════════════
   13. PANTALLA DE CARGA (entre quiz y tarjeta)
   ═══════════════════════════════════════════════ */
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  gap: 1.25rem;
  text-align: center;
}

.loading-spinner {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-pill);
  border: 3px solid var(--border);
  border-top-color: var(--accent-from);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 16ch; /* evita que el texto salte al cambiar los puntos */
}

/* ═══════════════════════════════════════════════
   14. TARJETA HOLOGRÁFICA
   ═══════════════════════════════════════════════ */
.card-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
  animation: fadeIn 0.4s ease;
}

/* Escena 3D */
.holo-scene {
  width: 100%;
  max-width: 20rem;
  perspective: 80rem;
  perspective-origin: center center;
}

/* La carta */
.holo-card {
  position: relative;
  width: 90%;
  margin: 0 auto;
  aspect-ratio: 1 / 1.586;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transform-style: preserve-3d;
  transition: box-shadow 0.3s ease;
  will-change: transform;
  background: var(--holo-gradient);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 20px 60px rgba(0, 0, 0, 0.55),
    0 0 40px var(--holo-glow, rgba(100, 100, 255, 0.4));
}

/* Capas compartidas */
.holo-layer {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.holo-shimmer {
  mix-blend-mode: screen;
  opacity: 0.6;
  transition: background-position 0.1s;
}

.holo-foil {
  mix-blend-mode: color-dodge;
  opacity: 0.12;
  transition: opacity 0.15s;
}

.holo-glare {
  mix-blend-mode: screen;
  opacity: 0.9;
}

.holo-sparkles {
  mix-blend-mode: screen;
}

/* Destellos */
.sparkle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: sparkle-anim linear infinite;
}

@keyframes sparkle-anim {
  0%   { opacity: 0; transform: scale(0.4); }
  40%  { opacity: 0.9; transform: scale(1); }
  70%  { opacity: 0.5; transform: scale(0.8); }
  100% { opacity: 0; transform: scale(0.4); }
}

/* Contenido de la carta */
.holo-content {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  color: var(--bg-base);
  text-align: center;
  font-size: 0.875rem;
}

.holo-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: auto;
}

.holo-series {
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.75;
}

.holo-tag-chip {
  background: var(--accent-from);
  backdrop-filter: blur(6px);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.5rem;
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
}

.holo-emoji-big {
  width: 90%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.5));
  margin: 0 auto 1rem;
}

.holo-nickname {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.holo-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: auto;
}

.holo-stat {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1;
}

/* ═══════════════════════════════════════════════
   15. RANKING EN TIEMPO REAL
   ═══════════════════════════════════════════════ */

/* Lista */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Grid compartido por cabecera y filas */
.rank-header,
.rank-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr 12rem 4rem 4rem;
  align-items: center;
  gap: 0.75rem;
}

/* Cabecera */
.rank-header {
  padding: 0.25rem 1rem;
  color: var(--text-faint);
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
}

.rank-header .col-pos { text-align: center; }

/* Fila */
.rank-row {
  padding: 0.5rem 1rem;
  background: var(--bg-base);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}

.rank-row.new-entry { animation: slideIn 0.5s ease; }

/* Top 3 */
.rank-row.top-1 { background: rgba(255, 215, 0, 0.05);   border-color: rgba(255, 215, 0, 0.45); }
.rank-row.top-2 { background: rgba(192, 192, 192, 0.04); border-color: rgba(192, 192, 192, 0.35); }
.rank-row.top-3 { background: rgba(205, 127, 50, 0.04);  border-color: rgba(205, 127, 50, 0.35); }

/* Posición */
.rank-row .col-pos { text-align: center; }

.medal {
  font-size: 1.8rem;
  line-height: 1;
}

.pos-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-pill);
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 700;
}

/* Jugador */
.player {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.rank-nick {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Aciertos */
.score-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.rank-score {
  font-size: 1rem;
  font-weight: 700;
  color: var(--clr-correct);
}

.rank-score small {
  font-size: 0.75em;
  color: var(--text-muted);
  font-weight: 400;
}

.score-bar {
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.score-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-from), var(--clr-correct));
  border-radius: var(--radius-pill);
  transition: width 0.6s ease;
}

/* Tiempo */
.rank-time {
  font-size: 0.97rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums; /* ver también: .tabular-nums */
}

/* Estado vacío */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
  color: var(--text-muted);
  font-size: 1.25rem;
  gap: 0.75rem;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-0.75rem); }
  to   { opacity: 1; transform: translateY(0); }
}