/* 기본 세팅 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", system-ui, sans-serif;
  background: radial-gradient(circle at top, #1f2240 0, #070815 45%, #04030a 100%);
  color: #f5f5ff;
  line-height: 1.6;
}

/* 링크 기본 */
a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* 레이아웃 공통 */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* 헤더 & 네비게이션 */
header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  background: linear-gradient(to right, rgba(10, 10, 25, 0.86), rgba(12, 8, 24, 0.9));
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0, #ff8ed4 0, #be4bff 40%, #4b6dff 80%);
  box-shadow: 0 0 18px rgba(190, 75, 255, 0.8);
}

.logo-text-main {
  font-weight: 700;
  font-size: 18px;
}

.logo-text-sub {
  font-size: 11px;
  color: #c3c6ff;
}

nav ul {
  display: flex;
  gap: 18px;
  list-style: none;
  font-size: 14px;
}

nav a {
  padding: 6px 10px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 12px rgba(130, 87, 230, 0.6);
}

nav a.active {
  background: linear-gradient(120deg, #8257e6, #e15eff);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(225, 94, 255, 0.7);
}

/* 메인 공통 */
main {
  flex: 1;
  padding: 40px 0 60px;
}

/* 히어로 섹션 (홈 전용) */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  margin: 30px 0 40px;
}

.hero-text h1 {
  font-size: 32px;
  margin-bottom: 12px;
}

.hero-text h1 span {
  background: linear-gradient(120deg, #ff8ed4, #9d7dff, #5bbdff);
  -webkit-background-clip: text;
  color: transparent;
}

.hero-text p {
  font-size: 15px;
  color: #c7caf5;
}

.hero-cta {
  margin-top: 22px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
  border: none;
  outline: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(115deg, #8257e6, #e15eff);
  color: #fff;
  box-shadow: 0 0 18px rgba(225, 94, 255, 0.7);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #f5f5ff;
}

/* 카드 레이아웃 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(130, 87, 230, 0.16));
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.card h2,
.card h3 {
  font-size: 16px;
  margin-bottom: 6px;
}

.card p {
  font-size: 13px;
  color: #d3d5ff;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.07);
  color: #e5e5ff;
  margin-bottom: 8px;
}

/* 섹션 타이틀 */
.section-title {
  font-size: 20px;
  margin-bottom: 10px;
}

.section-sub {
  font-size: 13px;
  color: #b9bcff;
  margin-bottom: 18px;
}

/* 텍스트 페이지용 */
.text-page h1 {
  font-size: 24px;
  margin-bottom: 12px;
}

.text-page h2 {
  font-size: 18px;
  margin: 20px 0 8px;
}

.text-page p {
  font-size: 14px;
  color: #dddfff;
  margin-bottom: 8px;
}

.text-page ul {
  margin: 8px 0 16px 18px;
  font-size: 14px;
  color: #d6d8ff;
}

.text-page li {
  margin-bottom: 4px;
}

/* 운세 상세 */
.fortune-summary {
  background: linear-gradient(135deg, rgba(225, 94, 255, 0.15), rgba(91, 189, 255, 0.12));
  border-radius: 18px;
  padding: 18px;
  border: 1px solid rgba(244, 158, 255, 0.45);
  margin-bottom: 18px;
}

.fortune-detail {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.2fr);
  gap: 20px;
  margin-top: 16px;
}

.fortune-block h3 {
  font-size: 15px;
  margin-bottom: 4px;
}

.fortune-block p {
  font-size: 13px;
  color: #dcdfff;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

/* 폼(문의 페이지) */
.form {
  margin-top: 16px;
  display: grid;
  gap: 10px;
  max-width: 480px;
}

.form label {
  font-size: 13px;
}

.form input,
.form textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(5, 5, 20, 0.9);
  color: #f4f4ff;
  padding: 8px 10px;
  font-size: 14px;
}

.form textarea {
  min-height: 120px;
  resize: vertical;
}

/* 푸터 */
footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 0 22px;
  margin-top: 30px;
  font-size: 12px;
  color: #a5a8d8;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 12px;
}

/* ---- TAROT PAGE ---- */
.tarot-intro {
  margin-bottom: 16px;
  font-size: 14px;
  color: #dddfff;
}

.tarot-intro strong {
  color: #ffb7ff;
}

.tarot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 16px 0 22px;
}

/* 카드 크기 수정 */
.tarot-card-btn {
  border: none;
  outline: none;
  cursor: pointer;
  border-radius: 16px;
  padding: 18px 8px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  color: #fdf5ff;
  background: radial-gradient(circle at top, #3e2a6e 0, #140a2b 55%, #05030d 100%);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  width: 220px;   /* 카드 가로 크기 */
  height: 330px;  /* 카드 세로 크기 */
  margin: 10px;
}

.tarot-card-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0, rgba(255, 189, 255, 0.6), transparent 55%);
  opacity: 0.6;
  pointer-events: none;
}

.tarot-card-btn span {
  position: relative;
}

.tarot-card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.85);
}

.tarot-card-label {
  font-size: 11px;
  opacity: 0.8;
  display: block;
}

.tarot-result {
  margin-top: 10px;
}

.tarot-card-name {
  font-size: 18px;
  margin-bottom: 6px;
}

.tarot-card-sub {
  font-size: 13px;
  color: #b9bcff;
  margin-bottom: 10px;
}

/* ---- TAROT FLIP CARD ---- */
.tarot-display {
  margin: 14px auto 10px;
  display: flex;
  justify-content: center;
  perspective: 1200px;
}

/* 카드 뒤집기 애니메이션 */
.tarot-flip-card {
  position: relative;
  width: 320px;  /* 카드 가로 크기 */
  height: 480px; /* 카드 세로 크기 */
  transform-style: preserve-3d;
  transition: transform 0.7s cubic-bezier(0.23, 0.74, 0.18, 1);
}

.tarot-flip-card.is-flipped {
  transform: rotateY(180deg);
}

.tarot-face {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  backface-visibility: hidden;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
}


.tarot-front {
  background: radial-gradient(circle at 20% 0, #ffb7ff 0, #7b4bff 40%, #17092b 80%);
}

.tarot-back {
  background: radial-gradient(circle at 10% 0, #2f3a76 0, #101425 40%, #05040f 80%);
  transform: rotateY(180deg); /* 뒷면 회전 */
}

/* 카드 앞면과 뒷면 이미지 크기 조정 */
.tarot-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;  /* 이미지가 카드 크기에 맞게 잘라짐 */
}

/* 텍스트 스타일 조정 */
.tarot-front-title {
  font-size: 18px;  /* 제목 크기 */
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tarot-front-sub {
  margin-top: 6px;
  font-size: 12px;  /* 서브 제목 크기 */
  color: #f4dcff;
}

.tarot-back-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  text-align: center;
}

.tarot-back-sub {
  font-size: 12px;
  color: #c9cff9;
  text-align: center;
}



/* 반응형 */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  nav ul {
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
  }

  .fortune-detail {
    grid-template-columns: minmax(0, 1fr);
  }
}
