/* Apple×Toss 디자인 토큰 — 확정 목업(목업HTML/mockup-apple-toss*.html) 정본 이식 */
:root {
  --white: #ffffff;
  --g50: #f9fafb;
  --g100: #f2f4f6;
  --g200: #e5e8eb;
  --g400: #b0b8c1;
  --g500: #8b95a1;
  --g600: #6b7684;
  --g700: #4e5968;
  --g900: #191f28;
  --blue: #3182f6;
  --blue-press: #1b64da;
  --blue-wash: #eaf2fe;
  /* 공식 동행복권 볼 색 (화사, 흰 숫자 대비 위해 밝은 색은 소폭 진하게) */
  --z1: #fbc400;
  --z2: #4fb4ec;
  --z3: #fb6b6b;
  --z4: #98a2ae;
  --z5: #a2cf3a;
  /* 운세 보조 톤 */
  --fortune: #7a5cf0;
  --fortune-wash: #f3ecff;
  /* 라운드 스케일 통일 */
  --r: 14px;
  --r-icon: 16px;
  --r-sm: 7px;
  --font: "Pretendard", "Pretendard Variable", -apple-system, BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", sans-serif;
  --soft: 0 6px 20px rgba(49, 130, 246, .26);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
/* 한글은 단어 중간에서 끊기지 않도록(어색한 줄바꿈 방지) */
h1, h2, .tag, .survey-title, .home-title, .eyebrow, .tsum, .limit-title, .limit-sub { word-break: keep-all; }
h1 { text-wrap: balance; }
html, body { background: var(--white); }
body {
  font-family: var(--font);
  color: var(--g900);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  letter-spacing: -.01em;
  padding-bottom: 200px; /* 하단 고정 도크(광고 320x100 + CTA) 가림 방지 */
}
.app { max-width: 560px; margin: 0 auto; }
.pad { padding-left: 22px; padding-right: 22px; }

/* 하위 호환 — 텍스트 링크형 버튼 / 안내문 / 로딩 뱃지 */
.link-btn { display: inline-block; margin-top: 14px; background: none; border: none; padding: 8px; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--blue); cursor: pointer; }
.disclaimer { font-size: 12px; color: var(--g400); line-height: 1.5; }
.badge { font-size: 13px; color: var(--g500); }

/* 상단 바 */
.nav { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { font-size: 17px; font-weight: 800; letter-spacing: -.03em; color: var(--g900); cursor: pointer; }
.logo u { text-decoration: none; color: var(--blue); }
.menu { width: 40px; height: 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; background: none; border: none; cursor: pointer; padding: 0 8px; }
.menu i { width: 22px; height: 2px; border-radius: 2px; background: var(--g900); display: block; flex: none; }

/* 히어로 */
.hero { padding-top: 30px; padding-bottom: 28px; text-align: center; }
.ticon { width: 76px; height: 76px; margin: 0 auto 20px; border-radius: var(--r-icon); background: var(--blue-wash); display: flex; align-items: center; justify-content: center; font-size: 40px; box-shadow: 0 8px 22px rgba(49, 130, 246, .16); }
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--blue); }
.hero h1 { font-size: 48px; line-height: 1.05; font-weight: 800; letter-spacing: -.04em; margin: 12px 0 0; }
.hero .tag { font-size: 16px; font-weight: 500; line-height: 1.6; color: var(--g600); margin: 16px auto 0; max-width: 290px; }

/* 히어로 v2 — 화면 꽉 채움(목업 flow-v2) */
.hero-v2 { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding-bottom: 40px; min-height: calc(100vh - 56px); }
.hero-balls { display: flex; gap: 10px; margin-bottom: 30px; }
.hero-ball { flex: none; width: 48px; aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 17px; box-shadow: 0 6px 12px rgba(25,31,40,.18); }
.hero-ball.b1 { background: var(--z1); color: #4a3600; }
.hero-ball.b2 { background: var(--z2); }
.hero-ball.b3 { background: var(--z3); }
.hero-ball.b4 { background: var(--z4); }
.hero-ball.b5 { background: var(--z5); color: #33420b; }
.hero-v2 .eyebrow { font-size: 14px; }
.hero-v2 h1 { font-size: 44px; line-height: 1.18; font-weight: 800; letter-spacing: -.04em; margin: 14px 0 0; }
.hero-v2 .tag { font-size: 17px; font-weight: 500; line-height: 1.6; color: var(--g600); margin: 18px auto 0; max-width: 340px; }
.hero-v2 .cta { margin-top: 40px; max-width: 420px; }
.skip { margin-top: 18px; font-size: 15px; font-weight: 600; color: var(--blue); background: none; border: none; cursor: pointer; }

/* 오늘의 운세 — 더 각지게 */
.luck { margin-top: 10px; background: linear-gradient(135deg, #eef4ff, #f5eeff); border-radius: var(--r); padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; }
.luck .l { display: flex; flex-direction: column; gap: 4px; }
.luck .d { font-size: 12px; font-weight: 600; color: var(--g500); }
.luck .t { font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.luck .t .star { color: #ffb020; }
.luck .num { display: flex; gap: 6px; }
.luck .num b { width: 34px; height: 34px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(80, 60, 160, .14); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; color: var(--fortune); }

/* 섹션 헤딩 */
.sec { padding: 28px 2px 4px; }
.sec h2 { font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.sec h2 em { font-style: normal; color: var(--blue); }
.sec .cred { font-size: 13.5px; font-weight: 500; color: var(--g500); margin-top: 6px; line-height: 1.5; }

/* 추천 세트 목록 */
.list { background: var(--g50); border-radius: var(--r); padding: 6px 20px; margin-top: 16px; }
.row { padding: 20px 0; }
.row + .row { box-shadow: inset 0 1px 0 var(--g100); }
.balls { display: flex; gap: 9px; justify-content: space-between; }

/* 번호공 — 작고 옅은 코너 하이라이트 + 숫자 그림자로 식별성 확보 */
.ball {
  flex: 0 1 44px; min-width: 0; aspect-ratio: 1; border-radius: 50%; position: relative; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  box-shadow: 0 4px 8px rgba(25, 31, 40, .20), inset 0 -5px 8px rgba(0, 0, 0, .16);
}
.ball::before {
  content: ""; position: absolute; left: 5px; top: 4px; width: 15px; height: 11px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .65), rgba(255, 255, 255, 0)); pointer-events: none;
}
.b1 { background: var(--z1); color: #4a3600; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); }
.b2 { background: var(--z2); }
.b3 { background: var(--z3); }
.b4 { background: var(--z4); }
.b5 { background: var(--z5); color: #33420b; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); }

/* 근거 라벨(통계 ✓ / 운세 ✦) */
.why { display: flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 13.5px; font-weight: 600; color: var(--g700); }
.why .mk { width: 17px; height: 17px; flex: none; border-radius: var(--r-sm); background: var(--blue-wash); color: var(--blue); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; }
.why .mk.f { background: var(--fortune-wash); color: var(--fortune); }

/* 보조 액션 */
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin-top: 16px; }
.act { display: flex; align-items: center; justify-content: center; gap: 7px; height: 52px; background: var(--g100); border: none; border-radius: var(--r); font-family: inherit; font-size: 15.5px; font-weight: 700; color: var(--g700); letter-spacing: -.02em; cursor: pointer; }
.act svg { width: 18px; height: 18px; }

/* 하단 고정 도크 */
.dock { position: fixed; left: 0; right: 0; bottom: 0; background: linear-gradient(to top, var(--white) 74%, rgba(255, 255, 255, 0)); }
.ad { max-width: 480px; margin: 0 auto; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--g400); letter-spacing: .02em; }
.dock .inner { max-width: 480px; margin: 0 auto; padding: 10px 20px calc(14px + env(safe-area-inset-bottom)); }
.cta { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 56px; background: var(--blue); color: #fff; border: none; border-radius: var(--r); font-family: inherit; font-size: 17px; font-weight: 700; letter-spacing: -.02em; cursor: pointer; box-shadow: var(--soft); }
.cta:active { background: var(--blue-press); }
.cta svg { width: 20px; height: 20px; }

/* 기본정보 화면 헤딩 */
.head { padding: 24px 0 26px; }
.head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.035em; line-height: 1.28; }
.head p { font-size: 15px; font-weight: 500; color: var(--g600); margin-top: 12px; line-height: 1.55; }

/* 폼 — 테두리 없는 톤 필드 */
.field { margin-bottom: 22px; }
.field .lab { font-size: 13px; font-weight: 700; color: var(--g700); margin-bottom: 9px; display: flex; align-items: center; gap: 6px; }
.field .lab .opt { font-size: 11px; font-weight: 600; color: var(--g400); }
.inp { width: 100%; height: 56px; background: var(--g100); border: none; border-radius: var(--r); padding: 0 18px; font-family: inherit; font-size: 16.5px; font-weight: 600; color: var(--g900); letter-spacing: -.01em; }
.inp::placeholder { color: var(--g400); font-weight: 500; }
.hint { font-size: 12px; font-weight: 500; color: var(--g500); margin-top: 8px; display: flex; align-items: center; gap: 5px; }
.hint .dot { color: var(--fortune); }

/* 성별 세그먼트 */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--g100); padding: 5px; border-radius: var(--r); }
.seg button { height: 46px; border: none; background: transparent; border-radius: 10px; font-family: inherit; font-size: 15px; font-weight: 700; color: var(--g500); cursor: pointer; }
.seg button.on { background: var(--white); color: var(--g900); box-shadow: 0 2px 6px rgba(25, 31, 40, .10); }

/* 지역 (두 필드, 목업 info-v2) */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sel { position: relative; }
.sel::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 2px solid var(--g400); border-bottom: 2px solid var(--g400); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
select.inp { appearance: none; -webkit-appearance: none; cursor: pointer; color: var(--g400); font-weight: 500; }
select.inp.filled { color: var(--g900); font-weight: 600; }

/* 저장 토글 */
.save { display: flex; align-items: center; justify-content: space-between; background: var(--g50); border-radius: var(--r); padding: 16px 18px; margin-top: 6px; }
.save .txt { font-size: 14px; font-weight: 700; color: var(--g700); }
.save .txt small { display: block; font-size: 12px; font-weight: 500; color: var(--g500); margin-top: 3px; }
.sw { width: 50px; height: 30px; border-radius: 99px; background: var(--blue); position: relative; flex: none; cursor: pointer; }
.sw::after { content: ""; position: absolute; top: 3px; left: 23px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); }

/* 설문 v2 — 세로 풀폭 옵션(목업 flow-v2) */
.survey { padding-top: 8px; padding-bottom: 40px; }
.survey-progress-track { height: 8px; background: var(--g100); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.survey-progress-bar { display: block; height: 100%; background: var(--blue); border-radius: 99px; transition: width .2s ease-out; }
.survey-badge { font-size: 14px; font-weight: 700; color: var(--g500); margin: 14px 0 0; }
/* min-height로 2줄 예약 → 질문 길이와 무관하게 선택지 시작 위치 고정 */
.survey-title { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.35; margin: 10px 0 32px; min-height: 2.7em; color: var(--g900); }
.survey-options { display: flex; flex-direction: column; gap: 14px; margin-bottom: 0; }
.survey-option { width: 100%; min-height: 66px; display: flex; align-items: center; text-align: left; padding: 0 22px; background: var(--g50); border: none; border-radius: 16px; font-family: inherit; font-size: 17px; font-weight: 600; color: var(--g900); letter-spacing: -.01em; line-height: 1.4; cursor: pointer; transition: background .15s ease; }
.survey-option:hover { background: var(--blue-wash); }
.survey-option:active { background: var(--blue-wash); }
.survey-back { align-self: flex-start; margin-top: 26px; background: none; border: none; color: var(--g500); font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer; padding: 8px 0; }

/* 용지 뷰 */
.paper-wrap { padding: 4px 16px 40px; max-width: 460px; margin: 0 auto; }
.paper { background: #fff; border-radius: 8px; box-shadow: 0 10px 34px rgba(20,24,31,.16); overflow: auto; }
.paper svg { display: block; width: 100%; height: auto; }
.paper-actions { display: flex; gap: 10px; margin-top: 16px; }
.paper-actions .act { flex: 1; height: 52px; }
.paper-actions .cta { flex: 1.4; height: 52px; box-shadow: 0 6px 18px rgba(49,130,246,.26); }
.nav .menu[data-action="back-to-result"] { font-size: 20px; color: var(--g700); align-items: center; }

/* 당첨 확인 배너(결과/추천 상단 pull 안내) */
.win-banner { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin: 14px 0; height: 48px; background: var(--fortune-wash); color: var(--fortune); border: none; border-radius: var(--r-sm); font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }

/* 스캔 화면 — 카메라 프리뷰 박스 */
.scanbox { border-radius: var(--r); overflow: hidden; background: var(--g900); aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; }
.scanbox video[data-role="cam"] { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 저장 티켓 목록 — 컴팩트(볼 축소 · 당첨=테두리 · 낙첨=빗금) */
.tickets { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.ticket { background: var(--g50); border-radius: var(--r); padding: 14px 16px; }
.thead { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 700; color: var(--g700); margin-bottom: 8px; }
.tdel { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: none; border: none; color: var(--g400); font-size: 13px; cursor: pointer; }
.trow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: var(--r-sm); }
.trow + .trow { margin-top: 4px; }
.trow .balls { gap: 6px; justify-content: flex-start; flex: 0 1 auto; position: relative; }
/* 티켓 내 번호공은 작게 */
.trow .ball { flex: 0 0 28px; font-size: 12.5px; box-shadow: 0 2px 4px rgba(25,31,40,.16), inset 0 -3px 6px rgba(0,0,0,.14); }
.trow .ball::before { left: 3px; top: 3px; width: 10px; height: 7px; }
.tmeta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.tbadge { flex: none; padding: 5px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 700; letter-spacing: -.01em; }
.tbadge.win { background: var(--blue-wash); color: var(--blue); }
.tbadge.small { background: var(--g100); color: var(--g600); }
.tbadge.lose { background: var(--g100); color: var(--g400); }
.tbadge.pend { background: var(--fortune-wash); color: var(--fortune); }
.tprize { font-size: 12px; font-weight: 700; color: var(--g700); white-space: nowrap; }
/* 당첨 게임 = 소프트 파란 테두리 강조(하드테두리 회피: wash 배경 + 은은한 링) */
.trow.win { background: var(--blue-wash); box-shadow: inset 0 0 0 1.5px rgba(49,130,246,.5); }
/* 낙첨 게임 = 흐릿 + 수평 취소선(시안 제안 A) */
.trow.lose { opacity: .5; }
.trow.lose .balls::after { content: ""; position: absolute; left: -3px; right: -3px; top: 50%; height: 2px; background: var(--g600); border-radius: 2px; transform: translateY(-50%); }
.tsum { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: var(--r-sm); margin-bottom: 10px; }
.tsum strong { font-size: 14.5px; font-weight: 800; letter-spacing: -.01em; }
.tsum span { font-size: 13px; font-weight: 500; }
.tsum.win { background: var(--blue-wash); color: var(--blue); }
.tsum.win span { color: var(--blue); opacity: .85; }
.tsum.lose { background: var(--g100); color: var(--g600); }
.tsum.lose span { color: var(--g600); opacity: .85; }

/* 앱 안내(teaser) — 웹에서 QR 당첨확인 진입 시 */
.guide-feats { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.guide-feat { display: flex; align-items: center; gap: 12px; background: var(--g50); border-radius: var(--r); padding: 16px 18px; font-size: 15px; font-weight: 600; color: var(--g900); letter-spacing: -.01em; }
.guide-feat .gf-ic { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--blue-wash); color: var(--blue); display: flex; align-items: center; justify-content: center; }
.guide-feat .gf-ic svg { width: 15px; height: 15px; }
.guide-note { margin-top: 16px; padding: 14px 16px; background: var(--fortune-wash); color: var(--fortune); border-radius: var(--r); font-size: 13px; font-weight: 600; line-height: 1.5; text-align: center; }
.cta-soon { background: var(--g200); color: var(--g500); box-shadow: none; cursor: default; }
.cta-soon:active { background: var(--g200); }

/* 인라인 광고 슬롯(추첨결과·앱 안내·바텀시트) — 콘텐츠 다 본 지점 배치. 광고 크기만큼 예약. */
.ad-box { margin-top: 20px; display: flex; align-items: center; justify-content: center; background: var(--g50); border-radius: var(--r); overflow: hidden; }
.ad-box .kakao_ad_area { margin: 0 auto; }
/* 결과 화면 하단 고정 도크 안의 광고 */
.dock .ad-box { margin: 0 auto 6px; max-width: 480px; background: transparent; }

/* appGuide 타이틀 — 2줄 가독성(전용 축소) */
.guide-hero h1 { font-size: 34px; line-height: 1.22; }

/* 추천 번호 이력 — 우측 날짜 */
.saved-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.saved-date { flex: none; font-size: 12.5px; font-weight: 600; color: var(--g500); font-variant-numeric: tabular-nums; }

/* 하루 제한 초과 안내(앱 설치 페이지 상단) */
.limit-reached { margin: 6px 22px 0; padding: 14px 16px; background: var(--fortune-wash); color: var(--fortune); border-radius: var(--r); display: flex; flex-direction: column; gap: 3px; }
.limit-reached strong { font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.limit-reached span { font-size: 13px; font-weight: 500; line-height: 1.5; }

/* 재방문 메뉴 홈 */
.home { padding-top: 24px; padding-bottom: 40px; }
.home-greet { font-size: 15px; font-weight: 600; color: var(--g600); }
.home-greet em { font-style: normal; color: var(--blue); font-weight: 800; }
.home-title { font-size: 30px; font-weight: 800; letter-spacing: -.035em; margin: 8px 0 24px; }
.home-menu { display: flex; flex-direction: column; gap: 10px; }
.home-item { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: var(--g50); border: none; border-radius: var(--r); padding: 16px 18px; font-family: inherit; cursor: pointer; }
.home-item:active { background: var(--g100); }
.home-item .hi-ic { flex: none; width: 44px; height: 44px; border-radius: var(--r-icon); background: var(--blue-wash); display: flex; align-items: center; justify-content: center; font-size: 22px; }
.home-item .hi-tx { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.home-item .hi-tx b { font-size: 16.5px; font-weight: 700; letter-spacing: -.02em; color: var(--g900); }
.home-item .hi-tx small { font-size: 12.5px; font-weight: 500; color: var(--g500); }
.home-item .hi-ch { flex: none; width: 20px; height: 20px; color: var(--g400); }
.home-item .hi-ch svg { width: 100%; height: 100%; }

/* 하루 제한 바텀시트(앱 설치 겸 광고) */
.limit-body { padding: 8px 6px 4px; text-align: center; }
.limit-emoji { font-size: 40px; }
.limit-title { font-size: 20px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 6px; color: var(--g900); }
.limit-count { display: inline-block; margin: 2px 0 8px; padding: 5px 12px; border-radius: 99px; background: var(--blue-wash); color: var(--blue); font-size: 13px; font-weight: 700; }
.limit-count b { font-variant-numeric: tabular-nums; }
.limit-sub { font-size: 14px; font-weight: 500; color: var(--g600); line-height: 1.55; margin-bottom: 16px; }
.limit-body .ad-box { margin-top: 0; margin-bottom: 16px; }
.limit-body .cta { box-shadow: var(--soft); }

/* 햄버거 메뉴 시트 */
.sheet-mask { position: fixed; inset: 0; background: rgba(25,31,40,.4); z-index: 40; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-width: 560px; margin: 0 auto; background: var(--white); border-radius: 20px 20px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px rgba(25,31,40,.18); }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--g200); margin: 6px auto 10px; }
.sheet-list { display: flex; flex-direction: column; }
.sheet-item { display: flex; align-items: center; gap: 12px; height: 56px; background: none; border: none; font-family: inherit; font-size: 16px; font-weight: 600; color: var(--g900); text-align: left; cursor: pointer; padding: 0 6px; }
.sheet-item + .sheet-item { box-shadow: inset 0 1px 0 var(--g100); }
.sheet-item .ic { width: 24px; text-align: center; }
