/* ===========================================================
   JPMS Modal (Blue, modern, mobile-safe)
   =========================================================== */

:root {
  --jpms-blue: #003366;
  --jpms-blue-2: #0b4a86;
  --jpms-border: rgba(0,0,0,0.10);
  --jpms-text: #0f172a;
  --jpms-muted: rgba(15, 23, 42, 0.70);
  --jpms-bg: #ffffff;
  --jpms-soft: rgba(0,0,0,0.03);
  --jpms-shadow: 0 18px 70px rgba(0,0,0,0.35);
}

/* hide/show */
.jpms-modal[aria-hidden="true"] { display: none; }
.jpms-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  font-family: Arial, sans-serif;
}

/* Backdrop with subtle blur */
.jpms-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(3px);
}

/* Panel */
.jpms-modal__panel {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  background: var(--jpms-bg);
  border-radius: 18px;
  box-shadow: var(--jpms-shadow);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
}

/* Top accent */
.jpms-modal__panel::before {
  content: "";
  display: block;
  height: 6px;
  background: linear-gradient(90deg, var(--jpms-blue), var(--jpms-blue-2));
}

/* Close button */
.jpms-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--jpms-border);
  background: rgba(0,0,0,0.03);
  cursor: pointer;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  color: var(--jpms-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
  z-index: 10;
}

.jpms-modal__close:hover {
  background: rgba(0,0,0,0.06);
  transform: scale(1.03);
}

/* Scroll container */
.jpms-modal__scroll {
  max-height: calc(100vh - 24px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 18px 16px;
}

/* Mobile handle bar (only shown on mobile in media query) */
.jpms-modal__bar { display: none; }

/* Header */
.jpms-modal__head {
  padding: 6px 60px 10px 4px; /* reserve space for close button */
  position: relative;
}


.jpms-modal__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--jpms-blue);
  color: #fff;
  letter-spacing: 0.4px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.jpms-modal__title {
  margin-top: 12px;
  font-weight: 900;
  font-size: 1.35rem;
  color: var(--jpms-text);
}

.jpms-modal__chips {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Chips */
.jpms-chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--jpms-border);
  background: rgba(0, 51, 102, 0.06);
  color: rgba(0, 51, 102, 0.95);
  font-weight: 800;
  font-size: 0.85rem;
}

/* Content layout */
.jpms-modal__body { margin-top: 10px; }

.jpms-modal__grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

/* Card blocks */
.jpms-modal__card {
  border: 1px solid var(--jpms-border);
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.015));
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.06);
}

.jpms-modal__cardtitle {
  font-weight: 900;
  font-size: 0.95rem;
  color: var(--jpms-blue);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.jpms-modal__cardtitle::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 4px;
  background: var(--jpms-blue);
  opacity: 0.85;
}

.jpms-modal__cardbody {
  font-size: 0.95rem;
  color: var(--jpms-text);
}

/* Score line */
.jpms-scoreline {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.jpms-scoreteam {
  font-weight: 900;
  color: var(--jpms-text);
  font-size: 0.95rem;
}

.jpms-scoreteam--right { text-align: right; }

.jpms-score {
  font-weight: 900;
  font-size: 1.18rem;
  padding: 8px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
  color: var(--jpms-blue);
  white-space: nowrap;
}

/* Lists (scorers) */
.jpms-modal__list {
  margin: 0;
  padding-left: 18px;
}
.jpms-modal__list li {
  margin: 6px 0;
  color: var(--jpms-text);
}

/* Links (streams) */
.jpms-modal__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.jpms-modal__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 51, 102, 0.22);
  background: linear-gradient(180deg, rgba(0, 51, 102, 0.10), rgba(0, 51, 102, 0.06));
  color: rgba(0, 51, 102, 0.95);
  text-decoration: none;
  font-weight: 900;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.jpms-modal__link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(0,0,0,0.10);
}

.jpms-subtle {
  opacity: 0.78;
  margin-top: 10px;
  color: var(--jpms-muted);
}

.jpms-big {
  font-weight: 900;
  font-size: 1.25rem;
  color: var(--jpms-blue);
}

/* Lock page scroll while open */
.jpms-modal-open { overflow: hidden; }

/* -----------------------------------------------------------
   Mobile: bottom-sheet style, ALWAYS fits, internal scrolling
   ----------------------------------------------------------- */
@media (max-width: 768px) {
  .jpms-modal__panel {
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    transform: none;
    width: 100vw;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
  }

  .jpms-modal__scroll {
    max-height: 92vh;
    padding: 14px 14px 16px 14px;
  }

  .jpms-modal__bar {
    display: block;
    width: 46px;
    height: 5px;
    border-radius: 999px;
    background: rgba(0,0,0,0.18);
    margin: 10px auto 6px auto;
  }

  .jpms-modal__grid2 {
    grid-template-columns: 1fr;
  }

  .jpms-modal__title {
    font-size: 1.15rem;
  }

  .jpms-score {
    font-size: 1.05rem;
    padding: 7px 10px;
  }
}
/* Header layout */
.jpms-modal__head-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
  margin-right: 10px; /* small breathing space */
}


/* Top stream button */
.jpms-modal-streamtop{
  width:42px;
  height:42px;
  border-radius:999px;
  background:#000;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(0,0,0,0.2);
  transition:transform 0.15s ease, box-shadow 0.15s ease;
}

.jpms-modal-streamtop:hover{
  transform:scale(1.05);
  box-shadow:0 8px 24px rgba(0,0,0,0.25);
}

.jpms-modal-streamimg{
  width:24px;
  height:24px;
  object-fit:contain;
}

.jpms-modal__head-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
}

.jpms-modal-streamtop{
  width:42px;
  height:42px;
  border-radius:999px;
  background:#000;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(0,0,0,0.22);
  flex: 0 0 auto;
}

.jpms-modal-streamimg{
  width:24px;
  height:24px;
  object-fit:contain;
  display:block;
}

/* LIVE chip styling in modal */
.jpms-chip{
  position: relative;
}

.jpms-chip:where(:first-child){
  /* normal first chip, no change */
}

/* Make a chip that says LIVE look special */
.jpms-chip {
  /* keep your existing chip styles */
}

.jpms-chip:has-text {
  /* (ignore; not supported) */
}

/* Simple, robust: style via attribute is not possible here,
   so we use the exact label "LIVE" by adding a class via JS (optional).
   If you want NO JS class: skip this block. */
.jpms-chip.jpms-chip-live{
  background:#e11d48 !important;
  border-color: rgba(225,29,72,0.35) !important;
  color:#fff !important;
  box-shadow:0 10px 26px rgba(225,29,72,0.25);
}
