/* [ggultv_sports_table] 통합 경기 테이블 — 기존 위젯과 같은 화이트 카드 디자인, 행높이 컴팩트 */
.ggultv-spt {
  --spt-bg: #ffffff;
  --spt-border: #e6e8eb;
  --spt-text: #1a1d21;
  --spt-muted: #6b7280;
  --spt-live: #e11d48;
  --spt-accent: #1d4ed8;
  --spt-soft: #f4f6f9;
  max-width: var(--gb-container-width, 860px);
  margin: 0 auto;
  background: var(--spt-bg);
  border: 1px solid var(--spt-border);
  border-radius: 12px;
  overflow: hidden;
  color: var(--spt-text);
  font-size: 13px;
  line-height: 1.35;
}
/* SSR 잔상 숨김: JS 첫 렌더(또는 4초 안전장치)에서 해제 */
.ggultv-spt.is-ssr .spt__body { visibility: hidden; }

.spt__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px;
  background: linear-gradient(90deg, #0f172a, #1e293b);
  color: #fff;
}
.spt__clock { font-weight: 700; font-size: 14px; letter-spacing: .3px; }
.spt__updated { font-size: 11px; color: #cbd5e1; }

/* 필터 탭 */
.spt__tabs {
  display: flex; gap: 6px; padding: 8px 10px;
  background: var(--spt-soft); border-bottom: 1px solid var(--spt-border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.spt__tab {
  appearance: none; border: 1px solid var(--spt-border); border-radius: 999px;
  background: var(--spt-bg); color: var(--spt-muted);
  font-size: 12px; font-weight: 600; padding: 4px 11px;
  cursor: pointer; white-space: nowrap; transition: all .15s;
}
.spt__tab b { font-weight: 700; margin-left: 2px; color: inherit; }
.spt__tab:hover { color: var(--spt-text); }
.spt__tab.is-on { background: var(--spt-accent); border-color: var(--spt-accent); color: #fff; }

/* 그룹 헤더(클릭 시 접기) */
.spt__ghead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px; background: var(--spt-soft);
  border-top: 1px solid var(--spt-border); border-bottom: 1px solid var(--spt-border);
  font-size: 12px; font-weight: 700; color: #374151;
  cursor: pointer; user-select: none;
}
.spt__ghead:first-child { border-top: 0; }
.spt__ghead .spt__gcnt {
  font-weight: 600; color: var(--spt-muted); font-size: 11px;
  background: var(--spt-bg); border: 1px solid var(--spt-border);
  border-radius: 999px; padding: 0 8px; line-height: 18px;
}
.spt__ghead.is-col { opacity: .65; }
.spt__ghead.is-col::after { content: ' ▸'; color: var(--spt-muted); }

/* 행: 6열 그리드 — 리그 / 시간 / 홈 / 상태 / 원정 / 액션
   r1/r2 래퍼는 데스크톱에서 display:contents 로 무시되고 셀들이 그리드에 직접 참여 */
.spt__row {
  display: grid;
  grid-template-columns: minmax(84px, 15%) 44px 1fr 78px 1fr minmax(46px, max-content);
  align-items: center; gap: 4px;
  padding: 5px 10px;
  border-bottom: 1px solid #f0f2f4;
  min-height: 46px; /* 기본 38px 의 1.2배 */
}
.spt__r1, .spt__r2 { display: contents; }
/* 래퍼로 DOM 순서가 lg,tm,act,home,st,away 가 되므로 열 위치를 명시 고정 */
.spt__lg      { grid-row: 1; grid-column: 1; }
.spt__tm      { grid-row: 1; grid-column: 2; }
.spt__team--h { grid-row: 1; grid-column: 3; }
.spt__st      { grid-row: 1; grid-column: 4; }
.spt__team--a { grid-row: 1; grid-column: 5; }
.spt__act     { grid-row: 1; grid-column: 6; }
.spt__row:last-child { border-bottom: 0; }
/* 진행중 행 강조: 80px 고정 높이 */
.spt__row.is-live { background: #fff7f8; min-height: 80px; padding-top: 7px; padding-bottom: 7px; }

.spt__lg { display: flex; align-items: center; gap: 4px; min-width: 0; }
.spt__ico { font-size: 13px; flex: 0 0 auto; }
.spt__lgn {
  font-size: 11px; color: var(--spt-muted); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.spt__tm { font-size: 12px; font-weight: 700; color: #374151; text-align: center; }

.spt__team { display: flex; align-items: center; gap: 6px; min-width: 0; }
.spt__team--h { justify-content: flex-end; text-align: right; }
.spt__team--a { justify-content: flex-start; }
.spt__tn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.spt__logo { width: 22px; height: 22px; object-fit: contain; flex: 0 0 auto; }
.spt__noimg { width: 22px; height: 22px; flex: 0 0 auto; }
.spt__sc { font-size: 14px; font-weight: 800; min-width: 16px; text-align: center; color: var(--spt-text); }
.spt__row.is-live .spt__sc { color: var(--spt-text); } /* 진행중 스코어: 블랙 */

.spt__st { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.spt__badge {
  font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px;
  white-space: nowrap;
}
.spt__badge.is-live { background: var(--spt-accent); color: #fff; } /* 진행중 배지: 블루 */
.spt__badge.is-ready { background: var(--spt-soft); color: var(--spt-muted); border: 1px solid var(--spt-border); }
.spt__badge.is-final { background: #e5e7eb; color: #4b5563; }
.spt__badge.is-off { background: #fef3c7; color: #92400e; }
.spt__sub { font-size: 10px; color: var(--spt-live); font-weight: 600; white-space: nowrap; }

.spt__act { text-align: center; }
.spt__bl { display: none; } /* 긴 라벨(경기분석/경기정보)은 모바일 전용 */
.spt__tnm { display: none; } /* 팀명 11자 컷 라벨도 모바일 전용 */
.spt__btn {
  display: inline-block; appearance: none; cursor: pointer;
  font-size: 11px; font-weight: 700; border-radius: 6px; padding: 3px 8px;
  text-decoration: none; line-height: 1.4; border: 1px solid var(--spt-border);
  background: var(--spt-bg); color: var(--spt-muted); transition: all .15s;
}
a.spt__btn--art { border-color: var(--spt-accent); color: var(--spt-accent); }
a.spt__btn--art:hover { background: var(--spt-accent); color: #fff; }
.spt__btn--info:hover { color: var(--spt-text); border-color: var(--spt-muted); }

.spt__msg { padding: 22px 14px; text-align: center; color: var(--spt-muted); font-size: 13px; }

/* --- 모바일: 2행 구조 ---
   1행(가운데 정렬): 종목아이콘+리그명 · 시작시간 · 경기분석/경기정보 텍스트 링크
   2행: 홈팀명…로고+스코어 | 상태배지(요약 생략) | 스코어+로고…원정팀명 — 좌우 100% 활용 */
@media (max-width: 640px) {
  /* 행높이는 상하 패딩 30px + 콘텐츠로 결정.
     align-items:stretch 필수: 데스크톱 공통 align-items:center 가 남으면
     r1/r2 가 콘텐츠 폭으로 줄어 가운데로 몰림(좌우 공간 낭비) */
  .spt__row { display: flex; flex-direction: column; justify-content: center; align-items: stretch; min-height: 0; padding: 30px 10px; }
  /* 진행중 경기만 상하 패딩 50px */
  .spt__row.is-live { padding-top: 50px; padding-bottom: 50px; }
  .spt__r1 {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-bottom: 10px; min-width: 0; /* 1행-2행 간격 10px */
  }
  .spt__r1 .spt__tm { font-size: 11px; color: var(--spt-muted); font-weight: 600; }
  /* 버튼 → 일반 텍스트 링크(경기분석/경기정보) */
  .spt__bs { display: none; }
  .spt__bl { display: inline; }
  .spt__r1 .spt__btn { border: 0; background: none; padding: 0; font-size: 12px; border-radius: 0; }
  .spt__r1 a.spt__btn--art { color: var(--spt-accent); text-decoration: underline; text-underline-offset: 2px; }
  .spt__r1 a.spt__btn--art:hover { background: none; color: var(--spt-accent); }
  /* 진행중 행의 경기분석 링크는 시간과 동일한 색 */
  .spt__row.is-live .spt__r1 a.spt__btn--art { color: var(--spt-muted); }
  .spt__r1 .spt__btn--info { color: var(--spt-muted); text-decoration: underline; text-underline-offset: 2px; }
  /* 2행: 1열(홈) 오른쪽 정렬 · 3열(원정) 왼쪽 정렬 — 배지 중심 배치 */
  .spt__r2 { display: flex; align-items: center; gap: 6px; min-width: 0; }
  .spt__team--h { flex: 1 1 0; justify-content: flex-end; min-width: 0; }
  .spt__st { flex: 0 0 auto; flex-direction: row; }
  .spt__team--a { flex: 1 1 0; justify-content: flex-start; min-width: 0; }
  .spt__sub { display: none; } /* 실시간 요약은 모바일에서 생략 */
  /* 12자 이상 팀명: 모바일은 11자 컷 라벨(spt__tnm)로 교체, 말줄임 기호 없음 */
  .spt__tnf { display: none; }
  .spt__tnm { display: inline; }
  .spt__tn { font-size: 12px; text-overflow: clip; }
  .spt__logo, .spt__noimg { width: 18px; height: 18px; }
  .spt__lgn { max-width: 44vw; }
}

/* --- 양팀정보 모달 --- */
.spt-modal {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(15, 23, 42, .62);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.spt-modal__box {
  position: relative; background: #fff; color: #1a1d21;
  border-radius: 14px; max-width: 520px; width: 100%;
  max-height: 86vh; overflow: auto; padding: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.spt-modal__x {
  position: absolute; top: 8px; right: 10px; appearance: none; border: 0;
  background: transparent; font-size: 22px; line-height: 1; color: #9ca3af; cursor: pointer;
}
.spt-modal__x:hover { color: #1a1d21; }
.spt-mi__head { text-align: center; font-size: 12px; font-weight: 700; color: #6b7280; margin-bottom: 12px; }
.spt-mi__grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: start; }
.spt-mi__vs { align-self: center; font-weight: 800; color: #9ca3af; font-size: 13px; }
.spt-mi__team { text-align: center; }
.spt-mi__team img { display: block; margin: 0 auto 4px; object-fit: contain; }
.spt-mi__name { font-weight: 800; font-size: 14px; margin-bottom: 8px; }
.spt-mi__kv {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 12px; padding: 3px 6px; border-bottom: 1px dashed #eef0f3;
}
.spt-mi__kv span { color: #9ca3af; font-weight: 600; flex: 0 0 auto; }
.spt-mi__kv b { font-weight: 700; text-align: right; }
.spt-mi__dots { display: inline-flex; gap: 3px; }
.spt-mi__dot {
  font-style: normal; font-size: 10px; font-weight: 700; color: #fff;
  width: 17px; height: 17px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.spt-mi__dot.is-w { background: #16a34a; }
.spt-mi__dot.is-d { background: #9ca3af; }
.spt-mi__dot.is-l { background: #dc2626; }
.spt-mi__note { margin-top: 12px; font-size: 11px; color: #9ca3af; text-align: center; }
