@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700&family=Cinzel:wght@500;700&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ==========================================================================
   DESIGN SYSTEM & CUSTOM PROPERTIES
   ========================================================================== */
:root {
  /* Colors */
  --bg-darkest: #090710;
  --bg-deep: #0e0b1a;
  --bg-panel: rgba(18, 14, 34, 0.65);
  --bg-panel-solid: #120e22;
  
  --primary-gold: #d4af37;
  --primary-gold-hover: #f3cf59;
  --primary-gold-rgb: 212, 175, 55;
  --gold-glow: rgba(212, 175, 55, 0.35);
  
  --accent-white: #f5f5f7;
  --accent-white-muted: #a19fad;
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(212, 175, 55, 0.25);
  
  /* Fonts */
  --font-display: 'Cinzel', serif;
  --font-decorative: 'Cinzel Decorative', serif;
  --font-sans: 'Outfit', sans-serif;
  
  /* Box Shadow & Glows */
  --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --shadow-card: 0 12px 40px rgba(0, 0, 0, 0.7);
  --glow-light: 0 0 15px rgba(255, 255, 255, 0.1);
  --glow-gold: 0 0 20px rgba(212, 175, 55, 0.3);
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-card: 20px;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-darkest);
  color: var(--accent-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(26, 17, 54, 0.8) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(38, 22, 74, 0.6) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(14, 11, 26, 1) 0%, rgba(9, 7, 16, 1) 100%);
  background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  letter-spacing: 0.05em;
  font-weight: 700;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, textarea {
  font-family: inherit;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-darkest);
}
::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-gold);
}

/* ==========================================================================
   LAYOUT: HEADER & NAVIGATION
   ========================================================================== */
.main-header {
  background: rgba(9, 7, 16, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.8rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
}

.logo-icon {
  font-size: 1.8rem;
  color: var(--primary-gold);
  filter: drop-shadow(0 0 8px var(--primary-gold));
}

.logo-text {
  font-family: var(--font-decorative);
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, var(--primary-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--accent-white-muted);
  font-weight: 500;
  cursor: pointer;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-btn:hover, .nav-btn.active {
  color: var(--primary-gold);
  text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.nav-btn.cta-btn {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 0.2));
  border: 1px solid var(--primary-gold);
  color: var(--primary-gold);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.1);
}

.nav-btn.cta-btn:hover {
  background: var(--primary-gold);
  color: var(--bg-darkest);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.35);
  text-shadow: none;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--primary-gold);
  background: rgba(212, 175, 55, 0.08);
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
  border: 1px solid var(--border-gold);
}

.user-badge i {
  font-size: 0.9rem;
}

/* ==========================================================================
   APP SCREENS (SPA CONTAINERS)
   ========================================================================== */
.screen {
  flex: 1;
  display: none; /* Controlled by JS */
  padding: 2rem 1rem;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeIn var(--transition-normal);
}

.screen.active {
  display: flex;
  flex-direction: column;
}

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

/* ==========================================================================
   LANDING / HOME SCREEN
   ========================================================================== */
.hero-section {
  text-align: center;
  padding: 4rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.hero-title {
  font-family: var(--font-decorative);
  font-size: 3rem;
  background: linear-gradient(135deg, #fff 40%, var(--primary-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--accent-white-muted);
  max-width: 650px;
  line-height: 1.6;
}

.hero-decor {
  font-size: 2rem;
  color: var(--primary-gold);
  filter: drop-shadow(0 0 10px var(--primary-gold));
  margin: 1rem 0;
}

.question-box {
  background: var(--bg-panel);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--border-glass);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow-soft);
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  border-top: 2px solid var(--primary-gold);
}

.question-box h3 {
  font-size: 1.3rem;
  color: var(--accent-white);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.textarea-wrapper {
  position: relative;
}

.question-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  color: var(--accent-white);
  font-size: 1.05rem;
  resize: none;
  min-height: 100px;
  transition: var(--transition-fast);
  outline: none;
}

.question-input:focus {
  border-color: var(--primary-gold);
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.15);
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary-gold), #b8860b);
  color: var(--bg-darkest);
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  box-shadow: var(--glow-gold);
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(212, 175, 55, 0.6);
  background: linear-gradient(135deg, var(--primary-gold-hover), var(--primary-gold));
}

.primary-btn:active {
  transform: translateY(0);
}

.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   ACTIVE CONSULTATION (DRAW PHASE) SCREEN
   ========================================================================== */
.consultation-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

.consultation-progress {
  width: 100%;
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 1rem;
}

.consultation-progress::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border-glass);
  z-index: 1;
  transform: translateY(-50%);
}

.progress-bar-fill {
  position: absolute;
  top: 50%;
  left: 0;
  height: 2px;
  background: var(--primary-gold);
  z-index: 2;
  transform: translateY(-50%);
  transition: width var(--transition-normal);
  width: 0%;
}

.progress-step {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-deep);
  border: 2px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent-white-muted);
  position: relative;
  z-index: 3;
  transition: var(--transition-fast);
}

.progress-step.active {
  border-color: var(--primary-gold);
  color: var(--primary-gold);
  box-shadow: var(--glow-gold);
  background: var(--bg-panel-solid);
}

.progress-step.completed {
  border-color: var(--primary-gold);
  background: var(--primary-gold);
  color: var(--bg-darkest);
}

.draw-prompt-title {
  text-align: center;
  font-size: 1.8rem;
  color: var(--accent-white);
  min-height: 2.5rem;
}

.draw-prompt-subtitle {
  text-align: center;
  color: var(--accent-white-muted);
  font-size: 1.1rem;
  margin-top: -1rem;
}

/* Shuffling & Drawing Deck Area */
.deck-area {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 380px;
  width: 100%;
  position: relative;
  perspective: 1200px;
  margin: 1.5rem 0;
}

/* 3D Card Styling */
.card-container {
  width: 240px;
  height: 360px;
  position: relative;
  cursor: pointer;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: absolute;
  transform-style: preserve-3d;
  transition: transform var(--transition-slow);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
}

.card-container:hover .card-inner:not(.flipped) {
  transform: translateY(-10px) rotateY(5deg);
  box-shadow: 0 15px 45px rgba(212, 175, 55, 0.15), var(--shadow-card);
}

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

.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border-glass);
}

/* Card Back (Mystical Pattern) */
.card-back {
  background-color: #0b0813;
  background-image: url('card-back.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid var(--primary-gold);
}

.card-back-design {
  border: 1px solid var(--border-gold);
  width: 100%;
  height: 100%;
  border-radius: calc(var(--radius-card) - 4px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.card-back-design::before {
  content: '';
  position: absolute;
  width: 160%;
  height: 160%;
  border: 1px dashed rgba(212, 175, 55, 0.15);
  border-radius: 50%;
  animation: rotateDeck 25s linear infinite;
}

.card-back-symbol {
  font-size: 3.5rem;
  color: var(--primary-gold);
  filter: drop-shadow(0 0 12px var(--primary-gold));
  z-index: 2;
}

.card-back-text {
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.3em;
  color: var(--accent-white-muted);
  text-transform: uppercase;
  z-index: 2;
}

@keyframes rotateDeck {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Card Front (Revealed Content) */
.card-front {
  background: var(--bg-panel-solid);
  transform: rotateY(180deg);
  border: 2px solid var(--card-theme-color, var(--primary-gold));
  box-shadow: 0 0 30px rgba(var(--card-theme-rgb, 212, 175, 55), 0.15);
  display: flex;
  flex-direction: column;
}

.card-header-glow {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-glass);
  background: rgba(var(--card-theme-rgb, 212, 175, 55), 0.05);
}

.card-body-content {
  flex: 1;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
}

.card-front-icon {
  font-size: 4rem;
  color: var(--card-theme-color, var(--primary-gold));
  filter: drop-shadow(0 0 15px var(--card-theme-color, var(--primary-gold)));
  margin-bottom: 0.5rem;
}

.card-subtitle {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--accent-white-muted);
  letter-spacing: 0.1em;
}

.card-description-preview {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--accent-white);
  opacity: 0.95;
}

/* ==========================================================================
   RESULT SCREEN (INTERPRETATION SHOWCASE)
   ========================================================================== */
.results-container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.results-header {
  text-align: center;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 1.5rem;
}

.results-title {
  font-family: var(--font-decorative);
  font-size: 2.2rem;
  color: var(--primary-gold);
  margin-bottom: 0.5rem;
}

.results-question {
  font-style: italic;
  font-size: 1.15rem;
  color: var(--accent-white-muted);
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
}

@media (max-width: 768px) {
  .results-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.result-pillar {
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
}

.result-pillar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--pillar-theme, var(--primary-gold));
}

.pillar-title-block {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pillar-icon {
  font-size: 2.2rem;
  color: var(--pillar-theme, var(--primary-gold));
}

.pillar-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--accent-white-muted);
  letter-spacing: 0.1em;
}

.pillar-name {
  font-size: 1.6rem;
  font-family: var(--font-display);
}

.cards-showcase {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin: 1rem 0;
}

.mini-card {
  width: 110px;
  height: 165px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--pillar-theme, var(--primary-gold));
  background: var(--bg-deep);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.8rem;
  text-align: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.mini-card-icon {
  font-size: 2.2rem;
  color: var(--pillar-theme, var(--primary-gold));
}

.mini-card-title {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.mini-card-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  color: var(--accent-white-muted);
}

.interpretation-text {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--accent-white);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.text-block-highlight {
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem;
  border-left: 2px solid var(--pillar-theme, var(--primary-gold));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 1rem;
}

/* Visitor Locked State (Entidade Pillar Blurry) */
.locked-pillar {
  filter: blur(4px);
  pointer-events: none;
  user-select: none;
  opacity: 0.6;
}

.lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(9, 7, 16, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
  gap: 1.2rem;
  z-index: 5;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-gold);
}

.lock-icon {
  font-size: 3rem;
  color: var(--primary-gold);
  filter: drop-shadow(0 0 8px var(--primary-gold));
}

.lock-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: #fff;
}

.lock-desc {
  font-size: 0.95rem;
  color: var(--accent-white-muted);
  max-width: 320px;
  line-height: 1.5;
}

/* Consolidation Block */
.consolidation-block {
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-soft), var(--glow-gold);
  text-align: center;
}

.consolidation-block h3 {
  font-size: 1.4rem;
  color: var(--primary-gold);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.consolidation-text {
  max-width: 800px;
  margin: 0 auto 1.5rem auto;
}

.consolidation-header {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--primary-gold);
  opacity: 0.85;
  margin-bottom: 0.6rem;
  font-weight: 600;
  text-align: center;
}

.consolidation-key-phrase {
  font-family: var(--font-title);
  font-size: 1.8rem;
  color: #fff;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
  margin-bottom: 2rem;
  font-style: italic;
  background: linear-gradient(135deg, #fff 30%, var(--primary-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  text-align: center;
  font-weight: bold;
}

.consolidation-subtitle {
  font-size: 1.15rem;
  color: var(--primary-gold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  margin-top: 2.2rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
}

.consolidation-subtitle::before,
.consolidation-subtitle::after {
  content: "✦";
  color: var(--primary-gold);
  font-size: 0.8rem;
  opacity: 0.7;
}

.consolidation-paragraph {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--accent-white-muted);
  margin-bottom: 1.2rem;
  text-align: justify;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.95;
}

.consolidation-oraculo-quote {
  font-family: var(--font-title);
  font-size: 1.35rem;
  line-height: 1.6;
  font-style: italic;
  color: #fff;
  background: rgba(212, 175, 55, 0.05);
  border-left: 3px solid var(--primary-gold);
  border-right: 3px solid var(--primary-gold);
  border-radius: 6px;
  padding: 1.5rem 2rem;
  margin: 1.8rem auto 1rem auto;
  max-width: 600px;
  text-align: center;
  box-shadow: inset 0 0 15px rgba(212, 175, 55, 0.08);
  border-top: 1px solid rgba(212, 175, 55, 0.1);
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.results-actions {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.secondary-btn {
  background: transparent;
  border: 1px solid var(--accent-white-muted);
  color: var(--accent-white-muted);
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.secondary-btn:hover {
  border-color: #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.link-btn {
  background: transparent;
  border: none;
  color: var(--primary-gold);
  cursor: pointer;
  font-size: 1rem;
  font-family: inherit;
  text-decoration: underline;
  transition: var(--transition-fast);
  padding: 0.5rem 1rem;
}

.link-btn:hover {
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ==========================================================================
   HISTORY SCREEN (TIMELINE & EXPANDABLE READINGS)
   ========================================================================== */
.history-title-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.history-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  transition: var(--transition-normal);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  cursor: pointer;
}

.history-card:hover {
  border-color: var(--border-gold);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.08);
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.history-card-meta {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.history-card-date {
  font-size: 0.85rem;
  color: var(--accent-white-muted);
}

.history-card-question {
  font-size: 1.1rem;
  font-weight: 600;
  color: #fff;
}

.history-card-draws {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.history-badge {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  padding: 0.3rem 0.7rem;
  border-radius: 50px;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.history-badge.orixa-badge {
  border-color: rgba(var(--orixa-rgb, 212, 175, 55), 0.3);
  color: var(--orixa-color, var(--primary-gold));
  background: rgba(var(--orixa-rgb, 212, 175, 55), 0.05);
}

.history-badge.entidade-badge {
  border-color: rgba(var(--entidade-rgb, 212, 175, 55), 0.3);
  color: var(--entidade-color, var(--primary-gold));
  background: rgba(var(--entidade-rgb, 212, 175, 55), 0.05);
}

.history-card-content {
  display: none; /* Controlled by toggle class */
  border-top: 1px solid var(--border-glass);
  padding-top: 1.2rem;
  margin-top: 0.5rem;
  animation: fadeIn var(--transition-fast);
}

.history-card.expanded .history-card-content {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.notes-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 1.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  margin-top: 0.5rem;
}

.notes-section label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--primary-gold);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.notes-textarea {
  width: 100%;
  min-height: 80px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
  color: var(--accent-white);
  resize: vertical;
  outline: none;
  font-size: 0.95rem;
}

.notes-textarea:focus {
  border-color: var(--primary-gold);
}

.notes-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

.empty-history-state {
  text-align: center;
  padding: 5rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  background: var(--bg-panel);
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-lg);
}

.empty-icon {
  font-size: 4rem;
  color: var(--accent-white-muted);
  opacity: 0.4;
}

/* ==========================================================================
   NATIVE DIALOGS (MODALS FOR AUTH)
   ========================================================================== */
dialog::backdrop {
  background-color: rgba(9, 7, 16, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

dialog {
  border: 1px solid var(--border-gold);
  border-top: 4px solid var(--primary-gold);
  border-radius: var(--radius-lg);
  background: var(--bg-panel-solid);
  color: var(--accent-white);
  padding: 2.5rem;
  max-width: 420px;
  width: 90%;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), var(--glow-gold);
  outline: none;
  animation: modalScale var(--transition-normal);
}

@keyframes modalScale {
  from { opacity: 0; transform: translate(-50%, -45%) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

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

.dialog-title {
  font-size: 1.4rem;
  font-family: var(--font-display);
  color: var(--primary-gold);
}

.close-dialog-btn {
  background: transparent;
  border: none;
  color: var(--accent-white-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 0.2rem;
}

.close-dialog-btn:hover {
  color: #fff;
}

.dialog-form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

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

.form-group label {
  font-size: 0.85rem;
  color: var(--accent-white-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
  color: var(--accent-white);
  font-size: 1rem;
  outline: none;
  transition: var(--transition-fast);
}

.form-input:focus {
  border-color: var(--primary-gold);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
}

.dialog-footer {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--accent-white-muted);
}

.dialog-footer button {
  background: transparent;
  border: none;
  color: var(--primary-gold);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  padding: 0 0.2rem;
}

.dialog-footer button:hover {
  color: var(--primary-gold-hover);
}

.error-message {
  color: #ef4444;
  font-size: 0.85rem;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.6rem;
  border-radius: var(--radius-sm);
  display: none; /* Show dynamically */
  text-align: left;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.main-footer {
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: 0.85rem;
  color: var(--accent-white-muted);
  border-top: 1px solid var(--border-glass);
  margin-top: auto;
  background: rgba(9, 7, 16, 0.5);
}

.footer-decor {
  font-size: 1.2rem;
  color: var(--primary-gold);
  margin-bottom: 0.8rem;
  opacity: 0.7;
}

/* ==========================================================================
   FONT AWESOME CDN EQUIVALENT (USING UNICODE ICONS IN CSS & HTML)
   ========================================================================== */
/* We will use generic UTF-8 symbols and simple shapes in HTML for icons,
   but we also add beautiful styling for them here to make them look uniform. */
.x-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
}

/* ==========================================================================
   INFO SECTION: PHILOSOPHY OF THE ORACLE
   ========================================================================== */
.info-section {
  width: 100%;
  max-width: 900px;
  margin: 4rem auto 0 auto;
  text-align: left;
  border-top: 1px solid var(--border-glass);
  padding-top: 3rem;
}

.info-section-title {
  font-family: var(--font-decorative);
  font-size: 1.8rem;
  color: var(--primary-gold);
  text-align: center;
  margin-bottom: 2rem;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

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

.info-card {
  background: var(--bg-panel);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  box-shadow: var(--shadow-soft);
  transition: var(--transition-fast);
}

.info-card:hover {
  border-color: var(--border-gold);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.05);
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  padding-bottom: 0.8rem;
}

.info-card-icon {
  font-size: 1.8rem;
  color: var(--primary-gold);
}

.info-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: #fff;
}

.info-card-subtitle {
  font-size: 0.8rem;
  color: var(--primary-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

.info-card-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--accent-white-muted);
}

.info-card-text strong {
  color: var(--accent-white);
}

.info-consolidation {
  background: rgba(212, 175, 55, 0.03);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  text-align: center;
  box-shadow: var(--glow-gold);
}

.info-consolidation-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--primary-gold);
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.info-consolidation-text {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--accent-white);
  max-width: 750px;
  margin: 0 auto;
}

.spiral-decor {
  width: 24px;
  height: 24px;
  color: var(--primary-gold);
  filter: drop-shadow(0 0 6px var(--primary-gold));
}

.print-visitor-warning {
  display: none;
}

/* ==========================================================================
   PRINT MEDIA STYLES (PDF GENERATION)
   ========================================================================== */
@media print {
  /* Restrição de Impressão para Visitantes */
  body.is-visitor .main-header,
  body.is-visitor .main-footer,
  body.is-visitor main,
  body.is-visitor dialog {
    display: none !important;
  }
  body.is-visitor .print-visitor-warning {
    display: block !important;
    text-align: center;
    padding: 3rem;
    margin: 5rem auto;
    max-width: 600px;
    border: 2px dashed #b8860b;
    border-radius: 8px;
    background: #fff !important;
    color: #1a1a1a !important;
    font-family: system-ui, -apple-system, sans-serif;
  }
  body.is-visitor .print-visitor-warning h2 {
    color: #b8860b !important;
    margin-bottom: 1rem;
    font-size: 22pt;
    font-weight: bold;
  }
  body.is-visitor .print-visitor-warning p {
    color: #333 !important;
    font-size: 13pt;
    line-height: 1.6;
    margin-bottom: 0.5rem;
  }

  /* Oculta componentes não imprimíveis do aplicativo */
  .main-header, 
  .main-footer, 
  .results-actions, 
  #screen-home, 
  #screen-draw, 
  #screen-history, 
  dialog, 
  .lock-overlay {
    display: none !important;
  }

  /* Exibe a tela de resultados de forma contínua no fluxo normal */
  #screen-results {
    display: block !important;
    position: relative !important; /* Correção crucial: relativo para permitir quebras naturais */
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #ffffff !important;
    color: #1a1a1a !important;
  }

  body {
    background: #ffffff !important;
    color: #1a1a1a !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
  }

  /* Container de Resultados em Impressão */
  .results-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0.5cm !important;
  }

  .results-title {
    color: #8b6b00 !important;
    font-size: 24pt !important;
    text-align: center;
    font-family: 'Cinzel', serif;
    margin-bottom: 0.5rem !important;
  }

  .results-question {
    color: #555555 !important;
    font-size: 12pt !important;
    text-align: center;
    padding-bottom: 0.5rem !important;
    margin-bottom: 0.5rem !important;
  }

  .print-meta-block {
    display: flex !important;
    justify-content: space-between;
    margin-bottom: 2rem !important;
    font-size: 11pt !important;
    color: #444444 !important;
    border-bottom: 2px solid #eaeaea;
    padding-bottom: 0.8rem !important;
  }

  /* Correção de Grid para Bloco para empilhar verticalmente e respeitar as páginas */
  .results-grid {
    display: block !important;
    margin-bottom: 0 !important;
  }

  /* Remove os borrões do visitante ao imprimir (se houver bloqueio, oculta a coluna de forma elegante) */
  .locked-pillar {
    filter: none !important;
    opacity: 0.3 !important;
  }

  body.is-visitor #result-pillar-entidade,
  body.is-visitor #consolidation-block {
    display: none !important;
  }

  .result-pillar {
    background: #ffffff !important;
    border: 1px solid #dddddd !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    margin-bottom: 2rem !important; /* Espaçamento entre os blocos empilhados */
    box-shadow: none !important;
    color: #1a1a1a !important;
    page-break-inside: avoid !important; /* Impede que o bloco do Orixá ou Entidade seja partido ao meio */
  }

  .result-pillar::before {
    display: none !important;
  }

  .pillar-name {
    color: #8b6b00 !important;
    font-size: 18pt !important;
  }

  /* Mini cards mais compactos para economizar espaço em impressão */
  .mini-card {
    background: #f4f4f5 !important;
    border: 1px solid #cccccc !important;
    color: #1a1a1a !important;
    box-shadow: none !important;
    padding: 0.5rem !important;
    height: auto !important;
    width: 95px !important;
  }

  .mini-card-icon {
    font-size: 1.8rem !important;
  }

  .mini-card-title {
    font-size: 0.7rem !important;
  }

  .text-block-highlight {
    background: #f9f9fb !important;
    border-left: 3px solid #8b6b00 !important;
    color: #333333 !important;
    padding: 0.8rem !important;
  }

  /* Bloco de consolidação em impressão */
  .consolidation-block {
    background: #fdfbf7 !important;
    border: 1px solid #ebd48e !important;
    border-radius: 12px !important;
    padding: 1.5rem !important;
    box-shadow: none !important;
    margin-top: 2rem !important;
    page-break-inside: avoid !important; /* Impede quebra no meio da consolidação */
  }

  .consolidation-block h3 {
    color: #8b6b00 !important;
    font-size: 14pt !important;
    font-family: 'Cinzel', serif;
  }

  /* ÁREA DE ANOTAÇÕES PAUTADAS EXCLUSIVA PARA IMPRESSÃO/PDF */
  .print-notes-area {
    display: block !important;
    margin-top: 2.5rem !important;
    border-top: 2px dashed #dddddd !important;
    padding-top: 1.5rem !important;
    page-break-inside: avoid !important; /* Impede que a área de anotações quebre */
  }

  .print-notes-area h3 {
    font-family: 'Cinzel', serif !important;
    font-size: 13pt !important;
    color: #8b6b00 !important;
    margin-bottom: 1.2rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
  }

  .print-note-line {
    border-bottom: 1px dashed #cccccc !important;
    height: 32px !important;
    width: 100% !important;
    margin-bottom: 6px !important;
  }

  /* Overrides de consolidação para impressão em papel branco */
  .consolidation-header {
    color: #444444 !important;
    text-align: center !important;
  }

  .consolidation-key-phrase {
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
    color: #8b6b00 !important;
    font-size: 16pt !important;
    text-shadow: none !important;
    text-align: center !important;
    font-weight: bold !important;
    display: block !important;
    margin-bottom: 1.5rem !important;
  }

  .consolidation-subtitle {
    color: #8b6b00 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.8rem !important;
    font-size: 12pt !important;
    text-align: center !important;
  }

  .consolidation-subtitle::before,
  .consolidation-subtitle::after {
    color: #8b6b00 !important;
  }

  .consolidation-paragraph {
    color: #222222 !important;
    font-size: 11pt !important;
    line-height: 1.6 !important;
    text-align: justify !important;
  }

  .consolidation-oraculo-quote {
    color: #111111 !important;
    font-size: 12pt !important;
    background: #fdfbf7 !important;
    border-left: 3px solid #8b6b00 !important;
    border-right: 3px solid #8b6b00 !important;
    box-shadow: none !important;
    padding: 1rem 1.5rem !important;
    margin: 1.5rem auto !important;
  }
}

/* ==========================================================================
   ADMIN PANEL STYLES
   ========================================================================== */
.admin-table-container {
  overflow-x: auto;
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
  margin-top: 1.5rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--accent-white);
  font-size: 1rem;
}

.admin-table th, .admin-table td {
  padding: 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table th {
  font-family: var(--font-display);
  color: var(--primary-gold);
  font-weight: 700;
  text-align: left;
  border-bottom: 2px solid var(--primary-gold);
  letter-spacing: 0.05em;
}

.admin-table tbody tr {
  transition: background var(--transition-fast);
}

.admin-table tbody tr:hover {
  background: rgba(212, 175, 55, 0.04);
}

@media (max-width: 600px) {
  .admin-table th, .admin-table td {
    padding: 0.8rem;
    font-size: 0.9rem;
  }
}

/* ==========================================================================
   RESPONSIVE LAYOUT ADJUSTMENTS FOR TABLETS AND MOBILE
   ========================================================================== */
.history-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  /* Header & Navigation */
  .main-header {
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    text-align: center;
  }
  .nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  .nav-btn {
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
  }

  /* Home/Hero Section */
  .hero-section {
    padding: 2rem 0.5rem;
    gap: 1.2rem;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .hero-subtitle {
    font-size: 1.05rem;
  }
  
  /* Question box */
  .question-box {
    padding: 1.5rem;
    gap: 1.2rem;
  }

  /* Sorteio / Deck Screen */
  .draw-prompt-title {
    font-size: 1.5rem;
  }
  .draw-prompt-subtitle {
    font-size: 1rem;
  }

  /* Result screen */
  .result-pillar {
    padding: 1.2rem;
    gap: 1.2rem;
  }
  
  /* History Screen */
  .history-card {
    padding: 1rem;
  }
  .history-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .history-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
  .history-card-draws {
    width: 100%;
  }
}

@media (max-width: 480px) {
  /* Hero typography */
  .hero-title {
    font-size: 1.8rem;
  }
  
  /* Cards mini showcases */
  .cards-showcase {
    gap: 0.5rem;
  }
  .mini-card {
    width: 48%;
    height: 140px;
    padding: 0.6rem;
  }
  .mini-card-icon {
    font-size: 1.8rem;
  }
  .mini-card-title {
    font-size: 0.7rem;
  }

  /* Action buttons */
  .primary-btn {
    font-size: 0.95rem;
    padding: 0.8rem 1.5rem;
  }
}

