/* ===== VARIABLES ===== */
:root {
  --bg: #0a0a0a; --bg2: #111; --card: #161616; --card-hover: #1c1c1c;
  --border: #242424; --border-light: #2e2e2e;
  --red: #ff0000; --red-dim: rgba(255,0,0,0.12); --red-glow: rgba(255,0,0,0.08);
  --green: #22c55e; --yellow: #eab308; --orange: #f97316; --blue: #3b82f6; --purple: #a78bfa;
  --text: #f4f4f4; --text2: #a3a3a3; --text3: #555;
  --radius: 14px; --shadow: 0 4px 24px rgba(0,0,0,0.5);
  --transition: 0.2s ease;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; }
textarea { font-family: 'Inter', monospace; }
code { font-family: monospace; background: var(--bg2); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; color: #ff8080; }

/* ===== LIQUID GLASS BUTTONS ===== */
.btn-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  color: var(--text);
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -1px 0 rgba(0,0,0,0.25),
    0 2px 8px rgba(0,0,0,0.35),
    0 1px 2px rgba(0,0,0,0.2);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  transition: all 0.25s cubic-bezier(0.1,0.4,0.2,1);
  white-space: nowrap;
}
.btn-glass::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  backdrop-filter: url('#glass-distort');
  pointer-events: none;
  opacity: 0.4;
}
.btn-glass:hover {
  background: rgba(255,255,255,0.12);
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.2),
    inset 0 -1px 0 rgba(0,0,0,0.25),
    0 6px 20px rgba(0,0,0,0.45),
    0 2px 6px rgba(0,0,0,0.3);
}
.btn-glass:active { transform: translateY(0) scale(0.97); }

.btn-glass-red {
  color: #fff;
  background: rgba(220,30,30,0.35);
  border-color: rgba(255,120,120,0.3);
  box-shadow:
    inset 0 1px 0 rgba(255,200,200,0.22),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 4px 20px rgba(255,0,0,0.22),
    0 1px 4px rgba(0,0,0,0.25),
    0 0 0 1px rgba(255,60,60,0.15) inset;
}
.btn-glass-red:hover {
  background: rgba(220,30,30,0.5);
  box-shadow:
    inset 0 1px 0 rgba(255,200,200,0.28),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 8px 30px rgba(255,0,0,0.35),
    0 2px 8px rgba(0,0,0,0.3);
}

.analyze-btn { padding: 12px 26px; font-size: 0.9rem; flex-shrink: 0; }
.analyze-btn.small { padding: 10px 20px; font-size: 0.85rem; margin-top: 16px; }

/* ===== PROGRESS BAR ===== */
.progress-bar { position: fixed; top: 0; left: 0; width: 0; height: 3px; background: var(--red); z-index: 9999; transition: width 0.4s ease; box-shadow: 0 0 8px var(--red); }

/* ===== HEADER ===== */
.app-header { position: sticky; top: 0; z-index: 100; background: rgba(10,10,10,0.9); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.header-inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-text { font-size: 1.05rem; color: var(--text); letter-spacing: -0.02em; }
.logo-text strong { color: var(--red); }
.header-badge { font-size: 0.72rem; color: var(--text3); background: var(--bg2); border: 1px solid var(--border); padding: 4px 10px; border-radius: 20px; }

/* ===== HERO ===== */
.hero { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; padding: 60px 24px; }
.hero-content { position: relative; z-index: 2; text-align: center; max-width: 700px; width: 100%; }
.hero-label { display: inline-block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red); background: var(--red-dim); border: 1px solid rgba(255,0,0,0.25); padding: 5px 14px; border-radius: 20px; margin-bottom: 24px; }
.hero-title { font-size: clamp(2.2rem,5vw,3.8rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; margin-bottom: 18px; }
.hero-title .highlight { background: linear-gradient(135deg, #ff0000, #ff6b6b); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-subtitle { font-size: 0.98rem; color: var(--text2); margin-bottom: 36px; max-width: 540px; margin-left: auto; margin-right: auto; }
.search-box { display: flex; align-items: center; background: rgba(22,22,22,0.8); backdrop-filter: blur(20px); border: 1.5px solid var(--border-light); border-radius: 50px; padding: 6px 6px 6px 20px; gap: 10px; transition: border-color var(--transition), box-shadow var(--transition); max-width: 620px; margin: 0 auto; }
.search-box:focus-within { border-color: rgba(255,0,0,0.5); box-shadow: 0 0 0 3px var(--red-glow); }
.search-icon { color: var(--text3); flex-shrink: 0; display: flex; }
.search-input { flex: 1; background: none; border: none; outline: none; font-size: 0.95rem; color: var(--text); min-width: 0; }
.search-input::placeholder { color: var(--text3); }
.search-examples { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.examples-label { font-size: 0.8rem; color: var(--text3); }
.example-chip { font-size: 0.78rem; color: var(--text2); background: var(--bg2); border: 1px solid var(--border); padding: 4px 12px; border-radius: 20px; transition: all var(--transition); }
.example-chip:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }
.hero-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.09; animation: blobMove 8s ease-in-out infinite; }
.blob-1 { width: 600px; height: 600px; background: #ff0000; top: -200px; right: -100px; }
.blob-2 { width: 500px; height: 500px; background: #ff4444; bottom: -150px; left: -150px; animation-delay: -4s; }
@keyframes blobMove { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,-20px) scale(1.05); } }

/* ===== LOADING / ERROR ===== */
.loading-state, .error-state { display: flex; align-items: center; justify-content: center; min-height: 60vh; padding: 40px 24px; }
.loading-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 28px; }
.loading-spinner { width: 52px; height: 52px; border: 3px solid var(--border); border-top-color: var(--red); border-radius: 50%; animation: spin 0.9s linear infinite; }
.loading-spinner.small { width: 26px; height: 26px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-steps { display: flex; flex-direction: column; gap: 10px; }
.loading-step { font-size: 0.88rem; color: var(--text3); display: flex; align-items: center; gap: 8px; }
.loading-step::before { content: '○'; font-size: 0.7rem; }
.loading-step.active { color: var(--text); font-weight: 500; }
.loading-step.active::before { content: '●'; color: var(--red); }
.loading-step.done { color: var(--green); }
.loading-step.done::before { content: '✓'; }
.error-card { background: var(--card); border: 1px solid rgba(255,0,0,0.2); border-radius: var(--radius); padding: 48px; text-align: center; max-width: 480px; }
.error-icon { font-size: 2.5rem; margin-bottom: 16px; }
.error-card h3 { font-size: 1.2rem; margin-bottom: 10px; }
.error-card p { color: var(--text2); font-size: 0.95rem; }

/* ===== CHANNEL HERO ===== */
.results.hidden { display: none; }
.hidden { display: none !important; }
.channel-hero { position: relative; background: var(--bg2); overflow: hidden; }
.channel-banner-wrap { position: relative; width: 100%; height: 220px; overflow: hidden; background: linear-gradient(135deg, #1a0000, #330000); }
.channel-banner { width: 100%; height: 100%; object-fit: cover; }
.banner-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 30%, rgba(0,0,0,0.9)); }
.channel-hero-content { max-width: 1280px; margin: -60px auto 0; padding: 0 32px 32px; display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; position: relative; z-index: 2; }
.channel-identity { display: flex; align-items: flex-end; gap: 20px; }
.avatar-wrap { flex-shrink: 0; width: 100px; height: 100px; border-radius: 50%; border: 4px solid var(--bg2); overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.channel-avatar { width: 100%; height: 100%; object-fit: cover; }
.channel-name { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 2px; }
.channel-handle { font-size: 0.9rem; color: var(--text2); }
.channel-country { font-size: 0.8rem; color: var(--text3); margin-top: 2px; }
.channel-hero-stats { display: flex; align-items: center; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 24px; flex-shrink: 0; flex-wrap: wrap; }
.hero-stat { text-align: center; padding: 0 20px; }
.hero-stat-value { display: block; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.hero-stat-label { display: block; font-size: 0.72rem; color: var(--text2); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.05em; }
.hero-stat-divider { width: 1px; height: 36px; background: var(--border); }

/* ===== MONETIZACIÓN ===== */
.monetization-banner {
  background: linear-gradient(135deg, rgba(34,197,94,0.06) 0%, rgba(22,22,22,1) 60%);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: var(--radius);
  padding: 24px 28px;
  overflow: hidden;
  position: relative;
}
.monetization-banner::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34,197,94,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.mono-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.mono-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }
.mono-sub { font-size: 0.78rem; color: var(--text2); }
.mono-disclaimer { font-size: 0.68rem; color: var(--text3); text-align: right; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; line-height: 1.5; }
.mono-stats-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.mono-stat-card { background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 10px; padding: 14px 18px; flex: 1; min-width: 140px; }
.mono-stat-card.highlight { border-color: rgba(34,197,94,0.3); background: rgba(34,197,94,0.05); }
.mono-stat-val { display: block; font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; color: var(--green); }
.mono-stat-lbl { display: block; font-size: 0.72rem; color: var(--text2); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.04em; }
.mono-stat-ctx { display: block; font-size: 0.7rem; color: var(--text3); margin-top: 4px; }
.mono-section-label { font-size: 0.82rem; font-weight: 600; color: var(--text2); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.06em; }
.mono-videos-list { display: flex; flex-direction: column; gap: 8px; }
.mono-video-row { display: flex; align-items: center; gap: 12px; background: rgba(0,0,0,0.2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; cursor: pointer; transition: border-color var(--transition); }
.mono-video-row:hover { border-color: rgba(34,197,94,0.3); }
.mono-video-rank { font-size: 0.75rem; font-weight: 800; color: var(--text3); width: 20px; text-align: center; }
.mono-video-thumb { width: 72px; height: 40px; border-radius: 5px; object-fit: cover; flex-shrink: 0; }
.mono-video-info { flex: 1; min-width: 0; }
.mono-video-title { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mono-video-sub { font-size: 0.72rem; color: var(--text2); margin-top: 2px; }
.mono-video-earn { font-size: 0.85rem; font-weight: 800; color: var(--green); white-space: nowrap; }

/* ===== LAYOUT ===== */
.section-container { max-width: 1280px; margin: 0 auto; padding: 24px 32px; }
.section-title { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
.section-subtitle { font-size: 0.78rem; font-weight: 400; color: var(--text3); margin-left: 8px; }
.section-desc { font-size: 0.83rem; color: var(--text2); margin-bottom: 14px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.card-title { font-size: 1rem; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); display: flex; align-items: center; flex-wrap: wrap; }
.card-subtitle { font-size: 0.72rem; font-weight: 400; color: var(--text3); margin-left: 10px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
/* ⚠️ con «1fr» una palabra sin espacios (un hashtag, un enlace, un @usuario largo)
   ensanchaba la columna hasta su tamaño mínimo y la tarjeta SEO/Radar se salía
   de la pantalla en el celular: minmax(0,…) fija el ancho y el texto se parte
   solo si no cabe */
.two-col, .radar-data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.two-col > *, .radar-data-item, .seo-item-label { min-width: 0; }
.seo-item-score { flex: none; white-space: nowrap; }   /* «10/10» nunca se parte */
.two-col { overflow-wrap: break-word; }
.rec-body, .portadas-header > div:first-child { min-width: 0; overflow-wrap: break-word; }
.rec-header > * { max-width: 100%; }

/* ===== DESCRIPTION ===== */
.description-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; }
.desc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.desc-label { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text2); }
.desc-badge { font-size: 0.72rem; padding: 3px 10px; border-radius: 20px; background: var(--bg2); color: var(--text2); border: 1px solid var(--border); }
.channel-desc-text { font-size: 0.88rem; color: var(--text2); line-height: 1.7; white-space: pre-line; max-height: 100px; overflow: hidden; }

/* ===== METRICS ===== */
.metrics-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-top: 14px; }
.metric-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; align-items: flex-start; gap: 14px; transition: all var(--transition); }
.metric-card:hover { border-color: var(--border-light); transform: translateY(-2px); }
.metric-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.metric-body { display: flex; flex-direction: column; gap: 1px; }
.metric-value { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; }
.metric-label { font-size: 0.75rem; color: var(--text2); }
.metric-context { font-size: 0.7rem; color: var(--text3); margin-top: 2px; }
.metric-badge { font-size: 0.68rem; font-weight: 600; padding: 2px 8px; border-radius: 12px; margin-top: 4px; display: inline-block; width: fit-content; }
.badge-good { background: rgba(34,197,94,0.12); color: var(--green); }
.badge-ok { background: rgba(234,179,8,0.12); color: var(--yellow); }
.badge-bad { background: rgba(255,0,0,0.12); color: #ff6b6b; }

/* ===== SEO ===== */
.seo-circle-wrap { display: flex; justify-content: center; margin-bottom: 20px; }
.seo-circle { position: relative; width: 150px; height: 150px; }
.seo-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.circle-bg { fill: none; stroke: var(--border); stroke-width: 10; }
.circle-fill { fill: none; stroke-width: 10; stroke-linecap: round; stroke: var(--red); stroke-dasharray: 364.42; stroke-dashoffset: 364.42; transition: stroke-dashoffset 1.5s cubic-bezier(0.4,0,0.2,1), stroke 0.5s ease; }
.seo-score-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.seo-score-num { font-size: 2.3rem; font-weight: 900; letter-spacing: -0.04em; }
.seo-score-max { font-size: 0.78rem; color: var(--text2); margin-top: -4px; }
.seo-score-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }
.seo-breakdown { display: flex; flex-direction: column; gap: 12px; }
.seo-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.seo-item-label { font-size: 0.8rem; color: var(--text2); font-weight: 500; }
.seo-item-score { font-size: 0.8rem; font-weight: 700; }
.seo-real-data { font-size: 0.72rem; color: var(--text2); margin-top: 3px; background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; line-height: 1.5; }
.seo-real-data strong { color: var(--text); }
.seo-item-feedback { font-size: 0.7rem; color: var(--text3); margin-top: 3px; }
.seo-bar-bg { height: 4px; background: var(--border); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.seo-bar-fill { height: 100%; border-radius: 3px; transition: width 1s ease; }

/* ===== RADAR ===== */
.chart-wrap { position: relative; height: 300px; }
.chart-wrap.tall { height: 420px; }
.radar-detail-panel {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.radar-detail-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text3);
  font-style: italic;
}
.radar-detail-content { display: none; }
.radar-detail-content.active { display: block; }
.radar-dim-title { font-size: 0.95rem; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.radar-dim-score { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 700; padding: 3px 10px; border-radius: 20px; background: var(--red-dim); border: 1px solid rgba(255,0,0,0.2); color: #ff8080; margin-bottom: 12px; }
.radar-data-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radar-data-item { background: rgba(0,0,0,0.3); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; }
.radar-data-item.highlight { border-color: rgba(255,0,0,0.25); background: var(--red-dim); }
.radar-data-label { font-size: 0.68rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 3px; }
.radar-data-value { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.radar-data-sub { font-size: 0.7rem; color: var(--text2); margin-top: 2px; }

/* ===== PORTADAS ===== */
.portadas-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; flex-wrap: wrap; }
.portadas-sort { display: flex; gap: 6px; flex-shrink: 0; }
.sort-btn { font-size: 0.75rem; padding: 7px 14px; border-radius: 20px; }
.sort-btn.active { background: rgba(220,30,30,0.4); border-color: rgba(255,100,100,0.35); color: white; }
.portadas-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; }
.portada-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer; transition: all var(--transition); position: relative; }
.portada-card:hover { border-color: var(--red); transform: translateY(-4px); box-shadow: 0 8px 32px rgba(255,0,0,0.12); }
.portada-rank { position: absolute; top: 8px; left: 8px; z-index: 3; background: rgba(0,0,0,0.85); color: white; font-size: 0.7rem; font-weight: 800; padding: 3px 7px; border-radius: 5px; }
.portada-score-badge { position: absolute; top: 8px; right: 8px; z-index: 3; background: rgba(255,0,0,0.8); color: white; font-size: 0.66rem; font-weight: 700; padding: 2px 7px; border-radius: 5px; }
.portada-thumb-wrap { position: relative; width: 100%; padding-top: 56.25%; overflow: hidden; background: var(--bg2); }
.portada-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.portada-card:hover .portada-thumb { transform: scale(1.06); }
.portada-hover { position: absolute; inset: 0; background: rgba(255,0,0,0.78); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--transition); font-size: 0.82rem; font-weight: 700; color: white; }
.portada-card:hover .portada-hover { opacity: 1; }
.portada-info { padding: 8px 10px 10px; }
.portada-title { font-size: 0.75rem; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 5px; }
.portada-stats { display: flex; gap: 6px; font-size: 0.68rem; color: var(--text2); flex-wrap: wrap; }
.thumb-style-badge-sm { display: inline-block; font-size: 0.62rem; font-weight: 600; padding: 2px 6px; border-radius: 8px; background: rgba(96,165,250,0.12); border: 1px solid rgba(96,165,250,0.2); color: #60a5fa; margin-top: 4px; }

/* ===== VIDEOS ===== */
.videos-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 14px; }
.video-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; transition: all var(--transition); }
.video-card:hover { border-color: var(--border-light); transform: translateY(-2px); }
.video-thumb-wrap { position: relative; width: 100%; padding-top: 56.25%; overflow: hidden; background: var(--bg2); }
.video-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.video-card:hover .video-thumb { transform: scale(1.04); }
.video-duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.85); color: white; font-size: 0.7rem; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.video-engagement { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,0.7); color: white; font-size: 0.66rem; font-weight: 600; padding: 2px 7px; border-radius: 12px; }
.video-info { padding: 12px 14px 14px; }
.video-title { font-size: 0.84rem; font-weight: 600; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 8px; }
.video-stats { display: flex; gap: 10px; font-size: 0.72rem; color: var(--text2); }
.video-date { font-size: 0.68rem; color: var(--text3); margin-top: 4px; }

/* ===== SHORTS ===== */
.shorts-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; flex-wrap: wrap; }
.shorts-metrics-row { display: flex; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }
.shorts-metric-pill { background: rgba(255,165,0,0.1); border: 1px solid rgba(255,165,0,0.2); border-radius: 20px; padding: 6px 14px; text-align: center; }
.shorts-metric-val { display: block; font-size: 0.95rem; font-weight: 800; color: #fbbf24; }
.shorts-metric-lbl { display: block; font-size: 0.68rem; color: var(--text3); }
.shorts-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(160px,1fr)); gap: 12px; }
.short-card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer; transition: all var(--transition); }
.short-card:hover { border-color: #fbbf24; transform: translateY(-3px); }
.short-thumb-wrap { position: relative; width: 100%; padding-top: 177%; overflow: hidden; background: var(--bg2); } /* 9:16 ratio */
.short-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.short-card:hover .short-thumb { transform: scale(1.05); }
.short-views-badge { position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,0.85); color: white; font-size: 0.68rem; font-weight: 600; padding: 2px 7px; border-radius: 10px; }
.short-info { padding: 8px 10px 10px; }
.short-title { font-size: 0.75rem; font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.short-stats { display: flex; gap: 8px; font-size: 0.66rem; color: var(--text2); margin-top: 4px; }
.short-badge { position: absolute; top: 8px; right: 8px; background: #fbbf24; color: #000; font-size: 0.6rem; font-weight: 800; padding: 2px 6px; border-radius: 5px; }

/* ===== KEYWORDS ===== */
.keywords-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.keyword-tag { font-size: 0.78rem; padding: 5px 13px; background: var(--bg2); border: 1px solid var(--border); border-radius: 20px; color: var(--text2); transition: all var(--transition); }
/* una palabra clave sin espacios no puede ser más ancha que su fila */
.keyword-tag { max-width: 100%; overflow-wrap: anywhere; }
.keyword-tag:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }

/* ===== RECOMMENDATIONS ===== */
.recs-list { display: flex; flex-direction: column; gap: 12px; }
.rec-card { background: var(--card); border: 1px solid var(--border); border-left: 4px solid transparent; border-radius: var(--radius); padding: 18px 22px; display: flex; align-items: flex-start; gap: 16px; transition: transform var(--transition); }
.rec-card:hover { transform: translateX(3px); }
.rec-card.high { border-left-color: #ef4444; }
.rec-card.medium { border-left-color: var(--yellow); }
.rec-card.low { border-left-color: var(--blue); }
.rec-icon { font-size: 1.3rem; flex-shrink: 0; width: 36px; text-align: center; }
.rec-body { flex: 1; }
.rec-header { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.rec-title { font-size: 0.9rem; font-weight: 700; }
.rec-cat { font-size: 0.66rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 10px; background: var(--bg2); color: var(--text2); }
.rec-priority { font-size: 0.66rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; margin-left: auto; }
.rec-priority.high { background: rgba(239,68,68,0.12); color: #ef4444; }
.rec-priority.medium { background: rgba(234,179,8,0.12); color: var(--yellow); }
.rec-priority.low { background: rgba(59,130,246,0.12); color: var(--blue); }
.rec-desc { font-size: 0.82rem; color: var(--text2); line-height: 1.65; }
.results-footer { max-width: 1280px; margin: 0 auto; padding: 24px 32px 40px; text-align: center; font-size: 0.75rem; color: var(--text3); }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0.94); backdrop-filter: blur(4px); overflow-y: auto; display: flex; flex-direction: column; }
.modal-container { max-width: 1440px; width: 100%; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.modal-topbar { display: flex; align-items: center; gap: 16px; padding: 14px 28px; border-bottom: 1px solid var(--border); background: var(--bg2); position: sticky; top: 0; z-index: 10; }
.modal-back-btn { display: flex; align-items: center; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--text2); background: none; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); transition: all var(--transition); white-space: nowrap; flex-shrink: 0; }
.modal-back-btn:hover { border-color: var(--red); color: var(--red); }
.modal-video-title-top { flex: 1; font-size: 0.9rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal-close-x { background: none; color: var(--text2); font-size: 1.1rem; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); transition: all var(--transition); flex-shrink: 0; }
.modal-close-x:hover { border-color: var(--red); color: var(--red); }
.modal-body-wrap { display: grid; grid-template-columns: 1fr 1.1fr; flex: 1; }
.modal-left { padding: 24px 28px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 18px; }
.modal-thumb-wrap { position: relative; border-radius: 10px; overflow: hidden; background: var(--bg2); }
.modal-big-thumb { width: 100%; display: block; border-radius: 10px; }
.modal-yt-link { position: absolute; bottom: 12px; right: 12px; display: flex; align-items: center; gap: 6px; font-size: 0.75rem; font-weight: 600; color: white; background: rgba(0,0,0,0.75); border: 1px solid rgba(255,255,255,0.15); padding: 5px 12px; border-radius: 20px; text-decoration: none; transition: background var(--transition); }
.modal-yt-link:hover { background: var(--red); }

/* Thumbnail style card */
.thumb-style-card { background: rgba(96,165,250,0.07); border: 1px solid rgba(96,165,250,0.2); border-radius: 10px; padding: 14px 16px; }
.thumb-style-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.thumb-style-emoji { font-size: 1.4rem; }
.thumb-style-name { font-size: 0.92rem; font-weight: 700; }
.thumb-style-label { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #60a5fa; background: rgba(96,165,250,0.12); padding: 2px 8px; border-radius: 10px; }
.thumb-style-desc { font-size: 0.8rem; color: var(--text2); line-height: 1.6; }
.thumb-style-tips { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(96,165,250,0.15); }
.thumb-style-tips-title { font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text3); margin-bottom: 6px; }
.thumb-tip-item { font-size: 0.78rem; color: var(--text2); padding: 3px 0; display: flex; gap: 6px; }
.thumb-tip-item::before { content: '→'; color: #60a5fa; flex-shrink: 0; }

.modal-stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.modal-stat-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 12px; text-align: center; }
.modal-stat-box.highlight-box { border-color: rgba(255,0,0,0.3); background: var(--red-dim); }
.modal-stat-val { display: block; font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; }
.modal-stat-lbl { display: block; font-size: 0.66rem; color: var(--text2); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.04em; }

/* Prompt */
.prompt-box { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.prompt-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.prompt-title { font-size: 0.9rem; font-weight: 700; margin-bottom: 2px; }
.prompt-subtitle { font-size: 0.7rem; color: var(--text3); }
.copy-btn { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; padding: 8px 16px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.copy-btn.copied { background: rgba(34,197,94,0.35); border-color: rgba(34,197,94,0.3); color: var(--green); }
.niche-badge { display: inline-block; font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; padding: 3px 10px; border-radius: 12px; background: var(--red-dim); color: #ff8080; border: 1px solid rgba(255,0,0,0.2); margin-bottom: 10px; }
.ai-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.7rem; font-weight: 700; padding: 4px 12px; border-radius: 12px; background: rgba(124,58,237,0.15); border: 1px solid rgba(124,58,237,0.35); color: #a78bfa; margin-bottom: 10px; animation: aiPulse 2s ease infinite; }
.ai-badge.hidden { display: none; }
@keyframes aiPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.3); } 50% { box-shadow: 0 0 0 4px rgba(124,58,237,0); } }
.btn-glass-gpt { background: rgba(124,58,237,0.25); border-color: rgba(167,139,250,0.3); color: #c4b5fd; }
.btn-glass-gpt:hover { background: rgba(124,58,237,0.4); box-shadow: inset 0 1px 0 rgba(200,180,255,0.2), 0 6px 20px rgba(124,58,237,0.3); }
.btn-glass-gpt.loading { opacity: 0.7; cursor: wait; pointer-events: none; }
.prompt-textarea.ai-generated { border-color: rgba(124,58,237,0.35); box-shadow: 0 0 0 1px rgba(124,58,237,0.15); }
.prompt-textarea { width: 100%; height: 260px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 14px; font-size: 0.76rem; color: var(--text2); line-height: 1.75; resize: vertical; outline: none; min-height: 200px; }
.prompt-tips { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.tip { font-size: 0.7rem; color: var(--text3); }

/* Similar thumbnails */
.modal-right { padding: 24px 28px; display: flex; flex-direction: column; overflow-y: auto; }
.modal-similar-header { margin-bottom: 16px; }
.modal-similar-title { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.modal-similar-sub { font-size: 0.75rem; color: var(--text2); }
.modal-similar-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.similar-loading { grid-column: 1/-1; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 40px; color: var(--text2); font-size: 0.85rem; }
.similar-card { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; cursor: pointer; transition: all var(--transition); text-decoration: none; display: block; }
.similar-card:hover { border-color: var(--red); transform: translateY(-2px); }
.similar-thumb-wrap { position: relative; width: 100%; padding-top: 56.25%; overflow: hidden; background: var(--card); }
.similar-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.similar-card:hover .similar-thumb { transform: scale(1.06); }
.similar-info { padding: 8px 10px 10px; }
.similar-channel { font-size: 0.66rem; color: var(--text3); margin-bottom: 3px; }
.similar-title { font-size: 0.75rem; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.similar-views { font-size: 0.68rem; color: var(--text2); margin-top: 4px; }
.similar-empty { grid-column: 1/-1; text-align: center; padding: 40px; color: var(--text3); font-size: 0.85rem; }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.results { animation: fadeInUp 0.4s ease; }

@media (max-width: 1100px) { .portadas-grid { grid-template-columns: repeat(4,1fr); } .modal-body-wrap { grid-template-columns: 1fr; } .modal-left { border-right: none; border-bottom: 1px solid var(--border); } .modal-similar-grid { grid-template-columns: repeat(4,1fr); } }
@media (max-width: 900px) { .two-col { grid-template-columns: minmax(0, 1fr); } .channel-hero-content { flex-direction: column; align-items: flex-start; } .channel-hero-stats { width: 100%; justify-content: center; } .portadas-grid { grid-template-columns: repeat(3,1fr); } .metrics-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px) { .section-container { padding: 16px; } .channel-hero-content { padding: 0 16px 24px; } .portadas-grid { grid-template-columns: repeat(2,1fr); } .modal-stats-row { grid-template-columns: repeat(2,1fr); } .modal-similar-grid { grid-template-columns: repeat(2,1fr); } .metrics-grid { grid-template-columns: 1fr 1fr; } .search-box { border-radius: 14px; padding: 10px 14px; flex-wrap: wrap; } .analyze-btn { width: 100%; justify-content: center; border-radius: 10px; } }

/* ============================================================
   MÓDULO: INVESTIGACIÓN POR NICHO
   ============================================================ */

/* Mode tabs */
.mode-tabs { display: inline-flex; gap: 6px; background: rgba(22,22,22,0.7); border: 1.5px solid var(--border-light); padding: 5px; border-radius: 40px; margin: 0 auto 18px; backdrop-filter: blur(20px); }
.mode-tab { display: inline-flex; align-items: center; gap: 7px; font-size: 0.82rem; font-weight: 600; color: var(--text2); background: transparent; border: none; padding: 9px 18px; border-radius: 30px; cursor: pointer; transition: all var(--transition); }
.mode-tab svg { opacity: 0.8; }
.mode-tab:hover { color: var(--text); }
.mode-tab.active { background: var(--red); color: #fff; box-shadow: 0 4px 14px rgba(255,0,0,0.3); }
.mode-panel { animation: fadeInUp 0.3s ease; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Niche search helpers */
.niche-search-box { max-width: 720px; }
.niche-hint { font-size: 0.82rem; color: var(--text2); margin: 16px 0 10px; }
.niche-breadcrumb { display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.crumb { font-size: 0.82rem; background: none; border: none; cursor: pointer; }
.crumb-home { color: var(--text2); text-decoration: underline; }
.crumb-home:hover { color: var(--red); }
.crumb-active { color: var(--text); font-weight: 600; }
.crumb-sep { color: var(--text3); }

.niche-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 840px; margin: 0 auto; }
.niche-chip { font-size: 0.8rem; font-weight: 500; color: var(--text); background: var(--card); border: 1px solid var(--border-light); padding: 8px 14px; border-radius: 22px; cursor: pointer; transition: all var(--transition); display: inline-flex; align-items: center; gap: 6px; }
.niche-chip:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); transform: translateY(-1px); }
.niche-chip-icon { font-size: 0.95rem; }
.niche-subchips { margin-top: 12px; }
.niche-subchip { background: var(--bg2); }
.niche-chip-all { background: rgba(220,30,30,0.18); border-color: rgba(255,100,100,0.35); color: #ffd0d0; font-weight: 600; }

/* Niche view */
.niche-view { animation: fadeInUp 0.3s ease; }
.niche-results-header, .niche-board-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.niche-results-sort { display: flex; gap: 6px; flex-shrink: 0; }
.niche-loading { display: flex; align-items: center; gap: 12px; color: var(--text2); font-size: 0.9rem; padding: 30px 0; justify-content: center; }
.niche-inline-error { color: #fca5a5; background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.25); border-radius: var(--radius); padding: 16px 18px; font-size: 0.88rem; }

/* Results grid */
.niche-results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.niche-result-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color var(--transition), transform var(--transition); }
.niche-result-card:hover { border-color: var(--border-light); transform: translateY(-2px); }
.nr-banner { height: 64px; background-size: cover; background-position: center; background-color: #1a1a1a; position: relative; z-index: 1; }
.nr-top { position: relative; z-index: 2; display: flex; align-items: flex-end; gap: 11px; padding: 0 16px; margin-top: -24px; }
.nr-avatar { position: relative; z-index: 2; width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--card); background: #222; object-fit: cover; flex-shrink: 0; box-shadow: 0 2px 8px rgba(0,0,0,0.5); }
.nr-id { min-width: 0; padding-bottom: 3px; }
.nr-name { font-size: 0.92rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nr-handle { font-size: 0.74rem; color: var(--text3); }
.nr-niche-tag { align-self: flex-start; margin: 10px 16px 0; font-size: 0.72rem; color: var(--text2); background: var(--bg2); border: 1px solid var(--border); padding: 3px 10px; border-radius: 14px; }
.nr-stats { display: flex; gap: 6px; padding: 12px 16px 4px; }
.nr-stat { flex: 1; text-align: center; background: var(--bg2); border-radius: 9px; padding: 8px 4px; }
.nr-stat-val { display: block; font-size: 0.92rem; font-weight: 700; }
.nr-stat-lbl { font-size: 0.66rem; color: var(--text3); text-transform: uppercase; letter-spacing: 0.04em; }
.nr-desc { font-size: 0.78rem; color: var(--text2); padding: 8px 16px 0; line-height: 1.45; min-height: 36px; }
.nr-actions { display: flex; gap: 8px; padding: 14px 16px 16px; margin-top: auto; }
.nr-actions .btn-glass { flex: 1; justify-content: center; font-size: 0.8rem; padding: 9px; border-radius: 10px; }
.nr-btn-board.added { background: rgba(34,197,94,0.18); border-color: rgba(34,197,94,0.4); color: #86efac; }

/* Board */
.board-empty { text-align: center; color: var(--text2); padding: 40px 20px; background: var(--card); border: 1px dashed var(--border-light); border-radius: var(--radius); }
.board-empty-icon { font-size: 2rem; display: block; margin-bottom: 10px; opacity: 0.6; }
.niche-board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 18px; }
.board-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.board-card-banner { height: 84px; background-size: cover; background-position: center; background-color: #1a1a1a; position: relative; z-index: 1; }
.board-remove { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,0.55); border: none; color: #fff; cursor: pointer; font-size: 0.8rem; backdrop-filter: blur(6px); transition: background var(--transition); z-index: 3; }
.board-remove:hover { background: var(--red); }
.board-card-head { position: relative; z-index: 2; display: flex; align-items: flex-end; gap: 11px; padding: 0 16px 4px; margin-top: -28px; }
.board-avatar { position: relative; z-index: 2; width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--card); background: #222; object-fit: cover; flex-shrink: 0; box-shadow: 0 2px 10px rgba(0,0,0,0.55); }
.board-id { min-width: 0; padding-bottom: 3px; }
.board-name { font-size: 0.95rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-handle { font-size: 0.74rem; color: var(--text3); }
.board-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.board-tag { font-size: 0.72rem; font-weight: 600; border: 1px solid var(--border-light); border-radius: 14px; padding: 4px 11px; color: var(--text2); }
.board-tag-niche { background: var(--bg2); }
.board-block { padding: 12px 16px; border-top: 1px solid var(--border); }
.board-block:first-of-type { border-top: none; }
.board-block-label { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text3); margin-bottom: 7px; font-weight: 600; }
.board-niche { font-size: 0.9rem; font-weight: 600; }
.board-palette { display: flex; gap: 7px; }
.swatch { width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2); }
.board-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.board-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 5px; background: #1a1a1a; }
.board-struct-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.board-struct-head .board-block-label { margin-bottom: 0; }
.board-struct-score { font-size: 0.82rem; font-weight: 800; border: 1.5px solid; border-radius: 8px; padding: 2px 9px; }
.board-struct-dom { font-size: 0.78rem; color: var(--text2); margin-bottom: 10px; }
.board-struct-dom strong { color: var(--text); }
.board-struct-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.bs-item { background: var(--bg2); border-radius: 8px; padding: 8px 4px; text-align: center; }
.bs-val { display: block; font-size: 1rem; font-weight: 800; }
.bs-lbl { font-size: 0.62rem; color: var(--text3); }
.board-struct-verdict { font-size: 0.78rem; color: var(--text2); line-height: 1.5; margin-top: 11px; padding-left: 11px; border-left: 3px solid; }
.board-titles { margin-top: 10px; }
.board-titles summary { font-size: 0.76rem; color: var(--text2); cursor: pointer; user-select: none; }
.board-titles summary:hover { color: var(--red); }
.board-titles ul { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.board-titles li { font-size: 0.76rem; color: var(--text2); background: var(--bg2); border-radius: 7px; padding: 6px 9px; line-height: 1.35; }
.board-analyze-btn { margin: 6px 16px 16px; justify-content: center; border-radius: 10px; font-size: 0.82rem; padding: 10px; }

/* Back button */
.back-to-niche-btn { position: fixed; top: 76px; left: 20px; z-index: 60; display: inline-flex; align-items: center; gap: 6px; background: rgba(22,22,22,0.9); border: 1.5px solid var(--border-light); color: var(--text); font-size: 0.82rem; font-weight: 600; padding: 9px 16px; border-radius: 30px; cursor: pointer; backdrop-filter: blur(14px); box-shadow: var(--shadow); transition: all var(--transition); }
.back-to-niche-btn:hover { border-color: var(--red); color: var(--red); }

@media (max-width: 640px) {
  .niche-results-grid { grid-template-columns: 1fr; }
  .niche-board-grid { grid-template-columns: 1fr; }
  .mode-tab { padding: 8px 13px; font-size: 0.78rem; }
  .back-to-niche-btn { top: auto; bottom: 16px; left: 16px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   NADA DE ZOOM Y NADA DE DOBLE TOQUE  ·  igual que en el resto del Club
   · `touch-action:manipulation` quita el zoom del doble toque y la espera de
     300 ms con la que el navegador comprobaba si ibas a tocar dos veces.
   · El pellizco lo frenan el viewport (Chrome) y los eventos de gesto que se
     cancelan en el <head> (Safari).
   ⚠️ NADA de overscroll-behavior en el <html> ni en el <body>, y ningún
   escuchador de rueda o de touchmove no pasivo: en Safari y en Chrome dejan
   la página sin scroll.
   ══════════════════════════════════════════════════════════════════════════ */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
* { touch-action: manipulation; }
a, button, input, select, label, [role="button"] { -webkit-tap-highlight-color: rgba(255,0,0,.14); }
/* Un campo de menos de 16 px hace que el iPhone se acerque solo al tocarlo. */
@media (hover: none) and (pointer: coarse) {
  input:not([readonly]), textarea:not([readonly]), select { font-size: 16px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   LA CABECERA DEL CLUB  ·  «Volver al panel» a la izquierda, tu foto a la derecha
   ══════════════════════════════════════════════════════════════════════════ */
.header-inner.hd { justify-content: flex-start; gap: 14px; }
.hd .logo { flex: none; min-width: 0; }
.hd .header-badge { margin-left: auto; flex: none; white-space: nowrap; }
.hd .club-cuenta { margin-left: auto; }

/* El botón de volver es el del Club: club-volver.js le pone texto, flecha,
   destino y su estilo (el mismo en todo el dominio). Aquí solo se viste igual
   antes de que llegue el script, para que no haya salto. */
.app-header .hd-volver {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  padding: 8px 14px 8px 11px; border-radius: 11px; text-decoration: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap;
  color: #a8b8d0; background: rgba(255,255,255,.04);
  border: 1px solid rgba(120,150,200,.18);
}
.app-header .hd-volver svg { width: 15px; height: 15px; flex: none; }

/* TU CUENTA — la foto, y el menú al tocarla (la pinta sesion-club.js).
   ⚠️ LIMPIA: solo la foto. Sin aro, sin fondo, sin sombra ni puntito detrás,
   y sin el recuadro que el iPhone pinta al tocar un botón. */
.club-cuenta { position: relative; flex: none; margin-left: auto; }
.club-cuenta > button {
  display: block; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 50%;
  background: none; box-shadow: none; line-height: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent; transition: transform .15s;
}
.club-cuenta > button:hover { transform: translateY(-1px); }
.club-cuenta > button img,
.club-cuenta > button .ini { display: block; width: 46px; height: 46px; border-radius: 50%; }
.club-cuenta > button img { object-fit: cover; object-position: center; background: none; }
.club-cuenta > button .ini,
.club-menu .quien > .ini {
  display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #ff4d4d, #c40000);
}
.club-cuenta > button .ini { font-size: 16px; }
.club-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 300; width: 232px; padding: 7px;
  border-radius: 16px; opacity: 0; visibility: hidden; transform: translateY(-6px);
  background: #141414; border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 24px 60px rgba(0,0,0,.65);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.club-cuenta.abierto .club-menu { opacity: 1; visibility: visible; transform: none; }
.club-menu .quien { display: flex; align-items: center; gap: 10px; padding: 10px 11px 12px; }
.club-menu .quien > img,
.club-menu .quien > .ini { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.club-menu .quien > .ini { font-size: 14px; }
.club-menu .quien > div { min-width: 0; flex: 1; }
.club-menu .quien > div > b {
  display: block; font-size: 13.5px; font-weight: 700; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.club-menu .quien > div > span {
  display: block; margin-top: 2px; font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 9.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #ff4d4d;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.club-menu hr { border: 0; border-top: 1px solid rgba(255,255,255,.08); margin: 3px 8px; }
.club-menu a,
.club-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 11px; border-radius: 11px;
  font-size: 13.5px; font-weight: 500; text-decoration: none; text-align: left; color: #c9c9c9;
  background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background .15s, color .15s;
}
.club-menu a:hover,
.club-menu button:hover { background: rgba(255,255,255,.055); color: #fff; }
.club-menu svg {
  width: 17px; height: 17px; flex-shrink: 0; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.club-menu .fuera { color: #ff8a8a; }
.club-menu .fuera:hover { background: rgba(255,0,0,.12); color: #ffc7c7; }

/* ══════════════════════════════════════════════════════════════════════════
   EL PIE DEL CLUB, EN LOS COLORES DEL ANALIZADOR
   club-pie.js y club-pie.css son los mismos de todo el dominio: misma marca,
   mismos enlaces, redes, Soporte a la derecha, aviso legal y versión. Aquí
   solo cambia la paleta: donde el Club pone azul y dorado, el Analizador pone
   negro y rojo. El pie común lee estas variables.
   ══════════════════════════════════════════════════════════════════════════ */
.pie-club {
  --line: rgba(255,255,255,.08);
  --white: #f4f4f4;
  --gray-2: #a3a3a3;
  --gray-3: #6e6e6e;
  --gold: #ff3b3b;            /* el «dorado» del Club es el rojo aquí */
  --gold-light: #ff4d4d;
  --gold-xlight: #ff8a8a;
  background: linear-gradient(180deg, rgba(28,5,5,0), rgba(28,5,5,.55));
}
.pie-club .pc-marca img { filter: drop-shadow(0 0 12px rgba(255,0,0,.35)); }
.pie-club .pc-redes a:hover { border-color: rgba(255,0,0,.5); background: rgba(255,0,0,.1); }
.pie-club .pc-sop {
  color: #fff; background: linear-gradient(135deg, #ff3b3b, #d40000);
  box-shadow: 0 4px 16px rgba(255,0,0,.22);
}

/* ⚠️ EL PIE CIERRA LA PÁGINA: club-pie.js lo baja hasta el borde en las
   páginas cortas y no deja nada debajo. Aquí no se le añade ningún hueco ni
   relleno propio (antes un body en columna + un separador sumaban 76 px). */

/* Con el análisis abierto, el carrusel de la portada sobra: se iba arriba de
   los resultados como una franja vacía. Se va con la portada. */
#heroSection[style*="none"] + .hero-marquee { display: none; }

/* ⚠️ EL MODAL TAPA ENTERO. El fondo del modal es una columna flex y la caja
   se encogía a una pantalla: el resto se pintaba sin fondo y la página de
   detrás asomaba entre las portadas. */
.modal-container { flex-shrink: 0; }
/* los títulos de las portadas similares salían en azul de enlace */
.similar-card { color: var(--text); }

/* Las cifras de vistas, likes y comentarios no se parten: si no caben, bajan
   de línea enteras (en las tarjetas estrechas el icono quedaba encima del
   número). */
.video-stats { flex-wrap: wrap; row-gap: 2px; }
.video-stats span { white-space: nowrap; }

/* Sin palabras sueltas en la última línea («meses», «videos)» solas abajo). */
p, h1, h2, h3, .metric-label, .metric-context, .mono-stat-lbl, .mono-stat-ctx,
.mono-video-sub, .rec-desc, .section-desc, .pie-club .pc-cr { text-wrap: pretty; }

/* Al cambiar de pestaña, el panel aparece al momento: la entrada lenta es
   solo para la primera carga (antes había más de un segundo de hueco). */
.hero.cambiado .mode-panel { animation: fadeInUp .3s ease both; opacity: 1; }
.hero.cambiado .mode-panel.hidden { animation: none; }

@media (max-width: 900px) {
  .hd .header-badge { display: none; }   /* tecnicismo que en pantallas estrechas estorba */
}

/* ══════════════════════════════════════════════════════════════════════════
   EL CELULAR  ·  que nada se salga ni se encime

   La cabecera llevaba el logo y la etiqueta de la API en una sola fila de 60
   px: en una pantalla de teléfono la etiqueta se montaba encima del título y
   el botón de entrar se salía. Aquí abajo se ordena todo para pantallas
   estrechas: la etiqueta desaparece (no la necesita nadie en el móvil), la
   cabecera crece lo que haga falta y ninguna caja se escapa del ancho.
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 720px) {
  /* ⚠️ La red contra el scroll de lado va SOLO en el body. Con overflow en el
     html y en el body a la vez, el body se volvía una caja con scroll propio:
     la cabecera dejaba de quedarse arriba al bajar. Así pasa a la ventana. */
  body { overflow-x: hidden; }
  img, video, canvas, table, pre { max-width: 100%; height: auto; }

  /* la cabecera: volver, logo y foto en una sola fila que siempre cabe */
  .header-inner { height: auto; min-height: 60px; padding: 8px 14px; gap: 10px; flex-wrap: nowrap; }
  .logo { gap: 8px; }
  .logo svg { width: 24px; height: 17px; flex: none; }
  .logo-text { font-size: .95rem; white-space: nowrap; }

  /* la portada */
  .hero { padding: 36px 16px 40px; }
  .hero-label { font-size: 9.5px; letter-spacing: .06em; padding: 5px 12px; margin-bottom: 18px; }
  .hero-subtitle { margin-bottom: 26px; }

  /* pestañas: las dos a lo ancho, el texto en una sola línea con su icono */
  .mode-tabs { display: flex; width: 100%; }
  .mode-tab { flex: 1 1 0; min-width: 0; justify-content: center; white-space: nowrap;
    padding: 9px 6px; gap: 5px; font-size: .76rem; }

  /* el buscador: la lupa y el texto en la misma fila, el botón debajo a lo ancho
     (antes la lupa iba sola en una fila y el texto flotaba debajo) */
  .search-box { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 10px;
    border-radius: 16px; padding: 10px 12px 12px 14px; }
  .search-icon { flex: none; }
  .search-input { flex: 1 1 0; min-width: 0; padding: 6px 0; text-overflow: ellipsis; }
  .search-box .analyze-btn { flex: 1 0 100%; width: 100%; justify-content: center; border-radius: 12px; }
  .niche-search-box { max-width: 100%; }

  /* la cabecera del canal analizado */
  .channel-banner-wrap { height: 140px; }
  .channel-hero-content { margin-top: -44px; padding: 0 16px 20px; gap: 16px; }
  .channel-identity { gap: 14px; width: 100%; min-width: 0; }
  .channel-meta { min-width: 0; }
  .avatar-wrap { width: 76px; height: 76px; border-width: 3px; }
  .channel-name { font-size: 1.25rem; line-height: 1.2; }
  /* las cuatro cifras en una rejilla de 2×2, sin rayas colgando */
  .channel-hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 0; width: 100%; padding: 14px 8px; }
  .hero-stat-divider { display: none; }
  .hero-stat { padding: 0 8px; }
  .hero-stat-value { font-size: 1.2rem; }

  /* monetización: tarjetas en dos columnas, y la lista de videos sin texto aplastado */
  .monetization-banner { padding: 18px 16px; }
  .mono-header { flex-direction: column; gap: 10px; margin-bottom: 16px; }
  .mono-disclaimer { text-align: left; }
  .mono-stats-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mono-stat-card { min-width: 0; padding: 12px 14px; }
  .mono-stat-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  /* ⚠️ con 1rem fijo, «$323.6K–$832.0K» (un canal grande) medía 142 px en una caja
     de 120 y se salía de la tarjeta a 375 px: la cifra se ajusta al ancho y, si
     aun así no cabe, baja de línea tras el guion en vez de desbordarse */
  .mono-stat-val { font-size: min(1rem, 3.5vw); overflow-wrap: break-word; }
  .mono-video-row { display: grid; grid-template-columns: 20px 64px minmax(0, 1fr);
    column-gap: 10px; row-gap: 3px; align-items: center; padding: 10px 12px; }
  .mono-video-rank { grid-row: 1 / span 2; width: auto; }
  .mono-video-thumb { grid-row: 1 / span 2; width: 64px; height: 36px; }
  .mono-video-info { grid-column: 3; min-width: 0; }
  .mono-video-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }
  .mono-video-sub { font-size: .68rem; }
  .mono-video-row > div:last-child { grid-column: 3; display: flex; align-items: baseline;
    gap: 6px; flex-wrap: wrap; text-align: left !important; }
  .mono-video-row > div:last-child > span { display: inline !important; margin-top: 0 !important; }

  /* métricas: el icono arriba y la cifra debajo, para que nada se parta */
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .metric-card { flex-direction: column; gap: 10px; padding: 14px; min-width: 0; }
  .metric-icon { width: 36px; height: 36px; font-size: 1rem; border-radius: 9px; }
  .metric-body { min-width: 0; }
  .metric-value { font-size: 1.2rem; line-height: 1.2; }

  /* tarjetas y títulos */
  .card { padding: 18px 16px; }
  .card-title { gap: 4px 10px; }
  .card-subtitle { margin-left: 0; }
  .description-card { padding: 16px; }
  .desc-header { gap: 10px; }

  /* los botones de ordenar: tres en fila que siempre caben */
  .portadas-sort, .niche-results-sort { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px; width: 100%; }
  .portadas-sort .sort-btn, .niche-results-sort .sort-btn { min-width: 0; padding: 8px 4px;
    font-size: .7rem; text-overflow: ellipsis; }

  /* videos en dos columnas, como las portadas y los Shorts */
  .videos-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .video-info { padding: 10px 10px 12px; }
  .video-title { font-size: .78rem; }
  .video-stats { gap: 2px 8px; font-size: .68rem; }

  /* plan de mejora */
  .rec-card { padding: 14px; gap: 12px; }
  .rec-icon { width: 26px; font-size: 1.1rem; }

  /* el modal de la portada */
  .modal-topbar { padding: 10px 14px; gap: 10px; }
  .modal-left, .modal-right { padding: 16px; }
  .prompt-box { padding: 14px; }
  /* ⚠️ el título del prompt se quedaba en una columna de dos letras: los
     botones van debajo, a lo ancho */
  .prompt-header { flex-direction: column; align-items: stretch; }
  .prompt-header > div:last-child { width: 100%; }
  .prompt-header .analyze-btn.small { margin-top: 0; flex: 1 1 auto; }
  .prompt-header .copy-btn { flex: 1 1 auto; justify-content: center; }

  /* el botón de volver a la búsqueda va arriba: abajo tapaba el pie */
  .back-to-niche-btn { top: 70px; bottom: auto; left: 12px; }

  /* ningún texto largo parte la caja, pero las palabras no se cortan por la
     mitad (con `anywhere` salía «Engageme-nt» y «Pro-mpt par-a») */
  h1, h2, h3, p, span, a, td, th { overflow-wrap: break-word; }
}

@media (max-width: 760px) {
    /* el botón de volver del Club, en su tamaño de móvil */
  .app-header .hd-volver { padding: 8px 12px 8px 10px; }
  .club-cuenta > button,
  .club-cuenta > button img,
  .club-cuenta > button .ini { width: 44px; height: 44px; }
  .club-menu { width: 216px; }
}

/* ⚠️ LA CAMPANITA (16 oct 2026): con ella, en el celular la cabecera no cabía
   (volver + logo + campana + foto = 415 px en una pantalla de 390) y la foto
   se salía por la derecha. En pantallas estrechas el logo se queda solo con
   el icono rojo —como el Arsenal, que solo enseña su emblema— y el hueco
   entre piezas baja un poco. El logo además puede encogerse: nunca empuja la
   foto fuera. */
.hd .logo { flex: 0 1 auto; min-width: 0; }
@media (max-width: 440px) {
  .header-inner.hd { gap: 10px; }
  .hd .logo-text { display: none; }
}
