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

:root {
  --gold: #C9A84C;
  --gold-light: #E8D5A0;
  --gold-dim: #8A6F35;
  --velvet: #0F0818;
  --velvet-mid: #1A0F2A;
  --velvet-light: #2D1A3E;
  --parchment: #F0E6CC;
}

body {
  background: var(--velvet);
  color: var(--parchment);
  font-family: 'Lora', Georgia, serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

section {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 2rem;
}

section.hidden { display: none; }

.landing-inner, .section-inner {
  max-width: 620px;
  width: 100%;
  text-align: center;
  padding-top: 2rem;
}

.section-inner.wide { max-width: 860px; }

#portrait {
  width: 360px;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid rgba(201,168,76,0.3);
  margin-bottom: 1.5rem;
}

h1 {
  font-family: 'Cinzel', serif;
  font-size: 2.6rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.tagline {
  font-size: 1.15rem;
  color: var(--gold-light);
  line-height: 1.8;
  margin-bottom: 0.8rem;
}

.sub {
  font-size: 1rem;
  color: rgba(240,230,204,0.55);
  margin-bottom: 2rem;
  font-style: italic;
}

button {
  background: transparent;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  padding: 13px 34px;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.3s;
}

button:hover {
  border-color: var(--gold);
  background: rgba(201,168,76,0.08);
}

textarea {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 0.5px solid rgba(201,168,76,0.3);
  color: var(--parchment);
  font-family: 'Lora', serif;
  font-size: 1.1rem;
  padding: 14px 16px;
  resize: none;
  outline: none;
  margin-bottom: 1.2rem;
  line-height: 1.7;
  border-radius: 2px;
}

textarea::placeholder { color: rgba(201,168,76,0.3); font-style: italic; }
textarea:focus { border-color: rgba(201,168,76,0.55); }

.genevieve-says {
  font-size: 1.2rem;
  font-style: italic;
  color: var(--parchment);
  line-height: 1.85;
  margin-bottom: 1.5rem;
  padding: 0 0.5rem;
}

/* Cards row — tutte le carte appaiono in fila */
.cards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 2rem;
  min-height: 60px;
}

.card-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.card-slot-label {
  font-size: 0.65rem;
  color: rgba(240,230,204,0.35);
  letter-spacing: 0.08em;
  font-style: italic;
}

.card-mini {
  width: 70px;
  height: 115px;
  border: 1px solid rgba(201,168,76,0.2);
  border-radius: 5px;
  background: var(--velvet-mid);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px;
  opacity: 0.4;
  transition: opacity 0.4s, border-color 0.4s;
}

.card-mini.revealed {
  opacity: 1;
  border-color: rgba(201,168,76,0.5);
}

.card-mini.active {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(201,168,76,0.15);
}

.card-mini-emoji { font-size: 1.6rem; line-height: 1; }

.card-mini-name {
  font-family: 'Cinzel', serif;
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  text-align: center;
  text-transform: uppercase;
  line-height: 1.3;
}

.card-mini-num {
  font-size: 0.5rem;
  color: var(--gold-dim);
}

/* Info carta attiva */
.active-card-info {
  margin-bottom: 1.5rem;
}

.active-position {
  font-size: 0.8rem;
  color: rgba(240,230,204,0.4);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.active-card-name {
  font-family: 'Cinzel', serif;
  font-size: 1.4rem;
  color: var(--gold);
  letter-spacing: 0.06em;
}

.active-reversed {
  font-size: 0.75rem;
  color: var(--gold-dim);
  font-style: italic;
  margin-left: 8px;
}

/* Conversazione */
.conversation-block {
  text-align: left;
  margin-bottom: 1.2rem;
}

.msg-genevieve {
  font-size: 1.1rem;
  line-height: 1.85;
  color: var(--parchment);
  font-style: italic;
  margin-bottom: 0.8rem;
}

.msg-user {
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(240,230,204,0.6);
  margin-bottom: 0.8rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(201,168,76,0.2);
}

.divider {
  width: 60px;
  height: 0.5px;
  background: var(--gold-dim);
  margin: 1.5rem auto;
  opacity: 0.3;
}

#dialogArea, #paidDialogArea {
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

#dialogArea textarea, #paidDialogArea textarea {
  margin-bottom: 0;
}

#nextCardBtn, #paidNextBtn, #restartBtn {
  margin-top: 1.5rem;
}

.paywall-box {
  border: 0.5px solid rgba(201,168,76,0.2);
  padding: 2.5rem;
  background: rgba(255,255,255,0.02);
  border-radius: 2px;
}

.paywall-sub {
  font-size: 1.1rem;
  color: var(--gold-light);
  margin: 1.5rem 0;
}

.paywall-sub strong { color: var(--gold); }

.paywall-note {
  font-size: 0.8rem;
  color: rgba(240,230,204,0.3);
  margin-top: 1rem;
  font-style: italic;
}

#stripeBtn {
  font-size: 0.88rem;
  padding: 15px 38px;
  border-color: var(--gold);
}

.loading-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 1.5rem 0;
}

.dot {
  width: 5px;
  height: 5px;
  background: var(--gold-dim);
  border-radius: 50%;
  animation: pulse 1.2s infinite ease-in-out;
}

.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes pulse {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

@media (max-width: 520px) {
  h1 { font-size: 1.9rem; }
  .tagline { font-size: 1rem; }
  #portrait { width: 260px; height: auto; }
  .card-mini { width: 56px; height: 90px; }
  .card-mini-emoji { font-size: 1.2rem; }
  .reviews { min-height: 190px; }
  .review { padding: 0.9rem 1rem; }
  .review-text { font-size: 0.88rem; }
  .review-author { font-size: 0.72rem; }
}

/* Intro: nome + sesso */
#introSection input[type="text"] {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 0.5px solid rgba(201,168,76,0.3);
  color: var(--parchment);
  font-family: 'Lora', serif;
  font-size: 1.2rem;
  padding: 14px 16px;
  outline: none;
  margin-bottom: 1.2rem;
  border-radius: 2px;
  text-align: center;
}
#introSection input[type="text"]::placeholder { color: rgba(201,168,76,0.3); font-style: italic; }
#introSection input[type="text"]:focus { border-color: rgba(201,168,76,0.55); }

.gender-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.gender-btn {
  padding: 10px 20px;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  opacity: 0.6;
  transition: all 0.2s;
}

.gender-btn.selected {
  border-color: var(--gold);
  color: var(--gold);
  opacity: 1;
  background: rgba(201,168,76,0.1);
}

/* Card flip */
.card-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.card-flip-container {
  width: 70px;
  height: 115px;
  perspective: 600px;
}

.card-flip-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.card-face-back, .card-face-front {
  position: absolute;
  inset: 0;
  border-radius: 5px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.card-face-back {
  background: var(--velvet-mid);
  border: 1px solid rgba(201,168,76,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-face-back svg {
  width: 55%;
  height: 55%;
  opacity: 0.3;
}

.card-face-front {
  background: var(--velvet-mid);
  border: 1px solid rgba(201,168,76,0.5);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px;
}

.card-face-front.active-glow {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(201,168,76,0.15);
}

.card-mini-emoji { font-size: 1.6rem; line-height: 1; }
.card-mini-name {
  font-family: 'Cinzel', serif;
  font-size: 0.48rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-align: center;
  text-transform: uppercase;
  line-height: 1.3;
}
.card-mini-num { font-size: 0.48rem; color: var(--gold-dim); }

.dialog-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.btn-secondary {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  padding: 11px 24px;
  opacity: 1;
  border-color: rgba(201,168,76,0.45);
  color: rgba(240,230,204,0.75);
}

.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(201,168,76,0.06);
}

/* Stripe Elements */
#elementsForm {
  margin: 1.5rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

#payment-element {
  padding: 4px 0;
}

/* Override Stripe Elements iframe to match our theme */
#payment-element iframe {
  border-radius: 2px !important;
}

#submitPaymentBtn {
  width: 100%;
  padding: 15px;
  font-size: 0.9rem;
  border-color: var(--gold);
  color: var(--gold);
  letter-spacing: 0.18em;
}

#submitPaymentBtn:disabled {
  opacity: 0.5;
  cursor: default;
}

.payment-error {
  color: #e07070;
  font-size: 0.9rem;
  font-style: italic;
  text-align: center;
}

/* Recensioni landing — carousel */
.reviews {
  margin-top: 2.5rem;
  width: 100%;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  min-height: 140px;
}

.review {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.03);
  border: 0.5px solid rgba(201,168,76,0.15);
  border-radius: 3px;
  padding: 1rem 1.2rem;
  text-align: left;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  pointer-events: none;
}

.review.active {
  opacity: 1;
  pointer-events: auto;
}

.stars {
  color: var(--gold);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.review-text {
  font-size: 0.95rem;
  font-style: italic;
  color: var(--parchment);
  line-height: 1.7;
  margin-bottom: 0.5rem;
  opacity: 0.85;
}

.review-author {
  font-size: 0.78rem;
  color: var(--gold-dim);
  letter-spacing: 0.05em;
}

#portraitShuffle {
  width: 300px;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(201,168,76,0.3);
  margin-bottom: 1.5rem;
}

/* Footer */
#siteFooter {
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  margin-top: 2rem;
  border-top: 0.5px solid rgba(201,168,76,0.1);
}

.footer-disclaimer {
  font-size: 0.7rem;
  color: rgba(240,230,204,0.3);
  font-style: italic;
  margin-bottom: 0.3rem;
  line-height: 1.5;
}

.footer-links {
  font-size: 0.68rem;
  color: rgba(201,168,76,0.35);
}

.footer-links a {
  color: rgba(201,168,76,0.4);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--gold-dim); }

.footer-sep {
  margin: 0 0.5rem;
  opacity: 0.4;
}

.footer-copyright {
  font-size: 0.62rem;
  color: rgba(240,230,204,0.2);
  margin-top: 0.2rem;
  letter-spacing: 0.05em;
}

/* Suggerimenti domanda */
.question-suggestions {
  margin-bottom: 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.suggestions-label {
  font-size: 0.75rem;
  color: rgba(240,230,204,0.35);
  letter-spacing: 0.1em;
  font-style: italic;
  margin-bottom: 0.3rem;
}

.suggestion-btn {
  font-family: 'Lora', serif;
  font-size: 0.88rem;
  font-style: italic;
  letter-spacing: 0.02em;
  text-transform: none;
  padding: 8px 18px;
  border-color: rgba(201,168,76,0.2);
  color: rgba(240,230,204,0.6);
  opacity: 1;
  transition: all 0.2s;
}

.suggestion-btn:hover {
  border-color: rgba(201,168,76,0.5);
  color: var(--parchment);
  background: rgba(201,168,76,0.05);
}

.dialog-or {
  font-size: 0.75rem;
  color: rgba(240,230,204,0.3);
  font-style: italic;
  letter-spacing: 0.1em;
  margin: 0.3rem 0;
}

.epilogue-title {
  font-family: 'Cinzel', serif;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  color: var(--gold-dim);
  text-align: center;
  margin: 0.5rem 0 1.5rem;
  text-transform: uppercase;
}
