/* ============================================================
   VegasBet — Esports page (design import)
   Board + filter visuals from the provided design. Functionality
   (filtering, betslip, sidebar sync) is handled by esports.js and
   is untouched — this file is visual only. Dark bg + purple accents.
   ============================================================ */

.esports-layout {
  --vb-live: #ff3c3c;
  --vb-border: rgba(124, 58, 237, 0.18);
  --vb-card: #1c1c1f;
  --vb-text-2: #8884aa;
  --vb-text: #e9e6f0;
}

@keyframes vbLivePulse {
  0%, 100% { box-shadow: rgba(255, 60, 60, 0.5) 0 0 0 0; opacity: 1; }
  50%      { box-shadow: rgba(255, 60, 60, 0) 0 0 0 6px; opacity: 0.65; }
}

/* ── Filter pills ───────────────────────────────────────────── */
.esb-filters {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.esb-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 18px;
  border-radius: 13px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: rgb(185, 179, 202);
  background: linear-gradient(#1d1d24, #151519);
  border: 1px solid rgba(124, 58, 237, 0.2);
  box-shadow: rgba(255, 255, 255, 0.03) 0 1px 0 inset, rgba(0, 0, 0, 0.8) 0 6px 16px -12px;
  transition: color .16s, border-color .16s, background .16s, transform .16s, box-shadow .16s;
  white-space: nowrap;
  overflow: hidden;
}
.esb-pill svg { width: 16px; height: 16px; color: #8f88a8; transition: color .16s, filter .16s; }
.esb-pill .pill-ic { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.esb-pill:hover {
  color: #fff;
  border-color: rgba(168, 85, 247, 0.45);
  background: linear-gradient(#241a35, #191223);
  transform: translateY(-1px);
}
.esb-pill:hover svg { color: #c084fc; }
.esb-pill.active {
  color: #fff;
  background: linear-gradient(#2a1c40, #1a1128);
  border-color: rgba(168, 85, 247, 0.7);
  box-shadow: rgba(124, 58, 237, 0.85) 0 10px 26px -12px,
              rgba(168, 85, 247, 0.35) 0 0 0 1px,
              rgba(192, 132, 252, 0.22) 0 1px 0 inset;
}
.esb-pill.active svg { color: #d7b8ff; filter: drop-shadow(rgba(168, 85, 247, 0.7) 0 0 6px); }
.esb-pill.active::after {
  content: "";
  position: absolute;
  left: 16%; right: 16%; bottom: 0;
  height: 2.5px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, transparent, #c084fc, #7c3aed, transparent);
  box-shadow: rgba(168, 85, 247, 0.9) 0 0 12px 1px;
}
.esb-pill .pill-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--vb-live);
  box-shadow: rgba(255, 60, 60, 0.8) 0 0 8px;
  animation: vbLivePulse 1.6s ease infinite;
}
.esb-pill.pill-all svg { color: #f0b34a; }
.esb-pill.pill-all.active svg { color: #ffca66; filter: drop-shadow(rgba(240, 179, 74, 0.7) 0 0 6px); }

/* ── Board shell ────────────────────────────────────────────── */
.esb-board {
  background: linear-gradient(#1a1a1f, #141417);
  border: 1px solid var(--vb-border);
  border-radius: 18px;
  padding: 16px 16px 10px;
  box-shadow: rgba(124, 58, 237, 0.5) 0 24px 50px -32px;
}
.esb-board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 6px 14px;
  border-bottom: 1px solid rgba(124, 58, 237, 0.14);
  margin-bottom: 6px;
}
.ebh-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.2px;
}
.ebh-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--vb-text-2);
}

/* ── Column headers ─────────────────────────────────────────── */
.lb-head {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
  gap: 16px;
  padding: 12px;
  color: var(--vb-text-2);
}
.lb-head-event { font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.lb-head-markets .lb-mgroup { gap: 8px; }
.lb-head-title { text-align: center; font-size: 11px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: #9c96b3; margin-bottom: 6px; }
.lb-head-subs { display: grid; gap: 6px; }
.lb-head-sub { font-size: 10.5px; font-weight: 700; color: #6f6a85; text-align: center; }

/* ── Markets grid ───────────────────────────────────────────── */
.lb-markets { display: flex; gap: 14px; flex-shrink: 0; }
.lb-mgroup { display: flex; flex-direction: column; }
.lb-cells { display: grid; gap: 6px; }
.lb-mgroup--2 .lb-cells,
.lb-mgroup--2 .lb-head-subs { grid-template-columns: repeat(2, 62px); }

/* ── Match row ──────────────────────────────────────────────── */
.lb-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 13px 14px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: var(--vb-card);
  border: 1px solid rgba(124, 58, 237, 0.12);
  border-left: 3px solid rgba(124, 58, 237, 0.14);
  transition: border-color .18s, transform .18s, box-shadow .18s;
  cursor: pointer;
}
.lb-row:hover {
  border-color: rgba(168, 85, 247, 0.38);
  border-left-color: rgba(168, 85, 247, 0.6);
  transform: translateY(-2px);
  box-shadow: rgba(124, 58, 237, 0.6) 0 14px 30px -20px;
}
.lb-row.is-live { border-left-color: rgba(255, 60, 60, 0.6); }
.lb-row.is-live:hover { border-left-color: var(--vb-live); }

.lb-event { min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.lb-league { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--vb-text-2); min-width: 0; }
.lg-ic-img { width: 18px; height: 18px; object-fit: contain; flex-shrink: 0; }
.lb-league .lg-name { color: #c9c3d8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.lb-teams { display: flex; flex-direction: column; gap: 6px; }
.lb-team { display: grid; grid-template-columns: 22px minmax(0, 1fr) 26px; align-items: center; gap: 9px; }
.lb-logo {
  width: 22px; height: 22px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(124, 58, 237, 0.14);
  border: 1px solid rgba(124, 58, 237, 0.24);
  font-size: 9.5px; font-weight: 800;
  color: #c9a2ff;
  font-family: 'Space Grotesk', sans-serif;
  overflow: hidden;
}
.lb-logo-img { width: 100%; height: 100%; object-fit: contain; }
.lb-name { font-size: 14px; font-weight: 600; color: #eae7f2; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-score { justify-self: end; font-family: 'Space Grotesk', sans-serif; font-size: 17px; font-weight: 700; color: #c084fc; font-variant-numeric: tabular-nums; line-height: 1; }

.lb-meta { display: flex; align-items: center; gap: 9px; margin-top: 1px; }
.lb-time-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: .4px;
  color: #ff8f8f; text-transform: uppercase;
  padding: 3px 9px; border-radius: 100px;
  background: rgba(255, 60, 60, 0.1); border: 1px solid rgba(255, 60, 60, 0.26);
}
.lb-time-live .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--vb-live); animation: vbLivePulse 1.6s ease infinite; }
.lb-map { font-size: 11px; font-weight: 700; color: #9c96b3; }
.lb-time-pre { font-size: 11.5px; font-weight: 700; color: #9c96b3; }
.lb-time-pre b { color: #d6d0e4; }

/* ── Odds cells ─────────────────────────────────────────────── */
.lb-cell {
  width: 62px; height: 46px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  background: rgba(13, 13, 13, 0.5);
  border: 1px solid var(--vb-border);
  border-radius: 10px;
  cursor: pointer;
  transition: transform .14s, border-color .14s, background .14s, box-shadow .14s;
  font-family: inherit;
  text-decoration: none;
}
.lb-cell:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(124, 58, 237, 0.1));
  border-color: rgba(168, 85, 247, 0.5);
  box-shadow: rgba(168, 85, 247, 0.7) 0 10px 20px -14px;
}
.lb-cell-lbl { font-size: 9.5px; font-weight: 700; color: var(--vb-text-2); text-transform: uppercase; max-width: 56px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-cell-odds { font-size: 14px; font-weight: 800; color: #efeaf9; font-variant-numeric: tabular-nums; }
.lb-cell.selected {
  background: linear-gradient(135deg, #9a4fe0, #7434d0);
  border-color: #c084fc;
  box-shadow: rgba(192, 132, 252, 0.5) 0 0 0 1px, rgba(168, 85, 247, 0.8) 0 10px 24px -12px;
}
.lb-cell.selected .lb-cell-lbl,
.lb-cell.selected .lb-cell-odds { color: #fff; }
/* Suspended / unavailable market cell */
.lb-cell--off { cursor: default; opacity: 0.45; }
.lb-cell--off:hover { transform: none; background: rgba(13, 13, 13, 0.5); border-color: var(--vb-border); box-shadow: none; }

/* ── Empty state ────────────────────────────────────────────── */
.esb-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 60px 20px; text-align: center;
}
.esb-empty[hidden] { display: none; }
.esb-empty-icon { font-size: 34px; opacity: 0.9; }
.esb-empty-title { font-size: 16px; font-weight: 700; color: var(--vb-text); }
.esb-empty-name { color: var(--accent); }
.esb-empty-sub { font-size: 13px; color: var(--vb-text-2); max-width: 460px; }

/* ── Light entrance + filter re-fade (our JS toggles .es-refreshing) ── */
.esb-board .lb-row { animation: esRowIn .4s cubic-bezier(.16, 1, .3, 1) both; }
.esb-board .lb-row:nth-child(4)  { animation-delay: .03s; }
.esb-board .lb-row:nth-child(5)  { animation-delay: .06s; }
.esb-board .lb-row:nth-child(6)  { animation-delay: .09s; }
.esb-board .lb-row:nth-child(7)  { animation-delay: .12s; }
.esb-board .lb-row:nth-child(n+8){ animation-delay: .15s; }
@keyframes esRowIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.esb-board.es-refreshing { animation: esBoardFade .28s ease; }
@keyframes esBoardFade { from { opacity: .4; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .esb-pill .pill-live-dot, .lb-time-live .dot,
  .esb-board .lb-row, .esb-board.es-refreshing { animation: none; }
  .esb-pill:hover, .lb-row:hover, .lb-cell:hover { transform: none; }
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 720px) {
  .lb-row, .lb-head { grid-template-columns: 1fr; }
  .lb-markets { overflow-x: auto; padding-bottom: 4px; }
  .lb-head { display: none; }
}
