/* ── Page ─────────────────────────────────────────────── */
.draw-page {
  padding-top: calc(var(--nav-height) + 3rem);
  padding-bottom: 6rem;
  min-height: 100vh;
}

.draw-page > .container { max-width: 880px; }

/* ── Atmospheric header ───────────────────────────────── */
.draw-header {
  text-align: center;
  margin-bottom: 3.5rem;
  position: relative;
}

.draw-header__symbol {
  font-size: 1.1rem;
  letter-spacing: 0.6em;
  color: var(--gold);
  opacity: 0.7;
  margin-bottom: 1rem;
  display: block;
}

.draw-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--text) 40%, var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.draw-header__sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-style: italic;
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.75;
}

/* ── Step labels ──────────────────────────────────────── */
.step-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.1rem;
}

.step-label span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--purple-dim);
  border: 1px solid rgba(196, 150, 255, 0.3);
  color: var(--purple-light);
  font-size: 0.65rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* ── Setup section ────────────────────────────────────── */
.setup-section { margin-bottom: 2rem; }

/* ── Spread grid ──────────────────────────────────────── */
.spread-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin-bottom: 2.5rem;
}

.spread-tile {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 0.85rem 1rem;
  cursor: pointer;
  transition: all 0.22s;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  user-select: none;
  color: var(--text-dim);
}

.spread-tile:hover {
  border-color: var(--border-2);
  transform: translateY(-3px);
  box-shadow: 0 0 30px rgba(124,58,237,0.35);
  color: var(--purple-light);
}

.spread-tile.selected {
  border-color: var(--violet);
  background: var(--purple-dim);
  box-shadow: 0 0 30px rgba(124,58,237,0.35);
  color: var(--purple-light);
}

.spread-tile__svg {
  width: 100%;
  height: 88px;
  display: block;
  margin-bottom: 0.6rem;
}

.spread-tile__name {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  color: var(--text);
  letter-spacing: 0.04em;
}

.spread-tile__desc {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ── Category pills ───────────────────────────────────── */
.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-bottom: 2.5rem;
}

.cat-pill {
  padding: 0.5rem 1.2rem;
  border-radius: 999px;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cat-pill:hover {
  border-color: rgba(212, 164, 192, 0.5);
  color: var(--gold-light);
}

.cat-pill.selected {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold-light);
}

/* ── Question textarea ────────────────────────────────── */
.question-wrap {
  position: relative;
  margin-bottom: 1.25rem;
}

.question-wrap textarea {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-style: italic;
  line-height: 1.65;
  resize: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  height: 80px;
}

.question-wrap textarea:focus {
  outline: none;
  border-color: rgba(212, 164, 192, 0.5);
  box-shadow: 0 0 0 3px rgba(212, 164, 192, 0.08);
}

.question-wrap textarea::placeholder {
  color: var(--text-dim);
  font-style: italic;
}

.question-wrap__count {
  position: absolute;
  bottom: 0.6rem;
  right: 0.8rem;
  font-family: var(--font-ui);
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* ── Privacy toggle ───────────────────────────────────── */
.privacy-row {
  margin-bottom: 2.5rem;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-muted);
  user-select: none;
}

.toggle-label input[type="checkbox"] { display: none; }

.toggle-track {
  width: 38px;
  height: 20px;
  border-radius: 999px;
  background: var(--border);
  border: 1px solid var(--border);
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.2s, background 0.2s;
}

.toggle-label input:checked ~ .toggle-track {
  background: var(--rose-dim);
  border-color: var(--rose);
}

.toggle-label input:checked ~ .toggle-track .toggle-thumb {
  transform: translateX(18px);
  background: var(--rose-light);
}

/* ── Share callout ────────────────────────────────────── */
.share-callout {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  background: linear-gradient(135deg, rgba(212,164,192,0.1), rgba(157,110,192,0.07));
  border: 1px solid rgba(212,164,192,0.25);
  max-height: 80px;
  overflow: hidden;
  opacity: 1;
  transition: max-height 0.35s ease, opacity 0.3s ease, margin-top 0.3s ease;
}

.share-callout--hidden {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
}

.share-callout--private {
  background: linear-gradient(135deg, rgba(157,110,192,0.08), rgba(46,26,66,0.2));
  border-color: rgba(157,110,192,0.2);
}

.share-callout__icon {
  font-size: 0.9rem;
  color: var(--gold);
  flex-shrink: 0;
  margin-top: 0.05rem;
}

.share-callout--private .share-callout__icon {
  color: var(--text-dim);
}

.share-callout strong {
  color: var(--gold-light);
}

/* ── CTA area ─────────────────────────────────────────── */
.cta-area {
  text-align: center;
  margin-bottom: 2.5rem;
}

.cta-hint {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  font-style: italic;
}

/* ── Draw button ──────────────────────────────────────── */
.btn-draw {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem 2.8rem;
  background: linear-gradient(120deg, var(--violet) 0%, #b15cff 60%, var(--petal) 130%);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(124,58,237,0.45), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: all 0.25s cubic-bezier(.2,.8,.2,1);
  position: relative;
  overflow: hidden;
}

.btn-draw::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
  border-radius: inherit;
}

.btn-draw:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 40px rgba(124,58,237,0.6), inset 0 1px 0 rgba(255,255,255,0.3);
}

.btn-draw:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-draw:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-draw__icon {
  font-size: 0.9rem;
  animation: pulse-star 2.5s ease-in-out infinite;
}

@keyframes pulse-star {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.85); }
}

/* ── Sign-in inline prompt ────────────────────────────── */
.signin-inline {
  margin-bottom: 2rem;
}

.signin-inline__inner {
  background: var(--surface);
  border: 1px solid rgba(212, 164, 192, 0.25);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  text-align: center;
  box-shadow: 0 0 40px rgba(212, 164, 192, 0.06);
}

.signin-inline__symbol {
  font-size: 2.5rem;
  opacity: 0.5;
  margin-bottom: 1rem;
  display: block;
}

.signin-inline__inner h3 {
  margin-bottom: 0.5rem;
  font-size: 1.3rem;
}

.signin-inline__inner p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
  max-width: 340px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}

/* ── Reveal section ───────────────────────────────────── */
.reveal-section {
  margin-top: 1rem;
}

.reveal-header {
  text-align: center;
  margin-bottom: 2rem;
}

.reveal-header__label {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--gold-light);
  letter-spacing: 0.08em;
  opacity: 0.85;
}

/* ── Cards stage — default (single / three card) ─────── */
.cards-stage {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
  margin: 0 auto 1rem;
}

.cards-stage[data-count="1"] { max-width: 160px; }
.cards-stage[data-count="3"] { max-width: 520px; }

/* ── Five-card horseshoe / V arc ─────────────────────── */
.cards-stage[data-spread="five_card"] {
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 12px;
  max-width: 580px;
  padding-top: 80px;   /* room for the arc peak */
  overflow: visible;
}

/* Push outer cards down to create the V/horseshoe shape */
.cards-stage[data-spread="five_card"] .flip-card:nth-child(1) { margin-top: 80px; }
.cards-stage[data-spread="five_card"] .flip-card:nth-child(2) { margin-top: 36px; }
.cards-stage[data-spread="five_card"] .flip-card:nth-child(3) { margin-top: 0;    }
.cards-stage[data-spread="five_card"] .flip-card:nth-child(4) { margin-top: 36px; }
.cards-stage[data-spread="five_card"] .flip-card:nth-child(5) { margin-top: 80px; }

/* ── Celtic Cross grid layout ────────────────────────── */
/* ── Celtic Cross: 80×128 cards — fits 4-row grid on screen ─ */
.cards-stage[data-spread="celtic_cross"] {
  display: grid;
  grid-template-columns: 80px 80px 80px 28px 80px;
  grid-template-rows: repeat(4, calc(80px * 680 / 400));  /* derived from aspect-ratio */
  column-gap: 10px;
  row-gap: 30px;    /* single-line labels need ~22px; 30px gives 8px breathing room */
  max-width: 100%;
  justify-content: center;
  margin-bottom: 3rem;  /* last row's label overflows grid bounds — needs clearance */
}

/* Override flip-card inner size; flex-shrink:0 prevents the label from squishing the inner */
.cards-stage[data-spread="celtic_cross"] .flip-card__inner {
  width: 80px;
  /* height auto-derived from aspect-ratio: 400/680 → 136px */
  flex-shrink: 0;
}

/* ── Grid placement ───────────────────────────────────── */
/* Card 0: present — cross center, BELOW challenge in z-order */
.cards-stage[data-spread="celtic_cross"] .flip-card:nth-child(1) {
  grid-column: 2; grid-row: 2;
  z-index: 1;
}
/* When present is active it must rise ABOVE the challenge card to receive clicks */
.cards-stage[data-spread="celtic_cross"] .flip-card:nth-child(1).flip-card--active {
  z-index: 10;
}
/* Once present is flipped, drop it back so challenge can be on top */
.cards-stage[data-spread="celtic_cross"] .flip-card:nth-child(1).flip-card--flipped {
  z-index: 1;
}

/* Card 1: challenge — overlaps present, landscape, above present by default */
/* align-self: start so the inner starts at the row top, putting its visual center
   at exactly half the row height (same as the present card's center) */
.cards-stage[data-spread="celtic_cross"] .flip-card:nth-child(2) {
  grid-column: 2; grid-row: 2;
  z-index: 3;
  align-self: start;
  justify-self: center;
}
/* While challenge is still locked, let clicks pass through to present below */
.cards-stage[data-spread="celtic_cross"] .flip-card:nth-child(2).flip-card--locked {
  pointer-events: none;
}

/* Card 2: foundation */
.cards-stage[data-spread="celtic_cross"] .flip-card:nth-child(3)  { grid-column: 2; grid-row: 3; }
/* Card 3: recent_past */
.cards-stage[data-spread="celtic_cross"] .flip-card:nth-child(4)  { grid-column: 1; grid-row: 2; }
/* Card 4: higher_self */
.cards-stage[data-spread="celtic_cross"] .flip-card:nth-child(5)  { grid-column: 2; grid-row: 1; }
/* Card 5: near_future */
.cards-stage[data-spread="celtic_cross"] .flip-card:nth-child(6)  { grid-column: 3; grid-row: 2; }
/* Staff col 5: self(row4)→environment(3)→hopes_fears(2)→outcome(1) */
.cards-stage[data-spread="celtic_cross"] .flip-card:nth-child(7)  { grid-column: 5; grid-row: 4; }
.cards-stage[data-spread="celtic_cross"] .flip-card:nth-child(8)  { grid-column: 5; grid-row: 3; }
.cards-stage[data-spread="celtic_cross"] .flip-card:nth-child(9)  { grid-column: 5; grid-row: 2; }
.cards-stage[data-spread="celtic_cross"] .flip-card:nth-child(10) { grid-column: 5; grid-row: 1; }


/* Keep Celtic Cross labels on one line so they never overflow into the next row.
   Slightly smaller font + tighter tracking keeps them readable within the column. */
.cards-stage[data-spread="celtic_cross"] .flip-card__label {
  white-space: nowrap;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  max-width: none;
}

/* ── Challenge card — rotate inner 90° to appear landscape ── */
/* Layout stays 80×128 (fits the grid cell); visual = 128×80 landscape */
.flip-card--challenge .flip-card__inner {
  transform: rotate(90deg);
  transform-origin: center center;
  /* width/height inherited from .cards-stage[data-spread="celtic_cross"] .flip-card__inner */
}

/* After parent rotateZ(90°), rotateX on children = visual left-right flip ✓ */
.flip-card--challenge .flip-card__front {
  transform: rotateX(180deg);   /* hidden: override the default rotateY(180deg) */
}
.flip-card--challenge.flip-card--flipped .flip-card__back  { transform: rotateX(-180deg); }
.flip-card--challenge.flip-card--flipped .flip-card__front { transform: rotateX(0deg);    }

/* Challenge revealed card: same landscape orientation as the face-down back */
/* No counter-rotation — card image appears sideways, as in a real Celtic Cross */
.flip-card--challenge .flip-card__img {
  object-fit: contain;  /* prevent cropping — tarot cards are taller ratio than the container */
}

/* Hover scale applies to outer .flip-card, not the rotated inner — that's fine */
.flip-card--challenge.flip-card--active:hover { transform: scale(1.04); }

/* ── Flip card ────────────────────────────────────────── */
.flip-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  transition: transform 0.15s;
}

/* Locked — waiting for earlier cards to be revealed */
.flip-card--locked .flip-card__inner {
  opacity: 0.28;
  filter: blur(1px);
}
.flip-card--locked .flip-card__label {
  opacity: 0.3;
}

/* Active — ready to be tapped */
.flip-card--active {
  cursor: pointer;
}
.flip-card--active .flip-card__inner {
  opacity: 1;
  filter: none;
}
.flip-card--active .flip-card__back {
  border-color: rgba(157, 92, 255, 0.8) !important;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.35), 0 8px 32px rgba(0,0,0,0.5) !important;
  animation: card-pulse 1.8s ease-in-out infinite;
}
.flip-card--active:hover {
  transform: translateY(-4px) scale(1.04);
}

@keyframes card-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(124,58,237,0.3), 0 8px 32px rgba(0,0,0,0.5); }
  50%       { box-shadow: 0 0 0 4px rgba(124,58,237,0.55), 0 8px 40px rgba(157,92,255,0.30); }
}

/* Lock icon inside back face */
.flip-card__lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: rgba(212, 164, 192, 0.15);
  pointer-events: none;
}

.flip-card__inner {
  width: 100px;
  aspect-ratio: 400 / 680;  /* exact card image dimensions — height always derived from width */
  perspective: 700px;
  position: relative;
}

.flip-card__inner > div {
  position: absolute;
  inset: 0;
  border-radius: 3.5%;  /* proportional to card width, matches actual card corner ~14px at 400px */
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.75s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

/* Back face (face-down) */
.flip-card__back {
  background: linear-gradient(160deg, #3a1a63, #1f0e3c);
  border: 1.5px solid rgba(240, 171, 252, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.05);
  overflow: hidden;
}

/* Front face (face-up) */
.flip-card__front {
  transform: rotateY(180deg);
  overflow: hidden;
  background: #1a0f26;
  border: 1.5px solid rgba(212, 164, 192, 0.25);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Flipped state — front visible */
.flip-card--flipped .flip-card__back  { transform: rotateY(-180deg); }
.flip-card--flipped .flip-card__front { transform: rotateY(0deg); }

/* Card back decorative design */
.card-back-design {
  width: 80%;
  height: 80%;
  border: 1px solid rgba(212, 164, 192, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    45deg,
    rgba(212, 164, 192, 0.03) 0px,
    rgba(212, 164, 192, 0.03) 1px,
    transparent 1px,
    transparent 8px
  );
}

.card-back-design__inner {
  font-size: 1.6rem;
  color: rgba(212, 164, 192, 0.3);
  animation: float-star 3s ease-in-out infinite;
}

@keyframes float-star {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50%       { transform: scale(1.15); opacity: 0.55; }
}

/* Card face image — contain so nothing gets cropped */
.flip-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.flip-card__img--reversed {
  transform: rotate(180deg);
}

/* Reversed badge */
.flip-card__rev {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(212, 112, 140, 0.85);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
}

/* Position label under each card */
.flip-card__label {
  font-family: var(--font-ui);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  text-align: center;
  max-width: 110px;
}

/* ── Get reading area ─────────────────────────────────── */
.get-reading-area {
  text-align: center;
  margin-top: 0.5rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, rgba(212, 164, 192, 0.04), rgba(157, 110, 192, 0.04));
  border: 1px solid rgba(212, 164, 192, 0.15);
  border-radius: var(--radius-xl);
}

.get-reading-hint {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.btn-reading {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.95rem 2.5rem;
  background: linear-gradient(120deg, var(--violet) 0%, #b15cff 60%, var(--petal) 130%);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: var(--font-heading);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(124,58,237,0.45), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: all 0.25s cubic-bezier(.2,.8,.2,1);
}

.btn-reading:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 40px rgba(124,58,237,0.6);
}

.btn-reading:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.reading-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 700px) {
  .spread-grid { grid-template-columns: repeat(2, 1fr); }
  .draw-header__sub { font-size: 0.95rem; }
}

@media (max-width: 420px) {
  .flip-card__inner { width: 80px; }
  .cards-stage { gap: 0.75rem; }
}

/* ── Five-card arc on narrow screens ─────────────────── */
/* 5 × 58px + 4 × 7px gaps = 318px — fits a 390px iPhone with padding */
@media (max-width: 520px) {
  .cards-stage[data-spread="five_card"] {
    gap: 7px;
    max-width: 100%;
    padding-top: 52px;
  }
  /* Higher specificity than the global .flip-card__inner rule — wins on all screens ≤520px */
  .cards-stage[data-spread="five_card"] .flip-card__inner {
    width: 58px;
    /* height auto-derived from aspect-ratio: 400/680 → ~98px */
  }
  /* Scale the arc margins proportionally (originally 0 / 36 / 80 → 0 / 23 / 52) */
  .cards-stage[data-spread="five_card"] .flip-card:nth-child(1) { margin-top: 52px; }
  .cards-stage[data-spread="five_card"] .flip-card:nth-child(2) { margin-top: 23px; }
  .cards-stage[data-spread="five_card"] .flip-card:nth-child(3) { margin-top: 0;    }
  .cards-stage[data-spread="five_card"] .flip-card:nth-child(4) { margin-top: 23px; }
  .cards-stage[data-spread="five_card"] .flip-card:nth-child(5) { margin-top: 52px; }
  /* Badge "REVERSED" at default size (~68px) overflows the 58px card. Shrink to fit. */
  .cards-stage[data-spread="five_card"] .flip-card__rev {
    font-size: 0.48rem;
    letter-spacing: 0;
    padding: 0.08rem 0.28rem;
  }
  /* Keep all labels on one line so every flip-card has the same intrinsic width (58px).
     "FOUNDATION" at default size wraps and makes that card wider than the rest. */
  .cards-stage[data-spread="five_card"] .flip-card__label {
    white-space: nowrap;
    font-size: 0.55rem;
    letter-spacing: 0.04em;
    max-width: none;
  }
}

/* ── Celtic Cross on narrow screens ──────────────────── */
@media (max-width: 520px) {
  .cards-stage[data-spread="celtic_cross"] {
    grid-template-columns: 72px 72px 72px 20px 72px;
    grid-template-rows: repeat(4, calc(72px * 680 / 400));  /* derived from aspect-ratio */
    column-gap: 8px;
    row-gap: 34px;
    margin-bottom: 3rem;
  }
  .cards-stage[data-spread="celtic_cross"] .flip-card__inner {
    width: 72px;
    /* height auto-derived from aspect-ratio: 400/680 → ~122px */
    flex-shrink: 0;
  }
  .flip-card--challenge .flip-card__inner {
    width: 72px;
    /* height auto-derived from aspect-ratio */
    transform: rotate(90deg);
  }
  /* Compact REVERSED badge so it fits inside the 72px-wide card */
  .cards-stage[data-spread="celtic_cross"] .flip-card__rev {
    font-size: 0.55rem;
    letter-spacing: 0.04em;
    padding: 0.1rem 0.3rem;
  }
}

/* ── Exchange mode banner ─────────────────────────────── */
.exchange-banner {
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(212,112,140,0.1), rgba(157,110,192,0.08));
  border: 1px solid rgba(212,112,140,0.3);
}
.exchange-banner__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.exchange-banner__label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--rose-light);
}
.exchange-banner__cancel {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}
.exchange-banner__cancel:hover { color: var(--text-muted); }
.exchange-banner__for {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 0.35rem;
  font-style: italic;
}
.exchange-banner__note {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
}

/* ── Pending exchanges section ────────────────────────── */
.pending-exchanges {
  margin-bottom: 2.5rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  background: rgba(212,164,192,0.05);
  border: 1px solid rgba(212,164,192,0.15);
}
.pending-exchanges__label {
  font-family: var(--font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.35rem;
}
.pending-exchanges__sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
  margin-bottom: 1rem;
}
.pending-exchanges__list {
  display: flex;
  flex-direction: row;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  /* hide scrollbar on webkit while keeping scroll functional */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.pending-exchanges__list::-webkit-scrollbar { height: 4px; }
.pending-exchanges__list::-webkit-scrollbar-track { background: transparent; }
.pending-exchanges__list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.pending-exchange-item {
  display: block;
  flex-shrink: 0;           /* don't compress — scroll instead */
  width: 220px;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
}
.pending-exchange-item:hover {
  border-color: var(--rose);
  background: var(--rose-dim);
}
.pending-exchange-item__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.3rem;
}
.pending-exchange-item__for {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold-light);
}
.pending-exchange-item__cat {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--text-muted);
}
.pending-exchange-item__q {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
