/* ==========================================================
   로또해봄 — home-top.css
   히어로 · 번호 생성기 · 이번 주 당첨결과 · 카운트다운 · 당첨확인
   ========================================================== */

/* ---------- HERO ---------- */
.hero {
  position: relative; overflow: hidden; padding: 20px 0 36px;
  background:
    radial-gradient(110% 60% at 100% 0%, #FFE6B3 0%, rgba(255, 230, 179, 0) 62%),
    radial-gradient(80% 50% at 0% 10%, #FFEDE0 0%, rgba(255, 237, 224, 0) 60%),
    linear-gradient(180deg, #FFF9EE 0%, #FFFFFF 100%);
}
.hero-art { position: absolute; inset: 0; pointer-events: none; }
.hero-sun { position: absolute; top: -86px; right: -84px; width: 250px; height: 250px; }
.hero-sun .rays { transform-origin: 50% 50%; animation: spin 50s linear infinite; }
.fb { position: absolute; border-radius: 50%; animation: bob 6s ease-in-out infinite; opacity: .9; }
.fb.ball { box-shadow: 0 10px 20px -8px rgba(29, 36, 51, .25); }
.hero-leaf { position: absolute; }
.hero-grid { position: relative; display: grid; gap: 18px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 5px;
  border-radius: 999px; background: #fff; box-shadow: var(--shadow-1);
  font-size: 13px; font-weight: 700; color: var(--ink-2);
}
.hero-badge i { width: 21px; height: 21px; border-radius: 50%; display: grid; place-items: center; background: var(--sprout-soft); color: var(--sprout); font-style: normal; }
.hero-title { margin-top: 12px; font-size: 28px; line-height: 1.28; font-weight: 800; letter-spacing: -.05em; }
.hero-title em {
  font-style: normal; color: var(--sun-deep);
  background: linear-gradient(transparent 60%, #FFE08A 60%, #FFE08A 92%, transparent 92%);
}
.hero-sub { margin-top: 8px; font-size: 15px; color: var(--ink-2); }
.pi.sun { background: var(--sun-soft); color: var(--sun-deep); }
.pi.sprout { background: var(--sprout-soft); color: var(--sprout); }
.pi.sky { background: var(--sky-soft); color: var(--sky); }
@media (min-width: 768px) {
  .hero-title { font-size: 38px; }
  .hero-sun { width: 340px; height: 340px; top: -110px; right: -90px; }
}
@media (min-width: 1024px) {
  .hero { padding: 56px 0 72px; }
  .hero-grid { grid-template-columns: 1fr 500px; align-items: center; gap: 56px; }
  .hero-title { font-size: 50px; }
  .hero-sub { font-size: 18px; margin-top: 14px; }
    .hero-sun { width: 420px; height: 420px; top: -150px; right: auto; left: 34%; }
}

/* ---------- GENERATOR ---------- */
.gen { padding: 14px; border-radius: 26px; position: relative; }
.gen-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gen-set {
  display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 12px;
  border-radius: 13px; background: var(--surface-2); color: var(--ink-2); font-size: 14px; font-weight: 700;
  transition: background .2s, color .2s;
}
.gen-set[aria-expanded="true"] { background: var(--sky-soft); color: #2166D9; }
.gen-set .cnt { display: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--sky); color: #fff; font-size: 11px; place-items: center; }
.gen-set .cnt.on { display: inline-grid; }
.gen-styles { margin-top: 12px; }

.gen-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s ease; }
.gen-panel.open { grid-template-rows: 1fr; }
.gen-panel > div { overflow: hidden; }
.slip-box { margin-top: 12px; padding: 14px; border-radius: 18px; background: var(--surface-2); }
.slip-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.slip-head .seg { background: #fff; }
.slip-head .seg button { height: 30px; font-size: 13px; padding: 0 12px; }
.slip-head .seg button[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.slip-head .seg button.ex[aria-pressed="true"] { background: #9AA3B2; }
.slip-reset { font-size: 13px; font-weight: 700; color: var(--ink-3); display: inline-flex; align-items: center; gap: 4px; }
.slip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.slip button {
  position: relative; aspect-ratio: 1; border-radius: 11px;
  background: #fff; box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 14px; font-weight: 700; color: var(--ink-2);
  transition: transform .12s, background .15s, color .15s;
}
.slip button::before { content: ""; position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--c); }
.slip button:active { transform: scale(.92); }
.slip button.fix { background: var(--c); color: #fff; text-shadow: 0 0 3px var(--sh); box-shadow: 0 4px 10px -4px var(--c); }
.slip button.fix::before { background: rgba(255, 255, 255, .85); }
.slip button.ex { background: #ECEFF3; color: #B7BECA; box-shadow: none; text-decoration: line-through; }
.slip button.ex::before { display: none; }
.slip-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-size: 12px; color: var(--ink-3); }
.slip-legend b { color: var(--ink-2); }

.gen-rows { display: grid; gap: 8px; margin: 14px 0; }
.gen-row {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 8px;
  padding: 8px 6px 8px 10px; border-radius: 16px; background: var(--surface-2); transition: background .25s, box-shadow .25s;
}
.gen-row .lbl { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: #fff; color: #B3BAC6; font-size: 11.5px; font-weight: 800; }
.gen-row .balls { gap: 5px; min-width: 0; }
.gen-row .ball { --s: clamp(30px, 8.6vw, 40px); }
.gen-row .meta { grid-column: 2 / 3; margin-top: 5px; font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.gen-row .meta:empty { display: none; }
.gen-row .row-act { grid-row: 1; grid-column: 3; }
.gen-row .row-act button { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #B3BAC6; transition: background .15s, color .15s; }
.gen-row.filled { background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); }
.gen-row.filled .lbl { background: var(--sun-soft); color: var(--sun-deep); }
.gen-row.filled .row-act button { color: var(--ink-3); }
.gen-row.filled .row-act button:hover { background: var(--surface-2); color: var(--ink); }
.gen-row .row-act button.saved { color: var(--berry); }
.gen-row .row-act button.saved svg { fill: currentColor; }
.gen.rolling .ball.empty {
  background: linear-gradient(90deg, #F1F3F7 0, #FFF3E6 40%, #F1F3F7 80%) 0 0 / 200px 100%;
  animation: shimmer 1s linear infinite;
}
.gen.rolling .gen-cta .ico { animation: spin .7s linear infinite; }
.gen-after { display: none; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.gen-after.show { display: grid; }
.gen-after .btn { height: 44px; padding: 0 8px; font-size: 13.5px; gap: 6px; }
.gen-note { margin-top: 12px; display: flex; align-items: flex-start; justify-content: center; gap: 6px; font-size: 12.5px; line-height: 1.5; color: var(--ink-3); text-align: center; }
.gen-note .ico { margin-top: 1px; }
@media (min-width: 768px) { .gen { padding: 24px; } }
@media (max-width: 360px) {
  .wrap { padding: 0 12px; }
  .gen-row .lbl { display: none; }
  .gen-row .balls { gap: 3px; }
}

/* ---------- 이번 주 당첨결과 ---------- */
.result-grid { display: grid; gap: 16px; }
@media (min-width: 1024px) { .result-grid { grid-template-columns: 1fr 360px; align-items: start; } }
.draw-nav { display: flex; align-items: center; gap: 6px; }
.draw-nav button {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink-2); transition: background .15s;
}
.draw-nav button:hover { background: #EDF0F5; }
.draw-nav button[disabled] { opacity: .35; pointer-events: none; }
.draw-card { position: relative; overflow: hidden; }
.draw-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.draw-no { font-size: 22px; font-weight: 800; letter-spacing: -.04em; }
.draw-date { font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
.draw-balls {
  display: flex; align-items: flex-start; justify-content: center; gap: 5px;
  margin: 16px 0; padding: 22px 6px 16px; border-radius: 20px;
  background: linear-gradient(180deg, #FFFBF2 0%, #FFF4E3 100%);
}
.draw-balls .ball { --s: clamp(32px, 8.8vw, 54px); }
.draw-balls .grp { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.draw-balls .grp > span:last-child { font-size: 11.5px; font-weight: 700; color: #B08A5B; }
.draw-balls .plus { height: clamp(32px, 8.8vw, 54px); display: grid; place-items: center; }
.prize-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.prize-tile { padding: 14px 16px; border-radius: 16px; background: var(--surface-2); }
.prize-tile.main { grid-column: 1 / -1; background: linear-gradient(135deg, #FFF4E6 0%, #FFE6D0 100%); }
.prize-tile .k { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.prize-tile .v { margin-top: 2px; font-size: 20px; font-weight: 800; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.prize-tile .v small { font-size: 14px; font-weight: 700; margin-left: 1px; }
.prize-tile.main .k { color: #B0643A; }
.prize-tile.main .v { font-size: 28px; color: var(--sun-deep); }
.win-type { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.win-type .tag { background: rgba(255, 255, 255, .8); color: #9A5A2E; }
@media (min-width: 768px) {
  .prize-tiles { grid-template-columns: 1.6fr 1fr 1fr; }
  .prize-tile.main { grid-column: auto; }
}

.rank-table { margin-top: 18px; font-size: 14px; }
.rank-table th { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: right; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.rank-table td { padding: 11px 4px; border-bottom: 1px solid var(--line-2); text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.rank-table th:first-child, .rank-table td:first-child { text-align: left; }
.rank-table tr:last-child td { border-bottom: 0; }
.rk { display: flex; align-items: center; gap: 9px; font-weight: 800; color: var(--ink); }
.rk i { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; flex: none; font-style: normal; font-size: 12px; color: #fff; }
.rk small { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink-3); line-height: 1.3; }
.rk1 i { background: linear-gradient(135deg, #FFC233, #FF8A1F); }
.rk2 i { background: linear-gradient(135deg, #A8B8D0, #8497B5); }
.rk3 i { background: linear-gradient(135deg, #E6B48A, #C98A5A); }
.rk4 i { background: #7ACCA8; }
.rk5 i { background: #A7B8FF; }
.rank-table .amt { font-weight: 800; color: var(--ink); }
.rank-table tr.r1 .amt { color: var(--sun-deep); }
.draw-actions { display: flex; gap: 8px; margin-top: 18px; }
.draw-actions .btn { flex: 1; }

/* 카운트다운 */
.side-stack { display: grid; gap: 16px; align-content: start; }
.cd-card {
  position: relative; overflow: hidden; padding: 20px; border-radius: 22px;
  background: linear-gradient(150deg, #FFF7D9 0%, #FFEACB 55%, #FFDCC4 100%);
  border: 1px solid #FFE4BC;
}
.cd-card .k { position: relative; font-size: 14px; font-weight: 700; color: #A0561A; }
.cd-card .k b { color: var(--ink); }
.cd-time { position: relative; display: flex; gap: 6px; margin-top: 12px; }
.cd-time span {
  flex: 1; max-width: 64px; padding: 8px 0 6px; border-radius: 13px; background: rgba(255, 255, 255, .8);
  text-align: center; font-size: 24px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.cd-time span small { display: block; margin-top: 3px; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.cd-meta { position: relative; margin-top: 12px; font-size: 13px; color: #8F5A2A; }
.cd-sun { position: absolute; top: -30px; right: -30px; width: 130px; height: 130px; }
.cd-sun .rays { transform-origin: 50% 50%; animation: spin 30s linear infinite; }

/* 내 번호 당첨 확인 */
.chk-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; }
.chk-title .pi { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; }
.chk-desc { margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.chk-inputs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 14px; }
.chk-inputs input {
  width: 100%; min-width: 0; height: 46px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface-2); text-align: center; font-size: 17px; font-weight: 800;
  -moz-appearance: textfield; appearance: textfield; transition: border-color .15s, background .15s;
}
.chk-inputs input::-webkit-outer-spin-button, .chk-inputs input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.chk-inputs input:focus { outline: 0; border-color: var(--sky); background: #fff; }
.chk-inputs input.hit { border-color: transparent; background: var(--c); color: #fff; text-shadow: 0 0 3px var(--sh); }
.chk-card .btn { width: 100%; margin-top: 10px; }
.chk-result { display: none; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.chk-result.show { display: flex; }
.chk-result.win { background: var(--sprout-soft); color: #0B7A50; }
.chk-result b { font-size: 16px; color: var(--ink); }

/* ---------- 보정 ---------- */
.d-only { display: none; }
@media (min-width: 1024px) { .ball.d-only { display: inline-grid; } }
.fortune-sec > .wrap { position: relative; z-index: 1; }
@media (max-width: 400px) {
  .rank-table { font-size: 13px; }
  .rank-table td, .rank-table th { padding-left: 2px; padding-right: 2px; }
  .rk { gap: 7px; }
}

/* 생성 전 빈 상태: 한 줄로 압축해서 CTA가 첫 화면에 보이게 */
.gen-empty {
  display: grid; justify-items: center; gap: 8px; padding: 16px 10px 14px;
  border-radius: 18px; background: var(--surface-2); border: 1.5px dashed #E1E5EC;
}
.gen-empty .balls { gap: 6px; }
.gen-empty .ball { --s: clamp(32px, 9vw, 42px); }
.gen-empty p { font-size: 13px; font-weight: 600; color: var(--ink-3); }
.hero-sub .more { display: none; }
@media (min-width: 768px) { .hero-sub .more { display: inline; } }
@media (max-width: 767px) {
  .draw-card { padding: 16px; }
  .draw-balls { padding-left: 2px; padding-right: 2px; }
  .draw-balls .ball { --s: clamp(32px, 9.4vw, 54px); }
  .draw-balls .plus { height: clamp(32px, 9.4vw, 54px); }
}
/* 태블릿: 카드도 가운데 정렬 */
@media (min-width: 768px) {
  .hero-grid { justify-items: center; }
  .hero-copy { max-width: 640px; text-align: center; }
  .gen { width: 100%; max-width: 640px; }
}
/* PC도 모바일처럼: 제목 → 번호 뽑기 → 신뢰 문구 순서로 가운데 정렬 */
@media (min-width: 1024px) {
  .hero { padding: 36px 0 56px; }
  .hero-grid { grid-template-columns: 1fr; justify-items: center; gap: 20px; }
  .hero-copy { max-width: 760px; padding-top: 0; text-align: center; }
  .hero-title { font-size: 44px; }
  .hero-sub { font-size: 17px; margin-top: 10px; }
  .gen { width: 100%; max-width: 640px; }
  .slip { grid-template-columns: repeat(7, minmax(0, 52px)); justify-content: center; }
  .hero-sun { width: 340px; height: 340px; top: -120px; right: -56px; left: auto; }
}

/* 작은 화면: 번호판을 6열로 넓혀 손가락에 맞춤 */
@media (max-width: 380px) {
  .slip { grid-template-columns: repeat(6, 1fr); gap: 5px; }
  .slip-box { padding: 12px; }
  .slip button { font-size: 13.5px; }
}
.slip-head .seg button { height: 34px; }
.slip-reset { min-height: 34px; padding: 0 6px; }
.search input { height: 34px; }
.sheet { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
