/* ==========================================================================
   THAYER-TAROT ONLINE • ESTILOS GENERALES Y ATMÓSFERA MÍSTICA
   Inspirado en GraficaThayertarot y ejemplo-interfaz-ThayerTarot.png
   ========================================================================== */

:root {
  --bg-dark: #090b14;
  --bg-navy: #101528;
  --bg-panel: rgba(16, 21, 40, 0.82);
  --bg-panel-solid: #12182e;
  
  --gold-primary: #dfbb60;
  --gold-light: #f7e096;
  --gold-dark: #a88330;
  --gold-glow: rgba(223, 187, 96, 0.4);
  
  --celestial-blue: #61b5ff;
  --celestial-glow: rgba(97, 181, 255, 0.3);
  
  --text-primary: #f5f2eb;
  --text-secondary: #c9c3b4;
  --text-muted: #8b8f9f;
  
  --border-gold: rgba(223, 187, 96, 0.3);
  --border-subtle: rgba(255, 255, 255, 0.08);
  
  --font-serif-display: 'Cinzel', 'Baskerville', 'Georgia', serif;
  --font-serif-reading: 'Cormorant Garamond', 'Georgia', serif;
  --font-sans: 'Montserrat', system-ui, -apple-system, sans-serif;
  
  --card-size-desktop: 440px;
  --header-height: 64px;
  --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 20%, #151b36 0%, #0c0f1e 45%, #070911 100%);
}

/* Ambient cosmic stars */
.stars-canvas-wrapper {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: 
    radial-gradient(1.5px 1.5px at 15% 25%, rgba(255,255,255,0.7) 100%, transparent),
    radial-gradient(1px 1px at 30% 70%, rgba(223,187,96,0.6) 100%, transparent),
    radial-gradient(2px 2px at 75% 15%, rgba(255,255,255,0.8) 100%, transparent),
    radial-gradient(1px 1px at 85% 65%, rgba(97,181,255,0.7) 100%, transparent),
    radial-gradient(1.5px 1.5px at 50% 85%, rgba(223,187,96,0.5) 100%, transparent),
    radial-gradient(1px 1px at 60% 35%, rgba(255,255,255,0.5) 100%, transparent),
    radial-gradient(1.5px 1.5px at 92% 40%, rgba(223,187,96,0.6) 100%, transparent),
    radial-gradient(1px 1px at 8% 80%, rgba(255,255,255,0.6) 100%, transparent);
  background-size: 550px 550px;
  opacity: 0.8;
}

/* Candle glow highlights inspired by GraficaThayertarot */
.candle-glow {
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.18;
  z-index: 0;
}
.candle-glow.glow-left {
  top: 10%;
  left: -80px;
  background: radial-gradient(circle, #df9b52 0%, transparent 70%);
}
.candle-glow.glow-right {
  bottom: 5%;
  right: -80px;
  background: radial-gradient(circle, #5b87f5 0%, transparent 70%);
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-height);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 13, 24, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-gold);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-symbol {
  color: var(--gold-primary);
  font-size: 1.4rem;
  animation: pulseSymbol 4s ease-in-out infinite;
}

@keyframes pulseSymbol {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); filter: drop-shadow(0 0 6px var(--gold-primary)); }
}

.brand-text h1 {
  font-family: var(--font-serif-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--gold-light);
  text-shadow: 0 1px 8px rgba(0,0,0,0.8);
}

.brand-sub {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  border-radius: 20px;
  padding: 0.4rem 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.header-btn:hover {
  background: rgba(223, 187, 96, 0.18);
  border-color: var(--gold-light);
  transform: translateY(-1px);
}

.icon-btn {
  border-radius: 50%;
  width: 38px;
  height: 38px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   APP MAIN & VIEWS
   ========================================================================== */
.app-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
}

.app-view {
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease;
  width: 100%;
}

.app-view.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
  animation: fadeInView 0.5s ease forwards;
}

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

/* ==========================================================================
   VIEW 1: VIRTUAL DECK & SHUFFLE TABLE
   ========================================================================== */
#tableSection {
  min-height: calc(100vh - var(--header-height));
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.table-content {
  max-width: 680px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2rem;
}

.cosmic-badge {
  display: inline-block;
  font-family: var(--font-serif-display);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: var(--gold-primary);
  border: 1px solid var(--border-gold);
  padding: 0.3rem 0.85rem;
  border-radius: 30px;
  background: rgba(223, 187, 96, 0.08);
  margin-bottom: 0.8rem;
}

.mystic-title {
  font-family: var(--font-serif-display);
  font-size: 2.2rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

.mystic-desc {
  font-family: var(--font-serif-reading);
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
}

/* Circular Deck Staging */
.deck-stage {
  position: relative;
  width: 360px;
  height: 360px;
  margin: 1rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.deck-altar-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-glow) 0%, rgba(97, 181, 255, 0.15) 50%, transparent 70%);
  filter: blur(25px);
  pointer-events: none;
  animation: altarBreathe 5s ease-in-out infinite alternate;
}

@keyframes altarBreathe {
  0% { transform: scale(0.9); opacity: 0.4; }
  100% { transform: scale(1.1); opacity: 0.75; }
}

.deck-wrapper {
  position: relative;
  width: 310px;
  height: 310px;
  cursor: pointer;
  perspective: 1000px;
  transition: transform 0.3s ease;
}

.deck-wrapper:hover {
  transform: scale(1.03);
}

.deck-card {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #182245;
  border: 2px solid rgba(223, 187, 96, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  transition: transform 0.4s ease;
}

.deck-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

/* 3D Depth Layers */
.card-depth-3 { transform: translateY(12px) scale(0.96); opacity: 0.5; border-color: rgba(97, 181, 255, 0.2); }
.card-depth-2 { transform: translateY(8px) scale(0.98); opacity: 0.7; }
.card-depth-1 { transform: translateY(4px) scale(0.99); opacity: 0.9; }

.top-card {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 20px rgba(223, 187, 96, 0.3);
  border: 2px solid var(--gold-primary);
}

.shimmer-ring {
  position: absolute;
  inset: -100%;
  background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.3) 50%, transparent 60%);
  animation: shimmerSweep 4s infinite;
  pointer-events: none;
}

@keyframes shimmerSweep {
  0% { transform: translateX(-100%) translateY(-100%); }
  100% { transform: translateX(100%) translateY(100%); }
}

/* Left and right packets for shuffle animation */
.deck-split-left, .deck-split-right {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  border: 2px solid var(--gold-primary);
  box-shadow: 0 8px 25px rgba(0,0,0,0.6);
}

/* ==========================================================================
   SHUFFLE ANIMATIONS (3 distinct steps)
   ========================================================================== */
/* Step 1: Split Left/Right */
.shuffling-step-1 .deck-split-left {
  opacity: 1;
  animation: shuffleSplitLeft 0.75s ease-in-out;
}
.shuffling-step-1 .deck-split-right {
  opacity: 1;
  animation: shuffleSplitRight 0.75s ease-in-out;
}
.shuffling-step-1 .top-card {
  opacity: 0;
}

@keyframes shuffleSplitLeft {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-75px, -15px) rotate(-18deg) scale(0.95); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
@keyframes shuffleSplitRight {
  0% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(75px, 15px) rotate(18deg) scale(0.95); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

/* Step 2: Up/Down Cross Riffle */
.shuffling-step-2 .deck-split-left {
  opacity: 1;
  animation: shuffleRiffleTop 0.75s ease-in-out;
}
.shuffling-step-2 .deck-split-right {
  opacity: 1;
  animation: shuffleRiffleBottom 0.75s ease-in-out;
}
.shuffling-step-2 .top-card {
  opacity: 0;
}

@keyframes shuffleRiffleTop {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-45px, -55px) rotate(-12deg) scale(1.03); }
  100% { transform: translate(0, 0) scale(1); }
}
@keyframes shuffleRiffleBottom {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(45px, 55px) rotate(12deg) scale(0.95); }
  100% { transform: translate(0, 0) scale(1); }
}

/* Step 3: Mystical Cosmic Spin & Settle */
.shuffling-step-3 .top-card {
  animation: shuffleSpinGather 0.85s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes shuffleSpinGather {
  0% { transform: scale(1) rotate(0deg); }
  40% { transform: scale(1.12) rotate(180deg); box-shadow: 0 0 45px var(--gold-primary); }
  100% { transform: scale(1) rotate(360deg); }
}

/* Draw lift-off animation when selected */
.card-drawing-reveal {
  animation: cardLiftReveal 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardLiftReveal {
  0% { transform: scale(1) translateY(0); opacity: 1; }
  50% { transform: scale(1.25) translateY(-40px) rotateY(90deg); opacity: 0.9; }
  100% { transform: scale(1.4) translateY(-80px) rotateY(180deg); opacity: 0; }
}

/* Shuffle Status Banner */
.shuffle-banner {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.shuffle-steps-dots {
  display: flex;
  gap: 0.6rem;
}

.step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid var(--border-gold);
  transition: var(--transition-smooth);
}

.step-dot.active {
  background: var(--gold-primary);
  box-shadow: 0 0 10px var(--gold-primary);
  transform: scale(1.3);
}

.shuffle-msg {
  font-family: var(--font-serif-display);
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  min-height: 1.4rem;
}

/* Action Button */
.magic-btn {
  background: linear-gradient(135deg, #dfbb60 0%, #a88330 100%);
  border: none;
  color: #0c0f1c;
  font-family: var(--font-serif-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 1rem 2.4rem;
  border-radius: 40px;
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(223, 187, 96, 0.35), 0 0 12px rgba(223, 187, 96, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition-smooth);
}

.magic-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 36px rgba(223, 187, 96, 0.5), 0 0 20px rgba(223, 187, 96, 0.4);
}

.magic-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.actions-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  letter-spacing: 0.04em;
}

/* ==========================================================================
   VIEW 2: SINGLE SCREEN READING (Layout inspirado en ejemplo-interfaz)
   ========================================================================== */
#readingSection {
  flex: 1;
  height: calc(100vh - var(--header-height));
  display: none;
}

#readingSection.active {
  display: flex;
}

.reading-split-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  height: 100%;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 2.5rem;
  gap: 2.5rem;
  align-items: center;
}

/* --- LEFT PANE: EDITORIAL BOOK TEXT --- */
.reading-left-pane {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.reading-left-pane .pane-inner {
  height: 100%;
  max-height: calc(100vh - var(--header-height) - 3rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.card-classification {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}

.cat-pill {
  font-family: var(--font-serif-display);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  border: 1px solid var(--border-gold);
}
.cat-pill.mayor {
  background: rgba(223, 187, 96, 0.12);
  color: var(--gold-light);
}
.cat-pill.menor {
  background: rgba(97, 181, 255, 0.12);
  border-color: rgba(97, 181, 255, 0.35);
  color: var(--celestial-blue);
}
.cat-pill.elem {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.mobile-only-title {
  display: none;
  font-family: var(--font-serif-display);
  font-size: 1.5rem;
  color: var(--gold-light);
  margin: 0.5rem 0;
}

.book-editorial-card {
  flex: 1;
  min-height: 0; /* Important for inner flex scroll */
  background: rgba(14, 18, 34, 0.75);
  border: 1px solid rgba(223, 187, 96, 0.22);
  border-radius: 16px;
  padding: 1.6rem 2rem;
  backdrop-filter: blur(16px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.text-scroll-box {
  flex: 1;
  overflow-y: auto;
  padding-right: 1rem;
}

/* Elegant Custom Scrollbar */
.text-scroll-box::-webkit-scrollbar {
  width: 6px;
}
.text-scroll-box::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}
.text-scroll-box::-webkit-scrollbar-thumb {
  background: rgba(223, 187, 96, 0.35);
  border-radius: 4px;
}
.text-scroll-box::-webkit-scrollbar-thumb:hover {
  background: var(--gold-primary);
}

.editorial-body {
  font-family: var(--font-serif-reading);
  font-size: 1.28rem;
  line-height: 1.72;
  color: #ede7dc;
  text-align: justify;
  letter-spacing: 0.015em;
}

.editorial-body p {
  margin-bottom: 1.25rem;
}

.editorial-body p:first-of-type::first-letter {
  font-family: var(--font-serif-display);
  font-size: 2.8rem;
  float: left;
  line-height: 0.85;
  margin-right: 0.6rem;
  color: var(--gold-light);
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(223, 187, 96, 0.3);
}

.editorial-footer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(223, 187, 96, 0.2);
  text-align: center;
}

.editorial-footer .flourish {
  color: var(--gold-primary);
  letter-spacing: 0.4em;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

.source-credit {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.author-credit {
  font-family: var(--font-serif-display);
  font-size: 0.95rem;
  color: var(--gold-light);
  margin-top: 0.25rem;
  letter-spacing: 0.06em;
}

.reading-toolbar {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
}

.tool-btn {
  font-family: var(--font-serif-display);
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  padding: 0.75rem 1.4rem;
  border-radius: 30px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-smooth);
}

.primary-tool {
  background: linear-gradient(135deg, #dfbb60 0%, #a88330 100%);
  border: none;
  color: #0c0f1c;
  font-weight: 700;
  box-shadow: 0 4px 18px rgba(223, 187, 96, 0.3);
}
.primary-tool:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(223, 187, 96, 0.45);
}

.secondary-tool {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
}
.secondary-tool:hover {
  background: rgba(223, 187, 96, 0.15);
  border-color: var(--gold-light);
  color: var(--gold-light);
}

/* --- RIGHT PANE: CARD ARTWORK IN LARGE CIRCULAR FORMAT --- */
.reading-right-pane {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.reading-right-pane .pane-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
}

.card-display-header {
  text-align: center;
}

.desktop-card-name {
  font-family: var(--font-serif-display);
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.card-roman-sub {
  font-family: var(--font-serif-reading);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--gold-light);
  margin-top: 0.2rem;
}

/* Circular Card Frame */
.card-showcase-stage {
  position: relative;
  width: min(var(--card-size-desktop), 65vh);
  height: min(var(--card-size-desktop), 65vh);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mandala-glow {
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-glow) 30%, var(--celestial-glow) 70%, transparent 80%);
  filter: blur(28px);
  pointer-events: none;
  animation: glowPulse 4s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  0% { opacity: 0.45; transform: scale(0.96); }
  100% { opacity: 0.85; transform: scale(1.04); }
}

.circular-card-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--gold-primary);
  box-shadow: 
    0 15px 45px rgba(0, 0, 0, 0.8),
    0 0 25px rgba(223, 187, 96, 0.35),
    inset 0 0 20px rgba(0, 0, 0, 0.4);
  cursor: zoom-in;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  background: #111629;
}

.circular-card-frame:hover {
  transform: scale(1.03);
}

.circular-card-frame:hover .magnify-badge {
  opacity: 1;
  transform: translateY(0);
}

.card-image-content {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.card-shine-effect {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 45%, rgba(0,0,0,0.2) 100%);
  pointer-events: none;
}

.magnify-badge {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(12, 16, 32, 0.85);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: var(--transition-smooth);
  pointer-events: none;
}

.card-meta-details {
  display: flex;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.meta-tag-item .meta-lbl {
  color: var(--text-muted);
  margin-right: 0.3rem;
}
.meta-tag-item .meta-val {
  color: var(--gold-light);
  font-weight: 500;
}

/* ==========================================================================
   LIGHTBOX MODAL
   ========================================================================== */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox-modal.active {
  display: flex;
  animation: fadeInModal 0.3s ease forwards;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 15, 0.92);
  backdrop-filter: blur(12px);
}

.lightbox-dialog {
  position: relative;
  z-index: 10;
  max-width: 680px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1.25rem;
}

.lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.8rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.lightbox-close:hover {
  color: var(--gold-primary);
  transform: scale(1.15);
}

.lightbox-circle-wrapper {
  width: min(520px, 75vh);
  height: min(520px, 75vh);
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--gold-primary);
  box-shadow: 0 0 50px rgba(223, 187, 96, 0.4), 0 20px 60px rgba(0,0,0,0.9);
  background: #0e1224;
}

.lightbox-card-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.lightbox-title {
  font-family: var(--font-serif-display);
  font-size: 1.4rem;
  color: var(--gold-light);
  letter-spacing: 0.1em;
}

.lightbox-desc {
  font-family: var(--font-serif-reading);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--text-secondary);
}

.lightbox-zoom-note {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ==========================================================================
   GALLERY / EXPLORER DRAWER
   ========================================================================== */
.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  justify-content: flex-end;
}

.gallery-modal.active {
  display: flex;
  animation: fadeInModal 0.3s ease;
}

.gallery-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
}

.gallery-drawer {
  position: relative;
  z-index: 10;
  width: min(720px, 100vw);
  height: 100%;
  background: var(--bg-panel-solid);
  border-left: 1px solid var(--border-gold);
  display: flex;
  flex-direction: column;
  padding: 1.8rem;
  box-shadow: -15px 0 40px rgba(0, 0, 0, 0.8);
  animation: slideInDrawer 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInDrawer {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.gallery-heading h3 {
  font-family: var(--font-serif-display);
  font-size: 1.3rem;
  color: var(--gold-light);
  letter-spacing: 0.08em;
}
.gallery-heading p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.gallery-close {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.6rem;
  cursor: pointer;
}

.gallery-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.filter-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.filter-tab.active, .filter-tab:hover {
  background: rgba(223, 187, 96, 0.18);
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.gallery-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
  padding-right: 0.5rem;
}

.gallery-card-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.85rem 0.5rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.gallery-card-item:hover {
  background: rgba(223, 187, 96, 0.12);
  border-color: var(--gold-primary);
  transform: translateY(-3px);
}

.gallery-thumb-circle {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold-primary);
  margin-bottom: 0.6rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.gallery-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-card-title {
  font-family: var(--font-serif-display);
  font-size: 0.76rem;
  color: var(--text-primary);
  line-height: 1.3;
}
.gallery-card-type {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Toast */
.toast-msg {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #192242;
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  font-family: var(--font-serif-display);
  font-size: 0.88rem;
  padding: 0.7rem 1.6rem;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.7);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
  z-index: 200;
  pointer-events: none;
}
.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ==========================================================================
   RESPONSIVE DESIGN (TABLETS & MOBILE)
   ========================================================================== */
@media (max-width: 1024px) {
  #readingSection {
    height: auto !important;
    min-height: calc(100vh - var(--header-height));
    overflow-y: auto !important;
  }

  #readingSection.active {
    display: block !important;
  }

  .reading-split-layout {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: auto !important;
    padding: 1.25rem 1rem 3.5rem 1rem !important;
    gap: 1.75rem !important;
  }

  .reading-right-pane {
    order: 1 !important; /* Top */
    height: auto !important;
    margin-bottom: 0.5rem;
  }

  .reading-left-pane {
    order: 2 !important; /* Below card */
    height: auto !important;
    overflow: visible !important;
  }

  .reading-left-pane .pane-inner {
    max-height: none !important;
    height: auto !important;
    gap: 1.25rem !important;
  }

  .desktop-card-name {
    display: none !important;
  }

  .card-classification {
    justify-content: center !important;
    flex-wrap: wrap;
  }

  .mobile-only-title {
    display: block !important;
    text-align: center;
    margin: 0.5rem auto 1rem auto;
    font-size: clamp(1rem, 4.8vw, 1.35rem) !important;
    letter-spacing: 0.04em !important;
    line-height: 1.35 !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    max-width: 90% !important;
  }

  .card-showcase-stage {
    width: min(280px, 70vw) !important;
    height: min(280px, 70vw) !important;
  }

  .book-editorial-card {
    height: auto !important;
    max-height: none !important;
    padding: 1.25rem !important;
    overflow: visible !important;
  }

  .text-scroll-box {
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }

  .editorial-body {
    font-size: 1.12rem !important;
    line-height: 1.65 !important;
  }

  .editorial-body p:first-of-type::first-letter {
    font-size: 2.2rem !important;
  }

  .reading-toolbar {
    justify-content: center !important;
    margin-top: 0.5rem;
  }

  .tool-btn {
    flex: 1 1 calc(50% - 0.5rem);
    justify-content: center;
  }

  .tool-btn.primary-tool {
    flex: 1 1 100%;
  }

  .site-header {
    padding: 0 0.85rem;
  }
  
  .brand-text h1 {
    font-size: 0.9rem;
  }

  .brand-sub {
    font-size: 0.65rem;
  }

  .mystic-title {
    font-size: clamp(1.4rem, 6vw, 2rem) !important;
  }

  .mystic-desc {
    font-size: 1.05rem !important;
    padding: 0 0.5rem;
  }

  .deck-stage {
    width: min(320px, 86vw) !important;
    height: min(320px, 86vw) !important;
  }

  .deck-altar-glow {
    width: min(350px, 92vw) !important;
    height: min(350px, 92vw) !important;
  }

  .deck-wrapper {
    width: min(270px, 76vw) !important;
    height: min(270px, 76vw) !important;
  }

  .table-content {
    padding: 0 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .magic-btn {
    font-size: clamp(0.82rem, 3.6vw, 1rem) !important;
    padding: 0.85rem 1.3rem !important;
    max-width: 92vw;
    letter-spacing: 0.08em !important;
    gap: 0.4rem !important;
  }

}

/* ==========================================================================
   EXPLICITLY HIDDEN PER USER SPECIFICATION (FIRST INDEX)
   ========================================================================== */
#copyReadingBtn {
  display: none !important;
}

#deckListBtn {
  display: none !important;
}
