/* ============================================================
   Sintéticos Replay — Comunidad
   ------------------------------------------------------------
   Mismo lenguaje visual del sitio (paneles oscuros translúcidos,
   azul de selección, mono para datos). El gráfico de cada análisis
   manda: es la prueba, no la decoración.
   ============================================================ */

.sr-com {
  --panel: rgba(18, 21, 27, 0.9);
  --line: rgba(255, 255, 255, 0.1);
  --line-soft: rgba(255, 255, 255, 0.05);
  --blue: #2962ff;
  --up: #00bfa5;
  --down: #f23645;
  --warn: #f7a600;
  --muted: #8b949e;
}

/* El navbar (css/style.css .navbar) es position:fixed con 90px de alto —
   sale de la fila normal del documento, así que el contenido necesita su
   propio margen de arriba o queda tapado debajo. */
.com-layout {
  display: flex; gap: 24px; max-width: 1300px;
  margin: 106px auto 40px; padding: 0 24px; align-items: flex-start;
}
.com-main { flex: 1; min-width: 0; }
.com-side { width: 320px; flex: none; position: sticky; top: 106px; }

@media (max-width: 1040px) {
  .com-layout { flex-direction: column; }
  .com-side { width: 100%; position: static; }
}
@media (max-width: 600px) {
  .com-layout { padding: 0 14px; margin: 106px auto 24px; }
}

/* ---------- Encabezado ---------- */
.com-head { display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.com-title { font-size: 28px; font-weight: 700; color: #fff; margin: 0; }
.com-sub { color: var(--muted); font-size: 14px; margin: 6px 0 0; max-width: 60ch; }

/* ---------- Filtros ---------- */
.com-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.com-chip {
  background: rgba(255,255,255,0.04); border: 1px solid var(--line);
  color: var(--muted); font-size: 12px; font-weight: 500;
  padding: 7px 14px; border-radius: 20px; cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.com-chip:hover { color: #fff; border-color: rgba(255,255,255,0.2); }
.com-chip.on { background: rgba(41,98,255,0.16); border-color: var(--blue); color: #fff; }
.com-chip:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Tarjeta de análisis ---------- */
.post-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; overflow: hidden; margin-bottom: 20px;
  backdrop-filter: blur(16px);
}
.post-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px 12px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff; letter-spacing: .02em;
}
.post-who { flex: 1; min-width: 0; }
.post-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-name b { color: #fff; font-size: 14.5px; font-weight: 600; }
.post-name a { color: #fff; text-decoration: none; }
.post-name a:hover { text-decoration: underline; }
.badge-role {
  font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 4px;
  background: rgba(41,98,255,0.16); color: #6b9bff; border: 1px solid rgba(41,98,255,0.3);
}
.badge-role.master { background: rgba(247,166,0,0.14); color: var(--warn); border-color: rgba(247,166,0,0.32); }
.badge-role.team   { background: rgba(0,191,165,0.14); color: var(--up); border-color: rgba(0,191,165,0.3); }
.post-meta { font-size: 12px; color: var(--muted); margin-top: 2px;
  font-family: 'JetBrains Mono', monospace; }

.post-instrument {
  display: flex; align-items: center; gap: 8px; flex: none;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
}
.tag-symbol { background: rgba(255,255,255,0.06); border: 1px solid var(--line);
  color: #fff; padding: 4px 9px; border-radius: 6px; font-weight: 600; }
.tag-tf { color: var(--muted); }

.post-caption { padding: 0 18px 14px; color: #c9d1d9; font-size: 15px;
  line-height: 1.6; white-space: pre-wrap; word-break: break-word; }

/* El gráfico del snapshot: la prueba verificable del análisis. */
.post-chart { position: relative; height: 300px; background: #0c0e12;
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.post-chart-state {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 13px; gap: 8px; text-align: center; padding: 20px;
}
.post-verified {
  position: absolute; top: 10px; right: 12px; z-index: 3;
  font-size: 10px; font-family: 'JetBrains Mono', monospace; letter-spacing: .03em;
  background: rgba(12,14,18,0.82); border: 1px solid rgba(0,191,165,0.3);
  color: var(--up); padding: 3px 8px; border-radius: 5px;
  display: flex; align-items: center; gap: 5px;
}
@media (max-width: 600px) { .post-chart { height: 230px; } }

/* ---------- Acciones ---------- */
.post-actions { display: flex; align-items: center; gap: 8px; padding: 12px 18px; flex-wrap: wrap; }
.act {
  background: rgba(255,255,255,0.03); border: 1px solid var(--line);
  color: var(--muted); font-size: 13px; font-weight: 500;
  padding: 7px 13px; border-radius: 9px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
  font-family: inherit;
}
.act:hover { color: #fff; border-color: rgba(255,255,255,0.22); }
.act:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.act.on-up   { background: rgba(0,191,165,0.14); border-color: rgba(0,191,165,0.4); color: var(--up); }
.act.on-down { background: rgba(242,54,69,0.12); border-color: rgba(242,54,69,0.4); color: var(--down); }
.act .n { font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.act-spacer { flex: 1; }
.act.subtle { background: transparent; border-color: transparent; color: #5c636d; }
.act.subtle:hover { color: var(--muted); border-color: var(--line); }

/* ---------- Estados ---------- */
.com-empty {
  background: var(--panel); border: 1px dashed var(--line); border-radius: 18px;
  padding: 56px 28px; text-align: center; color: var(--muted);
}
.com-empty i { font-size: 30px; color: #3d4453; display: block; margin-bottom: 14px; }
.com-empty h3 { color: #fff; font-size: 17px; margin: 0 0 8px; font-weight: 600; }
.com-empty p { margin: 0 auto; max-width: 46ch; font-size: 14px; line-height: 1.6; }

.com-skeleton { background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; height: 380px; margin-bottom: 20px; position: relative; overflow: hidden; }
.com-skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.035), transparent);
  animation: com-shimmer 1.4s infinite;
}
@keyframes com-shimmer { 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .com-skeleton::after { animation: none; } }

/* ---------- Panel lateral ---------- */
.side-card { background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 20px; margin-bottom: 18px; backdrop-filter: blur(16px); }
.side-title { font-size: 12px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin: 0 0 14px;
  display: flex; align-items: center; gap: 8px; }

.trader-row { display: flex; align-items: center; gap: 11px; padding: 10px 0;
  border-bottom: 1px solid var(--line-soft); }
.trader-row:last-child { border-bottom: none; }
.trader-info { flex: 1; min-width: 0; }
.trader-name { color: #fff; font-size: 13.5px; font-weight: 600;
  display: flex; align-items: center; gap: 6px; }
.trader-name a { color: #fff; text-decoration: none; }
.trader-name a:hover { text-decoration: underline; }
.trader-stat { font-size: 11.5px; color: var(--muted);
  font-family: 'JetBrains Mono', monospace; margin-top: 1px; }
.btn-follow {
  background: transparent; border: 1px solid var(--blue); color: #6b9bff;
  font-size: 11.5px; font-weight: 600; padding: 5px 12px; border-radius: 16px;
  cursor: pointer; flex: none; transition: background .16s ease, color .16s ease;
  font-family: inherit;
}
.btn-follow:hover { background: rgba(41,98,255,0.14); color: #fff; }
.btn-follow.on { border-color: var(--line); color: var(--muted); }
.btn-follow.on:hover { border-color: var(--down); color: var(--down); background: transparent; }
.btn-follow:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Señal de "está transmitiendo ahora" */
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--down); flex: none;
  animation: live-pulse 1.6s ease-in-out infinite;
}
@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242,54,69,0.55); }
  70%      { box-shadow: 0 0 0 6px rgba(242,54,69,0); }
}
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.tag-live {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(242,54,69,0.14); border: 1px solid rgba(242,54,69,0.4);
  color: #ff6b78; font-size: 10px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 5px;
}

.rules-list { margin: 0; padding: 0; list-style: none; }
.rules-list li { display: flex; gap: 9px; align-items: flex-start;
  font-size: 12.5px; color: var(--muted); line-height: 1.55; padding: 6px 0; }
.rules-list i { color: #3d4453; font-size: 11px; margin-top: 4px; flex: none; }

/* ---------- Diálogos ---------- */
.com-dialog {
  position: fixed; inset: 0; z-index: 9000; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(4,6,10,0.72); backdrop-filter: blur(4px);
}
.com-dialog.open { display: flex; }
.com-dialog-box {
  background: #12151b; border: 1px solid var(--line); border-radius: 18px;
  padding: 26px; width: 100%; max-width: 480px; max-height: 86vh; overflow-y: auto;
}
.com-dialog h3 { color: #fff; font-size: 18px; margin: 0 0 6px; font-weight: 600; }
.com-dialog p.hint { color: var(--muted); font-size: 13px; margin: 0 0 18px; line-height: 1.55; }
.com-field { width: 100%; background: rgba(0,0,0,0.35); border: 1px solid var(--line);
  border-radius: 10px; color: #fff; padding: 12px 14px; font-size: 14px;
  font-family: inherit; resize: vertical; line-height: 1.55; }
.com-field:focus { outline: none; border-color: var(--blue); }
.com-count { text-align: right; font-size: 11px; color: #5c636d;
  font-family: 'JetBrains Mono', monospace; margin-top: 6px; }
.com-dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.btn-ghost {
  background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 10px 18px; border-radius: 10px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.btn-ghost:hover { color: #fff; border-color: rgba(255,255,255,0.22); }
.btn-primary {
  background: var(--blue); border: 1px solid var(--blue); color: #fff;
  padding: 10px 20px; border-radius: 10px; font-size: 13px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.snap-summary {
  background: rgba(255,255,255,0.03); border: 1px solid var(--line-soft);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted);
  display: flex; flex-direction: column; gap: 5px;
}
.snap-summary b { color: #fff; font-weight: 600; }

/* ---------- Aviso flotante ---------- */
.com-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(80px);
  background: #181c24; border: 1px solid var(--line); color: #fff;
  padding: 13px 20px; border-radius: 12px; font-size: 13.5px; z-index: 9500;
  opacity: 0; transition: opacity .22s ease, transform .22s ease;
  box-shadow: 0 8px 28px rgba(0,0,0,.45); max-width: 90vw; text-align: center;
}
.com-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.com-toast.ok  { border-color: rgba(0,191,165,0.45); }
.com-toast.err { border-color: rgba(242,54,69,0.45); }
@media (prefers-reduced-motion: reduce) {
  .com-toast { transition: opacity .22s ease; transform: translateX(-50%); }
  .com-toast.show { transform: translateX(-50%); }
}

/* ---------- Directorio de traders ---------- */
.traders-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
@media (max-width: 720px) { .traders-grid { grid-template-columns: 1fr; } }

.trader-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 20px; backdrop-filter: blur(16px);
}
.trader-card-top { display: flex; align-items: center; gap: 14px; }
.trader-bio { color: #8b949e; font-size: 13px; line-height: 1.55; margin: 14px 0 0; }

.hit-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.hit-bar { flex: 1; height: 5px; background: rgba(255,255,255,0.07); border-radius: 3px; overflow: hidden; }
.hit-bar span { display: block; height: 100%; background: var(--up); border-radius: 3px; }
.hit-val { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--up); flex: none; }
.hit-none { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: #5c636d; }

/* ---------- Perfil de trader ---------- */
.profile-head {
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 26px; display: flex; gap: 20px; align-items: flex-start;
  flex-wrap: wrap; backdrop-filter: blur(16px); margin-bottom: 22px;
}
.profile-head .avatar { width: 68px; height: 68px; font-size: 22px; }
.profile-id { flex: 1; min-width: 220px; }
.profile-id h1 { color: #fff; font-size: 24px; margin: 0 0 6px; font-weight: 700;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-bio { color: #8b949e; font-size: 14px; line-height: 1.6; margin: 0 0 12px; max-width: 62ch; }
.profile-numbers { display: flex; gap: 22px; flex-wrap: wrap;
  font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: #8b949e; }
.profile-numbers b { color: #fff; font-size: 15px; display: block; font-weight: 600; }
.profile-social {
  display: none; align-items: center; gap: 6px; margin-top: 12px;
  color: #6b9bff; font-size: 12.5px; text-decoration: none;
}
.profile-social:hover { text-decoration: underline; }

.profile-cols { display: grid; grid-template-columns: 1fr 340px; gap: 22px; align-items: start; }
@media (max-width: 980px) { .profile-cols { grid-template-columns: 1fr; } }

.session-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line-soft); text-decoration: none;
}
.session-row:last-child { border-bottom: none; }
.session-icon {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: #6b7484; font-size: 13px;
}
.session-icon.on { background: rgba(242,54,69,0.14); border-color: rgba(242,54,69,0.4); color: #ff6b78; }
.session-title { color: #fff; font-size: 13.5px; font-weight: 500; }

.mini-post {
  display: block; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px; margin-bottom: 12px; text-decoration: none;
  transition: border-color .18s ease;
}
.mini-post:hover { border-color: rgba(255,255,255,0.2); }
.mini-post-head { display: flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; margin-bottom: 10px; }
.mini-post-text { color: #c9d1d9; font-size: 14px; line-height: 1.55; margin: 0 0 12px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mini-post-foot { display: flex; gap: 16px; font-family: 'JetBrains Mono', monospace; font-size: 12px; }

/* Botón de transmitir, dentro del terminal */
.tool.live-on { color: #f23645 !important; }
.tool.live-on .ico { animation: live-pulse 1.6s ease-in-out infinite; border-radius: 50%; }
@media (prefers-reduced-motion: reduce) { .tool.live-on .ico { animation: none; } }
