* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --navy: #191b35;
  --brown: #7a4b16;
  --brown-dark: #5c3914;
  --gold: #9a6417;
  --gold-light: #ffd966;
  --text: #2a1d16;
  --sub: #302642;
  --paper: rgba(255, 250, 241, 0.88);
  --paper-soft: rgba(255, 250, 241, 0.68);
  --line: rgba(126, 83, 37, 0.18);
  --shadow: 0 24px 80px rgba(35, 27, 22, 0.16);
  --radius: 34px;
}

body {
  font-family: "Noto Serif KR", "Pretendard", serif;
  color: var(--text);
  word-break: keep-all;
  overflow-wrap: break-word;
  background:
    radial-gradient(circle at 18% 8%, #f8ddb0 0%, transparent 30%),
    radial-gradient(circle at 85% 18%, #f1d4cc 0%, transparent 36%),
    linear-gradient(180deg, #f7ead6 0%, #efe1ca 48%, #191b35 100%);
  min-height: 100vh;
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 70px 24px 0;
}

.hidden {
  display: none;
}

.hero,
.section-title,
.after-section {
  text-align: center;
}

.badge {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(128, 82, 25, 0.12);
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 20px;
}

.hero h1,
.section-title h2 {
  color: var(--gold);
  letter-spacing: -1px;
}

.hero h1 {
  font-size: 48px;
  line-height: 1.22;
  margin-bottom: 24px;
}

.section-title h2 {
  font-size: 42px;
  line-height: 1.25;
  margin-bottom: 18px;
}

.hero p,
.section-title p,
.result-text-box p,
.landscape-desc {
  color: var(--sub);
  line-height: 1.8;
}

.hero p,
.section-title p {
  font-size: 17px;
}

/* side link */
.side-story {
  position: fixed;
  left: 0;
  top: 45%;
  z-index: 50;
  text-decoration: none;
}

.side-title {
  display: block;
  padding: 14px 10px;
  border-radius: 0 14px 14px 0;
  background: rgba(255, 250, 240, 0.94);
  color: #6c4417;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
  box-shadow: 0 10px 30px rgba(45, 33, 24, 0.14);
}

/* common cards */
.card-section,
.result-main,
.landscape-detail,
.youtube-card {
  background: var(--paper);
  border: 1px solid rgba(127, 83, 35, 0.13);
  box-shadow: var(--shadow);
}

.card-section {
  margin-top: 56px;
  padding: 46px 52px;
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}

#readingGuide {
  text-align: center;
  font-size: 25px;
  color: #6c4215;
  margin-bottom: 34px;
}

.card-container {
  display: flex;
  justify-content: center;
  gap: 34px;
}

/* ---- tarot card: no more crop, no more wobble — a soft fade + gold sparkle reveal ---- */
.tarot-card {
  position: relative;
  width: 210px;
  aspect-ratio: 3 / 4.6; /* fallback until JS measures the real image and refines this */
  height: auto;
  border: 0;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  background: transparent;
  box-shadow: 0 20px 42px rgba(25, 18, 12, 0.28);
  transition: transform 0.9s ease, box-shadow 0.9s ease, opacity 0.5s ease, aspect-ratio 0.2s ease;
}

.tarot-card:hover,
.kakao-btn:hover {
  transform: translateY(-4px);
}

.tarot-card:hover {
  transform: translateY(-10px);
}

.tarot-card.selected {
  transform: translateY(-12px) scale(1.03);
  box-shadow:
    0 0 0 4px rgba(244, 190, 94, 0.85),
    0 30px 60px rgba(25, 18, 12, 0.34);
}

/* Cards that weren't chosen quietly recede instead of flipping or flashing */
.tarot-card.dimmed {
  opacity: 0.32;
  transform: scale(0.96);
}

.tarot-card.dimmed:hover {
  transform: scale(0.96);
}

.result-image-wrap img,
.landscape-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tarot-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: opacity 0.42s ease;
}

/* Gold sparkle particles spawned on reveal, see reading.js spawnSparkles() */
.sparkle {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, #fff8e2 0%, #f4c766 55%, transparent 76%);
  pointer-events: none;
  z-index: 20;
  animation: sparkle-pop 0.85s ease forwards;
}

@keyframes sparkle-pop {
  0% {
    transform: scale(0) rotate(0deg);
    opacity: 0;
  }
  35% {
    transform: scale(1) rotate(80deg);
    opacity: 1;
  }
  100% {
    transform: scale(0) rotate(160deg);
    opacity: 0;
  }
}

.question-box {
  max-width: 760px;
  margin: 42px auto 0;
  padding: 32px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(128, 82, 25, 0.14);
  animation: fadeUp 0.45s ease both;
}

.selected-card-name {
  text-align: center;
  color: #9a651f;
  font-weight: 900;
  margin-bottom: 10px;
}

.question-box h3 {
  text-align: center;
  font-size: 24px;
  color: #583714;
  margin-bottom: 24px;
  line-height: 1.45;
}

.answer-buttons {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.answer-buttons button {
  padding: 17px 20px;
  border-radius: 18px;
  border: 1px solid rgba(130, 80, 20, 0.15);
  background: #fff8ed;
  color: #35251b;
  font-size: 16px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: 0.2s ease;
}

.answer-buttons button:hover {
  background: #f4dcae;
  transform: translateX(5px);
}

/* result */
.result-section,
.style-section {
  margin-top: 90px;
  animation: fadeUp 0.5s ease both;
}

.result-main {
  margin-top: 42px;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 36px;
  padding: 38px;
  border-radius: var(--radius);
}

.result-image-wrap img {
  height: 430px;
  border-radius: 26px;
  box-shadow: 0 18px 42px rgba(30, 22, 18, 0.18);
}

.result-content {
  padding: 12px 8px;
}

.result-style {
  display: inline-block;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--navy);
  color: #f8d98a;
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 18px;
}

.result-content h3 {
  font-size: 34px;
  color: #6b4215;
  margin-bottom: 12px;
  line-height: 1.3;
}

.result-match {
  color: #a4671b;
  font-weight: 900;
  margin-bottom: 24px;
}

.result-text-box {
  margin-top: 20px;
}

.result-text-box h4 {
  color: var(--brown);
  margin-bottom: 8px;
  font-size: 15px;
}

.point-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 24px;
}

.point-list span {
  padding: 9px 13px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 900;
  color: #493018;
}

.point-list span:nth-child(1) { background: #f4dcae; }
.point-list span:nth-child(2) { background: #dce7cf; }
.point-list span:nth-child(3) { background: #ead7ef; }

/* landscape buttons */
.landscape-buttons {
  margin: 40px auto 34px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.landscape-buttons button {
  padding: 13px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.84);
  color: var(--brown-dark);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  transition: 0.2s ease;
}

.landscape-buttons button:hover,
.landscape-buttons button.active {
  background: #fffaf4;
  color: #3f2b17;
  box-shadow: 0 12px 24px rgba(90, 70, 45, 0.14);
}

.landscape-buttons button:hover {
  transform: translateY(-3px);
}

.landscape-buttons button.active {
  transform: scale(1.04);
}

/* landscape map */
.landscape-map {
  position: relative;
  width: min(1000px, 92vw);
  height: 560px;
  margin: 42px auto 34px;
  border-radius: 36px;
  background: #fbf6ee;
  border: 1px solid rgba(115, 72, 25, 0.14);
  box-shadow: 0 30px 80px rgba(40, 31, 25, 0.18);
  overflow: visible;
}

.landscape-map::before,
.landscape-map::after {
  content: "";
  position: absolute;
  background: rgba(80, 70, 65, 0.22);
  z-index: 1;
}

.landscape-map::before {
  left: 50%;
  top: 12%;
  width: 1px;
  height: 76%;
}

.landscape-map::after {
  left: 8%;
  top: 50%;
  width: 84%;
  height: 1px;
}

.axis-label {
  position: absolute;
  z-index: 10;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff7df;
  font-size: 15px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(20, 20, 40, 0.22);
}

.axis-label.top,
.axis-label.bottom {
  left: 50%;
  transform: translateX(-50%);
}

.axis-label.top { top: 18px; }
.axis-label.bottom { bottom: 18px; }

.axis-label.left,
.axis-label.right {
  top: 50%;
  transform: translateY(-50%);
}

.axis-label.left { left: 22px; }
.axis-label.right { right: 22px; }

.map-points {
  position: absolute;
  inset: 0;
  z-index: 4;
}

.map-point {
  position: absolute;
  z-index: 4;
  transform: translate(-50%, -50%);
  width: 78px;
  height: 78px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #4b321d;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 14px 36px rgba(50, 38, 28, 0.13);
  transition: 0.25s ease;
}

.map-point:hover,
.map-point.active {
  background: #fffaf4;
  color: #3f2b17;
  box-shadow:
    0 18px 38px rgba(90, 70, 45, 0.16),
    0 0 0 18px rgba(255, 255, 255, 0.45);
}

.map-point:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

.map-point.active {
  transform: translate(-50%, -50%) scale(1.08);
  z-index: 8;
}

.map-icon {
  font-size: 24px;
  line-height: 1;
}

.map-name {
  font-size: 13px;
  font-weight: 800;
}

/* moving person marker */
.user-marker {
  position: absolute;
  z-index: 3;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  color: #f0b51d;
  background: rgba(255, 245, 205, 0.28);
  border: 1px solid rgba(238, 189, 43, 0.55);
  box-shadow:
    0 0 0 24px rgba(255, 219, 88, 0.16),
    0 0 0 48px rgba(255, 219, 88, 0.08);
  transform: translate(-50%, -50%);
  transition: left 0.45s ease, top 0.45s ease;
  pointer-events: none;
}

/* ---- landscape detail: better alignment, bigger type, no dead space ---- */
.landscape-detail {
  width: min(940px, 92vw);
  margin: 0 auto 70px;
  padding: 46px 50px;
  border-radius: 32px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
}

.landscape-image {
  display: none;
}

.landscape-info {
  display: contents;
}

.landscape-number,
#landscapeName,
#landscapeEnglish,
#landscapeDesc,
.landscape-quote {
  grid-column: 1;
}

.landscape-number {
  color: #a4671b;
  font-weight: 900;
  font-size: 15px;
  margin-bottom: 10px;
}

.landscape-info h3 {
  font-size: 42px;
  color: var(--brown-dark);
  margin-bottom: 8px;
}

.landscape-english {
  font-size: 19px;
  color: #7f6046;
  margin-bottom: 20px;
}

.landscape-desc {
  font-size: 20px;
  line-height: 1.85;
  margin-bottom: 0;
}

.landscape-quote {
  margin-top: 26px;
  padding: 20px 24px;
  border-radius: 18px;
  background: rgba(169, 130, 77, 0.09);
  border: 1px solid rgba(169, 130, 77, 0.16);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.quote-mark {
  font-size: 28px;
  color: #b27b39;
  line-height: 1;
}

.landscape-quote p {
  margin: 0;
  font-size: 16px;
  line-height: 1.75;
  color: #5a4b3d;
  font-style: italic;
}

.score-board {
  grid-column: 2;
  grid-row: 1 / span 5;
  border-left: 1px solid rgba(90, 64, 35, 0.16);
  padding-left: 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
}

.score-row {
  display: grid;
  grid-template-columns: 84px auto 1fr;
  align-items: center;
  column-gap: 20px;
  row-gap: 6px;
}

.score-row > span:first-child {
  font-size: 16px;
  font-weight: 900;
  color: var(--brown-dark);
}

.score-desc {
  color: #6b5c4c;
  line-height: 1.6;
  font-size: 14px;
  font-weight: 600;
}

.score-dots {
  display: flex;
  gap: 8px;
}
.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(80, 60, 40, 0.24);
  background: transparent;
}

.dot.on.warm { background: #e67e22; border-color: #e67e22; }
.dot.on.insight { background: #8e44ad; border-color: #8e44ad; }
.dot.on.heal { background: #43a047; border-color: #43a047; }
.dot.on.speed { background: #2586be; border-color: #2586be; }

/* ---- after-section: fades into navy so the footer no longer cuts in abruptly ---- */
.after-section {
  padding: 130px 24px 130px;
  margin-top: 40px;
  background: linear-gradient(180deg, transparent 0%, rgba(25, 27, 53, 0.55) 55%, var(--navy) 100%);
  border-radius: 60px 60px 0 0;
}

.after-section .badge {
  background: rgba(255, 255, 255, 0.14);
  color: var(--gold-light);
}

.after-section .section-title h2 {
  color: var(--gold-light);
}

.after-section .section-title p {
  color: rgba(255, 246, 224, 0.85);
}

.youtube-card {
  width: 820px;
  max-width: 96%;
  margin: 40px auto 0;
  border-radius: 28px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 70px rgba(10, 10, 26, 0.35);
}

.youtube-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.youtube-thumb iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.kakao-btn {
  display: inline-block;
  margin-top: 56px;
  padding: 19px 42px;
  border-radius: 999px;
  background: #fee500;
  color: #241800;
  font-size: 17px;
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 16px 40px rgba(254, 229, 0, 0.28), 0 8px 20px rgba(0, 0, 0, 0.25);
  transition: 0.2s ease;
}

.kakao-btn:hover {
  box-shadow: 0 20px 46px rgba(254, 229, 0, 0.36), 0 10px 24px rgba(0, 0, 0, 0.28);
}

footer {
  padding: 70px 20px 90px;
  text-align: center;
  color: #fff8e8;
  background: var(--navy);
}

footer p {
  font-size: 17px;
  line-height: 1.8;
  font-weight: 700;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .page {
    padding: 54px 18px 0;
  }

  .hero h1 {
    font-size: 34px;
  }

  .card-section {
    padding: 34px 20px;
  }

  .card-container {
    flex-wrap: wrap;
    gap: 20px;
  }

  .tarot-card {
    width: 155px;
    height: auto;
  }

  .result-main,
  .landscape-detail {
    grid-template-columns: 1fr;
  }

  .result-image-wrap img {
    height: 300px;
  }

  .landscape-map {
    height: 440px;
  }

  .landscape-detail {
    padding: 34px 28px;
  }

  .score-board {
    grid-column: 1;
    grid-row: auto;
    border-left: 0;
    border-top: 1px solid rgba(90, 64, 35, 0.16);
    padding-left: 0;
    padding-top: 28px;
    gap: 26px;
  }

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

  .landscape-info h3 {
    font-size: 34px;
  }

  .score-row {
    grid-template-columns: 76px 1fr;
  }

  .score-desc {
    grid-column: 1 / -1;
  }
}
/* 카드 선택 연출 개선 */
.tarot-card {
  background: transparent !important;
  overflow: visible;
  box-shadow: none;
}

.tarot-card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain !important;
  border-radius: 20px;
  box-shadow: 0 22px 48px rgba(25, 18, 12, 0.24);
}

.tarot-card.selected {
  transform: translateY(-16px) scale(1.05);
  box-shadow: none;
}

.tarot-card.selected img {
  box-shadow:
    0 0 0 3px rgba(244, 196, 100, 0.9),
    0 24px 58px rgba(25, 18, 12, 0.28),
    0 0 42px rgba(255, 215, 120, 0.42);
}

.tarot-card.dimmed {
  opacity: 0;
  transform: translateY(16px) scale(0.92);
  pointer-events: none;
  transition:
    opacity 1.15s ease,
    transform 1.15s ease;
}

.tarot-card.revealing img {
  opacity: 0.25;
  transform: rotateY(90deg);
  transition:
    opacity 0.45s ease,
    transform 0.45s ease;
}

.sparkle {
  z-index: 50;
  box-shadow: 0 0 14px rgba(255, 213, 102, 0.9);
}
.kakao-btn {
  background: #cdb7ff;
  color: #2d2346;
  box-shadow:
    0 16px 40px rgba(170, 140, 230, 0.34),
    0 8px 20px rgba(0, 0, 0, 0.22);
}

.kakao-btn:hover {
  background: #dac9ff;
  box-shadow:
    0 20px 46px rgba(190, 160, 245, 0.42),
    0 10px 24px rgba(0, 0, 0, 0.25);
}
.landscape-detail {
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 42px;
}

.landscape-info h3 {
  line-height: 1.25;
}

.landscape-desc {
  max-width: 520px;
}

.score-board {
  padding-left: 42px;
  gap: 26px;
}

  .score-row {
    grid-template-columns: 76px 1fr;
  }


.after-section {
  margin-top: 110px;
  padding: 140px 24px 150px;
  background:
    linear-gradient(
      180deg,
      rgba(239, 225, 202, 0) 0%,
      rgba(25, 27, 53, 0.18) 28%,
      rgba(25, 27, 53, 0.72) 68%,
      #191b35 100%
    );
  border-radius: 0;
}

.youtube-card {
  background: rgba(255, 250, 241, 0.08);
  backdrop-filter: blur(8px);
}
.kakao-btn {
  background: #cdb7ff;
  color: #2d2346;
  box-shadow:
    0 16px 40px rgba(170, 140, 230, 0.34),
    0 8px 20px rgba(0, 0, 0, 0.22);
}

.kakao-btn:hover {
  background: #dac9ff;
  box-shadow:
    0 20px 46px rgba(190, 160, 245, 0.42),
    0 10px 24px rgba(0, 0, 0, 0.25);
}
/* 1. 결과 카드 중앙선 정확히 중앙 정렬 */
.landscape-detail {
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.landscape-info {
  display: block;
  padding-right: 54px;
}

.score-board {
  grid-column: auto;
  grid-row: auto;
  border-left: 1px solid rgba(90, 64, 35, 0.16);
  padding-left: 54px;
}

/* display: contents 때문에 선이 밀리는 문제 방지 */
.landscape-number,
#landscapeName,
#landscapeEnglish,
#landscapeDesc,
.landscape-quote {
  grid-column: auto;
}

/* 2. 유튜브 영역 그라데이션이 박스처럼 보이는 문제 수정 */
.after-section {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: 120px;
  padding: 150px 24px 160px;
  border-radius: 0;
  background:
    linear-gradient(
      180deg,
      rgba(239, 225, 202, 0) 0%,
      rgba(25, 27, 53, 0.22) 30%,
      rgba(25, 27, 53, 0.78) 70%,
      #191b35 100%
    );
}

footer {
  width: 100vw;
  margin-left: calc(50% - 50vw);
}
/* 선택하지 않은 카드: 사라지지 않고 은은하게 남기기 */
.tarot-card.dimmed {
  opacity: 0.28 !important;
  transform: translateY(8px) scale(0.94);
  pointer-events: none;
  filter: grayscale(0.25) blur(0.2px);
  transition:
    opacity 1.1s ease,
    transform 1.1s ease,
    filter 1.1s ease;
}

.tarot-card.dimmed img {
  opacity: 1 !important;
}
/* 1. 결과 카드 중앙선 정확히 중앙 정렬 */
.landscape-detail {
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.landscape-info {
  display: block;
  padding-right: 54px;
}

.score-board {
  grid-column: auto;
  grid-row: auto;
  border-left: 1px solid rgba(90, 64, 35, 0.16);
  padding-left: 54px;
}

/* display: contents 때문에 선이 밀리는 문제 방지 */
.landscape-number,
#landscapeName,
#landscapeEnglish,
#landscapeDesc,
.landscape-quote {
  grid-column: auto;
}

/* 2. 유튜브 영역 그라데이션이 박스처럼 보이는 문제 수정 */
.after-section {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-top: 120px;
  padding: 150px 24px 160px;
  border-radius: 0;
  background:
    linear-gradient(
      180deg,
      rgba(239, 225, 202, 0) 0%,
      rgba(25, 27, 53, 0.22) 30%,
      rgba(25, 27, 53, 0.78) 70%,
      #191b35 100%
    );
}

footer {
  width: 100vw;
  margin-left: calc(50% - 50vw);
}
.score-board{
    padding-left:40px;
}

.score-row{
    display:grid;
    grid-template-columns:70px 110px minmax(180px,1fr);
    align-items:center;
    column-gap:18px;
    margin-bottom:22px;
}
.score-desc{
    font-size:15px;
    line-height:1.6;
    color:#6b5c4c;

    white-space:normal;
    word-break:keep-all;
}
.landscape-detail{
    display:grid;
    grid-template-columns:46% 54%;
}

.score-row{
    grid-template-columns:72px 110px 1fr;
}