/* ===== Solena — Diagnoza Miłosna ===== */

:root{
  --ink-950: #0a0916;
  --ink-900: #100e1f;
  --ink-800: #171429;
  --ink-700: #201a38;
  --plum-600: #2c2148;

  --gold: #c9a15a;
  --gold-soft: #e2c791;
  --rose: #d98a86;
  --rose-soft: #e8b0ac;

  --parchment: #f4ede1;
  --parchment-dim: #cfc6d9;
  --mute: #a79db3;

  --line: rgba(201,161,90,0.24);
  --line-soft: rgba(244,237,225,0.12);

  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "Manrope", "Segoe UI", sans-serif;

  --shadow-lift: 0 30px 60px -25px rgba(0,0,0,0.65);
  --ease: cubic-bezier(.22,.9,.3,1);
}

*, *::before, *::after{ box-sizing: border-box; }

body{
  margin: 0;
  background: var(--ink-950);
  color: var(--parchment);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg{ display: block; max-width: 100%; }
a{ color: inherit; text-decoration: none; }
ul{ list-style: none; margin: 0; padding: 0; }
button{ font: inherit; cursor: pointer; }
input, select, textarea{ font: inherit; }

/* ===== Texture layers ===== */
.grain{
  position: fixed; inset: 0; pointer-events: none; z-index: 5;
  opacity: 0.05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.star-field{ position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.star{
  position: absolute; width: 2px; height: 2px;
  background: var(--gold-soft); border-radius: 50%;
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle{
  0%, 100%{ opacity: 0.15; transform: scale(1); }
  50%{ opacity: 0.9; transform: scale(1.6); }
}

.eyebrow{
  font-family: var(--font-body);
  font-size: 0.78rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--gold); font-weight: 700; margin: 0 0 0.9rem;
}

/* ===== Buttons ===== */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: 100px; padding: 0.9rem 1.9rem;
  font-weight: 700; font-size: 0.95rem; border: 1px solid transparent;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.3s, border-color 0.3s, color 0.3s;
}
.btn-primary{
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  color: var(--ink-950);
  box-shadow: 0 12px 30px -12px rgba(201,161,90,0.55);
}
.btn-primary:hover{ transform: translateY(-2px); box-shadow: 0 18px 36px -14px rgba(201,161,90,0.7); }
.btn-primary:disabled{ opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-wide{ width: 100%; }
.btn-text{
  background: none; border: none; color: var(--mute); padding: 0.6rem 0.4rem; font-weight: 600;
}
.btn-text:hover{ color: var(--rose-soft); }

/* ===== Top bar ===== */
.top-bar{
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1100px; margin: 0 auto; padding: 1.8rem 1.5rem 0.5rem;
}
.logo{ display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-display); font-weight: 600; font-size: 1.45rem; }
.logo-mark{ color: var(--gold); }
.top-bar-tag{
  margin: 0; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--mute); font-weight: 700;
}

/* ===== Persistent entertainment disclaimer (always on screen) ===== */
.disclaimer-bar{
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  margin: 0; padding: 0.6rem 1rem 0.7rem;
  font-size: 0.68rem; line-height: 1.35; text-align: center;
  color: var(--mute);
  background: linear-gradient(180deg, transparent, var(--ink-950) 60%);
  pointer-events: none;
}

/* ===== Stage / scene (no card — full immersive canvas) ===== */
.stage{
  position: relative; z-index: 1;
  min-height: calc(100vh - 64px);
  display: flex; align-items: center; justify-content: center;
  padding: 2.5rem 1.5rem 5rem;
  overflow: hidden;
}

.ambient{ position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.ambient-glow{
  position: absolute; top: 45%; left: 50%;
  width: 1100px; height: 1100px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(201,161,90,0.12), rgba(44,33,72,0.08) 45%, transparent 70%);
  filter: blur(10px);
}
.ambient-ring{
  position: absolute; top: 45%; left: 50%;
  border: 1px solid var(--line); border-radius: 50%;
  transform: translate(-50%, -50%);
}
.ambient-ring--1{ width: 760px; height: 760px; animation: spin 80s linear infinite; }
.ambient-ring--2{ width: 940px; height: 940px; border-color: rgba(217,138,134,0.14); animation: spin 110s linear infinite reverse; }

.scene{
  position: relative; z-index: 2;
  width: 100%; max-width: 1080px;
}
.quiz-view{ display: none; }
.quiz-view.is-active{ display: block; animation: fadeUp 0.55s var(--ease); }
@keyframes fadeUp{
  from{ opacity: 0; transform: translateY(16px); }
  to{ opacity: 1; transform: translateY(0); }
}

/* ===== Single-column scene (name / cutscene / loading / result / checkout) ===== */
.scene-solo{
  max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}

/* ===== Character portrait ===== */
.portrait{
  position: relative;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.1rem;
}
.portrait--md{ width: 108px; height: 108px; }
.portrait--lg{ width: 172px; height: 172px; }
.portrait-core{
  position: relative; z-index: 2;
  width: 62%; height: 62%; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-soft);
  background: linear-gradient(160deg, var(--plum-600), var(--ink-800));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lift);
}
.portrait-ring{
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--line);
}
.portrait-ring--1{ animation: portraitPulse 4s ease-in-out infinite; }
.portrait-ring--2{ inset: 10%; border-color: rgba(217,138,134,0.22); animation: portraitPulse 4s ease-in-out 0.7s infinite; }
.portrait-ring--3{ inset: -10%; border-color: rgba(201,161,90,0.14); animation: portraitPulse 4s ease-in-out 1.4s infinite; }
@keyframes portraitPulse{
  0%, 100%{ transform: scale(1); opacity: 0.55; }
  50%{ transform: scale(1.05); opacity: 0.95; }
}
.portrait.is-speaking .portrait-ring{
  animation: portraitSpeak 0.8s ease-in-out infinite;
  border-color: var(--gold);
}
@keyframes portraitSpeak{
  0%, 100%{ transform: scale(1); opacity: 0.6; }
  50%{ transform: scale(1.12); opacity: 1; }
}
.portrait-name{
  margin: 0 0 1.3rem;
  font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; color: var(--parchment);
}
.portrait-name span{
  font-weight: 400; font-style: italic; font-size: 0.85rem;
  color: var(--mute); letter-spacing: 0.02em;
}

/* ===== Speech bubble ===== */
.bubble{
  position: relative;
  border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(180deg, rgba(244,237,225,0.045), rgba(244,237,225,0.015));
  padding: 1.3rem 1.6rem;
  margin-bottom: 1.6rem;
  min-height: 5.4em;
  cursor: default;
  width: 100%;
}
.bubble::before{
  content: "";
  position: absolute; top: -7px; left: 50%; margin-left: -7px;
  width: 13px; height: 13px;
  background: var(--ink-900);
  border-left: 1px solid var(--line); border-top: 1px solid var(--line);
  transform: rotate(45deg);
}
.bubble--center{ max-width: 46ch; }
.bubble--compact{ min-height: 0; max-width: 42ch; }
.bubble-text{
  margin: 0;
  font-family: var(--font-display); font-style: italic; font-weight: 500;
  font-size: 1.3rem; line-height: 1.5; color: var(--parchment);
}
.dialogue-cursor{
  display: inline-block; margin-left: 1px;
  color: var(--gold-soft);
  animation: cursorBlink 0.85s steps(1) infinite;
}
@keyframes cursorBlink{ 50%{ opacity: 0; } }

.dialogue-aside{
  margin: 0 0 0.9rem;
  font-size: 0.92rem; font-style: italic; color: var(--mute);
  min-height: 1.3em;
}
.reaction-line{
  min-height: 1.3em; margin: -1.4rem 0 0;
  font-family: var(--font-display); font-style: italic; font-size: 1.02rem; color: var(--rose-soft);
  opacity: 0; transform: translateY(-4px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.reaction-line.is-visible{ opacity: 1; transform: translateY(0); }

.trust-line{ margin: 1.4rem 0 0; font-size: 0.82rem; color: var(--mute); text-align: center; }

/* ===== Gender choice (opening step) ===== */
.gender-choices{ display: flex; gap: 1rem; width: 100%; }
.gender-choice{
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  padding: 1.5rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--line-soft);
  background: rgba(244,237,225,0.02);
  color: var(--parchment-dim);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), transform 0.25s var(--ease);
}
.gender-choice:hover{ border-color: var(--line); transform: translateY(-3px); }
.gender-choice.selected{ border-color: var(--gold); background: rgba(201,161,90,0.1); }
.gender-choice-label{
  font-family: var(--font-display); font-weight: 600; font-style: italic;
  font-size: 1.4rem; color: var(--gold-soft);
}
.gender-choice-sub{ font-size: 0.8rem; color: var(--mute); }

/* ===== Name form ===== */
#nameForm{ width: 100%; display: flex; flex-direction: column; gap: 0.9rem; }
#nameForm input{
  background: rgba(244,237,225,0.04);
  border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 0.95rem 1.1rem; color: var(--parchment); text-align: center;
  font-family: var(--font-display); font-style: italic; font-size: 1.3rem;
  transition: border-color 0.3s;
}
#nameForm input:focus{ outline: none; border-color: var(--gold); }
#nameForm input::placeholder{ color: var(--mute); opacity: 0.6; }

/* ===== Custom field validation (on-theme, replaces native browser tooltip) ===== */
.field-error{
  display: none;
  margin: -0.3rem 0 0;
  font-family: var(--font-display); font-style: italic; font-size: 0.95rem;
  color: var(--rose-soft);
}
.field-error.is-visible{ display: block; animation: fadeUp 0.35s var(--ease); }
input.field-invalid{
  border-color: var(--rose) !important;
  animation: fieldShake 0.4s var(--ease);
}
@keyframes fieldShake{
  0%, 100%{ transform: translateX(0); }
  25%{ transform: translateX(-5px); }
  75%{ transform: translateX(5px); }
}

/* ===== Cutscene ===== */
.cutscene-chapter{
  margin: 0 0 1.6rem;
  font-size: 0.78rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--gold);
}

/* ===== Two-column scene: question (right) + choices (left) ===== */
.scene-hud{
  max-width: 640px; margin: 0 auto 0.5rem;
  display: flex; align-items: center; gap: 1rem;
}
.quiz-progress-track{ flex: 1; height: 3px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.quiz-progress-bar{ height: 100%; width: 8.33%; background: linear-gradient(90deg, var(--rose-soft), var(--gold)); transition: width 0.5s var(--ease); }
.quiz-step-label{ font-size: 0.8rem; color: var(--mute); white-space: nowrap; }
.progress-hint{
  max-width: 640px; margin: 0 auto 1.6rem;
  min-height: 1.4em;
  font-family: var(--font-display); font-style: italic; font-size: 1rem; color: var(--rose-soft);
  text-align: center;
  opacity: 0; transform: translateY(-4px);
  transition: opacity 0.4s var(--ease), transform 0.4s var(--ease);
}
.progress-hint.is-visible{ opacity: 1; transform: translateY(0); }

.scene-grid{
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  grid-template-areas: "choices character";
  gap: 3.2rem;
  align-items: start;
}
.scene-character{ grid-area: character; display: flex; flex-direction: column; align-items: center; text-align: center; }
.scene-choices{ grid-area: choices; padding-top: 0.4rem; }

.choices-label{
  margin: 0 0 1rem;
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--mute); font-weight: 700;
}
.quiz-options{ display: flex; flex-direction: column; }
.quiz-option{
  position: relative;
  display: flex; align-items: center; gap: 1rem;
  text-align: left; width: 100%;
  padding: 1.05rem 0.3rem 1.05rem 1rem;
  border: none; border-top: 1px solid var(--line-soft);
  background: none; color: var(--parchment-dim);
  transition: color 0.25s var(--ease), padding-left 0.25s var(--ease);
}
.quiz-options button.quiz-option:last-child{ border-bottom: 1px solid var(--line-soft); }
.quiz-option::before{
  content: ""; position: absolute; left: 0; top: 50%;
  width: 2px; height: 0; background: var(--gold);
  transform: translateY(-50%);
  transition: height 0.25s var(--ease);
}
.quiz-option:hover{ color: var(--parchment); padding-left: 1.3rem; }
.quiz-option:hover::before{ height: 55%; }
.quiz-option.selected{ color: var(--parchment); padding-left: 1.3rem; }
.quiz-option.selected::before{ height: 70%; }
.option-letter{
  flex: none;
  font-family: var(--font-display); font-weight: 600; font-style: italic;
  font-size: 1.25rem; color: var(--gold-soft);
}
.quiz-option.selected .option-letter{ color: var(--gold); }
.option-text{ flex: 1; }

.quiz-nav{ display: flex; align-items: center; margin-top: 1.4rem; }

/* ===== Loading ===== */
.loading-orb{ position: relative; width: 90px; height: 90px; display: flex; align-items: center; justify-content: center; color: var(--gold); margin-bottom: 1.8rem; }
.loading-ring{ position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--line); border-top-color: var(--gold); animation: spin 2.2s linear infinite; }
.loading-ring--2{ inset: 14px; border-top-color: var(--rose-soft); animation-duration: 1.5s; animation-direction: reverse; }
@keyframes spin{ to{ transform: rotate(360deg); } }
.loading-percent{
  font-family: var(--font-display); font-variant-numeric: tabular-nums;
  font-size: 1.9rem; color: var(--gold-soft); margin: 0;
}

/* ===== Result ===== */
.result-body{
  max-width: 720px; margin: 2.6rem auto 0;
  display: grid; grid-template-columns: 190px 1fr; gap: 2.4rem; align-items: start;
}
.result-card-wrap{ display: flex; justify-content: center; perspective: 1200px; }
.tarot-card{ width: 172px; height: 248px; }
.tarot-card-inner{ position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1s var(--ease); }
.tarot-card.is-flipped .tarot-card-inner{ transform: rotateY(180deg); }
.tarot-face{
  position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: 14px; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lift);
}
.tarot-face--back{ background: linear-gradient(160deg, var(--plum-600), var(--ink-800)); }
.tarot-back-pattern{
  width: 80%; height: 80%; border: 1px solid var(--line); border-radius: 10px;
  background-image: radial-gradient(circle, var(--gold) 1px, transparent 1px);
  background-size: 14px 14px; opacity: 0.35;
}
.tarot-face--front{
  transform: rotateY(180deg);
  background: linear-gradient(170deg, var(--ink-800), var(--plum-600));
  flex-direction: column; gap: 0.9rem;
}
.tarot-symbol{ font-size: 2.5rem; color: var(--gold-soft); }
.tarot-name{ font-family: var(--font-display); font-weight: 600; font-style: italic; font-size: 1.4rem; color: var(--parchment); text-align: center; padding: 0 0.6rem; }

.result-section-label{
  font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--mute); font-weight: 700; margin: 0 0 0.7rem;
}
.result-reading, .result-week, .result-sign{
  font-size: 1rem; line-height: 1.65; color: var(--parchment-dim);
  margin: 0 0 1.8rem;
}

.compat-meter{
  border: 1px solid var(--line-soft); border-radius: 16px;
  padding: 1.3rem 1.5rem 1.5rem;
  background: linear-gradient(180deg, rgba(201,161,90,0.06), transparent);
  margin-bottom: 1.8rem;
}
.compat-meter-head{ display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.7rem; }
.compat-label{ font-size: 0.85rem; color: var(--parchment-dim); font-weight: 600; }
.compat-value{ font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; color: var(--gold-soft); }
.compat-track{ height: 6px; background: var(--line-soft); border-radius: 3px; overflow: hidden; margin-bottom: 0.8rem; }
.compat-bar{
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--rose-soft), var(--gold));
  transition: width 1.1s var(--ease);
}
.compat-line{ font-size: 0.86rem; font-style: italic; color: var(--mute); margin: 0; }

/* ===== Footer ===== */
.site-footer{ position: relative; z-index: 1; padding: 2.5rem 1.5rem 3rem; text-align: center; }
.footer-disclaimer{ font-size: 0.76rem; color: var(--mute); max-width: 50ch; margin: 0 auto 0.6rem; }
.footer-copy{ font-size: 0.76rem; color: var(--mute); margin: 0; }

/* ===== Responsive ===== */
@media (max-width: 900px){
  .scene-grid{
    grid-template-columns: 1fr;
    grid-template-areas: "character" "choices";
    gap: 2.2rem;
  }
  .scene-choices{ max-width: 520px; margin: 0 auto; width: 100%; }
  .bubble{ max-width: 46ch; margin-left: auto; margin-right: auto; }
}

@media (max-width: 640px){
  .result-body{ grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .result-text{ width: 100%; max-width: 420px; }
  .result-reading, .result-week, .result-sign{ text-align: left; }
  .portrait--lg{ width: 132px; height: 132px; }
  .ambient-ring--2{ display: none; }
}

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