/* ------------------------------------------------------------------
   Voima Tarot — web POC styles
   Palette: weathered parchment, birch bone, deep burgundy, moss ink.
   No mystical clichés (no purple/neon/runes-as-decor). Quiet & timeless.
------------------------------------------------------------------ */

:root {
  --bg:           #1a1714;
  --bg-warm:      #221d18;
  --paper:        #ece2cf;
  --paper-soft:   #d8ccb2;
  --ink:          #2a221c;
  --ink-soft:     #4a3f33;
  --bone:         #e8dcc4;
  --burgundy:     #6b1f2a;
  --moss:         #3d4a32;
  --gold:         #b08a4a;
  --gold-soft:    #8a6c3a;
  --line:         rgba(232, 220, 196, 0.18);
  --shadow:       0 30px 80px rgba(0, 0, 0, 0.55);
  --serif:        "Cormorant Garamond", "EB Garamond", Georgia, serif;
  /* Body text — every sentence the visitor reads. Cormorant is a display
     face, too thin for running text on the dark background, so it is kept
     for the big words only (title, headings, category names). */
  --read:         "Alegreya", Georgia, serif;
  --sans:         "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--serif);
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(1100px 700px at 20% 0%, rgba(176, 138, 74, 0.10), transparent 60%),
    radial-gradient(900px 600px at 90% 100%, rgba(107, 31, 42, 0.12), transparent 60%),
    var(--bg);
}

button { font-family: inherit; }

/* Start-screen body text in the reading face (see --read). */
.btn,
.scene-head p,
.subtitle,
.footnote,
.category-tile .question,
.contemplate-hint {
  font-family: var(--read);
}

/* ------------------------------------------------------------------
   Stage / scenes
------------------------------------------------------------------ */

#stage {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(24px, 4vw, 56px);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.scene {
  width: 100%;
  /* Auto margins center the active scene when it fits, but collapse to 0
     when it's taller than the viewport — so a long reading starts at the
     top and scrolls fully into view instead of being clipped. (Unlike
     justify-content: center, this never pushes content out of reach.) */
  margin-block: auto;
  animation: scene-in 700ms ease both;
}

@keyframes scene-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.scene-head {
  text-align: center;
  margin-bottom: clamp(24px, 4vw, 48px);
}
.scene-head h2 {
  font-weight: 500;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: 0.01em;
  margin: 0 0 6px;
}
.scene-head p {
  margin: 0;
  color: var(--paper-soft);
  font-style: italic;
  font-size: 1.05rem;
}

/* ------------------------------------------------------------------
   Buttons
------------------------------------------------------------------ */

.btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--gold-soft);
  color: var(--paper);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 14px 28px;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease, transform 200ms ease;
  border-radius: 2px;
}
.btn:hover { background: rgba(176, 138, 74, 0.10); border-color: var(--gold); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.btn--primary {
  background: var(--burgundy);
  border-color: var(--burgundy);
  color: var(--bone);
}
.btn--primary:hover {
  background: #7d2531;
  border-color: #7d2531;
}

/* ------------------------------------------------------------------
   Title scene
------------------------------------------------------------------ */

.scene--title {
  text-align: center;
}
.title-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.title-glyph {
  font-size: 56px;
  color: var(--gold);
  opacity: 0.9;
  font-family: serif;
}
.title {
  font-size: clamp(60px, 9vw, 110px);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin: 0;
  line-height: 1;
}
.subtitle {
  font-style: italic;
  color: var(--paper-soft);
  margin: 0 0 16px;
  font-size: 1.2rem;
}
.footnote {
  margin-top: 16px;
  color: var(--paper-soft);
  font-style: italic;
  opacity: 0.7;
  font-size: 0.95rem;
}

/* v5.0 — one quiet sentence of real text on the landing page, so search
   engines (and first-time visitors) learn what Voima is. */
.about {
  max-width: 34rem;
  margin: 8px auto 0;
  font-family: var(--read);
  color: var(--paper-soft);
  opacity: 0.55;
  font-size: 0.9rem;
  line-height: 1.6;
  text-align: center;
}

/* v5.2 — status line under the share / restart buttons */
.share-status {
  margin: 14px auto 0;
  text-align: center;
  font-family: var(--read);
  font-style: italic;
  color: var(--paper-soft);
  opacity: 0.8;
  font-size: 0.95rem;
}

/* v5.0 — FI · EN language switch, fixed top-right, deliberately faint. */
.lang-switch {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 20;
  display: flex;
  gap: 8px;
  align-items: center;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--paper-soft);
  opacity: 0.6;
}
.lang-switch a {
  color: inherit;
  text-decoration: none;
  padding: 4px 2px;
  border-bottom: 1px solid transparent;
}
.lang-switch a:hover,
.lang-switch a:focus-visible { opacity: 1; color: var(--bone); }
.lang-switch a.is-active {
  color: var(--gold);
  border-bottom-color: var(--gold-soft);
}

/* ------------------------------------------------------------------
   Category grid
------------------------------------------------------------------ */

.category-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.category-tile {
  position: relative;
  background: linear-gradient(180deg, rgba(232, 220, 196, 0.04), rgba(232, 220, 196, 0.01));
  border: 1px solid var(--line);
  padding: 24px 22px 22px;
  cursor: pointer;
  transition: border-color 250ms ease, transform 250ms ease, background 250ms ease;
  text-align: left;
  font-family: inherit;
  color: inherit;
  width: 100%;
  appearance: none;
  border-radius: 2px;
}
.category-tile:hover {
  border-color: var(--gold);
  background: linear-gradient(180deg, rgba(176, 138, 74, 0.06), rgba(232, 220, 196, 0.01));
  transform: translateY(-2px);
}

.category-tile .num {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
}
.category-tile .name {
  font-size: 1.7rem;
  margin: 4px 0 10px;
  font-weight: 500;
}
.category-tile .question {
  font-style: italic;
  color: var(--paper-soft);
  margin: 0;
  line-height: 1.5;
  font-size: 1.05rem;
}
.category-tile .structure {
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--paper-soft);
  opacity: 0.7;
  text-transform: uppercase;
}

/* ------------------------------------------------------------------
   Contemplation scene
------------------------------------------------------------------ */

.scene--contemplate { text-align: center; }
.contemplate-frame {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px;
}
.contemplate-eyebrow {
  font-family: var(--sans);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--gold);
  margin: 0 0 16px;
}
.contemplate-question {
  font-size: clamp(28px, 4vw, 44px);
  font-style: italic;
  line-height: 1.3;
  margin: 0 0 40px;
  color: var(--bone);
}
.contemplate-hint {
  color: var(--paper-soft);
  font-style: italic;
  margin: 0 0 32px;
}

/* ------------------------------------------------------------------
   Wheel
------------------------------------------------------------------ */

.wheel-stage {
  position: relative;
  width: min(420px, 80vw);
  aspect-ratio: 1 / 1;
  margin: 0 auto 36px;
}

.wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 22px solid var(--gold);
  z-index: 3;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #2c241b 0%, #1d1812 65%, #15110d 100%);
  border: 2px solid var(--gold-soft);
  box-shadow:
    var(--shadow),
    inset 0 0 40px rgba(0, 0, 0, 0.6),
    inset 0 0 0 8px rgba(176, 138, 74, 0.08);
  transition: transform 4500ms cubic-bezier(0.18, 0.8, 0.18, 1);
  will-change: transform;
}

.wheel::before {
  content: "";
  position: absolute;
  inset: 24px;
  border-radius: 50%;
  border: 1px solid rgba(176, 138, 74, 0.25);
}

.wheel-tick {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: 0 0;
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--paper-soft);
  pointer-events: none;
}
.wheel-tick span {
  display: block;
  transform: translate(-50%, -50%);
}

.wheel-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 36%;
  aspect-ratio: 1/1;
  border-radius: 50%;
  background: radial-gradient(circle, #2a221b 0%, #1a140e 100%);
  border: 1px solid var(--gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.7);
}
.wheel-token {
  font-size: clamp(38px, 7vw, 60px);
  color: var(--gold);
  font-family: var(--serif);
  letter-spacing: 0;
}

.wheel-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------------
   Reading scene
------------------------------------------------------------------ */

.scene--reading {
  text-align: center;
}

.opening, .closing {
  font-family: var(--read);
  font-size: clamp(19px, 2vw, 23px);
  font-style: italic;
  color: var(--bone);
  max-width: 720px;
  margin: 0 auto 36px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1000ms ease, transform 1000ms ease;
}
.opening.is-visible, .closing.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.closing { margin: 28px auto 24px; }

/* Woven synthesis — the prediction tying the three cards together. */
.synthesis {
  font-family: var(--read);
  font-size: clamp(18px, 1.95vw, 21px);
  color: var(--paper);
  max-width: 760px;
  margin: 44px auto 0;
  padding: 28px 28px 4px;
  line-height: 1.75;
  /* The reading is sung as runo lines + a guidance line ("So:" / "Joten"); keep its breaks. */
  white-space: pre-line;
  border-top: 1px solid var(--line);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 1600ms ease, transform 1600ms ease;
}
.synthesis::before {
  /* Label text is translated: i18n.js sets data-label ("Tulkinta" / "The reading"). */
  content: attr(data-label);
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}
.synthesis.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cards-row {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: clamp(16px, 3vw, 40px);
  flex-wrap: wrap;
  margin: 0 auto;
}

/* ----- 3D card (mirrors UE 3D-box-with-texture concept) ----- */

.card {
  width: clamp(180px, 22vw, 260px);
  perspective: 1400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.card.is-staged {
  opacity: 1;
  transform: translateY(0);
}

.card-label {
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
  min-height: 1em;
}

.card-flip {
  position: relative;
  width: 100%;
  aspect-ratio: 5 / 8;
  transform-style: preserve-3d;
  transition: transform 1300ms cubic-bezier(0.6, 0.04, 0.2, 1);
}
.card.is-revealed .card-flip {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.card-back {
  background:
    repeating-linear-gradient(45deg, rgba(176, 138, 74, 0.10) 0 2px, transparent 2px 14px),
    radial-gradient(circle at 50% 50%, #3a2a1c 0%, #1d1410 100%);
  border: 1px solid var(--gold-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-back::after {
  content: "ᚹ";
  font-size: 56px;
  color: var(--gold);
  opacity: 0.85;
}

.card-front {
  transform: rotateY(180deg);
  background: var(--paper);
  border: 1px solid var(--gold-soft);
  display: flex;
  flex-direction: column;
}
.card-front .card-art {
  /* Fills the whole face so the still matches the video exactly (the card
     name lives in the artwork itself, so no separate title strip). */
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  background: var(--paper-soft);
}

/* Video face — plays over the card art on click (UE: video on a box face) */
.card-front .card-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease;
  z-index: 2;
}
.card.is-playing .card-front .card-video {
  opacity: 1;
}

/* Small play hint shown on a revealed card that isn't currently playing */
.card-play-hint {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(26, 20, 16, 0.72);
  border: 1px solid var(--gold-soft);
  color: var(--gold);
  font-size: 13px;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}
/* Diagnostic badge — only appears if the video errors or play is blocked */
.card-diag {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  z-index: 4;
  padding: 5px 7px;
  border-radius: 3px;
  background: rgba(107, 31, 42, 0.92);
  color: #f4e9d6;
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease;
}
.card-diag.is-visible { opacity: 1; }

.card.is-revealed .card-front { cursor: pointer; }
.card.is-revealed .card-play-hint { opacity: 0.85; }
.card.is-playing  .card-play-hint { opacity: 0; }

/* "Video face" aura — mirrors the UE plan to play video on one side */
.card.is-revealed .card-flip::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 8px;
  background: radial-gradient(circle, rgba(176,138,74,0.35), transparent 70%);
  z-index: -1;
  animation: aura 4s ease-in-out infinite;
}
@keyframes aura {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 0.7; transform: scale(1.05); }
}

.card-fragment {
  margin-top: 18px;
  font-family: var(--read);
  color: var(--paper);
  font-size: 1.1rem;
  line-height: 1.55;
  min-height: 4em;
  text-align: center;
}
.card-fragment .char {
  opacity: 0;
  display: inline;
  transition: opacity 350ms ease;
}
.card-fragment .char.is-visible {
  opacity: 1;
}

/* Reading-status: "the threads unfold" cue shown through the intro wait
   (before the first card reveals), so the app never looks stuck. */
.reading-status {
  text-align: center;
  margin: 0 auto 30px;
  opacity: 0;
  transition: opacity 700ms ease;
}
.reading-status.is-visible { opacity: 1; }
.reading-status .runes {
  display: block;
  font-family: var(--serif);
  font-size: clamp(20px, 3vw, 30px);
  letter-spacing: 0.18em;
  color: var(--gold);
  word-break: break-all;
  animation: decipher-pulse 1.3s ease-in-out infinite;
}
.reading-status .caption {
  display: block;
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--paper-soft);
  opacity: 0.8;
}

/* "Deciphering" shimmer shown while a fragment's text is still loading. */
.card-fragment.is-deciphering {
  color: var(--gold-soft);
  letter-spacing: 0.14em;
  font-style: normal;
  word-break: break-all;
  animation: decipher-pulse 1.3s ease-in-out infinite;
}
@keyframes decipher-pulse {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 0.75; }
}

.reading-actions {
  margin-top: 40px;
  display: flex;               /* v5.2: share + restart side by side */
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  opacity: 0;
  transition: opacity 800ms ease;
}
.reading-actions.is-visible { opacity: 1; }

/* ------------------------------------------------------------------
   Responsive
------------------------------------------------------------------ */

@media (max-width: 600px) {
  /* Scale all rem-based text up for readability on phones. */
  html { font-size: 19px; }

  .cards-row { flex-direction: column; align-items: center; }
  .card { width: min(82vw, 300px); }

  /* Narrative + reading text (uses px/clamp, so root scaling doesn't reach it).
     The italic body copy is bumped a little more — it was the hardest to read. */
  .scene-head p            { font-size: 1.2rem; }
  .subtitle                { font-size: 1.35rem; }
  .footnote                { font-size: 1.05rem; }
  .contemplate-hint        { font-size: 1.2rem; }
  .category-tile .question { font-size: 1.2rem; line-height: 1.55; }
  .opening, .closing       { font-size: 22px; line-height: 1.55; }
  .synthesis               { font-size: 20px; line-height: 1.75; padding: 24px 18px 4px; }
  .card-fragment           { font-size: 1.2rem; line-height: 1.6; }
}

/* ------------------------------------------------------------------
   v5.3 — Tietäjän kirja / The seer's book (analytical reading)
   An old book opened in a full-screen dialog: parchment pages, ink
   text, a spine shadow on the left, rune page markers at the bottom.
------------------------------------------------------------------ */

.btn--book {
  border-color: var(--gold-soft);
  color: var(--gold);
}
.btn--book::before { content: "ᚹ  "; opacity: 0.8; }

.book {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: hidden;
}
.book[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}
.book::backdrop {
  background: rgba(12, 10, 8, 0.82);
  backdrop-filter: blur(3px);
}
.book[open] .book-binding { animation: book-open 700ms cubic-bezier(.2,.7,.2,1); }
@keyframes book-open {
  from { opacity: 0; transform: perspective(1400px) rotateX(8deg) translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.book-binding {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(760px, 94vw);
  height: min(900px, 92vh);
  /* parchment: warm base, darker toward the edges, a hint of fibre */
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255, 250, 238, 0.55), rgba(255, 250, 238, 0) 70%),
    repeating-linear-gradient(0deg, rgba(90, 70, 40, 0.025) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #efe5d1, #e2d4b8);
  border-radius: 4px 10px 10px 4px;
  box-shadow:
    inset 26px 0 30px -18px rgba(60, 40, 20, 0.55),   /* spine */
    inset 0 0 70px rgba(120, 90, 50, 0.28),           /* aged edges */
    0 40px 90px rgba(0, 0, 0, 0.6);
  outline: 1px solid rgba(138, 108, 58, 0.5);
  outline-offset: -12px;
}

.book-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 28px 6px 40px;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.book-glyph { font-size: 1.1rem; letter-spacing: 0; }
.book-title { flex: 1; }
.book-close {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 6px 8px;
  line-height: 1;
}
.book-close:hover, .book-close:focus-visible { color: var(--burgundy); }

.book-page {
  flex: 1;
  overflow-y: auto;
  padding: 10px 56px 24px 64px;
  transform-origin: left center;
  scrollbar-width: thin;
  scrollbar-color: rgba(138, 108, 58, 0.5) transparent;
}
.book-page.turn-next { animation: page-next 520ms ease; }
.book-page.turn-prev { animation: page-prev 520ms ease; }
@keyframes page-next {
  0%   { opacity: 0; transform: perspective(1600px) rotateY(-14deg) translateX(18px); filter: blur(1px); }
  100% { opacity: 1; transform: none; filter: none; }
}
@keyframes page-prev {
  0%   { opacity: 0; transform: perspective(1600px) rotateY(10deg) translateX(-18px); filter: blur(1px); }
  100% { opacity: 1; transform: none; filter: none; }
}

.book-eyebrow {
  margin: 14px 0 4px;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.book-heading {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.15;
  color: var(--ink);
}
.book-subheading {
  margin: 22px 0 6px;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--burgundy);
}
.book-text {
  margin: 0 0 12px;
  font-family: var(--read);
  font-size: 1.08rem;
  line-height: 1.7;
  color: var(--ink);
}
.book-lead { font-size: 1.18rem; }
/* drop cap on the first paragraph of each page */
.book-lead::first-letter {
  float: left;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 3.3em;
  line-height: 0.85;
  padding: 4px 8px 0 0;
  color: var(--burgundy);
}
.book-center { text-align: center; }
.book-hint, .book-note, .book-counter {
  font-family: var(--read);
  font-style: italic;
  font-size: 0.9rem;
  color: var(--ink-soft);
  opacity: 0.8;
}
.book-hint { margin-top: 24px; }
.book-note { margin-top: 18px; }
.book-counter { margin: 0; }
.book-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 18px;
}
.book-enter-hint {
  font-family: var(--read);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--ink-soft);
  opacity: 0.7;
}
@media (pointer: coarse) { .book-enter-hint { visibility: hidden; } }

.book-quote {
  margin: 0 0 20px;
  padding: 10px 0 10px 18px;
  border-left: 3px solid var(--gold);
  font-family: var(--read);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-soft);
}
.book-quote--plain { border-left-color: rgba(138, 108, 58, 0.4); }

/* ask page */
.book-label {
  display: block;
  margin: 22px 0 8px;
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.book-question {
  width: 100%;
  resize: vertical;
  min-height: 90px;
  padding: 12px 14px;
  font-family: var(--read);
  font-size: 1.08rem;
  line-height: 1.5;
  color: var(--ink);
  background: rgba(255, 252, 244, 0.6);
  border: 1px solid rgba(138, 108, 58, 0.55);
  border-radius: 3px;
}
.book-question:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.book .btn { color: var(--ink); border-color: var(--ink-soft); }
.book .btn--primary { color: var(--paper); background: var(--burgundy); border-color: var(--burgundy); }
.book-again { margin-top: 26px; }
.book-link {
  display: inline-block;
  margin: 6px 0 0;
  padding: 4px 0;
  border: 0;
  border-bottom: 1px solid var(--gold);
  background: transparent;
  font-family: var(--read);
  font-style: italic;
  font-size: 1.02rem;
  color: var(--burgundy);
  cursor: pointer;
}
.book-link:hover, .book-link:focus-visible { color: var(--ink); border-bottom-color: var(--burgundy); }

/* loading */
.book-page.is-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.book-decipher {
  font-size: 1.8rem;
  letter-spacing: 0.25em;
  color: var(--gold-soft);
  margin: 0 0 14px;
  animation: decipher-breathe 2.4s ease-in-out infinite;
}
@keyframes decipher-breathe { 50% { opacity: 0.45; } }

/* card page */
.book-card-head {
  display: flex;
  gap: 22px;
  align-items: flex-end;
  margin-bottom: 18px;
}
.book-card-art {
  width: 120px;
  height: auto;
  border: 1px solid var(--gold-soft);
  box-shadow: 0 10px 24px rgba(60, 40, 20, 0.35);
  transform: rotate(-2deg);
}
.book-card-titles .book-heading { margin-bottom: 4px; }
.book-archetype {
  margin: 0;
  font-family: var(--read);
  font-style: italic;
  color: var(--ink-soft);
}
.book-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 10px;
}
.book-duo-item {
  padding: 4px 14px 2px;
  border-left: 2px solid var(--gold);
}
.book-duo-item--shadow { border-left-color: var(--ink-soft); }
.book-duo-item .book-subheading { margin-top: 6px; }

/* interplay strip */
.book-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 22px;
}
.book-strip-card { margin: 0; text-align: center; }
.book-strip-card img {
  width: 84px;
  border: 1px solid var(--gold-soft);
  box-shadow: 0 6px 14px rgba(60, 40, 20, 0.3);
}
.book-strip-card figcaption {
  margin-top: 6px;
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-soft);
}
.book-strip-arrow { color: var(--gold-soft); font-size: 1.4rem; }

/* what next */
.book-list {
  margin: 0 0 8px;
  padding-left: 1.4em;
  font-family: var(--read);
  font-size: 1.08rem;
  line-height: 1.65;
}
.book-list li { margin-bottom: 8px; }
.book-list li::marker { color: var(--burgundy); font-family: var(--serif); font-weight: 600; }
.book-list--questions { list-style: "ᛃ  "; }

/* navigation */
.book-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 28px 22px 40px;
}
.book-nav[hidden] { display: none; }
.book-turn {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(138, 108, 58, 0.6);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.book-turn:disabled { opacity: 0.25; cursor: default; }
.book-turn:not(:disabled):hover { background: rgba(138, 108, 58, 0.15); }
.book-runes { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.book-rune {
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  opacity: 0.45;
  font-size: 1.05rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.book-rune.is-current { opacity: 1; color: var(--burgundy); border-bottom-color: var(--gold); }

@media (max-width: 600px) {
  .book-binding { width: 100vw; height: 100dvh; border-radius: 0; outline-offset: -8px; }
  .book-top { padding: 16px 16px 4px 24px; }
  .book-page { padding: 6px 22px 18px 28px; }
  .book-nav { padding: 8px 14px 16px 20px; }
  .book-card-art { width: 92px; }
  .book-duo { grid-template-columns: 1fr; gap: 6px; }
  .book-strip-card img { width: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .book[open] .book-binding,
  .book-page.turn-next,
  .book-page.turn-prev,
  .book-decipher { animation: none; }
}


/* ------------------------------------------------------------------
   v5.5 — reversed cards + the .lol easter egg
------------------------------------------------------------------ */

/* A reversed card (v5.5.1) turns black and white with harder contrast —
   the same art, drained of its colour — instead of being shown upside down. */
.card.is-reversed .card-art,
.card.is-reversed .card-video,
.book-card-art.is-reversed,
.book-strip-card img.is-reversed {
  filter: grayscale(1) contrast(1.4) brightness(0.95);
}
.card.is-reversed .card-label { color: var(--burgundy); }
.book-reversed-note {
  margin: -6px 0 14px;
  font-family: var(--read);
  font-style: italic;
  color: var(--burgundy);
}

/* The title rune is a (quiet) button now. */
button.title-glyph {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0 8px;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  transition: transform 400ms ease, text-shadow 400ms ease;
}
button.title-glyph:hover,
button.title-glyph:focus-visible { text-shadow: 0 0 18px rgba(176, 138, 74, 0.6); }
button.title-glyph[aria-expanded="true"] { transform: rotate(-8deg); }

.egg {
  max-width: 30rem;
  margin: 4px auto 0;
  padding: 14px 18px;
  border: 1px solid var(--line);
  text-align: center;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 600ms ease, transform 600ms ease;
}
.egg.is-visible { opacity: 1; transform: none; }
.egg-title {
  margin: 0 0 4px;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
}
.egg-figure {
  margin: 0;
  font-family: var(--serif);
  font-size: 2.6rem;
  letter-spacing: 0.08em;
  color: var(--bone);
  line-height: 1.1;
}
.egg-figure span { color: var(--gold); }
.egg-text {
  margin: 6px 0 0;
  font-family: var(--read);
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--paper-soft);
}
