/* ==========================================================
   로또해봄 — UI Preview · base.css
   디자인 토큰 / 리셋 / 공통 컴포넌트
   (공 · 버튼 · 칩 · 카드 · 헤더 · 광고슬롯 · 토스트 · 푸터)
   ========================================================== */

:root {
  /* 동행복권 공식 공 색상 (1~10 / 11~20 / 21~30 / 31~40 / 41~45) */
  --ball-1: #FBC400; --ball-1-sh: rgba(73, 57, 0, .8);
  --ball-2: #69C8F2; --ball-2-sh: rgba(0, 49, 70, .8);
  --ball-3: #FF7272; --ball-3-sh: rgba(64, 0, 0, .8);
  --ball-4: #AAAAAA; --ball-4-sh: rgba(61, 61, 61, .8);
  --ball-5: #B0D840; --ball-5-sh: rgba(41, 56, 0, .8);

  /* 브랜드 — 해(오렌지) + 봄(그린) */
  --sun: #FF7A2F;
  --sun-deep: #C2410C;
  --sun-soft: #FFF1E6;
  --sun-line: #FFD2B5;
  --sprout: #16B075;
  --sprout-soft: #E6F8F0;
  --sky: #3D8BFF;
  --sky-soft: #EAF3FF;
  --berry: #FF5C8A;
  --berry-soft: #FFEEF3;
  --lemon: #FFD84D;
  --lemon-soft: #FFF8DB;
  --violet: #7B61FF;
  --violet-soft: #F1EEFF;

  /* 텍스트 · 표면 (다크모드 없음: 항상 밝게) */
  --ink: #1D2433;
  --ink-2: #4A5366;
  --ink-3: #667085;
  --line: #E8EBF1;
  --line-2: #F1F3F7;
  --surface: #FFFFFF;
  --surface-2: #F6F8FB;

  --r-sm: 10px; --r-md: 14px; --r-lg: 22px; --r-xl: 28px;
  --shadow-1: 0 1px 2px rgba(29, 36, 51, .05), 0 2px 8px rgba(29, 36, 51, .05);
  --shadow-2: 0 1px 2px rgba(29, 36, 51, .04), 0 14px 36px -12px rgba(29, 36, 51, .14);
  --shadow-sun: 0 12px 24px -10px rgba(232, 86, 26, .6);

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
          "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --hdr-h: 60px;
  --nav-h: 48px;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--hdr-h) + var(--nav-h) + 12px);
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -.01em;
  color: var(--ink);
  background: #fff;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 3px solid rgba(61, 139, 255, .45); outline-offset: 2px; border-radius: 10px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.section { padding: 48px 0; position: relative; }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.sec-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--sun-deep); margin-bottom: 6px; }
.sec-title { font-size: 24px; font-weight: 800; line-height: 1.3; letter-spacing: -.035em; }
.sec-desc { font-size: 15px; color: var(--ink-2); margin-top: 6px; }
@media (min-width: 768px) {
  .wrap { padding: 0 24px; }
  .sec-title { font-size: 30px; }
}
@media (min-width: 1024px) {
  .section { padding: 72px 0; }
}

/* ---------- icon ---------- */
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 16px; height: 16px; }
.ico-lg { width: 24px; height: 24px; }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.hdr.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 20px -14px rgba(29, 36, 51, .25); }
.hdr-top { height: var(--hdr-h); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; letter-spacing: -.05em; }
.logo svg { width: 32px; height: 32px; }
.logo b { color: var(--sun-deep); font-weight: 800; }
.hdr-actions { display: flex; align-items: center; gap: 6px; }
.draw-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px;
  border-radius: 999px; background: var(--sun-soft); color: var(--sun-deep);
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.draw-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--sun); animation: pulse 1.6s infinite; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; color: var(--ink-2); transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn .badge {
  position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; border: 2px solid #fff; background: var(--berry); color: #fff;
  font-size: 10.5px; font-weight: 800; display: grid; place-items: center;
}
.subnav {
  height: var(--nav-h); display: flex; align-items: center; gap: 4px;
  overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 6px;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  flex: none; height: 34px; display: inline-flex; align-items: center; padding: 0 14px;
  border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background .2s, color .2s;
}
.subnav a:hover { background: var(--surface-2); color: var(--ink); }
.subnav a.is-active { background: var(--sun-soft); color: var(--sun-deep); font-weight: 700; }
@media (max-width: 380px) { .draw-pill .long { display: none; } }

/* ---------- lotto ball ---------- */
.ball {
  --c: var(--ball-1); --sh: var(--ball-1-sh); --s: 40px;
  width: var(--s); height: var(--s); flex: none; border-radius: 50%;
  display: inline-grid; place-items: center;
  color: #fff; font-weight: 800; font-size: calc(var(--s) * .42); line-height: 1;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums;
  text-shadow: 0 0 3px var(--sh);
  background:
    radial-gradient(circle at 33% 27%, rgba(255, 255, 255, .62) 0, rgba(255, 255, 255, .16) 24%, rgba(255, 255, 255, 0) 48%),
    var(--c);
  box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .08), 0 4px 10px -4px color-mix(in srgb, var(--c) 80%, transparent);
}
.b1 { --c: var(--ball-1); --sh: var(--ball-1-sh); }
.b2 { --c: var(--ball-2); --sh: var(--ball-2-sh); }
.b3 { --c: var(--ball-3); --sh: var(--ball-3-sh); }
.b4 { --c: var(--ball-4); --sh: var(--ball-4-sh); }
.b5 { --c: var(--ball-5); --sh: var(--ball-5-sh); }
.ball.xs { --s: 26px; }
.ball.sm { --s: 32px; }
.ball.md { --s: 36px; }
.ball.lg { --s: 48px; }
.ball.empty {
  background: var(--surface-2); color: #C3C9D4; text-shadow: none;
  box-shadow: inset 0 0 0 2px var(--line);
}
.ball.pop { animation: pop .52s cubic-bezier(.2, .9, .3, 1.35) both; animation-delay: var(--d, 0ms); }
.balls { display: flex; align-items: center; gap: 6px; }
.plus { color: #B7BECB; font-weight: 700; font-size: 18px; margin: 0 1px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px; border-radius: 14px;
  font-size: 15px; font-weight: 700; white-space: nowrap;
  transition: transform .12s, box-shadow .2s, background .2s, color .2s;
}
.btn:active { transform: scale(.98); }
.btn-sun {
  color: #fff; text-shadow: 0 1px 1px rgba(150, 45, 0, .25);
  background: linear-gradient(135deg, #FF9B40 0%, #FF6D2C 55%, #F0541F 100%);
  box-shadow: var(--shadow-sun);
}
.btn-sun:hover { box-shadow: 0 16px 30px -10px rgba(232, 86, 26, .65); }
.btn-berry {
  color: #fff; background: linear-gradient(135deg, #FF7FA3, #FF5C8A 50%, #F4467C);
  box-shadow: 0 12px 24px -10px rgba(244, 70, 124, .6);
}
.btn-soft { background: var(--surface-2); color: var(--ink); }
.btn-soft:hover { background: #EDF0F5; }
.btn-line { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-line:hover { box-shadow: inset 0 0 0 1.5px #D5DAE3; }
.btn-sm { height: 38px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn-xl { width: 100%; height: 58px; border-radius: 18px; font-size: 18px; }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn-shine { position: relative; overflow: hidden; isolation: isolate; }
.btn-shine::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .38) 50%, transparent 70%);
  transform: translateX(-100%); animation: shine 3.4s ease-in-out infinite;
}
.link { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; color: var(--sky); }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- segmented / chips / tags ---------- */
.seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 13px; background: var(--surface-2); }
.seg button {
  height: 34px; padding: 0 14px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: var(--ink-3); transition: background .2s, color .2s, box-shadow .2s;
}
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: #fff; color: var(--ink); font-weight: 700; box-shadow: var(--shadow-1); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 36px; padding: 0 14px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 14px; font-weight: 600; color: var(--ink-2); transition: all .15s;
}
.chip:hover { box-shadow: inset 0 0 0 1.5px #D5DAE3; }
.chip[aria-pressed="true"] { background: var(--sun-soft); color: var(--sun-deep); font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--sun-line); }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.tag-sun { background: var(--sun-soft); color: var(--sun-deep); }
.tag-sprout { background: var(--sprout-soft); color: #0E8A5B; }
.tag-sky { background: var(--sky-soft); color: #2166D9; }
.tag-berry { background: var(--berry-soft); color: #D93A6B; }
.tag-violet { background: var(--violet-soft); color: #5B41E0; }

/* ---------- card ---------- */
.card { background: #fff; border: 1px solid rgba(232, 235, 241, .9); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.card-pad { padding: 20px; }
@media (min-width: 768px) { .card-pad { padding: 28px; } }

/* ---------- AdSense 자리 표시 ---------- */
.ad {
  position: relative; max-width: 728px; min-height: 100px; margin: 0 auto;
  display: grid; place-items: center; text-align: center;
  border-radius: 14px; border: 1.5px dashed #D8DDE6;
  background: repeating-linear-gradient(45deg, #FAFBFD 0 10px, #F4F6F9 10px 20px);
  color: #A2AABA; font-size: 12px;
}
.ad::before { content: "광고"; position: absolute; top: 7px; left: 12px; font-size: 11px; font-weight: 700; color: #A9B1BF; }
.ad strong { display: block; font-size: 13px; font-weight: 700; color: #97A0B1; }
.ad-row { padding: 8px 0; }
@media (min-width: 768px) { .ad { min-height: 90px; } }
/* 승인된 광고 코드를 연결하기 전에는 목업 슬롯을 방문자에게 노출하지 않음 */
body:not(.ads-ready) .ad,
body:not(.ads-ready) .ad-row { display: none; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 100;
  display: flex; align-items: center; gap: 10px; max-width: calc(100% - 32px);
  padding: 12px 18px 12px 12px; border-radius: 16px;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 16px 40px -12px rgba(29, 36, 51, .3);
  font-size: 14px; font-weight: 600;
  opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .ok { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--sprout-soft); color: var(--sprout); }

/* ---------- footer ---------- */
.ftr { background: var(--surface-2); border-top: 1px solid var(--line); padding: 40px 0 56px; font-size: 13px; color: var(--ink-3); }
.ftr .logo { font-size: 18px; color: var(--ink); }
.ftr-desc { margin-top: 10px; color: var(--ink-2); font-size: 14px; }
.ftr-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 20px 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.ftr-links a:hover { color: var(--ink); }
.ftr-links a.em { color: var(--ink); font-weight: 800; }
.ftr-note { line-height: 1.75; }
.ftr-help {
  display: flex; align-items: center; gap: 10px; margin: 20px 0; padding: 12px 16px;
  border-radius: 14px; background: #fff; border: 1px solid var(--line); color: var(--ink-2); font-size: 13px;
}
.ftr-help b { color: var(--ink); }
.ftr-copy { margin-top: 20px; font-size: 12px; }

/* ---------- motion ---------- */
@keyframes pop {
  0% { transform: scale(.2) rotate(-140deg); opacity: 0; }
  60% { transform: scale(1.14) rotate(10deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
@keyframes shine { 0%, 55% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 122, 47, .55); } 100% { box-shadow: 0 0 0 8px rgba(255, 122, 47, 0); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: 200px 0; } }

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ---------- 맨 위로 (애드센스 앵커 광고 자리 위쪽에 배치) ---------- */
.to-top {
  position: fixed; right: 16px; bottom: 84px; z-index: 60;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--ink-2); border: 1px solid var(--line);
  box-shadow: 0 10px 24px -10px rgba(29, 36, 51, .35);
  opacity: 0; transform: translateY(12px) scale(.9); pointer-events: none;
  transition: opacity .25s, transform .25s, background .15s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { background: var(--surface-2); }
.to-top .ico { transform: rotate(180deg); }
@media (min-width: 1024px) { .to-top { right: 28px; bottom: 28px; width: 50px; height: 50px; } }

/* ---------- 터치 영역 · 안전영역 보정 ---------- */
.logo { min-height: 40px; }
.link { display: inline-flex; align-items: center; min-height: 32px; }
.ftr-links a { display: inline-flex; align-items: center; min-height: 34px; }
.subnav a { height: 36px; }
.to-top { bottom: calc(84px + env(safe-area-inset-bottom)); }
.ftr { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
@media (min-width: 1024px) { .to-top { bottom: calc(28px + env(safe-area-inset-bottom)); } }

/* 본문 바로가기 (키보드 사용자) */
.skip {
  position: fixed; left: 50%; top: 10px; z-index: 200; transform: translate(-50%, -160%);
  padding: 10px 18px; border-radius: 12px; background: var(--ink); color: #fff;
  font-size: 14px; font-weight: 700; transition: transform .2s;
}
.skip:focus { transform: translate(-50%, 0); }
main:focus { outline: none; }
