/* 로또 섹션 전용 스타일 (기본 팔레트는 style.css의 변수 사용) */
:root {
  --ball-1: #fbc400;  /* 1-10 */
  --ball-2: #69c8f2;  /* 11-20 */
  --ball-3: #ff7272;  /* 21-30 */
  --ball-4: #aab2bd;  /* 31-40 */
  --ball-5: #b0d840;  /* 41-45 */
}

/* ── 로또 서브 내비 ── */
.lotto-subnav {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding-top: 14px; padding-bottom: 2px;
}
.lotto-subnav::-webkit-scrollbar { display: none; }
.lotto-subnav a {
  padding: 7px 14px; border-radius: 999px; white-space: nowrap;
  font-size: .88rem; font-weight: 700; color: var(--ink-soft);
  border: 1px solid var(--line); background: #fff;
}
.lotto-subnav a:hover { border-color: var(--plum); color: var(--plum); text-decoration: none; }
.lotto-subnav a.active { background: var(--plum); border-color: var(--plum); color: #fff; }

/* ── 카드/버튼 ── */
.lcard {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.lcard h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 14px; }
.lbtn {
  display: inline-block; background: var(--plum); color: #fff; border: none; cursor: pointer;
  padding: 12px 22px; border-radius: 10px; font-size: 1rem; font-weight: 700; font-family: inherit;
}
.lbtn:hover { background: var(--plum-dark); }
.lbtn.ghost { background: #fff; color: var(--ink-soft); border: 1.5px solid var(--line); }
.lbtn.ghost:hover { border-color: var(--plum); color: var(--plum); }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

.field-label { display: block; font-weight: 700; font-size: .9rem; margin: 14px 0 6px; }
.lcard input[type="text"], .lcard input[type="number"], .lcard select {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 1rem; font-family: inherit; background: #fff; color: var(--ink);
}
.lcard input:focus, .lcard select:focus { outline: none; border-color: var(--plum); }

/* ── 로또 볼 ── */
.balls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ball {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  font-weight: 800; font-size: 1.05rem; color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  box-shadow: inset -3px -4px 6px rgba(0, 0, 0, .18), inset 2px 3px 5px rgba(255, 255, 255, .35), 0 2px 4px rgba(45, 34, 38, .15);
}
.ball.sm { width: 30px; height: 30px; font-size: .82rem; }
.ball.g1 { background: var(--ball-1); }
.ball.g2 { background: var(--ball-2); }
.ball.g3 { background: var(--ball-3); }
.ball.g4 { background: var(--ball-4); }
.ball.g5 { background: var(--ball-5); }
.ball-plus { color: var(--ink-faint); font-weight: 700; margin: 0 2px; }

/* ── 최신 회차 카드 ── */
.draw-hero { text-align: center; padding: 28px 22px; }
.draw-hero .draw-no { font-size: 1.3rem; font-weight: 800; }
.draw-hero .draw-no em { font-style: normal; color: var(--plum); }
.draw-hero .draw-date { color: var(--ink-faint); font-size: .9rem; margin-bottom: 16px; }
.draw-hero .balls { justify-content: center; margin-bottom: 16px; }
.draw-hero .prize-line { font-size: .95rem; color: var(--ink-soft); }
.draw-hero .prize-line b { color: var(--ink); }

/* ── 세그먼트 ── */
.seg { display: inline-flex; background: #f3e9ec; border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button {
  border: none; background: transparent; padding: 8px 14px; border-radius: 8px;
  font-family: inherit; font-size: .88rem; font-weight: 600; color: var(--ink-soft); cursor: pointer;
}
.seg button.on { background: #fff; color: var(--plum); box-shadow: 0 1px 3px rgba(45, 34, 38, .12); }

/* ── 통계 바 ── */
.freq-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; }
.freq-row { display: flex; align-items: center; gap: 8px; font-size: .82rem; }
.freq-row .fnum { width: 22px; text-align: right; font-weight: 700; color: var(--ink-soft); flex-shrink: 0; }
.freq-row .fbar-wrap { flex: 1; background: #f3e9ec; border-radius: 4px; height: 14px; overflow: hidden; }
.freq-row .fbar { height: 100%; border-radius: 4px; min-width: 2px; }
.freq-row .fcnt { width: 30px; font-size: .78rem; color: var(--ink-faint); flex-shrink: 0; }

.stat-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.mini-table th, .mini-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.mini-table th { color: var(--ink-faint); font-size: .8rem; font-weight: 700; }
.mini-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ── 히스토리 ── */
.history-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.history-table th, .history-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: middle; }
.history-table th { color: var(--ink-faint); font-size: .8rem; }
.history-table .balls { justify-content: center; flex-wrap: nowrap; gap: 4px; }
.pager { display: flex; gap: 6px; justify-content: center; margin: 18px 0; flex-wrap: wrap; }
.pager button {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 12px;
  font-family: inherit; font-size: .85rem; cursor: pointer; color: var(--ink-soft);
}
.pager button.on { background: var(--plum); color: #fff; border-color: var(--plum); font-weight: 700; }

/* ── 생성기 ── */
.gen-result { margin-top: 18px; }
.gen-game {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; background: #fff;
}
.gen-game .game-label { font-weight: 800; color: var(--ink-faint); width: 20px; }
.chip-box { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px;
  font-size: .82rem; font-family: inherit; cursor: pointer; color: var(--ink-soft);
}
.chip.fixed { background: var(--good-bg); border-color: var(--good); color: var(--good); font-weight: 700; }
.chip.excluded { background: var(--plum-bg); border-color: var(--plum); color: var(--plum); font-weight: 700; text-decoration: line-through; }

/* ── 안내 ── */
.lotto-notice {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
  padding: 14px 16px; font-size: .86rem; color: #78716c; margin: 20px 0;
}
.lotto-notice b { color: #57534e; }

@media (max-width: 600px) {
  .ball { width: 38px; height: 38px; font-size: .95rem; }
  .history-table .hide-m { display: none; }
}
