/* ==========================================================================
   CompetenciasTrader — estilos responsive
   Los estilos inline del HTML se mantienen (diseño ya aprobado); aquí solo
   se agregan clases estructurales + media queries que colapsan el layout
   en tablet/móvil. Se usa !important únicamente donde hace falta pisar un
   style="" inline existente.
   ========================================================================== */

:root {
  --bg: #0b0b0f;
  --bg-alt: #111116;
  --card: #16161c;
  --border: rgba(255, 255, 255, 0.08);
  --text: #f5f5f7;
  --text-dim: #9b9ba6;
  --accent: #f2711c;
  --green: #3ecf8e;
}

* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Header / navegación ---------- */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}
.nav-toggle svg {
  width: 26px;
  height: 26px;
}

/* ---------- Live dot ---------- */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulseDot 1.6s infinite ease-in-out;
}

/* ---------- Filtro de competencias ---------- */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}
.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.3px;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    background 0.15s ease;
}
.filter-tab .tab-count {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}
.filter-tab:hover {
  border-color: rgba(242, 113, 28, 0.5);
  color: var(--text);
}
.filter-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.filter-tab.active .tab-count {
  background: rgba(11, 11, 15, 0.25);
  color: var(--bg);
}

.comp-empty {
  display: none;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-dim);
  border: 1px dashed var(--border);
  border-radius: 14px;
  font-size: 14px;
}
.comp-empty.show {
  display: block;
}

/* ---------- Hero: mockup + velas (SVG propio) ---------- */
.hero-mock {
  position: relative;
  z-index: 2;
  width: 84%;
}
.hero-mock .mock-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.hero-mock .mock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
}
.hero-mock .mock-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(62, 207, 142, 0.12);
  color: var(--green);
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.candles-svg {
  width: 100%;
  height: auto;
  display: block;
}
.candle-bar {
  transform-origin: bottom;
  animation: growCandle 0.6s ease both;
}
@keyframes growCandle {
  from {
    transform: scaleY(0);
    opacity: 0;
  }
  to {
    transform: scaleY(1);
    opacity: 1;
  }
}

/* ---------- Iconos de pasos ---------- */
.step-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(242, 113, 28, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  position: relative;
}
.step-icon svg {
  width: 22px;
  height: 22px;
  stroke: var(--accent);
}

/* ---------- Medallas leaderboard ---------- */
.rank-medal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

/* Tablet grande: 4→2 columnas, 3→2 columnas */
@media (max-width: 1100px) {
  .steps-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .competitions-grid,
  .testimonials-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Tablet: header/nav, hero se apila, paddings se reducen */
@media (max-width: 860px) {
  .site-header {
    padding: 14px 20px !important;
  }
  .nav-toggle {
    display: flex !important;
  }
  .site-nav {
    display: none !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 18px !important;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 20px 24px !important;
    z-index: 60;
  }
  .site-nav.open {
    display: flex !important;
  }

  .hero-section {
    grid-template-columns: 1fr !important;
    min-height: auto !important;
  }
  .hero-left {
    padding: 56px 28px !important;
  }
  .hero-title {
    font-size: 56px !important;
  }
  .hero-right {
    min-height: 320px;
    flex-direction: row !important;
  }
  .hero-right > div {
    min-height: 160px !important;
  }

  section {
    padding-left: 28px !important;
    padding-right: 28px !important;
  }
  .site-footer {
    padding-left: 28px !important;
    padding-right: 28px !important;
  }

  .leaderboard-row,
  .leaderboard-head {
    grid-template-columns: 34px 1fr 90px 90px !important;
    padding: 14px 18px !important;
  }
}

/* Móvil: todo a 1 columna, tipografía compacta */
@media (max-width: 560px) {
  .site-nav {
    gap: 14px !important;
  }

  .steps-grid,
  .competitions-grid,
  .testimonials-grid,
  .footer-grid {
    grid-template-columns: 1fr !important;
  }

  section {
    padding-top: 56px !important;
    padding-bottom: 56px !important;
  }

  .hero-left {
    padding: 40px 20px !important;
  }
  .hero-title {
    font-size: 40px !important;
  }
  .hero-left p {
    font-size: 15px !important;
  }
  .hero-right {
    flex-direction: column !important;
  }

  h2 {
    font-size: 32px !important;
  }

  .leaderboard-row,
  .leaderboard-head {
    grid-template-columns: 28px 1fr 76px !important;
  }
  .leaderboard-row span:last-child,
  .leaderboard-head span:last-child {
    display: none;
  }

  .filter-tabs {
    gap: 8px;
  }
  .filter-tab {
    font-size: 12px;
    padding: 8px 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .candle-bar,
  .live-dot {
    animation: none !important;
  }
}
