/* CineAHO Premium Tarot Card Reading App Stylesheet */

/* Core Variables & Tokens */
:root {
  --hue-purple: 270;
  --hue-blue: 210;
  --hue-green: 145;
  --hue-gold: 45;
  --hue-red: 350;
  --hue-cyan: 190;
  --hue-pink: 325;
  --hue-orange: 25;

  /* Theme Core - Dark Glassmorphism */
  --bg-color: #050811;
  --bg-grid: rgba(255, 255, 255, 0.015);
  
  --panel-bg: rgba(12, 18, 33, 0.6);
  --panel-border: rgba(255, 255, 255, 0.06);
  --panel-hover-border: rgba(168, 85, 247, 0.3);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #475569;
  
  /* Gradation Accents */
  --grad-purple: linear-gradient(135deg, #a855f7 0%, #6b21a8 100%);
  --grad-blue: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  --grad-pink: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
  --grad-green: linear-gradient(135deg, #10b981 0%, #047857 100%);
  --grad-orange: linear-gradient(135deg, #f97316 0%, #c2410c 100%);
  --grad-purpleblue: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  --grad-gold: linear-gradient(135deg, #fbbf24 0%, #b45309 100%);

  --neon-glow-purple: 0 0 30px rgba(168, 85, 247, 0.25);
  --neon-border-glow: 0 0 15px rgba(168, 85, 247, 0.2);

  --font-main: 'Noto Sans KR', 'Inter', sans-serif;
  --font-display: 'Outfit', sans-serif;
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-card: 0 12px 40px 0 rgba(0, 0, 0, 0.6);
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

/* Grid Background */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: -2;
  pointer-events: none;
}

/* Ambient Glow Orbs */
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(150px);
  z-index: -3;
  pointer-events: none;
  opacity: 0.2;
}

.bg-glow-purple {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
  top: -150px;
  left: -100px;
}

.bg-glow-blue {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, #ec4899 0%, transparent 70%);
  top: 40%;
  right: -200px;
}

/* Header */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  margin: 1rem 1.5rem 0 1.5rem;
  border-radius: 50px;
  transition: var(--transition-smooth);
}

.glass-header {
  background: rgba(10, 15, 30, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.logo-circle {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #6366f1 0%, #4338ca 100%);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

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

.logo-text {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.95rem;
}

.logo-text span {
  color: var(--text-muted);
  font-weight: 400;
}

.header-nav {
  flex-grow: 1;
  margin: 0 2rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-nav::-webkit-scrollbar {
  display: none;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 1.25rem;
  white-space: nowrap;
}

.nav-list a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition-smooth);
  padding: 0.5rem 0.25rem;
  position: relative;
}

.nav-list a:hover,
.nav-list a.active {
  color: var(--text-main);
}

.nav-list a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: #a855f7;
  border-radius: 2px;
}

.btn-back-dashboard {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 30px;
  padding: 0.5rem 1.2rem;
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-back-dashboard:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #a855f7;
  transform: translateX(-2px);
}

/* Glass Panel Base */
.glass-panel {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

.glass-panel:hover {
  border-color: var(--panel-hover-border);
}

/* Tarot Layout Container */
.tarot-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.tarot-header-section {
  text-align: center;
}

.main-title {
  font-size: 2.3rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
  font-family: var(--font-main);
}

.main-title span {
  background: linear-gradient(135deg, #d946ef 0%, #a855f7 50%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.main-title i {
  color: #fbbf24;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
  margin-right: 0.5rem;
}

.subtitle-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto 1.5rem auto;
  line-height: 1.6;
}

.tag-badges {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.3rem 0.8rem;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Section Header Bar */
.section-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  border-bottom: 2px solid #a855f7;
  padding-bottom: 0.5rem;
  margin-top: 1rem;
}

.header-bar-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Spread Selector Grid */
.spread-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.spread-card {
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 250px;
  position: relative;
  overflow: hidden;
}

.spread-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 10% 10%, rgba(255,255,255,0.03) 0%, transparent 50%);
  pointer-events: none;
}

.spread-icon {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  display: inline-block;
  background: rgba(255, 255, 255, 0.03);
  width: 55px;
  height: 55px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.06);
}

.spread-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-count-tag {
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
}

.spread-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  line-height: 1.5;
}

.spread-footer {
  margin-top: 1.25rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-select-spread {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

.btn-select-spread:hover {
  background: #a855f7;
  border-color: #a855f7;
  color: #fff;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.35);
}

/* Spread Theme Color Customizations */
.theme-purple .spread-icon i { color: #c084fc; }
.theme-purple .card-count-tag { background: rgba(168,85,247,0.15); color: #c084fc; border: 1px solid rgba(168,85,247,0.3); }

.theme-blue .spread-icon i { color: #60a5fa; }
.theme-blue .card-count-tag { background: rgba(59,130,246,0.15); color: #60a5fa; border: 1px solid rgba(59,130,246,0.3); }

.theme-pink .spread-icon i { color: #f472b6; }
.theme-pink .card-count-tag { background: rgba(236,72,153,0.15); color: #f472b6; border: 1px solid rgba(236,72,153,0.3); }

.theme-green .spread-icon i { color: #34d399; }
.theme-green .card-count-tag { background: rgba(16,185,129,0.15); color: #34d399; border: 1px solid rgba(16,185,129,0.3); }

.theme-orange .spread-icon i { color: #fb923c; }
.theme-orange .card-count-tag { background: rgba(249,115,22,0.15); color: #fb923c; border: 1px solid rgba(249,115,22,0.3); }

.theme-purpleblue .spread-icon i { color: #818cf8; }
.theme-purpleblue .card-count-tag { background: rgba(99,102,241,0.15); color: #818cf8; border: 1px solid rgba(99,102,241,0.3); }

/* Interactive Board Section */
.tarot-board-section {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 1rem;
}

.current-spread-badge {
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 1.1rem;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #c084fc;
  padding: 0.4rem 1rem;
  border-radius: 30px;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.1);
}

.btn-close-board {
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.2);
  color: #f43f5e;
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition-smooth);
}

.btn-close-board:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: #f43f5e;
  transform: scale(1.03);
}

.board-status-bar {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: #c084fc;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.board-interactive-container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  align-items: center;
  width: 100%;
}

/* Spread Slots Layout (The Table) */
.spread-slots-container {
  position: relative;
  width: 100%;
  min-height: 480px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.03) 0%, transparent 70%);
  border: 1px dashed rgba(255,255,255,0.06);
  border-radius: 20px;
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

/* Slots for Spreads */
.slot-frame {
  width: 110px;
  height: 180px;
  border: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
  transition: var(--transition-smooth);
}

.slot-frame.active {
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(168, 85, 247, 0.03);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.08);
}

.slot-label {
  position: absolute;
  bottom: -22px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  width: 120%;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.slot-index {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: rgba(255,255,255,0.08);
}

/* Celtic Cross Layout Spec (Positioning frames absolutely for professional UI) */
.celtic-cross-map {
  position: relative;
  width: 100%;
  height: 520px;
  max-width: 800px;
  margin: 0 auto;
}

.celtic-cross-map .slot-frame {
  position: absolute;
}

/* Coordinates on a 800 x 520 board */
/* Cross slots (Left area) */
.cc-slot-1 { left: 240px; top: 170px; z-index: 2; } /* Center (현재) */
.cc-slot-2 { left: 240px; top: 170px; transform: rotate(90deg); z-index: 3; } /* Crossways (장애물) */
.cc-slot-3 { left: 240px; top: 10px; }  /* Top (목표/의식) */
.cc-slot-4 { left: 240px; top: 330px; } /* Bottom (무의식) */
.cc-slot-5 { left: 90px; top: 170px; }  /* Left (과거) */
.cc-slot-6 { left: 390px; top: 170px; }  /* Right (미래) */

/* Staff/Column slots (Right area) */
.cc-slot-7 { left: 580px; top: 390px; } /* Bottom (내면) */
.cc-slot-8 { left: 580px; top: 264px; } /* 2nd (주변환경) */
.cc-slot-9 { left: 580px; top: 138px; } /* 3rd (희망/공포) */
.cc-slot-10 { left: 580px; top: 12px; }  /* Top (결과) */

/* The Deck / Shuffle Area */
.deck-area-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 2rem;
}

.deck-container {
  position: relative;
  height: 180px;
  width: 250px; /* Shuffling cards width */
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: center;
}

/* Shuffling animations & Deck cards */
.deck-card-back {
  width: 110px;
  height: 180px;
  background: #171026;
  border: 2px solid #b45309; /* Gold border */
  border-radius: 12px;
  position: absolute;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), left 0.4s ease;
  user-select: none;
}

/* Card back visual art styling */
.deck-card-back::before {
  content: '';
  position: absolute;
  top: 4px; left: 4px; right: 4px; bottom: 4px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 8px;
  background: 
    radial-gradient(circle, rgba(168, 85, 247, 0.1) 0%, transparent 80%),
    repeating-linear-gradient(45deg, rgba(251, 191, 36, 0.02) 0px, rgba(251, 191, 36, 0.02) 2px, transparent 2px, transparent 10px);
}

.deck-card-back::after {
  content: '✦';
  color: #fbbf24;
  font-size: 1.2rem;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0.65;
  text-shadow: 0 0 5px rgba(251, 191, 36, 0.5);
}

/* Cards Hover/Float effects */
.deck-card-back:hover {
  transform: translateY(-8px) scale(1.03);
  border-color: #fbbf24;
  box-shadow: 0 8px 20px rgba(251, 191, 36, 0.2);
  z-index: 100;
}

/* Shuffling status animations */
.shuffling-animation .deck-card-back:nth-child(even) {
  animation: shuffle-left 0.6s infinite ease-in-out alternate;
}

.shuffling-animation .deck-card-back:nth-child(odd) {
  animation: shuffle-right 0.6s infinite ease-in-out alternate;
}

@keyframes shuffle-left {
  0% { transform: translateX(0) rotate(0); }
  100% { transform: translateX(-60px) rotate(-8deg); }
}

@keyframes shuffle-right {
  0% { transform: translateX(0) rotate(0); }
  100% { transform: translateX(60px) rotate(8deg); }
}

.deck-controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-action {
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #c084fc;
}

.btn-action:hover {
  background: rgba(168, 85, 247, 0.25);
  border-color: #c084fc;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.15);
}

.btn-gold {
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%);
  color: #111;
  border: none;
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.4);
  color: #000;
}

/* Flying card drawn animation */
.flying-card {
  position: absolute;
  width: 110px;
  height: 180px;
  z-index: 50;
  transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  pointer-events: none;
}

/* Drawn Card Styles (inside Slot Frames) */
.tarot-card-item {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0; left: 0;
  perspective: 1000px;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-inner.flipped {
  transform: rotateY(180deg);
}

.card-inner.flipped.reversed {
  transform: rotateY(180deg) rotateZ(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
}

.card-back {
  background: #171026;
  border: 2px solid #b45309;
}

/* Card Front Art */
.card-front {
  background: linear-gradient(135deg, #13112a 0%, #1e1b4b 100%);
  border: 2px solid #a855f7;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem;
}

/* Front card layout visual styling */
.card-front-border {
  position: absolute;
  top: 3px; left: 3px; right: 3px; bottom: 3px;
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 6px;
  pointer-events: none;
}

.card-front-title-top {
  font-size: 0.55rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-align: center;
  font-family: var(--font-display);
}

.card-front-icon {
  font-size: 2.2rem;
  color: #fbbf24;
  margin: auto;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.25);
}

.card-front-title-bottom {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin-top: auto;
  background: rgba(168, 85, 247, 0.15);
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  width: 100%;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

/* Reading Results Panel */
.tarot-results-panel {
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 1rem;
}

.results-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.results-header h3 i {
  color: #c084fc;
}

.result-badge {
  font-size: 0.75rem;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
  color: #c084fc;
  padding: 0.25rem 0.75rem;
  border-radius: 30px;
  font-weight: 600;
}

/* Tabs for drawn cards */
.results-navigation-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.results-tab-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.results-tab-chip:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.results-tab-chip.active {
  background: rgba(168, 85, 247, 0.15);
  border-color: #a855f7;
  color: #fff;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.1);
}

.tab-position-num {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  color: #fff;
  font-weight: 700;
}

.results-tab-chip.active .tab-position-num {
  background: #a855f7;
}

/* Results Detail Layout Grid */
.results-detail-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2.5rem;
}

.results-detail-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

/* Large 3D Card Viewer */
.card-3d-wrapper {
  width: 140px;
  height: 230px;
  perspective: 1000px;
}

.card-3d-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card-3d-inner.flipped {
  transform: rotateY(180deg);
}

.card-3d-inner.flipped.reversed {
  transform: rotateY(180deg) rotateZ(180deg);
}

.card-3d-back, .card-3d-front {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 14px;
}

.card-3d-back {
  background: #171026;
  border: 2px solid #b45309;
}

.card-3d-back .back-design {
  position: absolute;
  top: 5px; left: 5px; right: 5px; bottom: 5px;
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-3d-back .inner-ornament {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: rgba(251, 191, 36, 0.45);
  border: 1px solid rgba(251, 191, 36, 0.2);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-3d-front {
  background: linear-gradient(135deg, #13112a 0%, #1e1b4b 100%);
  border: 2px solid #a855f7;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
}

.card-3d-front .card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(168,85,247,0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  width: 100%;
  text-align: center;
}

.card-3d-front .card-art {
  font-size: 3.5rem;
  color: #fbbf24;
  text-shadow: 0 0 15px rgba(251, 191, 36, 0.3);
  margin: auto;
}

.viewer-card-direction-text {
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.3);
  color: #fb923c;
  padding: 0.25rem 0.75rem;
  border-radius: 30px;
}

/* Detail Right Readings styling */
.results-detail-right {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.card-position-meaning {
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid #a855f7;
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
}

.card-position-meaning h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #c084fc;
}

.card-position-meaning p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.card-info-box h2 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.keyword-badges {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.key-badge {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.25);
  color: #fbbf24;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
}

.interpretation-content-box {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255,255,255,0.04);
  padding: 1.25rem;
  border-radius: 12px;
}

.interpretation-content-box h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #c084fc;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}

.interpretation-content-box p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #e2e8f0;
}

/* Master Advice Block */
.advice-block-panel {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 1rem;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.2);
  padding: 1.5rem;
  border-radius: 16px;
  align-items: start;
}

.advice-icon {
  font-size: 1.8rem;
  color: #c084fc;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  width: 50px;
  background: rgba(168,85,247,0.1);
  border-radius: 50%;
}

.advice-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.advice-content p {
  font-size: 0.88rem;
  color: #d8b4fe;
  line-height: 1.6;
  margin-top: 0.25rem;
}

/* Explanation (TOC) Board Section - 14-part display */
.explanation-board-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.explanation-board-section .board-header {
  border-bottom: 2px solid #a855f7;
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.explanation-board-section .board-header i {
  font-size: 1.35rem;
}

.explanation-board-section .board-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

.explanation-board-section .board-header span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.explanation-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Navigation Left Column (TOC List) */
.explanation-index-list {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 16px;
  overflow: hidden;
}

.explanation-index-list ul {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.explanation-index-list li {
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition-smooth);
}

.explanation-index-list li:last-child {
  border-bottom: none;
}

.explanation-index-list li:hover {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-main);
  padding-left: 1.25rem;
}

.explanation-index-list li.active {
  background: rgba(168, 85, 247, 0.1);
  color: #fff;
  border-left: 4px solid #a855f7;
  padding-left: 1.25rem;
}

.index-num {
  font-family: var(--font-display);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.08);
  font-weight: 700;
}

.explanation-index-list li.active .index-num {
  color: #c084fc;
}

/* Content Box Styling (Right Column Display Box) */
.explanation-display-box {
  min-height: 400px;
  padding: 2.2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  /* Light purple color variables as requested by prompt */
  border-left: 4px solid #d8b4fe;
}

.display-content-inner {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}

.display-top-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(168, 85, 247, 0.12);
  padding: 0.25rem 0.8rem;
  border-radius: 30px;
  width: fit-content;
}

.display-top-badge i {
  font-size: 0.8rem;
  color: #c084fc;
}

.display-top-badge span {
  font-size: 0.72rem;
  font-weight: 700;
  color: #d8b4fe;
}

.explanation-display-box h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
}

.display-text-body {
  font-size: 0.92rem;
  color: #e2e8f0;
  line-height: 1.7;
}

/* Sub-points lists inside display body */
.display-text-body p {
  margin-bottom: 1rem;
}

.display-text-body ul, .display-text-body ol {
  margin-left: 1.25rem;
  margin-bottom: 1rem;
}

.display-text-body li {
  margin-bottom: 0.4rem;
}

.display-text-body strong {
  color: #c084fc;
}

/* Fade animation helper class for TOC */
.fade-out {
  opacity: 0;
}

/* Floating Navigator Widget */
.floating-navigator {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 100;
}

.floating-buttons-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-float {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(10, 15, 30, 0.8);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
}

.btn-float:hover {
  background: #a855f7;
  border-color: #a855f7;
  color: #fff;
  transform: translateY(-2px);
}

/* Media Queries for Responsive Design */
@media (max-width: 900px) {
  .results-detail-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .results-detail-left {
    flex-direction: row;
    justify-content: center;
    gap: 2rem;
  }
  .explanation-layout {
    grid-template-columns: 1fr;
  }
  .explanation-index-list ul {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .explanation-index-list li {
    flex: 1 1 200px;
  }
  .celtic-cross-map {
    height: auto;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem 1.5rem;
    min-height: auto;
    padding: 1rem;
  }
  .celtic-cross-map .slot-frame {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    transform: none !important;
  }
  .slot-label {
    width: auto;
    white-space: normal;
  }
}

@media (max-width: 600px) {
  .main-header {
    margin: 0.5rem;
    padding: 0.5rem 1rem;
  }
  .logo-text {
    display: none;
  }
  .main-title {
    font-size: 1.8rem;
  }
  .spread-selector-grid {
    grid-template-columns: 1fr;
  }
  .results-detail-left {
    flex-direction: column;
  }
  .celtic-cross-map {
    gap: 2.2rem 1.5rem;
  }
}
