/* ─── Korea Baseball Hub — base styles ─────────────────────────────── */

@font-face {
  font-family: "Pretendard Variable";
  font-display: swap;
  src: url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/woff2/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 45 920;
}

:root {
  --bg: #0B0E14;
  --bg-elev: #11151D;
  --card: #161B22;
  --card-2: #1F2630;
  --hairline: rgba(255, 255, 255, 0.08);
  --hairline-strong: rgba(255, 255, 255, 0.14);

  --text: #E6EDF3;
  --text-2: #8B949E;
  --text-3: #6E7681;

  --mlb: #FF4B4B;
  --mlb-soft: rgba(255, 75, 75, 0.14);
  --kbo: #4B9CFF;
  --kbo-soft: rgba(75, 156, 255, 0.14);
  --pos: #3FB950;
  --warn: #F0B229;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 28px;

  --max: 1280px;
  --pad: 28px;

  --num: "Inter", ui-sans-serif, system-ui, sans-serif;
  --kr:  "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic",
         ui-sans-serif, system-ui, sans-serif;

  font-feature-settings: "ss01", "cv11";
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--kr);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.01em;
  padding-bottom: env(safe-area-inset-bottom);
}

.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* ─── Layout ────────────────────────────────────────────────────────── */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.section { padding: 56px 0; }
.section-tight { padding: 32px 0; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 22px; gap: 16px;
}
.section-head h2 {
  font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -0.02em;
}
.section-head .more {
  color: var(--text-2); font-size: 13px; text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.section-head .more:hover { color: var(--text); }
.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-3);
}

/* ─── Header ────────────────────────────────────────────────────────── */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 14, 20, 0.78);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--hairline);
}
.hdr-inner {
  display: flex; align-items: center; gap: 24px;
  height: 60px;
  max-width: var(--max); margin: 0 auto; padding: 0 var(--pad);
}
.logo {
  display: flex; align-items: center; gap: 12px;
  font-weight: 800; letter-spacing: -0.01em; font-size: 22px;
  color: var(--text); text-decoration: none;
}
.logo-mark {
  width: 32px; height: 32px;
  background: url("images/brand/dualbat-mark.png") center/contain no-repeat;
  filter: drop-shadow(0 4px 10px rgba(75,156,255,0.35));
}
.logo small {
  font-family: var(--num); font-weight: 600; font-size: 11px; letter-spacing: 0.22em;
  color: var(--text-3); text-transform: uppercase;
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  padding: 8px 12px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: var(--text-2);
  text-decoration: none; transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav a.active { color: var(--text); }
.nav a.active::after {
  content: ""; display: block; height: 2px; margin-top: 6px;
  background: var(--mlb); border-radius: 2px;
}
.hdr-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  background: transparent; border: 1px solid transparent;
  color: var(--text-2); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: rgba(255,255,255,0.05); color: var(--text); }
.search-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px 7px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--hairline);
  color: var(--text-3); font-size: 13px; min-width: 220px; cursor: text;
}
.search-pill:hover { background: rgba(255,255,255,0.06); border-color: var(--hairline-strong); }
.kbd {
  margin-left: auto; font-family: var(--num); font-size: 10.5px;
  background: rgba(255,255,255,0.06); padding: 2px 6px; border-radius: 5px;
  color: var(--text-3); border: 1px solid var(--hairline);
}

/* ─── Cards ─────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  padding: 22px;
}
.card-2 { background: var(--card-2); }

/* ─── Hero / live matchup ──────────────────────────────────────────── */
.hero {
  position: relative;
  border-radius: var(--r-2xl);
  border: 1px solid var(--hairline);
  background:
    radial-gradient(1100px 360px at 110% -20%, rgba(255,75,75,0.18), transparent 60%),
    radial-gradient(700px 260px at -10% 110%, rgba(75,156,255,0.16), transparent 55%),
    linear-gradient(180deg, #131822 0%, #0F141C 100%);
  overflow: hidden;
}
.hero::before {
  /* faint diamond watermark */
  content: ""; position: absolute; right: -80px; top: -80px;
  width: 480px; height: 480px;
  background: conic-gradient(from 45deg, transparent 0deg 80deg, rgba(255,255,255,0.025) 80deg 100deg, transparent 100deg);
  transform: rotate(45deg); pointer-events: none;
}

.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--mlb);
  box-shadow: 0 0 0 0 rgba(255,75,75,0.6);
  animation: pulse 1.6s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,75,75,0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(255,75,75,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,75,75,0); }
}

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em;
  padding: 4px 9px; border-radius: 999px;
}
.tag-live { background: var(--mlb-soft); color: var(--mlb); }
.tag-mlb  { background: var(--mlb-soft); color: var(--mlb); }
.tag-kbo  { background: var(--kbo-soft); color: var(--kbo); }
.tag-mut  { background: rgba(255,255,255,0.06); color: var(--text-2); }
.tag-pos  { background: rgba(63,185,80,0.14); color: var(--pos); }

/* team mark — circular initial chip (placeholder logo) */
.team {
  display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
}
.team-mark {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--num); font-weight: 800; font-size: 18px;
  color: #fff; letter-spacing: -0.04em;
  border: 1.5px solid rgba(255,255,255,0.12);
}
.team-mark.lg { width: 68px; height: 68px; font-size: 22px; }
.team-mark.sm { width: 36px; height: 36px; font-size: 13px; border-width: 1px; }

/* ─── Buttons ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 12px;
  font-family: var(--kr); font-weight: 600; font-size: 14px;
  border: 1px solid transparent; cursor: pointer; transition: all .15s;
  text-decoration: none;
}
.btn-primary {
  background: var(--mlb); color: #fff;
  box-shadow: 0 6px 18px -8px rgba(255,75,75,0.6);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost {
  background: rgba(255,255,255,0.04); color: var(--text);
  border-color: var(--hairline);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: var(--hairline-strong); }

/* ─── Sparkline / bars ──────────────────────────────────────────────── */
.spark { display: block; width: 100%; height: 36px; }
.bars  { display: flex; align-items: flex-end; gap: 3px; height: 44px; }
.bars i {
  flex: 1; min-width: 4px; border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--kbo), rgba(75,156,255,0.4));
  display: block;
}
.bars.red i { background: linear-gradient(180deg, var(--mlb), rgba(255,75,75,0.4)); }

/* ─── Carousel ──────────────────────────────────────────────────────── */
.carousel {
  display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.player-chip {
  flex: 0 0 132px; scroll-snap-align: start;
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 16px 12px 14px; text-align: center; cursor: pointer;
  transition: border-color .15s, transform .15s, background .15s;
}
.player-chip:hover {
  border-color: var(--hairline-strong); transform: translateY(-2px);
  background: var(--card-2);
}
.player-avatar {
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 10px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--num); font-weight: 700; font-size: 22px; color: #fff;
  letter-spacing: -0.03em;
  position: relative;
}
.player-avatar::before {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--mlb), var(--kbo), var(--mlb));
  z-index: -1; opacity: 0.7;
}
.player-chip .name { font-size: 14px; font-weight: 600; margin-top: 2px; }
.player-chip .team-line { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }

/* ─── Leaderboard table ─────────────────────────────────────────────── */
.tabs {
  display: inline-flex; padding: 4px; background: var(--card);
  border: 1px solid var(--hairline); border-radius: 12px; gap: 2px;
}
.tabs button {
  padding: 8px 14px; border-radius: 9px; border: 0; background: transparent;
  color: var(--text-2); font: 600 13px var(--kr); cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.tabs button.on { background: rgba(255,255,255,0.06); color: var(--text); }
.tabs button .league-dot {
  width: 6px; height: 6px; border-radius: 50%;
}

.lb {
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--r-xl); overflow: hidden;
}
.lb table { width: 100%; border-collapse: collapse; }
.lb th, .lb td {
  text-align: left; padding: 12px 16px; font-size: 13.5px;
  border-bottom: 1px solid var(--hairline);
}
.lb th {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-3); background: rgba(255,255,255,0.02);
}
.lb tr:last-child td { border-bottom: 0; }
.lb td.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.lb .rank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 6px;
  background: rgba(255,255,255,0.04); color: var(--text-2);
  font-family: var(--num); font-weight: 600; font-size: 12px;
}
.lb tr:nth-child(1) .rank { background: rgba(240,178,41,0.16); color: var(--warn); }
.lb tr:nth-child(2) .rank { background: rgba(139,148,158,0.18); color: #c9d1d9; }
.lb tr:nth-child(3) .rank { background: rgba(205,127,50,0.18); color: #d2986b; }

.lb .player-cell { display: flex; align-items: center; gap: 10px; }
.lb .player-cell .name { font-weight: 600; }
.lb .player-cell .sub  { font-size: 11.5px; color: var(--text-3); }

.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.bar-cell .track {
  flex: 1; height: 4px; background: rgba(255,255,255,0.06); border-radius: 2px;
  overflow: hidden;
}
.bar-cell .fill { height: 100%; background: var(--kbo); border-radius: 2px; }
.bar-cell.red .fill { background: var(--mlb); }

/* ─── Guide boxes ───────────────────────────────────────────────────── */
.guide-box {
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: var(--r-xl); padding: 22px;
  position: relative; overflow: hidden;
  transition: border-color .15s, transform .15s;
  cursor: pointer;
}
.guide-box:hover { border-color: var(--hairline-strong); transform: translateY(-2px); }
.guide-box .num-badge {
  font-family: var(--num); font-weight: 700; font-size: 28px;
  color: rgba(255,255,255,0.08); letter-spacing: -0.04em;
  position: absolute; right: 22px; top: 18px;
}
.guide-box h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.guide-box p  { margin: 8px 0 0; color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.guide-box .read {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 14px;
  color: var(--mlb); font-size: 13px; font-weight: 600;
}

/* ─── Notify CTA ────────────────────────────────────────────────────── */
.cta {
  background:
    radial-gradient(600px 200px at 90% 0%, rgba(255,75,75,0.16), transparent 60%),
    radial-gradient(600px 200px at 10% 100%, rgba(75,156,255,0.14), transparent 60%),
    linear-gradient(180deg, #141923 0%, #0F141C 100%);
  border: 1px solid var(--hairline);
  border-radius: var(--r-2xl);
  padding: 40px 36px;
}
.cta h2 { margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -0.025em; }
.cta p  { margin: 0; color: var(--text-2); font-size: 14.5px; }
.cta-form {
  display: flex; gap: 8px; margin-top: 22px;
  background: var(--card); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 6px;
}
.cta-form input {
  flex: 1; background: transparent; border: 0; color: var(--text);
  font: 500 15px var(--kr); padding: 10px 12px; outline: none;
}
.cta-form input::placeholder { color: var(--text-3); }
.cta-form .btn { padding: 10px 18px; }

/* ─── Footer ────────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--hairline);
  padding: 40px 0 64px;
  color: var(--text-3); font-size: 13px;
  margin-top: 32px;
}
footer .grid {
  display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px;
}
footer h4 {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-2); margin: 0 0 12px;
}
footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
footer a { color: var(--text-3); text-decoration: none; }
footer a:hover { color: var(--text); }
.sources {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.source-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--hairline);
  font-family: var(--num); font-size: 11.5px; color: var(--text-2);
}

/* ─── Mobile bottom tab bar ─────────────────────────────────────────── */
.tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(11,14,20,0.92);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-top: 1px solid var(--hairline);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tabbar-inner {
  display: grid; grid-template-columns: repeat(5, 1fr); max-width: 480px; margin: 0 auto;
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; color: var(--text-3); text-decoration: none;
  font-size: 10.5px; font-weight: 500;
}
.tabbar a.on { color: var(--text); }
.tabbar a.on .tab-icon { color: var(--mlb); }
.tab-icon { width: 22px; height: 22px; }

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .grid-3 { grid-template-columns: 1fr 1fr !important; }
  footer .grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  :root { --pad: 16px; }
  .section { padding: 36px 0; }
  .nav, .search-pill, .hdr .desktop-only { display: none !important; }
  .grid-3 { grid-template-columns: 1fr !important; }
  .grid-hero { grid-template-columns: 1fr !important; }
  .hero-stats { grid-template-columns: 1fr 1fr !important; }
  .section-head h2 { font-size: 18px; }
  .cta { padding: 28px 22px; }
  .cta h2 { font-size: 20px; }
  .cta-form { flex-direction: column; }
  .cta-form .btn { width: 100%; }
  footer .grid { grid-template-columns: 1fr; gap: 24px; }
  .tabbar { display: block; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .hero { padding: 22px !important; }
  .hero-score { font-size: 36px !important; }
}

/* ─── Tweaks panel readability on dark bg ──────────────────────────── */
.twk-panel { color-scheme: light; }
