/* ======================================================
   League Data Engine – EPL / Sky Sports Clean UI
   ====================================================== */

/* ---------------- CARD ---------------- */

.lde-card {
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.25);
  margin: 20px 0;
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.lde-card-header {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(226, 232, 240, 1);
  background: #ffffff;
}

.lde-card-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}

.lde-card-body {
  padding: 16px 20px;
}

/* ======================================================
   FIXTURES (MATCHES YOUR RED MARKING)
   ====================================================== */

.lde-fixtures-card .lde-card-body {
  padding-inline: 24px;
}

.lde-fixtures-day + .lde-fixtures-day {
  margin-top: 18px;
  border-top: 1px solid rgba(226, 232, 240, 1);
  padding-top: 12px;
}

.lde-fixtures-day-header {
  font-size: 12px;
  text-transform: uppercase;
  color: #64748b;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

/* --- ROW --- */

.lde-fixture-row {
  display: grid;
  grid-template-columns: 1fr 180px 1fr;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(226, 232, 240, 1);
}

.lde-fixture-row:last-child {
  border-bottom: none;
}

.lde-fixture-trigger {
  cursor: pointer;
}

.lde-fixture-trigger:hover {
  background: #f8fafc;
  border-radius: 10px;
}

/* --- TEAMS --- */

.lde-team {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lde-fixture-row .lde-team:first-child {
  justify-content: flex-start;
}

.lde-fixture-row .lde-team:last-child {
  justify-content: flex-end;
}

.lde-team-logo {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex-shrink: 0;
}

.lde-team-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  white-space: nowrap;
}

/* --- SCORE + TIME CENTER (THIS IS THE KEY FIX) --- */

.lde-score-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

/* score MUST sit near team (your red marks) */
.lde-score {
  font-size: 15px;
  font-weight: 700;
  width: 18px;
  text-align: center;
}

/* time always centered */
.lde-fixture-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
}

.lde-fixture-time {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.2;
  white-space: nowrap;
}

.lde-fixture-venue {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
  text-align: center;
  max-width: 140px;
  line-height: 1.2;
  word-break: break-word;
}

/* ======================================================
   STANDINGS TABLE (NO GHOST LINES)
   ====================================================== */

.lde-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.lde-table thead th {
  font-weight: 600;
  color: #0f172a;
  padding: 10px 6px;
  text-align: center;
  border-bottom: 1px solid rgba(226, 232, 240, 1);
  background: #ffffff;
}

.lde-table thead th.lde-col-team {
  text-align: left;
}

.lde-table tbody tr {
  border-bottom: 1px solid rgba(226, 232, 240, 1);
}

.lde-table tbody tr:last-child {
  border-bottom: none;
}

.lde-table tbody td {
  padding: 10px 6px;
  text-align: center;
  color: #0f172a;
}

/* TEAM CELL */

.lde-team-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
}

.lde-logo-sm {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.lde-team-label {
  font-weight: 500;
}

.lde-col-pts {
  font-weight: 700;
}

/* FORM DOTS */

.lde-form-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
  margin: 0 2px;
}

.lde-form-win { background: #22c55e; }
.lde-form-draw { background: #94a3b8; }
.lde-form-loss { background: #ef4444; }

/* ======================================================
   VIEW ALL BUTTON
   ====================================================== */

.lde-view-all {
  margin-top: 16px;
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,.4);
  background: #ffffff;
  cursor: pointer;
}

.lde-view-all:hover {
  background: #f8fafc;
}

/* ======================================================
   MODAL
   ====================================================== */

.lde-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.lde-modal-dialog {
  width: 96%;
  max-width: 680px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.35);
  position: relative;
}

.lde-modal-inner {
  padding: 20px 24px;
}

.lde-modal-close {
  position: absolute;
  right: 14px;
  top: 10px;
  font-size: 22px;
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
}

/* ======================================================
   MOBILE
   ====================================================== */

@media (max-width: 640px) {
  .lde-fixture-row {
    grid-template-columns: 1fr;
    gap: 10px;
    text-align: center;
  }

  .lde-score-center {
    order: -1;
  }

  .lde-team {
    justify-content: center !important;
  }

  .lde-team-name {
    font-size: 12px;
  }
}


/* ======================================================
   STANDINGS MODAL – SCROLLABLE RECTANGLE
   ====================================================== */

#lde-standings-modal .lde-modal-dialog {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

#lde-standings-modal .lde-modal-inner {
  padding: 18px 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#lde-standings-modal-content {
  overflow-y: auto;
  max-height: 60vh;
  padding-right: 6px;
}

/* keep table header visible feel */
#lde-standings-modal-content table {
  margin-bottom: 0;
}


/* ======================================================
   TOP SCORERS / ASSISTS – RESTORE CARD UI
   ====================================================== */

.lde-top-card .lde-card-body {
  padding: 12px 16px;
}

.lde-top-card .lde-player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.lde-top-card .lde-player-row:hover {
  background: #f8fafc;
}

.lde-top-card .lde-player-photo {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
}

.lde-top-card .lde-player-name {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
}

.lde-top-card .lde-player-sub {
  font-size: 11px;
  color: #64748b;
}

.lde-top-card .lde-player-stat {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

/* ======================================================
   STANDINGS – MOBILE RESPONSIVE FIX
   ====================================================== */

.lde-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.lde-table {
  min-width: 640px; /* forces horizontal scroll on mobile */
}

/* Sticky Team Column */
@media (max-width: 768px) {
  .lde-table thead th.lde-col-team,
  .lde-table tbody td.lde-team-cell {
    position: sticky;
    left: 0;
    background: #ffffff;
    z-index: 2;
  }

  .lde-table thead th.lde-col-team {
    z-index: 3;
  }

  /* Slight shadow so users know it scrolls */
  .lde-table tbody td.lde-team-cell::after {
    content: '';
    position: absolute;
    right: -1px;
    top: 0;
    width: 8px;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.08), transparent);
    pointer-events: none;
  }
}

@media (max-width: 640px) {
  .lde-fixtures-day-header {
    text-align: center;
    margin-bottom: 12px;
  }
}