/* ==========================================================================
   AETHERIA I CHING QUANTUM ORACLE STYLES
   NorthStar Mystery School — Taoist Cyberpunk & Sacred Wisdom
   ========================================================================== */

:root {
  --bg-dark: #07090e;
  --panel-bg: rgba(13, 18, 31, 0.88);
  --border-gold: rgba(245, 158, 11, 0.3);
  --gold: #f59e0b;
  --gold-light: #fef08a;
  --jade: #10b981;
  --jade-light: #6ee7b7;
  --bronze: #d97706;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-serif: 'Cinzel', 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
}

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

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 50% 15%, rgba(16, 185, 129, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 85% 85%, rgba(245, 158, 11, 0.06) 0%, transparent 50%),
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
.iching-header {
  border-bottom: 1px solid var(--border-gold);
  background: rgba(8, 12, 22, 0.85);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 24px;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brand-yin-yang {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--jade);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--jade-light);
  background: radial-gradient(circle, rgba(16, 185, 129, 0.25) 0%, transparent 70%);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.3);
}

.brand-titles h1 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold-light);
}

.brand-titles .subtitle {
  font-size: 0.72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  gap: 18px;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.5px;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--gold);
}

/* Container */
.iching-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 20px 64px;
}

/* Hero */
.hero-deck {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 36px;
}

.hero-deck .kicker {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--jade);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.hero-deck h2 {
  font-family: var(--font-serif);
  font-size: 2.6rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.2;
}

.hero-deck h2 span {
  background: linear-gradient(135deg, #6ee7b7 0%, #10b981 50%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-deck p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Oracle Stage Workspace */
.oracle-workspace {
  display: grid;
  grid-template-columns: 460px 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 1024px) {
  .oracle-workspace {
    grid-template-columns: 1fr;
  }
}

/* Left: Coin Casting Chamber */
.coin-chamber {
  background: var(--panel-bg);
  border: 1px solid var(--border-gold);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.chamber-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.chamber-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--gold-light);
}

/* 3D Bronze Coins */
.coin-altar {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 20px 0 28px;
  perspective: 600px;
}

.bronze-coin {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f59e0b 0%, #b45309 60%, #78350f 100%);
  border: 3px solid #fef08a;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6), inset 0 0 10px rgba(0, 0, 0, 0.4);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.coin-hole {
  width: 22px;
  height: 22px;
  background: var(--bg-dark);
  border: 2px solid #78350f;
}

.coin-inscription {
  position: absolute;
  font-family: var(--font-serif);
  font-size: 0.65rem;
  font-weight: 800;
  color: rgba(254, 240, 138, 0.9);
}

.coin-ins-top { top: 6px; }
.coin-ins-bottom { bottom: 6px; }
.coin-ins-left { left: 8px; }
.coin-ins-right { right: 8px; }

.coin-flipping {
  animation: coinFlipAnim 0.7s ease-in-out;
}

@keyframes coinFlipAnim {
  0% { transform: translateY(0) rotateX(0); }
  50% { transform: translateY(-40px) rotateX(720deg) scale(1.1); }
  100% { transform: translateY(0) rotateX(1440deg); }
}

/* Casting Controls */
.casting-actions {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-bottom: 24px;
}

.btn-toss {
  flex: 1;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border: none;
  color: #fff;
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 1px;
  padding: 12px 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-toss:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.btn-instant {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  font-family: var(--font-serif);
  padding: 12px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-instant:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--gold);
}

/* Lines Stack (Hexagram visualizer) */
.hexagram-stack {
  width: 100%;
  display: flex;
  flex-direction: column-reverse; /* Line 1 at bottom, Line 6 at top */
  gap: 10px;
  background: rgba(5, 7, 13, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 20px 24px;
}

.hex-line-row {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 28px;
}

.line-number {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 48px;
}

.line-bars {
  flex: 1;
  display: flex;
  height: 14px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

/* Solid Yang Line */
.line-solid {
  background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
  width: 100%;
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

/* Broken Yin Line */
.line-broken {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.line-broken-segment {
  width: 45%;
  background: linear-gradient(90deg, #38bdf8 0%, #818cf8 100%);
  border-radius: 3px;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

/* Changing Line Markers */
.line-changing {
  position: absolute;
  right: -24px;
  font-weight: 800;
  font-size: 0.85rem;
  color: #ef4444;
  animation: pulseRune 1.2s infinite ease-in-out;
}

@keyframes pulseRune {
  0%, 100% { opacity: 0.5; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* Right: Wisdom & Interpretation Chamber */
.wisdom-chamber {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card-panel {
  background: var(--panel-bg);
  border: 1px solid var(--border-gold);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.card-panel h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--gold-light);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.hex-meta-header {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 16px;
}

.hex-glyph {
  font-size: 2.8rem;
  color: var(--jade-light);
  line-height: 1;
}

.hex-title-group h4 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: #fff;
  line-height: 1.2;
}

.hex-chinese {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--gold);
}

.section-block {
  margin-top: 18px;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.section-body {
  font-size: 0.95rem;
  color: #e2e8f0;
  line-height: 1.7;
}

.vorath-box {
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid var(--jade);
  padding: 14px 18px;
  border-radius: 0 10px 10px 0;
  margin-top: 20px;
}

.vorath-box strong {
  color: var(--jade-light);
  font-family: var(--font-serif);
  letter-spacing: 1px;
}

/* Transformed Hexagram Comparison Grid */
.dual-hex-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 600px) {
  .dual-hex-grid {
    grid-template-columns: 1fr;
  }
}
