:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --surface: #f7f8f9;
  --surface-2: #eef0f2;
  --text: #16191d;
  --text-dim: #5b636e;
  --text-faint: #868d97;
  --border: #e2e6ea;
  --border-strong: #cdd3da;

  --brand: #0f766e;
  --brand-ink: #0b5750;
  --brand-soft: #e6f4f1;
  --brand-line: #a7d9d1;

  --warn-bg: #fff4e5;
  --warn-line: #d97706;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --maxw: 780px;
  --shadow: 0 1px 2px rgba(16,25,29,.04), 0 8px 24px -12px rgba(16,25,29,.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --surface: #161a1f;
    --surface-2: #1e242b;
    --text: #e9ecef;
    --text-dim: #9aa3ae;
    --text-faint: #78818c;
    --border: #262c34;
    --border-strong: #333b45;

    --brand: #2dd4bf;
    --brand-ink: #5eead4;
    --brand-soft: #122b28;
    --brand-line: #1d4d47;

    --warn-bg: #3a2c14;
    --warn-line: #d97706;

    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Malgun Gothic", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ── 헤더 ─────────────────────────────────────── */
header.site {
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(1.4) blur(8px);
}
/* 두 줄로 나눈다 — **제목 줄**과 **메뉴 줄**(2026-08-12 사용자 지시).
   메뉴가 제목·버튼과 자리를 다투지 않으므로 폭을 통째로 쓰고, 그래서 한 줄에 들어간다.
   (한 줄에 다 넣어 봤더니 360px 에서 여섯 개 중 넷까지만 보였다.) */
header.site .wrap { padding-top: 9px; padding-bottom: 4px; }
header.site .bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: nowrap;
}
.brand {
  font-weight: 800; font-size: 1.06rem; letter-spacing: -.02em;
  color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.brand-mark {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .74rem; font-weight: 800; flex: none;
}
/* 자리가 모자라면 접지 않고 옆으로 민다. 접힌 메뉴보다 미는 메뉴가 읽기 쉽다.
   스크롤 막대는 감춘다 — 손가락으로 미는 것이 기본 동작이다. */
nav.site {
  display: flex; gap: 15px; flex-wrap: nowrap;
  min-width: 0; overflow-x: auto; padding: 4px 0 8px;
  scrollbar-width: none; -ms-overflow-style: none;
}
nav.site::-webkit-scrollbar { display: none; }
/* 좁은 화면에서는 메뉴가 반드시 넘친다(항목 여섯 + 브랜드 + 버튼). 오른쪽 끝을 흐리게 해
   **더 있다는 것을 보이게** 한다 — 잘린 글자는 오류처럼 보이지만 흐린 끝은 신호로 읽힌다. */
/* 그래도 넘치는 화면(아주 좁거나 글자 확대)에서는 접지 않고 옆으로 민다.
   오른쪽 끝을 흐리게 해 **더 있다는 것을 보인다** — 잘린 글자는 오류처럼 보이지만
   흐린 끝은 신호로 읽힌다. */
@media (max-width: 420px) {
  nav.site {
    gap: 9px; font-size: .92em; letter-spacing: -.01em;
    mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 18px), transparent);
  }
}
nav.site a {
  color: var(--text-dim); text-decoration: none; font-size: .9rem; font-weight: 500;
  padding: 2px 0; border-bottom: 2px solid transparent; white-space: nowrap;
}
nav.site a:hover, nav.site a:focus { color: var(--brand); border-bottom-color: var(--brand); }
/* 지금 보고 있는 메뉴. 색만으로 알리지 않도록 aria-current 를 함께 준다(HTML 쪽). */
nav.site a.current { color: var(--text); border-bottom-color: var(--brand); font-weight: 700; }

/* ── 오른쪽 위 메뉴 버튼 ──────────────────────── */
/* **JS 없이** `details` 로 여닫는다 — 브라우저가 키보드·낭독기까지 처리해 준다.
   사이트 전체가 JS 를 쓰지 않으므로 이 규칙을 여기서 깨지 않는다. */
.more { position: relative; flex: none; }
.more > summary {
  list-style: none; cursor: pointer;
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: none; color: var(--text-dim);
}
.more > summary::-webkit-details-marker { display: none; }
/* 테두리를 두지 않는다(2026-08-12 사용자 지시). 누를 수 있다는 신호는 **눌렀을 때**와
   **가리켰을 때**의 옅은 원으로 준다. 손가락 표적은 40px 그대로다. */
.more > summary:hover { background: var(--surface-2); color: var(--text); }
.more > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.more[open] > summary { background: var(--surface-2); color: var(--text); }
/* 버튼 안의 페이지를 보고 있으면 버튼에도 표시한다 — 안 그러면 지금 어디인지 알 수 없다. */
.more.has-current > summary { color: var(--brand); }
/* 세로 점 셋(⋮) — 2026-08-12 사용자 선택.
   막대 셋(≡)은 "화면 전체를 덮는 서랍"을 뜻하는 관례라, 작은 목록이 내려오는 이 버튼에는
   점 셋이 맞다. 이모지나 이미지를 쓰지 않고 그림자로 그린다. */
.dots { width: 4px; height: 4px; border-radius: 50%; background: currentColor;
  box-shadow: 0 -7px 0 currentColor, 0 7px 0 currentColor; }

.more-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 30;
  display: flex; flex-direction: column; gap: 2px; padding: 6px;
  min-width: 186px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow);
}
.more-menu a {
  display: flex; align-items: center; min-height: 44px;   /* 손가락 기준 */
  padding: 0 12px; border-radius: var(--r-sm); border: 0;
  color: var(--text); text-decoration: none; font-size: .95rem; font-weight: 500;
  white-space: nowrap;
}
.more-menu a:hover, .more-menu a:focus { background: var(--surface-2); color: var(--brand); }
.more-menu a.current { color: var(--brand); font-weight: 700; background: var(--brand-soft); }

main { padding: 32px 0 64px; }

/* ── 타이포 ───────────────────────────────────── */
h1 { font-size: 1.75rem; line-height: 1.3; margin: 0 0 8px; letter-spacing: -.03em; font-weight: 800; }
h2 {
  font-size: 1.22rem; margin: 44px 0 14px; letter-spacing: -.02em; font-weight: 700;
  display: flex; align-items: center; gap: 9px;
}
h2::before {
  content: ""; width: 3px; height: 1.05em; border-radius: 2px;
  background: var(--brand); flex: none;
}
h3 { font-size: 1.02rem; margin: 26px 0 8px; font-weight: 700; }
p { margin: 0 0 14px; }
.lead { color: var(--text-dim); margin-bottom: 26px; font-size: 1.02rem; }
a { color: var(--brand); text-underline-offset: 2px; }

/* ── 히어로 (최신 회차) ────────────────────────── */
.hero {
  background:
    radial-gradient(120% 140% at 8% -20%, var(--brand-soft) 0%, transparent 62%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px 24px 22px;
  margin: 0 0 26px;
  box-shadow: var(--shadow);
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .8rem; font-weight: 700; letter-spacing: .01em;
  color: var(--brand); background: var(--bg);
  border: 1px solid var(--brand-line);
  border-radius: 999px; padding: 4px 11px; margin-bottom: 14px;
}
.hero h1 { font-size: 1.9rem; margin-bottom: 2px; }
.hero .when { color: var(--text-dim); font-size: .93rem; margin: 0 0 18px; }

/* ── 볼 ───────────────────────────────────────── */
.balls { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin: 0; padding: 0; list-style: none; }
.ball {
  width: 48px; height: 48px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.12rem; color: #fff;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,.16), 0 2px 5px rgba(0,0,0,.14);
}
.ball.y { background: #e5a000; }
.ball.b { background: #1f6fd0; }
.ball.r { background: #d13c3c; }
.ball.g { background: #5a636e; }
.ball.n { background: #2f9e63; }
.plus { color: var(--text-faint); font-weight: 800; font-size: 1.1rem; padding: 0 3px; }
.bonus-label { font-size: .8rem; color: var(--text-faint); display: block; margin-top: 11px; }

/* ── 통계 타일 ────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; margin-top: 20px; }
.stat {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px 14px;
}
.stat dt { font-size: .78rem; color: var(--text-dim); margin: 0 0 3px; font-weight: 500; }
.stat dd { margin: 0; font-weight: 800; font-size: 1.12rem; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

/* ── 회차 팩트 칩 ─────────────────────────────── */
.facts { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 8px; padding: 0; list-style: none; }
.fact {
  font-size: .82rem; color: var(--text-dim);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 11px;
}
.fact b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── 카드 ─────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px; margin: 0 0 20px;
}

/* ── 표 ───────────────────────────────────────── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; container-type: inline-size; }
/* **표는 화면 폭에 맞춘다(min-width 없음).**
   예전에는 540px 를 강제했다 — 회차 목록에서 당첨번호 공이 세로로 접히는 것을 막으려던
   것이었는데, 그 목록은 이후 "좁으면 두 줄로 접기"(.draws)로 바뀌어 이 값이 필요 없어졌다.
   값만 남아 **공이 없는 표들까지 가로로 밀고 있었다**(2026-08-11 사용자 제보).
   지금은 공이 든 표가 하나도 없다. 끊기면 안 되는 값은 칸에 nowrap 을 주고,
   그래도 넘치면 .table-scroll 이 받아 준다 — 강제 폭 없이도 안전하다. */
table { width: 100%; min-width: 0; border-collapse: collapse; font-size: .93rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 600; font-size: .82rem; letter-spacing: .01em; }
tbody tr:hover { background: var(--surface); }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
td a { font-weight: 600; text-decoration: none; }
td a:hover { text-decoration: underline; }

/* 좁은 화면에서는 여백과 글자를 조금 줄인다. 끊을 수 없는 값(금액·확률)이 든 표는
   이 8%가 "한 화면에 들어가느냐 가로로 밀리느냐"를 가른다 — 세금 계산 예시가 딱 그랬다.
   화면 폭(@media)이 아니라 **표가 놓인 자리의 폭**(@container)을 본다 — 본문에 여백이
   있으므로 둘은 다르고, 판단 기준은 실제로 표가 쓸 수 있는 폭이다. */
@container (max-width: 400px) {
  table { font-size: .88rem; }
  th, td { padding-left: 5px; padding-right: 5px; }
}

/* 여섯 개는 **한 줄이다.** 접히면 표가 세로로 늘어나 빈 공간만 커진다. */
.mini-balls { display: inline-flex; gap: 4px; flex-wrap: nowrap; white-space: nowrap; }
.mini {
  flex: none;
  width: 27px; height: 27px; border-radius: 50%; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -2px 4px rgba(0,0,0,.16);
}
.mini.y { background: #e5a000; }
.mini.b { background: #1f6fd0; }
.mini.r { background: #d13c3c; }
.mini.g { background: #5a636e; }
.mini.n { background: #2f9e63; }

/* ── 회차 목록 ────────────────────────────────── */
/* 폭 예산이 전부다. 360px 폰에서 쓸 수 있는 폭은 약 328px 인데
   공 7개(본번호 6 + 보너스)만으로 200px 안팎을 쓴다. 회차·날짜·당첨금·당첨자를
   같은 줄에 넣는 방법은 없다 — 칸이나 글자를 줄여서 될 문제가 아니었다.
   그래서 좁으면 **표를 두 줄짜리 목록으로 접는다.** 가로 스크롤도 잘린 칸도 없다.
   접고 나면 폭이 남으므로 오히려 공을 키운다(표에 맞추느라 작게 둘 이유가 사라진다). */
.draws-wrap { container-type: inline-size; }
.draws { width: 100%; min-width: 0; }
.draws .r { text-align: right; }
.draw-cell { white-space: nowrap; line-height: 1.35; }
.draw-cell a { display: block; font-weight: 700; text-decoration: none; }
.draw-cell .when {
  display: block; font-size: .78rem; color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.prize-cell { text-align: right; white-space: nowrap; line-height: 1.35; }
/* 금액을 3px 내린다 (2026-08-11 사용자 결정 — 0/3/6px 을 렌더링해 비교한 뒤 3px).
   회차 번호와 픽셀 단위로는 원래 같은 높이였는데도 금액이 위로 떠 보였다 — 금액은 검정,
   회차는 청록 링크라 무게가 다르고, 아래 붙는 글(추첨일 vs "11명")의 길이도 달라서다.
   그 착시를 상쇄하려고 내린 것이므로 **정렬을 맞추려고 되돌리지 말 것.** */
.prize-cell b {
  display: block; padding-top: 3px;
  font-weight: 700; font-variant-numeric: tabular-nums;
}
.prize-cell .who { display: block; font-size: .78rem; color: var(--text-dim); }
/* 본번호와 보너스를 눈으로 가르는 기호. 낭독기에는 숨긴다(공 안에 라벨이 있다). */
.mini-plus { color: var(--text-faint); font-weight: 800; padding: 0 3px; font-size: .8rem; }

@container (max-width: 560px) {
  .draws thead { display: none; }
  .draws, .draws tbody, .draws tr, .draws td { display: block; width: auto; }
  .draws tr {
    display: grid; grid-template-columns: auto 1fr;
    /* 당첨금·당첨자 수는 **맨 윗줄 오른쪽**. baseline 정렬은 두 줄짜리 왼쪽 칸과
       어긋나 보이므로 start 로 고정한다. */
    align-items: start;
    gap: 0 12px;
    padding: 14px 2px; border-bottom: 1px solid var(--border);
  }
  .draws td { border: 0; padding: 0; }
  .draws .draw-cell { grid-column: 1; grid-row: 1; }
  .draws .prize-cell { grid-column: 2; grid-row: 1; justify-self: end; }
  .draws .balls-cell { grid-column: 1 / -1; grid-row: 2; margin-top: 10px; }

  /* 33px × 7 + 여백 ≈ 276px — 328px 안에 여유 있게 들어간다. */
  .draws .mini { width: 33px; height: 33px; font-size: .92rem; }
  .draws .mini-balls { gap: 5px; }
  .draws .mini-plus { font-size: .95rem; padding: 0 4px; }
}

/* ── 전 회차 색인 ─────────────────────────────── */
/* 1,200개가 넘는 링크가 깔리므로 밀도가 전부다. 숫자만 두고 폭을 고정해
   눈이 격자로 읽히게 한다. 손가락 기준(최소 32px)은 지킨다. */
.year { margin: 20px 0; }
.year h3 { font-size: .95rem; margin: 0 0 8px; color: var(--text-dim); }
.draw-links { display: flex; flex-wrap: wrap; gap: 4px; }
.draw-links a {
  min-width: 46px; min-height: 32px; padding: 6px 4px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); text-decoration: none;
  font-size: .8rem; font-variant-numeric: tabular-nums;
}
.draw-links a:hover, .draw-links a:focus { border-color: var(--brand); color: var(--brand); }

/* ── 출현 횟수 표(막대 포함) ──────────────────── */
/* 차트가 아니라 "막대가 붙은 표"다. 모든 행이 번호와 횟수를 직접 표기하므로
   색만으로 식별하지 않는다(볼 관례색의 CVD 한계에 대한 2차 인코딩). */
.freq { width: 100%; border-collapse: collapse; font-size: .9rem; }
.freq th { font-size: .8rem; }
.freq td { padding: 5px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.freq td.n { width: 44px; }
.freq td.c { width: 62px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-dim); }
.bar-cell { position: relative; }
.bar-track { background: var(--surface-2); border-radius: 4px; height: 15px; position: relative; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; }
.bar-fill.y { background: #e5a000; }
.bar-fill.b { background: #1f6fd0; }
.bar-fill.r { background: #d13c3c; }
.bar-fill.g { background: #5a636e; }
.bar-fill.n { background: #2f9e63; }
/* 이론상 기대 평균 기준선 — "다들 이 근처"가 눈에 보이게 한다. */
.bar-mean { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); opacity: .55; }
/* ⚠️ flex 로 두지 말 것. 문장 안의 <b> 하나하나가 flex 항목이 되어 **글이 칸으로 쪼개진다**
   (2026-08-12 번호 생성기 렌더링에서 발견 — 연금복권 안내문도 같은 증상이었다).
   기대선 설명의 색 표식은 inline-block 으로 줄 안에 세운다. */
.mean-note { font-size: .82rem; color: var(--text-dim); margin: 10px 0 0; }
.mean-swatch { width: 2px; height: 12px; background: var(--text); opacity: .55;
  display: inline-block; vertical-align: -1px; margin-right: 7px; }

/* ── 이번 회차 배출점 ─────────────────────────── */
/* 상호 아래에 주소를 붙인다. 주소는 길어서 한 줄에 같이 두면 표가 무너진다.
*/
.shop-table td { vertical-align: top; }
.shop-table .where { display: block; font-size: .8rem; color: var(--text-dim); margin-top: 2px; }
.method {
  display: inline-block; font-size: .78rem; color: var(--text-dim);
  background: var(--surface-2); border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
/* 자동·수동·반자동을 색으로도 구분한다(2026-08-11 사용자 요청).
   **색은 거들 뿐이다** — 배지 안에 낱말이 그대로 적혀 있으므로 색을 구별 못 해도
   잃는 정보가 없다(P7). 그래서 색맹 대비 검증이 아니라 대비율만 맞추면 된다.
   값을 모르면 색 없는 기본 배지로 둔다. */
.m-auto   { background: #e7f0fb; color: #17548f; }
.m-manual { background: #e6f4ec; color: #1a6b43; }
.m-semi   { background: #fbf0dc; color: #7a5000; }
@media (prefers-color-scheme: dark) {
  .m-auto   { background: #16273a; color: #8dbdf0; }
  .m-manual { background: #12291d; color: #74c79a; }
  .m-semi   { background: #322512; color: #e0b163; }
}
h2 .count, summary .count { font-size: .82rem; font-weight: 600; color: var(--text-dim); margin-left: 6px; }

/* 2등은 회당 70~90곳이라 지역별로 접는다. 펼치는 부분은 손가락 크기(최소 44px)를 지킨다. */
.region { border: 1px solid var(--border); border-radius: var(--r-md); margin: 0 0 8px; background: var(--surface); }
.region summary {
  cursor: pointer; padding: 13px 15px; font-weight: 700; min-height: 44px;
  display: flex; align-items: center;
}
.region[open] summary { border-bottom: 1px solid var(--border); }
.region .shops { margin: 0; padding: 10px 15px 14px; list-style: none; }
.region .shops li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .93rem; }
.region .shops li:last-child { border-bottom: 0; }
.region .shops .where { color: var(--text-dim); font-size: .82rem; margin-left: 6px; }

/* ── 연금복권 번호 ────────────────────────────── */
/* 로또처럼 공으로 그리지 않는다 — 연금복권은 **자리(순서)가 의미**다.
   등위가 "뒤에서 몇 자리 일치"로 갈리므로, 자리를 칸으로 끊어 두면
   표에서 등위별 당첨번호를 나란히 놓았을 때 규칙이 눈에 보인다. */
.pn { display: inline-flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.pn-group {
  font-weight: 800; font-size: .9rem; color: var(--brand);
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  border-radius: var(--r-sm); padding: 4px 8px; margin-right: 3px; white-space: nowrap;
}
.pn-d {
  min-width: 30px; text-align: center;
  font-weight: 700; font-size: 1.06rem; font-variant-numeric: tabular-nums;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 5px 0;
}
/* 등위별 표에서 "여기까지 맞아야 한다"를 표시하는 칸. 색만으로 알리지 않도록
   같은 줄의 등위 이름(3등 등)이 뜻을 지고 있다. */
.pn-d.on { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-ink); }
.hero .pn-d { min-width: 38px; font-size: 1.3rem; padding: 7px 0; }
/* 표 안에서는 칸을 그리지 않는다 — 여덟 줄이 전부 칸이면 표가 화면 밖으로 나간다. */
.pn.compact { gap: 0; }
.pn.compact .pn-d {
  min-width: 0; background: none; border: 0; padding: 0;
  font-size: .98rem; letter-spacing: .04em;
}
.pn.compact .pn-d.on { background: none; color: var(--brand-ink); font-weight: 800; }
.pn.compact .pn-group { font-size: .78rem; padding: 2px 6px; margin-right: 5px; }
@container (max-width: 400px) {
  .pn-d { min-width: 24px; font-size: .95rem; }
  .pn-group { font-size: .8rem; padding: 3px 6px; }
}

/* ── 번호 생성기 ──────────────────────────────── */
.gen { margin: 0 0 24px; }
.gen-row { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; flex-wrap: wrap; }
.gen-label { font-weight: 700; font-size: .93rem; }
.gen-hint { font-size: .82rem; color: var(--text-dim); }
.sw { border-radius: 4px; padding: 1px 6px; font-weight: 700; }
.sw.fix { background: var(--brand-soft); color: var(--brand-ink); }
.sw.ex  { background: #fbe3e3; color: #8f2020; }

/* 게임 수 — 손가락 기준 44px 를 지킨다. */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; }
.seg button {
  min-width: 44px; min-height: 40px; border: 0; background: var(--bg);
  color: var(--text-dim); font: inherit; font-weight: 700; cursor: pointer;
  border-right: 1px solid var(--border);
}
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--brand); color: #fff; }

/* 번호판 45칸. 한 줄에 여러 개가 들어가되 손가락으로 누를 수 있어야 한다. */
.pad { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; margin: 0 0 18px; }
.pad-n {
  min-height: 44px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--bg); color: var(--text); font: inherit; font-weight: 600;
  font-variant-numeric: tabular-nums; cursor: pointer;
}
/* 상태는 색만으로 알리지 않는다 — 테두리 굵기와 굵은 글씨가 함께 바뀐다(P7). */
.pad-n.fix { background: var(--brand-soft); border: 2px solid var(--brand); color: var(--brand-ink); font-weight: 800; }
.pad-n.ex  { background: var(--surface-2); border: 2px dashed var(--border-strong); color: var(--text-faint);
             text-decoration: line-through; }

.gen-go {
  width: 100%; min-height: 52px; border: 0; border-radius: var(--r-md);
  background: var(--brand); color: #fff; font: inherit; font-size: 1.05rem; font-weight: 800;
  cursor: pointer;
}
.gen-go:hover { background: var(--brand-ink); }
.gen-save {
  width: 100%; min-height: 46px; margin-top: 12px;
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--bg); color: var(--text); font: inherit; font-weight: 700; cursor: pointer;
}
.gen-save:hover { border-color: var(--brand); color: var(--brand); }
.gen-msg { font-size: .88rem; color: var(--text-dim); margin: 12px 0 0; min-height: 1.2em; }
.gen-msg.bad { color: #b3261e; font-weight: 700; }

.gen-list { list-style: none; margin: 14px 0 0; padding: 0; }
.gen-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border);
}
.gen-list li:last-child { border-bottom: 0; }
.gen-tag {
  width: 24px; height: 24px; flex: none; border-radius: 50%;
  background: var(--surface-2); color: var(--text-dim);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 800;
}

/* 홈에서 다른 화면으로 가는 줄. 두 개가 붙어 있으면 한 줄로 읽혀 못 누른다. */
.home-links { display: flex; flex-direction: column; gap: 8px; }

/* ── 코드 블록 ────────────────────────────────── */
pre.code {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 14px 16px; overflow-x: auto;
  font-size: .85rem; line-height: 1.6; margin: 0 0 18px;
}
pre.code code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em; background: var(--surface-2);
  padding: 1px 5px; border-radius: 4px;
}
pre.code code { background: none; padding: 0; }

/* ── 안내 박스 ────────────────────────────────── */
.notice {
  background: var(--brand-soft); border: 1px solid var(--brand-line);
  border-radius: var(--r-md); padding: 15px 17px; margin: 0 0 22px; font-size: .93rem;
}
.notice strong { display: block; margin-bottom: 4px; color: var(--brand-ink); }
/* 앱 설치 안내. 당첨번호 바로 아래에 놓이므로 **내용을 가리지 않을 만큼만** 강조한다 —
   여기서 더 키우면 우리가 비판해 온 "받으세요" 배너가 된다. */
.cta { margin-top: -6px; }
.cta a {
  display: inline-flex; align-items: center; min-height: 44px;
  font-weight: 700; text-decoration: none;
}
.cta a:hover { text-decoration: underline; }

.sample-banner {
  background: var(--warn-bg); border: 2px solid var(--warn-line);
  border-radius: var(--r-md); padding: 14px 16px; margin: 0 0 20px; font-size: .94rem;
}

.honesty {
  border-left: 3px solid var(--brand); background: var(--surface);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  padding: 12px 16px; color: var(--text-dim); font-size: .9rem; margin: 24px 0;
}

/* ── 페이저 ───────────────────────────────────── */
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.pager a {
  text-decoration: none; font-size: .9rem; font-weight: 600;
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 7px 15px;
  color: var(--text);
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }

/* ── 푸터 ─────────────────────────────────────── */
footer.site {
  border-top: 1px solid var(--border); background: var(--surface);
  color: var(--text-dim); font-size: .85rem; padding: 26px 0 44px;
}
footer.site a { color: var(--text-dim); }
footer.site .disclaimer { margin-top: 10px; font-size: .81rem; line-height: 1.65; }

ul.plain { padding-left: 20px; }
ul.plain li { margin-bottom: 6px; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 12px; top: 12px; z-index: 40; background: var(--bg);
  padding: 10px 15px; border: 2px solid var(--brand); border-radius: var(--r-sm);
}

@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  h1 { font-size: 1.45rem; }
  .hero { padding: 20px 17px 18px; }
  .hero h1 { font-size: 1.5rem; }
  .ball { width: 40px; height: 40px; font-size: .98rem; }
  .balls { gap: 7px; }

  /* 표는 가로로 스크롤한다. 공을 조금 줄여 한 화면에 더 들어오게 한다. */
  table { font-size: .88rem; }
  th, td { padding: 8px 6px; }
  .mini { width: 24px; height: 24px; font-size: .72rem; }
  .mini-balls { gap: 3px; }
}

@media (prefers-reduced-motion: no-preference) {
  nav.site a, .pager a { transition: color .15s ease, border-color .15s ease; }
}