/* =========================================================
   무료 원카드 타로 & 2027 궁합 – tarot.css
   fortune.css(한지빛·금빛) 위에 카드 아트워크를 얹는다.
   ========================================================= */

body.tarot .hero h1 .f-hanja { letter-spacing: .3em; }

/* 주제 선택 */
.topic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 0 18px;
}
.topic-btn {
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  padding: 10px 16px;
  min-height: 42px;
  border-radius: 999px;
  border: 1.5px solid #e3d4b8;
  background: #fffdf7;
  color: #6b563c;
  cursor: pointer;
  transition: all .16s ease;
}
.topic-btn:hover { border-color: #d9b877; color: #92400e; }
.topic-btn.is-active {
  background: linear-gradient(135deg, #92400e 0%, #b45309 60%, #d97706 100%);
  border-color: #92400e;
  color: #fff;
  box-shadow: 0 10px 22px -16px rgba(120, 53, 15, .9);
}

/* ---------- 카드 덱 ---------- */
.deck-wrap {
  position: relative;
  padding: 10px 0 4px;
}
.deck {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  perspective: 1200px;
  min-height: 190px;
}
.tarot-card {
  position: relative;
  width: 112px;
  height: 168px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  perspective: 900px;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s ease, opacity .3s ease;
}
.tarot-card:nth-child(1) { transform: translateY(8px) rotate(-4deg); }
.tarot-card:nth-child(2) { transform: translateY(2px) rotate(-2deg); }
.tarot-card:nth-child(4) { transform: translateY(2px) rotate(2deg); }
.tarot-card:nth-child(5) { transform: translateY(8px) rotate(4deg); }
.tarot-card:hover { transform: translateY(-8px) rotate(0deg); }
.tarot-card:focus-visible { outline: 3px solid #d97706; outline-offset: 4px; border-radius: 12px; }

.tc-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .7s cubic-bezier(.2, .8, .2, 1);
  border-radius: 12px;
}
.tarot-card.is-flipped .tc-inner { transform: rotateY(180deg); }

.tc-face {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
}

/* 카드 뒷면 */
.tc-back {
  background:
    radial-gradient(circle at 50% 32%, rgba(245, 208, 120, .34) 0%, rgba(245, 208, 120, 0) 46%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0 2px, transparent 2px 7px),
    linear-gradient(155deg, #2a1f33 0%, #1b1526 52%, #241a2d 100%);
  border: 1.5px solid #c9a35c;
  box-shadow: 0 14px 30px -18px rgba(30, 20, 10, .8), inset 0 0 0 4px rgba(201, 163, 92, .16);
  display: grid;
  place-items: center;
}
.tc-back::before {
  content: "";
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid rgba(233, 207, 156, .55);
  box-shadow:
    0 0 0 8px rgba(233, 207, 156, .1),
    inset 0 0 0 1px rgba(233, 207, 156, .25);
  background:
    radial-gradient(circle, rgba(233, 207, 156, .9) 0 2px, transparent 3px) center/100% 100% no-repeat,
    conic-gradient(from 0deg, rgba(233, 207, 156, .55) 0 2deg, transparent 2deg 45deg) center/70% 70% no-repeat;
}
.tc-back::after {
  content: "✧";
  position: absolute;
  font-size: 30px;
  color: #f0d9a8;
  text-shadow: 0 0 12px rgba(240, 217, 168, .8);
}
.tc-no {
  position: absolute;
  bottom: 8px;
  left: 0; right: 0;
  text-align: center;
  font-size: 10px;
  letter-spacing: .18em;
  color: rgba(233, 207, 156, .55);
}

/* 카드 앞면 */
.tc-front {
  transform: rotateY(180deg);
  background: linear-gradient(170deg, #fffdf6 0%, #fbf3e2 62%, #f6ecd6 100%);
  border: 1.5px solid #c9a35c;
  box-shadow: 0 18px 38px -20px rgba(60, 40, 10, .7), inset 0 0 0 4px rgba(201, 163, 92, .18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px;
  text-align: center;
}
.tc-front .num {
  font-family: "Noto Serif KR", "Nanum Myeongjo", serif;
  font-size: 11px;
  letter-spacing: .16em;
  color: #a87c33;
}
.tc-front .glyph {
  font-size: 40px;
  line-height: 1;
  color: #8a5a1c;
  text-shadow: 0 2px 10px rgba(180, 130, 50, .28);
}
.tc-front .nm {
  font-family: "Noto Serif KR", "Nanum Myeongjo", serif;
  font-size: 12.5px;
  font-weight: 700;
  color: #3a2a14;
  letter-spacing: -.01em;
}
.tc-front .en {
  font-size: 8.5px;
  letter-spacing: .06em;
  color: #a1855c;
  text-transform: uppercase;
}
.tc-front.rev .glyph { transform: rotate(180deg); }

.deck-hint {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 결과 ---------- */
.draw-result {
  margin: 26px auto 0;
  max-width: 720px;
}
.draw-result[hidden] { display: none; }
.dr-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 22px;
  align-items: start;
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(160deg, #fffdf8 0%, #fbf4e6 100%);
  border: 1px solid #e8d7b6;
  box-shadow: 0 26px 50px -34px rgba(80, 50, 10, .55);
}
.dr-visual { display: grid; gap: 8px; justify-items: center; }
.dr-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.dr-badge.up { background: #ecfdf5; color: #047857; }
.dr-badge.rev { background: #fef2f2; color: #b91c1c; }
.dr-body h3 {
  margin: 0 0 2px;
  font-family: "Noto Serif KR", "Nanum Myeongjo", serif;
  font-size: 22px;
  letter-spacing: -.02em;
  color: #2a1e0c;
}
.dr-body .dr-en {
  display: block;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #a1855c;
  margin-bottom: 10px;
}
.dr-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
.dr-keys li {
  font-size: 11.5px;
  font-weight: 700;
  color: #92400e;
  background: #fdf3dd;
  border: 1px solid #f0ddb4;
  border-radius: 999px;
  padding: 3px 9px;
}
.dr-topic {
  font-size: 12px;
  font-weight: 800;
  color: #b45309;
  letter-spacing: -.01em;
  margin: 0 0 4px;
}
.dr-text {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.72;
  color: #33281a;
}
.dr-advice {
  margin: 0;
  padding: 13px 15px;
  border-radius: 14px;
  background: #fdf6e7;
  border: 1px dashed #e3c98d;
  font-size: 13px;
  line-height: 1.65;
  color: #5a4423;
}
.dr-advice strong { color: #92400e; }

.draw-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.ghost-btn {
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 11px 18px;
  min-height: 44px;
  border-radius: 12px;
  border: 1.5px solid #e0cfae;
  background: #fffdf8;
  color: #7a5a2a;
  cursor: pointer;
  transition: all .15s ease;
}
.ghost-btn:hover { border-color: #c9a35c; background: #fdf6e7; }

/* ---------- 궁합 ---------- */
.cmp-form { max-width: 760px; margin: 0 auto; }
.cmp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.cmp-person {
  border: 1px solid #e8d7b6;
  border-radius: 16px;
  padding: 16px;
  background: #fffdf8;
}
.cmp-person h3 {
  margin: 0 0 12px;
  font-size: 14px;
  font-family: "Noto Serif KR", serif;
  color: #7a5a2a;
  letter-spacing: -.01em;
}
.cmp-person .field { margin-bottom: 12px; }
.cmp-person .field:last-child { margin-bottom: 0; }
.cmp-person label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #6b563c;
  margin-bottom: 6px;
}
.cmp-person input[type="text"],
.cmp-person input[type="date"] {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  font: inherit;
  font-size: 15px;
  color: #2a1e0c;
  background: #fff;
  border: 1.5px solid #e3d4b8;
  border-radius: 11px;
}
.cmp-person input:focus {
  outline: none;
  border-color: #d9b877;
  box-shadow: 0 0 0 4px rgba(217, 184, 119, .18);
}
.cal-row { display: flex; gap: 6px; }
.cal-btn {
  flex: 1;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 0;
  border-radius: 9px;
  border: 1.5px solid #e3d4b8;
  background: #fff;
  color: #8a6d45;
  cursor: pointer;
}
.cal-btn.is-active { background: #92400e; border-color: #92400e; color: #fff; }

.cmp-result { margin: 26px auto 0; max-width: 760px; }
.cmp-result[hidden] { display: none; }
.cmp-top {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 20px;
  align-items: center;
  padding: 22px;
  border-radius: 20px;
  background: linear-gradient(160deg, #fffdf8 0%, #fbf4e6 100%);
  border: 1px solid #e8d7b6;
  box-shadow: 0 26px 50px -34px rgba(80, 50, 10, .55);
}
.score-ring {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(#b45309 calc(var(--pct, 0) * 1%), #efe2c8 0);
}
.score-ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #fffdf8;
  box-shadow: inset 0 0 0 1px #f0e3c8;
}
.score-ring b {
  position: relative;
  font-size: 34px;
  letter-spacing: -.03em;
  color: #8a4a0e;
  font-family: "Noto Serif KR", serif;
}
.score-ring b small { font-size: 13px; color: #a1855c; margin-left: 2px; }
.cmp-headline h3 {
  margin: 0 0 6px;
  font-family: "Noto Serif KR", "Nanum Myeongjo", serif;
  font-size: 20px;
  letter-spacing: -.02em;
  color: #2a1e0c;
}
.cmp-headline p { margin: 0; font-size: 13.5px; line-height: 1.65; color: #5a4a33; }
.cmp-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.cmp-pair span {
  font-size: 11.5px;
  font-weight: 700;
  color: #7a5a2a;
  background: #fbf2df;
  border: 1px solid #eeddb9;
  border-radius: 999px;
  padding: 4px 10px;
}
.cmp-body {
  margin-top: 14px;
  padding: 20px 22px;
  border-radius: 20px;
  background: #fffdf8;
  border: 1px solid #e8d7b6;
}
.cmp-body h4 {
  margin: 0 0 8px;
  font-size: 14px;
  color: #8a5a1c;
  letter-spacing: -.01em;
}
.cmp-body h4 + p, .cmp-body ul { margin-top: 0; }
.cmp-body p { margin: 0 0 14px; font-size: 13.5px; line-height: 1.7; color: #40331f; }
.cmp-body ul { margin: 0 0 14px; padding-left: 18px; }
.cmp-body li { font-size: 13.5px; line-height: 1.7; color: #40331f; margin-bottom: 4px; }
.cmp-body hr { border: 0; border-top: 1px dashed #e3d4b8; margin: 16px 0; }
.cmp-foot { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.cmp-foot .ghost-btn { flex: 1 1 auto; }

.share-toast {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(28, 22, 17, .94);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  z-index: 200;
}
.share-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 반응형 ---------- */
@media (max-width: 760px) {
  .tarot-card { width: 74px; height: 111px; }
  .tc-back::after { font-size: 20px; }
  .tc-front .glyph { font-size: 26px; }
  .tc-front .nm { font-size: 10px; }
  .tc-front .num { font-size: 9px; }
  .tc-front .en { display: none; }
  .deck { gap: 8px; min-height: 140px; }
  .dr-card, .cmp-top { grid-template-columns: 1fr; }
  .dr-visual { justify-items: start; }
  .dr-visual .tarot-card { margin: 0 auto; }
  .cmp-grid { grid-template-columns: 1fr; }
  .score-ring { margin: 0 auto; }
  .cmp-top { justify-items: center; text-align: center; }
  .cmp-pair { justify-content: center; }
}

@media (max-width: 380px) {
  .tarot-card { width: 62px; height: 94px; }
  .tc-back::after { font-size: 17px; }
  .deck { gap: 6px; }
  .topic-btn { font-size: 12.5px; padding: 9px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .tc-inner { transition: none; }
}

/* 탭·버튼을 한지빛 팔레트에 맞춘다 (calculator.css의 파란 탭 덮기) */
body.tarot .tabbar {
  background: #fffdf8;
  border-color: #e8d7b6;
  box-shadow: 0 10px 24px -22px rgba(120, 80, 20, .6);
}
body.tarot .tab-btn { color: #8a6d45; }
body.tarot .tab-btn:hover { background: #fbf2df; color: #92400e; }
body.tarot .tab-btn.is-active {
  background: linear-gradient(135deg, #92400e 0%, #b45309 60%, #d97706 100%);
  box-shadow: 0 10px 22px -14px rgba(120, 53, 15, .95);
  color: #fff;
}
body.tarot .tab-btn.is-active small { color: rgba(255, 255, 255, .82); }
body.tarot .panel-intro { color: var(--muted); }
body.tarot .calc-btn {
  background: linear-gradient(135deg, #92400e 0%, #b45309 60%, #d97706 100%);
  color: #fff;
}
body.tarot .section-head h2 { color: #2a1e0c; }
body.tarot .ad-slot { background: #fffdf8; }
