
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;600;700;800;900&family=Noto+Serif+KR:wght@400;500;600;700&display=swap');

/* ========================================
   MODERN BLUE - SAJU PREMIUM
======================================== */

:root {
  --primary: #2563eb;
  --primary-dark: #1746b3;
  --primary-light: #eff6ff;
  --primary-soft: #dbeafe;

  --navy: #172554;
  --ink: #1e293b;
  --text: #334155;
  --muted: #8491a5;

  --bg: #f5f8fd;
  --white: #ffffff;
  --border: #e5ebf4;

  --success: #16a36a;
  --danger: #e05252;

  --shadow: 0 8px 28px rgba(30, 64, 175, .06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
 font-family: 'Apple SD Gothic Neo', 'Nanum Gothic', sans-serif;
  line-height: 1.7;
}

.wrap {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px 45px;
}

/* ========================================
   HERO
======================================== */

.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 55px 15px 45px;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 55%, #eaf2ff 100%);
  border-bottom: 1px solid #e1eaf8;
}

.hero::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(37, 99, 235, .055);
  top: -150px;
  right: -60px;
}

.hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(37, 99, 235, .04);
  bottom: -140px;
  left: -50px;
}

.brand {
  position: relative;
  z-index: 1;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--primary);
  font-weight: 800;
}

.brand span {
  color: var(--navy);
}

.ornament {
  position: relative;
  z-index: 1;
  font-size: 42px;
  color: var(--primary);
  margin: 17px 0 8px;
}

.eyebrow {
  position: relative;
  z-index: 1;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--primary);
  font-weight: 800;
}

h1, h2, h3 {
  font-family: 'Apple SD Gothic Neo', 'Nanum Gothic', sans-serif;
}

h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(30px, 6vw, 46px);
  margin: 9px 0;
  color: var(--navy);
  font-weight: 800;
  letter-spacing: -1.5px;
}

.sub {
  position: relative;
  z-index: 1;
  color: #64748b;
  font-size: 14px;
}

.today {
  position: relative;
  z-index: 1;
  display: inline-block;
  border: 1px solid #c9dcff;
  border-radius: 30px;
  padding: 6px 18px;
  background: #ffffff;
  color: var(--primary);
  font-size: 12px;
  margin-top: 14px;
}

/* ========================================
   MAIN / COMMON CARD
======================================== */

main {
  padding-top: 30px;
}

.panel,
.fortune-card,
.number-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0px;
  padding: 15px;
  box-shadow: var(--shadow);
}

.section-title {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 22px;
}

.section-title > span {
  width: 43px;
  height: 43px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 0px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 23px;
  font-weight: 800;
}

.section-title h2 {
  font-size: 20px;
  margin: 0;
  color: var(--navy);
  font-weight: 800;
}

.section-title p {
  font-size: 12px;
  color: var(--muted);
  margin: 3px 0 0;
}

.notice {
  padding: 13px 15px;
  background: #f0f6ff;
  border-left: 3px solid var(--primary);
  border-radius: 5px 10px 10px 5px;
  color: #526681;
  font-size: 12px;
  margin-bottom: 22px;
}

/* ========================================
   FORM
======================================== */

.field {
  margin: 19px 0;
}

.field > label {
  display: block;
  color: #334155;
  font-weight: 700;
  margin-bottom: 8px;
}

input[type=date],
select {
  width: 100%;
  height: 49px;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  background: #ffffff;
  color: #26354b;
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}

input[type=date]:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .09);
}

/* 출생시간 시·분 */
.time-select-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.time-select-row select {
  flex: 1;
  min-width: 0;
}

.time-select-row select:disabled {
  opacity: .5;
  background: #f3f5f8;
}

/* 양력 / 음력 */
.segmented {
  display: flex;
  gap: 10px;
}

.segmented label {
  flex: 1;
  padding: 12px;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  text-align: center;
  color: #536176;
  font-size: 13px;
  cursor: pointer;
  transition: .2s;
}

.segmented label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

.segmented input {
  accent-color: var(--primary);
}

/* 체크박스 */
.check-field label,
.save-option {
  font-size: 13px;
  color: #536176;
}

.check-field input,
.save-option input {
  accent-color: var(--primary);
}

small {
  display: block;
  color: #94a0b2;
  font-size: 11px;
  margin-top: 6px;
}

/* ========================================
   BUTTON
======================================== */

.gold-button {
  width: 100%;
  border: 0;
  padding: 16px;
  background: linear-gradient(110deg, #2563eb, #3978f6);
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  margin-top: 20px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .2);
  transition: transform .2s, box-shadow .2s;
}

.gold-button:hover {
  background: linear-gradient(110deg, #1746b3, #2563eb);
  box-shadow: 0 8px 20px rgba(37, 99, 235, .25);
  transform: translateY(-1px);
}

.gold-button:disabled {
  opacity: .55;
  cursor: wait;
  transform: none;
}

.privacy,
.muted {
  font-size: 11px;
  color: #94a0b2;
  text-align: center;
  margin: 13px 0 0;
}

/* ========================================
   LOADING / ERROR
======================================== */

.loading,
.error {
  padding: 13px;
  text-align: center;
  margin-top: 15px;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
}

.error {
  background: #fff1f1;
  color: var(--danger);
}

/* ========================================
   RESULT
======================================== */

.result {
  margin-top: 30px;
}

.result-head {
  margin: 10px 0 20px;
  padding: 10px;
  background: #fff;
}

.result-head h2 {
  font-size: 13px;
  margin: 6px;
  font-weight: 400;
  letter-spacing: -1px;
}

.result-head p {
  color: #8491a5;
  font-size: 12px;
}

/* 운세 결과 카드 */
.fortune-card {
  text-align: center;
}

.fortune-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

.fortune-label b {
  background: var(--primary-light);
  color: var(--primary);
  padding: 4px 13px;
  border-radius: 30px;
  font-size: 11px;
}

.fortune-art {
  font-size: 48px;
  color: var(--primary);
  margin: 15px;
}

.fortune-card h3 {
  font-size: 23px;
  color: var(--navy);
  margin: 5px;
  font-weight: 800;
}

.fortune-card > p {
  max-width: 650px;
  margin: 12px auto;
  color: #536176;
  font-size: 14px;
}

/* 사주 네 기둥 */
.pillar-box {
  display: flex;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.pillar-box span {
  border: 1px solid #dce8fb;
  background: #f5f8ff;
  border-radius: 9px;
  padding: 9px 15px;
  color: #2454a6;
  font-size: 12px;
  font-weight: 700;
}

/* ========================================
   FORTUNE DETAILS
======================================== */

.luck-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 13px;
  margin: 15px 0;
}

.luck-grid article {
  background: #f8faff;
  border: 1px solid #e7edf8;
  border-radius: 0px;
  padding: 17px;
  transition: transform .2s, box-shadow .2s;
}

.luck-grid article:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(30, 64, 175, .06);
}

.luck-grid span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.luck-grid p {
  font-size: 13px;
  color: #536176;
  margin: 8px 0 0;
}

/* ========================================
   LOTTO NUMBERS
======================================== */

.number-card {
  margin-top: 15px;
  text-align: center;
}

.number-card h3 {
  font-size: 20px;
  color: var(--navy);
  margin: 5px 0 18px;
  font-weight: 800;
}

.balls {
  display: flex;
  justify-content: center;
  gap: 9px;
  flex-wrap: wrap;
}

.ball {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .14);
}

.lotto-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 0;
  border-bottom: 1px solid #edf1f7;
}

.lotto-row:last-child {
  border: 0;
}

.set-label {
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  margin-right: 5px;
}

/* 결과 버튼 */
.outline-button {
  display: block;
  margin: 18px auto 0;
  background: #ffffff;
  border: 1px solid #b7cdf7;
  color: var(--primary);
  border-radius: 30px;
  padding: 11px 25px;
  cursor: pointer;
  font-weight: 700;
  transition: .2s;
}

.outline-button:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

/* ========================================
   FOOTER
======================================== */

footer {
  text-align: center;
  color: #9aa6b8;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 40px 10px 0;
}

footer small {
  font-size: 10px;
  letter-spacing: 0;
}

/* ========================================
   MOBILE
======================================== */

@media(max-width: 600px) {
  .wrap {
    padding: 0 13px 32px;
  }

  .hero {
    padding: 39px 10px 32px;
  }

  .ornament {
    font-size: 36px;
  }

  h1 {
    font-size: 32px;
  }

  .panel,
  .fortune-card,
  .number-card {
    padding: 15px;
    border-radius: 15px;
  }

  .section-title h2 {
    font-size: 18px;
  }

  .luck-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .ball {
    width: 37px;
    height: 37px;
    font-size: 13px;
  }

  .lotto-row {
    gap: 5px;
  }

  .set-label {
    display: none;
  }

  .pillar-box {
    gap: 6px;
  }

  .pillar-box span {
    padding: 7px 10px;
  }
}

/* ========================================
   PRINT
======================================== */

@media print {
  body {
    background: #ffffff;
    color: #222222;
  }

  .hero {
    background: #ffffff;
  }

  .brand,
  .eyebrow,
  .hero h1,
  .sub,
  .today {
    color: #222222;
  }

  .panel,
  .outline-button,
  footer {
    display: none !important;
  }

  .fortune-card,
  .number-card,
  .luck-grid article {
    background: #ffffff;
    color: #222222;
    box-shadow: none;
    border: 1px solid #cccccc;
  }

  .fortune-card h3,
  .number-card h3,
  .fortune-card > p,
  .luck-grid p {
    color: #222222;
  }

  .result {
    display: block !important;
  }
}


/* =========================================
   SAJU FUN ZONE
========================================= */

.fun-zone {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.fun-card {
    min-width: 0;
    padding: 22px;
    border: 1px solid #e9e1d1;
    border-radius: 15px;
    background: #fffdf8;
    overflow: hidden;
}

.fun-heading {
    margin-bottom: 20px;
}

.fun-heading > span {
    color: #b18a42;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.5px;
}

.fun-heading h3 {
    margin: 7px 0;
    color: #44351f;
    font-size: 19px;
    font-weight: 800;
}

.fun-heading p {
    margin: 0;
    color: #898174;
    font-size: 12px;
    line-height: 1.6;
}

/* 행운 부적 */

.talisman-inner {
    position: relative;
    padding: 24px 15px;
    text-align: center;
    color: #fff2ce;
    background: linear-gradient(145deg, #8c2525, #4d1010);
    border: 5px double #c9a45e;
    border-radius: 12px;
}

.talisman-symbol {
    font-size: 48px;
    color: #f4d58b;
}

.talisman-name {
    margin: 8px 0;
    font-size: 19px;
    font-weight: 800;
    color: #f7d995;
}

.talisman-message {
    font-size: 12px;
    line-height: 1.7;
}

.talisman-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 15px;
}

.talisman-info > div {
    padding: 12px 4px;
    text-align: center;
    background: #f6f0e5;
    border-radius: 8px;
}

.talisman-info span {
    display: block;
    color: #91836c;
    font-size: 10px;
    margin-bottom: 5px;
}

.talisman-info b {
    color: #654a27;
    font-size: 12px;
}

/* 룰렛 */

.roulette-wrap {
    position: relative;
    width: 210px;
    height: 210px;
    margin: 0 auto 20px;
}

.roulette-wheel {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 7px solid #d5b36d;
    background: conic-gradient(
        #a84a38 0deg 90deg,
        #d7ad57 90deg 180deg,
        #426c65 180deg 270deg,
        #755b8b 270deg 360deg
    );
    box-shadow: 0 5px 15px rgba(0,0,0,.15);
    transition: transform 4s cubic-bezier(.12,.75,.18,1);
}

.roulette-pointer {
    position: absolute;
    top: -12px;
    left: 50%;
    z-index: 5;
    transform: translateX(-50%);
    color: #b22e25;
    font-size: 26px;
}

.roulette-labels span {
    position: absolute;
    color: white;
    font-size: 13px;
    font-weight: 800;
}

.roulette-labels span:nth-child(1) {
    top: 28%;
    right: 17%;
}

.roulette-labels span:nth-child(2) {
    bottom: 25%;
    right: 17%;
}

.roulette-labels span:nth-child(3) {
    bottom: 25%;
    left: 15%;
}

.roulette-labels span:nth-child(4) {
    top: 28%;
    left: 15%;
}

.roulette-center {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    color: #8b6026;
    background: #fff2ce;
    border: 3px solid #d4ad60;
    font-size: 10px;
    font-weight: 900;
}

.fun-button {
    display: block;
    width: 100%;
    padding: 13px 15px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(110deg, #a87b36, #d0a953);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.fun-button:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.fun-button.secondary {
    margin-top: 8px;
    color: #73552a;
    background: #f0e7d5;
}

.roulette-result {
    min-height: 42px;
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #f7f0e3;
    color: #74562d;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}

/* 운세 공유 카드 */

.fortune-share-preview {
    padding: 20px 14px;
    margin-bottom: 15px;
    text-align: center;
    color: #fff0c9;
    background: linear-gradient(145deg, #451b19, #842e27);
    border: 4px double #c5a05e;
    border-radius: 12px;
}

.share-preview-top {
    font-size: 10px;
    letter-spacing: 3px;
    color: #e9ca83;
}

.share-preview-symbol {
    margin: 15px 0 5px;
    color: #e6c47d;
    font-size: 40px;
}

.share-preview-date {
    color: #e8d5a8;
    font-size: 11px;
}

.fortune-share-preview h3 {
    margin: 12px 0;
    font-size: 20px;
    color: #f8d995;
}

.fortune-share-preview p {
    font-size: 12px;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.share-preview-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 18px 0;
}

.share-preview-numbers span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 29px;
    height: 29px;
    border-radius: 50%;
    background: #e6bd66;
    color: #512d19;
    font-size: 11px;
    font-weight: 900;
}

.share-preview-bottom {
    color: #e9c980;
    font-size: 11px;
}

/* 오행 그래프 */

.element-graph {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.element-row {
    display: grid;
    grid-template-columns: 53px minmax(0, 1fr) 40px;
    align-items: center;
    gap: 10px;
}

.element-row > span {
    font-size: 12px;
    color: #65543d;
    font-weight: 700;
}

.element-row > b {
    font-size: 11px;
    color: #92723c;
    text-align: right;
}

.element-track {
    height: 11px;
    overflow: hidden;
    border-radius: 20px;
    background: #eee8dd;
}

.element-bar {
    width: 0;
    height: 100%;
    border-radius: 20px;
    transition: width 1s ease;
}

#elementWood { background: #57966a; }
#elementFire { background: #d56b56; }
#elementEarth { background: #d4a94c; }
#elementMetal { background: #a9a9a9; }
#elementWater { background: #5688bb; }

.element-comment {
    margin-top: 20px;
    padding: 13px;
    background: #f5f0e6;
    border-radius: 8px;
    color: #765c31;
    font-size: 12px;
    line-height: 1.7;
}

.element-notice {
    margin-top: 12px;
    color: #999084;
    font-size: 10px;
    line-height: 1.6;
}

/* 모바일 */

@media (max-width: 650px) {
    .fun-zone {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .fun-card {
        padding: 18px;
    }

    .roulette-wrap {
        width: 195px;
        height: 195px;
    }
}

/* 모바일 생년월일 날짜 입력창 잘림 방지 */
#birth_date {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    height: 48px;
    padding: 0 10px;
    font-size: 16px;
    -webkit-appearance: none;
    appearance: none;
}

/* 날짜 입력창을 포함하는 영역 */
#birth_date,
#birth_date * {
    box-sizing: border-box;
}

@media (max-width: 600px) {
    #birth_date {
        width: 100%;
        max-width: 100%;
        font-size: 16px;
        padding-left: 8px;
        padding-right: 8px;
    }
}

.year-zodiac {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin: 18px auto 5px;
}

.year-zodiac[hidden] {
    display: none;
}

.year-zodiac img {
    width: 90px;
    height: 82px;
    object-fit: contain;
    border-radius: 10px;
}

.year-zodiac-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.year-zodiac-info strong {
    font-size: 17px;
    color: #9b7132;
}

.year-zodiac-info span {
    font-size: 13px;
    color: #777;
}
.pillar-box {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.pillar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.pillar-item img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}
.pillar-box {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.pillar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}

.pillar-item img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

/* 오늘의 운세 그래프 */
.fortune-graphs {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 24px 0;
}

.fortune-graph-card {
    min-width: 0;
    padding: 22px;
    background: #fff;
    border: 1px solid #e5e8ed;
}

.fortune-graph-card h3 {
    margin: 0 0 7px;
    color: #27364a;
    font-size: 18px;
    font-weight: 800;
}

.fortune-graph-desc {
    margin: 0 0 20px;
    color: #687386;
    font-size: 13px;
    line-height: 1.6;
}

.fortune-overall-score {
    margin: 8px 0 15px;
    color: #246fc0;
    font-size: 38px;
    font-weight: 900;
    letter-spacing: -1px;
}

.fortune-bar-row {
    margin-bottom: 17px;
}

.fortune-bar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    color: #39475a;
    font-size: 14px;
    font-weight: 600;
}

.fortune-bar-top strong {
    color: #246fc0;
    font-size: 14px;
    font-weight: 800;
}

.fortune-bar-track {
    width: 100%;
    height: 12px;
    overflow: hidden;
    background: #e9edf2;
    border-radius: 3px;
}

.fortune-overall-track {
    height: 17px;
}

.fortune-bar-fill {
    width: 0;
    height: 100%;
    background: #438bd1;
    border-radius: 3px;
    transition: width 0.8s ease;
}

.fortune-bar-fill.high {
    background: #269b72;
}

.fortune-bar-fill.low {
    background: #d58b43;
}

.fortune-score-message {
    margin: 16px 0 0;
    padding: 12px 14px;
    background: #f3f7fc;
    color: #40546c;
    font-size: 13px;
    line-height: 1.7;
    border-left: 3px solid #438bd1;
}

@media (max-width: 650px) {
    .fortune-graphs {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .fortune-graph-card {
        padding: 17px;
    }

    .fortune-graph-card h3 {
        font-size: 16px;
    }

    .fortune-overall-score {
        font-size: 34px;
    }
}


