@font-face { font-family: "Pretendard"; font-weight: 45 920; font-display: swap; src: url(pretendard.woff2?v=41b1ffe16f) format("woff2"); }
/* Layout: single calm column of cards; colour lives only in the balls and one accent. Shared by every page. */
:root {
  --bg: #f2f4f6;
  --surface: #ffffff;
  --ink: #191f28;
  --muted: #6b7684;
  --rule: #e5e8eb;
  --bar: #d1d6db;
  --reel-bg: #e8ecf0;
  --accent: #2f6bff;
  --accent-soft: #edf3ff;
  --on-accent: #ffffff;
  --ball-1: #f5b800; --ball-2: #3fa9e0; --ball-3: #f25c5c; --ball-4: #8f98a3; --ball-5: #6cc04a;
  --ball-text: #ffffff;
  --font: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --tracking: -0.02em;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f1216; --surface: #191d23; --ink: #eef1f4; --muted: #8f99a6; --rule: #262b33; --bar: #3a414b; --reel-bg: #262c34;
  --accent: #5b8cff; --accent-soft: #1b2540; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0f1216; --surface: #191d23; --ink: #eef1f4; --muted: #8f99a6; --rule: #262b33; --bar: #3a414b; --reel-bg: #262c34;
  --accent: #5b8cff; --accent-soft: #1b2540; color-scheme: dark; }

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.6;
  letter-spacing: var(--tracking); -webkit-font-smoothing: antialiased;
  word-break: keep-all; overflow-wrap: break-word; }  /* Korean wraps between words, never mid-word */
button, input, output, table { font: inherit; letter-spacing: inherit; }
.wrap { max-width: 880px; margin: 0 auto; padding-block: 40px 72px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; gap: 20px; }
h1, h2 { font-weight: 800; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); line-height: 1.2; }
h2 { font-size: 1.25rem; font-weight: 700; }
p { margin: 0; }
.lede { color: var(--muted); max-width: 60ch; }
.eyebrow { font-size: .85rem; font-weight: 600; color: var(--muted); }
.mono, .num { font-variant-numeric: tabular-nums; }
header { display: grid; gap: 10px; padding-block: 8px 20px; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.seg.raised { background: var(--rule); }
.card { background: var(--surface); border-radius: var(--radius); padding: 24px; display: grid; gap: 18px; min-width: 0; }
.sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }

/* Latest draw */
.latest { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 8px;
  background: var(--surface); border-radius: var(--radius); padding: 16px 20px; }
.balls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ball { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: .95rem; letter-spacing: 0; color: var(--ball-text); background: var(--c);
  font-variant-numeric: tabular-nums; transition: background-color .35s ease-out, color .35s ease-out; }
/* While rolling, the ball stays a quiet blank and only the digits scroll; colour arrives on landing */
.ball.reel { background: var(--reel-bg); color: var(--ink); overflow: hidden; display: block; position: relative; }
.ball.reel::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(var(--reel-bg), transparent 30%, transparent 70%, var(--reel-bg)); }
.reel .strip { display: flex; flex-direction: column; width: 100%; height: 100%; will-change: transform, filter; }
.reel .cell { flex: 0 0 100%; display: grid; place-items: center; }
.plus { color: var(--muted); font-weight: 600; padding-inline: 2px; }

/* Strategy picker */
.strategies { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 8px; }
.strat { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left;
  border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.strat:hover { border-color: var(--bar); }
.strat:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.strat[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.strat .mark { grid-column: 2; grid-row: 1; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--bar);
  display: grid; place-items: center; }
.strat[aria-pressed="true"] .mark { background: var(--accent); border-color: var(--accent); }
.strat[aria-pressed="true"] .mark::after { content: ""; width: 6px; height: 10px; border: solid var(--on-accent);
  border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.strat b { grid-column: 1; grid-row: 1; font-weight: 700; }
.strat small { grid-column: 1 / -1; color: var(--muted); font-size: .84rem; line-height: 1.5; }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-top: 4px; }
.controls label { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); cursor: pointer; }
.controls input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; }
.stepper { display: inline-flex; align-items: center; background: var(--bg); border-radius: 10px; padding: 3px; }
.stepper button { border: 0; background: transparent; color: var(--ink); width: 32px; height: 32px; border-radius: 8px; font-size: 1.1rem; cursor: pointer; }
.stepper button:hover { background: var(--surface); }
.stepper output { min-width: 30px; text-align: center; font-weight: 700; }
.go { margin-left: auto; border: 0; border-radius: 12px; background: var(--accent); color: var(--on-accent);
  font-weight: 700; padding: 13px 28px; cursor: pointer; font-size: 1rem; }
.go:hover { filter: brightness(1.06); }
.go:active { transform: scale(.98); }

/* Tickets */
.tickets { display: grid; border-top: 1px solid var(--rule); }
.ticket { display: grid; grid-template-columns: 28px 1fr; gap: 6px 14px; align-items: center;
  padding-block: 14px; border-bottom: 1px solid var(--rule); }
.ticket:last-child { border-bottom: 0; padding-bottom: 0; }
.ticket .slot { font-weight: 700; color: var(--muted); grid-row: span 2; align-self: start; padding-top: 8px; }
.ticket .why { grid-column: 2; color: var(--muted); font-size: .84rem; }

/* Frequency chart */
.chart-box { overflow-x: auto; }
.chart-box svg { display: block; min-width: 640px; width: 100%; height: auto; }
.chart-box text { fill: var(--muted); font-family: var(--font); font-size: 11px; letter-spacing: 0; }
.chart-box .grid { stroke: var(--rule); }
.chart-box .bar-fill { fill: var(--bar); }
.chart-box .bar-fill.top { fill: var(--accent); }
.legend { color: var(--muted); font-size: .84rem; display: flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); display: inline-block; }
.seg { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); font-size: .85rem; font-weight: 600;
  padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* Backtest */
.table-box { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 12px 8px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
#bt-table tbody tr:last-child td { color: var(--muted); }
th { font-weight: 600; color: var(--muted); font-size: .82rem; }
td.num, th.num { text-align: right; }
td.num { font-weight: 600; }
.bar { height: 8px; border-radius: 4px; background: var(--accent); min-width: 2px; }
.bar.base { background: var(--bar); }
.note { color: var(--muted); font-size: .88rem; background: var(--bg); border-radius: 12px; padding: 14px 16px; }
/* Ad slots: invisible until an ad network is configured in CONFIG.ads */
.ad-slot { display: grid; justify-items: center; gap: 4px; min-width: 0; overflow: hidden; }
.ad-slot::before { content: "광고"; font-size: .72rem; color: var(--muted); }
.ad-slot .ad-frame { display: block; max-width: 100%; border: 0; }
.ad-slot .ad-disclosure { font-size: .72rem; color: var(--muted); text-align: center; max-width: 60ch; }
.ad-slot .ad-preview { width: min(100%, var(--ad-w)); height: var(--ad-h); border: 1.5px dashed var(--bar);
  border-radius: 10px; display: grid; place-items: center; color: var(--muted); font-size: .84rem; }
.prose { gap: 12px; }
.prose h3 { font-size: 1rem; font-weight: 700; margin: 8px 0 0; }
.prose p, .prose dd { color: var(--muted); max-width: 68ch; }
.prose dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.prose dt { font-weight: 700; }
.prose dd { margin: 0; }
@media (max-width: 520px) { .prose dl { grid-template-columns: 1fr; gap: 2px; } .prose dd { margin-bottom: 8px; } }
footer { color: var(--muted); font-size: .82rem; padding-top: 8px; display: grid; gap: 6px; }
footer p { margin: 0; }
footer a { color: inherit; }
.go:disabled { opacity: .55; cursor: progress; }
.why { transition: opacity .3s; }
.why.pending { opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .ball.settled { animation: settle .45s cubic-bezier(.3, 1.5, .5, 1); }
  @keyframes settle { 0% { transform: scale(.9); } 100% { transform: scale(1); } }
}
@media (max-width: 520px) { .card { padding: 20px 16px; } .go { width: 100%; margin-left: 0; } }

/* Site navigation */
/* Site navigation: one tab bar on its own surface, items spaced and divided so each reads as a separate destination */
.site-nav { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0;
  background: var(--surface); border-radius: 14px; padding: 6px; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { flex: 1 0 auto; text-align: center; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .92rem;
  padding: 10px 16px; border-radius: 10px; white-space: nowrap; transition: background .15s, color .15s; }
.site-nav a + a { position: relative; }
.site-nav a + a::before { content: ""; position: absolute; left: -4px; top: 50%; width: 1px; height: 16px;
  transform: translateY(-50%); background: var(--rule); }
.site-nav a:hover { background: var(--bg); }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.site-nav a[aria-current="page"]::before, .site-nav a[aria-current="page"] + a::before { display: none; }
.site-nav a:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Phones: wrap into rows so every menu item is visible without sideways scrolling */
@media (max-width: 520px) {
  .site-nav { flex-wrap: wrap; overflow: visible; gap: 4px; }
  .site-nav a { flex: 1 1 30%; padding: 9px 8px; font-size: .86rem; }
  .site-nav a::before { display: none; }
}
.brand { color: inherit; text-decoration: none; }
a.link { color: var(--accent); text-decoration: none; font-weight: 600; }
a.link:hover { text-decoration: underline; }

/* Compact static balls (draw lists) */
.ball.sm { width: 28px; height: 28px; font-size: .78rem; }

/* Stat tiles */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; }
.stat { background: var(--bg); border-radius: 12px; padding: 14px 16px; display: grid; gap: 2px; min-width: 0; }
.stat span { color: var(--muted); font-size: .82rem; }
.stat b { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat.accent b { color: var(--accent); }

/* Forms */
.field { display: grid; gap: 6px; }
.field label, .field .label { font-size: .88rem; color: var(--muted); font-weight: 600; }
.input { width: 100%; border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink); border-radius: 12px;
  padding: 12px 14px; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.input:focus { border-color: var(--accent); outline: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--rule); background: var(--surface); color: var(--ink); border-radius: 999px;
  padding: 6px 12px; font-size: .85rem; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--accent); }

/* Pager (prev / next draw) */
.pager { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pager a { color: var(--ink); text-decoration: none; background: var(--surface); border-radius: 12px; padding: 12px 16px; font-weight: 600; }
.pager a:hover { color: var(--accent); }
.crumbs { font-size: .85rem; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a { color: inherit; }
td .balls { flex-wrap: nowrap; gap: 4px; }
tr.hit td { color: var(--ink); }

/* Number picker (check page) */
.picker { display: grid; grid-template-columns: repeat(9, minmax(0, 46px)); gap: 8px; }
.pick { aspect-ratio: 1; max-width: 100%; border-radius: 50%; border: 1.5px solid var(--rule); background: var(--surface);
  color: var(--ink); font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.pick:hover { border-color: var(--c); }
.pick[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: var(--ball-text); }
@media (max-width: 520px) { .picker { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; } }
h3.sub { font-size: 1rem; font-weight: 700; margin: 0; }

/* Year chips on draw lists */
.year-links { flex-wrap: wrap; }
.year-links .chip { text-decoration: none; font-variant-numeric: tabular-nums; }
.year-links .chip[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.card .ad-slot { padding-block: 8px; }
/* Draw list is split into several tables around banners; fixed columns keep them aligned */
.draw-list { table-layout: fixed; min-width: 600px; }
.draw-list th:nth-child(1), .draw-list td:nth-child(1) { width: 76px; }
.draw-list th:nth-child(2), .draw-list td:nth-child(2) { width: 104px; }
.draw-list th:nth-child(4), .draw-list td:nth-child(4) { width: 150px; }
.draw-list th:nth-child(5), .draw-list td:nth-child(5) { width: 56px; }

/* Disclaimer shown on every page above the footer */
.disclaimer { border: 1.5px solid var(--rule); border-radius: var(--radius); padding: 18px 20px; display: grid; gap: 8px; }
.disclaimer h2 { font-size: .95rem; font-weight: 700; }
.disclaimer ul { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; color: var(--muted); font-size: .86rem; max-width: 72ch; }
.disclaimer strong { color: var(--ink); font-weight: 700; }

/* Share button + toast */
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.share-btn { display: inline-flex; align-items: center; gap: 6px; }
.share-btn::before { content: ""; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: var(--share-icon) center / contain no-repeat; mask: var(--share-icon) center / contain no-repeat; }
:root { --share-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v13M7 8l5-5 5 5M5 13v6a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6'/%3E%3C/svg%3E"); }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 16px);
  max-width: min(92vw, 420px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px;
  font-size: .9rem; font-weight: 600; text-align: center; opacity: 0; pointer-events: none; z-index: 20;
  transition: opacity .2s, transform .2s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Pattern page */
.pattern-table td.up { color: var(--accent); }
.meter { position: relative; height: 8px; border-radius: 4px; background: var(--bg); min-width: 120px; }
.meter::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--v); border-radius: 4px; background: var(--bar); }
.pattern-table tr:has(td.up) .meter::before { background: var(--accent); }
.meter::after { content: ""; position: absolute; top: -4px; bottom: -4px; left: var(--chance); border-left: 2px dotted var(--ink); }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 16px; }
.rank-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.rank-list li { display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; font-weight: 600; }

/* Readable copy: short paragraphs with breathing room; <br> breaks only apply where there is room */
.copy { display: grid; gap: 10px; margin: 0; }
.copy p, .copy li { margin: 0; }
.copy strong { color: var(--ink); font-weight: 700; }
.note.copy { gap: 6px; }
.steps { padding-left: 1.3em; color: var(--muted); max-width: 64ch; }
.steps li { padding-left: 4px; }
.verdict { font-size: 1.3rem; font-weight: 800; line-height: 1.45; color: var(--accent); }
.prose p + p { margin-top: 2px; }
@media (max-width: 520px) { .copy br, .prose br { display: none; } }

/* Second heading inside a page header (e.g. the draw index under "이번 주 로또 당첨번호") */
h2.sub-title { font-size: 1.2rem; margin-top: 12px; }

/* Phones: keep the menu pinned to the top while scrolling. The band above it (notch area) is painted by body::before. */
@media (max-width: 760px) {
  .site-nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 15;
    box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .35); }
  body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 16; background: var(--bg); }
  .card, h1, h2, h3 { scroll-margin-top: 120px; }   /* in-page jumps land below the pinned menu */
}

/* FAQ: question as a heading, answer as one self-contained paragraph */
.faq { gap: 14px; }
.faq-item { display: grid; gap: 4px; padding-top: 14px; border-top: 1px solid var(--rule); }
.faq-item:first-of-type { border-top: 0; padding-top: 0; }
.faq-item h3 { font-size: 1rem; font-weight: 700; margin: 0; }
.faq-item p { color: var(--muted); max-width: 68ch; }
