/* ==========================================================
   로또해봄 — home-bottom.css
   운세 번호 · 띠별 한마디 · 최근 당첨번호 · 번호 통계 · 가이드 · FAQ · 내 번호함
   ========================================================== */

/* ---------- 운세로 번호 받기 ---------- */
.fortune-sec { background: linear-gradient(180deg, #FFF2F6 0%, #F6F2FF 100%); overflow: hidden; }
.fortune-sec .sec-eyebrow { color: #D93A6B; }
.fortune-deco { position: absolute; pointer-events: none; }
.fortune-grid { position: relative; display: grid; gap: 16px; }
@media (min-width: 1024px) { .fortune-grid { grid-template-columns: 1fr 1fr; align-items: stretch; } }
.f-field { margin-bottom: 16px; }
.f-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.f-label small { font-weight: 500; color: var(--ink-3); }
.f-input, .f-select {
  width: 100%; height: 54px; padding: 0 16px; border-radius: 15px;
  border: 1.5px solid var(--line); background: var(--surface-2);
  font-size: 18px; font-weight: 700; transition: border-color .15s, background .15s, box-shadow .15s;
}
.f-input { letter-spacing: .06em; }
.f-input::placeholder { color: #B9C0CC; font-weight: 600; letter-spacing: 0; }
.f-input:focus, .f-select:focus { outline: 0; border-color: var(--berry); background: #fff; box-shadow: 0 0 0 4px rgba(255, 92, 138, .12); }
.f-select {
  appearance: none; font-size: 15px; font-weight: 600; padding-right: 40px;
  background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A93A5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 18px;
}
.f-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.f-2col .seg { width: 100%; height: 54px; border-radius: 15px; }
.f-2col .seg button { flex: 1; height: 46px; border-radius: 11px; }
.f-hint { min-height: 20px; margin-top: 7px; font-size: 12.5px; color: var(--ink-3); }
.f-hint.ok { color: #D93A6B; font-weight: 700; }
.f-hint.err { color: #E5484D; font-weight: 700; }
.f-form .btn-xl { margin-top: 4px; }
.f-privacy { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; font-size: 12.5px; color: var(--ink-3); }

.f-result { position: relative; overflow: hidden; min-height: 380px; }
.f-empty { height: 100%; min-height: 340px; display: grid; place-content: center; justify-items: center; text-align: center; }
.f-empty svg { width: 150px; height: 150px; animation: bob 5s ease-in-out infinite; }
.f-empty strong { margin-top: 14px; font-size: 17px; font-weight: 800; }
.f-empty p { margin-top: 4px; font-size: 14px; color: var(--ink-3); }
.f-load { display: none; }
.f-res { display: none; }
.f-result.loading .f-empty, .f-result.done .f-empty { display: none; }
.f-result.loading .f-load { display: grid; gap: 12px; }
.f-result.done .f-res { display: block; animation: fadeUp .5s ease both; }
.sk { height: 18px; border-radius: 9px; background: linear-gradient(90deg, #F1F3F7 0, #FBE9F0 40%, #F1F3F7 80%) 0 0 / 200px 100%; animation: shimmer 1s linear infinite; }
.sk.h { height: 70px; border-radius: 16px; }
.f-top { display: flex; align-items: center; gap: 14px; }
.gauge { position: relative; width: 112px; height: 66px; flex: none; }
.gauge svg { width: 112px; height: 66px; }
.gauge .arc { transition: stroke-dashoffset 1.1s cubic-bezier(.2, .8, .2, 1); }
.gauge .val { position: absolute; left: 0; right: 0; bottom: -2px; text-align: center; font-size: 26px; font-weight: 800; letter-spacing: -.04em; }
.gauge .val small { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.f-who { font-size: 13px; font-weight: 700; color: #D93A6B; }
.f-msg { margin-top: 3px; font-size: 16.5px; font-weight: 700; line-height: 1.5; letter-spacing: -.03em; }
.f-luck { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.f-luck > div { padding: 10px 6px; border-radius: 14px; background: var(--surface-2); text-align: center; }
.f-luck .k { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.f-luck .v { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 2px; font-size: 15px; font-weight: 800; }
.f-luck .sw { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.f-balls { justify-content: center; gap: 6px; padding: 18px 8px; border-radius: 18px; background: linear-gradient(180deg, #FFF4F7 0%, #F5F1FF 100%); }
.f-balls .ball { --s: clamp(34px, 9.6vw, 48px); }
.f-actions { display: flex; gap: 8px; margin-top: 14px; }
.f-actions .btn { flex: 1; }
.f-foot { margin-top: 12px; font-size: 12px; color: var(--ink-3); text-align: center; }

.zodiac { margin-top: 16px; }
.z-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.z-head h3 { font-size: 17px; font-weight: 800; }
.z-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (min-width: 640px) { .z-grid { grid-template-columns: repeat(6, 1fr); } }
@media (min-width: 1024px) { .z-grid { grid-template-columns: repeat(12, 1fr); } }
.z-grid button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 8px;
  border-radius: 15px; background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--ink-2);
  transition: transform .15s, background .15s, box-shadow .15s;
}
.z-grid button:hover { transform: translateY(-2px); }
.z-grid button .e { font-size: 26px; line-height: 1.2; }
.z-grid button[aria-pressed="true"] { background: #fff; color: #D93A6B; box-shadow: inset 0 0 0 2px var(--berry), 0 8px 18px -10px rgba(255, 92, 138, .6); }
.z-msg { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 16px; border-radius: 16px; background: var(--berry-soft); font-size: 14px; line-height: 1.55; color: #8A2A4A; }
.z-msg .balls { gap: 4px; flex: none; margin-left: auto; }

/* ---------- 최근 당첨번호 ---------- */
.hist-tools { display: flex; align-items: center; gap: 8px; }
.search { display: flex; align-items: center; gap: 4px; height: 42px; padding: 0 4px 0 12px; border-radius: 13px; background: var(--surface-2); color: var(--ink-3); }
.search input { width: 84px; border: 0; background: transparent; font-size: 14px; font-weight: 700; color: var(--ink); outline: 0; }
.search input::placeholder { color: #A9B1BF; font-weight: 600; }
.search button { height: 34px; padding: 0 12px; border-radius: 10px; background: #fff; box-shadow: var(--shadow-1); font-size: 13px; font-weight: 700; color: var(--ink); }
.hist { display: grid; gap: 10px; }
.hist-item {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 12px;
  padding: 14px 16px; border-radius: 18px; background: #fff; border: 1px solid var(--line);
  transition: transform .15s, box-shadow .2s;
}
.hist-item:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.hist-item.flash { animation: flash 1.8s ease; }
.hist-no { font-size: 15.5px; font-weight: 800; letter-spacing: -.03em; }
.hist-no small { margin-left: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.hist-prize { grid-row: 1; grid-column: 2; text-align: right; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.hist-prize b { font-weight: 800; color: var(--ink); }
.hist-item .balls { grid-row: 2; grid-column: 1 / -1; gap: 5px; }
.hist-item .ball { --s: clamp(30px, 8.4vw, 38px); }
.hist-item.new { animation: fadeUp .45s ease both; }
.hist-more { display: flex; justify-content: center; gap: 8px; margin-top: 16px; }
@media (min-width: 900px) {
  .hist-item { grid-template-columns: 170px 1fr 220px; padding: 14px 22px; }
  .hist-item .balls { grid-row: 1; grid-column: 2; }
  .hist-prize { grid-column: 3; }
}

/* ---------- 번호 통계 ---------- */
.stats-sec { background: linear-gradient(180deg, #F2F7FF 0%, #FFFFFF 100%); }
.stats-sec .sec-eyebrow { color: #2166D9; }
.stats-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.tabs { display: flex; gap: 4px; max-width: 100%; padding: 4px; border-radius: 15px; background: #fff; box-shadow: var(--shadow-1); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; height: 38px; padding: 0 16px; border-radius: 11px; font-size: 14px; font-weight: 700; color: var(--ink-3); transition: background .2s, color .2s; }
.tabs button[aria-selected="true"] { background: var(--sky); color: #fff; box-shadow: 0 8px 16px -8px rgba(61, 139, 255, .7); }
.chips.sky .chip[aria-pressed="true"] { background: var(--sky-soft); color: #2166D9; box-shadow: inset 0 0 0 1.5px #BCD6FF; }
.panel[hidden] { display: none; }
.panel { animation: fadeUp .35s ease both; }
.stats-grid { display: grid; gap: 16px; }
@media (min-width: 1024px) { .stats-grid { grid-template-columns: 1.1fr 1fr; } }
.st-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 16.5px; font-weight: 800; }
.st-sub { margin-top: 2px; font-size: 13px; color: var(--ink-3); }
.board { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; margin-top: 16px; }
.board .cell {
  aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: #EEF1F5; color: #B5BCC8; font-size: clamp(10.5px, 2.8vw, 14px); font-weight: 800;
  font-variant-numeric: tabular-nums; transition: background .4s, color .4s, transform .2s;
}
.board .cell.on { background: var(--c); color: #fff; text-shadow: 0 0 3px var(--sh); box-shadow: 0 4px 10px -5px var(--c); }
.board .cell.heat { background: color-mix(in srgb, var(--c) var(--p), #F1F3F7); color: var(--ink-2); }
.board .cell.heat.hot { color: #fff; text-shadow: 0 0 3px var(--sh); }
.board-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 14px; font-size: 12px; color: var(--ink-3); }
.lg-dot { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 50%; vertical-align: -1px; }
.bar-list { display: grid; gap: 11px; margin-top: 16px; }
.bar-item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.bar-item .bar { height: 10px; border-radius: 5px; background: var(--line-2); overflow: hidden; }
.bar-item .bar i { display: block; width: 0; height: 100%; border-radius: 5px; background: var(--c); transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.bar-item .w { min-width: 54px; text-align: right; font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bar-item .w small { font-weight: 600; color: var(--ink-3); }
.few { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.few span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px; background: var(--surface-2); font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.stack { display: flex; height: 44px; margin-top: 16px; border-radius: 14px; overflow: hidden; gap: 2px; }
.stack i { display: grid; place-items: center; min-width: 0; font-style: normal; font-size: 12.5px; font-weight: 800; color: #fff; text-shadow: 0 0 3px var(--sh); background: var(--c); transition: flex-grow .6s; }
.stack-legend { display: flex; gap: 2px; margin-top: 8px; text-align: center; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.stack-legend span { min-width: 0; transition: flex-grow .6s; }
.ratio-list { display: grid; gap: 8px; margin-top: 14px; }
.ratio { display: grid; grid-template-columns: 58px 1fr 46px; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.ratio .bar { height: 22px; border-radius: 8px; background: var(--line-2); overflow: hidden; }
.ratio .bar i { display: block; width: 0; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #A9CBFF, var(--sky)); transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.ratio.top .bar i { background: linear-gradient(90deg, #FFC08F, var(--sun)); }
.ratio .p { text-align: right; font-variant-numeric: tabular-nums; }
.mini-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.kpi { padding: 12px 6px; border-radius: 14px; background: var(--surface-2); text-align: center; }
.kpi .k { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.kpi .v { margin-top: 2px; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-note { display: flex; gap: 10px; margin-top: 16px; padding: 14px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); font-size: 13.5px; line-height: 1.65; color: var(--ink-2); }
.stat-note .ico { margin-top: 2px; color: var(--sky); }
.stat-note b { color: var(--ink); }

/* ---------- 로또 가이드 ---------- */
.guide-grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .guide-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .guide-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.g-card { display: flex; flex-direction: column; padding: 16px; border-radius: 20px; background: #fff; border: 1px solid var(--line); transition: transform .2s, box-shadow .2s; }
.g-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.g-thumb { position: relative; height: 108px; margin-bottom: 14px; border-radius: 14px; display: grid; place-items: center; overflow: hidden; }
.g-thumb .ico { width: 42px; height: 42px; stroke-width: 1.7; }
.g-thumb::after { content: ""; position: absolute; width: 90px; height: 90px; right: -24px; bottom: -34px; border-radius: 50%; background: rgba(255, 255, 255, .45); }
.g-thumb.sun { background: linear-gradient(135deg, #FFF1DE, #FFDDC4); color: var(--sun-deep); }
.g-thumb.sprout { background: linear-gradient(135deg, #E3F8EE, #C9EEDD); color: var(--sprout); }
.g-thumb.sky { background: linear-gradient(135deg, #E6F0FF, #CFE2FF); color: var(--sky); }
.g-thumb.violet { background: linear-gradient(135deg, #F1EDFF, #DED5FF); color: var(--violet); }
.g-card h3 { margin-top: 8px; font-size: 16.5px; font-weight: 800; line-height: 1.4; letter-spacing: -.035em; }
.g-card p { margin-top: 6px; font-size: 13.5px; line-height: 1.6; color: var(--ink-3); }
.g-more { display: flex; align-items: center; gap: 4px; margin-top: auto; padding-top: 12px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.prob-card { margin-top: 16px; }
.prob-table { font-size: 14px; }
.prob-table th { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.prob-table td { padding: 12px 6px; border-bottom: 1px solid var(--line-2); color: var(--ink-2); }
.prob-table tr:last-child td { border-bottom: 0; }
.prob-table th:last-child, .prob-table td:last-child { text-align: right; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 10px; max-width: 840px; }
.faq details { border-radius: 18px; background: #fff; border: 1px solid var(--line); transition: box-shadow .2s, border-color .2s; }
.faq details[open] { border-color: transparent; box-shadow: var(--shadow-2); }
.faq summary { display: flex; align-items: center; gap: 12px; padding: 16px 18px; list-style: none; cursor: pointer; font-size: 15.5px; font-weight: 700; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .q { width: 26px; height: 26px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--sun-soft); color: var(--sun-deep); font-size: 13px; font-weight: 800; }
.faq summary .ico { margin-left: auto; color: var(--ink-3); transition: transform .25s; }
.faq details[open] summary .ico { transform: rotate(180deg); }
.faq .a { padding: 0 18px 18px 56px; font-size: 14.5px; line-height: 1.75; color: var(--ink-2); }

/* ---------- 내 번호함 (시트) ---------- */
.dim { position: fixed; inset: 0; z-index: 80; background: rgba(29, 36, 51, .24); opacity: 0; pointer-events: none; transition: opacity .25s; }
.dim.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; max-height: 80vh; overflow: auto;
  padding: 10px 20px 28px; border-radius: 26px 26px 0 0; background: #fff;
  box-shadow: 0 -16px 40px -16px rgba(29, 36, 51, .3);
  transform: translateY(105%); transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.sheet.open { transform: none; }
.sheet-grip { width: 42px; height: 5px; margin: 0 auto 14px; border-radius: 3px; background: #DDE1E8; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h3 { font-size: 18px; font-weight: 800; }
.sheet-desc { margin-top: 4px; font-size: 13px; color: var(--ink-3); }
.saved-list { display: grid; gap: 8px; margin-top: 16px; }
.saved-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border-radius: 16px; background: var(--surface-2); }
.saved-item .when { font-size: 11.5px; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }
.saved-item .balls { gap: 4px; }
.saved-empty { padding: 28px 10px; text-align: center; font-size: 14px; color: var(--ink-3); }
@media (min-width: 768px) {
  .sheet { left: auto; right: 24px; bottom: 24px; width: 420px; border-radius: 26px; transform: translateY(calc(100% + 40px)); }
  .sheet.open { transform: none; }
}

@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 216, 77, 0); } 15%, 60% { box-shadow: 0 0 0 4px rgba(255, 216, 77, .9); } }

/* 가이드 카드: 모바일은 가로형으로 압축 */
.g-card .tag { align-self: flex-start; }
@media (max-width: 639px) {
  .g-card { display: grid; grid-template-columns: 76px 1fr; column-gap: 14px; align-items: start; padding: 14px; }
  .g-thumb { grid-row: 1 / 5; height: 76px; margin: 0; border-radius: 16px; }
  .g-thumb .ico { width: 30px; height: 30px; }
  .g-card .tag { justify-self: start; }
  .g-card h3 { margin-top: 6px; font-size: 15.5px; }
  .g-card p { font-size: 13px; }
  .g-more { padding-top: 6px; }
}

/* 태블릿(768~1023): 카운트다운·당첨확인을 나란히, 통계 번호판은 과하게 커지지 않게 */
@media (min-width: 768px) and (max-width: 1023px) {
  .side-stack { grid-template-columns: 1fr 1fr; align-items: start; }
  .cd-card { height: 100%; }
}
@media (min-width: 600px) {
  .board { max-width: 520px; margin-left: auto; margin-right: auto; }
  .board .cell { font-size: 14px; }
}

.st-empty {
  margin-top: 14px; padding: 12px 14px; border-radius: 14px;
  background: var(--lemon-soft); border: 1px solid #FFE9A8;
  font-size: 13px; line-height: 1.6; color: #6B5200;
}
