@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Inter:wght@400;500;600&display=swap');
@import url('tokens.css');

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg-0);
  color: var(--text-primary);
  font-family: var(--font-ui);
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  padding-bottom: calc(var(--bottom-nav-h) + 12px);
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

.app {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  background: var(--gradient-hero);
  position: relative;
}

/* ---------- Header ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(5, 16, 12, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.app-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-header .brand img { height: 34px; width: auto; }

.app-header .brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.app-header .brand-text strong { font-size: var(--fs-sm); font-weight: 800; letter-spacing: 0.02em; }
.app-header .brand-text span { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-primary);
}

/* ---------- Chips ---------- */
.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 16px 4px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-glass);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
}
.chip.active {
  background: var(--gradient-gold);
  color: var(--text-inverse);
  border-color: transparent;
}

/* ---------- Sections ---------- */
.section {
  padding: 18px 16px 6px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-head h2 {
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.section-head .see-all {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--green-300);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---------- Live banner ---------- */
.live-banner {
  margin: 0 16px 6px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--gradient-card);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-card);
}
.live-banner .live-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--live);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 0 rgba(255,59,48,0.6);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,59,48,0.5); }
  70% { box-shadow: 0 0 0 8px rgba(255,59,48,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,59,48,0); }
}
.match-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.match-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 30%;
}
.match-team img { width: 44px; height: 44px; object-fit: contain; }
.match-team span { font-size: var(--fs-xs); font-weight: 700; text-align: center; color: var(--text-secondary); }
.match-score {
  font-size: var(--fs-2xl);
  font-weight: 800;
  letter-spacing: 0.05em;
}
.match-meta { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 10px; }

/* ---------- Cards horizontais ---------- */
.hscroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.hscroll::-webkit-scrollbar { display: none; }

.card-news {
  flex: 0 0 78%;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.card-news .thumb {
  height: 120px;
  background-size: cover;
  background-position: center;
}
.card-news .body { padding: 12px 14px 14px; }
.card-news .tag {
  font-size: 10px;
  font-weight: 800;
  color: var(--gold-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.card-news h3 {
  font-size: var(--fs-sm);
  font-weight: 700;
  margin-top: 6px;
  line-height: 1.3;
}
.card-news .meta {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ---------- Comunicados ---------- */
.post-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.post-card .avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-2);
  padding: 4px;
  flex-shrink: 0;
}
.post-card .content { flex: 1; }
.post-card .head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-xs);
  font-weight: 800;
}
.verified-badge {
  color: var(--green-400);
  font-size: 14px;
}
.post-card .time { color: var(--text-muted); font-weight: 500; }
.post-card p { font-size: var(--fs-sm); margin-top: 4px; color: var(--text-secondary); line-height: 1.4; }
.post-type-tag {
  display: inline-block;
  margin-top: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: rgba(34, 181, 107, 0.15);
  color: var(--green-300);
}

/* ---------- Promo banner ---------- */
.promo-banner {
  margin: 6px 16px 0;
  border-radius: var(--radius-lg);
  padding: 20px;
  background: linear-gradient(135deg, var(--green-700), var(--green-900));
  border: 1px solid var(--border-strong);
  position: relative;
  overflow: hidden;
}
.promo-banner h3 { font-size: var(--fs-lg); font-weight: 800; max-width: 70%; }
.promo-banner p { font-size: var(--fs-sm); color: var(--text-secondary); margin-top: 6px; max-width: 70%; }
.promo-banner .btn-gold {
  display: inline-block;
  margin-top: 14px;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--gradient-gold);
  color: var(--text-inverse);
  font-weight: 800;
  font-size: var(--fs-sm);
}

/* ---------- Bottom Navigation ---------- */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: var(--max-width);
  height: var(--bottom-nav-h);
  display: flex;
  background: rgba(8, 20, 15, 0.85);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  box-shadow: var(--shadow-nav);
  z-index: 30;
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}
.bottom-nav a.active { color: var(--green-300); }
.bottom-nav svg { width: 22px; height: 22px; }

/* ---------- Institucional ---------- */
.institutional-hero {
  padding: 28px 16px 20px;
  text-align: center;
}
.institutional-hero img.crest { width: 84px; margin: 0 auto 14px; }
.institutional-hero h1 { font-size: var(--fs-2xl); font-weight: 800; }
.institutional-hero p { color: var(--text-secondary); margin-top: 8px; font-size: var(--fs-sm); }

.info-block {
  margin: 0 16px 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}
.info-block h2 { font-size: var(--fs-md); font-weight: 800; margin-bottom: 8px; }
.info-block p, .info-block li { font-size: var(--fs-sm); color: var(--text-secondary); line-height: 1.55; }
.info-block ul { padding-left: 18px; margin-top: 6px; }

.staff-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0 16px 16px;
}
.staff-card {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
  padding-bottom: 12px;
}
.staff-card img { width: 100%; aspect-ratio: 1/1; object-fit: cover; object-position: top; }
.staff-card strong { display: block; font-size: 12px; margin-top: 8px; padding: 0 6px; }
.staff-card span { font-size: 10px; color: var(--text-muted); }

.sponsors-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.sponsors-strip img {
  height: 28px;
  width: auto;
  filter: grayscale(1) brightness(1.6);
  opacity: 0.85;
}

.doc-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.doc-link:last-child { border-bottom: none; }

/* ---------- Menú global (inyectado por main.js) ---------- */
#site-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: flex-end;
  justify-content: center;
}
#site-menu-overlay.open { display: flex; }
.site-menu-panel {
  width: 100%;
  max-width: var(--max-width);
  max-height: 82vh;
  overflow-y: auto;
  background: var(--bg-1);
  border-radius: 20px 20px 0 0;
  padding: 20px;
  border-top: 1px solid var(--border-strong);
}
.site-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.site-menu-head strong { font-size: var(--fs-lg); font-weight: 800; }
.site-menu-list { display: flex; flex-direction: column; }
.site-menu-list a {
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
}
.site-menu-list a:last-child { border-bottom: none; }
