
:root {
  --parchment: #ffffff;
  --parchment-dark: #f5f5f5;
  --parchment-deep: #e0e0e0;
  --ink: #1e0e04;
  --brown-deep: #2c1508;
  --brown-mid: #2a2a2a;
  --brown-light: #9b6b3f;
  --gold: #c8963e;
  --gold-light: #e8b96a;
  --gold-pale: #fdf6e8;
  --burgundy: #7a1e2e;
  --burgundy-light: #a83040;
  --sage: #4a6741;
  --sage-bg: #f0f5ef;
  --miss-bg: #fdf0f0;
  --shadow: rgba(44,21,8,0.1);
}

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

body {
  background: #faf8f5;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(200,150,62,0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(122,30,46,0.03) 0%, transparent 50%);
  min-height: 100vh;
  font-family: 'Merriweather', Georgia, serif;
  color: #1a1a1a;
}

/* ─── SCREENS ──────────────────────────────────────────────── */
.screen { display:none; min-height:100vh; }
.screen.active { display:flex; flex-direction:column; }

/* ─── TOP BAR ──────────────────────────────────────────────── */
.top-bar {
  background: #ffffff;
  border-bottom: 1px solid #e8e0d0;
  padding: 8px 28px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
.top-bar-row1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 28px;
  text-align: left;
}
.top-bar-row2 {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.top-bar-title {
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--brown-mid);
  text-transform: uppercase;
  white-space: nowrap;
  min-width: 120px;
  cursor: pointer;
  transition: color 0.2s;
}
.top-bar-title:hover { color: var(--burgundy); }
.top-bar-greeting {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.78rem; color: var(--brown-mid);
  display: none;
  align-items: center; gap: 8px;
  white-space: nowrap; margin-left: auto;
}
.top-bar-signout {
  font-family: 'Cinzel', serif; font-size: 0.6rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--burgundy); cursor: pointer;
  border-left: 1px solid #ddd; padding-left: 10px;
  transition: opacity 0.2s;
}
.top-bar-signout:hover { opacity: 0.7; }
.welcome-top-bar {
  background: #2c1508;
  border-bottom: 1px solid rgba(200,150,62,0.2);
  width: 100%;
  align-self: stretch;
  flex-shrink: 0;
}
.welcome-top-bar-title {
  color: var(--gold) !important;
  letter-spacing: 0.28em;
  cursor: default;
}
.welcome-top-bar-links {
  display: flex;
  gap: 20px;
  align-items: center;
  margin: 0 auto;
}
.welcome-top-bar-link {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(200,150,62,0.55);
  text-decoration: none;
  transition: color 0.2s;
}
.welcome-top-bar-link:hover { color: var(--gold); }
.welcome-top-bar .top-bar-greeting {
  color: var(--cream-dim, #faf4ec);
}
.welcome-top-bar .top-bar-signout {
  color: var(--gold-light);
  border-left-color: rgba(200,150,62,0.3);
}
.progress-track {
  flex: 1;
  height: 4px;
  background: var(--parchment-deep);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--burgundy), var(--gold));
  border-radius: 3px;
  transition: width 0.6s ease;
}
.progress-dots { display: flex; gap: 5px; align-items: center; }
.p-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--parchment-deep);
  border: 1px solid #d0c8b8;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}
.p-dot.done { background: var(--gold); border-color: var(--gold); }
.p-dot.current { background: var(--burgundy); border-color: var(--burgundy-light); }
.p-dot.locked { cursor: not-allowed; }
.p-dot-tooltip {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brown-deep);
  color: #fff;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.p-dot:hover .p-dot-tooltip { opacity: 1; }

/* ─── BUTTONS ──────────────────────────────────────────────── */
.btn-primary {
  display: inline-block;
  background: var(--burgundy);
  color: #fff;
  font-family: 'Cinzel', serif;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  padding: 13px 32px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.22s;
  text-transform: uppercase;
}
.btn-primary:hover { background: var(--burgundy-light); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: transparent;
  color: var(--brown-mid);
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  padding: 11px 22px;
  border: 1px solid var(--parchment-deep);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
}
.btn-secondary:hover { border-color: var(--gold); color: var(--brown-deep); }

.btn-row { display: flex; gap: 12px; align-items: center; }

/* ─── WELCOME SCREEN ───────────────────────────────────────── */
#welcome {
  align-items: center;
  justify-content: flex-start;
  flex-direction: column;
  padding: 0 0 20px 0;
  background: #2c1508;
  min-height: 100vh;
}
/* wider inner so lesson tiles can breathe */
.welcome-inner { max-width: 960px; width: 100%; text-align: center; margin-top: 20px; padding: 0 20px; }
.tome-cover {
  background: #ffffff;
  border: 2px solid var(--parchment-deep);
  border-radius: 10px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.28);
  padding: 32px 40px 36px;
  position: relative;
  text-align: center;
}
.tome-cover::before {
  content: '';
  position: absolute;
  left: 10px; top: 10px; right: 10px; bottom: 10px;
  border: 1px solid rgba(200,150,62,0.18);
  border-radius: 6px;
  pointer-events: none;
}
/* Header: title left, greeting right */
.welcome-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  text-align: left;
}
.welcome-header-left {
  display: flex; flex-direction: column; gap: 2px;
}
.welcome-title {
  font-family: 'Cinzel', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--brown-deep);
  letter-spacing: 0.06em;
  line-height: 1.2;
}
.welcome-subtitle {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  color: var(--brown-light);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
/* Actions */
.welcome-actions {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.welcome-secondary-btns {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
}

/* Footer links (About / Privacy) */
.welcome-footer {
  margin-top: 16px;
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.welcome-footer-link {
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  text-decoration: none;
  transition: color 0.2s;
}
.welcome-footer-link:hover { color: var(--gold); }
.welcome-footer-sep {
  color: rgba(255,255,255,0.15);
  font-size: 0.6rem;
}

.welcome-intro {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.82rem;
  color: #555; line-height: 1.65; text-align: center;
  margin: 6px 0 10px; font-style: italic;
}
.welcome-ref-row {
  display: flex; gap: 10px; justify-content: center;
  flex-wrap: wrap; margin-bottom: 4px;
}
.divider {
  display: flex; align-items: center; gap: 12px; margin: 8px 0;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}
.divider span { color: var(--gold); font-size: 0.85rem; }
.welcome-text {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.92rem; line-height: 1.75; color: #1a1a1a;
  margin-bottom: 14px; text-align: left;
}
.lesson-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 8px; margin: 6px 0 8px;
}
.lesson-tile {
  background: var(--gold-pale);
  border: 1px solid #e0d0b0;
  border-radius: 6px; padding: 12px 8px;
  cursor: pointer; transition: all 0.2s;
  position: relative; text-align: center;
}
.lesson-tile:hover:not(.locked-tile) { transform: translateY(-2px); border-color: var(--gold); }
.lesson-tile.done-tile { border-color: var(--sage); background: var(--sage-bg); }
.lesson-tile.done-tile::after {
  content: '✓'; position: absolute; top: 4px; right: 6px;
  color: var(--sage); font-size: 0.72rem; font-weight: bold;
}
.lesson-tile.locked-tile { opacity: 0.4; cursor: not-allowed; }
.lesson-tile.current-tile { border-color: var(--burgundy); background: var(--miss-bg); }
.tile-day { font-family: 'Cinzel', serif; font-size: 0.9rem; color: #2c1508; font-weight: 600; display: block; }
.tile-label { font-family: 'Merriweather', Georgia, serif; font-size: 0.64rem; color: #1a1a1a; display: block; margin-top: 4px; line-height: 1.35; font-weight: 400; }
/* Review mode badge shown on lesson intro */
.topics-review-badge {
  font-family: 'Cinzel', serif; font-size: 0.6rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--sage); background: var(--sage-bg);
  border: 1px solid var(--sage); border-radius: 4px;
  padding: 5px 12px; margin-bottom: 14px; display: inline-block;
}

/* ─── MUTE SCREEN ──────────────────────────────────────────── */
#mute {
  align-items: center; justify-content: center;
  padding: 40px 20px; background: #ffffff;
}
.mute-card {
  max-width: 500px; width: 100%;
  background: #fff; border: 1px solid var(--parchment-deep);
  border-radius: 10px; padding: 52px 48px; text-align: center;
  box-shadow: 0 4px 30px rgba(0,0,0,0.07);
}
.mute-icon { font-size: 3rem; margin-bottom: 18px; display: block; }
.mute-title {
  font-family: 'Cinzel', serif; font-size: 1.2rem;
  color: var(--brown-deep); letter-spacing: 0.08em; margin-bottom: 14px;
}
.mute-body {
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 1rem; color: var(--brown-mid);
  line-height: 1.8; margin-bottom: 28px;
}
.mute-label {
  font-family: 'Cinzel', serif; font-size: 0.7rem;
  letter-spacing: 0.15em; color: var(--burgundy);
  text-transform: uppercase; display: block; margin-bottom: 8px;
}
.mute-input {
  width: 100%; padding: 12px 16px;
  border: 1px solid var(--parchment-deep); border-radius: 5px;
  background: var(--parchment-dark);
  font-family: 'IM Fell English', Georgia, serif;
  font-size: 1rem; color: var(--ink); text-align: center;
  transition: border-color 0.2s;
}
.mute-input:focus { outline: none; border-color: var(--gold); }
.mute-hint { font-size: 0.8rem; font-style: italic; color: var(--brown-light); margin-top: 6px; }
.mute-error { color: var(--burgundy); font-size: 0.82rem; margin-top: 8px; min-height: 20px; font-style: italic; }

/* ─── MEDITATION SCREEN ────────────────────────────────────── */
#meditation {
  align-items: center; justify-content: center;
  padding: 40px 20px; background: #ffffff;
}
.meditation-card { max-width: 500px; width: 100%; text-align: center; }
.breath-circle-wrap {
  margin: 0 auto 36px; width: 180px; height: 180px;
  position: relative; display: flex; align-items: center; justify-content: center;
}
.breath-circle {
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,150,62,0.12) 0%, rgba(200,150,62,0.02) 70%);
  border: 1.5px solid rgba(200,150,62,0.4);
  display: flex; align-items: center; justify-content: center;
  animation: breathe 8s ease-in-out infinite;
}
@keyframes breathe {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.35); }
}
.breath-inner {
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  letter-spacing: 0.15em; color: var(--gold); text-transform: uppercase;
}
.orbit-ring {
  position: absolute; width: 170px; height: 170px;
  border: 1px solid rgba(200,150,62,0.15); border-radius: 50%;
  animation: spin 20s linear infinite;
}
.orbit-ring::after {
  content: '✦'; position: absolute; top: -7px; left: 50%;
  transform: translateX(-50%); color: var(--gold); font-size: 0.7rem; opacity: 0.5;
}
@keyframes spin { to { transform: rotate(360deg); } }
.med-title {
  font-family: 'Cinzel', serif; font-size: 1.3rem;
  color: var(--brown-deep); letter-spacing: 0.1em; margin-bottom: 12px;
}
.med-instruction {
  font-family: 'IM Fell English', Georgia, serif; font-style: italic;
  font-size: 1rem; color: var(--brown-mid); line-height: 1.85;
  margin-bottom: 32px; max-width: 400px; margin-left: auto; margin-right: auto;
}
.timer-display {
  font-family: 'Cinzel', serif; font-size: 3rem;
  color: var(--brown-deep); letter-spacing: 0.1em; margin-bottom: 8px;
}
.timer-label {
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  letter-spacing: 0.2em; color: var(--brown-light);
  text-transform: uppercase; margin-bottom: 36px;
}
.timer-bar-wrap {
  width: 100%; max-width: 360px; margin: 0 auto 36px;
  height: 3px; background: var(--parchment-deep); border-radius: 2px; overflow: hidden;
}
.timer-bar {
  height: 100%;
  background: linear-gradient(to right, var(--burgundy), var(--gold));
  border-radius: 2px; transition: width 1s linear; width: 100%;
}
.btn-skip {
  background: transparent; color: var(--brown-light);
  font-family: 'Cinzel', serif; font-size: 0.7rem; letter-spacing: 0.15em;
  text-transform: uppercase; border: 1px solid var(--parchment-deep);
  border-radius: 3px; padding: 10px 24px; cursor: pointer; transition: all 0.25s;
}
.btn-skip:hover { color: var(--brown-mid); border-color: var(--gold); }

/* ─── LESSON INTRO SCREEN ──────────────────────────────────── */
#lessonIntro { align-items: stretch; background: #ffffff; }
.lesson-intro-card {
  max-width: 580px; width: 100%;
  background: #fff; border: 1px solid var(--parchment-deep);
  border-radius: 8px; padding: 48px 44px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.06);
}
.lesson-day-badge {
  font-family: 'Cinzel', serif; font-size: 0.78rem;
  letter-spacing: 0.2em; color: var(--burgundy);
  text-transform: uppercase; margin-bottom: 8px; font-weight: 600;
}
.lesson-intro-title {
  font-family: 'Cinzel', serif; font-size: 1.6rem;
  font-weight: 700; color: #1a1a1a;
  line-height: 1.2; margin-bottom: 5px; letter-spacing: 0.04em;
}
.lesson-intro-sub {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.88rem;
  color: #333333; letter-spacing: 0.05em;
  margin-bottom: 24px;
}
.lesson-topics {
  background: var(--parchment-dark); border: 1px solid var(--parchment-deep);
  border-radius: 6px; padding: 18px 22px; margin-bottom: 26px;
}
.topics-title {
  font-family: 'Cinzel', serif; font-size: 0.75rem;
  letter-spacing: 0.15em; color: #1a1a1a;
  text-transform: uppercase; margin-bottom: 12px; font-weight: 600;
}
.topic-item {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 7px; font-family: 'Merriweather', Georgia, serif;
  font-size: 0.88rem; color: #1a1a1a; line-height: 1.6;
}
.topic-item::before { content: '✦'; color: var(--gold); font-size: 0.65rem; flex-shrink: 0; margin-top: 4px; }
.lesson-duration {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.9rem; color: #333333; margin-bottom: 26px;
}

/* ─── CARD STUDY SCREEN ────────────────────────────────────── */
#lessonStudy { align-items: stretch; }

.study-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  flex: 1;
  min-height: 0;
}

/* Left — card panel */
.card-panel {
  background: var(--parchment-dark);
  border-right: 1px solid var(--parchment-deep);
  padding: 32px 24px;
  display: flex; flex-direction: column;
  align-items: center; gap: 18px;
  position: sticky; top: 43px;
  height: calc(100vh - 43px);
  overflow-y: auto;
}
.card-numeral {
  font-family: 'Cinzel', serif; font-size: 0.78rem;
  letter-spacing: 0.2em; color: #2c1508; text-transform: uppercase; font-weight: 600;
}
.card-img-wrap {
  width: 200px;
  border: 2px solid var(--gold);
  border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  overflow: hidden; background: #fff; flex-shrink: 0;
}
.card-img-wrap img { width: 100%; height: auto; display: block; }
.card-name-display {
  font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 600;
  color: var(--brown-deep); text-align: center; letter-spacing: 0.06em;
}
.card-prompt {
  background: #fff; border: 1px solid var(--parchment-deep);
  border-radius: 6px; padding: 14px 16px;
  font-family: 'IM Fell English', Georgia, serif; font-style: italic;
  font-size: 0.88rem; color: var(--brown-mid); line-height: 1.65; text-align: center;
}
.card-keywords {
  width: 100%;
  background: var(--gold-pale); border: 1px solid rgba(200,150,62,0.3);
  border-radius: 6px; padding: 12px 14px;
}
.kw-title {
  font-family: 'Cinzel', serif; font-size: 0.6rem; letter-spacing: 0.15em;
  color: var(--gold); text-transform: uppercase; margin-bottom: 6px;
}
.kw-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.kw-tag {
  font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 0.08em;
  color: var(--brown-mid); background: #fff;
  border: 1px solid rgba(200,150,62,0.3); border-radius: 20px; padding: 3px 10px;
}

/* Right — input panel */
.input-panel {
  background: #fff; padding: 36px 44px;
  overflow-y: auto; height: calc(100vh - 43px);
}
.input-heading {
  font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 600;
  color: var(--brown-deep); letter-spacing: 0.06em; margin-bottom: 6px;
}
.input-subheading {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.92rem; color: #333333; line-height: 1.7; margin-bottom: 28px;
}
.observe-label {
  font-family: 'Cinzel', serif; font-size: 0.68rem; letter-spacing: 0.15em;
  color: var(--burgundy); text-transform: uppercase; display: block; margin-bottom: 8px;
}
.observe-textarea {
  width: 100%; min-height: 220px;
  background: var(--parchment-dark); border: 1px solid var(--parchment-deep);
  border-radius: 5px; padding: 16px 18px;
  font-family: 'Crimson Text', Georgia, serif; font-size: 1.05rem;
  color: var(--ink); resize: vertical; line-height: 1.7;
  transition: border-color 0.2s;
}
.observe-textarea:focus { outline: none; border-color: var(--gold); background: #fff; }
.observe-textarea::placeholder { color: #c8bfb0; font-style: italic; }
.observe-hint {
  font-size: 0.82rem; font-style: italic; color: var(--brown-light);
  margin-top: 8px; margin-bottom: 28px; line-height: 1.5;
}
.submit-row {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 16px; border-top: 1px solid var(--parchment-deep);
}
.submit-note { font-style: italic; font-size: 0.85rem; color: var(--brown-light); }

/* ─── LOADING SCREEN ───────────────────────────────────────── */
#loading {
  align-items: center; justify-content: center; background: #fff;
}
.loading-inner { text-align: center; }
.loading-card-anim {
  font-size: 3.5rem; display: block;
  animation: float 2s ease-in-out infinite;
  margin-bottom: 24px;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.loading-title {
  font-family: 'Cinzel', serif; font-size: 1rem;
  color: var(--brown-deep); letter-spacing: 0.15em; margin-bottom: 6px;
}
.loading-sub {
  font-family: 'IM Fell English', Georgia, serif; font-style: italic;
  font-size: 0.9rem; color: var(--brown-light); margin-bottom: 20px;
}
.loading-dots span {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--gold); margin: 0 3px;
  animation: bounce 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }

/* ─── REVEAL SCREEN ────────────────────────────────────────── */
#reveal { align-items: stretch; }

.reveal-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  flex: 1; min-height: 0;
}

/* Reveal left panel */
.reveal-left {
  background: var(--parchment-dark);
  border-right: 1px solid var(--parchment-deep);
  padding: 28px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  position: sticky; top: 43px;
  height: calc(100vh - 43px); overflow-y: auto;
}
.ai-feedback-box {
  background: var(--gold-pale); border: 1px solid rgba(200,150,62,0.3);
  border-radius: 6px; padding: 16px;  width: 100%;
}
.ai-feedback-label {
  font-family: 'Cinzel', serif; font-size: 0.6rem; letter-spacing: 0.15em;
  color: var(--gold); text-transform: uppercase; margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.ai-feedback-text {
  font-family: 'IM Fell English', Georgia, serif; font-style: italic;
  font-size: 0.88rem; color: var(--brown-mid); line-height: 1.65;
}
.notebook-prompt {
  background: #fff; border: 1px solid var(--parchment-deep);
  border-radius: 6px; padding: 14px 16px; width: 100%;
}
.notebook-label {
  font-family: 'Cinzel', serif; font-size: 0.6rem; letter-spacing: 0.15em;
  color: var(--burgundy); text-transform: uppercase; margin-bottom: 6px;
}
.notebook-text {
  font-family: 'IM Fell English', Georgia, serif; font-size: 0.88rem;
  color: var(--brown-mid); line-height: 1.6; font-style: italic;
}

/* Reveal right — three blocks */
.reveal-content {
  background: #fff; padding: 36px 44px;
  overflow-y: auto; height: calc(100vh - 43px);
}
.reveal-card-header {
  font-family: 'Cinzel', serif; font-size: 1.3rem;
  color: var(--brown-deep); margin-bottom: 4px; letter-spacing: 0.04em;
}
.reveal-card-sub {
  font-family: 'IM Fell English', Georgia, serif; font-style: italic;
  font-size: 0.9rem; color: var(--brown-light); margin-bottom: 28px;
}

/* Three blocks */
.reveal-block {
  border: 1px solid var(--parchment-deep);
  border-radius: 8px; margin-bottom: 20px; overflow: hidden;
}
.reveal-block-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; background: var(--parchment-dark);
  border-bottom: 1px solid var(--parchment-deep);
}
.block-icon { font-size: 1.1rem; }
.block-title {
  font-family: 'Cinzel', serif; font-size: 0.78rem;
  letter-spacing: 0.14em; color: var(--brown-deep); text-transform: uppercase;
}
.reveal-block-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
}
.block-col {
  padding: 18px 20px;
}
.block-col:first-child {
  border-right: 1px solid var(--parchment-deep);
}
.block-col-label {
  font-family: 'Cinzel', serif; font-size: 0.72rem; letter-spacing: 0.12em;
  color: #1a1a1a; text-transform: uppercase; margin-bottom: 12px; font-weight: 600;
}
.student-text {
  font-family: 'Crimson Text', Georgia, serif; font-size: 0.95rem;
  color: var(--brown-mid); line-height: 1.7;
}
.student-text .highlight {
  background: rgba(200,150,62,0.18); border-radius: 2px;
  padding: 0 2px; font-style: italic;
}
.student-text.empty {
  font-style: italic; color: #bbb; font-size: 0.88rem;
}
.correct-items { display: flex; flex-direction: column; gap: 10px; }
.correct-item {}
.correct-item-name {
  font-family: 'Cinzel', serif; font-size: 0.78rem; letter-spacing: 0.1em;
  color: #1a1a1a; text-transform: uppercase; margin-bottom: 5px; font-weight: 600;
}
.correct-item-keywords {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.8rem;
  color: var(--burgundy); font-weight: 700; margin-bottom: 6px; line-height: 1.5;
}
.correct-item-meaning {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.88rem;
  color: #1a1a1a; line-height: 1.7;
}
.correct-item-spotted {
  display: inline-block; font-family: 'Cinzel', serif; font-size: 0.58rem;
  letter-spacing: 0.1em; padding: 2px 8px; border-radius: 20px;
  margin-top: 4px; text-transform: uppercase;
}
.spotted-yes { background: var(--sage-bg); color: var(--sage); border: 1px solid var(--sage); }
.spotted-no  { background: var(--miss-bg); color: var(--burgundy); border: 1px solid var(--burgundy-light); }

.reveal-next-row {
  padding-top: 20px; border-top: 1px solid var(--parchment-deep);
  margin-top: 8px; display: flex; justify-content: space-between; align-items: center;
}
.reveal-next-note {
  font-family: 'IM Fell English', Georgia, serif; font-style: italic;
  font-size: 0.88rem; color: var(--brown-light);
}

/* ─── DECK INTRO SCREEN ─────────────────────────────────────── */
#deckIntro { align-items: stretch; background: #fff; }
.deck-intro-wrap {
  flex: 1; overflow-y: auto;
  padding: 48px 60px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}
.deck-intro-eyebrow {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  letter-spacing: 0.25em; color: var(--burgundy);
  text-transform: uppercase; margin-bottom: 8px;
}
.deck-intro-title {
  font-family: 'Cinzel', serif; font-size: 1.8rem;
  font-weight: 700; color: #1a1a1a;
  margin-bottom: 6px; letter-spacing: 0.04em;
}
.deck-intro-subtitle {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.95rem; color: #555; margin-bottom: 36px;
}
/* Structure diagram */
.deck-diagram {
  display: flex; align-items: stretch; gap: 0;
  border: 1px solid var(--parchment-deep);
  border-radius: 8px; overflow: hidden; margin-bottom: 40px;
}
.deck-diagram-block {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 22px 16px; text-align: center;
}
.deck-diagram-block.total {
  background: #1a1a1a; flex: 0 0 140px;
}
.deck-diagram-block.major {
  background: var(--burgundy); flex: 1;
}
.deck-diagram-block.minor {
  background: var(--brown-mid); flex: 2.5;
  border-left: 1px solid rgba(255,255,255,0.1);
}
.diag-number {
  font-family: 'Cinzel', serif; font-size: 2.2rem;
  font-weight: 700; color: #fff; line-height: 1;
}
.diag-label {
  font-family: 'Cinzel', serif; font-size: 0.62rem;
  letter-spacing: 0.18em; color: rgba(255,255,255,0.75);
  text-transform: uppercase; margin-top: 4px;
}
.diag-sub {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.72rem; color: rgba(255,255,255,0.55);
  margin-top: 4px;
}
.diag-equals {
  font-family: 'Cinzel', serif; font-size: 1.4rem;
  color: #999; padding: 0 8px; display: flex;
  align-items: center; background: #fff;
  border-top: 1px solid var(--parchment-deep);
  border-bottom: 1px solid var(--parchment-deep);
}
/* Section headings */
.intro-section { margin-bottom: 40px; }
.intro-section-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 2px solid var(--parchment-deep);
}
.intro-section-badge {
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  letter-spacing: 0.15em; color: #fff;
  text-transform: uppercase; padding: 4px 12px;
  border-radius: 20px; white-space: nowrap;
}
.badge-major { background: var(--burgundy); }
.badge-minor { background: var(--brown-mid); }
.badge-how { background: var(--sage); }
.intro-section-title {
  font-family: 'Cinzel', serif; font-size: 1.1rem;
  font-weight: 600; color: #1a1a1a; letter-spacing: 0.04em;
}
.intro-section-count {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.78rem; color: #888; margin-left: auto;
}
.intro-body {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.92rem; color: #1a1a1a; line-height: 1.85;
  margin-bottom: 20px;
}
/* Card image row */
.intro-card-row {
  display: flex; gap: 16px; margin: 20px 0; flex-wrap: wrap;
}
.intro-card-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  flex: 1; min-width: 90px; max-width: 130px;
}
.intro-card-img {
  width: 90px; border: 2px solid var(--gold);
  border-radius: 5px; overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.intro-card-img img { width: 100%; height: auto; display: block; }
.intro-card-caption {
  font-family: 'Cinzel', serif; font-size: 0.62rem;
  letter-spacing: 0.1em; color: #555;
  text-transform: uppercase; text-align: center;
}
/* Suits grid */
.suits-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 16px; margin: 20px 0;
}
.suit-item {
  border: 1px solid var(--parchment-deep);
  border-radius: 8px; overflow: hidden;
  text-align: center;
}
.suit-img { width: 100%; }
.suit-img img { width: 100%; height: auto; display: block; }
.suit-info { padding: 10px 8px; background: var(--parchment-dark); }
.suit-name {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  font-weight: 600; color: #1a1a1a; letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 3px;
}
.suit-element {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.7rem; color: var(--burgundy); font-weight: 700;
  margin-bottom: 4px;
}
.suit-desc {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.7rem; color: #555; line-height: 1.5;
}
.intro-bottom-row {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; border-top: 1px solid var(--parchment-deep);
  margin-top: 16px;
}
.intro-bottom-note {
  font-family: 'Merriweather', Georgia, serif;
  font-style: italic; font-size: 0.85rem; color: #888;
}

/* ─── QUIZ SCREEN ───────────────────────────────────────────── */
#quiz { align-items: stretch; background: #fff; }
.quiz-wrap {
  flex: 1; max-width: 720px; margin: 0 auto;
  width: 100%; padding: 48px 40px; overflow-y: auto;
}
.quiz-eyebrow {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  letter-spacing: 0.25em; color: var(--burgundy);
  text-transform: uppercase; margin-bottom: 8px;
}
.quiz-title {
  font-family: 'Cinzel', serif; font-size: 1.6rem;
  font-weight: 700; color: #1a1a1a; margin-bottom: 6px;
}
.quiz-subtitle {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.9rem; color: #555; margin-bottom: 32px;
}
.quiz-progress-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 32px;
}
.quiz-q-dots { display: flex; gap: 6px; }
.quiz-q-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--parchment-deep); border: 1px solid #ccc;
  transition: all 0.3s;
}
.quiz-q-dot.done { background: var(--sage); border-color: var(--sage); }
.quiz-q-dot.current { background: var(--burgundy); border-color: var(--burgundy); }
.quiz-q-count {
  font-family: 'Cinzel', serif; font-size: 0.7rem;
  letter-spacing: 0.15em; color: #888; text-transform: uppercase;
  margin-left: auto;
}
.quiz-question-card {
  border: 1px solid var(--parchment-deep);
  border-radius: 8px; padding: 28px 32px; margin-bottom: 24px;
  background: #fff;
}
.quiz-q-number {
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  letter-spacing: 0.18em; color: var(--gold);
  text-transform: uppercase; margin-bottom: 10px;
}
.quiz-q-text {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 1rem; color: #1a1a1a; line-height: 1.7;
  margin-bottom: 22px; font-weight: 700;
}
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 18px; border: 1.5px solid var(--parchment-deep);
  border-radius: 6px; cursor: pointer; transition: all 0.2s;
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.88rem; color: #1a1a1a; line-height: 1.6;
  background: #fff;
}
.quiz-option:hover { border-color: var(--gold); background: var(--gold-pale); }
.quiz-option.selected { border-color: var(--burgundy); background: #fdf0f0; }
.quiz-option.correct { border-color: var(--sage); background: var(--sage-bg); color: #1a1a1a; }
.quiz-option.wrong { border-color: var(--burgundy); background: #fdf0f0; color: #1a1a1a; }
.quiz-option-letter {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  font-weight: 700; color: #888; flex-shrink: 0; margin-top: 2px;
  min-width: 18px;
}
.quiz-option.correct .quiz-option-letter { color: var(--sage); }
.quiz-option.wrong .quiz-option-letter { color: var(--burgundy); }
.quiz-explanation {
  margin-top: 16px; padding: 14px 18px;
  background: var(--parchment-dark); border-radius: 6px;
  border-left: 3px solid var(--gold);
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.85rem; color: #1a1a1a; line-height: 1.7;
  display: none;
}
.quiz-explanation.show { display: block; }
.quiz-nav-row {
  display: flex; justify-content: space-between;
  align-items: center; margin-top: 8px;
}
.quiz-score-summary {
  text-align: center; padding: 32px;
  border: 1px solid var(--parchment-deep);
  border-radius: 8px; margin-bottom: 24px;
  background: var(--parchment-dark); display: none;
}
.quiz-score-summary.show { display: block; }
.quiz-score-number {
  font-family: 'Cinzel', serif; font-size: 3rem;
  font-weight: 700; color: var(--burgundy); margin-bottom: 8px;
}
.quiz-score-label {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.9rem; color: #555; margin-bottom: 16px;
}
.quiz-score-msg {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.92rem; color: #1a1a1a; line-height: 1.7;
  font-style: italic;
}
.quiz-loading {
  text-align: center; padding: 60px 20px;
}
.quiz-loading-text {
  font-family: 'Cinzel', serif; font-size: 0.9rem;
  color: var(--brown-mid); letter-spacing: 0.12em; margin-bottom: 16px;
}

/* ─── NUMEROLOGY SCREEN ─────────────────────────────────────── */
#numerologyIntro { align-items: stretch; background: #fff; }
.numeral-wrap {
  flex: 1; max-width: 800px; margin: 0 auto;
  width: 100%; padding: 48px 40px; overflow-y: auto;
}
.numeral-eyebrow {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  letter-spacing: 0.25em; color: var(--burgundy);
  text-transform: uppercase; margin-bottom: 8px;
}
.numeral-title {
  font-family: 'Cinzel', serif; font-size: 1.6rem;
  font-weight: 700; color: #1a1a1a; margin-bottom: 6px;
}
.numeral-subtitle {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.9rem; color: #555; margin-bottom: 32px;
}
.numeral-intro {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.92rem; color: #1a1a1a; line-height: 1.85;
  margin-bottom: 32px;
}
.numeral-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-bottom: 36px;
}
.numeral-cell {
  border: 1px solid var(--parchment-deep);
  border-radius: 8px; padding: 16px 12px; text-align: center;
  background: var(--parchment-dark);
  transition: all 0.2s;
}
.numeral-cell:hover { border-color: var(--gold); background: var(--gold-pale); }
.numeral-cell.zero { grid-column: span 4; background: #1a1a1a; border-color: #1a1a1a; }
.numeral-num {
  font-family: 'Cinzel', serif; font-size: 1.6rem;
  font-weight: 700; color: var(--gold); display: block;
  margin-bottom: 4px;
}
.numeral-cell.zero .numeral-num { font-size: 2rem; }
.numeral-keyword {
  font-family: 'Cinzel', serif; font-size: 0.68rem;
  letter-spacing: 0.1em; color: var(--burgundy);
  text-transform: uppercase; display: block; margin-bottom: 6px;
}
.numeral-cell.zero .numeral-keyword { color: var(--gold); }
.numeral-desc {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.78rem; color: #1a1a1a; line-height: 1.6;
}
.numeral-cell.zero .numeral-desc { color: rgba(255,255,255,0.7); }

.numeral-section-title {
  font-family: 'Cinzel', serif; font-size: 0.85rem;
  font-weight: 700; color: #1a1a1a; letter-spacing: 0.08em;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 2px solid var(--parchment-deep);
}
.numeral-pattern-block {
  border: 1px solid var(--parchment-deep);
  border-radius: 8px; padding: 20px 24px;
  margin-bottom: 14px; background: var(--parchment-dark);
}
.numeral-pattern-title {
  font-family: 'Cinzel', serif; font-size: 0.75rem;
  font-weight: 700; color: var(--burgundy);
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.numeral-pattern-text {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.88rem; color: #1a1a1a; line-height: 1.75;
}
.numeral-bottom-row {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; border-top: 1px solid var(--parchment-deep); margin-top: 8px;
}
.numeral-bottom-note {
  font-family: 'Merriweather', Georgia, serif;
  font-style: italic; font-size: 0.85rem; color: #888;
}

/* ─── THREE CARD SPREAD SCREEN ──────────────────────────────── */
#spreadIntro { align-items: stretch; background: #faf8f5; }
.spread-wrap {
  flex: 1; max-width: 860px; margin: 0 auto;
  width: 100%; padding: 48px 40px; overflow-y: auto;
}
.spread-eyebrow {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  letter-spacing: 0.25em; color: var(--burgundy);
  text-transform: uppercase; margin-bottom: 8px;
}
.spread-title {
  font-family: 'Cinzel', serif; font-size: 1.6rem;
  font-weight: 700; color: #1a1a1a; margin-bottom: 6px;
}
.spread-subtitle {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.9rem; color: #555; margin-bottom: 32px;
}
.spread-intro-text {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.92rem; color: #1a1a1a; line-height: 1.85;
  margin-bottom: 32px;
}
/* The visual spread diagram */
.spread-diagram {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin-bottom: 36px;
}
.spread-position {
  border: 1px solid var(--parchment-deep);
  border-radius: 10px; overflow: hidden; text-align: center;
}
.spread-position-card {
  background: var(--parchment-dark);
  aspect-ratio: 2/3; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 20px 12px;
  border-bottom: 1px solid var(--parchment-deep);
  position: relative;
}
.spread-position-num {
  font-family: 'Cinzel', serif; font-size: 2rem;
  font-weight: 700; color: var(--gold); opacity: 0.4;
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
}
.spread-position-icon { font-size: 2.4rem; margin-bottom: 8px; }
.spread-position-name {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  letter-spacing: 0.12em; color: var(--burgundy);
  text-transform: uppercase; font-weight: 600;
}
.spread-position-info { padding: 14px 12px; background: #fff; }
.spread-position-label {
  font-family: 'Cinzel', serif; font-size: 0.68rem;
  letter-spacing: 0.1em; color: #888; text-transform: uppercase;
  display: block; margin-bottom: 6px;
}
.spread-position-desc {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.78rem; color: #1a1a1a; line-height: 1.6;
}
/* Variations table */
.spread-variations {
  border: 1px solid var(--parchment-deep);
  border-radius: 8px; overflow: hidden; margin-bottom: 32px;
}
.spread-var-header {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
  background: #1a1a1a; padding: 12px 16px;
}
.spread-var-header span {
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  letter-spacing: 0.15em; color: rgba(255,255,255,0.7);
  text-transform: uppercase;
}
.spread-var-header span:first-child { color: var(--gold); }
.spread-var-row {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
  padding: 12px 16px; border-bottom: 1px solid var(--parchment-deep);
}
.spread-var-row:last-child { border-bottom: none; }
.spread-var-row:nth-child(even) { background: var(--parchment-dark); }
.spread-var-cell {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.8rem; color: #1a1a1a; line-height: 1.5;
  padding-right: 8px;
}
.spread-var-cell.theme {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  font-weight: 600; color: var(--burgundy);
}
.spread-tip {
  background: var(--gold-pale); border: 1px solid rgba(200,150,62,0.3);
  border-radius: 8px; padding: 18px 22px; margin-bottom: 24px;
}
.spread-tip-label {
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  letter-spacing: 0.15em; color: var(--gold); text-transform: uppercase;
  margin-bottom: 6px;
}
.spread-tip-text {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.88rem; color: #1a1a1a; line-height: 1.75;
}
.spread-bottom-row {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; border-top: 1px solid var(--parchment-deep);
}
.spread-bottom-note {
  font-family: 'Merriweather', Georgia, serif;
  font-style: italic; font-size: 0.85rem; color: #888;
}

/* ─── SUITS INTRO SCREEN ─────────────────────────────────────── */
#suitsIntro { align-items: stretch; background: #faf8f5; }
.suits-wrap {
  flex: 1; max-width: 860px; margin: 0 auto;
  width: 100%; padding: 48px 40px; overflow-y: auto;
}
.suits-eyebrow {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  letter-spacing: 0.25em; color: var(--burgundy);
  text-transform: uppercase; margin-bottom: 8px;
}
.suits-title {
  font-family: 'Cinzel', serif; font-size: 1.6rem;
  font-weight: 700; color: #1a1a1a; margin-bottom: 6px;
}
.suits-subtitle {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.9rem; color: #555; margin-bottom: 28px;
}
.suits-intro-text {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.92rem; color: #1a1a1a; line-height: 1.85;
  margin-bottom: 36px;
}
.suits-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 20px; margin-bottom: 36px;
}
.suit-card {
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--parchment-deep);
  transition: transform 0.2s, box-shadow 0.2s;
}
.suit-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px var(--shadow); }
.suit-card-image {
  width: 100%; height: 180px; object-fit: cover; display: block;
  background: var(--parchment-dark);
}
.suit-card-image.placeholder {
  display: flex; align-items: center; justify-content: center;
  font-size: 3.5rem; height: 180px; background: var(--parchment-dark);
}
.suit-card-body { padding: 18px 20px; background: #fff; }
.suit-card-element {
  font-family: 'Cinzel', serif; font-size: 0.62rem;
  letter-spacing: 0.18em; text-transform: uppercase;
  margin-bottom: 4px; display: flex; align-items: center; gap: 6px;
}
.suit-card-name {
  font-family: 'Cinzel', serif; font-size: 1rem;
  font-weight: 700; color: #1a1a1a; margin-bottom: 6px;
}
.suit-card-domain {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.8rem; color: #555; margin-bottom: 10px;
  font-style: italic;
}
.suit-card-desc {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.82rem; color: #1a1a1a; line-height: 1.7;
}
.suit-card-keywords {
  display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px;
}
.suit-kw {
  font-family: 'Cinzel', serif; font-size: 0.6rem;
  letter-spacing: 0.08em; padding: 3px 8px;
  border-radius: 20px; border: 1px solid;
  text-transform: uppercase;
}
/* Suit accent colours */
.suit-cups   { --suit-color: #3b6fa0; --suit-bg: #eef3fa; }
.suit-swords { --suit-color: #5a5a7a; --suit-bg: #f0f0f5; }
.suit-wands  { --suit-color: #b5600a; --suit-bg: #fdf3ea; }
.suit-pentacles { --suit-color: #3d6b3d; --suit-bg: #eef5ee; }
.suit-card-element { color: var(--suit-color); }
.suit-card-body  { border-top: 3px solid var(--suit-color); }
.suit-kw { border-color: var(--suit-color); color: var(--suit-color); background: var(--suit-bg); }

/* Summary table */
.suits-table {
  border: 1px solid var(--parchment-deep); border-radius: 8px;
  overflow: hidden; margin-bottom: 32px;
}
.suits-table-header {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr 2fr;
  background: #1a1a1a; padding: 12px 16px; gap: 8px;
}
.suits-table-header span {
  font-family: 'Cinzel', serif; font-size: 0.62rem;
  letter-spacing: 0.15em; color: rgba(255,255,255,0.6);
  text-transform: uppercase;
}
.suits-table-header span:first-child { color: var(--gold); }
.suits-table-row {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr 2fr;
  padding: 11px 16px; border-bottom: 1px solid var(--parchment-deep);
  gap: 8px; align-items: start;
}
.suits-table-row:last-child { border-bottom: none; }
.suits-table-row:nth-child(even) { background: var(--parchment-dark); }
.suits-table-cell {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.78rem; color: #1a1a1a; line-height: 1.5;
}
.suits-table-cell.suit-name {
  font-family: 'Cinzel', serif; font-size: 0.75rem;
  font-weight: 700; color: var(--burgundy);
}
.suits-bottom-row {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; border-top: 1px solid var(--parchment-deep);
}
.suits-bottom-note {
  font-family: 'Merriweather', Georgia, serif;
  font-style: italic; font-size: 0.85rem; color: #888;
}

/* ─── SPREAD PRACTICE SCREEN ─────────────────────────────────── */
#spreadPractice { align-items: stretch; background: #faf8f5; }
.sp-wrap {
  flex: 1; max-width: 860px; margin: 0 auto;
  width: 100%; padding: 48px 40px; overflow-y: auto;
}
.sp-eyebrow {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  letter-spacing: 0.25em; color: var(--burgundy);
  text-transform: uppercase; margin-bottom: 8px;
}
.sp-title {
  font-family: 'Cinzel', serif; font-size: 1.6rem;
  font-weight: 700; color: #1a1a1a; margin-bottom: 6px;
}
.sp-subtitle {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.9rem; color: #555; margin-bottom: 32px;
}
/* Card draw area */
.sp-cards-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin-bottom: 28px;
}
.sp-card-slot {
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--parchment-deep);
  background: #fff;
}
.sp-card-pos-label {
  font-family: 'Cinzel', serif; font-size: 0.6rem;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--gold); background: #1a1a1a;
  padding: 6px 12px; display: block; text-align: center;
}
.sp-card-img-wrap {
  position: relative; background: var(--parchment-dark);
  aspect-ratio: 2/3; overflow: hidden;
}
.sp-card-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.sp-card-name {
  font-family: 'Cinzel', serif; font-size: 0.78rem;
  font-weight: 700; color: #1a1a1a; text-align: center;
  padding: 10px 8px 4px;
}
.sp-card-meaning {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.72rem; color: #555; text-align: center;
  padding: 0 10px 12px; line-height: 1.5; font-style: italic;
}
/* Spread type badge */
.sp-type-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--gold-pale); border: 1px solid rgba(200,150,62,0.4);
  border-radius: 20px; padding: 7px 16px; margin-bottom: 28px;
}
.sp-type-label {
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  letter-spacing: 0.12em; text-transform: uppercase; color: #888;
}
.sp-type-name {
  font-family: 'Cinzel', serif; font-size: 0.75rem;
  font-weight: 700; color: var(--burgundy);
}
/* Position labels shown above cards */
.sp-positions-row {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 20px; margin-bottom: 8px;
}
.sp-pos-name {
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #888; text-align: center;
}
/* Student input */
.sp-input-section { margin-bottom: 24px; }
.sp-input-label {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--burgundy); display: block; margin-bottom: 10px;
}
.sp-input-hint {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.82rem; color: #888; margin-bottom: 12px;
  line-height: 1.6;
}
.sp-textarea {
  width: 100%; min-height: 140px; padding: 16px;
  border: 1.5px solid var(--parchment-deep); border-radius: 8px;
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.88rem; color: #1a1a1a; line-height: 1.7;
  resize: vertical; background: #fff;
  transition: border-color 0.2s;
}
.sp-textarea:focus { outline: none; border-color: var(--gold); }
/* AI interpretation */
.sp-interpretation {
  border: 1px solid var(--parchment-deep); border-radius: 10px;
  overflow: hidden; margin-bottom: 28px; display: none;
}
.sp-interpretation.show { display: block; }
.sp-interp-header {
  background: #1a1a1a; padding: 14px 20px;
  display: flex; align-items: center; gap: 10px;
}
.sp-interp-title {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold);
}
.sp-interp-body { padding: 24px; background: #fff; }
.sp-interp-pos {
  margin-bottom: 22px; padding-bottom: 22px;
  border-bottom: 1px solid var(--parchment-deep);
}
.sp-interp-pos:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: none; }
.sp-interp-pos-label {
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 4px; display: block;
}
.sp-interp-pos-card {
  font-family: 'Cinzel', serif; font-size: 0.9rem;
  font-weight: 700; color: #1a1a1a; margin-bottom: 10px;
}
.sp-interp-pos-text {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.88rem; color: #1a1a1a; line-height: 1.8;
}
.sp-interp-synthesis {
  margin-top: 22px; padding: 18px;
  background: var(--parchment-dark); border-radius: 8px;
  border-left: 3px solid var(--gold);
}
.sp-interp-synth-label {
  font-family: 'Cinzel', serif; font-size: 0.62rem;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 8px; display: block;
}
.sp-interp-synth-text {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.88rem; color: #1a1a1a; line-height: 1.8;
  font-style: italic;
}
.sp-nav-row {
  display: flex; justify-content: space-between;
  align-items: center; padding-top: 24px;
  border-top: 1px solid var(--parchment-deep);
}
.sp-nav-note {
  font-family: 'Merriweather', Georgia, serif;
  font-style: italic; font-size: 0.82rem; color: #888;
}

/* ─── COURT CARDS INTRO ─────────────────────────────────────── */
#courtCardsIntro { align-items: stretch; background: #faf8f5; }
.court-wrap {
  flex: 1; max-width: 860px; margin: 0 auto;
  width: 100%; padding: 48px 40px; overflow-y: auto;
}
.court-eyebrow {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  letter-spacing: 0.25em; color: var(--burgundy);
  text-transform: uppercase; margin-bottom: 8px;
}
.court-title {
  font-family: 'Cinzel', serif; font-size: 1.6rem;
  font-weight: 700; color: #1a1a1a; margin-bottom: 6px;
}
.court-subtitle {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.9rem; color: #555; margin-bottom: 28px;
}
.court-intro-text {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.92rem; color: #1a1a1a; line-height: 1.85;
  margin-bottom: 36px;
}
.court-rank-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 16px; margin-bottom: 36px;
}
.court-rank-card {
  border: 1px solid var(--parchment-deep); border-radius: 10px;
  overflow: hidden;
}
.court-rank-header {
  padding: 14px 18px; display: flex; align-items: center; gap: 12px;
}
.court-rank-icon { font-size: 1.8rem; }
.court-rank-name {
  font-family: 'Cinzel', serif; font-size: 1rem;
  font-weight: 700; color: #fff;
}
.court-rank-count {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.75rem; color: rgba(255,255,255,0.7); margin-top: 2px;
}
.court-rank-body { padding: 16px 18px; background: #fff; }
.court-rank-energy {
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 6px;
}
.court-rank-desc {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.84rem; color: #1a1a1a; line-height: 1.7;
  margin-bottom: 12px;
}
.court-rank-examples {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.78rem; color: #666; line-height: 1.6;
  font-style: italic;
}
.court-rank-page   .court-rank-header { background: #3b6fa0; }
.court-rank-knight .court-rank-header { background: #7a1e2e; }
.court-rank-queen  .court-rank-header { background: #4a6741; }
.court-rank-king   .court-rank-header { background: #2c1508; }
.court-suits-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-bottom: 32px;
}
.court-suit-pill {
  border-radius: 8px; padding: 14px 10px; text-align: center;
  border: 1px solid var(--parchment-deep);
}
.court-suit-icon { font-size: 1.4rem; margin-bottom: 6px; display: block; }
.court-suit-name {
  font-family: 'Cinzel', serif; font-size: 0.68rem;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  display: block; margin-bottom: 4px;
}
.court-suit-total {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.7rem; color: #888;
}
.court-bottom-row {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; border-top: 1px solid var(--parchment-deep);
}
.court-bottom-note {
  font-family: 'Merriweather', Georgia, serif;
  font-style: italic; font-size: 0.85rem; color: #888;
}

/* ─── REFERENCE LIBRARY ─────────────────────────────────────── */
/* Reference button in top bar */
/* ─── REFERENCE BUTTON (📖 icon on each screen) ─── */
.ref-btn {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--parchment-dark); border: 1px solid var(--parchment-deep);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.9rem; flex-shrink: 0;
  transition: all 0.2s; color: var(--brown-mid);
  text-decoration: none;
}
.ref-btn:hover { background: var(--gold-pale); border-color: var(--gold); color: var(--burgundy); }

/* ─── REFERENCE SIDEBAR ──────────────────────────── */
#refOverlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 800;
}
#refOverlay.show { display: block; }

#refSidebar {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 75vw; max-width: 960px; min-width: 320px;
  background: #fefcf8;
  box-shadow: -6px 0 40px rgba(0,0,0,0.22);
  z-index: 900;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
}
#refSidebar.open { transform: translateX(0); }

/* Sidebar header */
.ref-sidebar-header {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px 14px;
  border-bottom: 2px solid #e8dcc8;
  background: #fff; flex-shrink: 0;
}
.ref-sidebar-title {
  font-family: 'Cinzel', serif; font-size: 1rem;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--burgundy); flex: 1; text-align: center;
}
.ref-back-btn, .ref-close-btn {
  font-family: 'Cinzel', serif; font-size: 0.75rem;
  letter-spacing: 0.06em; padding: 7px 14px;
  border-radius: 4px; cursor: pointer;
  background: none; border: 1px solid #d0c4b0;
  color: #444; transition: all 0.2s; flex-shrink: 0;
}
.ref-back-btn:hover, .ref-close-btn:hover {
  background: #f0ebe0; color: var(--burgundy); border-color: var(--burgundy);
}

/* Search */
.ref-search-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid #e8dcc8;
  background: #fff; flex-shrink: 0;
}
.ref-search-icon { font-size: 1rem; color: #999; flex-shrink: 0; }
.ref-search-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.95rem; color: #222;
}
.ref-search-input::placeholder { color: #bbb; }

/* Tab row */
.ref-tabs-row {
  display: flex; overflow-x: auto; flex-shrink: 0;
  border-bottom: 2px solid #e8dcc8;
  background: #fff;
}
.ref-tab-btn {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 12px 16px; cursor: pointer; white-space: nowrap;
  color: #777; border: none; border-bottom: 3px solid transparent;
  margin-bottom: -2px; background: none; transition: all 0.2s;
}
.ref-tab-btn:hover { color: var(--burgundy); background: #faf6f0; }
.ref-tab-btn.active { color: var(--burgundy); border-bottom-color: var(--burgundy); font-weight: 700; }
.ref-tab-locked { color: #ccc !important; cursor: default !important; pointer-events: none; }

/* Tab panels & sidebar scroll area */
.ref-sidebar-content {
  flex: 1; overflow-y: auto; padding: 20px 24px;
}
.ref-tab-panel { display: none; }

/* Locked message */
.ref-locked-msg {
  text-align: center; padding: 48px 20px;
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.95rem; color: #999; font-style: italic;
}
.ref-locked-icon { font-size: 2rem; display: block; margin-bottom: 12px; }

/* Major Arcana grid */
.ref-arcana-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
}
.ref-arcana-card {
  border: 1px solid #e0d4c0; border-radius: 8px;
  overflow: hidden; cursor: pointer; transition: all 0.2s;
}
.ref-arcana-card:hover { border-color: var(--gold); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.1); }
.ref-arcana-card.expanded { border-color: var(--burgundy); }
.ref-arcana-img { width: 100%; aspect-ratio: 2/3; object-fit: cover; display: block; background: #f0ebe0; }
.ref-arcana-footer { padding: 8px 9px 7px; background: #fff; }
.ref-arcana-numeral {
  font-family: 'Cinzel', serif; font-size: 0.58rem;
  letter-spacing: 0.08em; color: var(--gold);
  text-transform: uppercase; display: block; margin-bottom: 2px;
}
.ref-arcana-name {
  font-family: 'Cinzel', serif; font-size: 0.72rem;
  font-weight: 700; color: #1a1a1a; display: block;
}
.ref-arcana-detail {
  display: none; padding: 14px 16px;
  background: #faf6f0; border-top: 1px solid #e0d4c0;
}
.ref-arcana-detail.show { display: block; }
.ref-detail-theme {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.88rem; color: #333; font-style: italic;
  margin-bottom: 12px; line-height: 1.7;
}
.ref-detail-keywords { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.ref-detail-kw {
  font-family: 'Cinzel', serif; font-size: 0.6rem;
  letter-spacing: 0.05em; padding: 3px 8px; border-radius: 10px;
  background: #f0e8d8; color: var(--burgundy); text-transform: uppercase;
}
.ref-detail-section {
  font-family: 'Cinzel', serif; font-size: 0.65rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 6px; margin-top: 12px; display: block;
}
.ref-detail-item { margin-bottom: 9px; padding-bottom: 9px; border-bottom: 1px solid #e8dcc8; }
.ref-detail-item:last-child { border-bottom: none; margin-bottom: 0; }
.ref-detail-item-name { font-family: 'Cinzel', serif; font-size: 0.72rem; font-weight: 700; color: #1a1a1a; margin-bottom: 3px; }
.ref-detail-item-meaning { font-family: 'Merriweather', Georgia, serif; font-size: 0.84rem; color: #333; line-height: 1.65; }

/* ── Colours panel ───────────────────────────────── */
.ref-colour-group {
  border: 1px solid #e0d4c0; border-radius: 8px;
  margin-bottom: 12px; overflow: hidden;
}
.ref-colour-group-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer; background: #fff;
  transition: background 0.2s;
}
.ref-colour-group-header:hover { background: #faf6f0; }
.ref-colour-swatch-lg {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.14);
}
.ref-colour-group-info { flex: 1; }
.ref-colour-group-name {
  font-family: 'Cinzel', serif; font-size: 0.82rem; font-weight: 700; color: #1a1a1a;
}
.ref-colour-group-theme {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.82rem; color: #555;
  font-style: italic; margin-top: 3px; line-height: 1.5;
}
.ref-colour-group-toggle { font-size: 1rem; color: #aaa; flex-shrink: 0; }
.ref-colour-group-nuances { padding: 4px 16px 14px; background: #faf6f0; }
.ref-nuances-label {
  font-family: 'Cinzel', serif; font-size: 0.62rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 10px; margin-top: 12px; display: block;
}
.ref-nuance-row { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #e8dcc8; }
.ref-nuance-row:last-child { border-bottom: none; margin-bottom: 0; }
.ref-nuance-card {
  font-family: 'Cinzel', serif; font-size: 0.68rem; font-weight: 700;
  color: var(--burgundy); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.06em;
}
.ref-nuance-text {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.86rem; color: #333; line-height: 1.7;
}

/* ── Symbols panel ───────────────────────────────── */
.ref-symbols-section { margin-bottom: 24px; }
.ref-symbols-card-title {
  font-family: 'Cinzel', serif; font-size: 0.85rem; font-weight: 700; color: #1a1a1a;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 2px solid #e8dcc8;
}
.ref-symbols-card-numeral {
  font-family: 'Cinzel', serif; font-size: 0.65rem; color: var(--gold);
  margin-right: 7px; text-transform: uppercase; letter-spacing: 0.06em;
}
.ref-symbol-row {
  padding: 12px 0; border-bottom: 1px solid #e8dcc8;
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer;
}
.ref-symbol-row:last-child { border-bottom: none; }
.ref-symbol-icon { width: 24px; text-align: center; font-size: 0.9rem; flex-shrink: 0; margin-top: 2px; color: var(--gold); }
.ref-symbol-content { flex: 1; }
.ref-symbol-name { font-family: 'Cinzel', serif; font-size: 0.76rem; font-weight: 700; color: #1a1a1a; margin-bottom: 3px; }
.ref-symbol-keyword { font-family: 'Merriweather', Georgia, serif; font-size: 0.84rem; color: #444; font-style: italic; }
.ref-symbol-detail {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.84rem; color: #333;
  line-height: 1.65; margin-top: 6px; display: none;
}
.ref-symbol-row.expanded .ref-symbol-detail { display: block; }

/* ── Search results ───────────────────────────────── */
.ref-search-count {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.88rem;
  color: #666; margin-bottom: 14px;
}
.ref-search-empty {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.95rem;
  color: #aaa; font-style: italic; text-align: center; padding: 40px 0;
}
.ref-search-item {
  border: 1px solid #e0d4c0; border-radius: 8px;
  padding: 14px 18px; margin-bottom: 10px; cursor: pointer;
  background: #fff; transition: all 0.2s;
}
.ref-search-item:hover { border-color: var(--gold); background: #faf6f0; }
.ref-search-item-context {
  font-family: 'Cinzel', serif; font-size: 0.62rem; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 5px;
}
.ref-search-item-title { font-family: 'Cinzel', serif; font-size: 0.84rem; font-weight: 700; color: #1a1a1a; margin-bottom: 5px; }
.ref-search-item-preview { font-family: 'Merriweather', Georgia, serif; font-size: 0.86rem; color: #444; font-style: italic; line-height: 1.6; }

/* Detail view from search */
.ref-detail-view { padding: 4px 0; }
.ref-detail-context {
  font-family: 'Cinzel', serif; font-size: 0.62rem; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 8px;
}
.ref-detail-title { font-family: 'Cinzel', serif; font-size: 1rem; font-weight: 700; color: #1a1a1a; margin-bottom: 14px; }
.ref-detail-body { font-family: 'Merriweather', Georgia, serif; font-size: 0.9rem; color: #222; line-height: 1.85; }
.ref-back-to-results-btn {
  margin-top: 22px; font-family: 'Cinzel', serif; font-size: 0.7rem;
  letter-spacing: 0.08em; padding: 9px 16px; border-radius: 4px;
  cursor: pointer; background: none; border: 1px solid #d0c4b0; color: #444;
  transition: all 0.2s;
}
.ref-back-to-results-btn:hover { background: #f0ebe0; color: var(--burgundy); }

/* ── Minor Arcana comparison tables ─────────────────── */
.ref-minor-intro {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.9rem;
  color: #444; line-height: 1.8; margin-bottom: 20px;
}
.ref-minor-number-picker {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px;
}
.ref-minor-num-btn {
  font-family: 'Cinzel', serif; font-size: 0.68rem; letter-spacing: 0.06em;
  padding: 7px 12px; border-radius: 20px; cursor: pointer;
  border: 1px solid #d0c4b0; background: #fff; color: #555;
  transition: all 0.2s; white-space: nowrap;
}
.ref-minor-num-btn:hover { border-color: var(--burgundy); color: var(--burgundy); background: #faf0f0; }
.ref-minor-num-btn.active { background: var(--burgundy); color: #fff; border-color: var(--burgundy); }

.ref-minor-number-block { margin-bottom: 8px; }
.ref-minor-number-heading {
  font-family: 'Cinzel', serif; font-size: 1.05rem; font-weight: 700;
  color: #1a1a1a; margin-bottom: 4px;
}
.ref-minor-shared {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.86rem;
  color: #555; font-style: italic; line-height: 1.75;
  margin-bottom: 16px; padding: 12px 16px;
  background: #faf6f0; border-left: 3px solid var(--gold); border-radius: 0 6px 6px 0;
}

/* Comparison table */
.ref-minor-table {
  width: 100%; border-collapse: collapse; margin-bottom: 8px;
  font-family: 'Merriweather', Georgia, serif;
}
.ref-minor-table th {
  font-family: 'Cinzel', serif; font-size: 0.7rem; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 10px 14px; text-align: left;
  border-bottom: 2px solid #e0d4c0; white-space: nowrap;
}
.ref-minor-table td {
  padding: 12px 14px; vertical-align: top;
  border-bottom: 1px solid #ede5d5; font-size: 0.86rem; line-height: 1.7; color: #222;
}
.ref-minor-table tr:last-child td { border-bottom: none; }
.ref-minor-table tr:hover td { background: #faf6f0; }

.ref-minor-suit-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.ref-minor-suit-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.ref-minor-suit-name {
  font-family: 'Cinzel', serif; font-size: 0.72rem; font-weight: 700; color: #1a1a1a;
}
.ref-minor-suit-el {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.72rem; color: #888;
}
.ref-minor-keywords {
  font-family: 'Cinzel', serif; font-size: 0.62rem; letter-spacing: 0.04em;
  color: var(--burgundy); margin-bottom: 6px; font-weight: 700;
}
.ref-minor-meaning {
  font-size: 0.86rem; color: #333; line-height: 1.7;
}

.ref-more-hint {
  font-family: 'Merriweather', Georgia, serif;
  font-size: 0.78rem; color: #bbb; font-style: italic;
  text-align: center; padding: 16px 0;
  border-top: 1px dashed var(--parchment-deep); margin-top: 6px;
}
.ref-intro-text {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.85rem;
  color: #444; line-height: 1.8; margin-bottom: 20px;
}

/* ─── GRADUATION SCREEN ─────────────────────────────────────── */
#courseComplete {
  background: radial-gradient(ellipse at 50% 20%, #1e1005 0%, #0d0800 100%);
  overflow-y: auto; position: relative; align-items: flex-start; justify-content: center;
}
.grad-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

/* Scroll wrapper */
.grad-scroll {
  width: 100%; min-height: 100%; display: flex; flex-direction: column;
  align-items: center; padding: 32px 16px 48px; position: relative; z-index: 1;
}

/* Certificate parchment */
.grad-certificate {
  width: 100%; max-width: 560px;
  animation: certReveal 1.2s cubic-bezier(0.2,0,0.2,1) forwards;
  opacity: 0;
}
@keyframes certReveal {
  from { opacity: 0; transform: scale(0.94) translateY(24px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* The parchment frame */
.grad-frame {
  background: linear-gradient(160deg, #fdfaf2 0%, #f5edda 50%, #faf6e8 100%);
  border: 1px solid #c8963e;
  box-shadow:
    0 0 0 6px #f5edda,
    0 0 0 8px #c8963e,
    0 0 0 14px #f5edda,
    0 0 40px rgba(200,150,62,0.3),
    0 24px 80px rgba(0,0,0,0.6);
  padding: 36px 32px 28px;
  position: relative; text-align: center;
}

/* Corner ornaments */
.grad-corner {
  position: absolute; font-size: 1.4rem; color: #c8963e; line-height: 1;
  font-family: serif;
}
.grad-corner.tl { top: 10px; left: 14px; }
.grad-corner.tr { top: 10px; right: 14px; transform: scaleX(-1); }
.grad-corner.bl { bottom: 10px; left: 14px; transform: scaleY(-1); }
.grad-corner.br { bottom: 10px; right: 14px; transform: scale(-1,-1); }

/* Rules */
.grad-rule {
  display: flex; align-items: center; gap: 10px; margin: 12px 0;
}
.grad-rule-gem { color: #c8963e; font-size: 0.7rem; flex-shrink: 0; }
.grad-rule-line {
  flex: 1; height: 1px;
  background: linear-gradient(to right, transparent, #c8963e, transparent);
}
.grad-rule-thin {
  height: 1px; margin: 10px 0;
  background: linear-gradient(to right, transparent, #c8963e44, transparent);
}

/* Institution name */
.grad-institution {
  font-family: 'Cinzel', serif; font-size: 1.1rem; font-weight: 700;
  color: #1a0f06; letter-spacing: 0.18em; text-transform: uppercase;
  margin-bottom: 2px;
}
.grad-institution-sub {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.7rem;
  color: #8a6a40; font-style: italic; letter-spacing: 0.06em;
  margin-bottom: 10px;
}

/* Certificate heading */
.grad-cert-heading {
  font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 0.32em;
  text-transform: uppercase; color: #c8963e; margin: 14px 0 8px;
}

/* Seal */
.grad-seal-wrap {
  margin: 10px auto; width: 100px; height: 100px;
  animation: sealSpin 1.6s 0.4s cubic-bezier(0.2,0,0.2,1) both;
}
@keyframes sealSpin {
  from { opacity: 0; transform: rotate(-20deg) scale(0.6); }
  to   { opacity: 1; transform: rotate(0deg)  scale(1); }
}
.grad-seal-svg { width: 100%; height: 100%; }

/* Certify text */
.grad-certify-text {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.8rem;
  color: #5a3e20; font-style: italic; margin: 10px 0 4px;
}
.grad-student-name {
  font-family: 'Cinzel', serif; font-size: 1.5rem; font-weight: 700;
  color: #1a0f06; margin: 2px 0 8px; letter-spacing: 0.06em;
  border-bottom: 1px solid #c8963e44; padding-bottom: 8px;
  display: inline-block; min-width: 200px;
}

/* Achievement */
.grad-achievement {
  margin: 14px 0 16px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #c8963e11, #8a6a4011);
  border: 1px solid #c8963e44;
  border-radius: 4px;
}
.grad-achievement-title {
  font-family: 'Cinzel', serif; font-size: 0.95rem; font-weight: 700;
  color: #1a0f06; letter-spacing: 0.06em; margin-bottom: 4px;
}
.grad-achievement-sub {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.72rem;
  color: #7a5a30; font-style: italic;
}

/* Stats inside certificate */
.grad-stats {
  display: flex; justify-content: center; gap: 0;
  margin: 16px 0 4px; border: 1px solid #c8963e44; border-radius: 4px; overflow: hidden;
}
.grad-stat {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 12px 8px; border-right: 1px solid #c8963e33;
}
.grad-stat:last-child { border-right: none; }
.grad-stat-num {
  font-family: 'Cinzel', serif; font-size: 1.5rem; font-weight: 700;
  color: #c8963e; line-height: 1;
}
.grad-stat-label {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.6rem;
  color: #8a6a40; margin-top: 4px; font-style: italic;
}

/* Actions below certificate */
.grad-actions-below {
  width: 100%; max-width: 560px; margin-top: 28px; text-align: center;
  animation: gradFadeUp 0.8s 1.2s both;
}
.grad-cta-label {
  font-family: 'Cinzel', serif; font-size: 0.6rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: #8a7060; margin-bottom: 12px;
}
.grad-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 16px;
}
.grad-btn-reading, .grad-btn-quiz {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 8px; cursor: pointer;
  text-align: left; transition: all 0.2s; font-family: inherit;
  min-width: 150px;
}
.grad-btn-reading {
  background: var(--burgundy); border: 1px solid rgba(200,150,62,0.4); color: #fff;
}
.grad-btn-reading:hover { background: #7a1e2e; transform: translateY(-2px); }
.grad-btn-quiz {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(200,150,62,0.35); color: #d4c4a8;
}
.grad-btn-quiz:hover { background: rgba(200,150,62,0.14); transform: translateY(-2px); }
.grad-btn-icon { font-size: 1.3rem; flex-shrink: 0; }
.grad-btn-text { font-size: 0.78rem; line-height: 1.4; }
.grad-btn-text small { font-size: 0.65rem; opacity: 0.7; }
.grad-home-btn {
  font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 0.1em;
  color: #706050; background: none; border: none; cursor: pointer;
  padding: 8px; transition: color 0.2s;
}
.grad-home-btn:hover { color: #c8963e; }

@keyframes gradFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Day 10 hub inside lesson intro */
.day10-hub-label {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.82rem;
  color: #666; font-style: italic; text-align: center;
  margin-bottom: 14px; line-height: 1.6;
}
.day10-hub-btns {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 4px;
}
.day10-hub-btns .btn-secondary,
.day10-hub-btns .btn-primary {
  width: 100%; justify-content: center; font-size: 0.8rem;
}

/* Day 10 spread practice — Another Reading / Graduate buttons */
.sp-day10-actions {
  display: flex; gap: 12px; justify-content: center;
  flex-wrap: wrap; margin-top: 8px;
}

/* Reference section title */
.ref-section-title {
  font-family: 'Cinzel', serif; font-size: 0.9rem; font-weight: 700;
  color: #1a1a1a; letter-spacing: 0.06em; text-transform: uppercase;
  margin-bottom: 12px; margin-top: 8px;
  padding-bottom: 8px; border-bottom: 2px solid var(--parchment-deep);
}
.suit-card-numbers {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.73rem;
  color: #666; line-height: 1.65; margin-top: 8px;
  padding-top: 8px; border-top: 1px solid var(--parchment-deep);
}

/* ─── TOAST ─────────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--brown-deep); color: #fff;
  font-family: 'Cinzel', serif; font-size: 0.75rem; letter-spacing: 0.08em;
  padding: 11px 26px; border-radius: 4px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  opacity: 0; transition: all 0.3s; z-index: 999; pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── API KEY BANNER ────────────────────────────────────────── */
.api-banner {
  background: var(--miss-bg); border-bottom: 1px solid rgba(122,30,46,0.2);
  padding: 8px 20px; text-align: center;
  font-family: 'Cinzel', serif; font-size: 0.68rem; letter-spacing: 0.08em;
  color: var(--burgundy); display: none;
}
.api-banner.show { display: block; }
.api-banner a { color: var(--burgundy); text-decoration: underline; cursor: pointer; }


/* ─── AUTH OVERLAY ───────────────────────────────────── */
#authOverlay {
  position: fixed; inset: 0; background: rgba(10,5,2,0.88);
  z-index: 1000; display: none; align-items: center; justify-content: center;
  padding: 20px;
}
.auth-card {
  background: #fdfaf4; border: 1px solid #e0d4c0;
  border-radius: 12px; padding: 40px 36px; max-width: 440px; width: 100%;
  box-shadow: 0 24px 80px rgba(0,0,0,0.4);
}
.auth-logo {
  font-size: 2rem; color: var(--gold); text-align: center;
  margin-bottom: 12px;
}
.auth-title {
  font-family: 'Cinzel', serif; font-size: 1.2rem; font-weight: 700;
  color: #1a0f06; text-align: center; letter-spacing: 0.06em; margin-bottom: 6px;
}
.auth-sub {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.8rem;
  color: #888; text-align: center; line-height: 1.6; margin-bottom: 22px;
  font-style: italic;
}
.auth-google-btn {
  width: 100%; display: flex; align-items: center; justify-content: center;
  gap: 10px; padding: 12px; border-radius: 6px;
  border: 1px solid #d0c4b0; background: #fff; cursor: pointer;
  font-family: 'Cinzel', serif; font-size: 0.78rem; letter-spacing: 0.06em;
  color: #333; transition: all 0.2s; margin-bottom: 16px;
}
.auth-google-btn:hover { background: #f5f0e8; border-color: var(--gold); }
.auth-google-btn:disabled { opacity: 0.5; cursor: default; }
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: #e0d4c0;
}
.auth-divider span {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.72rem;
  color: #bbb; white-space: nowrap; font-style: italic;
}
.auth-field { margin-bottom: 16px; }
.auth-label {
  font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 0.14em;
  color: var(--burgundy); text-transform: uppercase; display: block; margin-bottom: 6px;
}
.auth-input {
  width: 100%; padding: 11px 14px; box-sizing: border-box;
  border: 1px solid #d0c4b0; border-radius: 5px; background: #fff;
  font-family: 'Merriweather', Georgia, serif; font-size: 0.9rem;
  color: #222; transition: border-color 0.2s;
}
.auth-input:focus { outline: none; border-color: var(--gold); }
.auth-error {
  color: var(--burgundy); font-size: 0.8rem; font-style: italic;
  margin-bottom: 8px; min-height: 18px; text-align: center;
}
.auth-switch {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.78rem;
  color: #888; text-align: center; margin-top: 14px; line-height: 1.6;
}
.auth-switch a {
  color: var(--burgundy); cursor: pointer; text-decoration: underline;
}
.auth-privacy {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.68rem;
  color: #bbb; text-align: center; margin-top: 12px; line-height: 1.6;
}

/* ─── STUDENT GREETING (welcome screen) ────────────────── */
#studentGreeting {
  font-family: 'Merriweather', Georgia, serif; font-size: 0.8rem;
  color: var(--brown-mid); display: none; white-space: nowrap;
  text-align: right; align-self: flex-start; padding-top: 4px; min-width: 160px;
}
.greeting-edit {
  font-family: 'Cinzel', serif; font-size: 0.6rem;
  letter-spacing: 0.12em; color: var(--gold);
  cursor: pointer; margin-left: 10px; text-transform: uppercase;
  transition: color 0.2s;
}
.greeting-edit:hover { color: var(--burgundy); }

/* ─── RESPONSIVE BREAKPOINTS ────────────────────────────── */

/* ── Tablet (≤ 900px) ─────────────────────────────────── */
@media (max-width: 900px) {
  .deck-intro-wrap { padding: 36px 32px; }
  .spread-wrap, .suits-wrap, .court-wrap, .sp-wrap,
  .quiz-wrap, .numeral-wrap, .ref-wrap { padding: 36px 24px; }
}

/* ── Mobile (≤ 768px) ─────────────────────────────────── */
@media (max-width: 768px) {

  /* Study screen: stack to single column */
  .study-layout {
    grid-template-columns: 1fr;
    display: flex; flex-direction: column;
  }
  .card-panel {
    position: static; height: auto;
    flex-direction: row; flex-wrap: wrap;
    justify-content: center; gap: 12px;
    padding: 20px 16px;
  }
  .card-img-wrap { width: 140px; }
  .card-prompt { display: none; }
  .input-panel { height: auto; padding: 20px 16px; }

  /* Reveal screen: stack to single column */
  .reveal-layout {
    grid-template-columns: 1fr;
    display: flex; flex-direction: column;
  }
  .reveal-left {
    position: static; height: auto;
    flex-direction: row; flex-wrap: wrap;
    justify-content: center; gap: 12px;
    padding: 20px 16px;
  }
  .reveal-left .card-img-wrap { width: 120px; }
  .reveal-content { height: auto; padding: 20px 16px; }

  /* Reveal block: stack columns */
  .reveal-block-body { grid-template-columns: 1fr; }
  .block-col:first-child { border-right: none; border-bottom: 1px solid var(--parchment-deep); }

  /* Lesson grid: 2 columns */
  .lesson-grid { grid-template-columns: repeat(2, 1fr); }

  /* Numerology grid: 2 columns */
  .numeral-grid { grid-template-columns: repeat(2, 1fr); }
  .numeral-cell.zero { grid-column: span 2; }

  /* Suits grid: 1 column */
  .suits-grid { grid-template-columns: 1fr; }

  /* Court rank grid: 1 column */
  .court-rank-grid { grid-template-columns: 1fr; }

  /* Spread practice: 1 column */
  .sp-cards-row { grid-template-columns: 1fr; }
  .sp-positions-row { grid-template-columns: 1fr; }

  /* Spread intro diagram */
  .spread-diagram { grid-template-columns: 1fr; }

  /* Spread variations table: hide on small screens */
  .spread-var-header, .spread-var-row { grid-template-columns: 1fr 1fr; }
  .spread-var-header span:nth-child(3),
  .spread-var-header span:nth-child(4),
  .spread-var-cell:nth-child(3),
  .spread-var-cell:nth-child(4) { display: none; }

  /* Suits table: simplified */
  .suits-table-header, .suits-table-row { grid-template-columns: 1.2fr 1fr 2fr; }
  .suits-table-header span:nth-child(4),
  .suits-table-header span:nth-child(5),
  .suits-table-cell:nth-child(4),
  .suits-table-cell:nth-child(5) { display: none; }

  /* Top bar: compress */
  .top-bar { padding: 8px 14px; gap: 8px; }
  .top-bar-title { font-size: 0.62rem; min-width: 80px; }
  .progress-dots { display: none; }

  /* Welcome screen */
  .tome-cover { padding: 16px; }
  .welcome-title { font-size: 1.2rem; }
  .welcome-subtitle { display: none; }
  .welcome-header { flex-direction: column; gap: 4px; }

  /* Lesson intro */
  .lesson-intro-card { padding: 28px 20px; }

  /* Quiz */
  .quiz-wrap { padding: 28px 16px; }
  .quiz-question-card { padding: 20px 16px; }

  /* Deck intro */
  .deck-intro-wrap { padding: 28px 16px; }
  .deck-diagram { flex-direction: column; }
  .deck-diagram-block.total,
  .deck-diagram-block.major,
  .deck-diagram-block.minor { flex: none; width: 100%; }
  .diag-equals { display: none; }

  /* Reference library */
  .ref-arcana-grid { grid-template-columns: repeat(2, 1fr); }

  /* General: bottom rows stack */
  .intro-bottom-row,
  .spread-bottom-row,
  .suits-bottom-row,
  .numeral-bottom-row,
  .court-bottom-row,
  .sp-nav-row,
  .reveal-next-row {
    flex-direction: column; gap: 14px; align-items: flex-start;
  }

  /* Onboarding overlay */
  .onboard-card { padding: 32px 24px; }

  /* General padding */
  .spread-wrap, .suits-wrap, .court-wrap, .sp-wrap,
  .quiz-wrap, .numeral-wrap { padding: 24px 16px; }
}

/* ── Small phones (≤ 420px) ───────────────────────────── */
@media (max-width: 420px) {
  .lesson-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .tile-label { font-size: 0.55rem; }
  .tile-day { font-size: 0.78rem; }
  .welcome-title { font-size: 1.2rem; }
  .numeral-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}


/* ─── MINOR ARCANA GROUP SCREEN (lesson flow) ─────────── */
.mg-wrap {
  max-width: 740px; margin: 0 auto; padding: 32px 24px 60px;
  font-family: 'Merriweather', Georgia, serif;
}
.mg-step-count {
  font-family: 'Cinzel', serif; font-size: 0.65rem; letter-spacing: 0.18em;
  color: var(--gold); text-transform: uppercase; margin-bottom: 18px;
}
.mg-heading-row {
  display: flex; align-items: baseline; gap: 14px; margin-bottom: 6px;
}
.mg-heading {
  font-family: 'Cinzel', serif; font-size: 1.5rem; font-weight: 700;
  color: var(--brown-deep); letter-spacing: 0.05em; margin: 0;
}
.mg-numeral {
  font-family: 'Cinzel', serif; font-size: 0.9rem; color: var(--gold);
  letter-spacing: 0.1em;
}
.mg-shared-box {
  background: linear-gradient(135deg, #fdf8f0, #f8f0e0);
  border: 1px solid var(--parchment-deep); border-left: 3px solid var(--gold);
  border-radius: 6px; padding: 16px 20px; margin: 20px 0 28px;
}
.mg-shared-label {
  font-family: 'Cinzel', serif; font-size: 0.62rem; letter-spacing: 0.14em;
  color: var(--gold); text-transform: uppercase; margin-bottom: 8px;
}
.mg-shared-text {
  font-size: 0.9rem; color: #3a2a1a; line-height: 1.75; font-style: italic;
}
.mg-suit-grid {
  display: grid; gap: 16px;
}
.mg-suit-row {
  background: #fdfaf4; border: 1px solid #e8dcc8; border-radius: 8px;
  padding: 18px 20px;
}
.mg-suit-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.mg-suit-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.mg-suit-name {
  font-family: 'Cinzel', serif; font-size: 0.8rem; font-weight: 700;
  color: var(--brown-deep); letter-spacing: 0.06em;
}
.mg-suit-element {
  font-size: 0.72rem; color: #888; margin-left: auto;
}
.mg-card-title {
  font-family: 'Cinzel', serif; font-size: 0.78rem; color: var(--burgundy);
  letter-spacing: 0.04em; margin-bottom: 4px;
}
.mg-keywords {
  font-size: 0.75rem; color: var(--burgundy); font-style: italic;
  margin-bottom: 8px; opacity: 0.8;
}
.mg-meaning {
  font-size: 0.85rem; color: #3a2a1a; line-height: 1.7;
}
.mg-actions {
  margin-top: 36px; text-align: center;
}

@media (min-width: 600px) {
  .mg-suit-grid { grid-template-columns: 1fr 1fr; }
}
