@import url('https://fonts.googleapis.com/css2?family=Gaegu:wght@400;700&family=Gowun+Dodum&display=swap');

:root {
  --paper: #fbf6e9;
  --paper-line: #ecdfc0;
  --card: #fffdf6;
  --ink: #17171f;
  --ink-soft: #3d3d50;
  --stamp: #d64545;
  --stamp-dark: #b73535;
  --gold: #e8b94a;
  --gold-soft: #f6dfa0;
  --mint: #7fbfa0;
  --mint-soft: #cfe9dc;
  --pencil: #77778c;
  --radius-card: 22px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: var(--ink);
  background-color: var(--paper);
  background-image: repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 34px,
      var(--paper-line) 34px,
      var(--paper-line) 35px
    );
  display: flex;
  justify-content: center;
  padding: 28px 14px 60px;
}

.wrap { width: 100%; max-width: 460px; }

h1, h2, h3, .brush { font-family: 'Gaegu', cursive; }

/* ---------- 상단 히어로 ---------- */
.hero {
  text-align: center;
  margin-bottom: 22px;
  position: relative;
}

.mascot-cluster {
  font-size: 40px;
  display: inline-flex;
  gap: 6px;
  animation: floaty 3.2s ease-in-out infinite;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-8px) rotate(2deg); }
}

.hero h1 {
  font-size: 30px;
  margin: 8px 0 4px;
  color: var(--stamp);
  letter-spacing: -0.5px;
}

.hero .sub {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0;
}

.dday-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px 20px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-family: 'Gaegu', cursive;
  font-size: 17px;
  box-shadow: 0 6px 0 rgba(0,0,0,0.12);
}

.dday-banner b { color: var(--gold-soft); font-size: 19px; }

/* ---------- 수험표(티켓) 스타일 카드 ---------- */
.ticket-card {
  position: relative;
  background: var(--card);
  border: 2px dashed #d9cba0;
  border-radius: var(--radius-card);
  padding: 26px 22px 24px;
  box-shadow: 0 10px 0 rgba(43,43,61,0.06), 0 14px 24px rgba(43,43,61,0.08);
  margin-bottom: 22px;
}

.ticket-card::before,
.ticket-card::after {
  content: "";
  position: absolute;
  width: 26px;
  height: 26px;
  background: var(--paper);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: inset 0 0 0 2px #d9cba0;
  display: none; /* 세로형 카드에서는 미사용, 결과표에서 활성화 */
}

.tape {
  position: absolute;
  width: 68px;
  height: 22px;
  opacity: 0.85;
  top: -12px;
}
.tape.left { left: 18px; background: var(--mint-soft); transform: rotate(-8deg); }
.tape.right { right: 18px; background: var(--gold-soft); transform: rotate(7deg); }

.stamp {
  position: absolute;
  top: 14px;
  right: 18px;
  width: 58px;
  height: 58px;
  border: 3px solid var(--stamp);
  border-radius: 50%;
  color: var(--stamp);
  font-family: 'Gaegu', cursive;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: rotate(-14deg);
  opacity: 0.85;
}

/* ---------- 폼 ---------- */
.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-family: 'Gaegu', cursive;
  font-size: 17px;
  margin-bottom: 6px;
  color: var(--ink);
}

.field .hint {
  font-size: 13.5px;
  color: var(--pencil);
  margin-top: 4px;
}

input[type="text"],
input[type="date"],
select {
  width: 100%;
  padding: 12px 14px;
  font-family: 'Gowun Dodum', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: #fffefb;
  border: none;
  border-bottom: 2.5px dashed var(--gold);
  border-radius: 10px 10px 0 0;
  outline: none;
  transition: background 0.15s ease;
}

input[type="text"]:focus,
input[type="date"]:focus,
select:focus {
  background: var(--mint-soft);
}

.error-box {
  background: #fdeaea;
  border: 1.5px dashed var(--stamp);
  color: var(--stamp-dark);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 18px;
  border: none;
  border-radius: 14px;
  font-family: 'Gaegu', cursive;
  font-size: 19px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--stamp), var(--stamp-dark));
  box-shadow: 0 6px 0 var(--stamp-dark);
  transition: transform 0.08s ease;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--stamp-dark); }

.btn.secondary {
  background: linear-gradient(135deg, var(--mint), #5fa080);
  box-shadow: 0 6px 0 #4c8267;
  margin-top: 10px;
}
.btn.secondary:active { box-shadow: 0 2px 0 #4c8267; }

.btn.ghost {
  background: var(--card);
  color: var(--ink);
  border: 2px dashed var(--pencil);
  box-shadow: none;
  margin-top: 10px;
}

.footnote {
  text-align: center;
  font-size: 13px;
  color: var(--pencil);
  margin-top: 18px;
  line-height: 1.6;
}

/* ---------- 결과 페이지 ---------- */
.result-head {
  text-align: center;
  margin-bottom: 6px;
}
.result-head .zodiac-badge {
  display: inline-block;
  background: var(--gold-soft);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 14px;
  margin-bottom: 10px;
}
.result-head h2 {
  font-size: 26px;
  margin: 4px 0;
}
.result-head .score-total {
  font-family: 'Gaegu', cursive;
  font-size: 44px;
  color: var(--stamp);
  margin: 4px 0 0;
}
.result-head .score-total span { font-size: 16px; color: var(--ink-soft); }

.chart-wrap {
  background: #fffefb;
  border-radius: 18px;
  padding: 10px 6px 4px;
  margin: 18px 0;
}

.score-bars { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.score-bar-row { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.score-bar-row .label { width: 68px; flex-shrink: 0; color: var(--ink-soft); font-weight: 600; }
.score-bar-track {
  flex: 1;
  height: 12px;
  background: #eee3c8;
  border-radius: 999px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint), var(--gold));
}
.score-bar-row .val { width: 30px; text-align: right; color: var(--ink); font-weight: 600; }

.summary-box {
  background: var(--mint-soft);
  border-radius: 16px;
  padding: 18px 16px;
  font-size: 16.5px;
  line-height: 1.9;
  color: var(--ink);
  margin: 18px 0;
}

/* 중요한 문장(집중력/멘탈/체력/행운/조언 등) 강조 표시 */
.summary-box strong.hl {
  font-family: 'Gaegu', cursive;
  font-weight: 700;
  font-size: 1.05em;
  color: var(--stamp-dark);
  background: linear-gradient(to top, rgba(232, 185, 74, 0.45) 0%, rgba(232, 185, 74, 0.45) 38%, transparent 38%);
  padding: 0 2px;
}

.lucky-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 18px 0;
  text-align: center;
}
.lucky-grid .lucky-item {
  background: #fffefb;
  border: 1.5px dashed var(--gold);
  border-radius: 14px;
  padding: 10px 6px;
}
.lucky-grid .lucky-item .k { font-size: 12.5px; color: var(--pencil); display: block; margin-bottom: 4px; }
.lucky-grid .lucky-item .v { font-size: 14.5px; font-weight: 700; color: var(--ink); }

.share-row { display: flex; gap: 8px; margin-top: 20px; }
.share-row .btn { margin-top: 0; }

.kakao-btn {
  background: #fee500 !important;
  color: #3c1e1e !important;
  box-shadow: 0 6px 0 #d9c400 !important;
}
.kakao-btn:active { box-shadow: 0 2px 0 #d9c400 !important; }

/* ---------- 신비로운 로딩 오버레이 ---------- */
.casting-overlay {
  position: fixed;
  inset: 0;
  background: rgba(43, 43, 61, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.casting-overlay.show { display: flex; }

.casting-inner { text-align: center; color: #fbf6e9; }

.casting-orb {
  font-size: 64px;
  animation: orb-spin 1.8s ease-in-out infinite;
  filter: drop-shadow(0 0 18px rgba(232, 185, 74, 0.7));
}
@keyframes orb-spin {
  0%, 100% { transform: scale(1) rotate(-8deg); }
  50% { transform: scale(1.15) rotate(8deg); }
}

.casting-text {
  font-family: 'Gaegu', cursive;
  font-size: 22px;
  margin: 18px 0 4px;
}
.casting-sub { font-size: 13px; color: #cfc7b0; margin: 0; }

.dots span {
  animation: dot-blink 1.4s infinite;
  opacity: 0;
}
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-blink {
  0%, 20% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------- 부적을 여는 듯한 결과 등장 애니메이션 ---------- */
.reveal-in {
  animation: reveal-pop 0.6s cubic-bezier(0.2, 0.8, 0.3, 1.2) both;
}
@keyframes reveal-pop {
  0% { opacity: 0; transform: scale(0.86) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.stamp-pop {
  animation: stamp-bounce 0.5s 0.5s cubic-bezier(0.3, 1.6, 0.4, 1) both;
}
@keyframes stamp-bounce {
  0% { opacity: 0; transform: rotate(-14deg) scale(0.3); }
  70% { opacity: 1; transform: rotate(-14deg) scale(1.15); }
  100% { opacity: 1; transform: rotate(-14deg) scale(1); }
}

/* ---------- 상세풀이 섹션 ---------- */
.section-title {
  font-family: 'Gaegu', cursive;
  font-size: 18px;
  margin: 22px 0 10px;
  color: var(--ink);
}

.detail-card {
  background: #fffefb;
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--ink);
  line-height: 1.75;
  margin-bottom: 10px;
}
.detail-card b { font-family: 'Gaegu', cursive; font-size: 16px; }

.time-grid, .subject-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.time-grid .mini-card, .subject-grid .mini-card {
  background: var(--mint-soft);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.6;
}
.time-grid .mini-card b, .subject-grid .mini-card b {
  display: block;
  font-family: 'Gaegu', cursive;
  font-size: 15.5px;
  margin-bottom: 4px;
}

/* ---------- 나만의 수능 부적 카드 ---------- */
.amulet-wrap { text-align: center; margin: 26px 0 6px; }

.amulet-card {
  display: inline-block;
  width: 240px;
  background: linear-gradient(180deg, #fff8e6, #fbe7b8);
  border: 4px double var(--stamp);
  border-radius: 12px;
  padding: 24px 16px 20px;
  position: relative;
  box-shadow: 0 8px 20px rgba(214, 69, 69, 0.18);
}
.amulet-top {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--stamp);
  font-weight: 700;
}
.amulet-emoji { font-size: 44px; margin: 8px 0 2px; }
.amulet-name { font-family: 'Gaegu', cursive; font-size: 20px; margin: 2px 0; }
.amulet-zodiac { font-size: 13.5px; color: var(--ink-soft); }

/* 점수 대신 들어가는 부적 문양 */
.amulet-mark {
  color: var(--stamp);
  margin: 14px auto 2px;
  display: flex;
  justify-content: center;
  filter: drop-shadow(0 2px 2px rgba(183, 53, 53, 0.15));
}
.amulet-mark-caption {
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--stamp-dark);
  margin: 4px 0 0;
}

.amulet-divider { border: none; border-top: 1.5px dashed var(--stamp); margin: 12px 0; opacity: 0.5; }
.amulet-blessing { font-size: 13.5px; color: var(--ink-soft); line-height: 1.6; }

.amulet-caption {
  font-size: 14px;
  color: var(--ink-soft);
  max-width: 260px;
  margin: 12px auto 14px;
  line-height: 1.7;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #d9a530);
  color: #3c2b0a;
  font-family: 'Gaegu', cursive;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 5px 0 #b9832a;
}
.download-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #b9832a; }

/* ---------- 제휴상품 영역 ---------- */
.product-section { margin-top: 26px; }
.product-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.product-section-head h3 {
  font-size: 17px;
  margin: 0;
}
.ad-badge {
  font-size: 10.5px;
  color: var(--pencil);
  border: 1px solid var(--pencil);
  border-radius: 999px;
  padding: 1px 8px;
}

.product-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x proximity;
}
.product-scroll::-webkit-scrollbar { height: 5px; }
.product-scroll::-webkit-scrollbar-thumb { background: var(--gold-soft); border-radius: 999px; }

.product-card {
  flex: 0 0 auto;
  width: 108px;
  background: #fffefb;
  border: 1.5px solid #eee1c0;
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  scroll-snap-align: start;
}
.product-card .product-emoji { font-size: 28px; margin-bottom: 6px; }
.product-card .product-name { font-size: 12.5px; color: var(--ink); line-height: 1.4; min-height: 30px; }
.product-card .product-price { font-size: 12.5px; color: var(--stamp); font-weight: 700; margin-top: 4px; }

@media (max-width: 360px) {
  .hero h1 { font-size: 26px; }
  .mascot-cluster { font-size: 32px; }
}




/*푸터*/

footer.site-footer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 2px dashed #d8cdbf;
}
footer.site-footer .footer-inner {
  text-align: center;
  padding: 0 12px 20px;
}
footer.site-footer p.affiliate-notice {
  font-size: 11px !important;
  line-height: 1.6;
  color: #808080 !important;
  margin: 0 0 10px 0 !important;
}
footer.site-footer p.footer-meta {
  font-size: 12px !important;
  color: #a89f91 !important;
  margin: 0 !important;
}
footer.site-footer p.footer-meta a {
  color: #a89f91 !important;
  text-decoration: underline;
}


/*카톡공유*/

.kakao-share-wrap {
  text-align: center;
  margin: 18px 0 4px;
}
.kakao-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FEE500 !important;
  color: #3C1E1E !important;
  border: 2px dashed #d8b400 !important;
  border-radius: 14px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.08);
}
.kakao-share-btn:active {
  transform: translateY(1px);
}


/*카테고리*/
.hero-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.hero-nav-item {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,0.5);
  color: var(--pencil, #7a6f5f);
  text-decoration: none;
  border: 1px dashed #d8cdbf;
}
.hero-nav-item.active {
  background: #fff;
  font-weight: 700;
  color: #3c1e1e;
}

.shop-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #fff7ec, #ffe9d6);
  border: 2px dashed #e8c9a0;
  border-radius: 16px;
  padding: 14px 18px;
  margin: 20px 0;
  text-decoration: none;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.05);
}
.shop-banner-text b {
  display: block;
  color: #3c1e1e;
  font-size: 15px;
  margin-bottom: 4px;
}
.shop-banner-text span {
  font-size: 12px;
  color: #a89f91;
}
.shop-banner-arrow {
  font-size: 20px;
  color: #e0955a;
}



/* 쇼핑상품페이지 */

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin: 16px 0 20px;
}
.category-tabs .tab {
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px dashed #d8cdbf;
  background: rgba(255,255,255,0.6);
  color: var(--pencil, #7a6f5f);
  cursor: pointer;
  font-family: inherit;
}
.category-tabs .tab.active {
  background: #fff;
  font-weight: 700;
  color: #3c1e1e;
  border-style: solid;
}










/* ===== 쇼핑 상품 그리드 (모바일 기본: 3컬럼) ===== */
#shopProductGrid.product-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px;
  margin-top: 16px;
  overflow: visible !important;
  white-space: normal !important;
}

#shopProductGrid.product-grid .product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: #fffefb;
  border: 1.5px dashed #d8cdbf;
  border-radius: 12px;
  padding: 8px 6px;
  box-sizing: border-box;
  min-width: 0;
  width: auto;   /* 캐러셀용 .product-card의 width:108px 무력화 */
  flex-shrink: initial;
}

#shopProductGrid.product-grid .product-emoji {
  width: 100%;
  display: flex;
  justify-content: center;
}

#shopProductGrid.product-grid .product-card img {
  width: 100%;
  max-width: 60px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  height: auto;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}

#shopProductGrid.product-grid .product-name {
  font-size: 11px;
  color: var(--ink);
  line-height: 1.35;
  margin-top: 6px;
  min-height: 0;
  word-break: keep-all;
}

#shopProductGrid.product-grid .product-price {
  font-size: 11px;
  color: var(--stamp);
  font-weight: 700;
  margin-top: 3px;
}

/* ===== PC (768px 이상): 6컬럼 ===== */
@media (min-width: 768px) {
  .wrap-shop {
    max-width: 760px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
  }

  #shopProductGrid.product-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    gap: 10px;
  }

  #shopProductGrid.product-grid .product-card {
    padding: 10px 8px;
  }

  #shopProductGrid.product-grid .product-card img {
    max-width: 75px;
  }

  #shopProductGrid.product-grid .product-name {
    font-size: 12px;
  }

  #shopProductGrid.product-grid .product-price {
    font-size: 12px;
  }
