* { box-sizing: border-box; }

body {
  font-family: Arial, sans-serif;
  background: #f4f6fb;
  color: #111;
  margin: 0;
  padding: 0;
}

header {
  background: linear-gradient(135deg, #1d428a, #c8102e);
  color: white;
  padding: 24px 16px;
  text-align: center;
}

header h1 { margin: 0 0 8px; font-size: 32px; font-weight: 700; }
header p  { margin: 0; opacity: 0.95; font-size: 15px; }

main {
  max-width: 1400px;
  margin: 24px auto;
  padding: 0 16px;
}

.card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

/* Status row */
.status-card { padding: 14px 20px; }
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

#status { margin: 0; font-size: 14px; color: #334155; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.updated-at {
  font-size: 12px;
  color: #94a3b8;
}

.filter-tabs { display: flex; gap: 6px; }
.tab {
  padding: 6px 14px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: white;
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}
.tab:hover { border-color: #1d428a; color: #1d428a; }
.tab.active { background: #1d428a; border-color: #1d428a; color: white; }

/* Games grid */
#games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

/* Game card */
.game-card {
  background: #ffffff;
  border: 1px solid #e3e7ef;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: box-shadow 0.2s;
}

.game-card:hover { box-shadow: 0 12px 32px rgba(0,0,0,0.1); }

/* Alerta card */
.game-card.has-alerta {
  border-color: #fbbf24;
  border-width: 2px;
  background: linear-gradient(180deg, #fffbeb, #ffffff);
}

.alerta-banner {
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #92400e;
  line-height: 1.4;
}

.alerta-banner .alerta-titulo {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #b45309;
  margin-bottom: 3px;
}

/* Game top */
.game-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.game-status { font-size: 14px; font-weight: 700; color: #c8102e; }
.game-date   { font-size: 13px; color: #666; text-align: right; }

/* Teams */
.teams { display: flex; flex-direction: column; gap: 8px; }

.team-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: #fbfcff;
  border: 1px solid #e3e7ef;
  border-radius: 12px;
  padding: 10px 14px;
}

.team-name  { flex: 1; font-size: 15px; font-weight: 700; color: #111; }
.team-score { font-size: 22px; font-weight: 700; color: #1d428a; }

/* Odds row en la card */
.odds-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.odds-cell {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 7px 8px;
  text-align: center;
}

.odds-cell-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #94a3b8;
  margin-bottom: 4px;
}

.odds-pair { display: flex; flex-direction: column; gap: 2px; }

.odds-val {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}
.odds-val.pos { color: #16a34a; }
.odds-val.neg { color: #c8102e; }
.odds-val.neu { color: #334155; }
.odds-val.muted { color: #94a3b8; font-size: 12px; }

/* Pick badge en la card */
.pick-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

.pick-badge.pick-pos {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.pick-badge.pick-warn {
  background: #fffbeb;
  border-color: #fde68a;
}
.pick-badge.pick-wait {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.pick-tipo {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.pick-tipo.pos  { color: #15803d; }
.pick-tipo.warn { color: #b45309; }
.pick-tipo.wait { color: #1d4ed8; }
.pick-tipo.neu  { color: #475569; }

.pick-confianza {
  font-size: 11px;
  color: #64748b;
  margin-left: auto;
}

/* Live badge */
.live-extra {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #16a34a, #15803d);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(21,128,61,0.25);
  white-space: nowrap;
}
.live-extra.is-final    { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.live-extra.is-scheduled{ background: linear-gradient(135deg, #1d428a, #1e3a7b); }

/* Actions */
.game-actions { margin-top: auto; }

.analyze-btn {
  width: 100%;
  background: #1d428a;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 11px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
}
.analyze-btn:hover { background: #16346d; }

/* MODAL */
.modal.hidden { display: none; }
.modal { position: fixed; inset: 0; z-index: 9999; overflow-y: auto; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,0.45); }

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(960px, calc(100% - 24px));
  margin: 18px auto;
  background: #fff;
  border-radius: 18px;
  border: 1px solid #dbe3ef;
  box-shadow: 0 24px 60px rgba(15,23,42,0.18);
  max-height: calc(100vh - 36px);
  overflow: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #e8edf5;
  position: sticky;
  top: 0;
  background: white;
  z-index: 2;
}
.modal-header h2 { margin: 0; font-size: 20px; color: #1d428a; }
.close-btn {
  border: none;
  background: #eef3fb;
  color: #1d428a;
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.close-btn:hover { background: #dfe9f8; }

#analysis-panel { padding: 20px; }

/* Analysis box */
.analysis-box { display: flex; flex-direction: column; gap: 20px; }

.analysis-header h3 { margin: 0 0 4px; font-size: 22px; color: #1d428a; }
.analysis-subtitle  { margin: 0; font-size: 13px; color: #666; }
.analysis-date      { margin: 4px 0 0; font-size: 13px; color: #444; }

/* Recomendación modal */
.rec-box {
  border-radius: 14px;
  padding: 16px;
  border: 1px solid #dbe3ef;
}
.rec-box.pos  { background: linear-gradient(180deg,#f0fdf4,#fff); border-color: #bbf7d0; }
.rec-box.warn { background: linear-gradient(180deg,#fffbeb,#fff); border-color: #fde68a; }
.rec-box.wait { background: linear-gradient(180deg,#eff6ff,#fff); border-color: #bfdbfe; }
.rec-box.neu  { background: linear-gradient(180deg,#f8fafc,#fff); border-color: #e2e8f0; }

.rec-kicker { font-size: 11px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: #1d428a; margin-bottom: 4px; }
.rec-pick   { font-size: 20px; font-weight: 700; color: #111827; margin-bottom: 6px; }
.rec-tipo   { font-size: 12px; font-weight: 700; display: inline-block; padding: 3px 10px; border-radius: 6px; margin-bottom: 8px; }
.rec-tipo.pos  { background: #dcfce7; color: #15803d; }
.rec-tipo.warn { background: #fef3c7; color: #b45309; }
.rec-tipo.wait { background: #dbeafe; color: #1d4ed8; }
.rec-tipo.neu  { background: #f1f5f9; color: #475569; }
.rec-notas  { font-size: 14px; color: #334155; line-height: 1.5; margin: 0; }

/* Injury list en modal */
.injury-section { margin-top: 4px; }
.injury-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: #64748b; margin-bottom: 8px; }
.injury-list  { display: flex; flex-direction: column; gap: 5px; }
.injury-item  {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
}
.injury-item.clave { border-color: #fbbf24; background: #fffbeb; }

.inj-status {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  white-space: nowrap;
}
.inj-status.out   { background: #fee2e2; color: #991b1b; }
.inj-status.doubt { background: #fef3c7; color: #92400e; }
.inj-status.ques  { background: #dbeafe; color: #1e40af; }
.inj-status.prob  { background: #f1f5f9; color: #475569; }
.inj-clave { font-size: 11px; color: #b45309; font-weight: 700; }

/* Odds table en modal */
.odds-section { }
.odds-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: #64748b; margin-bottom: 10px; }

.odds-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.odds-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #64748b;
  border-bottom: 1px solid #e2e8f0;
}
.odds-table td { padding: 9px 12px; border-bottom: 1px solid #f1f5f9; }
.odds-table tr:hover td { background: #f8fafc; }
.odds-table tr:last-child td { border-bottom: none; }

.best-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 4px;
  color: #92400e;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
}

/* Pregame compare */
.pregame-shell { }
.pregame-compare { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }

.pregame-row {
  display: grid;
  grid-template-columns: 1fr 150px 1fr;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.pregame-row > div {
  padding: 12px;
  font-size: 13px;
  display: flex;
  align-items: center;
}

.pregame-row .metric {
  justify-content: center;
  background: #f8fafc;
  font-weight: 700;
  text-align: center;
  color: #526176;
  font-size: 12px;
}

.pregame-row .away { justify-content: flex-start; font-weight: 600; }
.pregame-row .home { justify-content: flex-end;   font-weight: 600; text-align: right; }

.pregame-head { background: #1d428a; border: none; border-radius: 12px; }
.pregame-head > div { color: #fff; font-size: 13px; font-weight: 700; }
.pregame-head > div:nth-child(2) { justify-content: center; background: rgba(255,255,255,0.1); }
.pregame-head > div:nth-child(3) { justify-content: flex-end; }

.edge { color: #15803d !important; font-weight: 700 !important; }

/* Form chips */
.form-chips { display: flex; align-items: center; gap: 5px; flex-wrap: nowrap; }
.form-chips.right { justify-content: flex-end; }

.form-chip {
  width: 26px; height: 26px; min-width: 26px;
  border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff;
}
.form-chip.win  { background: #16a34a; }
.form-chip.loss { background: #dc2626; }

.no-games { text-align: center; padding: 40px; color: #64748b; font-size: 15px; }

/* Responsive */
@media (max-width: 900px) {
  #games { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 600px) {
  #games { grid-template-columns: 1fr; }
  header h1 { font-size: 24px; }
  .modal-panel { width: calc(100% - 12px); margin: 6px auto; }
  .pregame-row { grid-template-columns: 1fr; }
  .pregame-head { display: none; }
}

/* ── O/U picks ─────────────────────────────────────────────────────── */
.pick-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.pick-badge.pick-pos  { background:#f0fdf4; border-color:#bbf7d0; }
.pick-badge.pick-warn { background:#fffbeb; border-color:#fde68a; }
.pick-badge.pick-wait { background:#eff6ff; border-color:#bfdbfe; }
.pick-badge.pick-over  { background:#fef9ee; border-color:#fed7aa; }
.pick-badge.pick-under { background:#f0f9ff; border-color:#bae6fd; }
.pick-badge.pick-neu  { background:#f8fafc; border-color:#e2e8f0; }

.pick-icono { font-size: 16px; flex-shrink:0; }
.pick-content { display:flex; flex-direction:column; gap:1px; flex:1; }
.pick-label { font-size:10px; text-transform:uppercase; letter-spacing:0.4px; color:#94a3b8; font-weight:700; }

.pick-tipo { font-size:13px; font-weight:800; }
.pick-tipo.pos   { color:#15803d; }
.pick-tipo.warn  { color:#b45309; }
.pick-tipo.wait  { color:#1d4ed8; }
.pick-tipo.over  { color:#c2410c; }
.pick-tipo.under { color:#0369a1; }
.pick-tipo.neu   { color:#64748b; }

.pick-confianza { font-size:11px; color:#64748b; white-space:nowrap; }

.team-label-role {
  font-size:11px;
  font-weight:700;
  color:#94a3b8;
  background:#f1f5f9;
  border:1px solid #e2e8f0;
  border-radius:5px;
  padding:2px 7px;
  flex-shrink:0;
}

/* O/U en modal */
.ou-box { margin-top: 0; }
.rec-box.over  { background:linear-gradient(180deg,#fef9ee,#fff); border-color:#fed7aa; }
.rec-box.under { background:linear-gradient(180deg,#f0f9ff,#fff); border-color:#bae6fd; }
.rec-tipo.over  { background:#fff7ed; color:#c2410c; }
.rec-tipo.under { background:#e0f2fe; color:#0369a1; }

/* ── Score en vivo / final ──────────────────────────────────────────── */
.game-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.badge-live {
  background: #fee2e2;
  color: #dc2626;
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.7; }
}

.badge-final    { background: #f1f5f9; color: #64748b; }
.badge-upcoming { background: #eff6ff; color: #1d428a; font-weight: 600; }

.score-live, .score-final {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 0 4px;
}

.score-val {
  font-size: 28px;
  font-weight: 800;
  color: #111827;
  line-height: 1;
}

.score-sep {
  font-size: 18px;
  color: #94a3b8;
  font-weight: 400;
}

/* Card states */
.card-live {
  border-color: #fca5a5 !important;
  background: linear-gradient(180deg, #fff5f5, #ffffff) !important;
}

.card-final { opacity: 0.85; }

/* Pick histórico (mostrado en partidos en vivo/finales) */
.pick-historical {
  opacity: 0.75;
  border-style: dashed !important;
}

/* Banner en vivo en modal */
.live-result-banner {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.banner-live  { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.banner-final { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

.historical-note {
  font-size: 11px;
  font-weight: 400;
  opacity: 0.8;
  margin-left: 4px;
}

/* O/U styles */
.pick-badge { display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:10px; background:#f1f5f9; border:1px solid #e2e8f0; }
.pick-badge.pick-pos   { background:#f0fdf4; border-color:#bbf7d0; }
.pick-badge.pick-warn  { background:#fffbeb; border-color:#fde68a; }
.pick-badge.pick-wait  { background:#eff6ff; border-color:#bfdbfe; }
.pick-badge.pick-over  { background:#fef9ee; border-color:#fed7aa; }
.pick-badge.pick-under { background:#f0f9ff; border-color:#bae6fd; }
.pick-badge.pick-neu   { background:#f8fafc; border-color:#e2e8f0; }
.pick-icono   { font-size:16px; flex-shrink:0; }
.pick-content { display:flex; flex-direction:column; gap:1px; flex:1; }
.pick-label   { font-size:10px; text-transform:uppercase; letter-spacing:0.4px; color:#94a3b8; font-weight:700; }
.pick-tipo    { font-size:13px; font-weight:800; }
.pick-tipo.pos   { color:#15803d; }
.pick-tipo.warn  { color:#b45309; }
.pick-tipo.wait  { color:#1d4ed8; }
.pick-tipo.over  { color:#c2410c; }
.pick-tipo.under { color:#0369a1; }
.pick-tipo.neu   { color:#64748b; }
.pick-confianza  { font-size:11px; color:#64748b; white-space:nowrap; }
.team-label-role { font-size:11px; font-weight:700; color:#94a3b8; background:#f1f5f9; border:1px solid #e2e8f0; border-radius:5px; padding:2px 7px; flex-shrink:0; }
.ou-box { margin-top:0; }
.rec-box.over  { background:linear-gradient(180deg,#fef9ee,#fff); border-color:#fed7aa; }
.rec-box.under { background:linear-gradient(180deg,#f0f9ff,#fff); border-color:#bae6fd; }
.rec-tipo.over  { background:#fff7ed; color:#c2410c; }
.rec-tipo.under { background:#e0f2fe; color:#0369a1; }

/* ── EV display ──────────────────────────────────────────────────────── */
.ev-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  background: #dcfce7;
  border: 1px solid #86efac;
  border-radius: 5px;
  color: #15803d;
  letter-spacing: 0.3px;
}

.ev-badge-modal {
  font-family: Arial, sans-serif;
  font-size: 1.1rem;
  font-weight: 800;
  color: #15803d;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 4px 14px;
  white-space: nowrap;
}

.rec-pick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.prob-row {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
}

.prob-item {
  font-size: 13px;
  color: #475569;
}

/* Spread badge */
.pick-badge.pick-spread {
  background: #f0f9ff;
  border: 1px solid #7dd3fc;
}
