/* === Tarot Table — full-screen desk experience === */

body.tarot-page {
  background: #0b0820 url("img/desk_bg.png") center center / cover no-repeat fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

body.tarot-page .cosmos,
body.tarot-page .stars { display: none; }

/* darken/vignette on top of desk image */
body.tarot-page::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 30%, rgba(11, 8, 32, 0.55) 75%, rgba(11, 8, 32, 0.85) 100%);
  z-index: 0;
  pointer-events: none;
}

.tarot-header-wrap {
  position: relative;
  z-index: 20;
}
.tarot-header-wrap .header {
  border-bottom: 1px solid rgba(212, 184, 92, 0.15);
}

/* === Stage === */
.tarot-stage {
  position: relative;
  z-index: 10;
  min-height: calc(100vh - 130px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}
.stage-step {
  display: none;
  width: 100%;
  max-width: 1400px;
  text-align: center;
  position: relative;
}
.stage-step.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  animation: fadeIn 0.6s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Intro panel === */
.intro-panel {
  background: linear-gradient(180deg, rgba(20, 12, 40, 0.88), rgba(11, 8, 32, 0.94));
  border: 1px solid rgba(212, 184, 92, 0.35);
  border-radius: 14px;
  padding: 48px 56px;
  max-width: 640px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(2px);
}
.intro-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 42px;
  font-weight: 700;
  color: var(--gold-soft);
  letter-spacing: 14px;
  margin-bottom: 6px;
  padding-left: 14px;
}
.intro-sub {
  font-family: 'Cinzel', serif;
  font-size: 12px;
  letter-spacing: 7px;
  color: var(--purple-soft);
  text-transform: uppercase;
  margin-bottom: 24px;
  padding-left: 7px;
}
.intro-lead {
  font-family: 'Noto Serif KR', serif;
  font-size: 16px;
  line-height: 1.9;
  color: var(--text-light);
  margin-bottom: 32px;
  font-style: italic;
  opacity: 0.92;
}

.intro-panel .form-row {
  margin-bottom: 14px;
}
.intro-panel .input-group label {
  color: var(--purple-soft);
}
.intro-panel .input-group input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(212, 184, 92, 0.3);
  color: var(--ivory);
}
.intro-panel .input-group input::placeholder {
  color: rgba(184, 163, 217, 0.5);
}
.intro-panel .input-group input:focus {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 184, 92, 0.18);
}
.intro-panel .input-group.full { flex: 1 1 100%; }

.intro-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 26px;
}
.btn-skip,
.btn-start {
  padding: 12px 28px;
  font-family: 'Noto Serif KR', serif;
  font-size: 15px;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 3px;
  border: 1px solid rgba(184, 163, 217, 0.4);
  background: transparent;
  color: var(--text-light);
  transition: all 0.18s;
}
.btn-start {
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: var(--night-deep);
  border-color: var(--gold);
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(212, 184, 92, 0.35);
}
.btn-skip:hover { border-color: var(--gold); color: var(--gold-soft); }
.btn-start:hover { filter: brightness(1.07); transform: translateY(-1px); }

/* === Stage instruction text === */
.stage-instruction {
  text-align: center;
  margin-bottom: 18px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}
.stage-instruction .line1 {
  font-family: 'Noto Serif KR', serif;
  font-size: 22px;
  color: var(--gold-soft);
  letter-spacing: 4px;
  margin-bottom: 6px;
}
.stage-instruction .line2 {
  font-family: 'Noto Serif KR', serif;
  font-size: 14px;
  color: var(--purple-soft);
  letter-spacing: 2px;
  font-style: italic;
}

/* === Card visuals (shared) === */
.t-card {
  position: absolute;
  width: 110px;
  height: 180px;
  border-radius: 8px;
  cursor: pointer;
  transform-origin: center bottom;
  transition: transform 0.5s cubic-bezier(0.4, 0.2, 0.2, 1),
              left 0.6s cubic-bezier(0.4, 0.2, 0.2, 1),
              top 0.6s cubic-bezier(0.4, 0.2, 0.2, 1),
              opacity 0.4s;
  transform-style: preserve-3d;
  will-change: transform, left, top;
}
.t-card .face {
  position: absolute;
  inset: 0;
  border-radius: 8px;
  backface-visibility: hidden;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.4);
}
.t-card .face.back {
  background:
    radial-gradient(circle at 50% 25%, rgba(212, 184, 92, 0.25) 0%, transparent 45%),
    linear-gradient(135deg, #1a1340 0%, #2a1f5a 50%, #1a1340 100%);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}
.t-card .face.back::before {
  content: "✦";
  font-family: 'Cinzel', serif;
  font-size: 42px;
  color: var(--gold-soft);
  text-shadow: 0 0 12px rgba(230, 207, 140, 0.6);
}
.t-card .face.back::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(212, 184, 92, 0.5);
  border-radius: 4px;
  pointer-events: none;
}
.t-card .face.front {
  transform: rotateY(180deg);
  background: #1a1340;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}
.t-card .face.front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.t-card .face.front .placeholder {
  font-family: 'Noto Serif KR', serif;
  color: var(--gold-soft);
  font-size: 13px;
  text-align: center;
  padding: 14px;
  letter-spacing: 2px;
  line-height: 1.5;
}
.t-card.flipped {
  transform: var(--final-transform, none) rotateY(180deg);
}

.t-card.hover-lift:hover {
  transform: var(--base-transform, none) translateY(-22px) scale(1.05);
  z-index: 100;
}

/* === Shuffle phase === */
.deck-zone {
  position: relative;
  width: 100%;
  height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === Fan zone === */
.fan-zone {
  position: relative;
  width: 100%;
  height: 380px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin-top: 20px;
}

/* === Picked slots row === */
.picked-slots {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 30px;
}
.picked-slot {
  width: 130px;
  height: 220px;
  border: 2px dashed rgba(212, 184, 92, 0.4);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 8px;
  position: relative;
}
.picked-slot.filled {
  border-style: solid;
  border-color: rgba(212, 184, 92, 0.65);
  background: rgba(212, 184, 92, 0.06);
}
.picked-slot .slot-label {
  font-family: 'Noto Serif KR', serif;
  font-size: 13px;
  color: var(--gold-soft);
  letter-spacing: 4px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
  padding-left: 4px;
}
.picked-slot .slot-card {
  position: relative;
  width: 110px;
  height: 180px;
  margin-top: 4px;
}
.picked-slot .slot-card .t-card {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* === Reveal phase === */
.reveal-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 20px 0 30px;
}
.reveal-card {
  width: 150px;
  text-align: center;
}
.reveal-card .pos-label {
  font-family: 'Noto Serif KR', serif;
  font-size: 14px;
  color: var(--gold-soft);
  letter-spacing: 4px;
  margin-bottom: 10px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.7);
}
.reveal-card .card-img-wrap {
  width: 150px;
  height: 240px;
  position: relative;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
}
.reveal-card .card-img-wrap.reversed img { transform: rotate(180deg); }
.reveal-card .card-img-wrap img,
.reveal-card .card-img-wrap .placeholder {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.reveal-card .card-img-wrap .placeholder {
  background: linear-gradient(135deg, #1a1340 0%, #2a1f5a 100%);
  color: var(--gold-soft);
  font-family: 'Noto Serif KR', serif;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px;
  letter-spacing: 2px;
  line-height: 1.6;
}
.reveal-card .card-name {
  font-family: 'Noto Serif KR', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--ivory);
  margin-top: 10px;
  letter-spacing: 2px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}
.reveal-card .reversed-tag {
  font-size: 11px;
  color: #ff9d6b;
  letter-spacing: 3px;
  margin-top: 2px;
}

.reveal-meanings {
  max-width: 760px;
  margin: 0 auto;
  background: linear-gradient(180deg, rgba(20, 12, 40, 0.85), rgba(11, 8, 32, 0.92));
  border: 1px solid rgba(212, 184, 92, 0.3);
  border-radius: 12px;
  padding: 32px 40px;
  text-align: left;
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}
.reveal-meanings .meaning {
  padding: 14px 0;
  border-bottom: 1px dashed rgba(184, 163, 217, 0.2);
}
.reveal-meanings .meaning:last-child { border-bottom: none; }
.reveal-meanings .meaning h4 {
  font-family: 'Noto Serif KR', serif;
  font-size: 18px;
  color: var(--gold-soft);
  margin-bottom: 6px;
  letter-spacing: 3px;
}
.reveal-meanings .meaning .desc {
  font-family: 'Noto Serif KR', serif;
  font-size: 13px;
  color: var(--purple-soft);
  font-style: italic;
  margin-bottom: 8px;
}
.reveal-meanings .meaning p {
  font-family: 'Noto Serif KR', serif;
  font-size: 15px;
  line-height: 1.9;
  color: var(--text-light);
}

.stage-actions {
  margin-top: 28px;
}
.btn-restart {
  padding: 12px 32px;
  font-family: 'Noto Serif KR', serif;
  font-size: 14px;
  color: var(--gold-soft);
  background: transparent;
  border: 1px solid rgba(212, 184, 92, 0.5);
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 3px;
}
.btn-restart:hover {
  background: rgba(212, 184, 92, 0.15);
  border-color: var(--gold);
}

/* === Shuffle animations === */
@keyframes shuffle-jiggle {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(-30px, -8px) rotate(-6deg); }
  50%  { transform: translate(20px, -12px) rotate(4deg); }
  75%  { transform: translate(-12px, -4px) rotate(-3deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

.t-card.shuffling { animation: shuffle-jiggle 0.55s ease-in-out; }

/* === Responsive === */
@media (max-width: 900px) {
  .intro-panel { padding: 32px 24px; max-width: 92vw; }
  .intro-title { font-size: 30px; letter-spacing: 8px; }
  .picked-slots { gap: 14px; }
  .picked-slot { width: 90px; height: 150px; }
  .picked-slot .slot-card { width: 76px; height: 124px; }
  .reveal-row { flex-wrap: wrap; gap: 18px; }
  .reveal-card { width: 110px; }
  .reveal-card .card-img-wrap { width: 110px; height: 176px; }
  .t-card { width: 78px; height: 128px; }
  .t-card .face.back::before { font-size: 30px; }
  .fan-zone { height: 280px; }
}

@media (max-width: 560px) {
  .intro-actions { flex-direction: column; }
  .btn-skip, .btn-start { width: 100%; }
  .reveal-meanings { padding: 22px 18px; }
}

/* === Combined reading: larger type + woven flow (2026-06-21) === */
.reveal-meanings .meaning h4 { font-size: 20px; }
.reveal-meanings .meaning .desc { font-size: 14.5px; }
.reveal-meanings .meaning p { font-size: 17px; line-height: 2.0; }
.reveal-meanings .reading-flow { font-size: 17.5px; line-height: 2.15; }
.reveal-meanings .reading-flow b { color: var(--gold); font-weight: 700; }
@media (max-width: 640px) {
  .reveal-meanings .meaning p { font-size: 16px; }
  .reveal-meanings .reading-flow { font-size: 16px; }
}

/* === Reveal cards 1.8x bigger (2026-06-21) === */
.reveal-row { gap: 36px; flex-wrap: wrap; }
.reveal-card { width: 270px; }
.reveal-card .card-img-wrap { width: 270px; height: 432px; }
.reveal-card .pos-label { font-size: 18px; margin-bottom: 14px; }
.reveal-card .card-name { font-size: 21px; margin-top: 14px; }
.reveal-card .reversed-tag { font-size: 13px; }
.reveal-card .card-img-wrap .placeholder { font-size: 18px; }
@media (max-width: 760px) {
  .reveal-card { width: 200px; }
  .reveal-card .card-img-wrap { width: 200px; height: 320px; }
  .reveal-card .pos-label { font-size: 16px; }
  .reveal-card .card-name { font-size: 18px; }
}

/* === Pick-step slots: label above the box so it never overlaps the card (2026-06-21) === */
.picked-slots { gap: 48px; margin-top: 48px; }
.picked-slot { width: 122px; height: 192px; padding-top: 0; overflow: visible; justify-content: center; }
.picked-slot .slot-label {
  position: absolute; top: -30px; left: 0; right: 0;
  text-align: center; margin: 0; padding: 0; font-size: 15px;
}
.picked-slot .slot-card { margin-top: 0; width: 110px; height: 180px; }
@media (max-width: 760px) {
  .picked-slots { gap: 20px; }
  .picked-slot { width: 90px; height: 150px; }
  .picked-slot .slot-card { width: 80px; height: 132px; }
  .picked-slot .slot-label { font-size: 13px; top: -26px; }
}

/* === "해석하기" button in the pick step === */
.pick-actions { text-align: center; margin-top: 64px; }
#btn-interpret { padding: 14px 44px; font-size: 17px; }
#btn-interpret:disabled {
  opacity: 0.4;
  filter: grayscale(0.5);
  box-shadow: none;
  cursor: not-allowed;
}
#btn-interpret:disabled:hover { transform: none; filter: grayscale(0.5); }
