:root {
  --red: #ff0010;
  --red-soft: #fff0f0;
  --black: #0d0d12;
  --dark: #17171b;
  --bg: #f5f5f5;
  --card: #fff;
  --ink: #17171b;
  --muted: #8a8d95;
  --line: #ececec;
  --gold: #ffd83a;
  --win: #16803c;
  font-family: "Noto Sans KR", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); line-height: 1.5; -webkit-text-size-adjust: 100%; }
h1, h2, h3, h4, p { margin: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ── 상단 ── */
.topbar { background: var(--black); }
.topbar-in { max-width: 1300px; margin: 0 auto; padding: 0 16px; height: 56px; display: flex; align-items: center; justify-content: space-between; }
.logo { height: 30px; width: auto; }
.top-right { display: flex; align-items: center; gap: 18px; }
.top-prize { display: flex; align-items: center; gap: 6px; padding: 5px 14px 5px 8px; border-radius: 99px; background: rgba(255, 216, 58, .12); border: 1px solid rgba(255, 216, 58, .55); font-size: 0.8rem; color: #e9e9ee; white-space: nowrap; }
.top-prize[hidden] { display: none; }
.top-prize img { width: 18px; height: 18px; object-fit: contain; }
.top-prize b { color: #ffd83a; font-size: 0.95rem; font-weight: 900; }
.topbar-link { color: #fff; font-size: 0.8rem; text-decoration: none; display: none; }

.hero { display: none; background: var(--red); color: #fff; position: relative; overflow: hidden; }
.hero-in { max-width: 1300px; margin: 0 auto; padding: 48px 20px 44px; min-height: 320px; display: flex; align-items: center; }
.hero-text { position: relative; z-index: 1; }
.hero-period { font-size: 0.95rem; font-weight: 500; margin-bottom: 10px; }
.hero h1 { font-size: 3rem; font-weight: 700; line-height: 1.15; }
.hero-sub { margin-top: 18px; font-size: 1rem; }
.hero-trophy { position: absolute; right: max(20px, calc((100vw - 1300px) / 2 + 20px)); bottom: 0; height: calc(100% - 28px); width: auto; }

/* ── 본문 ── */
.page { max-width: 1300px; margin: 0 auto; padding: 14px 16px 48px; display: grid; gap: 16px; }
.page > *, .view > * { min-width: 0; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: #ebebeb; border-radius: 99px; padding: 4px; }
.tab { border: 0; background: transparent; border-radius: 99px; padding: 11px 0; font-size: 1rem; font-weight: 700; color: var(--muted); }
.tab.active { background: var(--red); color: #fff; }
.updated { order: 99; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 0.72rem; color: var(--muted); text-align: center; padding: 2px 0 6px; }
.updated span { white-space: nowrap; }
.d-pc { display: none; }

/* 모바일 배너 */
.ev-m-set { position: relative; }
.ev-m-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 0; border-radius: 18px; }
.ev-m-track::-webkit-scrollbar { display: none; }
/* ── 이벤트 배너(코드로 그림): 모든 크기를 배너 폭(cqw)에 비례시켜 어느 화면에서도 같은 모양·선명하게 ── */
.bn { position: relative; container-type: inline-size; overflow: hidden; }
.ev-m-track .bn { flex: 0 0 100%; scroll-snap-align: center; }
.bn-m { aspect-ratio: 358 / 164; border-radius: 5cqw; background: linear-gradient(90deg, #ff0010 0%, #d2000e 60%, #bf000b 100%); color: #fff; }
.bn-m .b-date { position: absolute; left: 4.5cqw; top: 14cqw; font-size: 3.6cqw; font-weight: 500; opacity: .9; }
.bn-m .b-title { position: absolute; left: 4.5cqw; top: 19.6cqw; font-size: 6.4cqw; font-weight: 900; line-height: 1.2; letter-spacing: -0.01em; white-space: nowrap; }
.bn-m .b-sub { position: absolute; left: 4.5cqw; top: 29.2cqw; font-size: 3.2cqw; font-weight: 500; opacity: .92; white-space: nowrap; }
.bn-m .b-pts { position: absolute; left: 4.5cqw; top: 34.6cqw; height: 6.7cqw; padding: 0 3.6cqw; display: flex; align-items: center; border-radius: 99px; background: #ffd83a; color: #17171b; font-size: 3.4cqw; font-weight: 900; white-space: nowrap; }
.bn-m .b-cta { position: absolute; right: 4.5cqw; top: 3.4cqw; height: 6.6cqw; min-width: 31cqw; padding: 0 3cqw; display: flex; align-items: center; justify-content: center; border-radius: 99px; font-size: 3.2cqw; font-weight: 700; white-space: nowrap; text-decoration: none; }
.bn-m .b-cta.soon, .bn-m .b-cta.done { background: #6d0008; color: #fff; }
.bn-m .b-cta.live { background: #fff; color: #e5000f; }
.bn-m .b-img { position: absolute; z-index: 0; pointer-events: none; }
.bn-m.img-pumpkin .b-img { right: 0; bottom: 3cqw; width: 52cqw; }
.bn-m.img-coins .b-img { right: 0; bottom: 5cqw; width: 54cqw; }
.bn-m.img-lotto .b-img { right: -1cqw; bottom: -2cqw; width: 48cqw; }
.bn-m.img-trophy .b-img { right: 2.5cqw; bottom: -1cqw; height: 29cqw; width: auto; }
.bn-m.img-together .b-img { right: 3cqw; bottom: 0; height: 32cqw; width: auto; }
.bn-m.img-pumpkin .b-img, .bn-m.img-coins .b-img, .bn-m.img-lotto .b-img, .bn-pc.img-pumpkin .b-img, .bn-pc.img-coins .b-img, .bn-pc.img-lotto .b-img { -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 42%); mask-image: linear-gradient(90deg, transparent 0%, #000 42%); }
.bn-m > :not(.b-img) { z-index: 1; }
/* 오픈 전에는 지급 포인트를 가리고, 오픈일이 되면 공개 */
.bn .pts-open { display: none; }
.bn.open .pts-open { display: inline; }
.bn.open .pts-lock { display: none; }
.bn .b-cta.live, .bn .b-cta.done { display: none; }
.bn.open:not(.closed) .b-cta.live, .bn.open.closed .b-cta.done { display: flex; }
.bn.open .b-cta.live ~ .b-cta.soon, .bn.open .b-cta.done ~ .b-cta.soon { display: none; }
.bn-pc { width: 222px; height: 240px; border-radius: 16px; background: #fff; color: #17171b; }

.dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.dots i { width: 6px; height: 6px; border-radius: 99px; background: #d2d2d6; transition: width .2s; }
.dots i.on { width: 20px; background: var(--red); }
.ev-pc { display: none; }

/* 제목 줄 */
.view { display: grid; gap: 14px; }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.title-row h2 { font-size: 1.35rem; font-weight: 900; }
.title-bar, .title-sub { display: none; }
.round-period { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.dpill { margin-left: auto; background: var(--red); color: #fff; font-weight: 700; font-size: 0.82rem; border-radius: 99px; padding: 5px 14px; white-space: nowrap; }
.score-parts { order: 5; flex-basis: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.score-parts i { display: none; }
.part { background: #fff; border: 1px solid #dcdce0; border-radius: 12px; padding: 10px 6px; text-align: center; }
.part img { display: none; }
.part b { display: block; font-size: 0.88rem; font-weight: 700; }
.part small { color: var(--muted); font-size: 0.72rem; }

/* 카드 · 순위 */
.card { background: var(--card); border: 1px solid #e3e3e6; border-radius: 20px; padding: 18px 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
#rankingNote { display: none; }
.card-head h3 { font-size: 1.05rem; font-weight: 900; }
.card-head small { font-size: 0.72rem; font-weight: 500; color: var(--muted); margin-left: 4px; }
.search { display: flex; align-items: center; gap: 8px; }
.s-label { display: none; font-size: 0.7rem; }
.search input { width: 140px; border: 0; background: #f0f0f2; border-radius: 99px; padding: 7px 14px; font-size: 0.85rem; }
.search input::placeholder { color: #999; }
.search-hint { font-size: 0.72rem; color: var(--muted); margin: -2px 0 10px; }

.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rank-row { display: grid; grid-template-columns: 2em 1fr auto; column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; }
.rank-row.top { background: var(--red-soft); }
.rank-row .no { font-weight: 900; font-size: 1.15rem; color: var(--muted); text-align: center; grid-row: span 2; }
.rank-row.r3 .no { color: var(--red); }
.rank-row .nm { font-weight: 700; font-size: 1rem; }
.rank-row .br { font-size: 0.7rem; font-weight: 500; color: var(--muted); margin-left: 6px; }
.rank-row .detail { grid-column: 2; font-size: 0.72rem; color: var(--muted); }
.rank-row .score { grid-column: 3; grid-row: 1 / span 2; font-weight: 900; color: var(--red); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.rank-row.ineligible { opacity: .55; }
.tag { display: inline-block; font-size: 0.65rem; font-weight: 500; padding: 0 7px; border-radius: 99px; background: #e5e5e5; margin-left: 5px; color: var(--ink); }
.empty { padding: 20px; color: var(--muted); text-align: center; font-size: 0.9rem; }

.my-rank { border: 2px solid var(--red); background: var(--red-soft); border-radius: 14px; padding: 12px; margin-bottom: 12px; display: grid; gap: 8px; }
.my-title { font-weight: 900; font-size: 0.95rem; }
.my-title small { font-weight: 500; color: var(--muted); margin-left: 6px; }
.my-row { display: grid; grid-template-columns: 4em 1fr auto; gap: 4px 10px; align-items: center; background: #fff; border-radius: 10px; padding: 10px 12px; }
.my-no { font-size: 1.35rem; font-weight: 900; color: var(--red); grid-row: span 2; }
.my-no small { font-size: 0.75rem; margin-left: 2px; }
.my-row .nm { font-weight: 700; }
.my-row .br { font-size: 0.7rem; font-weight: 500; color: var(--muted); margin-left: 6px; }
.my-row .detail { grid-column: 2; font-size: 0.72rem; color: var(--muted); }
.my-row .score { grid-column: 3; grid-row: 1 / span 2; font-weight: 900; color: var(--red); }
.note { font-size: 0.72rem; color: var(--muted); }

/* ── 지점 대항전 ── */
.round-pills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.round-pills::-webkit-scrollbar { display: none; }
.rp { flex: 0 0 auto; min-width: 52px; border: 1px solid #dcdce0; background: #fff; border-radius: 99px; padding: 8px 14px; font-weight: 700; font-size: 0.9rem; }
.rp.active { background: var(--red); border-color: var(--red); color: #fff; }
.rp.live:not(.active) { border-color: var(--red); color: var(--red); }

.match-grid { display: grid; gap: 12px; }
.mc { background: #fff; border: 1px solid #e3e3e6; border-radius: 14px; overflow: hidden; }
.mc-head { background: var(--dark); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 9px 14px; font-size: 0.9rem; font-weight: 700; }
.mc-head small { color: #b8bac2; font-weight: 500; font-size: 0.72rem; }
.mc-body { display: flex; align-items: center; justify-content: space-around; gap: 6px; padding: 22px 8px 16px; }
.side { text-align: center; position: relative; min-width: 0; flex: 1; padding-top: 4px; }
.lead-badge { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); background: var(--red); color: #fff; font-size: 0.62rem; font-weight: 700; padding: 0 8px; border-radius: 99px; }
.side b { display: block; font-size: 1.2rem; font-weight: 900; }
.side .pt { display: block; font-size: 0.95rem; font-weight: 700; color: #8a8d95; font-variant-numeric: tabular-nums; }
.side.lead .pt { color: var(--red); }
.side .wp { display: block; font-size: 0.68rem; color: var(--muted); }
.side .place { display: block; font-size: 0.72rem; font-weight: 500; color: var(--muted); margin: -2px 0 4px; word-break: keep-all; }
#standings .place { display: block; font-size: 0.68rem; color: var(--muted); }
.branch-legend { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: -4px 0 10px; font-size: 0.72rem; color: var(--muted); }
.branch-legend span { background: #f0f0f2; border-radius: 6px; padding: 2px 8px; }
.branch-legend b { color: var(--ink); margin-right: 4px; }
.vs { color: var(--red); font-weight: 900; font-size: 1.1rem; }

.wide-btn { width: 100%; background: var(--dark); color: #fff; border: 0; border-radius: 14px; padding: 15px; font-weight: 700; font-size: 0.95rem; }
.wide-btn span:last-child { margin-left: 4px; }
.all-panel { display: none; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.card { min-width: 0; }
.sched-table { display: none; }
.sl-row { padding: 10px 4px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; font-size: 0.85rem; }
.sl-row.cur { background: var(--red-soft); border-radius: 10px; padding: 10px 10px; }
.sl-top { display: flex; align-items: center; gap: 8px; }
.sl-top .st { margin-left: auto; }
.sl-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.sl-line em { font-style: normal; font-size: 0.68rem; color: var(--muted); background: #f0f0f2; border-radius: 6px; padding: 0 6px; min-width: 2.6em; text-align: center; }
.sl-line i { font-style: normal; color: var(--muted); }
#standings th, #standings td { padding: 9px 4px; font-size: 0.8rem; }
.all-panel.open { display: grid; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th, td { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { font-size: 0.72rem; color: var(--muted); font-weight: 500; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.cur td { background: var(--red-soft); }
.winner { font-weight: 900; color: var(--win); }
.st { display: inline-block; font-size: 0.68rem; padding: 1px 9px; border-radius: 99px; background: #eee; }
.st.live { background: var(--red); color: #fff; }
.st.confirmed { background: #e9f3ec; color: var(--win); }

/* 규칙 */
.rules-toggle { background: transparent; color: var(--muted); font-size: 0.85rem; padding: 6px; }
.rules { display: none; background: var(--black); color: #fff; border-radius: 20px; padding: 22px 20px; scroll-margin-top: 12px; }
.rules.open { display: block; }
.rules h3 { font-size: 1.05rem; margin-bottom: 12px; }
.rules ul { margin: 0; padding-left: 1.1em; display: grid; gap: 5px; font-size: 0.78rem; color: #e6e6ea; }
.rules-prize { margin-top: 14px; font-size: 0.82rem; font-weight: 700; color: var(--gold); }

/* ══ PC ══ */
@media (min-width: 900px) {
  .topbar-in { height: 58px; padding: 0 20px; }
  .topbar-link { display: block; }
  .hero { display: block; }
  .page { padding: 20px 20px 64px; gap: 22px; }
  .tabs { max-width: 420px; }
  .d-pc { display: inline; }
  .d-m { display: none; }
  #rankingNote { display: inline; }
  .card-head { flex-wrap: wrap; }

  .ev-m { display: none; }
  .ev-pc { display: grid; grid-template-columns: 250px 1fr; align-items: center; gap: 16px; position: relative; background: linear-gradient(90deg, #d5000d, #ff0010 60%, #e8000e); border-radius: 22px; padding: 22px 26px; }
  .ev-pc-intro { color: #fff; }
  .ev-pc-intro img { height: 34px; width: auto; margin-bottom: 8px; }
  .ev-pc-intro h2 { font-size: 1.4rem; font-weight: 900; }
  .ev-pc-intro p { font-size: 0.78rem; margin-top: 6px; opacity: .95; }
  .ev-progress { height: 3px; background: rgba(255,255,255,.35); border-radius: 99px; margin-top: 16px; width: 120px; }
  .ev-progress span { display: block; height: 100%; width: 66%; background: #fff; border-radius: 99px; transition: width .25s; }
  .ev-pc-intro small { font-size: 0.68rem; opacity: .85; }
  .ev-pc-window { overflow: hidden; }
  .ev-pc-track { display: flex; gap: 12px; transition: transform .3s ease; }
  .ev-pc-track .bn { flex: 0 0 auto; }
  .bn-pc .b-date { position: absolute; left: 8.1cqw; top: 9cqw; height: 8.6cqw; padding: 0 4.5cqw; display: flex; align-items: center; border-radius: 99px; background: #ffe5e8; color: #e5000f; font-size: 4.9cqw; font-weight: 700; }
  .bn-pc .b-title { position: absolute; left: 8.1cqw; top: 22cqw; font-size: 7.6cqw; font-weight: 900; line-height: 1.2; white-space: nowrap; }
  .bn-pc .b-sub { position: absolute; left: 8.1cqw; top: 34cqw; font-size: 5.4cqw; font-weight: 500; line-height: 1.5; color: #6b6e76; white-space: nowrap; }
  .bn-pc .b-pts { position: absolute; left: 8.1cqw; top: 50.5cqw; height: 11.7cqw; padding: 0 5cqw; display: flex; align-items: center; border-radius: 99px; background: #ffd83a; color: #17171b; font-size: 5.4cqw; font-weight: 900; white-space: nowrap; }
  .bn-pc .b-cta { position: absolute; left: 8.1cqw; top: 65.3cqw; height: 10.8cqw; min-width: 51cqw; padding: 0 5cqw; display: flex; align-items: center; justify-content: center; border-radius: 99px; font-size: 5cqw; font-weight: 700; white-space: nowrap; text-decoration: none; }
  .bn-pc .b-cta.soon, .bn-pc .b-cta.done { background: #ececef; color: #6b6e76; }
  .bn-pc .b-cta.live { background: #17171b; color: #fff; }
  .bn-pc .b-img { position: absolute; pointer-events: none; }
  .bn-pc.img-pumpkin .b-img { right: 0; bottom: 0; width: 62cqw; }
  .bn-pc.img-coins .b-img { right: 0; bottom: 0; width: 62cqw; }
  .bn-pc.img-lotto .b-img { right: 0; bottom: 0; width: 62cqw; }
  .bn-pc.img-trophy .b-img { right: 2cqw; bottom: 0; height: 40cqw; width: auto; }
  .bn-pc.img-together .b-img { right: -5cqw; bottom: 0; width: 50cqw; }
  .ev-arrow { position: absolute; top: 50%; width: 34px; height: 34px; margin-top: -17px; border-radius: 99px; border: 0; background: var(--dark); color: #fff; font-size: 1.3rem; line-height: 1; }
  .ev-arrow.prev { left: 275px; }
  .ev-arrow.next { right: 10px; }
  .ev-arrow:disabled { opacity: .35; cursor: default; }

  .title-row { gap: 14px; }
  .title-row h2 { font-size: 1.5rem; }
  .title-bar { display: block; width: 2px; height: 24px; background: var(--ink); }
  .title-sub { display: block; font-weight: 700; font-size: 0.95rem; }
  .dpill { font-size: 1rem; padding: 8px 28px; }
  .score-parts { order: 0; flex-basis: auto; display: flex; align-items: center; gap: 10px; }
  .score-parts i { display: block; font-style: normal; color: var(--muted); }
  .part { display: flex; align-items: center; gap: 6px; background: transparent; border: 0; padding: 0; text-align: left; }
  .part img { display: block; width: 20px; height: 20px; }
  .part b { display: inline; font-size: 0.95rem; }
  .part small { margin-left: 4px; }
  .part span { display: block; }

  .card { padding: 24px 28px; }
  .s-label { display: block; }
  .search input { width: 200px; background: #fff; border: 1px solid #888; border-radius: 10px; padding: 5px 12px; }
  .search input::placeholder { color: transparent; }
  .rank-list { gap: 6px; }
  .rank-row { grid-template-columns: 2.6em 8.5em 1fr auto; padding: 13px 18px; background: #fafafa; }
  .rank-row.top { background: var(--red-soft); }
  .rank-row .no { grid-row: auto; font-size: 0.95rem; }
  .rank-row.r3:not(.top) .no { color: var(--muted); }
  .rank-row.top .no { color: var(--red); }
  .rank-row .nm { font-size: 0.92rem; }
  .rank-row .br { display: block; margin: 0; }
  .rank-row .detail { grid-column: 3; text-align: center; }
  .rank-row .score { grid-column: 4; grid-row: auto; font-size: 0.98rem; }
  .my-row { grid-template-columns: 4em 8.5em 1fr auto; }
  .my-no { grid-row: auto; }
  .my-row .br { display: block; margin: 0; }
  .my-row .detail { grid-column: 3; text-align: center; }
  .my-row .score { grid-column: 4; grid-row: auto; }

  .title-row.branch-row { }
  .match-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .mc-body { padding: 26px 12px 20px; }
  .wide-btn#allToggle { display: none; }
  .all-panel { display: grid; }
  .sched-table { display: block; }
  .sched-list { display: none; }
  .rules-toggle { display: none; }
  .rules { display: block; padding: 26px 32px; }
  .rules ul { font-size: 0.8rem; }
}

.prov { display: inline-block; margin-left: 6px; font-size: 0.62rem; font-weight: 700; line-height: 1.5; padding: 0 7px; border-radius: 99px; background: #ffe7a3; color: #7a5500; vertical-align: middle; }
