/* ==========================================================================
   CRUX SACRA — CATECHISM QUEST SACRED STYLESHEET
   Aesthetic: Sacred Catholic, Vatican Gold, Marian Blue, Illuminated Parchment
   Characters: Crux Sacra 1 & 2 Animated Companions, Speech & Lifelines
   ========================================================================== */

:root {
  --primary: #0f2b5c;
  --primary-light: #1c4587;
  --primary-dark: #071733;
  --gold: #c59b27;
  --gold-hover: #dbb037;
  --gold-light: #fef7e0;
  --gold-border: #d4af37;
  --crimson: #8b1523;
  --crimson-light: #fbebee;
  --bg-page: #f6f3eb;
  --card-bg: #ffffff;
  --card-parchment: #fdfbf7;
  --text-main: #1c232b;
  --text-muted: #5e6977;
  --success: #198754;
  --success-bg: #d1e7dd;
  --error: #dc3545;
  --error-bg: #f8d7da;
  --border-color: #e5dac6;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(15, 43, 92, 0.06);
  --shadow-md: 0 6px 20px rgba(15, 43, 92, 0.1);
  --shadow-gold: 0 0 16px rgba(197, 155, 39, 0.35);
  --font-serif: 'Cinzel', Georgia, serif;
  --font-body: 'Lora', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-page);
  background-image: radial-gradient(#e5dec9 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
}

/* ==========================================================================
   TOP MASTHEAD (FJ FAITH & FAMILY)
   ========================================================================== */
.site-masthead {
  background: #14171a;
  color: #f7f1e4;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  font-size: 0.8rem;
  padding: 0.4rem 1.5rem;
}

.masthead-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.masthead-brand {
  color: #f7f1e4;
  text-decoration: none;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: color 0.2s;
}

.masthead-brand:hover {
  color: var(--gold);
}

.masthead-cross {
  color: var(--gold);
}

.masthead-scripture {
  color: rgba(247, 241, 228, 0.7);
  font-size: 0.75rem;
  font-style: italic;
}

.masthead-link {
  color: var(--gold-light);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.75rem;
  transition: color 0.2s;
}

.masthead-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.app-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #ffffff;
  padding: 0.85rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.cross-emblem {
  font-size: 1.8rem;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(197, 155, 39, 0.6);
  transition: transform 0.3s;
}

.brand-logo:hover .cross-emblem {
  transform: rotate(15deg) scale(1.1);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: #ffffff;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--gold-light);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.companion-header-btn {
  background: rgba(197, 155, 39, 0.25);
  border: 1px solid var(--gold);
  color: #ffffff;
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.companion-header-btn:hover {
  background: var(--gold);
  color: var(--primary-dark);
}

.rank-badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
}

.xp-badge {
  background: rgba(255, 255, 255, 0.15);
  padding: 0.35rem 0.7rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--gold-light);
}

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

.icon-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--gold);
  border-color: var(--gold);
  transform: scale(1.05);
}

.icon-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(197, 155, 39, 0.6);
}

.lang-btn {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 0.45rem 0.85rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.82rem;
  transition: all 0.2s;
}

.lang-btn:hover {
  background: #ffffff;
  color: var(--primary);
}

/* ==========================================================================
   MAIN CONTENT & SCREENS
   ========================================================================== */
.app-main {
  flex: 1;
  max-width: 920px;
  width: 100%;
  margin: 1.5rem auto;
  padding: 0 1.25rem 3rem;
}

.screen {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.screen.active {
  display: block;
}

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

/* ==========================================================================
   SCREEN 1: HERO & HOME HUB
   ========================================================================== */
.hero-banner {
  background: linear-gradient(135deg, #ffffff 0%, var(--card-parchment) 100%);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '☩';
  position: absolute;
  top: -20px;
  right: -20px;
  font-size: 8rem;
  color: rgba(197, 155, 39, 0.07);
  pointer-events: none;
}

.latin-motto {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--crimson);
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
}

.hero-heading {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

.hero-subtext {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 680px;
  margin: 0 auto 1.5rem;
}

/* COMPANION SHOWCASE WIDGET IN HUB */
.companion-quick-showcase {
  background: var(--gold-light);
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.companion-quick-showcase:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-gold);
}

.cqs-avatar {
  font-size: 2.6rem;
  background: white;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.cqs-info {
  flex: 1;
}

.cqs-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #785400;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.cqs-info h4 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin: 0.1rem 0;
}

.cqs-info p {
  font-size: 0.85rem;
  color: #5c4100;
  line-height: 1.3;
}

.cqs-change-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.45rem 0.85rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

/* MODES GRID */
.modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.mode-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 2px solid var(--border-color);
  padding: 1.4rem;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.mode-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.mode-gauntlet:hover { border-color: var(--crimson); }
.mode-blitz:hover { border-color: var(--gold); }
.mode-study:hover { border-color: var(--primary); }

.mode-icon {
  font-size: 2.2rem;
  margin-bottom: 0.6rem;
}

.mode-content h3 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.mode-content p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.85rem;
}

.mode-tag {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  text-transform: uppercase;
}

.tag-survival { background: var(--crimson-light); color: var(--crimson); }
.tag-time { background: var(--gold-light); color: #855f00; }
.tag-study { background: #e8f0fe; color: var(--primary); }

/* SECTION DIVIDER */
.section-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.divider-cross {
  color: var(--gold);
  font-size: 1.4rem;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--primary-dark);
}

/* WORLDS GRID */
.worlds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.world-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.world-card:hover {
  transform: translateY(-5px);
  border-color: var(--gold-border);
  box-shadow: var(--shadow-gold);
}

.world-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.world-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.world-subtitle {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.world-stars {
  font-size: 1.2rem;
  letter-spacing: 2px;
  color: #f59e0b;
}

/* SISTER GAMES */
.sister-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.sister-card {
  background: var(--card-parchment);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.sister-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
  background: #ffffff;
}

.sister-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.sister-body h4 {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 0.35rem;
}

.sister-body p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

.sister-link-badge {
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  background: #e8f0fe;
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
  transition: background 0.2s;
}

.sister-card:hover .sister-link-badge {
  background: var(--gold);
  color: white;
}

/* ==========================================================================
   SCREEN 2: ACTIVE QUIZ ARENA WITH COMPANION & LIFELINES
   ========================================================================== */
.quiz-arena-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  padding: 2rem;
  box-shadow: var(--shadow-md);
}

.quiz-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.back-link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.back-link-btn:hover {
  background: #e8f0fe;
}

.diff-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: 15px;
  text-transform: uppercase;
}

.diff-novice { background: #d1e7dd; color: #0f5132; }
.diff-disciple { background: #cfe2ff; color: #084298; }
.diff-scholar { background: #fff3cd; color: #664d03; border: 1px solid #ffecb5; }

.quiz-indicator {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.quiz-streak-pill {
  background: #ffe8cc;
  color: #d9480f;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 15px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.quiz-lives-pill {
  font-size: 1.1rem;
  letter-spacing: 2px;
}

.quiz-timer-pill {
  background: #f8d7da;
  color: #842029;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 15px;
  font-size: 0.85rem;
}

.quiz-score-pill {
  font-weight: 800;
  color: var(--primary);
  font-size: 1rem;
}

/* COMPANION ARENA BOX */
.companion-arena-box {
  background: linear-gradient(135deg, #fefbf4 0%, #f7f1e4 100%);
  border: 2px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(197, 155, 39, 0.12);
}

.companion-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
}

.companion-avatar-icon {
  font-size: 2.8rem;
  background: #ffffff;
  border: 2px solid var(--gold);
  border-radius: 50%;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.companion-portrait:hover .companion-avatar-icon {
  transform: scale(1.08);
}

.companion-emblem-badge {
  position: absolute;
  bottom: 16px;
  right: -2px;
  font-size: 1rem;
  background: #ffffff;
  border-radius: 50%;
  padding: 1px 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.companion-name-tag {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-top: 0.3rem;
  text-align: center;
  white-space: nowrap;
}

.companion-speech-bubble {
  flex: 1;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.1rem;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.companion-speech-bubble::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 18px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 8px solid #ffffff;
}

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

.companion-role-title {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 700;
}

.speech-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.speech-advice-btn {
  background: var(--gold-light);
  border: 1px solid var(--gold);
  color: #785400;
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s;
}

.speech-advice-btn:hover {
  background: var(--gold);
  color: #ffffff;
  transform: translateY(-1px);
}

.speech-audio-btn {
  background: #e8f0fe;
  border: 1px solid #c2d7fa;
  color: var(--primary);
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.2s;
}

.speech-audio-btn:hover {
  background: var(--gold-light);
  border-color: var(--gold);
}

.speech-audio-btn.speaking {
  background: #f8d7da;
  border-color: var(--error);
  color: var(--error);
  animation: pulse 0.8s infinite alternate;
}

.speech-message {
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--text-main);
  line-height: 1.45;
}

/* LIFELINES TOOLBAR */
.lifelines-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.lifeline-btn {
  background: var(--card-parchment);
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s;
}

.lifeline-btn:hover:not(:disabled) {
  background: var(--gold-light);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.lifeline-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f1f3f5;
}

/* QUESTION CONTAINER */
.question-container {
  margin-bottom: 1.75rem;
}

.question-title {
  font-family: var(--font-body);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--primary-dark);
  line-height: 1.45;
}

.options-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.option-btn {
  background: var(--card-parchment);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  text-align: left;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  transition: all 0.2s ease;
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.4;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--gold);
  background: #ffffff;
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}

.opt-letter {
  background: #e2e8f0;
  color: var(--primary-dark);
  font-weight: 800;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.option-btn.correct {
  background: var(--success-bg) !important;
  border-color: var(--success) !important;
  color: #0f5132 !important;
}

.option-btn.correct .opt-letter {
  background: var(--success);
  color: white;
}

.option-btn.wrong {
  background: var(--error-bg) !important;
  border-color: var(--error) !important;
  color: #842029 !important;
}

.option-btn.wrong .opt-letter {
  background: var(--error);
  color: white;
}

/* CATECHESIS INSIGHT CARD */
.catechesis-insight-card {
  background: #fdfaf2;
  border: 2px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 4px 12px rgba(197, 155, 39, 0.15);
  animation: slideUp 0.3s ease-out;
}

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

.catechesis-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.catechesis-icon {
  font-size: 1.5rem;
}

.status-correct {
  color: var(--success);
  font-weight: 700;
  font-size: 1.1rem;
}

.status-wrong {
  color: var(--crimson);
  font-weight: 700;
  font-size: 1.1rem;
}

.catechesis-body {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--text-main);
  line-height: 1.55;
  margin-bottom: 1rem;
}

.catechesis-citation {
  background: rgba(197, 155, 39, 0.12);
  border-left: 4px solid var(--gold);
  padding: 0.6rem 0.85rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
  color: #634300;
  margin-bottom: 1.25rem;
}

.continue-action-btn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
  box-shadow: 0 4px 10px rgba(15, 43, 92, 0.2);
}

.continue-action-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* ==========================================================================
   SCREEN 3: LESSON COMPLETE / RESULTS
   ========================================================================== */
.result-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 2px solid var(--gold-border);
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.result-crest {
  font-size: 3rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.result-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  color: var(--primary-dark);
  margin-bottom: 0.5rem;
}

.stars-display {
  font-size: 3.2rem;
  margin: 0.75rem 0 1.25rem;
  letter-spacing: 4px;
}

.result-details {
  background: var(--card-parchment);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  max-width: 450px;
  margin: 0 auto 2rem;
  font-size: 1.1rem;
}

.result-details p {
  margin-bottom: 0.5rem;
}

.result-details p:last-child {
  margin-bottom: 0;
}

.result-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.action-btn {
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.primary-btn {
  background: var(--primary);
  color: white;
  border: none;
}

.primary-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.secondary-btn {
  background: var(--gold-light);
  color: #785400;
  border: 2px solid var(--gold);
}

.secondary-btn:hover {
  background: var(--gold);
  color: white;
  transform: translateY(-2px);
}

/* ==========================================================================
   SCREEN 4: STUDY HALL / FLASHCARDS
   ========================================================================== */
.study-header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.study-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  color: var(--primary);
}

.study-select {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border-color);
  font-weight: 600;
  font-size: 0.9rem;
  background: white;
  cursor: pointer;
}

.study-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.study-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.study-card-header {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.study-pillar-tag {
  font-size: 0.75rem;
  font-weight: 800;
  background: #e8f0fe;
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
}

.study-diff-tag {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 10px;
  text-transform: uppercase;
}

.study-question {
  font-family: var(--font-body);
  font-size: 1.15rem;
  color: var(--primary-dark);
  margin-bottom: 0.75rem;
}

.study-answer {
  background: var(--success-bg);
  color: #0f5132;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.65rem;
  font-size: 0.95rem;
}

.study-hint-preview {
  font-size: 0.9rem;
  color: #785400;
  background: var(--gold-light);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.study-explanation {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.study-source {
  font-size: 0.85rem;
  color: #785400;
  border-top: 1px dashed var(--border-color);
  padding-top: 0.6rem;
}

/* ==========================================================================
   CHARACTERS MODAL
   ========================================================================== */
.modal-characters {
  max-width: 840px;
}

.char-section-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--primary);
  margin-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.35rem;
}

.characters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
}

.character-select-card {
  background: var(--card-parchment);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

.character-select-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
  background: #ffffff;
}

.character-select-card.selected {
  border-color: var(--gold);
  background: var(--gold-light);
  box-shadow: 0 0 12px rgba(197, 155, 39, 0.4);
}

.char-icon-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.char-avatar {
  font-size: 2.2rem;
  background: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.char-emblem {
  font-size: 1.2rem;
}

.char-meta {
  flex: 1;
}

.char-name {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: var(--primary-dark);
  margin-bottom: 0.15rem;
}

.char-title-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #785400;
  display: block;
  margin-bottom: 0.45rem;
}

.char-perk {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 0.75rem;
}

.char-select-badge {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
  background: #e2e8f0;
  color: var(--primary);
}

.character-select-card.selected .char-select-badge {
  background: var(--gold);
  color: #ffffff;
}

/* ==========================================================================
   RELICS & ACHIEVEMENTS MODAL
   ========================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 23, 51, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 3px solid var(--gold);
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  animation: zoomIn 0.25s ease-out;
}

@keyframes zoomIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

.modal-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--primary-dark);
}

.close-modal-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-intro {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.relics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.relic-card {
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s;
}

.relic-card.unlocked {
  background: var(--gold-light);
  border: 2px solid var(--gold);
}

.relic-card.locked {
  background: #f1f3f5;
  border: 2px dashed #ced4da;
  opacity: 0.7;
}

.relic-icon {
  font-size: 2rem;
  margin-bottom: 0.35rem;
}

.relic-title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.relic-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0.5rem;
  flex: 1;
}

.relic-status {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.relic-card.unlocked .relic-status { color: #855f00; }
.relic-card.locked .relic-status { color: #6c757d; }

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast {
  visibility: hidden;
  min-width: 250px;
  background-color: var(--primary-dark);
  color: var(--gold-light);
  border: 1px solid var(--gold);
  text-align: center;
  border-radius: 30px;
  padding: 0.9rem 1.5rem;
  position: fixed;
  z-index: 1100;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.toast.show {
  visibility: visible;
  animation: fadein 0.4s, fadeout 0.4s 3s;
}

@keyframes fadein {
  from { bottom: 10px; opacity: 0; }
  to { bottom: 30px; opacity: 1; }
}

@keyframes fadeout {
  from { bottom: 30px; opacity: 1; }
  to { bottom: 10px; opacity: 0; }
}

/* ==========================================================================
   FOOTER (FJ FAITH & FAMILY)
   ========================================================================== */
.app-footer {
  background: #14171a;
  color: #f7f1e4;
  border-top: 3px solid var(--gold);
  padding: 2.5rem 1.5rem;
  text-align: center;
  margin-top: auto;
}

.footer-inner {
  max-width: 700px;
  margin: 0 auto;
}

.footer-cross {
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 0.6rem;
}

.footer-tagline {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-style: italic;
  color: #f7f1e4;
  margin-bottom: 1.25rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.footer-links a {
  color: #f7f1e4;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--gold);
  text-decoration: underline;
}

.footer-links .sep {
  color: rgba(247, 241, 228, 0.4);
}

.footer-fine {
  font-size: 0.75rem;
  color: rgba(247, 241, 228, 0.55);
  letter-spacing: 0.5px;
}

/* ==========================================================================
   RESPONSIVE DESIGN (MOBILE & TABLET)
   ========================================================================== */
@media (max-width: 650px) {
  .site-masthead {
    padding: 0.4rem 1rem;
  }
  .masthead-scripture {
    display: none;
  }
  .app-header {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.6rem;
  }
  .brand-title {
    font-size: 1.15rem;
  }
  .header-stats {
    order: 3;
    width: 100%;
    justify-content: space-between;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  .companion-arena-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .companion-speech-bubble::before {
    display: none;
  }
  .hero-heading {
    font-size: 1.45rem;
  }
  .quiz-arena-card {
    padding: 1.25rem;
  }
  .question-title {
    font-size: 1.15rem;
  }
  .option-btn {
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
  }
}

/* ==========================================================================
   AUTHENTIC CHARACTER ARTWORKS & AVATARS
   ========================================================================== */
.companion-avatar-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px rgba(197, 155, 39, 0.35);
  flex-shrink: 0;
}

.cqs-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(197, 155, 39, 0.25);
  flex-shrink: 0;
}

.companion-header-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  border: 1px solid var(--gold);
  background: #ffffff;
}

.char-img-fluid {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.char-select-thumb {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 2px solid var(--gold);
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

/* ==========================================================================
   SACRED ART GALLERY SCREEN & LIGHTBOX
   ========================================================================== */
.gallery-header-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  text-align: center;
}

.gallery-title {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  color: var(--primary-dark);
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.gallery-filter-btn {
  background: var(--card-bg);
  border: 1.5px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.45rem 1rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.gallery-filter-btn:hover,
.gallery-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 43, 92, 0.2);
}

/* VIRTUAL LITURGICAL ORGAN */
.organ-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1rem auto 1.5rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #0d1e3d 0%, #071226 100%);
  border: 2px solid var(--gold);
  border-radius: var(--radius-md);
  max-width: 600px;
  width: 100%;
  box-shadow: 0 4px 18px rgba(0,0,0,0.25), inset 0 0 12px rgba(197, 155, 39, 0.2);
}

.organ-title {
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.organ-keys {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.organ-key {
  background: linear-gradient(180deg, #ffffff 0%, #e2d7c0 85%, #bca678 100%);
  color: #1a293d;
  border: 1px solid #7c6843;
  border-radius: 0 0 7px 7px;
  width: 44px;
  height: 58px;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 6px;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  user-select: none;
  transition: transform .06s ease, background .06s ease;
}

.organ-key:active, .organ-key.pressed {
  transform: translateY(3px);
  background: linear-gradient(180deg, #f5d47a 0%, #d4a73b 100%);
}

.organ-key small {
  font-size: 8px;
  color: #6d5b3d;
  margin-top: 1px;
}

/* GALLERY CARDS GRID */
.sacred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.gallery-card {
  background: var(--card-bg);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

.gallery-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}

.gallery-img-wrap {
  background: #0d1b2a;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  position: relative;
  overflow: hidden;
}

.gallery-img-wrap img {
  max-width: 100%;
  max-height: 190px;
  object-fit: contain;
  border-radius: 6px;
  transition: transform 0.3s ease;
}

.gallery-card:hover .gallery-img-wrap img {
  transform: scale(1.05);
}

.gallery-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.gallery-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(197, 155, 39, 0.15);
  color: #785400;
  margin-bottom: 0.5rem;
  align-self: flex-start;
}

.gallery-card.cat-hero .gallery-badge { background: #e8f0fe; color: var(--primary); }
.gallery-card.cat-saint .gallery-badge { background: var(--gold-light); color: #785400; }
.gallery-card.cat-villain .gallery-badge { background: #fce8e6; color: var(--crimson); }

.gallery-card-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--primary-dark);
  margin-bottom: 0.2rem;
}

.gallery-card-sub {
  font-size: 0.8rem;
  color: #785400;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.gallery-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0;
  flex: 1;
}

/* ARTWORK LIGHTBOX MODAL */
.modal-artwork-box {
  text-align: center;
  background: #081120;
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1rem;
}

.modal-artwork-box img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 8px;
}
