/* OddsDrops Live Matches – modern 2026 */
.lm-wrap {
  --lm-bg: transparent;
  --lm-card: #0f172a;
  --lm-card2: #0b1220;
  --lm-border: #1e293b;
  --lm-text: #e2e8f0;
  --lm-muted: #94a3b8;
  --lm-dim: #64748b;
  --lm-green: #34d399;
  --lm-red: #fb7185;
  --lm-amber: #fbbf24;
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 14px 40px;
  color: var(--lm-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.lm-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid var(--lm-border);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(15,23,42,.95), rgba(7,11,20,.98));
  box-shadow: 0 12px 36px rgba(0,0,0,.22);
}
.lm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.lm-brand h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 850;
  letter-spacing: -0.03em;
}
.lm-brand p {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--lm-muted);
}
.lm-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(52,211,153,.12);
  color: var(--lm-green);
  border: 1px solid rgba(52,211,153,.35);
}
.lm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lm-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .12s, background .12s, border-color .12s;
}
.lm-btn:hover { transform: translateY(-1px); }
.lm-btn-primary {
  background: linear-gradient(135deg, #10b981, #0d9488);
  color: #052e16;
}
.lm-btn-violet {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  color: #fff;
}
.lm-btn-ghost {
  background: #0b1220;
  color: var(--lm-text);
  border: 1px solid var(--lm-border);
}

/* Main tabs LIVE / FINISHED */
.lm-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  border-radius: 14px;
  background: #0b1220;
  border: 1px solid var(--lm-border);
  margin-bottom: 12px;
}
.lm-tabs button {
  border: none;
  background: transparent;
  color: var(--lm-muted);
  font-weight: 800;
  font-size: 13px;
  padding: 11px 12px;
  border-radius: 11px;
  cursor: pointer;
  letter-spacing: .02em;
}
.lm-tabs button.tab-active {
  background: rgba(16, 185, 129, 0.16);
  color: #a7f3d0;
  box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.35);
}

/* League dropdown + search row */
.lm-search-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.lm-league-select-wrap {
  position: relative;
  flex: 0 1 240px;
  min-width: 160px;
  max-width: 100%;
}
.lm-league-select-wrap > i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--lm-green);
  font-size: 12px;
  pointer-events: none;
  z-index: 1;
}
.lm-league-select {
  width: 100%;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  background: #0b1220 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M1.4.6 6 5.2 10.6.6 12 2 6 8 0 2z'/%3E%3C/svg%3E") no-repeat right 14px center;
  border: 1px solid var(--lm-border);
  color: var(--lm-text);
  border-radius: 999px;
  padding: 11px 36px 11px 38px;
  font-size: 13px;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  transition: border-color .12s, box-shadow .12s;
}
.lm-league-select:hover {
  border-color: #475569;
}
.lm-league-select:focus {
  border-color: rgba(52, 211, 153, 0.5);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}
.lm-league-select option {
  background: #0f172a;
  color: #e2e8f0;
}
.lm-search {
  position: relative;
  flex: 1 1 180px;
  min-width: 140px;
}
.lm-search input {
  width: 100%;
  box-sizing: border-box;
  background: #0b1220;
  border: 1px solid var(--lm-border);
  color: var(--lm-text);
  border-radius: 999px;
  padding: 11px 14px 11px 40px;
  font-size: 13px;
  outline: none;
}
.lm-search input:focus {
  border-color: rgba(52, 211, 153, 0.5);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}
.lm-search i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--lm-dim);
  font-size: 13px;
}
.lm-search-meta {
  font-size: 11px;
  color: var(--lm-dim);
  white-space: nowrap;
}
@media (max-width: 640px) {
  .lm-league-select-wrap {
    flex: 1 1 100%;
    max-width: none;
  }
}

/* League groups */
.lm-league {
  margin-bottom: 18px;
  border: 1px solid var(--lm-border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--lm-card2);
  box-shadow: 0 10px 28px rgba(0,0,0,.18);
}
.lm-league-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  background: linear-gradient(90deg, #111827, #0f172a);
  border-bottom: 1px solid var(--lm-border);
  font-weight: 800;
  font-size: 13px;
  color: #f1f5f9;
}
.lm-league-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #070b14;
}

/* Match card */
.match-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px 12px;
  border: 1px solid var(--lm-border);
  border-radius: 14px;
  background: #0f172a;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
}
.match-row:hover {
  border-color: rgba(52, 211, 153, 0.4);
  background: #111827;
  transform: translateY(-1px);
}
.lm-team {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.lm-team.right {
  justify-content: flex-end;
  text-align: right;
}
.lm-team img,
.lm-team .lm-crest {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid #334155;
  background: rgba(255,255,255,.92);
}
.lm-crest {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e293b;
  color: var(--lm-dim);
  font-size: 14px;
  border: 1px solid #334155;
}
.lm-team-name {
  font-weight: 700;
  font-size: 14px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.lm-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 92px;
}
.lm-score {
  min-width: 72px;
  text-align: center;
  padding: 6px 12px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  background: #0b1220;
  border: 1px solid #334155;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.lm-score.live {
  border-color: rgba(251, 113, 133, 0.45);
  box-shadow: 0 0 0 1px rgba(251, 113, 133, 0.15), inset 0 1px 0 rgba(255,255,255,.04);
}

/* Mål! – röd blink efter soft-refresh när score ökat */
.match-row.lm-goal-flash {
  border-color: rgba(248, 113, 113, 0.9) !important;
  background: linear-gradient(90deg, rgba(127, 29, 29, 0.55), rgba(15, 23, 42, 0.95) 55%) !important;
  box-shadow:
    0 0 0 1px rgba(248, 113, 113, 0.55),
    0 0 20px rgba(239, 68, 68, 0.35);
  animation: lmGoalFlash 0.9s ease-in-out 5;
  z-index: 2;
}
.match-row.lm-goal-flash .lm-score,
.lm-score.lm-score-goal {
  border-color: rgba(252, 165, 165, 0.85) !important;
  background: rgba(185, 28, 28, 0.55) !important;
  color: #fecaca;
  animation: lmScorePop 0.85s ease 3;
}
.lm-goal-banner {
  display: inline-flex;
  align-items: center;
  color: #fca5a5;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 10px;
}
#liveGrid.lm-soft-refresh {
  opacity: 0.97;
  transition: opacity 0.2s ease;
}
@keyframes lmGoalFlash {
  0%, 100% {
    background: linear-gradient(90deg, rgba(127, 29, 29, 0.4), rgba(15, 23, 42, 0.95) 55%);
    box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.4), 0 0 10px rgba(239, 68, 68, 0.2);
  }
  50% {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.75), rgba(15, 23, 42, 0.95) 50%);
    box-shadow: 0 0 0 2px rgba(254, 202, 202, 0.75), 0 0 24px rgba(248, 113, 113, 0.55);
  }
}
@keyframes lmScorePop {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.1); }
}

.lm-meta {
  margin-top: 4px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--lm-dim);
}
.lm-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
}
.lm-pill-live {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.4);
}
.lm-pill-ft {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.3);
}
.lm-pred {
  margin-top: 3px;
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: rgba(110, 231, 183, 0.9);
  text-align: center;
}
.lm-value {
  display: inline-block;
  margin-left: 6px;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  vertical-align: middle;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f87171;
  animation: lm-pulse 1.6s infinite;
}
@keyframes lm-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.lm-empty, .lm-loading, .lm-error {
  text-align: center;
  padding: 40px 16px;
  border-radius: 16px;
  border: 1px dashed var(--lm-border);
  background: #0b1220;
  color: var(--lm-muted);
  font-size: 14px;
}
.lm-loading { color: var(--lm-green); }
.lm-error { color: var(--lm-red); }

/* Modal polish (unique lm* ids – do not clash with header ticker) */
#lmMatchModal {
  backdrop-filter: blur(6px);
}
#lmMatchModal.lm-open {
  display: flex !important;
}
#lmMatchModalPanel {
  border: 1px solid #1e293b;
  box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.modal-scroll {
  scrollbar-width: thin;
  scrollbar-color: #10b981 #1e2937;
}
.modal-scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.modal-scroll::-webkit-scrollbar-thumb {
  background: #10b981;
  border-radius: 3px;
}

@media (max-width: 640px) {
  .match-row {
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: center;
  }
  .lm-team, .lm-team.right {
    justify-content: center;
    text-align: center;
  }
  .lm-team.right { flex-direction: row-reverse; }
  .lm-center { order: -1; }
  .lm-team-name { white-space: normal; }
  #lmMatchModalPanel {
    max-height: 96vh !important;
    margin: 0;
  }
}
