/**
 * Sacred Dojo Design System
 * IFS Roleplay Bot - "Digital Sanctuary" UI
 * Version: 3.0 - Gemini Pixel-Perfect Edition
 * Brand: Esu Nick / Esu House
 */

/* === FONT IMPORTS === */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600&family=Great+Vibes&family=Lato:wght@300;400;700&family=Playfair+Display:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  /* === EXACT COLOR PALETTE === */
  /* Canvas */
  --c-canvas: #F5F0E8;       /* Esu Cream */
  --c-surface: #FFFFFF;      /* Luminous White */
  --c-surface-wash: #FBF8F3; /* Slightly warmer white for hover states */

  /* Text & Content */
  --c-forest-deep: #2C3630;  /* Primary Text (WCAG AA compliant on Cream) */
  --c-forest-mid: #4A5B4F;   /* Icons / Secondary Text */
  --c-stone: #6B7280;        /* Meta Text */

  /* Gold Accents */
  --c-gold-primary: #A38C6D; /* Graphic Elements / Borders */
  --c-gold-dark: #8F7A5E;    /* Button Gradients / Hover */
  --c-gold-text: #856E50;    /* Text-Safe Gold (Darker for Contrast) */
  --c-gold-faint: #EBE3D9;   /* Progress tracks / Backgrounds */

  /* Legacy Compatibility */
  --c-card: #FFFFFF;
  --c-text-primary: #2C3630;
  --c-text-secondary: #6B7280;
  --c-gold-deco: #A38C6D;
  --c-gold-accessible: #856E50;
  --c-gold-wash: #EBE3D9;
  --c-gold-glow: rgba(163, 140, 109, 0.4);

  /* Feedback */
  --c-error-bg: #FDF2F2;
  --c-error-text: #9B2C2C;
  --c-error: #9B2C2C;
  --c-success: #3D5A45;
  --c-success-text: #2C3630;
  --c-success-bg: #F0F7F1;
  --c-warning: #D97706;
  --c-danger: #9B2C2C;

  /* Dark Mode (Call Interface Only) */
  --c-void-bg: #1F2622;      /* Deepest Forest Green */
  --c-void-surface: rgba(255, 255, 255, 0.08);
  --c-call-bg: #1F2622;
  --c-call-header: rgba(31, 38, 34, 0.95);
  --c-call-text: rgba(255, 255, 255, 0.9);
  --c-glass: rgba(255, 255, 255, 0.1);
  --c-glass-border: rgba(255, 255, 255, 0.15);

  /* === SPACING SCALE (8pt Grid) === */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* === BORDER RADIUS === */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 50px;
  --radius-circle: 50%;

  /* === DEPTH & SHADOWS (The "Premium" Feel) === */
  --shadow-ambient: 0 10px 40px -10px rgba(74, 91, 79, 0.08);
  --shadow-define: 0 1px 2px 0 rgba(74, 91, 79, 0.05);
  --shadow-gold: 0 4px 14px 0 rgba(163, 140, 109, 0.4);
  --shadow-lift: 0 20px 40px -12px rgba(74, 91, 79, 0.15);
  /* Legacy */
  --shadow-soft: 0 10px 40px -10px rgba(74, 91, 79, 0.08), 0 1px 2px 0 rgba(74, 91, 79, 0.05);
  --shadow-medium: 0 12px 32px -8px rgba(44, 54, 48, 0.12);
  --shadow-pop: 0 20px 40px -12px rgba(74, 91, 79, 0.15);
  --shadow-gold-btn: 0 4px 14px rgba(163, 140, 109, 0.4);
  --shadow-heavy: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

  /* === TYPOGRAPHY === */
  --font-display: 'Cinzel', serif;
  --font-header: 'Playfair Display', serif;
  --font-body: 'Lato', sans-serif;
  --font-script: 'Great Vibes', cursive;

  /* === TRANSITIONS === */
  --ease-sacred: cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: 150ms ease;
  --transition-base: 300ms var(--ease-sacred);
  --transition-slow: 500ms var(--ease-sacred);
}

/* === BASE RESET === */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  background-color: var(--c-canvas);
  color: var(--c-forest-deep);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === ACCESSIBILITY: FOCUS MANAGEMENT === */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--c-forest-mid);
  outline-offset: 2px;
  border-radius: 4px;
}

/* === ACCESSIBILITY: REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* === PAGE TRANSITIONS === */
main {
  animation: fadeIn 300ms ease;
}

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

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

.text-display {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  color: var(--c-gold-text);
  line-height: 1.2;
  margin: 0 0 8px 0;
}

.text-header {
  font-family: var(--font-header);
  font-size: 24px;
  font-weight: 400;
  color: var(--c-forest-deep);
  line-height: 1.3;
  margin: 0 0 16px 0;
}

.text-subheader {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
  color: var(--c-forest-deep);
  line-height: 1.4;
  margin: 0 0 12px 0;
}

.text-body {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  color: var(--c-forest-deep);
  line-height: 1.6;
}

.text-meta {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--c-stone);
  line-height: 1.5;
}

.text-label, .label-sacred {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--c-gold-text);
  display: block;
  margin-bottom: 4px;
}

.text-script {
  font-family: var(--font-script);
  font-size: 24px;
  color: var(--c-gold-text);
  opacity: 0.8;
}

@media (max-width: 768px) {
  .text-display { font-size: 24px; }
  .text-header { font-size: 20px; }
  .text-subheader { font-size: 16px; }
}

/* ============================================================================
   BUTTONS - ESU PRIMARY (Main CTAs)
   ============================================================================ */

.btn-esu-primary, .esu-button-primary {
  /* Dimensions */
  height: 48px;
  padding: 0 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  /* Shape */
  border-radius: var(--radius-pill);
  border: none;

  /* Visuals */
  background: linear-gradient(135deg, #A38C6D 0%, #8F7A5E 100%);
  color: #FFFFFF;
  box-shadow: var(--shadow-gold);

  /* Typography */
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1.25px;
  text-transform: uppercase;
  text-decoration: none;

  /* Interaction */
  cursor: pointer;
  transition: transform 0.3s var(--ease-sacred), box-shadow 0.3s var(--ease-sacred), background 0.3s var(--ease-sacred);
}

.btn-esu-primary:hover, .esu-button-primary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #AD9575 0%, #998264 100%);
  box-shadow: 0 8px 20px 0 rgba(163, 140, 109, 0.5);
}

.btn-esu-primary:active, .esu-button-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px 0 rgba(163, 140, 109, 0.4);
}

.btn-esu-primary:disabled, .esu-button-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* === SECONDARY BUTTON (Outlined) === */
.esu-button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 28px;

  background: transparent;
  color: var(--c-gold-text);
  border: 2px solid var(--c-gold-primary);
  border-radius: var(--radius-pill);

  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;

  cursor: pointer;
  transition: all var(--transition-base);
}

.esu-button-secondary:hover {
  background: var(--c-gold-faint);
}

.esu-button-secondary:active {
  background: var(--c-gold-primary);
  color: white;
}

/* === GHOST BUTTON === */
.esu-button-ghost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  color: var(--c-gold-text);
  border: none;
  padding: 8px 0;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.esu-button-ghost:hover {
  color: var(--c-forest-deep);
}

.esu-button-ghost.has-arrow::after {
  content: '\2192';
  transition: transform var(--transition-fast);
}

.esu-button-ghost.has-arrow:hover::after {
  transform: translateX(4px);
}

/* === DANGER BUTTON === */
.esu-button-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(155, 44, 44, 0.9);
  color: white;
  border: none;
  border-radius: var(--radius-circle);
  width: 56px;
  height: 56px;
  cursor: pointer;
  transition: all var(--transition-base);
}

.esu-button-danger:hover {
  background: var(--c-error);
  transform: scale(1.05);
}

/* ============================================================================
   CARDS - SACRED CARD (Container)
   ============================================================================ */

.card-sacred, .sacred-card {
  background: var(--c-surface);
  border-radius: var(--radius-md);
  border: 1px solid rgba(163, 140, 109, 0.15);
  box-shadow: var(--shadow-define), var(--shadow-ambient);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--transition-base);
}

.card-sacred:hover, .sacred-card:hover {
  box-shadow: var(--shadow-lift);
}

/* === TAROT SELECTION CARDS === */
.card-tarot, .selection-card {
  background: var(--c-surface);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  cursor: pointer;
  transition: all 0.4s var(--ease-sacred);
  box-shadow: var(--shadow-ambient);
}

.card-tarot:hover, .selection-card:hover {
  border-color: var(--c-gold-faint);
  box-shadow: var(--shadow-lift);
}

.card-tarot.is-selected, .selection-card.is-selected {
  border-color: var(--c-gold-primary);
  transform: translateY(-8px);
  background: linear-gradient(160deg, #FFFFFF 0%, #FBF6F1 100%);
  box-shadow: var(--shadow-lift), 0 0 0 1px rgba(163, 140, 109, 0.2);
}

.card-tarot i, .selection-card i {
  font-size: 32px;
  color: var(--c-gold-faint);
  margin-bottom: var(--space-md);
  transition: color 0.3s ease;
}

.card-tarot.is-selected i, .selection-card.is-selected i {
  color: var(--c-gold-primary);
}

.selection-card:focus-visible {
  outline: 2px solid var(--c-forest-mid);
  outline-offset: 2px;
}

/* ============================================================================
   FORM ELEMENTS - SACRED INPUT (Underline Style)
   ============================================================================ */

.input-sacred-wrapper, .sacred-input-group {
  position: relative;
  margin-bottom: var(--space-lg);
}

.input-sacred, .sacred-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 2px solid rgba(163, 140, 109, 0.3);
  border-radius: 0;
  padding: 12px 0;
  font-family: var(--font-header);
  font-size: 18px;
  color: var(--c-forest-deep);
  transition: border-color 0.3s ease, background 0.3s ease;
}

.input-sacred:focus, .sacred-input:focus {
  outline: none;
  border-bottom-color: var(--c-gold-primary);
  background: linear-gradient(to bottom, transparent 95%, rgba(163, 140, 109, 0.05) 100%);
}

.input-sacred::placeholder, .sacred-input::placeholder {
  color: var(--c-stone);
  opacity: 0.6;
}

/* === SELECT DROPDOWN === */
.sacred-select {
  appearance: none;
  width: 100%;
  background: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23856E50' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  border: none;
  border-bottom: 2px solid rgba(163, 140, 109, 0.3);
  border-radius: 0;
  padding: 12px 24px 12px 0;
  font-family: var(--font-header);
  font-size: 18px;
  color: var(--c-forest-deep);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sacred-select:focus {
  outline: none;
  border-color: var(--c-gold-primary);
}

/* ============================================================================
   DASHBOARD: ENSO PROGRESS RINGS
   ============================================================================ */

.enso-wrapper, .enso-container {
  position: relative;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.enso-track {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid var(--c-gold-faint);
  opacity: 0.5;
}

.enso-fill, .enso-ring-graphic {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid transparent;
  border-top-color: var(--c-gold-primary);
  border-left-color: var(--c-gold-primary);
  transform: rotate(-25deg);
  box-shadow: 0 4px 12px rgba(163, 140, 109, 0.2);
}

.enso-value {
  z-index: 2;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--c-forest-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.enso-label {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-stone);
  margin-top: 4px;
}

/* ============================================================================
   PRE-CALL: DOSSIER (Mission Brief)
   ============================================================================ */

.dossier-container {
  max-width: 600px;
  margin: 0 auto;
  background: #FCFBF9;
  border: 1px solid #EBE3D9;
  box-shadow:
    0 1px 1px rgba(0,0,0,0.05),
    0 10px 0 -5px #F5F0E8,
    0 10px 1px -4px rgba(0,0,0,0.05),
    0 20px 0 -10px #F5F0E8,
    0 20px 1px -9px rgba(0,0,0,0.05);
  padding: 40px;
  border-radius: var(--radius-md);
}

.goal-circle {
  width: 20px;
  height: 20px;
  border: 2px solid var(--c-gold-primary);
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
}

/* === PROSPECT CARD === */
.prospect-card {
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  border-left: 4px solid var(--c-gold-primary);
  padding: 32px;
  box-shadow: var(--shadow-soft);
}

.prospect-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--c-gold-faint);
}

.prospect-avatar {
  width: 64px;
  height: 64px;
  background: var(--c-gold-faint);
  border-radius: var(--radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-gold-text);
  font-size: 28px;
}

.prospect-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.prospect-field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-stone);
  margin-bottom: 4px;
}

.prospect-field-value {
  font-family: var(--font-header);
  font-size: 16px;
  color: var(--c-forest-deep);
}

/* ============================================================================
   CONNECTING: BREATH PACER
   ============================================================================ */

.connecting-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--c-canvas);
  padding: 40px;
}

.breath-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 1px solid var(--c-gold-primary);
  animation: breathe-anim 8s infinite ease-in-out;
  box-shadow: 0 0 20px rgba(163, 140, 109, 0.1);
}

@keyframes breathe-anim {
  0% { transform: scale(0.8); opacity: 0.3; border-width: 1px; }
  50% { transform: scale(1.4); opacity: 1; border-width: 3px; box-shadow: 0 0 40px rgba(163, 140, 109, 0.3); }
  100% { transform: scale(0.8); opacity: 0.3; border-width: 1px; }
}

.connecting-text {
  margin-top: 32px;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--c-gold-text);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ============================================================================
   CALL INTERFACE: THE LIVING ORB
   ============================================================================ */

.call-interface {
  background-color: var(--c-void-bg);
  color: rgba(255, 255, 255, 0.9);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* === ORB STAGE === */
.orb-stage {
  width: 100%;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 30px rgba(163, 140, 109, 0.3));
}

/* === THE LIVING ORB === */
.living-orb {
  width: 180px;
  height: 180px;

  /* Sacred Gradient - gives volume */
  background: radial-gradient(
    circle at 35% 35%,
    #FDFBF7 0%,
    #EBE3D9 20%,
    #A38C6D 60%,
    #8F7A5E 100%
  );

  /* Initial Fluid Shape */
  border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%;

  /* Fluid Motion */
  animation: fluid-morph 6s ease-in-out infinite;
  will-change: border-radius;
}

@keyframes fluid-morph {
  0% { border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; transform: rotate(0deg); }
  33% { border-radius: 70% 30% 30% 70% / 60% 40% 60% 40%; transform: rotate(120deg); }
  66% { border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%; transform: rotate(240deg); }
  100% { border-radius: 42% 58% 70% 30% / 45% 45% 55% 55%; transform: rotate(360deg); }
}

/* === GLASS BAR (Bottom Controls) === */
.glass-bar {
  background: rgba(31, 38, 34, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px 24px 0 0;
  width: 100%;
  padding: 24px 32px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* === GLASS BUTTONS === */
.btn-glass {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-glass-danger {
  background: rgba(180, 91, 91, 0.25);
  border: 1px solid rgba(180, 91, 91, 0.4);
  color: #FFDEDE;
  padding: 0 32px;
  height: 56px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all var(--transition-base);
}

.btn-glass-danger:hover {
  background: rgba(180, 91, 91, 0.4);
}

/* === CALL TIMER === */
.call-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--c-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--c-glass-border);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  font-variant-numeric: tabular-nums;
}

.call-timer-dot {
  width: 8px;
  height: 8px;
  background: #EF4444;
  border-radius: var(--radius-circle);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* === END CALL BUTTON === */
.end-call-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: rgba(155, 44, 44, 0.9);
  border: none;
  border-radius: var(--radius-circle);
  color: white;
  cursor: pointer;
  transition: all var(--transition-base);
}

.end-call-button:hover {
  background: var(--c-error);
  transform: scale(1.05);
}

/* === TRANSCRIPT OVERLAY === */
.transcript-overlay {
  position: absolute;
  bottom: 100px;
  left: 0;
  right: 0;
  padding: 24px;
  background: linear-gradient(to top, var(--c-void-bg) 20%, transparent 100%);
  text-align: center;
}

.transcript-text {
  font-family: var(--font-header);
  font-style: italic;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 600px;
  margin: 0 auto;
}

.transcript-speaker {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
}

/* === TECHNIQUES HINT === */
.techniques-hint {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 24px;
  background: var(--c-glass);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--c-glass-border);
  font-family: var(--font-body);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

/* === BACKDROP-FILTER FALLBACK === */
@supports not (backdrop-filter: blur(8px)) {
  .call-timer, .techniques-hint, .glass-bar {
    background: rgba(31, 38, 34, 0.95);
  }
}

/* === MOBILE CALL INTERFACE === */
@media (max-width: 768px) {
  .living-orb {
    width: 140px;
    height: 140px;
  }
  .transcript-text { font-size: 16px; }
  .end-call-button { width: 48px; height: 48px; }
  .glass-bar { padding: 20px 24px 40px; }
}

/* ============================================================================
   PROGRESS INDICATORS
   ============================================================================ */

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--c-gold-faint);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--c-gold-primary), var(--c-gold-text));
  border-radius: var(--radius-pill);
  transition: width var(--transition-slow);
}

/* === LEVEL BADGES === */
.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 12px;
  background: var(--c-gold-faint);
  color: var(--c-gold-text);
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
}

.level-badge.is-unlocked {
  background: var(--c-gold-primary);
  color: white;
}

.level-badge.is-locked {
  background: var(--c-canvas);
  color: var(--c-stone);
  border: 1px dashed var(--c-stone);
}

.level-badge-l0 { background: #48bb78; color: white; }
.level-badge-l1 { background: #4299e1; color: white; }
.level-badge-l2 { background: #ed8936; color: white; }
.level-badge-l3 { background: #9f7aea; color: white; }

/* ============================================================================
   SESSION TABLE (Dashboard)
   ============================================================================ */

.session-table {
  width: 100%;
  border-collapse: collapse;
}

.session-table th {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-stone);
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--c-gold-faint);
}

.session-table td {
  padding: 16px;
  border-bottom: 1px solid var(--c-gold-faint);
  vertical-align: middle;
}

.session-table tr:nth-child(even) {
  background: var(--c-gold-faint);
}

.session-table tr:hover {
  background: rgba(163, 140, 109, 0.1);
}

.score-high { color: var(--c-success); font-weight: 700; }
.score-medium { color: var(--c-gold-text); font-weight: 700; }
.score-low { color: var(--c-stone); }

/* ============================================================================
   DIFFICULTY OPTIONS (Session Setup)
   ============================================================================ */

.difficulty-option {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  margin-bottom: 12px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: var(--c-surface);
  cursor: pointer;
  transition: all var(--transition-base);
}

.difficulty-option:hover {
  border-color: var(--c-gold-faint);
}

.difficulty-option.is-selected {
  border-color: var(--c-gold-primary);
  background: var(--c-gold-faint);
}

.difficulty-option.is-locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.difficulty-option-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.difficulty-option-name {
  font-family: var(--font-header);
  font-size: 18px;
  color: var(--c-forest-deep);
}

.difficulty-option-description {
  font-size: 14px;
  color: var(--c-stone);
  line-height: 1.5;
}

.difficulty-option-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.trait-badge {
  font-size: 11px;
  padding: 4px 10px;
  background: var(--c-canvas);
  border-radius: var(--radius-sm);
  color: var(--c-stone);
}

.lock-message {
  margin-top: 8px;
  font-size: 12px;
  color: var(--c-gold-text);
  font-style: italic;
}

/* ============================================================================
   PROCESSING STATE
   ============================================================================ */

.processing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 40px;
  text-align: center;
}

.alchemy-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid var(--c-gold-faint);
  border-top-color: var(--c-gold-primary);
  border-radius: var(--radius-circle);
  animation: spin 1.5s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.processing-title {
  margin-top: 32px;
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--c-gold-text);
}

.processing-subtitle {
  margin-top: 8px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--c-stone);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ============================================================================
   SCORE DISPLAY (Debrief)
   ============================================================================ */

.score-hero {
  text-align: center;
  padding: 48px 24px;
}

.score-ring {
  position: relative;
  width: 160px;
  height: 160px;
  margin: 0 auto 24px;
}

.score-ring-bg {
  position: absolute;
  inset: 0;
  border: 6px solid var(--c-gold-faint);
  border-radius: var(--radius-circle);
}

.score-ring-fill {
  position: absolute;
  inset: 0;
  border: 6px solid var(--c-gold-primary);
  border-radius: var(--radius-circle);
}

.score-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-number {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 600;
  color: var(--c-gold-text);
  line-height: 1;
}

.score-max {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--c-stone);
}

.score-label {
  font-family: var(--font-header);
  font-size: 20px;
  color: var(--c-forest-deep);
}

/* === RUBRIC CARDS === */
.rubric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.rubric-card {
  background: var(--c-surface);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-soft);
}

.rubric-category {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-stone);
  margin-bottom: 8px;
}

.rubric-score {
  font-family: var(--font-header);
  font-size: 24px;
  color: var(--c-forest-deep);
  margin-bottom: 12px;
}

.rubric-bar {
  height: 6px;
  background: var(--c-gold-faint);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.rubric-bar-fill {
  height: 100%;
  background: var(--c-gold-primary);
  border-radius: var(--radius-pill);
  transition: width 1s ease-out;
}

/* ============================================================================
   ERROR STATE
   ============================================================================ */

.error-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 40px;
  text-align: center;
}

.error-icon {
  width: 64px;
  height: 64px;
  color: rgba(155, 44, 44, 0.6);
  margin-bottom: 24px;
}

.error-title {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--c-forest-deep);
  margin-bottom: 12px;
}

.error-message {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--c-stone);
  max-width: 400px;
  margin-bottom: 32px;
}

.error-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* ============================================================================
   LAYOUT HELPERS
   ============================================================================ */

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px;
}

.container-narrow {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-2xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-2xl); }

/* === RESPONSIVE BREAKPOINTS === */
@media (max-width: 768px) {
  :root {
    --radius-lg: 16px;
  }
  .hide-on-mobile {
    display: none !important;
  }
  .container {
    padding: 16px;
  }
  .sacred-card, .card-sacred {
    padding: 20px;
  }
  .selection-card, .card-tarot {
    padding: 24px 16px;
  }
}

/* ============================================================================
   ACCORDION
   ============================================================================ */

.accordion {
  border: 1px solid rgba(163, 140, 109, 0.15);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.accordion-item {
  border-bottom: 1px solid rgba(163, 140, 109, 0.15);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 20px 24px;
  background: var(--c-surface);
  border: none;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--c-forest-deep);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.accordion-header:hover {
  background: var(--c-gold-faint);
}

.accordion-icon {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-base);
}

.accordion-item.is-open .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.accordion-item.is-open .accordion-content {
  max-height: 500px;
}

.accordion-body {
  padding: 0 24px 20px 24px;
  color: var(--c-forest-deep);
}

/* ============================================================================
   OBJECTIVES LIST
   ============================================================================ */

.objectives-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.objective-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
}

.objective-bullet {
  width: 20px;
  height: 20px;
  border: 2px solid var(--c-gold-primary);
  border-radius: var(--radius-circle);
  flex-shrink: 0;
  margin-top: 2px;
}

.objective-text {
  font-size: 16px;
  color: var(--c-forest-deep);
}
