:root {
  --bg: #0a0e16;
  --surface: #111827;
  --surface-2: #172033;
  --surface-3: #1e2a40;
  --line: #26324a;
  --line-strong: #34425f;
  --text: #e9edf5;
  --muted: #8b96ad;
  --faint: #5b6680;
  --gold: #c8aa6e;
  --gold-bright: #f0d595;
  --gold-soft: rgba(200, 170, 110, 0.14);
  --danger: #e0626b;
  --danger-soft: rgba(224, 98, 107, 0.12);
  --confirm: #4fb3d9;
  --confirm-soft: rgba(79, 179, 217, 0.14);
  --radius: 10px;
  --gutter: 16px;
  --display: "Oswald", "Noto Sans KR", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image: radial-gradient(1200px 500px at 50% -200px, rgba(200, 170, 110, 0.12), transparent 70%);
  background-attachment: fixed;
}

button { font: inherit; color: inherit; }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 14, 22, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 1680px;
  margin: 0 auto;
  padding: 18px var(--gutter) 10px;
  display: flex;
  gap: 12px 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.brand { display: flex; gap: 12px; align-items: center; }
/* 롤드컵 엠블럼 (금색, brand-logo.svg) */
.brand-logo { flex: none; display: block; width: 45px; height: 46px; filter: drop-shadow(0 2px 8px rgba(200, 170, 110, 0.25)); }
h1 { font-size: 21px; margin: 0; font-weight: 900; letter-spacing: -0.01em; }
.brand p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }

.header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.progress { display: flex; align-items: center; gap: 8px; margin-right: 4px; }
.progress-track { width: 140px; height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
#progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); transition: width 0.3s; }
#progress-count { font-family: var(--display); font-size: 15px; min-width: 52px; }

.btn {
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  padding: 10px 16px;
  border-radius: 9px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.btn:hover { border-color: var(--gold); }
.btn:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.btn.ghost { background: transparent; }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #1a1408; font-weight: 700; }
.btn.primary:hover { background: var(--gold-bright); }
.btn.primary:disabled { opacity: 0.4; cursor: not-allowed; background: var(--gold); }

.tabs { max-width: 1680px; margin: 0 auto; padding: 0 var(--gutter); display: flex; justify-content: center; gap: 8px; }
.tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--gold-bright); border-bottom-color: var(--gold); }

/* ---------- 공통 ---------- */
main { max-width: 1680px; margin: 0 auto; padding: 40px var(--gutter) 80px; }
.stage-intro { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 22px; text-align: center; }
.stage-intro h2 { margin: 0; font-size: 30px; font-weight: 900; }
.stage-intro p { margin: 0; color: var(--muted); font-size: 15px; }
.h-scroll { overflow-x: auto; padding-bottom: 12px; }

.col-title {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.record { font-family: var(--display); font-size: 18px; font-weight: 600; letter-spacing: 0.04em; }

.badge {
  --team: #666;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 44px; height: 26px;
  border-radius: 6px;
  font-family: var(--display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #fff;
  background: color-mix(in srgb, var(--team) 72%, #000);
  border: 1px solid color-mix(in srgb, var(--team) 80%, #fff);
}
.badge.empty { background: var(--surface-3); border-color: var(--line); color: var(--faint); }
.badge.lg { width: 88px; height: 56px; font-size: 18px; border-radius: 12px; }

/* 팀 로고: 이미지가 깨지면 .broken 이 붙고 글자 배지를 대신 보여줌 */
.logo { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 28px; }
.logo img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; }
.logo > .badge { display: none; }
.logo.broken { width: auto; height: auto; }
.logo.broken img { display: none; }
.logo.broken > .badge { display: inline-grid; }
.logo.lg { width: 100px; height: 66px; }

/* ---------- 매치 카드 ---------- */
.match {
  display: block;
  width: 100%;
  padding: 0;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.match:hover:not(:disabled) { border-color: var(--gold); transform: translateY(-1px); }
.match:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.match:disabled { cursor: default; }
.match.picked { border-color: rgba(200, 170, 110, 0.45); }
.match.placeholder { border-style: dashed; background: transparent; cursor: default; }

/* 확정 결과: 금색(내 예측)과 구분되는 파란색, 클릭 불가 */
.match.locked { border-color: rgba(79, 179, 217, 0.35); box-shadow: inset 3px 0 0 var(--confirm); }
.match.locked .team-row.win { background: linear-gradient(90deg, var(--confirm-soft), transparent); }
.match.locked .team-row.win .team-name,
.match.locked .team-row.win .team-score { color: var(--confirm); }

.lock-tag {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  color: var(--confirm);
  background: var(--confirm-soft);
}
.group-tags { display: flex; gap: 4px; align-items: center; }

.status-bar { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: center; margin: -6px 0 22px; font-size: 13px; color: var(--muted); }
.updated { color: var(--confirm); font-weight: 500; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line-strong); background: var(--surface-2); }
.swatch.locked { border-color: var(--confirm); background: var(--confirm-soft); }
.swatch.picked { border-color: var(--gold); background: var(--gold-soft); }

.team-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; min-height: 46px; font-size: 15px; }
.team-row + .team-row { border-top: 1px solid var(--line); }
.team-row.win { background: linear-gradient(90deg, var(--gold-soft), transparent); }
.team-row.win .team-name { color: var(--gold-bright); font-weight: 700; }
.team-row.lose { opacity: 0.42; }
.team-row.tbd .team-name { color: var(--faint); }
.team-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-tag { font-family: var(--display); font-size: 12px; color: var(--muted); }
.team-score { font-family: var(--display); font-weight: 600; font-size: 17px; width: 18px; text-align: right; }
.team-row.win .team-score { color: var(--gold-bright); }

/* ---------- 스위스 스테이지 ---------- */
.swiss { display: grid; grid-template-columns: repeat(5, 260px); gap: 20px; align-items: start; width: max-content; margin: 0 auto; }
/* 최종 결과: 라운드 아래 가로 띠 */
.results-strip { max-width: 1380px; margin: 28px auto 0; }
.results-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.results-head .col-title { margin: 0; }
.results-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; align-items: start; }
.results-grid .result { margin-bottom: 0; }
.group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 14px; }
.group-head { display: flex; justify-content: space-between; align-items: center; padding: 0 2px; margin-bottom: 8px; }
.bo-tag { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--surface-3); color: var(--muted); }
.bo-tag.bo3 { background: var(--gold-soft); color: var(--gold-bright); }
.group-matches { display: flex; flex-direction: column; gap: 8px; }

.result { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; overflow: hidden; }
.result-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; font-size: 13px; font-weight: 700; }
.result-head .record { font-size: 14px; }
.result.adv .result-head { background: var(--gold-soft); color: var(--gold-bright); }
.result.out .result-head { background: var(--danger-soft); color: var(--danger); }
.result ul { list-style: none; margin: 0; padding: 4px 0; }
.result li { display: flex; align-items: center; gap: 10px; padding: 7px 12px; font-size: 14px; }
.result li.tbd { color: var(--faint); }
.result li .lock-tag { margin-left: auto; }
.result.out li:not(.tbd) { opacity: 0.6; }

/* ---------- 녹아웃 스테이지 ---------- */
.notice {
  border: 1px dashed var(--line-strong);
  background: var(--surface);
  color: var(--muted);
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  max-width: 1500px;
  margin: 0 auto 24px;
}
/* 8강 추첨 패널 */
.draw-panel {
  background: var(--surface);
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  padding: 18px 20px;
  max-width: 1500px;
  margin: 0 auto 32px;
}
.draw-panel.drawn { border-color: var(--line); }
.draw-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start; }
.draw-head h3 { display: flex; gap: 8px; align-items: center; margin: 0 0 4px; font-size: 18px; font-weight: 900; }
.draw-head p { margin: 0; font-size: 14px; color: var(--muted); }
.draw-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pick-tag { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 99px; color: var(--gold-bright); background: var(--gold-soft); }
.pools { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 14px; }
.pool { display: flex; align-items: center; gap: 10px; }
.pool .record { font-size: 14px; }
.pool-teams { display: flex; flex-wrap: wrap; gap: 6px; }
.pool-team {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 4px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 99px;
}
.pool-team .logo { width: 22px; height: 18px; }
.draw-rules { margin: 14px 0 0; padding-left: 18px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.draw-rules strong { color: var(--text); }

.draw-details { margin-top: 12px; font-size: 12px; color: var(--muted); }
.draw-details summary { cursor: pointer; width: max-content; }
.draw-details summary:hover { color: var(--text); }
.draw-details .draw-rules { margin-top: 8px; }
.notice-cta { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }

/* 양쪽 대진표: A 블록(왼쪽) → 결승(가운데) ← B 블록(오른쪽) */
.bracket { --gap: 44px; display: flex; gap: var(--gap); width: max-content; margin: 0 auto; padding-top: 4px; }
.b-col { width: 236px; display: flex; flex-direction: column; }
.b-col.center { width: 264px; }
.b-col .col-title { text-align: center; }
.b-slots { height: 720px; display: flex; flex-direction: column; }
.b-slot { flex: 1; display: flex; align-items: center; position: relative; }
.ko-match { position: relative; width: 100%; }
.ko-meta {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 2px; right: 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 대진 연결선
   out-r / out-l: 오른쪽·왼쪽 다음 라운드로 나가는 선 (두 경기를 묶는 ㄷ자, single 이면 직선)
   in-l / in-r : 왼쪽·오른쪽에서 들어오는 선 */
.b-col.out-r .b-slot::after,
.b-col.out-l .b-slot::before,
.b-col.in-l .b-slot::before,
.b-col.in-r .b-slot::after {
  content: "";
  position: absolute;
  width: calc(var(--gap) / 2);
  border: 0 solid var(--line-strong);
}
.b-col.out-r .b-slot::after,
.b-col.in-r .b-slot::after { right: calc(var(--gap) / -2); }
.b-col.out-l .b-slot::before,
.b-col.in-l .b-slot::before { left: calc(var(--gap) / -2); }

.b-col.out-r .b-slot:nth-child(odd)::after { top: 50%; height: 50%; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 6px; }
.b-col.out-r .b-slot:nth-child(even)::after { top: 0; height: 50%; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 6px; }
.b-col.out-l .b-slot:nth-child(odd)::before { top: 50%; height: 50%; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 6px; }
.b-col.out-l .b-slot:nth-child(even)::before { top: 0; height: 50%; border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: 6px; }
.b-col.out-r.single .b-slot::after,
.b-col.out-l.single .b-slot::before,
.b-col.in-l .b-slot::before,
.b-col.in-r .b-slot::after { top: 50%; height: 0; border-width: 2px 0 0; border-radius: 0; }

/* 결승 + 우승 카드 (우승 카드는 결승 카드 위에 띄움) */
.final-match .champion { position: absolute; left: 0; right: 0; bottom: calc(100% + 34px); }
.final-match > .match { border-color: rgba(200, 170, 110, 0.5); }

.champion {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 14px;
  text-align: center;
  border: 1px solid var(--gold);
  border-radius: 14px;
  background: radial-gradient(circle at 50% 0, rgba(240, 213, 149, 0.2), transparent 70%), var(--surface);
}
.champion.empty { border-style: dashed; border-color: var(--line-strong); background: var(--surface); }
.champion svg { width: 44px; height: 44px; color: var(--gold); }
.champion.empty svg { color: var(--faint); }
.champ-name { font-size: 21px; font-weight: 900; color: var(--gold-bright); }
.champion.empty .champ-name { color: var(--faint); }
.champ-sub { font-size: 12px; color: var(--muted); }


/* ---------- 경기 일정 ---------- */
.schedule { max-width: 960px; margin: 0 auto; }
.sched-toolbar { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.filter-tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.filter-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}
.filter-tab span { font-family: var(--display); font-size: 13px; font-weight: 500; color: var(--faint); }
.filter-tab:hover { color: var(--text); }
.filter-tab:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.filter-tab[aria-pressed="true"] { color: #1a1408; background: var(--gold); }
.filter-tab[aria-pressed="true"] span { color: rgba(26, 20, 8, 0.65); }

/* 결과 모두 보기 스위치 */
.spoiler-toggle { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); cursor: pointer; user-select: none; }
.spoiler-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { position: relative; width: 40px; height: 22px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line-strong); transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform 0.15s, background 0.15s; }
.spoiler-toggle input:checked + .switch { background: var(--gold-soft); border-color: var(--gold); }
.spoiler-toggle input:checked + .switch::after { transform: translateX(18px); background: var(--gold-bright); }
.spoiler-toggle input:focus-visible + .switch { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

.sched-day { margin-bottom: 30px; }
.sched-day-head { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; margin-bottom: 10px; }
.sched-day-head h3 { margin: 0; font-size: 18px; font-weight: 900; }
.sched-day-head span { font-size: 12px; color: var(--faint); }

.sched-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 8px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.sched-row.picked { box-shadow: inset 3px 0 0 var(--gold); }
.sched-row.live { border-color: rgba(255, 70, 85, 0.5); box-shadow: inset 3px 0 0 #ff4655; }
.sched-row.done { box-shadow: inset 3px 0 0 var(--confirm); }

.sched-time { display: flex; flex-direction: column; font-family: var(--display); font-size: 21px; font-weight: 600; line-height: 1.1; }
.sched-time small { font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 3px; }
.sched-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sched-stage { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.next-tag, .proj-tag, .sched-status { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.next-tag { color: #1a1408; background: var(--gold); }
.proj-tag { color: var(--muted); border: 1px solid var(--line-strong); }
.sched-status.live { color: #fff; background: #ff4655; }
.sched-status.ended { color: var(--confirm); background: var(--confirm-soft); }
.sched-status.waiting { color: var(--muted); border: 1px solid var(--line-strong); }

.sched-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 14px; align-items: center; }
.sched-team { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 16px; font-weight: 500; }
.sched-team .team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-team.right { flex-direction: row-reverse; text-align: right; }
.sched-team.win .team-name { font-weight: 700; color: var(--gold-bright); }
.sched-row.done .sched-team.win .team-name { color: var(--confirm); }
.sched-team.lose { opacity: 0.45; }
.sched-team.tbd .team-name { color: var(--faint); }
.sched-team .abbr { display: none; }

.sched-score { display: flex; flex-direction: column; align-items: center; min-width: 64px; font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--muted); }
.sched-score.result { color: var(--text); }
.sched-score.mine { color: var(--gold-bright); }
.sched-score small { font-family: "Noto Sans KR", sans-serif; font-size: 10px; font-weight: 700; color: var(--gold); margin-top: 1px; }

/* 스포일러 방지: 결과 가림 버튼 */
.reveal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-3);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
}
.reveal-btn svg { width: 15px; height: 15px; }
.reveal-btn:hover { color: var(--text); border-color: var(--confirm); }
.reveal-btn:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

/* 예측·시청 버튼 */
.sched-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; min-width: 196px; }
.sched-actions > :only-child, .sched-actions .predict-btn { grid-column: 1 / -1; }
.predict-btn, .watch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  border-radius: 8px;
  cursor: pointer;
  transition: filter 0.15s, border-color 0.15s;
}
.predict-btn { color: #1a1408; background: var(--gold); border: 1px solid var(--gold); }
.predict-btn.done { color: var(--gold-bright); background: var(--gold-soft); }
.predict-btn:hover { filter: brightness(1.1); }
.watch-btn svg { width: 14px; height: 14px; }
.watch-btn { color: var(--text); background: var(--surface-2); border: 1px solid var(--line-strong); }
.watch-btn:hover { border-color: var(--text); }
.watch-btn.chzzk .chzzk-dot { width: 9px; height: 9px; border-radius: 50%; background: #00ffa3; box-shadow: 0 0 6px #00ffa3; }
.watch-btn.youtube svg, .watch-btn.vod svg { color: #ff0033; }
.watch-btn.vod { color: #fff; background: #cc0029; border-color: #cc0029; }
.watch-btn.vod svg { color: #fff; }
.watch-btn.vod:hover { filter: brightness(1.12); }
.predict-btn:focus-visible, .watch-btn:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

/* ---------- 선택 창 ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(3, 6, 12, 0.72);
  backdrop-filter: blur(4px);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  position: relative;
  width: min(620px, 100%);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  animation: pop 0.18s ease-out;
}
@keyframes pop { from { transform: translateY(8px) scale(0.98); opacity: 0; } }
.modal-x {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.modal-x:hover { background: var(--surface-3); color: var(--text); }
.modal-eyebrow { margin: 0; font-size: 12px; font-weight: 700; color: var(--gold); }
.modal h2 { margin: 4px 0 22px; font-size: 23px; font-weight: 900; }

.pick-teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.vs { align-self: center; font-family: var(--display); font-size: 18px; color: var(--faint); }
.pick-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 18px 10px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.pick-team:hover { border-color: var(--line-strong); }
.pick-team:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.pick-team[aria-pressed="true"] { border-color: var(--gold); background: linear-gradient(180deg, var(--gold-soft), var(--surface-2)); }
.pick-name { margin-top: 4px; font-size: 17px; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-meta { font-size: 12px; color: var(--muted); }
.pick-check {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  color: var(--faint);
  border: 1px solid var(--line);
}
.pick-team[aria-pressed="true"] .pick-check { color: #1a1408; background: var(--gold); border-color: var(--gold); }

.score-pick { margin-top: 20px; }
.score-label { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.score-label strong { color: var(--gold-bright); }
.chips { display: flex; gap: 8px; }
.chip {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-2);
  font-family: var(--display);
  font-size: 16px;
  cursor: pointer;
}
.chip:hover:not(:disabled) { border-color: var(--gold); }
.chip:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.chip[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-bright); background: var(--gold-soft); }
.chip:disabled { opacity: 0.35; cursor: not-allowed; }

/* 추첨 창 */
.draw-block { margin-top: 16px; }
.draw-block h4 { margin: 0 0 8px; font-size: 13px; font-weight: 700; }
.draw-block h4 span { color: var(--muted); font-weight: 500; }
.draw-qf {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 10px;
  margin-bottom: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.draw-qf-label { grid-column: 1 / -1; font-size: 11px; font-weight: 700; color: var(--muted); }
.draw-qf .vs { font-size: 13px; }
.draw-slot { display: flex; align-items: center; gap: 6px; min-width: 0; }
.draw-select {
  flex: 1;
  min-width: 0;
  padding: 8px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
}
.draw-select:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 1px; }
.draw-status { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
.draw-status.ok { color: var(--confirm); }
.modal .draw-rules { margin-top: 0; }

.modal-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 24px; }
.modal-actions .right { display: flex; gap: 8px; }

@media (max-width: 1100px) {
  .results-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  h1 { font-size: 16px; }
  .brand p { display: none; }
  .progress-track { width: 72px; }
  .modal { padding: 20px 16px; }
  .badge.lg { width: 58px; height: 40px; font-size: 13px; }
  .pick-teams { gap: 8px; }
  .tab { padding: 12px 10px; font-size: 13px; }
  .team-row { font-size: 14px; min-height: 42px; }
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-intro h2 { font-size: 24px; }
  .sched-toolbar { justify-content: center; }
  .filter-tab { padding: 9px 12px; font-size: 14px; }
  .sched-row { grid-template-columns: 48px minmax(0, 1fr); gap: 10px 12px; padding: 12px 14px; }
  .sched-time { font-size: 18px; }
  .sched-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; min-width: 0; }
  .sched-actions > * { flex: 1; }
  .sched-team { font-size: 15px; gap: 6px; }
  .sched-team .logo { width: 28px; height: 22px; }
  .sched-teams { gap: 8px; }
  .sched-score { min-width: 48px; font-size: 17px; }
  .reveal-btn { padding: 6px 8px; font-size: 11px; }
  .reveal-btn svg { display: none; }
  .sched-team .full { display: none; }
  .sched-team .abbr { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------- 적중 표시 ---------- */
.verdict-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.verdict-tag.exact { color: #0b1a10; background: #3ddc84; }
.verdict-tag.hit { color: #3ddc84; background: rgba(61, 220, 132, 0.14); }
.verdict-tag.miss { color: var(--danger); background: var(--danger-soft); }

/* 확정 카드 아래 '내 예측 · 적중/빗나감' 줄 */
.card-verdict {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px dashed var(--line-strong);
  background: rgba(0, 0, 0, 0.18);
}
.card-verdict span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hit-rate { color: var(--text); font-size: 13px; }
.hit-rate strong { font-family: var(--display); font-size: 15px; color: #3ddc84; }

/* 일정: 확정 점수 아래 내 예측 */
.sched-score small.exact, .sched-score small.hit { color: #3ddc84; }
.sched-score small.miss { color: var(--danger); text-decoration: line-through; }

/* ---------- 예측 마감 (경기 시작 후) ---------- */
.match.closed:not(.locked) { cursor: not-allowed; }
.match.closed .team-row { opacity: 0.85; }
.card-verdict.closed { color: var(--muted); }
.closed-tag, .predict-closed {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
}
.closed-tag { padding: 2px 8px; }
.predict-closed {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--surface-3);
}
.modal-expired {
  margin: 16px 0 0;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--danger);
  background: var(--danger-soft);
  border-radius: 8px;
}

/* ---------- 점수 · 재예측 · 대진 적중 ---------- */
.card-verdict .tags { display: inline-flex; gap: 4px; align-items: center; flex: none; }
.points-tag { font-family: var(--display); font-size: 13px; font-weight: 600; color: var(--gold-bright); }
.points-tag.zero { color: var(--faint); }
.repick-tag, .matchup-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.repick-tag { color: #f2a65a; background: rgba(242, 166, 90, 0.14); }
.matchup-tag { color: #3ddc84; background: rgba(61, 220, 132, 0.14); }
.card-verdict.repick { color: #f2a65a; }
.card-verdict.frozen { color: var(--text); }

.points-hint { margin: -12px 0 18px; font-size: 13px; color: var(--muted); }
.points-hint.repick { color: #f2a65a; }

.link-btn {
  margin-left: 10px;
  padding: 0;
  font: inherit;
  font-size: 12px;
  color: var(--gold);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link-btn:hover { color: var(--gold-bright); }

.rules-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rules-table th, .rules-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.rules-table th[scope="row"] { text-align: left; font-weight: 500; color: var(--text); }
.rules-table thead th { font-size: 12px; color: var(--muted); font-weight: 700; }
.rules-table td { font-family: var(--display); font-size: 16px; color: var(--gold-bright); }
.rules-notes { margin: 16px 0 0; padding-left: 18px; font-size: 13px; line-height: 1.7; color: var(--muted); }
.rules-notes strong { color: var(--text); }

/* ---------- 로그인 ---------- */
.auth-area { display: flex; align-items: center; gap: 8px; }
.discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  background: #5865f2;
  border-radius: 9px;
  transition: filter 0.15s;
}
.discord-btn:hover { filter: brightness(1.1); }
.discord-btn:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: 2px; }
.me-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; max-width: 180px; }
.me-chip img { border-radius: 50%; flex: none; }
.me-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 알림 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  transform: translateX(-50%);
  max-width: min(560px, calc(100% - 32px));
  padding: 12px 18px;
  font-size: 14px;
  color: var(--text);
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}
.toast[hidden] { display: none; }

/* ---------- 순위표 ---------- */
.leaderboard { max-width: 860px; margin: 0 auto; }
.lb-join {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  margin-bottom: 20px;
  background: rgba(88, 101, 242, 0.1);
  border: 1px solid rgba(88, 101, 242, 0.45);
  border-radius: var(--radius);
}
.lb-join strong { font-size: 15px; }
.lb-join p { margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.lb-me { margin-bottom: 14px; font-size: 15px; color: var(--muted); text-align: center; }
.lb-me strong { font-family: var(--display); font-size: 20px; color: var(--gold-bright); }
.lb-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lb-table th { padding: 12px 14px; font-size: 12px; font-weight: 700; color: var(--muted); text-align: right; background: var(--surface-2); }
.lb-table th:nth-child(1), .lb-table th:nth-child(2) { text-align: left; }
.lb-table td { padding: 10px 14px; font-size: 15px; text-align: right; border-top: 1px solid var(--line); }
.lb-table tr.me td { background: var(--gold-soft); }
.lb-rank { width: 56px; text-align: left !important; font-family: var(--display); font-size: 18px; font-weight: 600; }
.lb-table tbody tr:nth-child(-n+3) .lb-rank { color: var(--gold-bright); }
.lb-table th, .lb-table td:not(.lb-player) { white-space: nowrap; }
.lb-player { text-align: left !important; max-width: 0; width: 100%; }
.lb-player > div { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lb-player img { border-radius: 50%; flex: none; }
.lb-player span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.lb-points { font-family: var(--display); font-size: 18px; font-weight: 600; color: var(--gold-bright); }
.lb-hits, .lb-exact { font-family: var(--display); color: var(--muted); }
.lb-more { text-align: center; font-size: 13px; color: var(--faint); }

@media (max-width: 640px) {
  .me-chip span { display: none; }
  .lb-table .lb-exact { display: none; }
  .lb-table td, .lb-table th { padding: 10px 8px; }
}

/* ---------- 하단 안내 (라이엇 팬 콘텐츠 정책) ---------- */
.site-footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px var(--gutter) 48px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--faint);
  text-align: center;
  border-top: 1px solid var(--line);
}
.site-footer p { margin: 0 0 6px; }
