/* ==========================================================================
   MYSTICAL TAROT & KATINA SPREAD APPLICATION - STYLESHEET (V5)
   Aesthetics: Deep Velvet Cosmic Theme, Gold Foil Accents, 3D Realistic Transforms
   Includes: Landing Gate, 3-Mode Selection Hub, 3x3 Altar, Fast Oracle & Astrological Horary Sky Chart
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700;800;900&family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  /* Color Palette */
  --bg-cosmic: #07060d;
  --bg-table: radial-gradient(circle at 50% 25%, #18122c 0%, #0c0916 65%, #05040a 100%);
  --bg-card-front: #141024;
  --bg-card-back: #100b1e;
  --bg-glass: rgba(22, 17, 39, 0.85);
  --bg-glass-strong: rgba(26, 20, 48, 0.98);
  --bg-modal: #120e24;

  /* Gold & Accents */
  --gold-primary: #f59e0b;
  --gold-light: #fef08a;
  --gold-dark: #b45309;
  --gold-gradient: linear-gradient(135deg, #fef08a 0%, #d97706 50%, #fef08a 100%);
  --gold-glow: 0 0 25px rgba(245, 158, 11, 0.35);

  /* Element Colors */
  --el-fire: #ef4444;
  --el-water: #10b981;
  --el-earth: #d97706;
  --el-air: #0284c7;
  --el-spirit: #a855f7;

  /* Typography */
  --font-serif: 'Cinzel', 'Playfair Display', Georgia, serif;
  --font-reading: 'Playfair Display', Georgia, serif;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  /* Card Dimensions */
  --card-width: 172px;
  --card-height: 264px;
  --grid-gap: 1.25rem;
  --radius-card: 14px;

  /* Transitions */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.25, 1, 0.5, 1);
}

@media (min-width: 1600px) {
  :root {
    --card-width: 188px;
    --card-height: 288px;
    --grid-gap: 1.5rem;
  }
}

@media (max-width: 1200px) {
  :root {
    --card-width: 142px;
    --card-height: 218px;
    --grid-gap: 0.9rem;
  }
}

@media (max-width: 768px) {
  :root {
    --card-width: 102px;
    --card-height: 156px;
    --grid-gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  :root {
    --card-width: 92px;
    --card-height: 142px;
    --grid-gap: 0.4rem;
  }
}

/* Base Reset & Layout */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-cosmic);
  background-image: var(--bg-table);
  color: #e5e7eb;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Background Stars */
.cosmic-stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  background-image: 
    radial-gradient(1px 1px at 30px 40px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 120px 180px, #fde047, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 240px 90px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 350px 400px, #f59e0b, rgba(0,0,0,0)),
    radial-gradient(1.5px 1.5px at 550px 140px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 750px 320px, #38bdf8, rgba(0,0,0,0)),
    radial-gradient(1px 1px at 950px 110px, #ffffff, rgba(0,0,0,0)),
    radial-gradient(2px 2px at 1150px 450px, #fde047, rgba(0,0,0,0));
  background-repeat: repeat;
  background-size: 1400px 700px;
  opacity: 0.45;
}

/* ==========================================================================
   1. LANDING PAGE & GATEKEEPER PORTAL
   ========================================================================== */

.landing-portal-wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 10;
}

.portal-card-container {
  width: 100%;
  max-width: 540px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

.portal-brand-badge {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.portal-sigil-icon {
  font-size: 3.5rem;
  filter: drop-shadow(0 0 20px rgba(245, 158, 11, 0.7));
  margin-bottom: 0.5rem;
  animation: pulseSigil 3s ease-in-out infinite alternate;
}

@keyframes pulseSigil {
  0% { transform: scale(1); filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.5)); }
  100% { transform: scale(1.06); filter: drop-shadow(0 0 30px rgba(254, 240, 138, 0.9)); }
}

.portal-title {
  font-family: var(--font-serif);
  font-size: 2.35rem;
  font-weight: 900;
  letter-spacing: 4px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.portal-tagline {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  letter-spacing: 2px;
  color: #d1d5db;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.portal-features-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.feature-tag {
  background: rgba(22, 17, 38, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 20px;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.portal-auth-box {
  width: 100%;
  background: var(--bg-glass-strong);
  border: 1.5px solid rgba(245, 158, 11, 0.35);
  border-radius: 24px;
  padding: 2.25rem 2rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), var(--gold-glow);
  backdrop-filter: blur(20px);
}

.auth-box-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.lock-icon {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 0.35rem;
}

.auth-box-header h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gold-light);
  letter-spacing: 1px;
}

.auth-box-header p {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-top: 0.25rem;
}

.login-form-fields {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.login-error-banner {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--el-fire);
  color: #fca5a5;
  padding: 0.65rem 0.95rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: shakeAnim 0.4s ease-in-out;
}

@keyframes shakeAnim {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.input-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #d1d5db;
  letter-spacing: 0.5px;
}

.input-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  font-size: 1.1rem;
  pointer-events: none;
  opacity: 0.7;
}

.input-field-wrapper input,
.input-field-wrapper select {
  width: 100%;
  background: rgba(14, 10, 24, 0.85);
  border: 1.5px solid rgba(245, 158, 11, 0.28);
  border-radius: 14px;
  padding: 0.85rem 1rem 0.85rem 2.85rem;
  color: #f3f4f6;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all 0.25s ease;
  outline: none;
}

.input-field-wrapper input:focus,
.input-field-wrapper select:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.4);
  background: rgba(22, 16, 38, 0.95);
}

.login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #9ca3af;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.remember-label input {
  accent-color: var(--gold-primary);
  width: 16px;
  height: 16px;
}

.btn-portal-submit {
  background: var(--gold-gradient);
  color: #0c0817;
  border: none;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  padding: 0.95rem;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s var(--ease-smooth);
  margin-top: 0.5rem;
}

.btn-portal-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.7);
  filter: brightness(1.08);
}

.portal-footer-notice {
  text-align: center;
  font-size: 0.76rem;
  color: #6b7280;
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   2. MODE SELECTION HUB (3 DISTINCT MODES)
   ========================================================================== */

.mode-selection-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  position: relative;
  z-index: 10;
}

.hub-container {
  width: 100%;
  max-width: 1180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

.hub-header {
  text-align: center;
}

.hub-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.6));
}

.hub-title {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: 2px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.hub-greeting {
  font-size: 1.05rem;
  color: #d1d5db;
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.5;
}

.hub-greeting strong {
  color: var(--gold-light);
}

.mode-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  width: 100%;
}

@media (max-width: 960px) {
  .mode-cards-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.mode-card {
  background: var(--bg-glass-strong);
  border: 1.5px solid rgba(245, 158, 11, 0.3);
  border-radius: 24px;
  padding: 2.25rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  cursor: pointer;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  transition: all 0.35s var(--ease-spring);
}

.mode-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--gold-primary);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), var(--gold-glow);
}

.mode-card-badge {
  position: absolute;
  top: -12px;
  background: var(--gold-gradient);
  color: #120d1e;
  font-family: var(--font-serif);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  padding: 0.25rem 0.85rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.mode-card-badge.quick-badge {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.4);
}

.mode-card-badge.astro-badge {
  background: linear-gradient(135deg, #c084fc 0%, #7e22ce 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(126, 34, 206, 0.4);
}

.mode-card-icon {
  font-size: 3.25rem;
  margin-bottom: 0.85rem;
  filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.5));
}

.mode-card-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
  letter-spacing: 1px;
}

.mode-card-desc {
  font-size: 0.88rem;
  color: #9ca3af;
  line-height: 1.55;
  margin-bottom: 1.5rem;
  flex: 1;
}

.mode-card-tags {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.mode-card-tags span {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--gold-light);
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
  font-size: 0.76rem;
  font-weight: 600;
}

.btn-mode-select {
  width: 100%;
  background: var(--gold-gradient);
  color: #100b1e;
  border: none;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0.85rem;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.25s ease;
}

.btn-mode-select:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-mode-select.quick-btn {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
}

.btn-mode-select.astro-btn {
  background: linear-gradient(135deg, #c084fc 0%, #7e22ce 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(126, 34, 206, 0.35);
}

/* ==========================================================================
   3. APP HEADER & MODE SWITCHER
   ========================================================================== */

.main-app-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.75rem;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  gap: 1rem;
}

@media (max-width: 980px) {
  .app-header {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-symbol {
  font-size: 1.75rem;
  filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.6));
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 2px;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.brand-subtitle {
  font-size: 0.68rem;
  letter-spacing: 1.2px;
  color: #9ca3af;
  text-transform: uppercase;
}

/* Mode Switcher Buttons in Center */
.nav-mode-switcher {
  display: flex;
  background: rgba(10, 8, 18, 0.9);
  padding: 4px;
  border-radius: 25px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  flex-wrap: wrap;
}

.nav-mode-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-family: var(--font-serif);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 0.45rem 0.9rem;
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-mode-btn:hover {
  color: var(--gold-light);
}

.nav-mode-btn.active {
  background: var(--gold-gradient);
  color: #120d1e;
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.45);
}

.nav-hub-btn {
  border-left: 1px solid rgba(245, 158, 11, 0.2) !important;
  border-radius: 0 18px 18px 0 !important;
}

.nav-hub-btn:hover {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-light);
}

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

.user-greeting-badge {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  padding: 0.35rem 0.75rem;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.icon-btn {
  background: rgba(20, 16, 36, 0.8);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #d1d5db;
  padding: 0.45rem 0.8rem;
  border-radius: 18px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  border-color: var(--gold-primary);
  color: var(--gold-light);
  background: rgba(30, 24, 52, 0.9);
}

.icon-btn.active {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.btn-logout {
  border-color: rgba(239, 68, 68, 0.4) !important;
  color: #fca5a5 !important;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: var(--el-fire) !important;
  color: #fff !important;
}

/* Sub-deck Tabs Bar (3x3 Spread only) */
.sub-deck-bar {
  display: flex;
  justify-content: center;
  padding-top: 1rem;
}

.deck-switcher-tabs {
  display: flex;
  background: rgba(10, 8, 18, 0.85);
  padding: 4px;
  border-radius: 30px;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.deck-tab-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  font-family: var(--font-serif);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 0.45rem 1.15rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s var(--ease-smooth);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.deck-tab-btn:hover {
  color: var(--gold-light);
}

.deck-tab-btn.active {
  background: var(--gold-gradient);
  color: #120d1e;
  box-shadow: 0 2px 14px rgba(245, 158, 11, 0.45);
}

/* ==========================================================================
   4. 3x3 SPREAD READING ROOM
   ========================================================================== */

.active-view-container {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.reading-room-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.25rem 1.5rem 6.5rem 1.5rem;
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.altar-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.spread-title {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--gold-light);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.35);
}

.spread-instructions {
  font-size: 0.92rem;
  color: #a1a1aa;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.45;
}

.altar-main-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  width: 100%;
}

.deck-sidebar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

@media (max-width: 1024px) {
  .deck-sidebar {
    display: none;
  }
}

.deck-stack-visual {
  width: var(--card-width);
  height: var(--card-height);
  position: relative;
  cursor: pointer;
}

.deck-stack-card {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.95), 0 0 18px rgba(245, 158, 11, 0.35);
  border: 1.2px solid rgba(245, 158, 11, 0.45);
  background: var(--bg-card-back);
  transition: transform 0.3s ease;
}

.deck-stack-card svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.deck-stack-card:nth-child(1) { transform: translate(-6px, -6px); }
.deck-stack-card:nth-child(2) { transform: translate(-3px, -3px); }
.deck-stack-card:nth-child(3) { transform: translate(0, 0); }

.deck-counter-badge {
  font-family: var(--font-serif);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-light);
  background: rgba(18, 14, 30, 0.95);
  padding: 0.35rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  text-align: center;
}

.altar-table-box {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: rgba(15, 11, 26, 0.6);
  border: 1.5px solid rgba(245, 158, 11, 0.22);
  border-radius: 24px;
  padding: 1.5rem 1.75rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85), inset 0 0 40px rgba(22, 17, 38, 0.7);
}

.table-col-headers {
  display: flex;
  align-items: center;
  gap: var(--grid-gap);
  padding-bottom: 0.25rem;
}

.guide-header-spacer {
  width: 110px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .guide-header-spacer {
    display: none;
  }
}

.col-guide-badge {
  width: var(--card-width);
  background: rgba(22, 17, 38, 0.8);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
  padding: 0.35rem 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
}

.guide-num {
  font-family: var(--font-serif);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.guide-text {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: #f3f4f6;
  white-space: nowrap;
}

.table-rows-container {
  display: flex;
  flex-direction: column;
  gap: var(--grid-gap);
}

.table-row-group {
  display: flex;
  align-items: center;
  gap: var(--grid-gap);
}

.row-guide-badge {
  width: 110px;
  height: var(--card-height);
  background: rgba(22, 17, 38, 0.8);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem;
  text-align: center;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .row-guide-badge {
    display: none;
  }
}

.row-badge-title {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: var(--gold-light);
  text-transform: uppercase;
}

.row-badge-sub {
  font-size: 0.72rem;
  color: #9ca3af;
  line-height: 1.2;
}

.row-slots-trio {
  display: flex;
  gap: var(--grid-gap);
}

.grid-slot {
  width: var(--card-width);
  height: var(--card-height);
  border-radius: var(--radius-card);
  border: 1.5px dashed rgba(245, 158, 11, 0.28);
  background: rgba(16, 12, 28, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  perspective: 1200px;
  transition: all 0.3s ease;
}

.grid-slot.has-card {
  border-color: transparent;
  background: transparent;
}

.slot-center-special {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.05);
}

.slot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem;
  text-align: center;
  color: rgba(245, 158, 11, 0.5);
  pointer-events: none;
  user-select: none;
}

.slot-number {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-weight: 800;
  color: rgba(245, 158, 11, 0.7);
}

.slot-label {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #9ca3af;
}

.altar-table-box:not(.show-guides) .table-col-headers,
.altar-table-box:not(.show-guides) .row-guide-badge {
  display: none !important;
}

.card-item {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  border-radius: var(--radius-card);
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.65s var(--ease-spring), box-shadow 0.3s ease;
  user-select: none;
}

.card-item:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.9), var(--gold-glow);
  z-index: 10;
}

.card-item.flipped {
  animation: none !important;
  transform: rotateY(180deg) !important;
}

.card-item.is-reversed .card-face-front {
  transform: rotateY(180deg) rotateZ(180deg);
}

.card-reversed-pill {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: 1px solid #fecaca;
  font-family: var(--font-serif);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0.2rem 0.55rem;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8), 0 0 8px rgba(239, 68, 68, 0.6);
  z-index: 5;
  pointer-events: none;
  text-transform: uppercase;
}

.card-item.flipped:hover {
  transform: rotateY(180deg) translateY(-8px) scale(1.03) !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.9), var(--gold-glow);
  z-index: 10;
}

.card-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-card);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.85);
}

.card-face-back {
  background: var(--bg-card-back);
  transform: rotateY(0deg);
}

.card-face-front {
  background: var(--bg-card-front);
  transform: rotateY(180deg);
}

.card-art-svg {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* Realistic Card Dealing Animation (Flies physically from Deck position) */
@keyframes dealFromDeckAnim {
  0% {
    opacity: 0;
    transform: translate(var(--fly-from-x, -320px), var(--fly-from-y, 0px)) rotate(-24deg) scale(0.85);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.95), 0 0 25px rgba(245, 158, 11, 0.6);
    filter: brightness(1.2);
  }
  65% {
    opacity: 1;
    transform: translate(calc(var(--fly-from-x, -320px) * -0.04), calc(var(--fly-from-y, 0px) * -0.04)) rotate(3deg) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) rotate(0deg) scale(1);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.85);
    filter: brightness(1);
  }
}

.card-item.dealing {
  animation: dealFromDeckAnim 0.55s cubic-bezier(0.18, 0.89, 0.32, 1.15) forwards;
  will-change: transform, opacity;
}

.deck-stack-visual.is-dealing-card {
  transform: scale(0.97) translateY(2px);
  filter: drop-shadow(0 0 15px rgba(245, 158, 11, 0.8));
}

.grid-slot.active-reading .card-item {
  box-shadow: 0 0 35px rgba(245, 158, 11, 0.75), 0 0 12px rgba(254, 240, 138, 0.9);
  border: 1.5px solid #fef08a;
}

.bottom-action-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 0.9rem 1.5rem;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(245, 158, 11, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 20;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.7);
}

.btn-primary-roll {
  background: var(--gold-gradient);
  color: #0d0a17;
  border: none;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 0.85rem 2.25rem;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.5);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.3s var(--ease-smooth);
}

.btn-primary-roll:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 30px rgba(245, 158, 11, 0.75);
}

.btn-secondary-action {
  background: rgba(22, 17, 38, 0.85);
  color: #e5e7eb;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-family: var(--font-serif);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 0.8rem 1.4rem;
  border-radius: 25px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-secondary-action:hover:not(:disabled) {
  border-color: var(--gold-primary);
  color: var(--gold-light);
  background: rgba(36, 28, 62, 0.9);
}

.btn-secondary-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   5. FAST ORACLE READING ROOM (3 CARDS)
   ========================================================================== */

.horary-view-container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

.horary-hero-box {
  width: 100%;
  background: var(--bg-glass-strong);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 24px;
  padding: 2.25rem 2rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
}

.horary-badge-pill {
  display: inline-block;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid #38bdf8;
  color: #bae6fd;
  font-family: var(--font-serif);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  margin-bottom: 0.85rem;
}

.horary-hero-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #f0f9ff;
  margin-bottom: 0.5rem;
}

.horary-hero-desc {
  font-size: 0.95rem;
  color: #94a3b8;
  max-width: 600px;
  margin: 0 auto 1.75rem auto;
  line-height: 1.5;
}

.horary-form-bar {
  display: flex;
  gap: 0.85rem;
  width: 100%;
  max-width: 750px;
  margin: 0 auto;
}

@media (max-width: 650px) {
  .horary-form-bar {
    flex-direction: column;
  }
}

.horary-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.horary-input-icon {
  position: absolute;
  left: 1.1rem;
  font-size: 1.25rem;
  opacity: 0.8;
}

.horary-input-wrap input {
  width: 100%;
  background: rgba(11, 15, 28, 0.95);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 16px;
  padding: 0.95rem 1.25rem 0.95rem 3rem;
  color: #f8fafc;
  font-family: var(--font-sans);
  font-size: 1rem;
  outline: none;
  transition: all 0.25s ease;
}

.horary-input-wrap input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.btn-cast-horary {
  background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  color: #fff;
  border: none;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0.95rem 1.75rem;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(2, 132, 199, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.btn-cast-horary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 6px 25px rgba(2, 132, 199, 0.7);
}

.horary-timestamp-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: #64748b;
  flex-wrap: wrap;
}

.horary-timestamp-row strong {
  color: #bae6fd;
}

.horary-deck-indicator {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--gold-light);
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  font-size: 0.76rem;
  font-weight: 600;
}

.horary-table-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.horary-cards-trio {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.horary-slot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.horary-slot-header {
  text-align: center;
}

.horary-slot-num {
  font-family: var(--font-serif);
  font-size: 0.72rem;
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: 1px;
  display: block;
}

.horary-slot-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f1f5f9;
}

.horary-card-slot {
  width: var(--card-width);
  height: var(--card-height);
}

.horary-verdict-box {
  width: 100%;
  background: var(--bg-glass-strong);
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
}

.verdict-header-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1.5rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 600px) {
  .verdict-header-row {
    grid-template-columns: 1fr;
  }
}

.verdict-sub {
  font-family: var(--font-serif);
  font-size: 0.75rem;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 1px;
  display: block;
  margin-bottom: 0.4rem;
}

.verdict-decision-badge {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 1px;
  padding: 0.75rem 1.25rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.verdict-decision-badge.verdict-yes {
  background: rgba(16, 185, 129, 0.2);
  border: 1.5px solid var(--el-water);
  color: #6ee7b7;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.35);
}

.verdict-decision-badge.verdict-no {
  background: rgba(239, 68, 68, 0.2);
  border: 1.5px solid var(--el-fire);
  color: #fca5a5;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.35);
}

.verdict-decision-badge.verdict-neutral {
  background: rgba(245, 158, 11, 0.2);
  border: 1.5px solid var(--gold-primary);
  color: var(--gold-light);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.35);
}

.verdict-timing-badge {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 800;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.15);
  border: 1.5px solid #38bdf8;
  padding: 0.75rem 1.25rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.horary-question-quote {
  font-size: 1.1rem;
  color: #f1f5f9;
  margin-bottom: 1rem;
}

.horary-question-quote span {
  color: var(--gold-primary);
  font-weight: 700;
}

.horary-question-quote em {
  color: var(--gold-light);
  font-family: var(--font-reading);
}

.horary-interpretation-text {
  font-family: var(--font-reading);
  font-size: 1.1rem;
  line-height: 1.7;
  color: #f3f4f6;
}

/* ==========================================================================
   6. ASTROLOGICAL HORARY ROOM (12-HOUSE SKY CHART)
   ========================================================================== */

.astro-horary-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

.astro-hero-box {
  width: 100%;
  background: var(--bg-glass-strong);
  border: 1.5px solid rgba(192, 132, 252, 0.35);
  border-radius: 24px;
  padding: 2.25rem 2rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
}

.astro-badge-pill {
  display: inline-block;
  background: rgba(192, 132, 252, 0.15);
  border: 1px solid #c084fc;
  color: #e9d5ff;
  font-family: var(--font-serif);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 0.3rem 0.9rem;
  border-radius: 20px;
  margin-bottom: 0.85rem;
}

.astro-hero-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #fdf4ff;
  margin-bottom: 0.5rem;
}

.astro-hero-desc {
  font-size: 0.95rem;
  color: #c084fc;
  max-width: 680px;
  margin: 0 auto 1.75rem auto;
  line-height: 1.55;
}

.astro-form-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  max-width: 840px;
  margin: 0 auto;
}

.astro-form-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  text-align: left;
}

@media (max-width: 768px) {
  .astro-form-row {
    grid-template-columns: 1fr;
  }
}

.astro-input-wrap label,
.astro-select-wrap label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e9d5ff;
  margin-bottom: 0.35rem;
  display: block;
}

.astro-select-field {
  width: 100%;
  background: rgba(14, 10, 24, 0.85);
  border: 1.5px solid rgba(192, 132, 252, 0.35);
  border-radius: 14px;
  padding: 0.85rem 1rem 0.85rem 2.85rem;
  color: #f3f4f6;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  outline: none;
  cursor: pointer;
}

.astro-select-field option {
  background: #120d22;
  color: #fff;
}

.btn-cast-astro {
  background: linear-gradient(135deg, #c084fc 0%, #7e22ce 100%);
  color: #fff;
  border: none;
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 1rem 2rem;
  border-radius: 16px;
  cursor: pointer;
  box-shadow: 0 4px 25px rgba(126, 34, 206, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.btn-cast-astro:hover {
  transform: translateY(-2px);
  filter: brightness(1.12);
  box-shadow: 0 6px 30px rgba(126, 34, 206, 0.75);
}

.astro-time-info-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: #a855f7;
  flex-wrap: wrap;
}

.astro-time-info-row strong {
  color: #e9d5ff;
}

.astro-coord-pill {
  background: rgba(192, 132, 252, 0.15);
  border: 1px solid rgba(192, 132, 252, 0.3);
  color: #e9d5ff;
  padding: 0.2rem 0.65rem;
  border-radius: 10px;
  font-size: 0.76rem;
  font-weight: 600;
}

/* Results Grid */
.astro-results-area {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.astro-chart-grid-layout {
  display: grid;
  grid-template-columns: 540px 1fr;
  gap: 1.75rem;
  width: 100%;
}

@media (max-width: 1100px) {
  .astro-chart-grid-layout {
    grid-template-columns: 1fr;
  }
}

.astro-wheel-card,
.astro-data-card {
  background: var(--bg-glass-strong);
  border: 1.5px solid rgba(192, 132, 252, 0.3);
  border-radius: 24px;
  padding: 1.75rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
}

.astro-card-subheading {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gold-light);
  margin-bottom: 1.25rem;
  letter-spacing: 0.5px;
}

.astro-wheel-container {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.astro-wheel-svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 20px rgba(192, 132, 252, 0.25));
}

.wheel-hint {
  font-size: 0.78rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 0.75rem;
}

.astro-key-signifiers {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.signifier-pill {
  background: rgba(14, 10, 24, 0.75);
  border: 1px solid rgba(192, 132, 252, 0.3);
  padding: 0.65rem 1rem;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
}

.sig-label {
  color: #9ca3af;
}

.signifier-pill strong {
  color: var(--gold-light);
  font-family: var(--font-serif);
}

.astro-planets-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.astro-planets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.astro-planets-table th {
  background: rgba(22, 17, 38, 0.95);
  color: var(--gold-light);
  padding: 0.65rem 0.85rem;
  font-family: var(--font-serif);
  font-weight: 700;
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
}

.astro-planets-table td {
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: #e5e7eb;
}

.astro-planets-table tr:hover td {
  background: rgba(245, 158, 11, 0.08);
}

.astro-judgment-box {
  width: 100%;
  background: var(--bg-glass-strong);
  border: 1.5px solid rgba(192, 132, 252, 0.35);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
}

.astro-aspect-indicator-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.aspect-badge {
  background: rgba(14, 10, 24, 0.8);
  border: 1px solid rgba(192, 132, 252, 0.35);
  padding: 0.45rem 0.9rem;
  border-radius: 12px;
  font-size: 0.85rem;
  color: #e9d5ff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.astro-narrative-text {
  font-family: var(--font-reading);
  font-size: 1.12rem;
  line-height: 1.75;
  color: #f3f4f6;
}

/* ==========================================================================
   7. MODAL STYLES
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(5, 4, 9, 0.88);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  padding: 1.5rem;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.card-detail-modal {
  background: var(--bg-modal);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  border-radius: 24px;
  width: 100%;
  max-width: 840px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), var(--gold-glow);
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding: 2.25rem;
  position: relative;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s var(--ease-spring);
}

.modal-overlay.open .card-detail-modal {
  transform: scale(1) translateY(0);
}

@media (max-width: 768px) {
  .card-detail-modal {
    grid-template-columns: 1fr;
    padding: 1.5rem;
    gap: 1.25rem;
  }
}

.modal-close-btn {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #d1d5db;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
  z-index: 10;
}

.modal-close-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  color: var(--gold-light);
  border-color: var(--gold-primary);
}

.modal-card-visual-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.modal-card-preview {
  width: 240px;
  height: 368px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85), var(--gold-glow);
}

.modal-position-badge {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold-light);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--gold-primary);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  text-align: center;
  width: 100%;
}

.modal-reading-col {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.modal-card-header {
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  padding-bottom: 0.85rem;
}

.modal-card-name {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--gold-light);
  margin-bottom: 0.25rem;
}

.modal-card-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

.meta-pill {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-light);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-weight: 600;
}

.modal-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}

.orientation-badge {
  font-family: var(--font-serif);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0.3rem 0.85rem;
  border-radius: 14px;
  text-transform: uppercase;
}

.orientation-badge.badge-upright {
  background: rgba(16, 185, 129, 0.18);
  border: 1.2px solid var(--el-water);
  color: #a7f3d0;
}

.orientation-badge.badge-reversed {
  background: rgba(239, 68, 68, 0.2);
  border: 1.2px solid var(--el-fire);
  color: #fca5a5;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.4);
}

.reading-section {
  background: rgba(18, 14, 30, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 1rem;
}

.reading-section.active-orientation-section {
  border: 1.5px solid var(--gold-primary);
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
  position: relative;
}

.active-tag {
  display: inline-block !important;
  background: var(--gold-gradient);
  color: #110c1f;
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 8px;
  margin-left: 0.5rem;
  text-transform: none;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

.section-label {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--gold-primary);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.section-body {
  font-family: var(--font-reading);
  font-size: 1.05rem;
  line-height: 1.6;
  color: #f3f4f6;
}

.summary-drawer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(105%);
  width: 95%;
  max-width: 920px;
  background: var(--bg-glass-strong);
  backdrop-filter: blur(22px);
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 1.75rem;
  box-shadow: 0 -15px 50px rgba(0, 0, 0, 0.85);
  z-index: 90;
  transition: transform 0.4s var(--ease-spring);
  max-height: 75vh;
  overflow-y: auto;
}

.summary-drawer.open {
  transform: translateX(-50%) translateY(0);
}

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

.drawer-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--gold-light);
}

.element-balance-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .element-balance-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.element-stat-card {
  background: rgba(14, 10, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.element-stat-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #9ca3af;
}

.element-stat-val {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gold-light);
}

.element-stat-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.element-stat-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
