/* five-card-tarot.html + onecard.html + yes-no-tarot.html + ai-tarot.html CSS [M] Stage 3b: reveal/flip (open-message labels; reveal-active lifts .select-hint above fan). JS: js/five-card-reveal.js */

/* ==== M. STAGE 3b: REVEAL — flip stage (.open-message: The Answer | Past/Present/Future | 5 spread labels) ==== */
.tarot-select-stage .inner-card-panel {
  bottom: 0;
  height: 100%;
  left: 0;
  position: absolute;
  right: 0;
  width: 100%;
}

.tarot-select-stage .hint-container {
  align-items: center;
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
}

.tarot-select-stage .open-message {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 1.5vw;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  transition: opacity 0.2s ease;
  width: 100%;
}

.tarot-select-stage .open-message .msg {
  font-family: var(--font-display);
  height: 2.4vw;
  min-height: 28px;
  position: relative;
  width: 100%;
}

.tarot-select-stage .open-message .msg span {
  font-size: clamp(18px, 2.4vw, 28px);
  left: 50%;
  letter-spacing: 0.06em;
  line-height: 1.2;
  opacity: 1;
  position: absolute;
  text-align: center;
  transform: translateX(-50%);
  transition: opacity 0.8s ease, transform 0.8s ease;
  white-space: nowrap;
  width: max-content;
}

.tarot-select-stage .open-message .msg span.hide {
  opacity: 0;
  transform: translateX(-50%) scale(1.15);
}

.tarot-select-stage .open-message .hint {
  font-family: var(--font-display);
  font-size: clamp(14px, 1.5vw, 20px);
  letter-spacing: 0.03em;
  margin: 0;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.tarot-select-stage .open-message .hint.hide {
  opacity: 0;
}

.tarot-select-stage .card-name {
  bottom: 100%;
  color: #fff;
  filter: blur(10px);
  font-family: var(--font-card-name);
  font-size: clamp(13px, 1.35vw, 18px);
  font-style: italic;
  font-weight: 600;
  left: 50%;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  max-width: min(220px, 90vw);
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  text-align: center;
  text-overflow: ellipsis;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.65), 0 0 24px rgba(186, 128, 255, 0.25);
  transform: translateX(-50%) translateY(6px);
  transition: opacity 0.55s ease 0.35s, filter 0.55s ease 0.35s, transform 0.55s ease 0.35s;
  white-space: nowrap;
  z-index: 5;
}

.tarot-select-stage .card-el.opened .card-name {
  filter: none;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.tarot-select-stage .card-el.opened {
  pointer-events: none;
}

.tarot-select-stage.reveal-active.openingClickable .card-el.selected:not(.opened) .card-inner,
.tarot-select-stage.reveal-active.opening-clickable .card-el.selected:not(.opened) .card-inner {
  transition: transform 0.85s cubic-bezier(0.34, 1.15, 0.48, 1);
}

.tarot-select-stage .card-el.selected.flipping .card-inner,
.tarot-select-stage .card-el.opened .card-inner {
  transform: rotateY(180deg);
}

.tarot-select-stage.reveal-active.openingClickable .card-el.selected:not(.opened),
.tarot-select-stage.reveal-active.opening-clickable .card-el.selected:not(.opened) {
  cursor: pointer;
  pointer-events: all;
}

.tarot-select-stage.reveal-active.openingClickable .card-el.selected:not(.opened):hover,
.tarot-select-stage.reveal-active.opening-clickable .card-el.selected:not(.opened):hover {
  filter:
    drop-shadow(0 12px 28px rgba(186, 128, 255, 0.35))
    drop-shadow(rgba(0, 0, 0, 0.45) 0 0 18px);
  transform: translateY(-2%) scale(1.03);
}

.tarot-select-stage.reveal-active.openingClickable .card-axis.selected,
.tarot-select-stage.reveal-active.opening-clickable .card-axis.selected,
.tarot-select-stage.reveal-active.openingClickable .card-wrapper,
.tarot-select-stage.reveal-active.opening-clickable .card-wrapper,
.tarot-select-stage.reveal-active.openingClickable .card-el.selected,
.tarot-select-stage.reveal-active.opening-clickable .card-el.selected {
  overflow: visible;
}

.tarot-select-stage.reveal-active.openingClickable .card-el.selected.flipping,
.tarot-select-stage.reveal-active.opening-clickable .card-el.selected.flipping {
  pointer-events: none;
}

.tarot-select-stage.reveal-active.openingClickable .card-el.selected .card-back::after,
.tarot-select-stage.reveal-active.opening-clickable .card-el.selected .card-back::after,
.tarot-select-stage.reveal-active.openingClickable .card-el.selected:not(.opened) .card-front::after,
.tarot-select-stage.reveal-active.opening-clickable .card-el.selected:not(.opened) .card-front::after {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.tarot-select-stage.reveal-active .select-layout-spacer {
  display: none;
}

.tarot-select-stage.reveal-active .card-el.selected {
  filter: drop-shadow(rgba(0, 0, 0, 0.4) 0px 0px 16px);
  transform: translateZ(0);
}

.tarot-select-stage.reveal-active.opening .open-message {
  opacity: 1;
}

/* ==== M1. REVEAL ACTIVE — lift .select-hint / .open-message above fan (.reveal-active; pick 3 tighter) ==== */
.tarot-select-stage.reveal-active .open-message {
  position: relative;
  top: auto;
  gap: clamp(10px, 1.8vw, 22px);
  margin-bottom: clamp(16px, 3vh, 44px);
}

.tarot-select-stage.reveal-active .select-hint {
  bottom: auto;
  top: calc(max(300px, var(--site-header-chrome)) + clamp(8px, 1.5vh, 24px));
  transition: top 0.6s ease, bottom 0.6s ease;
}

.tarot-select-stage.reveal-active[data-pick-limit="3"] .select-hint {
  top: calc(max(300px, var(--site-header-chrome)) + clamp(4px, 1vh, 16px));
}

.tarot-select-stage.reveal-active.opening .card-el .card-back::after,
.tarot-select-stage.reveal-active.opening .card-el .card-front::after {
  background: linear-gradient(180deg, rgba(54, 66, 139, 0.8) 0%, rgba(54, 66, 139, 0.3) 39%, rgba(54, 66, 139, 1) 91%);
  border-radius: inherit;
  content: "";
  inset: 0;
  mix-blend-mode: soft-light;
  opacity: 1;
  position: absolute;
  z-index: 2;
}

/* Mobile reveal — carousel clipped in cards-container viewport */
.tarot-select-stage.reveal-active.reveal-mobile.openingClickable .cards-container,
.tarot-select-stage.reveal-active.reveal-mobile.opening-clickable .cards-container {
  overflow: visible;
}

.tarot-select-stage.reveal-active.reveal-mobile .cards-container {
  height: 62%;
  margin-top: -25%;
  overflow: hidden;
  transform: none;
}

.tarot-select-stage.reveal-active.reveal-mobile .inner-card-panel {
  bottom: 0;
  height: 100%;
  left: 0;
  position: absolute;
  right: 0;
  width: 100%;
}

.tarot-select-stage.reveal-active.reveal-mobile .cards-container-inner {
  transition: transform 0.5s cubic-bezier(0.3, 0, 0.14, 1);
}

.tarot-select-stage.reveal-active.reveal-mobile.selectHiding .status-panel {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tarot-select-stage.reveal-active.reveal-mobile.selectHiding .cards-container-inner {
  transform: rotate(130deg);
  transition: transform 0.5s cubic-bezier(0.3, 0, 0.14, 1);
}

.tarot-select-stage.reveal-active.reveal-mobile.selectHidden .cards-container-inner {
  transform: rotate(-130deg);
  transition: transform 0.8s cubic-bezier(0.3, 0, 0.14, 1);
}

.tarot-select-stage.reveal-active.reveal-mobile.selectHidden .card-axis {
  width: 8%;
}

.tarot-select-stage.reveal-active.reveal-mobile.selectHidden .card-wrapper {
  transform: rotate(0deg) !important;
  transition: transform 0.1s ease;
}

.tarot-select-stage.reveal-active.reveal-mobile.opening .cards-container-inner {
  transform: rotate(1turn);
  transition: transform 2s cubic-bezier(0.3, 0, 0.14, 1);
}

.tarot-select-stage.reveal-active.reveal-mobile.opening .card-axis,
.tarot-select-stage.reveal-active.reveal-mobile.openingClickable .card-axis {
  transition: all 0.4s ease-in-out;
}

/* ==== M2. DESKTOP REVEAL — spinning disc + hint lift (min-width 670px) ==== */
@media (min-width: 670px) {
  .tarot-select-stage.reveal-active.reveal-desktop {
    overflow: visible;
  }

  .tarot-select-stage.reveal-active.reveal-desktop .cards-container {
    align-items: flex-end;
    display: flex;
    flex: none;
    height: 100%;
    justify-content: center;
    left: 0;
    margin-top: 0;
    max-height: 85vw;
    overflow: visible;
    position: absolute;
    right: 0;
    top: 0;
    transform: none;
    width: 100%;
  }

  .tarot-select-stage.reveal-active.reveal-desktop .inner-card-panel {
    align-items: center;
    aspect-ratio: 1;
    bottom: 0;
    display: flex;
    height: auto;
    justify-content: center;
    left: 50%;
    max-width: 200vh;
    position: absolute;
    transform: translateX(-50%);
    transform-origin: center center;
    transition: transform 2s cubic-bezier(0.3, 0, 0.14, 1);
    width: 150%;
    will-change: transform;
  }

  .tarot-select-stage.reveal-active.reveal-desktop .cards-container-inner {
    align-items: flex-end;
    bottom: auto;
    display: flex;
    height: 100%;
    justify-content: center;
    left: auto;
    position: relative;
    transform: none !important;
    transition: none;
    width: 100%;
  }

  .tarot-select-stage.reveal-active.reveal-desktop.transition-circle-in {
    transform: translateY(calc(50% + 6vw));
    transition: transform 0.2s ease;
  }

  .tarot-select-stage.reveal-active.reveal-desktop.transition-circle-in .status-panel {
    opacity: 0;
  }

  .tarot-select-stage.reveal-active.reveal-desktop.transition-circle-in .inner-card-panel,
  .tarot-select-stage.reveal-active.reveal-desktop.transition-circle-out .inner-card-panel {
    transform: translateX(-50%) rotate(1turn) scale(0.8);
  }

  .tarot-select-stage.reveal-active.reveal-desktop.transition-circle-hide-extra .card-axis.is-extra {
    display: none;
  }

  .tarot-select-stage.reveal-active.reveal-desktop.move-to-top-outer {
    transform: translateY(0);
    transition: transform 0.6s ease;
  }

  .tarot-select-stage.reveal-active.reveal-desktop.move-to-top .inner-card-panel,
  .tarot-select-stage.reveal-active.reveal-desktop.opening .inner-card-panel {
    transform: translateX(-50%) rotate(1turn) scale(1);
  }

  .tarot-select-stage.reveal-active.reveal-desktop.opening .card-wrapper {
    transform: translateY(0) rotate(0deg) !important;
  }

  .tarot-select-stage.reveal-active.reveal-desktop .card-axis.selected {
    --arc-span: 78;
  }

  .tarot-select-stage.reveal-active.reveal-desktop .card-axis.circleIn.selected {
    transform: rotate(0deg);
  }

  .tarot-select-stage.reveal-active.reveal-desktop .card-axis.circleIn.selected .card-wrapper {
    transform: translateY(-100%);
  }

  .tarot-select-stage.reveal-active.reveal-desktop .card-axis.circleIn:not(.selected) .card-wrapper {
    transform: translateY(500%);
  }

  .tarot-select-stage.reveal-active.reveal-desktop .card-axis.circle.selected {
    z-index: calc(10 - (var(--selected-order) - (var(--selected-count) - 1) / 2) * (var(--selected-order) - (var(--selected-count) - 1) / 2));
    transform: rotate(calc(1deg * var(--arc-span) / 2 - 1deg * var(--selected-order) * var(--arc-span) / var(--selected-count)));
  }

  .tarot-select-stage.reveal-active.reveal-desktop .card-axis.circle.selected .card-wrapper {
    transform: translateY(-100%);
  }

  .tarot-select-stage.reveal-active.reveal-desktop .card-axis.circleOpened {
    transition: all 1.4s ease;
  }

  .tarot-select-stage.reveal-active.reveal-desktop .card-axis.circleOpened.selected {
    z-index: calc(10 - (var(--selected-order) - (var(--selected-count) - 1) / 2) * (var(--selected-order) - (var(--selected-count) - 1) / 2));
    transform: rotate(calc(1deg * var(--arc-span) / 2 - 1deg * var(--selected-order) * var(--arc-span) / (var(--selected-count) - 1)));
  }

  .tarot-select-stage.reveal-active.reveal-desktop .card-axis.circleOpened.selected .card-wrapper {
    transform: translateY(0);
  }

  .tarot-select-stage.reveal-active.reveal-desktop.opening .card-axis,
  .tarot-select-stage.reveal-active.reveal-desktop.opening-clickable .card-axis {
    transition: all 0.4s ease-in-out;
  }

  .tarot-select-stage.reveal-active.reveal-desktop .select-hint {
    top: calc(max(300px, var(--site-header-chrome)) - clamp(12px, 2.5vh, 40px));
  }

  .tarot-select-stage.reveal-active.reveal-desktop[data-pick-limit="5"] .select-hint {
    top: calc(max(300px, var(--site-header-chrome)) - clamp(28px, 4.5vh, 72px));
  }

  .tarot-select-stage.reveal-active.reveal-desktop[data-pick-limit="3"] .select-hint {
    top: calc(max(300px, var(--site-header-chrome)) - clamp(24px, 5vh, 64px));
  }

  .tarot-select-stage.reveal-active.reveal-desktop[data-pick-limit="3"] .open-message {
    margin-bottom: clamp(28px, 6vh, 72px);
  }
}

@media (max-width: 669px) {
  /* ==== M3. MOBILE REVEAL — hint lift + open-message type scale ==== */
  .tarot-select-stage.reveal-active.reveal-mobile .select-hint {
    padding-top: 0;
    top: calc(120px + clamp(8px, 2vh, 16px));
  }

  .tarot-select-stage.reveal-active.reveal-mobile[data-pick-limit="3"] .select-hint {
    top: calc(112px + clamp(6px, 1.5vh, 12px));
  }

  .tarot-select-stage .open-message .msg {
    height: 16vw;
    min-height: 48px;
  }

  .tarot-select-stage .open-message .msg span {
    font-size: clamp(16px, 5vw, 24px);
  }

  .tarot-select-stage .open-message .hint {
    font-size: clamp(13px, 4vw, 18px);
  }

  .tarot-select-stage .card-name {
    font-size: clamp(10px, 2.8vw, 13px);
    margin-bottom: 8px;
  }
}
  
