/* Honest Cards styles. Reuses the design tokens + base components from
   client/ui/app.css and the fashion sheet (pack cards, dials — linked in index.html),
   and adds only what this game needs: a warmer paper, the flipping card itself, the
   two-answer reveal, the letter page and the keepsake.

   The one skin decision: this game runs on WARM paper, not the app's cool photo white.
   It's the only surface in Angie meant to feel like a table at night. */
:root {
  --cd-rose: #B4849B;
  --cd-deep: #7A3552;
}
body[data-game="cards"] {
  --paper: #FFF8F4;
  --paper-raised: #FFFDFB;
  --line: #EFE0DC;
  --ink-soft: #6B6068;
}

.start-tagline { color: var(--ink-soft); font-size: 15px; text-align: center; max-width: 34ch; }
.presence-text { color: var(--ink-soft); font-size: 14px; }

.cd-start-art {
  width: min(86vw, 420px);
  height: auto;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

/* ============ PACK ============ */
.cd-pack .pack-grid { max-width: 620px; }
.cd-letter-chip { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 18px; border-radius: var(--r-card); }
.cd-letter-chip b { font-size: 13px; }
.cd-letter-chip span { font-family: var(--font-mono); font-size: 10px; color: var(--ink-soft); }

/* ============ CARD (the round) ============ */
.scene.cd-round { gap: var(--s2); }
.cd-count { color: var(--cd-rose); }

.cd-stage { perspective: 1400px; width: min(78vw, 340px); }
.cd-card {
  position: relative;
  width: 100%;
  aspect-ratio: 0.68;
  background: none;
  border: 0;
  padding: 0;
}
.cd-card.is-tappable { cursor: pointer; }
.cd-card-inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 720ms cubic-bezier(.2, .8, .2, 1);
}
.cd-card.is-flipped .cd-card-inner { transform: rotateY(180deg); }
.cd-card.is-tappable .cd-card-inner { animation: cd-breathe 3.6s ease-in-out infinite; }
@keyframes cd-breathe {
  50% { transform: translateY(-6px) rotate(-0.6deg); }
}

.cd-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(122, 53, 82, 0.18);
  background: var(--paper-raised);
}
.cd-face--back { border: 1px solid #E4CBD3; }
.cd-back-art { width: 100%; height: 100%; object-fit: cover; display: block; }
.cd-face--front {
  transform: rotateY(180deg);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--s2);
  padding: var(--s3) var(--s2);
  text-align: center;
}
.cd-face--front::before,
.cd-face--front::after {
  content: '';
  position: absolute; left: 18px; right: 18px; height: 1px;
  background: var(--line);
}
.cd-face--front::before { top: 46px; }
.cd-face--front::after { bottom: 46px; }

.cd-stamp {
  position: absolute; top: 18px; left: 0; right: 0;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--cd-rose);
}
.cd-kind {
  position: absolute; bottom: 18px; left: 0; right: 0;
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: #B9AAB0;
}
.cd-q {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(17px, 4.4vw, 23px);
  line-height: 1.42; letter-spacing: -0.01em;
  color: var(--cd-deep);
  margin: 0; max-width: 24ch;
}
.cd-face--front.is-act .cd-q { color: #8A5A24; font-style: italic; }
.cd-q--sm {
  font-size: clamp(15px, 3vw, 19px);
  font-weight: 600; color: var(--ink-soft);
  max-width: 46ch; text-align: center;
}

.cd-answer { display: flex; flex-direction: column; align-items: center; gap: var(--s2); width: min(92vw, 460px); }
.cd-answer.is-hidden, .cd-round .is-hidden, .cd-result .is-hidden { display: none; }
.cd-input {
  width: 100%;
  padding: var(--s2);
  font-family: var(--font-body); font-size: 16px; line-height: 1.55;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  resize: vertical;
}
.cd-input:focus-visible { outline: 2px solid var(--cd-rose); outline-offset: 1px; }
.cd-input:disabled { color: var(--ink-soft); background: #FBF3EF; }

.cd-status { font-size: 13px; color: var(--ink-soft); min-height: 18px; text-align: center; }
.cd-timer { font-family: var(--font-mono); font-size: 11px; color: #C2B2B8; min-height: 14px; }

/* ============ SHARED (the card opens) ============ */
.scene.cd-shared { gap: var(--s2); }
.cd-pair {
  display: grid; gap: var(--s2);
  grid-template-columns: 1fr;
  width: min(94vw, 720px);
}
@media (min-width: 620px) { .cd-pair { grid-template-columns: 1fr 1fr; } }
.cd-said {
  padding: var(--s2);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-top: 3px solid var(--pink);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
  animation: cd-rise 420ms cubic-bezier(.2, 1, .3, 1) both;
}
.cd-said[data-color="blue"] { border-top-color: var(--blue); }
@keyframes cd-rise { from { opacity: 0; transform: translateY(10px); } }
.cd-said-name {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
}
.cd-said-text { margin: 6px 0 0; font-size: 16px; line-height: 1.6; white-space: pre-wrap; }
.cd-act-done { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--cd-deep); }
.cd-nudge { font-family: var(--font-mono); font-size: 11px; color: #BCAAB1; margin: 0; }

/* ============ LETTER ============ */
.scene.cd-letter { gap: var(--s1); }
.cd-letter-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(20px, 4.6vw, 27px);
  color: var(--cd-deep); margin: 0; text-align: center; max-width: 30ch;
}
.cd-letter-hint { font-size: 14px; color: var(--ink-soft); margin: 0 0 var(--s1); text-align: center; }
.cd-letter-paper {
  position: relative;
  width: min(94vw, 560px);
  padding: var(--s3) var(--s3) var(--s2);
  background:
    repeating-linear-gradient(to bottom, transparent 0 33px, #F3E4E7 33px 34px),
    var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 14px 34px rgba(122, 53, 82, 0.1);
}
.cd-letter-input {
  width: 100%;
  border: 0; background: none; resize: vertical;
  font-family: "Gowun Batang", var(--font-display), serif;
  font-size: 17px; line-height: 34px; color: var(--ink);
}
.cd-letter-input:focus-visible { outline: none; }
.cd-letter-count { display: block; text-align: right; font-family: var(--font-mono); font-size: 10px; color: #C7B6BC; }

/* ============ RESULT (the keepsake) ============ */
.scene.cd-result { gap: var(--s2); padding-bottom: var(--s5); }
.cd-seal { font-size: 40px; line-height: 1; }
.cd-note-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(24px, 5.4vw, 34px);
  color: var(--cd-deep); margin: 0; text-align: center; max-width: 26ch;
}
.cd-note-body { font-size: 16px; line-height: 1.65; color: var(--ink-soft); margin: 0; text-align: center; max-width: 52ch; }
.cd-keep {
  font-family: "Gowun Batang", var(--font-display), serif;
  font-size: 19px; line-height: 1.55; color: var(--cd-deep);
  margin: var(--s1) 0 0; text-align: center; max-width: 40ch;
}

.cd-letters { display: grid; gap: var(--s2); width: min(94vw, 720px); }
@media (min-width: 620px) { .cd-letters { grid-template-columns: 1fr 1fr; } }
.cd-letter-card {
  padding: var(--s2);
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-left: 3px solid var(--pink);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
}
.cd-letter-card[data-color="blue"] { border-left-color: var(--blue); }
.cd-letter-from {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-soft);
}
.cd-letter-text {
  margin: 8px 0 0; white-space: pre-wrap;
  font-family: "Gowun Batang", var(--font-display), serif;
  font-size: 16px; line-height: 1.7;
}

.cd-log { display: flex; flex-direction: column; gap: var(--s2); width: min(94vw, 720px); text-align: left; }
.cd-log-row { display: flex; gap: var(--s2); padding-bottom: var(--s2); border-bottom: 1px solid var(--line); }
.cd-log-n { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--cd-rose); padding-top: 3px; }
.cd-log-body { flex: 1; min-width: 0; }
.cd-log-q { margin: 0 0 6px; font-weight: 700; font-size: 15px; color: var(--cd-deep); }
.cd-log-a { margin: 0 0 4px; font-size: 15px; line-height: 1.55; color: var(--ink); white-space: pre-wrap; }
.cd-log-a b { color: var(--pink); font-weight: 700; }
.cd-log-a[data-color="blue"] b { color: var(--blue); }
.cd-log-a.is-act { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); }
