:root {
  color-scheme: dark;
  --ink: #fff7fa;
  --muted: #ead7e3;
  --deep: #130a1a;
  --night: #28142d;
  --violet: #8664b7;
  --rose: #f3a6bf;
  --gold: #e6c47a;
  --line: rgba(255, 232, 240, 0.2);
  --panel: rgba(40, 19, 48, 0.78);
  --shadow: 0 24px 70px rgba(8, 4, 18, 0.42);
  --tarot-app-max-width: 430px;
  font-family: "Hiragino Sans", "Yu Gothic", "YuGothic", system-ui, sans-serif;
}

.tarot-app,
.tarot-app * {
  box-sizing: border-box;
}

body.tarot-tool-page {
  margin: 0;
  min-height: 100svh;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 4%, rgba(243, 166, 191, 0.3), transparent 30rem),
    radial-gradient(circle at 88% 16%, rgba(157, 190, 232, 0.14), transparent 26rem),
    radial-gradient(circle at 72% 78%, rgba(230, 196, 122, 0.12), transparent 30rem),
    linear-gradient(150deg, #100817 0%, #28142d 50%, #11172c 100%);
}

.tarot-app button,
.tarot-app a {
  -webkit-tap-highlight-color: transparent;
}

.tarot-app button {
  font: inherit;
}

.app-shell {
  width: min(100%, var(--tarot-app-max-width));
  min-height: 100svh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  container-type: inline-size;
}

.screen {
  display: none;
  min-height: 100svh;
  padding: 22px;
  animation: screenIn 420ms ease both;
}

.screen.is-active {
  display: block;
}

.intro {
  display: none;
  position: relative;
  grid-template-rows: 250px auto;
  align-content: center;
  justify-items: center;
  padding: 32px;
  background:
    linear-gradient(rgba(16, 8, 23, 0.02), rgba(18, 8, 28, 0.94)),
    radial-gradient(circle at 50% 23%, rgba(243, 166, 191, 0.28), transparent 19rem);
}

.intro.is-active {
  display: grid;
}

.intro-card-spread {
  position: relative;
  width: min(100%, 440px);
  height: 100%;
  min-height: 250px;
  margin: 0 auto;
  isolation: isolate;
}

.intro-tarot {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 150px;
  height: auto;
  border-radius: 7px;
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.48);
  transform-origin: 50% 90%;
  animation:
    introCardIn 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both,
    tarotFloat 4.8s ease-in-out 900ms infinite;
  will-change: translate, scale, filter;
}

.intro-tarot--left {
  z-index: 1;
  transform: translateX(-112%) rotate(-11deg);
}

.intro-tarot--center {
  z-index: 3;
  bottom: 18px;
  width: 166px;
  transform: translateX(-50%);
  animation-delay: 90ms, 1.15s;
  animation-duration: 700ms, 4.3s;
}

.intro-tarot--right {
  z-index: 2;
  transform: translateX(12%) rotate(11deg);
  animation-delay: 180ms, 1.45s;
  animation-duration: 700ms, 5.2s;
}

.intro-content {
  position: relative;
  z-index: 4;
  width: min(100%, 620px);
  margin: 0 auto;
  padding-top: 48px;
  text-align: left;
}

.intro h1 {
  line-height: 1.5;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro .eyebrow {
  color: #ffdce8;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 14px rgba(243, 166, 191, 0.42);
}

.tarot-app h1,
.tarot-app h2,
.tarot-app h3,
.tarot-app p {
  margin-top: 0;
}

.tarot-app h1 {
  position: relative;
  margin-bottom: 16px;
  max-width: 10em;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(2.55rem, 12vw, 3rem);
  font-size: clamp(2.55rem, 12cqw, 3rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.tarot-app h2 {
  margin-bottom: 14px;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(1.55rem, 6vw, 1.8rem);
  font-size: clamp(1.55rem, 6cqw, 1.8rem);
  line-height: 1.28;
  letter-spacing: 0;
}

.intro h1 {
  max-width: 10em;
  font-size: clamp(2.28rem, 10.2vw, 2.55rem);
}

.tarot-app h3 {
  margin-bottom: 10px;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: 1.35rem;
}

.lead,
.stage-copy,
.result-hero p,
.affiliate-cta p,
.loader-card p {
  color: var(--muted);
  line-height: 1.85;
}

.lead {
  position: relative;
  max-width: 35rem;
  margin-bottom: 26px;
}

.micro-copy {
  margin: 12px 0 0;
  color: rgba(255, 232, 240, 0.76);
  font-size: 0.82rem;
}

.primary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  width: 100%;
  max-width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  color: #24101d;
  background: linear-gradient(135deg, #fff5ef 0%, #f4d37f 50%, #f2a3b7 100%);
  box-shadow: 0 18px 42px rgba(243, 166, 191, 0.32), 0 2px 0 rgba(255, 255, 255, 0.42) inset;
  font-family: "Hiragino Sans", "Yu Gothic", "YuGothic", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.34);
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease, opacity 180ms ease, box-shadow 180ms ease;
}

.primary-action:hover,
.primary-action:focus-visible {
  filter: brightness(1.04) saturate(1.04);
  box-shadow: 0 20px 48px rgba(243, 166, 191, 0.4), 0 2px 0 rgba(255, 255, 255, 0.52) inset;
}

.primary-action:active {
  transform: translateY(1px) scale(0.99);
}

.primary-action:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
}

.primary-action:disabled:hover,
.primary-action:disabled:focus-visible {
  filter: none;
  box-shadow: none;
}

.intro .primary-action,
.cta-button {
  position: relative;
  overflow: hidden;
  animation: buttonGlow 2.4s ease-in-out infinite;
}

.intro .primary-action::after,
.cta-button::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -30%;
  width: 20%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  transform: translateX(-220%) skewX(-18deg);
  animation: buttonShine 3s ease-in-out infinite;
  pointer-events: none;
}

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.ghost-action {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--ink);
  background: rgba(255, 226, 238, 0.06);
  cursor: pointer;
}

.ghost-action--light {
  background: rgba(255, 226, 238, 0.09);
}

.progress {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 226, 238, 0.13);
}

.progress-fill {
  display: block;
  width: 20%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--gold));
  transition: width 280ms ease;
}

.progress-fill--cards {
  width: 86%;
}

.step-count {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.question-panel,
.card-stage,
.loader-card,
.result-sections,
.affiliate-cta {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.question-panel,
.card-stage {
  padding: 22px;
}

.choices {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.choice-button {
  width: 100%;
  min-height: 58px;
  border: 1px solid rgba(255, 226, 238, 0.18);
  border-radius: 16px;
  padding: 14px 16px;
  color: var(--ink);
  background: rgba(255, 226, 238, 0.07);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.choice-button.is-selected,
.choice-button:hover {
  border-color: rgba(243, 166, 191, 0.88);
  background: linear-gradient(135deg, rgba(243, 166, 191, 0.17), rgba(230, 196, 122, 0.1));
  transform: translateY(-1px);
}

.tarot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 24px 0 0;
}

.tarot-card {
  position: relative;
  aspect-ratio: 3 / 5;
  border: 1px solid rgba(255, 226, 238, 0.17);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  background: linear-gradient(160deg, #18203f, #4a2147);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  cursor: pointer;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.tarot-card img {
  position: absolute;
  top: 52.2%;
  left: 50%;
  width: 149%;
  height: auto;
  max-width: none;
  display: block;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.tarot-card.is-selected {
  z-index: 1;
  border-color: rgba(247, 194, 213, 0.98);
  box-shadow: 0 0 0 3px rgba(243, 166, 191, 0.18), 0 18px 44px rgba(230, 196, 122, 0.22);
  transform: translateY(-7px) scale(1.025);
}

.tarot-card.is-selected::after {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle, rgba(255, 217, 230, 0.34), transparent 55%);
  animation: glowPulse 1.8s ease-in-out infinite;
}

.card-read-action {
  margin-top: 22px;
}

.loading-screen {
  place-content: center;
}

.loading-screen.is-active {
  display: grid;
}

.loader-card {
  padding: 34px 22px;
  text-align: center;
}

.loader-symbol {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  border: 1px solid rgba(243, 166, 191, 0.62);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(243, 166, 191, 0.46), transparent 54%);
  animation: breathe 1.2s ease-in-out infinite;
}

.result-screen {
  padding-bottom: 34px;
}

.result-hero {
  padding: 34px 0 22px;
  text-align: center;
}

.result-card-visual {
  width: min(100%, 390px);
  margin: 20px auto 24px;
}

.result-card-visual img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  animation: cardReveal 720ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.result-hero h2 {
  color: #ffe3ed;
}

.result-hero > p:last-child {
  max-width: 680px;
  margin-right: auto;
  margin-left: auto;
  text-align: left;
}

.result-sections {
  display: grid;
  gap: 1px;
  overflow: hidden;
  padding: 0;
}

.result-block {
  padding: 22px 20px;
  background: rgba(255, 226, 238, 0.055);
}

.result-heading {
  position: relative;
  margin: 0 -8px 16px;
  border-top: 1px solid rgba(255, 220, 232, 0.1);
  border-bottom: 1px solid rgba(255, 220, 232, 0.18);
  padding: 10px 12px 10px 20px;
  color: #fff4f8;
  background: linear-gradient(90deg, rgba(243, 166, 191, 0.18), rgba(230, 196, 122, 0.07) 58%, transparent 100%);
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.5;
  text-shadow: 0 2px 14px rgba(243, 166, 191, 0.22);
}

.result-heading::before {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: 8px;
  width: 4px;
  border-radius: 3px;
  background: linear-gradient(var(--rose), var(--gold));
  box-shadow: 0 0 12px rgba(243, 166, 191, 0.28);
}

.result-block p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.85;
}

.affiliate-cta {
  margin-top: 18px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(243, 166, 191, 0.16), rgba(230, 196, 122, 0.1), rgba(157, 190, 232, 0.06)),
    var(--panel);
}

.cta-button {
  display: grid;
  place-items: center;
  min-height: 64px;
  margin-top: 18px;
}

.tarot-guide,
.tarot-guide * {
  box-sizing: border-box;
}

.tarot-guide {
  width: min(calc(100% - 32px), 720px);
  margin: 48px auto 0;
  padding: 34px 0 56px;
  color: var(--ink);
}

.tarot-guide__header {
  max-width: 640px;
  margin: 0 auto 26px;
  text-align: center;
}

.tarot-guide h2,
.tarot-guide h3,
.tarot-guide p {
  margin-top: 0;
}

.tarot-guide h2 {
  margin-bottom: 14px;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
  font-size: clamp(1.45rem, 5vw, 1.9rem);
  line-height: 1.45;
}

.tarot-guide h3 {
  margin-bottom: 8px;
  color: #fff1f6;
  font-size: 1rem;
  line-height: 1.5;
}

.tarot-guide p,
.tarot-guide li {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.9;
}

.tarot-guide__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.tarot-guide__panel,
.tarot-guide__section,
.tarot-guide__related,
.tarot-guide__notice {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(40, 19, 48, 0.72);
  box-shadow: 0 18px 50px rgba(8, 4, 18, 0.28);
}

.tarot-guide__panel {
  padding: 20px;
}

.tarot-guide__panel p {
  margin-bottom: 0;
  font-size: 0.86rem;
}

.tarot-guide__number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-bottom: 14px;
  border: 1px solid rgba(230, 196, 122, 0.48);
  border-radius: 50%;
  color: #2a1724;
  background: linear-gradient(135deg, #f7e8bb, var(--rose));
  font-size: 0.78rem;
  font-weight: 900;
}

.tarot-guide__section,
.tarot-guide__related {
  margin-top: 18px;
  padding: 26px;
}

.tarot-guide__section ul,
.tarot-guide__related ul {
  margin: 0 0 18px;
  padding-left: 1.4em;
}

.tarot-guide__faq h3 {
  margin-top: 22px;
  padding-left: 14px;
  border-left: 3px solid var(--rose);
}

.tarot-guide__faq p:last-child,
.tarot-guide__section p:last-child {
  margin-bottom: 0;
}

.tarot-guide__related li + li {
  margin-top: 10px;
}

.tarot-guide a {
  color: #ffe3ed;
  text-decoration-color: rgba(243, 166, 191, 0.58);
  text-underline-offset: 4px;
}

.tarot-guide a:hover,
.tarot-guide a:focus-visible {
  color: #fff;
  text-decoration-color: var(--gold);
}

.tarot-guide a:focus-visible {
  border-radius: 3px;
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.tarot-guide__notice {
  margin-top: 18px;
  padding: 20px 22px;
  background: rgba(255, 226, 238, 0.065);
}

.tarot-guide__notice p {
  margin-bottom: 8px;
  font-size: 0.82rem;
}

.tarot-guide__notice a {
  font-size: 0.82rem;
  font-weight: 700;
}

@media (max-width: 640px) {
  .tarot-guide {
    width: min(calc(100% - 28px), 430px);
    margin-top: 30px;
    padding-bottom: 42px;
  }

  .tarot-guide__grid {
    grid-template-columns: 1fr;
  }

  .tarot-guide__panel,
  .tarot-guide__section,
  .tarot-guide__related {
    padding: 20px;
  }
}

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

@keyframes introCardIn {
  from {
    opacity: 0;
    translate: 0 22px;
    scale: 0.94;
  }
  to {
    opacity: 1;
    translate: 0 0;
    scale: 1;
  }
}

@keyframes tarotFloat {
  0%,
  100% {
    translate: 0 0;
    scale: 1;
    filter: brightness(1);
  }
  38% {
    translate: -4px -16px;
    scale: 1.025;
    filter: brightness(1.08) drop-shadow(0 16px 24px rgba(243, 166, 191, 0.26));
  }
  70% {
    translate: 5px -7px;
    scale: 1.01;
    filter: brightness(1.04) drop-shadow(0 12px 20px rgba(230, 196, 122, 0.18));
  }
}

@keyframes buttonGlow {
  0%,
  100% {
    box-shadow: 0 14px 34px rgba(243, 166, 191, 0.26);
  }
  50% {
    box-shadow: 0 16px 44px rgba(255, 210, 225, 0.46), 0 0 24px rgba(230, 196, 122, 0.22);
  }
}

@keyframes buttonShine {
  0%,
  42% {
    left: -30%;
  }
  72%,
  100% {
    left: 130%;
  }
}

@keyframes glowPulse {
  50% {
    opacity: 0.55;
    transform: scale(1.1);
  }
}

@keyframes breathe {
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 40px rgba(243, 166, 191, 0.34);
  }
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro-tarot,
  .intro .primary-action,
  .intro .primary-action::after,
  .cta-button,
  .cta-button::after {
    animation: none;
  }
}
