/* ─────────────────────────────────────────────────────────────
     dreambaku.com 홈 시안 v1
     기준: ~/Documents/애플디자인.md (§1 다크 역전 · §2 시스템 스택 · §3 4px 그리드 · §5 모션)
     골격: Rollbit(좌측 고정 사이드바 3열 + 상단 카운트다운 + 라이브 티커)
     ⛔가져오지 않은 것: 네온·잭팟 카운터·룻박스·「누가 얼마 당첨」 티커
     단일 다크 테마로 확정 — 뷰어 테마와 무관하게 같은 화면을 보여준다.
     ───────────────────────────────────────────────────────────── */
  :root {
    --ground: #000000;
    --surface: #1d1d1f;
    --surface-2: #161617;
    --text: #f5f5f7;
    --muted: #86868b;
    --hairline: #2c2c2e;
    --accent: #0071e3;
    --accent-dim: rgba(0, 113, 227, 0.16);

    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Apple SD Gothic Neo",
      "Pretendard", "Noto Sans KR", Helvetica, Arial, sans-serif;

    --rail: 240px;
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
  }

  * { box-sizing: border-box; }

  body {
    margin: 0;
    background: var(--ground);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
  }

  a { color: var(--accent); text-decoration: none; }
  a:focus-visible,
  button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

  /* ── 상단바 (44px, 애플 기준 §3) ───────────────────────────── */
  .topbar {
    position: sticky; top: 0; z-index: 20;
    height: 44px;
    display: flex; align-items: center; gap: 16px;
    padding: 0 20px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--hairline);
  }
  .wordmark { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
  .wordmark span { color: var(--muted); font-weight: 400; }
  .draft-chip {
    font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
    color: var(--muted); border: 1px solid var(--hairline);
    padding: 2px 8px; border-radius: 980px;
  }
  .countdown {
    margin-left: auto;
    display: flex; align-items: baseline; gap: 8px;
    font-size: 13px; color: var(--muted);
  }
  .countdown b {
    font-weight: 600; font-size: 14px; color: var(--text);
    font-variant-numeric: tabular-nums;
  }

  /* ── 3열 골격 ─────────────────────────────────────────────── */
  .shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); }

  .rail {
    border-right: 1px solid var(--hairline);
    padding: 24px 12px 48px;
    position: sticky; top: 44px; align-self: start;
    height: calc(100vh - 44px); overflow-y: auto;
  }
  .rail-group + .rail-group { margin-top: 24px; }
  .rail-label {
    font-size: 11px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase;
    color: var(--muted); padding: 0 12px; margin-bottom: 8px;
  }
  .rail-nav { display: flex; flex-direction: column; gap: 2px; }
  .rail-nav a {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 12px; border-radius: 10px;
    color: var(--text); font-size: 15px;
    transition: background 200ms var(--ease);
  }
  .rail-nav a:hover { background: var(--surface); }
  .rail-nav a[aria-current="page"] { background: var(--surface); font-weight: 600; }
  .rail-nav .tag { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

  main { padding: 40px 32px 96px; }
  .wrap { max-width: 1024px; margin: 0 auto; }
  .section + .section { margin-top: 72px; }

  .eyebrow {
    font-size: 11px; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase;
    color: var(--muted); margin: 0 0 12px;
  }
  h1, h2, h3 { text-wrap: balance; margin: 0; }
  h1 { font-size: 44px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; }
  h2 { font-size: 32px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; }
  h3 { font-size: 20px; font-weight: 600; line-height: 1.3; }
  .lead { font-size: 19px; color: var(--muted); margin: 12px 0 0; max-width: 62ch; }

  /* ── 히어로: 오늘 맥이가 먹은 꿈 한 문장 ────────────────────── */
  .hero {
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 40px; align-items: center;
  }
  .dream-line {
    font-size: 30px; font-weight: 600; letter-spacing: -0.012em; line-height: 1.35;
    margin: 0;
  }
  .dream-line em { font-style: normal; color: var(--accent); }
  .dream-meta { margin-top: 16px; color: var(--muted); font-size: 15px; }

  .stack { display: flex; flex-direction: column; gap: 16px; }

  .pick-card {
    background: var(--surface); border-radius: 18px; padding: 28px;
  }
  /* 공식 당첨번호는 맥이의 번호와 «다른 종류»임이 한눈에 보여야 한다.
     같은 볼로 나란히 놓으면 우리 번호가 당첨번호처럼 읽힌다. */
  .win-card {
    background: none; border: 1px solid var(--hairline);
    border-radius: 18px; padding: 24px 28px;
  }
  .ball.win { background: none; border-color: var(--muted); }
  .ball.bonus { background: none; border-style: dashed; border-color: var(--muted); }
  .plus { align-self: center; color: var(--muted); font-size: 16px; }
  .pick-note.src { font-size: 13px; }
  .pick-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    padding-bottom: 16px; border-bottom: 1px solid var(--hairline);
  }
  .pick-head .no { font-size: 15px; font-weight: 600; }
  .pick-head .when { font-size: 13px; color: var(--muted); }
  .balls { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; }
  .ball {
    width: 46px; height: 46px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--surface-2); border: 1px solid var(--hairline);
    font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums;
  }
  .pick-note { margin: 20px 0 0; font-size: 14px; color: var(--muted); line-height: 1.6; }
  .pick-note strong { color: var(--text); font-weight: 600; }

  /* ── 티커: 맥이가 먹는 꿈 (사람·금액 없음) ──────────────────── */
  .ticker {
    /* ⚠️.section + .section 규칙이 여기서 끊기므로 아래 간격을 직접 준다 */
    margin: 40px 0 72px;
    border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
    padding: 14px 0; overflow: hidden;
    display: flex; align-items: center; gap: 20px;
  }
  .ticker-label {
    flex: none; font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--muted); padding-left: 2px; white-space: nowrap;
  }
  /* 오른쪽 끝만 흐린다 — 양쪽을 흐리면 첫 칩이 잘려 라벨 옆에 잔상처럼 보인다 */
  .ticker-track { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 64px), transparent); }
  .ticker-run {
    display: flex; gap: 10px; width: max-content;
    animation: drift 48s linear infinite;
  }
  .ticker-run span {
    flex: none; padding: 6px 14px; border-radius: 980px;
    background: var(--surface); font-size: 14px; color: var(--text);
  }
  @keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
  @media (prefers-reduced-motion: reduce) {
    .ticker-run { animation: none; flex-wrap: wrap; width: 100%; }
  }

  /* ── 성적표 ──────────────────────────────────────────────── */
  .scoreboard { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
  .table-scroll { overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; font-size: 15px; }
  caption { text-align: left; color: var(--muted); font-size: 13px; padding-bottom: 12px; }
  th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
  thead th {
    background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--muted);
    position: sticky; top: 44px;
  }
  td.no, td.nums { font-variant-numeric: tabular-nums; }
  .hit { color: var(--accent); font-weight: 600; }
  .rank {
    display: inline-block; min-width: 46px; text-align: center;
    font-size: 13px; padding: 2px 8px; border-radius: 980px;
    color: var(--muted); border: 1px solid var(--hairline);
  }
  .rank.win { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }

  .tally { background: var(--surface); border-radius: 18px; padding: 24px; }
  .tally dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 16px 0 0; }
  .tally dt { color: var(--muted); font-size: 15px; }
  .tally dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
  .tally .math {
    margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--hairline);
    font-size: 14px; color: var(--muted); line-height: 1.6;
  }
  .tally .math b { color: var(--text); font-weight: 600; }

  /* ── 오해 차단 한 줄 (용어 카드마다 동반) ───────────────────── */
  .terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
  .term { background: var(--surface); border-radius: 18px; padding: 20px 22px; }
  .term h3 { font-size: 17px; }
  .term p { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
  .term .guard {
    margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hairline);
    font-size: 14px; color: var(--text);
  }

  /* ── 사전 칩 ─────────────────────────────────────────────── */
  .chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; padding: 0; list-style: none; }
  .chips a {
    display: block; padding: 8px 16px; border-radius: 980px;
    background: var(--surface); color: var(--text); font-size: 16px;
    transition: background 200ms var(--ease);
  }
  .chips a:hover { background: #2a2a2c; }

  .btn {
    display: inline-block; border-radius: 980px; padding: 12px 22px;
    background: var(--accent); color: #fff; font-size: 17px;
  }
  .btn.ghost { background: none; color: var(--accent); padding-left: 0; }

  footer {
    margin-top: 96px; padding-top: 32px; border-top: 1px solid var(--hairline);
    color: var(--muted); font-size: 14px;
  }
  .disclaimer { color: var(--text); font-size: 15px; margin: 0 0 12px; }

  @media (max-width: 900px) {
    .shell { grid-template-columns: 1fr; }
    .rail { display: none; }
    main { padding: 32px 20px 72px; }
    .hero, .scoreboard { grid-template-columns: 1fr; gap: 28px; }
    h1 { font-size: 34px; }
    h2 { font-size: 26px; }
    .dream-line { font-size: 24px; }
    thead th { position: static; }
  }

/* ── 생성기 추가분 ─────────────────────────────────────────── */
.stale-banner {
  background: #3a2a00; color: #ffd479; border-bottom: 1px solid #5a4200;
  padding: 10px 20px; font-size: 14px;
}
a.wordmark { color: var(--text); }
.basis { margin-top: 20px; font-size: 13px; color: var(--muted); }
td.kw { color: var(--muted); }
td.nums b { color: var(--accent); font-weight: 600; }
td.hit { color: var(--text); font-weight: 600; }
td.miss { color: var(--muted); }

/* 기사 본문 */
.article h1 { font-size: 36px; margin-bottom: 8px; }
.article h2 { margin-top: 48px; }
.article h3 { margin-top: 32px; }
.article p { max-width: 68ch; }
.article ul { max-width: 68ch; padding-left: 20px; }
.article li { margin: 6px 0; }
.article hr { border: 0; border-top: 1px solid var(--hairline); margin: 40px 0; }
.article pre {
  background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 12px;
  padding: 20px; overflow-x: auto; font-size: 13px; line-height: 1.6;
}
.article code { font-size: 0.92em; }
.article table { margin: 20px 0; }

/* 히어로 카드는 폭이 좁다 — 6볼 + 보너스가 한 줄에 들어가도록 줄인다
   (보너스 볼만 다음 줄로 떨어지면 별개 정보처럼 읽힌다). */
.hero .balls { gap: 8px; }
.hero .ball { width: 40px; height: 40px; font-size: 15px; }
.hero .plus { font-size: 14px; }

@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; }
  .scoreboard { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: 1fr; }
  .rail { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--hairline); }
  main { padding: 24px 16px 64px; }
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  .dream-line { font-size: 24px; }
}

/* ── 가로 스크롤 차단 ────────────────────────────────────────
   grid·flex 자식의 기본 min-width:auto가 «내용의 최소 폭»으로 늘어난다.
   성적표 표는 white-space:nowrap, 티커는 width:max-content라 그 최소 폭이
   뷰포트보다 넓다 → 페이지 전체가 밀려 가로 스크롤이 생긴다(390px 실측).
   overflow-x:auto는 min-width를 0으로 눌러야 제 컨테이너 안에서 동작한다. */
.shell > main { min-width: 0; }
.scoreboard > * { min-width: 0; }
.table-scroll { min-width: 0; }
.ticker-track { min-width: 0; }
.dream-line, .lead, .pick-note, footer p { overflow-wrap: anywhere; }

@media (max-width: 520px) {
  .cd-label { display: none; }       /* 숫자만 남긴다 — 라벨이 두 줄로 접혔다 */
  .topbar { gap: 10px; padding: 0 14px; }
  .wordmark { font-size: 14px; }
  .wordmark span { display: none; }
}

/* ── 앱 CTA 밴드 ─────────────────────────────────────────── */
.cta-band {
  background: var(--surface); border-radius: 18px; padding: 32px;
}
.cta-band h3 { font-size: 22px; }
.cta-band > p { color: var(--muted); margin: 10px 0 0; max-width: 60ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.cta-free { font-size: 14px; }
.cta-free b { color: var(--text); }

/* ── 좁은 화면의 성적표 ───────────────────────────────────
   표는 5열 nowrap이라 좁은 화면에서 오른쪽 열(결과)이 컨테이너 안에서 잘린다.
   가로 스크롤은 되지만 «잘린 것»으로 읽힌다 → 모바일에서는 열을 줄여 다 보이게 한다.
   숨기는 열은 「맥이의 물상」 하나뿐 — 회차·번호·일치·결과가 성적표의 본체다. */
@media (max-width: 640px) {
  table th:nth-child(2), table td:nth-child(2) { display: none; }
  th, td { padding: 10px 8px; white-space: normal; }
  td.nums { word-spacing: 2px; }
  caption { font-size: 12px; }
}
/* 그래도 넘칠 때를 위한 스크롤 힌트 — 오른쪽 끝을 살짝 흐려 «더 있다»를 알린다 */
.table-scroll {
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 24px), transparent);
}
@supports not (mask-image: linear-gradient(90deg, #000, #000)) {
  .table-scroll { mask-image: none; }
}

/* ── 회차당 다조합 ───────────────────────────────────────── */
tr.expand td { padding: 0 12px 12px; border-bottom: 1px solid var(--hairline); }
details summary {
  cursor: pointer; color: var(--muted); font-size: 13px; padding: 8px 0;
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "▸ "; }
details[open] summary::before { content: "▾ "; }
table.inner { font-size: 13px; margin-top: 4px; }
table.inner th, table.inner td { padding: 7px 10px; }
.bonus-inline { color: var(--muted); }

.all-picks { margin-top: 16px; }
.pick-list { list-style: none; margin: 12px 0 0; padding: 0; font-size: 13px; }
.pick-list li {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px; align-items: baseline;
  padding: 7px 0; border-top: 1px solid var(--hairline);
}
.pick-list .slot { color: var(--muted); font-variant-numeric: tabular-nums; }
.pick-list .kw { color: var(--muted); }
.pick-list .nums { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 520px) {
  .pick-list li { grid-template-columns: 20px minmax(0, 1fr); }
  .pick-list .nums { grid-column: 1 / -1; color: var(--text); }
}

/* ── 출처 구분 (소급 검증 vs 사전 공개) ─────────────────────
   이 사이트에서 가장 조심해야 할 문단이라 시각적으로도 분리한다. */
.provenance {
  margin-top: 20px; padding: 16px 20px;
  border-left: 2px solid var(--accent); background: var(--surface-2);
  border-radius: 0 12px 12px 0;
}
.provenance p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; max-width: 68ch; }
.provenance p + p { margin-top: 8px; }
.provenance b { color: var(--text); }

/* ── 자사 배너 (olo.house 단방향 업셀) ─────────────────────── */
.promo {
  margin: 72px 0 0; padding: 32px;
  border: 1px solid var(--hairline); border-radius: 18px;
  background: linear-gradient(180deg, var(--surface-2), var(--ground));
}
.promo-eyebrow {
  margin: 0 0 10px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted);
}
.promo h3 { font-size: 22px; letter-spacing: -0.01em; }
.promo p { color: var(--muted); margin: 10px 0 0; max-width: 60ch; }
.promo-items { font-size: 14px; }
.promo .btn { margin-top: 18px; }

/* ── 유료 광고 자리 ───────────────────────────────────────
   「광고」 라벨은 뗄 수 없다(표시광고법). 본문과 확실히 구분되게 둔다. */
.ads { margin: 72px 0 0; display: grid; gap: 12px; }
.ad-card {
  display: block; padding: 20px 24px; border-radius: 14px;
  border: 1px dashed var(--hairline); background: var(--surface-2);
  color: var(--text);
}
.ad-label {
  display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: 0.14em;
  color: var(--muted); border: 1px solid var(--hairline);
  padding: 1px 7px; border-radius: 980px; margin-bottom: 10px;
}
.ad-title { display: block; font-size: 17px; font-weight: 600; }
.ad-body { display: block; color: var(--muted); font-size: 14px; margin-top: 6px; }
.ad-adv { display: block; color: var(--muted); font-size: 12px; margin-top: 10px; }

/* ── 꿈 사전 ─────────────────────────────────────────────── */
.cats { margin-top: 28px; }
.cat + .cat { margin-top: 36px; }
.cat h3 { font-size: 17px; display: flex; align-items: baseline; gap: 8px; }
.cat-n { font-size: 12px; color: var(--muted); font-weight: 400; }
.word-grid {
  list-style: none; margin: 14px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px;
}
.word-grid li { min-width: 0; }
.word-grid a {
  display: flex; align-items: baseline; gap: 6px;
  padding: 9px 12px; border-radius: 10px; background: var(--surface);
  color: var(--text); font-size: 15px;
  transition: background 200ms var(--ease);
}
.word-grid a:hover { background: var(--hairline); }
.has-note {
  font-size: 10px; color: var(--accent); border: 1px solid var(--accent-dim);
  padding: 0 5px; border-radius: 980px;
}
.pending { color: var(--muted); }
