:root {
  color-scheme: dark;
  --bg: #060b1c;
  --panel: #0e1836;
  --gold: #d9b86c;
  --bright: #f1d58a;
  --cream: #f7f1e6;
  --muted: #a9adc3;
  --line: #2b365c;
  --serif: "Playfair Display", "Noto Serif KR", Georgia, "Batang", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--cream); font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif; }
body.modal-open { overflow: hidden; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }

.page {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 52% -12%, #27396799, transparent 36rem),
    radial-gradient(circle at 95% 55%, #132b5a55, transparent 32rem),
    linear-gradient(#070c20, #040817);
}

.page::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: .5;
  background-image:
    radial-gradient(circle, #f1d58acc 0 1px, transparent 1.5px),
    radial-gradient(circle, #f1d58a66 0 1px, transparent 1.5px);
  background-position: 12% 6%, 70% 18%;
  background-size: 143px 149px, 197px 211px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  padding: 10px clamp(16px, 4vw, 62px);
  border-bottom: 1px solid #d9b86c38;
  background: #060b1cd9;
  backdrop-filter: blur(16px);
}

.brand { display: flex; align-items: center; gap: 11px; color: var(--cream); font: 700 clamp(1.25rem, 2vw, 1.8rem)/1 var(--serif); text-decoration: none; }
.brand span { display: grid; width: 38px; aspect-ratio: 1; place-items: center; border: 1px solid #d9b86ca8; border-radius: 50%; color: var(--bright); font-size: .9rem; }
.counter { min-width: 145px; padding: 10px 16px; border: 1px solid #d9b86c80; border-radius: 99px; background: #0c1633d9; text-align: center; font-size: .87rem; }
.counter b { color: var(--bright); }

.hero { position: relative; z-index: 1; padding: clamp(34px, 5vw, 62px) 20px 28px; text-align: center; }
.hero p, .panel small { margin: 0 0 8px; color: var(--gold); font-size: .67rem; font-weight: 800; letter-spacing: .22em; }
.hero h1 { margin: 0; font: 700 clamp(1.85rem, 4vw, 3.3rem)/1.25 var(--serif); letter-spacing: -.05em; }
.hero > span { display: block; color: #c7cad8; font-size: clamp(.9rem, 1.5vw, 1.05rem); }
.rule { display: flex; width: min(300px, 70%); align-items: center; margin: 20px auto; color: var(--gold); }
.rule::before, .rule::after { width: 46%; height: 1px; content: ""; background: linear-gradient(90deg, transparent, #d9b86c99); }
.rule::after { transform: rotate(180deg); }
.rule i { padding: 0 10px; font-style: normal; }

.workspace {
    position: relative;
    z-index: 1;
    display: block;
    gap: 16px;
    width: min(1440px, calc(100% - 28px));
    margin: auto;
    padding-bottom: 42px;
}
.panel { border: 1px solid #5b6b9f6b; border-radius: 24px; background: linear-gradient(145deg, #101937ee, #080f24e8); box-shadow: 0 20px 56px #0000004d, inset 0 1px #ffffff08; }
.deck-panel, .spread-panel {
    padding: clamp(18px, 2vw, 28px);
    width: min(820px, 100%);
    /* min-height: 670px; */
    margin: auto;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.panel h2 { margin: 0; font: 700 clamp(1.42rem, 2.3vw, 2rem)/1.2 var(--serif); letter-spacing: -.04em; }
.panel-head p { max-width: 210px; margin: 0; padding: 10px 14px; border: 1px solid #5b6b9f55; border-radius: 13px; color: #c1c5d4; font-size: .76rem; line-height: 1.5; }

.deck-scroll { width: 100%; margin-top: 8px; padding: 22px 10px 16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: #d9b86c88 #070d20; overscroll-behavior-inline: contain; }
.deck-scroll:focus-visible { outline: 1px solid var(--bright); outline-offset: 3px; border-radius: 10px; }
.deck-row {
    display: flex;
    width: max-content;
    min-width: 100%;
    min-height: 126px;
    /* align-items: flex-end; */
    padding: 0px 0px 4px;
}
.deck-card { position: relative; flex: 0 0 70px; width: 70px; aspect-ratio: 2 / 3.12; padding: 0; cursor: pointer; border: 0; border-radius: 7px; background: transparent; transition: transform .18s ease, filter .18s ease; }
.deck-card + .deck-card { margin-left: -41px; }
.deck-card:hover, .deck-card:focus-visible, .deck-card.selected { z-index: 3; transform: translateY(-12px); filter: drop-shadow(0 0 9px #f1d58a80); outline: none; }
.deck-card:focus-visible .card-back { outline: 2px solid var(--bright); outline-offset: 3px; }
.card-back { position: absolute; inset: 0; display: block; border: 1px solid var(--gold); border-radius: 7px; background: #09122e url("../cardimg/taroback.png") center / cover no-repeat; box-shadow: 0 8px 14px #0007, inset 0 0 0 3px #081027; }
.card-back.small { position: relative; inset: auto; width: 43px; aspect-ratio: 2 / 3.12; border-radius: 5px; animation: place .22s ease-out both; }
.order { position: absolute; top: -8px; right: auto; left: -8px; z-index: 4; display: grid; width: 23px; aspect-ratio: 1; place-items: center; border: 2px solid #09112a; border-radius: 50%; background: var(--bright); color: #09112a; font-size: .7rem; }
.scroll-help { margin: 2px 0 0; color: var(--muted); text-align: center; font-size: .72rem; }

.spread-panel { width: min(820px, 100%); min-height: 670px; margin: auto; }
.spread-head { position: relative; min-height: 76px; text-align: center; }
.spread-head::after { display: block; width: 210px; height: 1px; margin: 14px auto; content: ""; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.spread-head button { position: absolute; top: 2px; right: 0; cursor: pointer; border: 0; background: none; color: var(--muted); font-size: .73rem; text-decoration: underline; text-underline-offset: 4px; }
.spread-head button:hover, .spread-head button:focus-visible { color: var(--bright); }
.spread { display: grid; grid-template-areas: ". now why ." "stayGood stayEnd moveGood moveBlock" ". moveEnd moveEnd ." ". advice advice ."; grid-template-columns: repeat(4, minmax(74px, 1fr)); gap: 17px 12px; align-items: start; padding: 8px 0; }
.slot { display: flex; min-height: 123px; flex-direction: column; align-items: center; justify-content: center; padding: 8px 4px; border: 1px dashed #d9b86caf; border-radius: 11px; background: #060c1e85; color: var(--gold); text-align: center; }
.slot.filled { border-style: solid; border-color: var(--bright); background: #101d41e8; box-shadow: 0 0 16px #d9b86c22; }
.slot strong { font: 400 1.7rem/1 var(--serif); }
.slot > span:last-child { margin-top: 8px; color: #c1c5d5; font-size: .67rem; line-height: 1.35; word-break: keep-all; }
.notice { min-height: 20px; margin: 8px 0 10px; color: var(--muted); text-align: center; font-size: .76rem; }
.notice.warning { color: var(--bright); }
.result { display: flex; width: 100%; min-height: 56px; align-items: center; justify-content: center; gap: 16px; cursor: pointer; border: 1px solid var(--gold); border-radius: 14px; background: linear-gradient(135deg, var(--gold), var(--bright)); color: #09112a; font-weight: 800; box-shadow: 0 12px 28px #d9b86c29; }
.result:not(:disabled):hover { transform: translateY(-1px); }
.result:disabled { cursor: not-allowed; border-color: #3b4260; background: #292f48; color: #777c94; box-shadow: none; }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: #02050dd9; backdrop-filter: blur(10px); animation: fadeIn .2s ease-out both; }
.result-modal { width: min(1120px, 100%); max-height: calc(100vh - 40px); overflow: auto; border: 1px solid #d9b86c70; border-radius: 24px; background: linear-gradient(145deg, #101a3b, #070e23 70%); box-shadow: 0 30px 90px #000a, 0 0 50px #d9b86c14; animation: modalIn .22s ease-out both; }
.modal-head { position: sticky; top: 0; z-index: 4; display: flex; align-items: flex-start; justify-content: space-between; padding: 25px 28px 20px; border-bottom: 1px solid #d9b86c32; background: #0d1734f2; backdrop-filter: blur(14px); }
.modal-head small { color: var(--gold); font-size: .64rem; font-weight: 800; letter-spacing: .2em; }
.modal-head h2 { margin: 6px 0 5px; font: 700 clamp(1.55rem, 3vw, 2.3rem)/1.2 var(--serif); letter-spacing: -.04em; }
.modal-head p { margin: 0; color: var(--muted); font-size: .82rem; }
.modal-close { display: grid; flex: 0 0 38px; width: 38px; aspect-ratio: 1; place-items: center; cursor: pointer; border: 1px solid #d9b86c70; border-radius: 50%; background: #111c3e; color: var(--cream); font-size: 1.55rem; line-height: 1; }
.modal-close:hover, .modal-close:focus-visible { border-color: var(--bright); color: var(--bright); outline: none; }
.overall-reading { display: flex; gap: 14px; margin: 22px 28px 0; padding: 17px 18px; border: 1px solid #d9b86c55; border-radius: 15px; background: linear-gradient(100deg, #d9b86c14, transparent); }
.overall-reading > span { color: var(--bright); }
.overall-reading b { font-family: var(--serif); color: var(--bright); }
.overall-reading p { margin: 6px 0 0; color: #d5d7e1; font-size: .86rem; line-height: 1.7; }
.reading-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 22px 28px 28px; }
.reading-card { display: grid; grid-template-columns: 112px 1fr; gap: 16px; min-height: 190px; padding: 16px; border: 1px solid #344064aa; border-radius: 16px; background: #081128b3; }
.card-face { position: relative; display: flex; width: 112px; aspect-ratio: 2 / 3.15; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; border: 1px solid #e0c27b; border-radius: 9px; background: radial-gradient(circle at 50% 38%, #33446d, #101a38 58%, #080f22); box-shadow: 0 10px 24px #0007, inset 0 0 0 5px #0a1128, inset 0 0 0 6px #d9b86c99; text-align: center; }
.card-face::before { position: absolute; inset: 11px; border: 1px solid #d9b86c66; border-radius: 50% 50% 44% 44% / 38% 38% 62% 62%; content: ""; }
.card-face.card-face-image-wrap::before { display: none; }
.card-face-image { display: block; width: 100%; height: 100%; object-fit: contain; }
.card-face.amber { background: radial-gradient(circle at 50% 40%, #6d4526, #281827 62%, #0a1024); }
.card-face.blue { background: radial-gradient(circle at 50% 40%, #275574, #17264d 62%, #090f23); }
.card-face.violet { background: radial-gradient(circle at 50% 40%, #493a75, #1f1b43 62%, #090f23); }
.card-face.green { background: radial-gradient(circle at 50% 40%, #2e624e, #152f33 62%, #090f23); }
.face-index { position: absolute; top: 13px; left: 14px; color: #f1d58abb; font: 700 .65rem/1 var(--serif); letter-spacing: .08em; }
.face-symbol { position: relative; z-index: 1; color: var(--bright); font: 400 2.85rem/1 var(--serif); filter: drop-shadow(0 0 12px #f1d58a66); }
.face-name { position: relative; z-index: 1; max-width: 88px; margin-top: 15px; color: var(--cream); font: 700 .88rem/1.25 var(--serif); word-break: keep-all; }
.face-group { position: absolute; right: 0; bottom: 12px; left: 0; color: #d9b86caa; font-size: .5rem; letter-spacing: .05em; }
.reading-copy { align-self: center; }
.reading-position { display: flex; align-items: center; gap: 7px; margin: 0 0 8px; color: var(--gold); font-size: .7rem; }
.reading-position b { display: grid; width: 21px; aspect-ratio: 1; place-items: center; border: 1px solid #d9b86c88; border-radius: 50%; }
.reading-copy h3 { margin: 0 0 9px; font: 700 1.15rem/1.3 var(--serif); }
.reading-copy > p:last-child { margin: 0; color: #c8cbd8; font-size: .79rem; line-height: 1.72; word-break: keep-all; }
.reading-copy strong { color: #ead7a6; font-weight: 600; }
.modal-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 28px 24px; border-top: 1px solid #2b365c; }
.modal-footer p { margin: 0; color: #858ba2; font-size: .7rem; line-height: 1.5; }
.modal-footer button { flex: 0 0 auto; min-width: 130px; padding: 11px 18px; cursor: pointer; border: 1px solid var(--gold); border-radius: 10px; background: linear-gradient(135deg, var(--gold), var(--bright)); color: #09112a; font-weight: 800; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes place { from { opacity: 0; transform: translateY(8px) scale(.94); } }

@media (max-width: 820px) {
  .reading-list { grid-template-columns: 1fr; }
  .reading-card { grid-template-columns: 96px 1fr; }
  .card-face { width: 96px; }
  .face-symbol { font-size: 2.4rem; }
  .modal-backdrop { padding: 10px; }
  .result-modal { max-height: calc(100vh - 20px); border-radius: 18px; }
  .modal-head { padding: 20px; }
  .overall-reading { margin: 16px 20px 0; }
  .reading-list { padding: 16px 20px 20px; }
  .modal-footer { padding: 16px 20px 20px; }
}

@media (max-width: 720px) {
  .header { min-height: 62px; padding: 9px 13px; }
  .brand span { width: 32px; }
  .counter { min-width: auto; padding: 9px 12px; font-size: .76rem; }
  .hero { padding: 28px 16px 22px; }
  .workspace { width: calc(100% - 18px); }
  .panel { border-radius: 18px; }
  .panel-head { align-items: flex-start; }
  .panel-head p { max-width: 150px; padding: 8px; font-size: .65rem; }
  .deck-scroll { width: calc(100% + 12px); margin-left: -6px; padding-inline: 6px; }
  .deck-row {
      min-height: 100px;
  }
  .deck-card { flex-basis: 60px; width: 60px; }
  .deck-card + .deck-card { margin-left: -36px; }
  .spread { grid-template-areas: "now now why why" "stayGood stayGood stayEnd stayEnd" "moveGood moveGood moveBlock moveBlock" ". moveEnd moveEnd ." ". advice advice ."; gap: 10px; }
  .slot { min-height: 110px; }
  .spread-panel { min-height: auto; }
  .spread-head button { top: auto; bottom: 6px; }
  .modal-head p { max-width: 240px; }
  .modal-footer { align-items: stretch; flex-direction: column; }
  .modal-footer button { width: 100%; }
}

@media (max-width: 460px) {
  .brand { font-size: 1.12rem; }
  .deck-panel, .spread-panel { padding: 15px; }
  .deck-card { flex-basis: 58px; width: 58px; }
  .deck-card + .deck-card { margin-left: -35px; }
  .spread { grid-template-columns: repeat(4, minmax(54px, 1fr)); }
  .slot { min-height: 102px; }
  .slot > span:last-child { font-size: .61rem; }
  .reading-card { grid-template-columns: 76px 1fr; gap: 12px; padding: 12px; }
  .card-face { width: 76px; }
  .face-symbol { font-size: 2rem; }
  .face-name { max-width: 64px; margin-top: 10px; font-size: .68rem; }
  .face-group { display: none; }
  .reading-copy h3 { font-size: 1rem; }
  .reading-copy > p:last-child { font-size: .73rem; }
  .modal-head h2 { font-size: 1.45rem; }
  .modal-close { width: 34px; }
  .overall-reading { margin-inline: 14px; }
  .reading-list { padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =========================================================
   메인 페이지(index.php)
   기존 이직운 화면과 충돌하지 않도록 main-/site- 접두사를 사용합니다.
========================================================= */
.home-body {
  min-width: 320px;
  background: #040817;
}

.main-page {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -8%, #293c7190, transparent 36rem),
    radial-gradient(circle at 92% 38%, #17326545, transparent 32rem),
    radial-gradient(circle at 5% 68%, #142c5940, transparent 28rem),
    linear-gradient(180deg, #070c20 0%, #050a19 54%, #030612 100%);
}

.main-page::before {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  content: "";
  opacity: .48;
  background-image:
    radial-gradient(circle, #f1d58acc 0 1px, transparent 1.5px),
    radial-gradient(circle, #f1d58a55 0 1px, transparent 1.5px);
  background-position: 8% 10%, 74% 20%;
  background-size: 151px 163px, 211px 227px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 78px;
  border-bottom: 1px solid #d9b86c30;
  background: #060b1ce8;
  box-shadow: 0 10px 35px #0003;
  backdrop-filter: blur(18px);
}

.site-header-inner {
  display: flex;
  width: min(1500px, calc(100% - 40px));
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin: 0 auto;
}

.site-logo {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  color: var(--cream);
  text-decoration: none;
}

.site-logo-mark {
  display: grid;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid #d9b86ca8;
  border-radius: 50%;
  color: var(--bright);
  box-shadow: inset 0 0 0 4px #d9b86c0d, 0 0 18px #d9b86c18;
}

.site-logo-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.site-logo-copy strong {
  font: 700 1.05rem/1 var(--serif);
  letter-spacing: .08em;
}

.site-logo-copy small {
  color: var(--gold);
  font-size: .52rem;
  font-weight: 700;
  letter-spacing: .24em;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(10px, 1.5vw, 23px);
}

.site-nav a {
  position: relative;
  padding: 29px 0 27px;
  color: #c7cad8;
  font-size: clamp(.7rem, .9vw, .82rem);
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: color .18s ease;
}

.site-nav a::after {
  position: absolute;
  right: 50%;
  bottom: 19px;
  left: 50%;
  height: 1px;
  /* content: ""; */
  background: var(--bright);
  transition: right .18s ease, left .18s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--bright);
  outline: none;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  right: 0;
  left: 0;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 10px;
  cursor: pointer;
  border: 1px solid #d9b86c70;
  border-radius: 10px;
  background: #101a3b;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 1px;
  margin: 5px 0;
  background: var(--bright);
  transition: transform .2s ease, opacity .2s ease;
}

.menu-toggle.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.is-open span:nth-child(2) { opacity: 0; }
.menu-toggle.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.main-hero {
  position: relative;
  z-index: 1;
  display: grid;
  min-height: 590px;
  place-items: center;
  padding: 70px 24px 82px;
  overflow: hidden;
  text-align: center;
}

.main-hero::before {
  position: absolute;
  top: 15%;
  left: 50%;
  width: min(740px, 88vw);
  aspect-ratio: 1;
  border: 1px solid #d9b86c12;
  border-radius: 50%;
  content: "";
  transform: translate(-50%, -50%);
  box-shadow: inset 0 0 70px #21356420;
}

.main-hero-content {
  position: relative;
  z-index: 2;
  max-width: 920px;
}

.main-eyebrow,
.fortune-section-heading > p {
  margin: 0 0 13px;
  color: var(--gold);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .28em;
}

.main-hero h1 {
  margin: 0;
  color: var(--cream);
  font: 700 clamp(2.45rem, 6vw, 5.4rem)/1.15 var(--serif);
  letter-spacing: -.06em;
  text-shadow: 0 0 42px #f1d58a10;
}

.main-hero h1 em {
  color: var(--bright);
  font-style: normal;
}

.main-title-rule {
  display: flex;
  width: min(390px, 72vw);
  align-items: center;
  justify-content: center;
  margin: 27px auto 24px;
  color: var(--gold);
}

.main-title-rule::before,
.main-title-rule::after {
  width: 44%;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, #d9b86ca8);
}

.main-title-rule::after { transform: rotate(180deg); }
.main-title-rule span { padding: 0 13px; }

.main-hero-description {
  margin: 0;
  color: #bec2d1;
  font-size: clamp(.88rem, 1.5vw, 1.03rem);
  line-height: 1.9;
  word-break: keep-all;
}

.main-start-button {
  display: inline-flex;
  min-width: 194px;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 15px;
  margin-top: 32px;
  border: 1px solid var(--gold);
  border-radius: 99px;
  background: linear-gradient(135deg, #d9b86c, #f1d58a);
  color: #09112a;
  font-size: .87rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 13px 34px #d9b86c24;
  transition: transform .18s ease, box-shadow .18s ease;
}

.main-start-button:hover,
.main-start-button:focus-visible {
  transform: translateY(-3px);
  outline: none;
  box-shadow: 0 17px 38px #d9b86c35;
}

.main-hero-orbit {
  position: absolute;
  pointer-events: none;
  border: 1px dashed #d9b86c28;
  border-radius: 50%;
}

.main-hero-orbit::after {
  position: absolute;
  top: -5px;
  left: 50%;
  color: var(--bright);
  content: "✦";
  font-size: .7rem;
}

.main-hero-orbit-one {
  top: -390px;
  left: 50%;
  width: 940px;
  height: 690px;
  transform: translateX(-50%) rotate(-8deg);
}

.main-hero-orbit-two {
  right: -220px;
  bottom: -370px;
  width: 620px;
  height: 620px;
}

.fortune-section {
  position: relative;
  z-index: 2;
  width: min(1400px, calc(100% - 40px));
  margin: 0 auto;
  padding: 82px 0 105px;
  scroll-margin-top: 90px;
}

.fortune-section::before {
  position: absolute;
  inset: 0 -80px;
  z-index: -1;
  border: 1px solid #34406455;
  border-radius: 34px;
  content: "";
  background: linear-gradient(145deg, #0d1733d9, #070e22c7);
  box-shadow: 0 30px 80px #0005;
}

.fortune-section-heading {
  max-width: 720px;
  margin: 0 auto 43px;
  text-align: center;
}

.fortune-section-heading h2 {
  margin: 0 0 13px;
  font: 700 clamp(1.75rem, 4vw, 3rem)/1.25 var(--serif);
  letter-spacing: -.05em;
}

.fortune-section-heading > span {
  color: var(--muted);
  font-size: .87rem;
}

.fortune-menu-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.fortune-menu-card {
  position: relative;
  display: flex;
  min-height: 246px;
  flex-direction: column;
  overflow: hidden;
  padding: 20px;
  border: 1px solid #38466daa;
  border-radius: 18px;
  background:
    radial-gradient(circle at 85% 15%, #d9b86c13, transparent 38%),
    linear-gradient(145deg, #111c3e, #091128);
  color: var(--cream);
  text-decoration: none;
  box-shadow: inset 0 1px #ffffff08;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.fortune-menu-card::before {
  position: absolute;
  right: -55px;
  bottom: -75px;
  width: 150px;
  aspect-ratio: 1;
  border: 1px solid #d9b86c1f;
  border-radius: 50%;
  content: "";
}

.fortune-menu-card:hover,
.fortune-menu-card:focus-visible {
  z-index: 2;
  transform: translateY(-6px);
  border-color: #f1d58a9c;
  outline: none;
  box-shadow: 0 18px 32px #0006, 0 0 24px #d9b86c13, inset 0 1px #ffffff0d;
}

.fortune-card-number {
  position: absolute;
  top: 17px;
  right: 18px;
  color: #d9b86c68;
  font: 700 .68rem/1 var(--serif);
  letter-spacing: .12em;
}

.fortune-card-icon {
  display: grid;
  width: 47px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid #d9b86c70;
  border-radius: 50%;
  color: var(--bright);
  font: 400 1.28rem/1 var(--serif);
  box-shadow: inset 0 0 0 4px #d9b86c0a;
}

.fortune-card-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  margin-top: 22px;
}

.fortune-card-copy small {
  color: var(--gold);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .17em;
}

.fortune-card-copy strong {
  margin-top: 7px;
  font: 700 1.35rem/1.2 var(--serif);
}

.fortune-card-copy > span {
  margin-top: 12px;
  color: #9fa5b9;
  font-size: .73rem;
  line-height: 1.65;
  word-break: keep-all;
}

.fortune-card-arrow {
  position: relative;
  z-index: 1;
  align-self: flex-end;
  color: var(--gold);
  font-size: 1.1rem;
  transition: transform .2s ease;
}

.fortune-menu-card:hover .fortune-card-arrow,
.fortune-menu-card:focus-visible .fortune-card-arrow {
  transform: translateX(5px);
}

.main-footer {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(1400px, calc(100% - 40px));
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin: 0 auto;
  padding: 30px 0 42px;
  border-top: 1px solid #d9b86c25;
}

.footer-logo { opacity: .74; }
.main-footer p { margin: 0; color: #747b91; font-size: .7rem; text-align: right; }

@media (max-width: 1260px) {
  .site-header-inner { width: min(100% - 28px, 1500px); gap: 20px; }
  .site-nav { gap: 11px; }
  .site-nav a { font-size: .68rem; }
  .fortune-menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .site-header,
  .site-header-inner { min-height: 68px; }
  .menu-toggle { display: block; }
  .site-nav {
    position: absolute;
    top: 68px;
    right: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    max-height: 0;
    padding: 0 18px;
    overflow: hidden;
    border-bottom: 1px solid transparent;
    background: #080e23f7;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: max-height .28s ease, padding .28s ease, opacity .2s ease, transform .2s ease;
    backdrop-filter: blur(18px);
  }
  .site-nav.is-open {
    max-height: 430px;
    padding: 12px 18px 18px;
    border-bottom-color: #d9b86c30;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }
  .site-nav a {
    padding: 13px 14px;
    border-bottom: 1px solid #2b365c88;
    font-size: .8rem;
  }
  .site-nav a::after { display: none; }
  .main-hero { min-height: 520px; padding-top: 55px; }
  .fortune-section { width: min(100% - 36px, 880px); padding: 68px 0 88px; }
  .fortune-section::before { inset-inline: -18px; border-radius: 26px; }
  .fortune-menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fortune-menu-card { min-height: 220px; }
}

@media (max-width: 620px) {
  .site-logo-mark { width: 36px; }
  .site-logo-copy strong { font-size: .88rem; }
  .site-logo-copy small { font-size: .46rem; }
  .main-hero { min-height: 490px; padding: 48px 18px 64px; }
  .main-hero-description br { display: none; }
  .fortune-section { width: calc(100% - 30px); padding: 58px 0 70px; }
  .fortune-section::before { inset-inline: -8px; border-radius: 21px; }
  .fortune-section-heading { margin-bottom: 30px; padding-inline: 10px; }
  .fortune-section-heading > span { font-size: .78rem; }
  .fortune-menu-grid { grid-template-columns: 1fr; gap: 11px; }
  .fortune-menu-card {
    display: grid;
    grid-template-columns: 46px 1fr auto;
    min-height: 0;
    align-items: center;
    gap: 14px;
    padding: 17px;
  }
  .fortune-card-icon { width: 44px; grid-column: 1; grid-row: 1; }
  .fortune-card-copy { grid-column: 2; grid-row: 1; margin: 0; }
  .fortune-card-copy strong { font-size: 1.12rem; }
  .fortune-card-copy > span { margin-top: 7px; }
  .fortune-card-number { display: none; }
  .fortune-card-arrow { grid-column: 3; grid-row: 1; align-self: center; }
  .main-footer { width: calc(100% - 30px); align-items: flex-start; flex-direction: column; gap: 18px; padding-bottom: 30px; }
  .main-footer p { text-align: left; line-height: 1.6; }
}

@media (max-width: 390px) {
  .site-header-inner { width: calc(100% - 20px); }
  .site-logo-copy small { display: none; }
  .main-hero h1 { font-size: 2.08rem; }
  .site-nav { grid-template-columns: 1fr; }
  .site-nav.is-open { max-height: 600px; }
}

/* =========================================================
   공통 타로 리딩 페이지
========================================================= */
.site-nav a.is-current {
  color: var(--bright);
}

.site-nav a.is-current::after {
  width: 100%;
}

.tarot-reading-page,
.saju-page {
  min-height: calc(100vh - 78px);
  overflow: visible;
}

.tarot-reading-page .header,
.saju-page .header {
  top: 78px;
}

.tarot-reading-page .spread-panel {
  min-height: auto;
  margin-top: 16px;
}

.tarot-reading-page .spread {
  min-height: 0;
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  gap: 17px 14px;
}

.tarot-reading-page .spread-today {
  grid-template-areas:
    "morning afternoon evening"
    ". advice .";
}

.tarot-reading-page .spread-worry {
  grid-template-areas:
    ". root ."
    ". hidden ."
    "aGood . bGood"
    "aResult . bResult"
    ". advice .";
}

.tarot-reading-page .spread-love {
  grid-template-areas:
    "me relation other"
    "good . obstacle"
    ". flow ."
    ". advice .";
}

.tarot-reading-page .spread-reunion {
  grid-template-areas:
    "me cause other"
    ". view ."
    ". obstacle ."
    ". chance ."
    ". action .";
}

.tarot-reading-page .spread-crush {
  grid-template-areas:
    "me view feeling"
    ". obstacle ."
    ". chance ."
    ". action .";
}

.tarot-reading-page .spread-career {
  grid-template-areas:
    "strength current weakness"
    ". environment ."
    ". opportunity ."
    ". flow ."
    ". advice .";
}

.tarot-reading-page .spread-success {
  grid-template-areas:
    "strength current weakness"
    ". variable ."
    ". result ."
    ". advice .";
}

.tarot-reading-page .spread-fortune {
  grid-template-areas:
    "past current future"
    "love career money"
    "warning chance advice";
}

.tarot-reading-page .spread-money {
  grid-template-areas:
    "income current expense"
    "opportunity . risk"
    ". action ."
    ". result .";
}

@media (max-width: 960px) {
  .tarot-reading-page .header,
  .saju-page .header {
    top: 68px;
  }
}

@media (max-width: 460px) {
  .tarot-reading-page .spread {
    grid-template-columns: repeat(3, minmax(54px, 1fr));
    gap: 9px 7px;
  }

  .tarot-reading-page .slot {
    min-height: 96px;
    padding-inline: 2px;
  }

  .tarot-reading-page .slot > span:last-child {
    font-size: .58rem;
  }
}

/* 이직운 8장 배열 */
.tarot-reading-page .spread-jobchange {
  grid-template-areas:
    ". now why ."
    "stayGood stayEnd moveGood moveBlock"
    ". moveEnd moveEnd ."
    ". advice advice .";
  grid-template-columns: repeat(4, minmax(74px, 1fr));
}

/* 이미지 로고 크기 */
.site-logo img {
  display: block;
  width: auto;
  height: 42px;
  max-width: 190px;
  object-fit: contain;
}

/* 공통 푸터 */
.site-footer {
    width: 100%;
    margin-top: 72px;
    padding: 26px max(20px, env(safe-area-inset-right))
        calc(26px + env(safe-area-inset-bottom))
        max(20px, env(safe-area-inset-left));
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #070914;
    color: #9299ad;
    box-sizing: border-box;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
}

.footer-logo {
    flex: 0 0 auto;
    color: #f4f6fb;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.04em;
}

.footer-nav {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
}

.footer-nav p {
    margin: 0;
    color: #9299ad;
    font-size: 13px;
    line-height: 1.6;
}

.footer-nav a {
    color: #cbd0dd;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: color 0.2s ease;
}

.footer-nav a:hover,
.footer-nav a:focus-visible {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.footer-nav a:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.65);
    outline-offset: 4px;
    border-radius: 2px;
}

.footer-copy {
    flex: 0 0 auto;
    color: #747c91;
    font-size: 12px;
    line-height: 1.6;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .site-footer {
        margin-top: 52px;
        padding-top: 24px;
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }

    .footer-inner {
        flex-direction: column;
        gap: 9px;
        text-align: center;
    }

    .footer-nav {
        width: 100%;
    }

    .footer-copy {
        white-space: normal;
    }
}


@media (max-width: 720px) {
  .tarot-reading-page .spread-jobchange {
    grid-template-areas:
      "now now why why"
      "stayGood stayGood stayEnd stayEnd"
      "moveGood moveGood moveBlock moveBlock"
      ". moveEnd moveEnd ."
      ". advice advice .";
    grid-template-columns: repeat(4, minmax(54px, 1fr));
  }
}

@media (max-width: 620px) {
  .site-logo img {
    height: 34px;
    max-width: 155px;
  }
}

/* =========================================================
   카드 선택 완료 안내 및 모바일 브라우저 UI 대응
========================================================= */
body.selection-complete-open {
  overflow: hidden;
}

/* 선택된 카드는 위로 띄우지 않고 순번 배지만 표시합니다. */
.deck-card.selected {
  z-index: auto;
  transform: none;
  filter: none;
}

.deck-card.selected .card-back {
  border: 2px solid #fff0a6;
  box-shadow:
    0 0 0 1px #ffd76a,
    0 0 14px #ffd76aa6,
    0 8px 14px #0007,
    inset 0 0 0 3px #081027;
}

/* 주소창이 접히고 펼쳐지는 모바일 브라우저의 실제 보이는 높이를 사용합니다. */
.modal-backdrop {
  inset: auto 0 auto 0;
  top: var(--visual-viewport-offset-top, 0px);
  width: 100%;
  height: 100vh;
  height: var(--visual-viewport-height, 100dvh);
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  overflow: hidden;
}

.result-modal {
  max-height: calc(100vh - 24px);
  max-height: calc(
    var(--visual-viewport-height, 100dvh)
    - max(24px, env(safe-area-inset-top))
    - max(24px, env(safe-area-inset-bottom))
  );
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.modal-head {
  top: 0;
}

.modal-close {
  position: relative;
  z-index: 2;
  align-self: flex-start;
}

.modal-footer {
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.selection-complete-backdrop {
  z-index: 60;
}

.selection-complete-modal {
  width: min(380px, 100%);
  max-height: calc(100% - 4px);
  padding: 30px 24px 24px;
  overflow: auto;
  border: 1px solid #d9b86c88;
  border-radius: 22px;
  background: linear-gradient(145deg, #111d40, #070e23 72%);
  box-shadow: 0 28px 80px #000b, 0 0 42px #d9b86c1c;
  text-align: center;
  animation: modalIn .22s ease-out both;
}

.selection-complete-icon {
  display: grid;
  width: 54px;
  margin: 0 auto 16px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid #d9b86ca8;
  border-radius: 50%;
  color: var(--bright);
  box-shadow: inset 0 0 0 5px #d9b86c0c, 0 0 22px #d9b86c22;
}

.selection-complete-modal small {
  color: var(--gold);
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .2em;
}

.selection-complete-modal h2 {
  margin: 8px 0 10px;
  font: 700 1.65rem/1.25 var(--serif);
}

.selection-complete-modal p {
  margin: 0;
  color: #c7cad8;
  font-size: .86rem;
  line-height: 1.7;
}

.selection-complete-modal button {
  width: 100%;
  min-height: 50px;
  margin-top: 22px;
  cursor: pointer;
  border: 1px solid var(--gold);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--bright));
  color: #09112a;
  font-weight: 800;
}

.selection-complete-modal button:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 3px;
}

@media (max-width: 820px) {
  .modal-backdrop {
    padding:
      max(8px, env(safe-area-inset-top))
      max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom))
      max(8px, env(safe-area-inset-left));
  }

  .result-modal {
    max-height: calc(100vh - 16px);
    max-height: calc(
      var(--visual-viewport-height, 100dvh)
      - max(16px, env(safe-area-inset-top))
      - max(16px, env(safe-area-inset-bottom))
    );
  }

  .modal-footer {
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}

@media (max-width: 720px) {
  body.has-complete-selection .tarot-reading-page {
    padding-bottom: calc(92px + env(safe-area-inset-bottom));
  }

  body.has-complete-selection .result {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    left: max(12px, env(safe-area-inset-left));
    z-index: 45;
    width: auto;
    box-shadow: 0 14px 36px #0009, 0 0 22px #d9b86c33;
  }

  .selection-complete-modal {
    width: min(340px, 100%);
    padding: 26px 20px 20px;
    border-radius: 18px;
  }
}

@media (max-width: 460px) {
  .modal-head {
    padding: 16px 14px 14px;
  }

  .modal-close {
    width: 40px;
    flex-basis: 40px;
  }
}

/* 사주유형 페이지 */
.saju-workspace { display: flex; justify-content: center; width: min(1100px, calc(100% - 40px)); margin: 0 auto clamp(40px, 6vw, 72px); }
.saju-panel { /* width: min(560px, 100%);*/ padding: 30px 34px 34px; }
.saju-form { display: flex; flex-direction: column; gap: 20px; margin-top: 22px; }
.saju-field-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.saju-field { display: flex; flex-direction: column; gap: 8px; font-size: .76rem; color: var(--muted); }
.saju-field input {
  padding: 12px 14px;
  border: 1px solid #5b6b9f6b;
  border-radius: 12px;
  background: #060c1eb3;
  color: var(--cream);
  font-size: 1rem;
  font-family: inherit;
  color-scheme: dark;
}
.saju-field input::placeholder { color: #5f6580; }
.saju-field input:focus-visible { border-color: var(--bright); outline: none; box-shadow: 0 0 0 3px #d9b86c22; }
.saju-solar-toggle { display: flex; gap: 12px; }
.saju-solar-toggle label {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid #5b6b9f6b;
  border-radius: 12px;
  background: #060c1eb3;
  color: var(--muted);
  font-size: .87rem;
  cursor: pointer;
}
.saju-solar-toggle input { accent-color: var(--bright); }
.saju-solar-toggle label:has(input:checked) { border-color: var(--bright); background: #101d41e8; color: var(--cream); box-shadow: 0 0 16px #d9b86c22; }

.saju-overall { align-items: center; }
.saju-result-image { width: 84px; aspect-ratio: 1; border: 1px solid var(--gold); border-radius: 50%; object-fit: cover; background: #060c1e; }
.saju-result-card { grid-template-columns: 1fr; min-height: 0; }

@media (max-width: 640px) {
  .saju-field-row { grid-template-columns: 1fr; }
  .saju-panel { padding: 24px 20px 26px; }
}

/* 약관/개인정보 등 텍스트 안내 페이지 */
.legal-workspace { display: flex; justify-content: center; width: min(900px, calc(100% - 40px)); margin: 0 auto clamp(40px, 6vw, 72px); }
.legal-panel { width: 100%; padding: clamp(24px, 4vw, 40px); }
.legal-article h2 { margin: 32px 0 12px; font: 700 1.2rem/1.35 var(--serif); color: var(--gold); letter-spacing: -.02em; }
.legal-article h2:first-child { margin-top: 0; }
.legal-article p { margin: 0 0 14px; color: #d5d7e1; font-size: .92rem; line-height: 1.75; word-break: keep-all; }
.legal-article ul { margin: 0 0 14px; padding-left: 1.2em; color: #d5d7e1; font-size: .92rem; line-height: 1.75; }
.legal-article li { margin-bottom: 4px; }
.legal-article a { color: var(--bright); }
.legal-date { margin-top: 28px; color: var(--muted); font-size: .82rem; }

@media (max-width: 640px) {
  .legal-panel { padding: 22px 18px 26px; }
}