/* ── TVContigo — TV Design System ───────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Bebas+Neue&display=swap');

:root {
  --bg:        #07070f;
  --surface:   #0f0f1a;
  --surface-2: #161625;
  --surface-3: #1d1d30;
  --blue:      #0ea5e9;
  --blue-dim:  #0284c7;
  --blue-glow: rgba(14,165,233,.28);
  --orange:    #f97316;
  --orange-dim:#ea6200;
  --green:     #22c55e;
  --red:       #ef4444;
  --text:      #f0f0ff;
  --text-dim:  #94a3b8;
  --text-muted:#4b5563;
  --border:    rgba(255,255,255,.07);
  --border-hi: rgba(255,255,255,.14);
  --nav-h:     64px;
  --ad-h:      72px;
  --radius:    12px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  padding-top: 60px;
  padding-bottom: calc(var(--nav-h) + var(--ad-h) + 8px);
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

/* ── Top Nav ──────────────────────────────────────────────────────────────── */
.top-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 60px;
  background: linear-gradient(to bottom, rgba(7,7,15,.98) 70%, transparent);
  backdrop-filter: blur(16px);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; gap: 12px;
}
.nav-brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; flex-shrink: 0;
}
.nav-logo-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px; letter-spacing: 1px;
  color: var(--text); line-height: 1;
}
.nav-logo-text span { color: var(--orange); }
.nav-badge {
  background: var(--orange); color: #fff;
  font-size: 9px; font-weight: 800; letter-spacing: 1px;
  padding: 2px 5px; border-radius: 4px; margin-left: 2px;
}
.nav-live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 6px var(--red);
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:.4;} }

.nav-center { flex: 1; max-width: 340px; margin: 0 auto; }
.nav-search {
  width: 100%; background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 24px; padding: 7px 16px; color: var(--text);
  font-size: 13px; outline: none; transition: border-color .2s;
  display: flex; align-items: center; gap: 8px;
}
.nav-search:focus { border-color: var(--blue); }

.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.btn {
  border: none; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 8px; font-weight: 600; transition: all .18s; white-space: nowrap;
}
.btn-sm { font-size: 13px; padding: 7px 14px; }
.btn-ghost {
  background: transparent; color: var(--text-dim);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-hi); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dim); }
.btn-orange { background: var(--orange); color: #fff; }
.btn-orange:hover { background: var(--orange-dim); }

#nav-guest { display: flex; gap: 8px; }
#nav-user { display: none; align-items: center; gap: 10px; }
#nav-user.visible { display: flex; }
.nav-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; cursor: pointer;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  position: relative; width: 100%;
  height: clamp(280px, 56vw, 540px);
  background: var(--surface); overflow: hidden;
}
.hero iframe {
  width: 100%; height: 100%; border: none; display: block;
}
.hero-overlay {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(to top, rgba(7,7,15,1) 0%, rgba(7,7,15,.3) 40%, transparent 70%);
}
.hero-info {
  position: absolute; bottom: 16px; left: 20px; right: 20px;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px;
}
.hero-meta { flex: 1; }
.hero-live-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px;
  padding: 3px 8px; border-radius: 4px; margin-bottom: 6px;
}
.hero-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(22px, 5vw, 40px);
  line-height: 1.05; letter-spacing: .5px;
  text-shadow: 0 2px 12px rgba(0,0,0,.8);
}
.hero-subtitle { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.hero-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.btn-watch {
  background: var(--blue); color: #fff;
  border: none; border-radius: 8px;
  padding: 9px 18px; font-size: 14px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.btn-watch:hover { background: var(--blue-dim); }

.hero-no-live {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; height: 100%; gap: 12px; padding: 24px;
  text-align: center;
}
.hero-no-live .big-icon { font-size: 48px; opacity: .35; }
.hero-no-live h2 { font-family: 'Bebas Neue', sans-serif; font-size: 28px; letter-spacing: 1px; }
.hero-no-live p { color: var(--text-dim); font-size: 13px; }

/* ── Iframe Notice (estilo lacancha.tv) ───────────────────────────────────── */
.iframe-notice {
  display: none; align-items: flex-start; gap: 8px;
  background: rgba(249,115,22,.08);
  border: 1px solid rgba(249,115,22,.22);
  border-radius: 10px; margin: 10px 20px 0;
  padding: 10px 14px; font-size: 11.5px; line-height: 1.5;
  color: var(--text-dim);
}
.iframe-notice-icon { flex-shrink: 0; }
.iframe-notice a { color: var(--orange); font-weight: 600; }
.iframe-notice strong { color: var(--text); }

/* ── Channel Warning ──────────────────────────────────────────────────────── */
.channel-warning {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; margin: 10px 20px; padding: 10px 14px;
  font-size: 12px; color: var(--text-dim);
}
.cw-close {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 13px; flex-shrink: 0; padding: 2px 6px;
}
.cw-close:hover { color: var(--text); }

/* ── Chip Tag ─────────────────────────────────────────────────────────────── */
.chip-tag {
  font-size: 8px; font-weight: 800; letter-spacing: .5px;
  color: var(--orange); background: rgba(249,115,22,.12);
  padding: 1px 5px; border-radius: 4px;
}

/* ── Channel Selector (below hero) ───────────────────────────────────────── */
.channel-strip {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex; align-items: center; gap: 10px; overflow-x: auto;
}
.channel-chip {
  flex-shrink: 0; display: flex; flex-direction: column;
  align-items: center; gap: 4px; cursor: pointer;
  padding: 8px 14px; border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  transition: all .18s; min-width: 80px; text-align: center;
}
.channel-chip:hover, .channel-chip.active {
  border-color: var(--blue);
  background: rgba(14,165,233,.1);
  box-shadow: 0 0 14px var(--blue-glow);
}
.chip-name { font-size: 11px; font-weight: 700; letter-spacing: .5px; }
.chip-label { font-size: 9px; color: var(--text-dim); }
.chip-live { font-size: 9px; color: var(--red); font-weight: 700; }

/* ── Content Sections ─────────────────────────────────────────────────────── */
.content-section { padding: 24px 0 4px; }
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 12px;
}
.section-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px; letter-spacing: 1px;
  display: flex; align-items: center; gap: 8px;
}
.section-title .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--blue);
}
.section-see-all {
  font-size: 12px; color: var(--blue);
  cursor: pointer; font-weight: 600;
}

/* Horizontal scroll rows */
.scroll-row {
  display: flex; gap: 12px;
  padding: 4px 20px 12px;
  overflow-x: auto; scroll-snap-type: x mandatory;
}
.scroll-row::-webkit-scrollbar { height: 3px; }

/* ── Match Cards ──────────────────────────────────────────────────────────── */
.match-card {
  flex: 0 0 200px; background: var(--surface-2);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 14px; cursor: pointer; scroll-snap-align: start;
  transition: all .18s;
}
.match-card:hover {
  border-color: var(--blue-glow);
  background: var(--surface-3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
.match-card.live { border-color: rgba(239,68,68,.4); }
.match-card.live:hover { border-color: var(--red); box-shadow: 0 0 18px rgba(239,68,68,.25); }
.mc-status {
  font-size: 9px; font-weight: 800; letter-spacing: 1.5px;
  margin-bottom: 10px; display: flex; align-items: center; gap: 5px;
}
.mc-status.live { color: var(--red); }
.mc-status.upcoming { color: var(--text-dim); }
.mc-teams {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.mc-team { flex: 1; text-align: center; }
.mc-flag { font-size: 22px; line-height: 1; }
.mc-team-name { font-size: 10px; color: var(--text-dim); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-score-block { text-align: center; }
.mc-score { font-family: 'Bebas Neue', sans-serif; font-size: 28px; letter-spacing: 2px; }
.mc-time { font-size: 10px; color: var(--text-dim); }
.mc-competition { font-size: 10px; color: var(--text-muted); margin-top: 8px; }

/* ── Channel Cards Grid ───────────────────────────────────────────────────── */
.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px; padding: 4px 20px 12px;
}
.ch-card {
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 16px 12px;
  cursor: pointer; transition: all .18s; text-align: center;
  aspect-ratio: 16/9; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
}
.ch-card:hover {
  border-color: var(--blue);
  background: rgba(14,165,233,.08);
  box-shadow: 0 0 0 1px var(--blue), 0 0 20px var(--blue-glow);
  transform: scale(1.03);
}
.ch-name { font-size: 13px; font-weight: 800; letter-spacing: .5px; }
.ch-option { font-size: 10px; color: var(--text-dim); }
.ch-live-tag {
  font-size: 9px; font-weight: 700; color: var(--red);
  display: flex; align-items: center; gap: 4px;
}

/* ── Results Row ──────────────────────────────────────────────────────────── */
.result-card {
  flex: 0 0 170px; background: var(--surface-2);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 12px; scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 8px;
}
.rc-competition { font-size: 9px; color: var(--text-muted); letter-spacing: 1px; font-weight: 700; }
.rc-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.rc-team { font-size: 12px; font-weight: 600; flex: 1; }
.rc-team.right { text-align: right; }
.rc-score { font-family: 'Bebas Neue', sans-serif; font-size: 20px; letter-spacing: 2px; color: var(--blue); }

/* ── Quiniela Section ─────────────────────────────────────────────────────── */
#quiniela-section { padding: 16px 20px 24px; }
.quiniela-login-prompt {
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 16px; padding: 28px; text-align: center;
}
.quiniela-login-prompt h3 { font-family: 'Bebas Neue', sans-serif; font-size: 24px; letter-spacing: 1px; margin-bottom: 8px; }
.quiniela-login-prompt p { color: var(--text-dim); font-size: 13px; margin-bottom: 16px; }

.quiniela-match {
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 10px;
}
.qm-header { font-size: 10px; color: var(--text-muted); margin-bottom: 10px; letter-spacing: .5px; }
.qm-teams { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.qm-team { flex: 1; }
.qm-team-name { font-size: 13px; font-weight: 700; }
.qm-vs { font-family: 'Bebas Neue', sans-serif; font-size: 16px; color: var(--text-muted); }
.qm-picks { display: flex; gap: 8px; }
.pick-btn {
  flex: 1; border: 1.5px solid var(--border);
  background: var(--surface-3); color: var(--text-dim);
  border-radius: 8px; padding: 8px 4px; font-size: 11px; font-weight: 700;
  cursor: pointer; transition: all .18s; text-align: center;
  font-family: inherit;
}
.pick-btn:hover { border-color: var(--blue); color: var(--blue); }
.pick-btn.selected-home { background: rgba(14,165,233,.15); border-color: var(--blue); color: var(--blue); }
.pick-btn.selected-draw { background: rgba(249,115,22,.15); border-color: var(--orange); color: var(--orange); }
.pick-btn.selected-away { background: rgba(34,197,94,.15); border-color: var(--green); color: var(--green); }

/* ── Ranking ──────────────────────────────────────────────────────────────── */
.ranking-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 6px;
  background: var(--surface-2); border: 1.5px solid var(--border);
}
.ranking-pos { font-family: 'Bebas Neue', sans-serif; font-size: 20px; color: var(--text-muted); width: 24px; text-align: center; }
.ranking-pos.gold { color: #fbbf24; }
.ranking-pos.silver { color: #94a3b8; }
.ranking-pos.bronze { color: #cd7c2f; }
.ranking-name { flex: 1; font-weight: 600; font-size: 14px; }
.ranking-pts { font-family: 'Bebas Neue', sans-serif; font-size: 22px; color: var(--blue); }

/* ── Ad Bar ───────────────────────────────────────────────────────────────── */
.ad-bar {
  position: fixed; bottom: var(--nav-h); left: 0; right: 0;
  height: var(--ad-h); z-index: 150;
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.ad-bar.hidden { display: none; }
.ad-label {
  position: absolute; top: 3px; right: 8px;
  font-size: 9px; color: var(--text-muted); letter-spacing: .5px;
}
.ad-close {
  position: absolute; top: 4px; left: 8px;
  font-size: 11px; color: var(--text-muted); cursor: pointer; padding: 2px 4px;
}
.ad-close:hover { color: var(--text); }
.ad-placeholder {
  width: 100%; max-width: 728px; height: 56px;
  background: var(--surface-2); border: 1px dashed var(--border-hi);
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 11px; margin: 0 16px;
}
.ad-content { width: 100%; display: flex; align-items: center; justify-content: center; padding: 0 48px; }

/* ── Bottom Nav ───────────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-h); z-index: 200;
  background: rgba(7,7,15,.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  color: var(--text-muted); cursor: pointer;
  font-size: 10px; font-weight: 600; letter-spacing: .3px;
  transition: color .15s; border: none; background: none; font-family: inherit;
}
.nav-item svg { width: 20px; height: 20px; stroke-width: 1.8; }
.nav-item:hover, .nav-item.active { color: var(--blue); }
.nav-item.active svg { stroke: var(--blue); }

/* ── Modals ───────────────────────────────────────────────────────────────── */
.modal-backdrop {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.7); backdrop-filter: blur(4px);
  align-items: center; justify-content: center; padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: 20px; padding: 28px 24px; width: 100%; max-width: 380px;
  box-shadow: 0 24px 64px rgba(0,0,0,.8);
}
.modal-title {
  font-family: 'Bebas Neue', sans-serif; font-size: 26px; letter-spacing: 1px;
  margin-bottom: 20px; text-align: center;
}
.modal-title span { color: var(--orange); }
.form-group { margin-bottom: 14px; }
.form-label { font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; display: block; }
.form-input {
  width: 100%; background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 10px; padding: 11px 14px; color: var(--text); font-size: 14px;
  outline: none; font-family: inherit; transition: border-color .2s;
}
.form-input:focus { border-color: var(--blue); }
.form-error { font-size: 12px; color: var(--red); margin-top: 6px; min-height: 16px; }

.btn-google {
  width: 100%; background: #fff; color: #3c4043;
  border: none; border-radius: 10px; padding: 11px;
  font-size: 14px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: inherit; transition: background .18s; margin-bottom: 12px;
}
.btn-google:hover { background: #f5f5f5; }

.modal-divider {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.modal-divider::before, .modal-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.modal-divider span { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

.btn-full {
  width: 100%; padding: 12px; border-radius: 10px;
  font-size: 15px; font-weight: 700; cursor: pointer; border: none;
  font-family: inherit; transition: all .18s;
}
.btn-blue-full { background: var(--blue); color: #fff; }
.btn-blue-full:hover { background: var(--blue-dim); }

.modal-switch { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-dim); }
.modal-switch a { color: var(--blue); cursor: pointer; text-decoration: none; font-weight: 600; }
.modal-close {
  float: right; background: none; border: none; color: var(--text-muted);
  font-size: 20px; cursor: pointer; line-height: 1; margin-top: -4px;
}

/* ── Toast ────────────────────────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: calc(var(--nav-h) + var(--ad-h) + 12px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-3); color: var(--text);
  padding: 10px 20px; border-radius: 24px; font-size: 13px; font-weight: 500;
  z-index: 999; opacity: 0; transition: all .25s;
  border: 1px solid var(--border-hi); white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.6);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Mundial Strip ────────────────────────────────────────────────────────── */
.mundial-strip {
  background: linear-gradient(90deg, #0d1a2e, #0f1f3d, #0d1a2e);
  text-align: center; padding: 6px 16px;
  font-size: 11px; color: var(--text-dim); letter-spacing: .5px;
  border-bottom: 1px solid rgba(14,165,233,.15);
}
.mundial-strip strong { color: var(--orange); }

/* ── Trivia / Info Cards ──────────────────────────────────────────────────── */
.trivia-card {
  flex: 0 0 260px; background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 16px; scroll-snap-align: start;
}
.trivia-q { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.trivia-a { font-size: 12px; color: var(--orange); font-weight: 600; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (min-width: 640px) {
  .top-nav { padding: 0 32px; }
  .hero-title { font-size: 44px; }
  .channels-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
@media (min-width: 1024px) {
  body { padding-top: 64px; }
  .top-nav { height: 64px; }
  .content-section { padding: 28px 0 8px; }
  .section-title { font-size: 22px; }
  .channels-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
  .match-card { flex: 0 0 220px; }
  .hero { height: clamp(360px, 50vw, 600px); }
}
@media (max-width: 400px) {
  .nav-center { display: none; }
}
