/* ================================================================
   PSBS style.css — 사이트 모양
   색은 맨 위 :root 에 모아뒀어요. 여기만 바꾸면 사이트 전체 색이 바뀌어요.
   "모바일 퍼스트": 폰 화면을 기본으로 만들고, 넓은 화면에선 가운데 정렬만 해요.
   ================================================================ */

:root {
  --bg: #0B0F14;          /* 배경: 밤 체육관 */
  --surface: #141A21;     /* 카드 */
  --surface-2: #1B232C;   /* 카드 안 강조 */
  --line: #232C37;        /* 구분선 */
  --text: #ECEFF3;
  --muted: #8794A2;
  --orange: #FF7A1A;      /* 농구공 주황 (포인트 색) */
  --gold: #F5C04E;        /* 우승 */
  --win: #2FBF71;
  --loss: #E5484D;
  --font-score: "Black Han Sans", "Noto Sans KR", sans-serif;
  --font-body: "Noto Sans KR", -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --tabbar-h: 62px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0 auto;
  max-width: 520px;       /* 컴퓨터에서 봐도 폰처럼 가운데에 */
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  /* 하단 탭에 내용이 가려지지 않게 + 아이폰 홈 바 공간 */
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
h2, h3 { margin: 0; font-weight: 700; }
.muted { color: var(--muted); }
small { font-size: 12px; }

/* ---------- 상단 바 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 14px) 16px 12px;
  background: rgba(11, 15, 20, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 9px; }
.logo {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--orange);
  display: grid; place-items: center;
}
.logo svg { width: 24px; height: 24px; fill: none; stroke: #1A0E05; stroke-width: 1.6; }
.brand-name { font-family: var(--font-score); font-size: 26px; letter-spacing: 1.5px; line-height: 1; }
.topbar-season { font-size: 12px; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.info-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--muted); }
.info-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.info-btn.on { color: var(--orange); background: var(--surface); }

/* ---------- ⓘ 사이트 정보 화면 ---------- */
.info-hero { text-align: center; padding: 24px 16px 18px; }
.info-hero h2 { font-family: var(--font-score); font-weight: 400; font-size: 30px; letter-spacing: 2px; margin-top: 10px; }
.info-hero p { margin: 2px 0 0; font-size: 13px; }
.logo.big { width: 64px; height: 64px; margin: 0 auto; }
.logo.big svg { width: 48px; height: 48px; }
.insta { display: flex; align-items: center; gap: 12px; padding: 4px 14px 16px; }
.insta-icon {
  display: grid; place-items: center; flex: none;
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(45deg, #F9A23A, #E1306C, #833AB4);
}
.insta-icon svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; }
.insta b { display: block; font-size: 16px; }
.insta small { color: var(--muted); }
.insta .arrow { margin-left: auto; font-size: 26px; color: var(--muted); }
.rule-list { margin: 0; padding: 0 16px 16px 34px; font-size: 14px; }
.rule-list li { padding: 5px 0; line-height: 1.5; }
.rule-list li::marker { color: var(--orange); font-family: var(--font-score); }
.info-row { display: flex; justify-content: space-between; padding: 14px; font-size: 14px; }

/* ---------- 알림 띠 ---------- */
.banner { margin: 0 12px 8px; padding: 9px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; }
.banner.test { background: #2A2412; color: #F3D98B; }
.banner.warn { background: #2D1517; color: #F5B5B7; }
.banner.notice {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(120deg, #FF7A1A, #E5484D);
  color: #fff; font-size: 15px; font-weight: 700; line-height: 1.4;
}
.notice-emoji { font-size: 26px; line-height: 1; }

main { padding: 0 12px; }

/* ---------- 시즌 진행 바 ---------- */
.season-bar { padding: 4px 4px 14px; }
.season-row { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; margin-bottom: 7px; }
.season-row b { font-family: var(--font-score); font-weight: 400; font-size: 16px; color: var(--orange); }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--orange); border-radius: 3px; }

/* ---------- 팀 배지 (동그라미) ---------- */
.badge {
  flex: none;
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--team);
  color: #fff;
  font-family: var(--font-score); font-size: 14px;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}
.badge.sm { width: 24px; height: 24px; font-size: 12px; }
.badge.lg { width: 54px; height: 54px; font-size: 24px; }

/* ---------- 큰 카드 (오늘 경기) ---------- */
.hero {
  background: var(--surface);
  border: 1px solid rgba(255, 122, 26, 0.35);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 12px;
  /* 코트 센터 서클 무늬 */
  background-image: radial-gradient(circle at 50% 58%, transparent 52px, rgba(255, 122, 26, 0.07) 53px, rgba(255, 122, 26, 0.07) 54px, transparent 55px);
}
.hero.is-promo { border-color: rgba(155, 123, 234, 0.5); }
.hero-top { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; margin-bottom: 14px; }
.pill { background: var(--orange); color: #1A0E05; font-weight: 700; padding: 3px 9px; border-radius: 7px; font-size: 12px; }
.pill.gold { background: var(--gold); color: #2B1E02; }
.hero-body { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center; }
.hero-team { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.hero-team .badge { margin-bottom: 4px; }
.hero-name { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.hero-team b { font-size: 15px; }
.hero-team small { color: var(--muted); }
.hero-team.lose { opacity: 0.55; }
.hero-center { padding: 0 8px; }
.big-vs { font-family: var(--font-score); font-size: 32px; color: var(--muted); line-height: 1.1; }
.big-score { font-family: var(--font-score); font-size: 42px; line-height: 1.05; display: flex; gap: 6px; justify-content: center; }
.big-score .win { color: var(--orange); }
.big-score .colon { color: #4A5562; }
.center-sub { font-size: 12px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.hero-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); text-align: center; font-size: 12px; color: var(--muted); }
.hero .tags { justify-content: center; }

.hero.champion { border-color: rgba(245, 192, 78, 0.5); background-image: none; }
.champ-body { display: flex; align-items: center; gap: 14px; }
.champ-body b { display: block; font-size: 20px; }
.champ-body small { color: var(--muted); }
.trophy { margin-left: auto; font-size: 38px; }
.promo-result { margin-top: 12px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; font-size: 13px; }

/* ---------- 경기 목록 ---------- */
.section-title { font-size: 14px; color: var(--muted); font-weight: 500; margin: 22px 4px 8px; }
.group { background: var(--surface); border-radius: 14px; margin-bottom: 10px; overflow: hidden; }
.group-head {
  display: flex; justify-content: space-between;
  padding: 10px 14px; font-size: 12.5px; font-weight: 500;
  background: var(--surface-2);
}
.match {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: 4px 8px; padding: 12px 14px;
  border-top: 1px solid var(--line);
}
.group-head + .match, .panel-head + .match, .mini-date + .match { border-top: 0; }
.match.empty { display: block; color: var(--muted); font-size: 13px; text-align: center; }
.side { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.side.away { justify-content: flex-end; text-align: right; }
.side .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side.lose { color: var(--muted); }
.mid { position: relative; display: flex; align-items: center; gap: 4px; font-family: var(--font-score); font-size: 20px; padding: 0 6px; }
.mid .colon { color: #4A5562; }
.mid .win { color: var(--orange); }
.mid .vs { font-size: 14px; color: var(--muted); }
.gg { position: absolute; right: -12px; top: -4px; font-size: 13px; }
.tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 4px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.tag.promo { background: rgba(155, 123, 234, 0.18); color: #C9B8F5; }
.tag.wait { background: rgba(245, 192, 78, 0.15); color: var(--gold); }
.legend { font-size: 12px; color: var(--muted); margin: 4px 4px 0; }

/* ---------- 패널 (순위·팀 탭) ---------- */
.panel { background: var(--surface); border-radius: 14px; margin-bottom: 12px; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 14px 10px; font-size: 12.5px; }
.panel-head h2 { font-size: 16px; }
.pad { padding: 0 14px 14px; margin: 0; font-size: 13.5px; }

/* 순위표 */
.table-wrap { overflow-x: auto; }
.standings { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.standings th { font-size: 11px; font-weight: 500; color: var(--muted); padding: 6px 2px; text-align: center; }
.standings td { padding: 10px 2px; text-align: center; border-top: 1px solid var(--line); }
.standings th:first-child, .standings td:first-child { padding-left: 12px; width: 26px; }
.standings th:last-child, .standings td:last-child { padding-right: 12px; }
.standings .team-cell { text-align: left; }
.team-cell a { display: flex; align-items: center; gap: 8px; }
.team-cell b { display: block; font-size: 14px; font-weight: 500; white-space: nowrap; }
.rank { font-family: var(--font-score); font-size: 15px; color: var(--muted); }
.pts { font-family: var(--font-score); font-size: 17px; color: var(--text); }
.zone-champ td:first-child { box-shadow: inset 3px 0 0 var(--gold); color: var(--gold); }
.zone-promo td:first-child { box-shadow: inset 3px 0 0 var(--orange); color: var(--orange); }
.zone-line td { padding: 0; border-top: 2px dashed var(--orange); position: relative; height: 0; }
.zone-line span {
  position: absolute; right: 12px; top: -9px;
  background: var(--orange); color: #1A0E05;
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 5px;
}
.zone-line + tr td { border-top: 0; }

/* 폼 동그라미 */
.form { display: inline-flex; gap: 3px; margin-top: 3px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.dot.win { background: var(--win); }
.dot.loss { background: var(--loss); }

.legend-row { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 10px 14px; font-size: 11.5px; border-top: 1px solid var(--line); }
.legend-row span { display: inline-flex; align-items: center; gap: 5px; }
.legend-row + .legend-row { border-top: 0; padding-top: 0; }
.bar { display: inline-block; width: 4px; height: 12px; border-radius: 2px; }
.bar.gold { background: var(--gold); }
.bar.orange { background: var(--orange); }

.d2-row { display: flex; align-items: center; gap: 10px; padding: 4px 14px 14px; }
.d2-row b { display: block; font-size: 14px; font-weight: 500; }
.d2-row small { color: var(--muted); }
.panel .promo-result { margin: 0 14px 14px; }

.rules { padding: 14px; }
.rules h3 { font-size: 14px; margin-bottom: 6px; }
.rules p { margin: 0; font-size: 13px; color: var(--muted); }
.rules b { color: var(--text); }

/* ---------- 팀 탭 ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 14px; border-radius: 999px;
  background: var(--surface); font-size: 13.5px; color: var(--muted);
  border: 1px solid var(--line);
}
.chip.on { color: var(--text); border-color: var(--team); background: color-mix(in srgb, var(--team) 22%, var(--surface)); }

.team-head { border-top: 4px solid var(--team); border-radius: 0 0 14px 14px; }
.team-title { display: flex; align-items: center; gap: 14px; padding: 16px 14px 12px; }
.team-title h2 { font-size: 22px; }
.team-title .muted { font-size: 12.5px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 0 14px; }
.stat-grid div { background: var(--surface-2); border-radius: 10px; padding: 10px 6px; text-align: center; }
.stat-grid small { display: block; color: var(--muted); font-size: 11px; }
.stat-grid b { font-family: var(--font-score); font-weight: 400; font-size: 20px; }
.stat-line { display: flex; align-items: center; gap: 12px; padding: 12px 14px 14px; font-size: 12.5px; color: var(--muted); }
.stat-line .form { margin: 0 0 0 auto; }

.h2h { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); font-size: 14px; }
.panel-head + .h2h { border-top: 0; }
.h2h .name { flex: 1; }
.h2h-rec .w { color: var(--win); font-weight: 500; }
.h2h-rec .l { color: var(--loss); font-weight: 500; }
.h2h-pts { width: 52px; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.mini-date { padding: 10px 14px 0; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); }
.panel-head + .mini-date { border-top: 0; padding-top: 0; }

/* ---------- 기록 탭 (곧 추가) ---------- */
.soon { text-align: center; padding: 48px 20px; }
.soon-ball { font-size: 54px; margin-bottom: 8px; }
.soon h2 { font-family: var(--font-score); font-weight: 400; font-size: 24px; }
.soon ul { list-style: none; padding: 0; margin: 18px auto 0; max-width: 260px; text-align: left; }
.soon li { background: var(--surface); border-radius: 10px; padding: 11px 14px; margin-bottom: 8px; font-size: 14px; }
.soon li::before { content: "🔒"; margin-right: 8px; }

.error { padding: 16px; }
.error p { color: var(--muted); font-size: 14px; }
.error code { display: block; background: var(--surface-2); padding: 10px; border-radius: 8px; font-size: 12px; word-break: break-all; }

/* ---------- 하단 탭 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 10;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(16, 21, 28, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 11px; color: var(--muted);
}
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--orange); }
.tabbar a.on span { font-weight: 700; }

.badge.xs { width: 20px; height: 20px; font-size: 10px; }


/* ================================================================
   💻 PC 화면 (폭 1024px 이상) — 초안 C "전광판형"
   폰 화면은 위 규칙 그대로예요. 아래 규칙은 넓은 화면에서만 덮어써요.
   ================================================================ */
.pc-only, .topnav { display: none; }

@media (min-width: 1024px) {
  body { max-width: 1180px; padding-bottom: 48px; }
  main { padding: 0 24px; }
  .banner { margin: 0 24px 12px; font-size: 13.5px; }
  .banner.notice { font-size: 17px; padding: 16px 22px; }
  .tabbar { display: none; }
  .pc-only { display: block; }

  /* 위쪽 메뉴 */
  .topbar { justify-content: flex-start; gap: 28px; padding: 18px 24px 16px; }
  .topnav { display: flex; gap: 6px; }
  .topnav a { padding: 7px 16px; border-radius: 9px; color: var(--muted); font-size: 15px; font-weight: 500; }
  .topnav a:hover { color: var(--text); background: var(--surface); }
  .topnav a.on { color: var(--orange); background: rgba(255, 122, 26, 0.12); font-weight: 700; }
  .topbar-right { margin-left: auto; }
  .topbar-season { font-size: 13px; }

  /* 시즌 진행 바 */
  .season-bar { padding: 4px 4px 16px; }
  .season-row { font-size: 14px; }
  .season-row b { font-size: 20px; }

  /* 🏀 전광판 (오늘 경기 큰 카드) */
  .hero {
    padding: 22px 34px 18px; border-radius: 22px; margin-bottom: 14px;
    background-image: radial-gradient(circle at 50% 56%, transparent 104px, rgba(255, 122, 26, 0.08) 105px, rgba(255, 122, 26, 0.08) 107px, transparent 108px);
  }
  .hero-top { font-size: 14px; margin-bottom: 10px; }
  .pill { font-size: 13px; padding: 4px 11px; }
  .hero-team { flex-direction: row; gap: 18px; }
  .hero-team.home { flex-direction: row-reverse; justify-content: flex-start; text-align: right; }
  .hero-team.home .hero-name { align-items: flex-end; }
  .hero-team.away .hero-name { align-items: flex-start; }
  .hero-team .badge { margin: 0; }
  .hero .badge.lg { width: 86px; height: 86px; font-size: 40px; }
  .hero-team b { font-family: var(--font-score); font-weight: 400; font-size: 30px; line-height: 1.15; }
  .hero-team small { font-size: 14px; }
  .hero-form { margin-top: 2px; }
  .hero-form .dot { width: 10px; height: 10px; }
  .hero-center { padding: 0 40px; }
  .big-vs { font-size: 62px; }
  .big-score { font-size: 80px; gap: 14px; }
  .center-sub { font-size: 14px; }
  .hero-foot { border-top: 0; margin-top: 8px; padding-top: 0; font-size: 13px; }
  .champ-body b { font-size: 28px; }
  .trophy { font-size: 54px; }

  /* 날짜별 경기 카드 줄 */
  .strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 10px; margin-bottom: 16px; }
  .strip-card { background: var(--surface); border: 1px solid transparent; border-radius: 12px; padding: 10px 12px; }
  .strip-card.today { border-color: var(--orange); }
  .strip-date { font-size: 12px; color: var(--muted); }
  .strip-card.today .strip-date { color: var(--orange); font-weight: 700; }
  .strip-match { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-family: var(--font-score); font-size: 18px; }
  .strip-match b { font-weight: 400; }
  .strip-match .win { color: var(--orange); }
  .strip-match .colon { color: #4A5562; }
  .strip-match .vs { font-family: var(--font-body); font-size: 12px; color: var(--muted); }
  .strip-tag { margin-top: 4px; font-size: 11px; color: #C9B8F5; }

  /* 순위표 + 팀 카드 */
  .pc-overview { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; align-items: start; }
  .pc-overview .panel { margin: 0; }
  .team-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .team-card {
    display: flex; align-items: center; gap: 10px; padding: 14px 12px;
    background: var(--surface); border-top: 3px solid var(--team); border-radius: 0 0 12px 12px;
  }
  .team-card:hover { background: var(--surface-2); }
  .tc-name { font-size: 14px; font-weight: 700; }
  .tc-pts { font-family: var(--font-score); font-weight: 400; font-size: 22px; }
  .standings { font-size: 14px; }
  .standings td { padding: 12px 4px; }
  .standings .zone-line td { padding: 0; }

  /* 지난 결과 | 남은 일정 2단 */
  .lists { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .section-title { font-size: 15px; margin-top: 22px; }

  /* 순위 탭: 순위표 | 2부·규칙 */
  .page-table { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: start; }
  .page-table > .panel { margin: 0; }
  .page-table > .standings-panel { grid-row: span 2; }

  /* 팀 탭: 왼쪽 팀·전적 | 오른쪽 다음 경기·최근 경기 */
  .team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; grid-template-areas: "head next" "h2h recent"; }
  .team-grid > .panel { margin: 0; }
  .t-head { grid-area: head; }
  .t-next { grid-area: next; }
  .t-h2h { grid-area: h2h; }
  .t-recent { grid-area: recent; }

  /* 기록·정보 탭은 가운데 좁게 */
  .page-narrow { max-width: 680px; margin: 0 auto; }
}
