/* Same gray dark palette as the rest of the DayTrace/Prism family
   (day-trace-root/style.css, web-games/shared/hub.css). --accent stays the
   distinct tarot-gold highlight used for callouts, not a generic UI color. */
:root {
  color-scheme: dark;
  --bg: #202124;
  --surface: #2d2e31;
  --surface-light: #35363a;
  --primary: #a08cff;
  --secondary: #4fd1d9;
  --accent: #e9c46a;
  --text: #e8eaed;
  --muted: #9aa0a6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

a {
  color: var(--secondary);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Header / Footer --- */
.pf-header {
  padding: 1.5rem 1.25rem 1rem;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pf-home-link {
  display: block;
  margin: 0 0 0.75rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.8rem;
}

.pf-home-link:hover {
  color: var(--secondary);
}

.pf-header .pf-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.pf-header .pf-brand .mark {
  color: var(--accent);
}

.pf-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  margin-top: 0.9rem;
  font-size: 0.85rem;
}

.pf-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.3rem 0.2rem;
}

.pf-nav a:hover,
.pf-nav a[aria-current="page"] {
  color: var(--text);
}

.pf-footer {
  margin-top: 2rem;
  padding: 2rem 1.25rem 3rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.pf-footer nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-bottom: 1rem;
}

.pf-footer a {
  color: var(--muted);
}

.pf-disclaimer {
  max-width: 34rem;
  margin: 0 auto 1rem;
  line-height: 1.6;
}

/* --- Layout --- */
.pf-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.pf-section {
  margin: 2.5rem 0;
}

.pf-section h2 {
  font-size: 1.2rem;
  margin: 0 0 1rem;
}

/* --- Buttons --- */
.pf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  background: var(--primary);
  color: #0a0b16;
  border: none;
  padding: 0.8rem 1.75rem;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.pf-btn:active {
  transform: scale(0.97);
}

.pf-btn.pf-btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.pf-btn:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* --- Cards --- */
.pf-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 1.25rem;
}

.pf-service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.pf-service-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.pf-service-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}

.pf-service-card .icon {
  font-size: 1.8rem;
}

.pf-service-card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.pf-service-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

/* --- Steps --- */
.pf-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.pf-step {
  background: var(--surface);
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.pf-step .num {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
}

.pf-step p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

/* --- FAQ / guide content --- */
.pf-faq-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 1rem 0;
}

.pf-faq-item h3 {
  margin: 0 0 0.5rem;
  font-size: 0.98rem;
}

.pf-faq-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.92rem;
}

/* --- Ad slot ---
   Per project spec: layout must not break without ads, but no visible
   "ad pending" placeholder should be shown to users (unlike the web-games
   site's dashed-border placeholder) - reserve space only. */
.pf-ad-slot {
  margin: 1.5rem 0;
  min-height: 1px;
}

/* --- Utility --- */
.pf-muted {
  color: var(--muted);
}

.pf-hidden {
  display: none !important;
}

.pf-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pf-star-rating {
  color: var(--accent);
  letter-spacing: 0.15em;
}

/* --- Tarot cards ---
   No commissioned illustration art yet (see project follow-ups) - card
   faces are drawn with CSS/typography only: number, name, a simple
   symbolic glyph. Kept deliberately minimal per the "Modern / Mystical /
   Minimal" brief in the spec rather than looking like a placeholder. */
.pf-card-spread {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1.5rem 0;
  perspective: 1000px;
}

.pf-tarot-card {
  width: 110px;
  aspect-ratio: 2 / 3;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
}

.pf-tarot-card:disabled {
  cursor: default;
}

.pf-tarot-card .inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
  transform-style: preserve-3d;
}

.pf-tarot-card.flipped .inner {
  transform: rotateY(180deg);
}

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

.pf-tarot-card .face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.5rem;
}

.pf-tarot-card .face-back {
  background: linear-gradient(155deg, #12152a 0%, #1c1440 55%, #0d0f22 100%);
  border: 1px solid rgba(233, 196, 106, 0.35);
}

.pf-tarot-card .face-back .glyph {
  font-size: 1.8rem;
  color: var(--accent);
  opacity: 0.85;
}

.pf-tarot-card .face-front {
  background: var(--surface);
  border: 1px solid rgba(233, 196, 106, 0.5);
  transform: rotateY(180deg);
  gap: 0.3rem;
  padding: 0;
  overflow: hidden;
}

.pf-tarot-card .face-front .card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pf-tarot-card.reversed .face-front .card-image {
  transform: rotate(180deg);
}

.pf-tarot-card .face-front .glyph {
  font-size: 1.6rem;
  color: var(--primary);
}

.pf-tarot-card .face-front .num {
  font-size: 0.65rem;
  color: var(--muted);
}

.pf-tarot-card .face-front .name-en {
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
}

.pf-tarot-card .face-front .name-ko {
  font-size: 0.68rem;
  color: var(--muted);
}

.pf-tarot-card .face-front .orientation {
  font-size: 0.62rem;
  color: var(--secondary);
}

.pf-tarot-card.reversed .face-front .inner-content {
  transform: rotate(180deg);
}

/* Keeps all 3 spread cards on one row even on the narrowest supported
   width (360px) instead of wrapping to 2+1 - 3 x 110px + 2 x 1rem gap
   already exceeds a 360px viewport once the .pf-main padding is
   subtracted. Placed after the base .pf-tarot-card rule (not before) so
   it actually wins the cascade at equal specificity - a media query
   appearing earlier in the file loses to a later unconditional rule for
   the same selector regardless of whether the query matches. */
@media (max-width: 380px) {
  .pf-card-spread {
    gap: 0.5rem;
  }
  .pf-tarot-card {
    width: 88px;
  }
}

.pf-card-large {
  width: 160px;
  margin: 0 auto 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
}

.pf-card-large .card-image {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.pf-card-large.reversed .card-image {
  /* Only the card art flips - rotating the name text too would force
     readers to tilt their head to read it. The "역방향" badge already
     communicates the orientation in plain, upright text. */
  transform: rotate(180deg);
}

.pf-card-large .name-en {
  font-weight: 700;
  font-size: 1rem;
}

.pf-card-large .name-ko {
  color: var(--muted);
  font-size: 0.85rem;
}

.pf-card-large .orientation-tag {
  font-size: 0.7rem;
  color: var(--secondary);
  padding: 0.15rem 0.6rem;
  border: 1px solid rgba(94, 200, 229, 0.4);
  border-radius: 999px;
}

.pf-result-block {
  margin: 1.25rem 0;
}

.pf-result-block h3 {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pf-result-block p {
  margin: 0;
  line-height: 1.7;
}

.pf-score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.pf-score-item {
  background: var(--surface);
  border-radius: 12px;
  padding: 0.75rem;
  text-align: center;
}

.pf-score-item .label {
  font-size: 0.78rem;
  color: var(--muted);
}

.pf-keyword-chip {
  display: inline-block;
  background: rgba(139, 124, 255, 0.15);
  color: var(--primary);
  border-radius: 999px;
  padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
  margin: 0.15rem;
}

.pf-lucky-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.pf-birthdate-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 1.5rem 0;
}

.pf-birthdate-form input,
.pf-birthdate-form select {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  border-radius: 8px;
  padding: 0.6rem 0.5rem;
  font-size: 0.95rem;
}

.pf-yesno-answer {
  text-align: center;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin: 1rem 0 0.25rem;
}

.pf-yesno-answer.tone-positive { color: #7bd389; }
.pf-yesno-answer.tone-neutral { color: var(--accent); }
.pf-yesno-answer.tone-negative { color: #ff8fa3; }
