/* 오늘로또 — styles
   아트 디렉션(docs/design-direction.md): 시선 끌기, "오늘의 공 여섯 개"
   제목 Black Han Sans · 숫자 Pretendard 800 tabular · 평면 원 공 · 움직임은 공 떨어지기 하나뿐 */
:root {
  --bg: #F4F2EC;
  --surface: #FFFFFF;
  --surface-2: #ECE9E1;
  --ink: #16171A;
  --ink-2: #3D3E42;
  --ink-3: #6A6A68;
  --line: #E0DCD2;
  --brand: #D23A1F;
  --brand-ink: #B5301A;
  --brand-soft: #F8E5DF;
  --btn: var(--brand);          /* 주 버튼 바탕: 라이트는 포인트 색 */
  --on-btn: #FFFFFF;
  /* 로또 공 5색 — 데이터(번호)에만 */
  --b-y: #FBC400; --b-b: #69C8F2; --b-r: #FF7272; --b-k: #AAAAAA; --b-g: #B0D840;
  --r-card: 12px; --r-ctl: 10px;
  --sheet-shadow: 0 8px 24px -12px rgba(0, 0, 0, .12);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --gutter: 16px;
  --display: "Black Han Sans", "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212; --surface: #1B1B1B; --surface-2: #252524;
    --ink: #ECEAE4; --ink-2: #C6C4BE; --ink-3: #8F8D88; --line: #2D2D2B;
    --brand: #D9705C; --brand-ink: #DE806E; --brand-soft: #2B1F1B;
    /* 다크: 주 버튼은 밝은 잉크로 채우고 글자는 바탕색 (포인트 색으로 채우지 않음) */
    --btn: #ECEAE4; --on-btn: #121212;
    /* 공 5색은 채도 15% 낮춤 */
    --b-y: #DDB012; --b-b: #64BEE5; --b-r: #F36C6C; --b-k: #A2A2A2; --b-g: #A5CA40;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 16px; line-height: 1.5; font-weight: 500; letter-spacing: -0.01em; word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
b, strong { font-weight: 700; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: var(--r-ctl); }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: var(--r-ctl); text-decoration: none; font-weight: 700; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { font-family: var(--display); font-weight: 400; font-size: 22px; letter-spacing: -0.01em; line-height: 1; text-decoration: none; color: var(--ink); }
.streak-pill { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 14px; font-weight: 500; color: var(--ink-2); transition: background-color .15s; }
.streak-pill b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.streak-pill .ic { width: 18px; height: 18px; color: var(--brand); }
.streak-pill:hover { background: var(--surface-2); }

/* ---------- 첫 화면: 오늘의 공 여섯 개 ---------- */
.hero { border-bottom: 1px solid var(--line); }
.hero-in { padding-top: 24px; padding-bottom: 28px; display: grid; gap: 0; }
.hero-main { min-width: 0; }
.hero-date { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.hero-round { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--ink); color: var(--ink); }
.hero-round:empty { display: none; }
.hero-title { margin-top: 14px; font-family: var(--display); font-weight: 400; font-size: 28px; line-height: 1.15; letter-spacing: -0.01em; }
.hero-who { margin-top: 6px; font-size: 14px; color: var(--ink-2); min-height: 21px; }
.hero-who b { color: var(--ink); }
.ex { display: inline-block; margin-right: 6px; padding: 0 7px; border-radius: 999px; border: 1px solid var(--ink-3); font-size: 12px; font-weight: 700; line-height: 18px; color: var(--ink-2); vertical-align: 1px; }

.stage { position: relative; margin-top: 18px; }
/* 공 크기: 360px 폭에서도 6개(+보너스)가 줄 안에 들어오도록 화면 폭에 맞춰 줄어든다 */
.balls { --bs: clamp(34px, calc((100vw - 2 * var(--gutter) - 5 * 8px) / 6), 56px); display: grid; grid-template-columns: repeat(6, minmax(0, var(--bs))); gap: 8px; align-items: center; max-width: 100%; }
/* 공: 공식 5색 평면 원 */
.ball { position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--c);
  font-weight: 800; font-size: clamp(16px, 5vw, 22px); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; text-shadow: 0 1px 0 rgba(0, 0, 0, .16); }
.ball.c-y { --c: var(--b-y); } .ball.c-b { --c: var(--b-b); } .ball.c-r { --c: var(--b-r); } .ball.c-k { --c: var(--b-k); } .ball.c-g { --c: var(--b-g); }
.ball.q { --c: var(--surface-2); color: var(--ink-3); text-shadow: none; box-shadow: inset 0 0 0 1px var(--line); }
.hero:not(.mine) .ball.star::after { display: none; }
.ball.star::after { content: ""; position: absolute; top: 0; right: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2px var(--bg); }
.ball.drop { animation: drop .32s var(--ease) both; }
.bonus-row { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; min-width: 0; }
.bonus-row .plus { font-size: 16px; color: var(--ink-3); font-weight: 500; }
.bonus-row .ball { width: 36px; flex: none; font-size: 14px; }
.bonus-cap { font-size: 12px; color: var(--ink-3); }

.reveal { position: absolute; inset: 0; border: 1px dashed var(--ink-3); border-radius: var(--r-card); display: grid; place-content: center; gap: 2px; color: var(--ink); text-align: center; background: var(--bg); transition: background-color .15s; }
.reveal:hover { background: var(--surface-2); }
.reveal-txt { font-family: var(--display); font-size: 22px; font-weight: 400; letter-spacing: -0.01em; }
.reveal-sub { font-size: 14px; color: var(--ink-3); }

.digit-note { margin-top: 10px; font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.digit-note:empty { display: none; }
.digit-note .st { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); flex: none; }

.draws { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.draws button { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.draws button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.hero-actions { margin-top: 20px; display: grid; gap: 10px; justify-items: start; }
.hero-actions .btn { min-width: min(220px, 100%); max-width: 100%; }
.hero-actions.two { grid-template-columns: 1fr 1fr; max-width: 440px; justify-items: stretch; }
.hero-actions.two .btn { min-width: 0; padding: 0 12px; }
.hero-note { font-size: 14px; color: var(--ink-3); }

/* 추첨까지: 페이지에 하나뿐인 큰 숫자 */
.cd { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); min-width: 0; container-type: inline-size; }
.cd-label { font-size: 14px; color: var(--ink-2); }
.cd-label span { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.cd-digits { margin-top: 6px; display: flex; align-items: baseline; flex-wrap: nowrap; font-size: clamp(30px, 10vw, 80px); font-size: clamp(30px, min(10vw, 16.5cqi), 80px); line-height: 1; font-weight: 800; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cd-digits i { font-style: normal; font-size: .38em; font-weight: 700; letter-spacing: 0; color: var(--ink-3); margin: 0 .3em 0 .06em; }
.cd-digits i.sep { font-size: .8em; margin: 0 .04em; position: relative; top: -.06em; }
.cd-date { margin-top: 10px; font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.cd-foot { margin-top: 4px; font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cd-foot:empty { display: none; }
.cd-foot .live { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); flex: none; }
.cd-foot a { color: var(--ink); font-weight: 700; }
.cd.urgent .cd-digits b { color: var(--brand); }

/* ---------- layout ---------- */
.layout { display: grid; gap: 12px; margin-top: 20px; }
.col-main, .col-side { display: grid; gap: 12px; align-content: start; min-width: 0; }
.tools { display: grid; gap: 12px; }

.card { background: var(--surface); border-radius: var(--r-card); border: 1px solid var(--line); padding: 20px 16px; }
.sec-title { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; display: flex; align-items: center; gap: 8px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.sec-desc { font-size: 14px; color: var(--ink-3); margin-bottom: 16px; }
.badge { min-width: 24px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; padding: 0 18px; border-radius: var(--r-ctl); border: 1px solid transparent; font-size: 16px; font-weight: 700; text-decoration: none; transition: background-color .15s, border-color .15s, color .15s, opacity .15s; user-select: none; -webkit-user-select: none; }
.btn:active { opacity: .85; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.btn-primary { color: var(--on-btn); background: var(--btn); }
.btn-primary:hover { background: color-mix(in srgb, var(--btn) 88%, var(--bg)); }
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-soft:hover { background: color-mix(in srgb, var(--surface-2) 90%, var(--ink)); }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--ink-3); }
.btn-outline[aria-pressed="true"] { border-color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--bg); }
.btn-text { background: transparent; color: var(--ink-3); padding: 0 14px; font-weight: 500; }
.btn-block { width: 100%; }
.btn-grow { flex: 1; }
.btn-sm { min-height: 40px; font-size: 14px; padding: 0 14px; }
.btn .count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--ink); color: var(--bg); margin-left: 2px; font-variant-numeric: tabular-nums; }
.btn .count.zero { background: var(--line); color: var(--ink-3); }
.btn-link { background: none; border: 0; padding: 6px 2px; font-size: 14px; font-weight: 500; color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.btn-link:hover { color: var(--ink); }
.btn-link.danger { color: var(--brand-ink); }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; flex: none; transition: background-color .15s; }
.icon-btn:hover { background: var(--surface-2); }

/* ---------- profiles ---------- */
/* 프로필 칩: 화면 밖으로 삐져나가 잘리지 않게 줄바꿈 */
.profiles { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.pchip { flex: none; max-width: 100%; min-width: 0; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 5px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 700; color: var(--ink-2); scroll-snap-align: start; transition: background-color .15s, color .15s; }
.pchip .pn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pchip .av { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--ink-2); background: var(--surface-2); }
.pchip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pchip[aria-pressed="true"] .av { background: var(--bg); color: var(--ink); }
.pchip.add { padding: 0 14px 0 10px; color: var(--ink-3); border-style: dashed; background: transparent; gap: 4px; }
.pchip.add .ic { width: 18px; height: 18px; }

/* ---------- form ---------- */
.form-card { padding-top: 14px; }
.form-top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.form-top .icon-btn { width: 36px; height: 36px; border-color: transparent; background: transparent; margin-left: -6px; }
.form-top .icon-btn[disabled] { visibility: hidden; }
.progress { flex: 1; height: 4px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; width: 33.3%; border-radius: inherit; background: var(--ink); }
.step-count { font-size: 12px; font-weight: 700; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.step { display: none; }
.step.on { display: block; }
.step-title { font-size: 20px; line-height: 1.35; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 18px; }
.step-sub { margin: -12px 0 18px; color: var(--ink-3); font-size: 14px; }
.field { display: block; border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.field-label { display: block; font-size: 14px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; padding: 0; }
.field-label small { font-weight: 500; color: var(--ink-3); font-size: 12px; }
.field input, .field select {
  width: 100%; height: 52px; padding: 0 14px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface);
  font-size: 16px; font-weight: 500; color: var(--ink); transition: border-color .15s; -webkit-appearance: none; appearance: none;
}
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6.75 9.75 5.25 5.25 5.25-5.25' fill='none' stroke='%236A6A68' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 20px; padding-right: 40px; }
.field input::placeholder { color: var(--ink-3); font-weight: 500; }
.field input:focus, .field select:focus { outline: none; border-color: var(--ink); }
.field input[aria-invalid="true"] { border-color: var(--brand); }
#fBirth { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.field-row { display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; }
.field-row .field { margin-bottom: 12px; }
.hint { margin: -6px 0 14px; font-size: 14px; color: var(--ink-3); min-height: 21px; }
.hint.good { color: var(--ink); font-weight: 700; }
.err { margin: -6px 0 12px; font-size: 14px; color: var(--brand-ink); font-weight: 500; min-height: 0; }
.err:empty { display: none; }

.tiles { display: grid; gap: 8px; }
.tiles-2 { grid-template-columns: 1fr 1fr; }
.tiles-time { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tile { position: relative; display: block; min-width: 0; }
.tile input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tile span { display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 16px; color: var(--ink-2); transition: background-color .15s, border-color .15s, color .15s; text-align: center; line-height: 1.2; }
.tiles-time .tile span { height: 52px; flex-direction: column; gap: 1px; font-size: 14px; }
.tiles-time .tile span small { font-size: 12px; font-weight: 500; color: var(--ink-3); }
.tile input:checked + span { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.tile input:checked + span small { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.tile input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 172px; overflow-y: auto; padding: 2px 0; margin: 0 0 6px; }
.chips:empty { display: none; }
.chip { min-height: 36px; max-width: 100%; line-height: 1.3; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 500; color: var(--ink-2); transition: background-color .15s, border-color .15s; }
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.form-actions { display: flex; gap: 8px; margin-top: 22px; min-width: 0; }
.form-actions .btn { min-width: 0; }
.form-sub { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.privacy-line { min-width: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.privacy-line .ic { width: 16px; height: 16px; }

/* ---------- result (풀이) ---------- */
.rc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.rc-head > div { min-width: 0; }
.rc-date { font-size: 14px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rc-title { font-size: 20px; line-height: 1.35; font-weight: 700; letter-spacing: -0.03em; margin-top: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { display: inline-flex; align-items: center; gap: 4px; min-height: 26px; max-width: 100%; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; border: 1px solid var(--line); color: var(--ink-2); }

.rc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.rc-actions .btn { min-height: 48px; font-size: 14px; padding: 0 10px; min-width: 0; }

/* 5게임 세트: 용지 느낌은 점선 하나로만 */
.ticket { margin-top: 12px; border-radius: var(--r-card); padding: 14px 14px 10px; background: var(--bg); color: var(--ink); border: 1px dashed var(--ink-3); }
.tk-head { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--ink-3); padding-bottom: 8px; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.tk-head b { font-size: 14px; font-weight: 700; letter-spacing: .04em; color: var(--ink); }
.tk-rows { list-style: none; margin: 0; padding: 8px 0; display: grid; gap: 6px; }
.tk-rows li { display: grid; grid-template-columns: 22px minmax(0, 1fr); align-items: center; gap: 8px; }
.tk-rows li > b { font-size: 14px; font-weight: 700; color: var(--ink-3); }
.tk-foot { display: flex; flex-wrap: wrap; gap: 2px 12px; justify-content: space-between; align-items: center; font-size: 12px; color: var(--ink-3); padding-top: 6px; border-top: 1px dashed var(--line); }
.tk-foot .btn-link { color: var(--ink); font-weight: 700; font-size: 12px; }

.minis { display: grid; grid-template-columns: repeat(6, minmax(0, 30px)); gap: 5px; }
.minis .ball { max-width: 30px; font-size: 12px; font-weight: 700; }
.minis .ball.dim { opacity: .3; }
.minis .ball.hit { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }

.score-txt { min-width: 0; }
.score { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.ring { position: relative; width: 72px; height: 72px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 5; }
.ring-bg { stroke: var(--surface-2); }
.ring-fg { stroke: var(--brand); stroke-linecap: round; stroke-dasharray: 169.65; stroke-dashoffset: 169.65; }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 20px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.score-tag:empty { display: none; }
.score-k { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.score-tag { padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink); font-size: 12px; font-weight: 700; }
.score-line { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; margin-top: 3px; line-height: 1.4; }
.score-tip { font-size: 14px; color: var(--ink-2); margin-top: 3px; }

/* ---------- 언제, 어디서 살까 ---------- */
.lucky { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 16px 16px; }
.lucky .sec-title { margin-bottom: 12px; }
.lucky-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid var(--line); }
.lk { position: relative; padding: 16px 12px 16px 0; min-width: 0; border-bottom: 1px solid var(--line); }
.lk-time { padding-right: 12px; border-right: 1px solid var(--line); }
.lk-dir { padding-left: 14px; padding-right: 48px; }
.lk-place, .lk-where { grid-column: 1 / -1; }
.lk-where { border-bottom: 0; padding-bottom: 0; }
.lk-k { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-3); }
.lk-k .ic { width: 16px; height: 16px; }
.lk-v { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.35; margin-top: 4px; }
.lk-s { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.lk-status { margin-top: 8px; max-width: 100%; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.lk-status:empty { display: none; }
.lk-status.now { border-color: var(--brand); color: var(--brand-ink); }
.lk-status.now::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* 살 방향: 나침반 선 SVG */
.compass { position: absolute; right: 0; top: 14px; width: 40px; height: 40px; }
.compass svg { width: 100%; height: 100%; overflow: visible; }
.cp-ring { fill: none; stroke: var(--line); stroke-width: 1.2; }
.cp-ticks path { stroke: var(--ink-3); stroke-width: 1.5; stroke-linecap: round; }
.cp-ticks .cp-minor { stroke: var(--line); }
.cp-n { font-size: 8px; font-weight: 700; fill: var(--ink-3); text-anchor: middle; }
.cp-needle { transform-origin: 32px 32px; transform: rotate(var(--deg, 0deg)); }
.cp-needle path { stroke: var(--brand); stroke-width: 2.5; stroke-linecap: round; }
.cp-hub { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; }
.maps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.map-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 12px; border-radius: var(--r-ctl); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; max-width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); transition: border-color .15s; }
.map-btn:hover { border-color: var(--ink-3); }
.map-btn.plain { color: var(--ink-2); }
/* 잠금: 예시 값을 보여 주지 않고 '아직 몰라요'만 */
.lucky.locked .lk-v, .lucky.locked .lk-s { color: var(--ink-3); font-weight: 500; }
.lucky.locked .lk-status { display: none; }
.lucky.locked .cp-needle { display: none; }
.lucky.locked .maps { display: none; }
.lock-msg { display: none; }
.lucky.locked .lock-msg { margin-top: 14px; display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ink-2); }
.lucky.locked .lock-msg .ic { width: 16px; height: 16px; }

/* ---------- streak ---------- */
.streak-top { display: flex; gap: 14px; align-items: center; }
.streak-top > div { min-width: 0; }
.flame { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); color: var(--brand); flex: none; }
.flame .ic { width: 24px; height: 24px; }
.streak-title { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
.streak-title b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.streak-sub { font-size: 14px; color: var(--ink-3); }
.streak-note { margin-top: 14px; font-size: 12px; color: var(--ink-3); }
.week { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.week li { display: grid; justify-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.week i { width: 100%; max-width: 36px; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); font-style: normal; }
.week li.on i { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.week li.on i::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5.75 12.5 4 4 8.5-9' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m5.75 12.5 4 4 8.5-9' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat; }
.week li.today { color: var(--ink); font-weight: 700; }
.week li.today i { border: 1.5px solid var(--ink); }
.week li.today.on i { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--brand); }

/* ---------- vault ---------- */
.vault-list { display: grid; gap: 14px; }
.v-empty { padding: 24px 12px; text-align: center; color: var(--ink-3); font-size: 14px; border-radius: var(--r-card); border: 1px dashed var(--line); }
.v-empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }
.v-group h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.v-group h3 small { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.v-state { margin-left: auto; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); background: transparent; }
.v-state.wait { color: var(--ink); border-color: var(--ink-3); }
.v-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.v-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; padding: 10px 6px 10px 12px; border-radius: var(--r-ctl); border: 1px solid var(--line); }
.v-meta { grid-column: 1 / -1; min-width: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 12px; color: var(--ink-3); }
.v-meta .rk { margin-left: auto; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.v-meta .rk.win { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.v-del { width: 34px; height: 34px; border-color: transparent; background: transparent; color: var(--ink-3); }
.v-del .ic { width: 18px; height: 18px; }
.v-more { justify-self: center; }

/* ---------- checker ---------- */
.num-inputs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)) 10px minmax(0, 1fr); gap: 4px; align-items: center; }
.num-inputs .plus { text-align: center; color: var(--ink-3); }
.num-inputs input { width: 100%; height: 48px; padding: 0; text-align: center; border-radius: var(--r-ctl); border: 1px solid var(--line); background: var(--surface); font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.num-inputs input:focus { outline: none; border-color: var(--ink); }
.num-inputs input.bonus-in { border-style: dashed; }
.num-inputs input.filled { border-color: transparent; color: #fff; background: var(--c); }
.num-inputs input.c-y { --c: var(--b-y); } .num-inputs input.c-b { --c: var(--b-b); } .num-inputs input.c-r { --c: var(--b-r); } .num-inputs input.c-k { --c: var(--b-k); } .num-inputs input.c-g { --c: var(--b-g); }
.ck-link { display: inline-block; margin-top: 8px; }
.ck-result { margin-top: 14px; display: grid; gap: 8px; }
.ck-result:empty { display: none; }
.ck-sum { padding: 14px; border-radius: var(--r-ctl); border: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.ck-sum b { color: var(--ink); }
.ck-sum.win { border-color: var(--ink); color: var(--ink); }

/* ---------- 알아 두세요 ---------- */
.notice { margin-top: 32px; }
.notice-list { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; color: var(--ink-2); line-height: 1.65; }
.notice-list b { color: var(--ink); }
.notice-list a { color: var(--ink); font-weight: 700; margin-left: 4px; }
.guide { margin-top: 16px; }
.guide-more { margin: 12px 0 0; font-size: 14px; }
.guide-more a { color: var(--ink); font-weight: 700; }

/* ---------- shared ---------- */
.shared { margin-top: 20px; }
.shared-kicker { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.shared-title { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; margin: 4px 0 16px; }
.shared .balls { margin-bottom: 18px; grid-template-columns: repeat(6, minmax(0, 48px)); }
.shared .btn { max-width: 380px; }

/* ---------- ads: 자리 미리 잡기 · 「광고」 라벨 · 버튼과 넉넉히 띄우기 · 안 채워지면 접기 ---------- */
/* 광고 칸: 공용 ../common/ads.css(.jl-ad). 여기선 색과 버튼·링크와의 간격(150px 이상)만 맞춤 */
.jl-ad { --muted: var(--ink-3); }
.ad-slot .jl-ad { margin: 150px auto; }
.ad-in-doc .jl-ad { margin: 40px auto; }
.doc .ad-end .jl-ad { margin: 72px auto 150px; }

/* ---------- footer: 공용 컴포넌트(../common/footer.css) — 색만 이 사이트 토큰에 맞춤 ---------- */
.jl-footer { --muted: var(--ink-3); }
.jl-footer .jf-notes b { color: var(--ink-2); }
.jl-footer .jf-notes a { color: var(--ink); font-weight: 700; }

/* ---------- sheet / dialog ---------- */
.sheet { border: 1px solid var(--line); padding: 0; width: min(440px, 100%); max-width: 100%; max-height: 100dvh; margin: auto auto 0; border-radius: var(--r-card) var(--r-card) 0 0; background: var(--surface); color: var(--ink); box-shadow: var(--sheet-shadow); }
.sheet::backdrop { background: rgba(0, 0, 0, .4); }
.sheet-in { padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.sheet-head h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.share-preview { border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--line); background: var(--bg); aspect-ratio: 4 / 5; max-height: 52dvh; margin: 0 auto; display: grid; place-items: center; }
.share-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.share-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.share-actions .btn-primary { grid-column: 1 / -1; }
.share-actions .btn { min-height: 48px; font-size: 14px; min-width: 0; padding: 0 10px; }
.sheet-note { text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 10px; }
@media (min-width: 600px) { .sheet { margin: auto; border-radius: var(--r-card); } }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 60; transform: translate(-50%, 0); opacity: 0; pointer-events: none; max-width: calc(100% - 32px);
  padding: 12px 16px; border-radius: var(--r-ctl); background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 500; transition: opacity .2s; text-align: center; }
.toast.on { opacity: 1; }

.noscript { padding: 20px; text-align: center; }

/* ---------- content pages ---------- */
.doc { max-width: 760px; margin: 24px auto 0; }
.doc h1 { font-family: var(--display); font-weight: 400; font-size: 28px; letter-spacing: -0.01em; margin-bottom: 6px; }
.doc .meta { color: var(--ink-3); font-size: 14px; margin-bottom: 20px; }
.doc h2 { font-size: 20px; font-weight: 700; margin: 26px 0 8px; letter-spacing: -0.02em; }
.doc h2:first-child { margin-top: 0; }
.doc p, .doc li { color: var(--ink-2); font-size: 16px; line-height: 1.75; }
.doc ul { padding-left: 20px; margin: 6px 0; }
.doc a { color: var(--brand-ink); }
.doc .card { padding: 26px 22px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0; }
.doc th, .doc td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
.doc th { color: var(--ink); font-weight: 700; word-break: keep-all; }
.doc .table-wrap { overflow-x: auto; }

/* ---------- motion: 공 떨어지기 하나만 ---------- */
@keyframes drop { from { opacity: 0; transform: translateY(-28px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- larger screens ---------- */
@media (min-width: 420px) {
  .card, .lucky { padding: 22px 20px; }
}
@media (min-width: 720px) {
  :root { --gutter: 24px; }
  .hero-in { padding-top: 40px; padding-bottom: 40px; }
  .hero-title { font-size: 28px; }
  .tools { grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (min-width: 960px) {
  .topbar-in { height: 64px; }
  .hero-in { grid-template-columns: minmax(0, 1fr) minmax(0, 500px); gap: 56px; align-items: end; padding-top: 56px; padding-bottom: 56px; }
  .balls { gap: 12px; }
  .ball { font-size: 22px; }
  .cd { margin-top: 0; padding-top: 0; border-top: 0; padding-left: 40px; border-left: 1px solid var(--line); }
  .layout { grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: 16px; margin-top: 32px; align-items: start; }
  .card, .lucky { padding: 24px; }
  .tools { gap: 16px; }
}
