/* ══════════════════════════════════════════════
   THE CHRISTIAN LIFE GAME
   Estilo: Mundo Ilustrado Imersivo
   Inspirado em Blink Industries + Barnard
   ══════════════════════════════════════════════ */

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

:root {
  --ink: #1a1a1a;
  --ink-soft: #444;
  --ink-light: #777;
  --paper: #f5f0e8;
  --paper-warm: #efe6d8;
  --paper-dark: #e0d6c4;
  --parchment: #f2eadc;
  --parchment-dark: #d4c8b4;
  --wood: #5c3d2e;
  --wood-light: #8b6914;
  --gold: #b8963e;
  --gold-soft: #d4b96a;
  --success: #3a5a3a;
  --error: #7a2a2a;
  --cream: #faf5ee;
  --ink-glow: rgba(0,0,0,0.08);
  --font-title: 'Georgia', 'Palatino', 'Times New Roman', serif;
  --font-body: 'Georgia', 'Palatino', 'Times New Roman', serif;
  --font-script: 'Georgia', 'Palatino', serif;
}

html { font-size: 18px; }
@media (max-width: 480px) { html { font-size: 16px; } }

html, body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

/* ── Parchment texture (full screen, immersive) ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    /* Subtle paper grain */
    repeating-linear-gradient(0deg,
      transparent, transparent 2px,
      rgba(0,0,0,0.008) 2px, rgba(0,0,0,0.008) 4px
    ),
    repeating-linear-gradient(90deg,
      transparent, transparent 3px,
      rgba(0,0,0,0.004) 3px, rgba(0,0,0,0.004) 6px
    ),
    /* Warm vignette */
    radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(139,115,85,0.06) 100%),
    /* Aged spots */
    radial-gradient(ellipse at 15% 30%, rgba(139,115,85,0.03) 0%, transparent 30%),
    radial-gradient(ellipse at 85% 70%, rgba(139,115,85,0.02) 0%, transparent 25%),
    /* Base */
    var(--paper);
}

/* ── Game container (full bleed) ── */
#app {
  width: 100%;
  max-width: 600px;
  position: relative;
  z-index: 1;
}

/* ── HUD / Game Header Bar ── */
.game-hud {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, var(--paper) 60%, transparent);
  padding: 0.5rem 1rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  backdrop-filter: blur(4px);
}

.game-hud__title {
  font-family: var(--font-title);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.5;
  white-space: nowrap;
}

.game-hud__stats {
  display: flex;
  gap: 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
}

.game-hud__stat {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.game-hud__progress {
  flex: 0 0 80px;
  height: 4px;
  background: var(--parchment-dark);
  border-radius: 2px;
  overflow: hidden;
}

.game-hud__progress-fill {
  height: 100%;
  background: var(--ink);
  transition: width 0.5s ease;
  border-radius: 2px;
}

/* ── Game Screen (full-bleed content) ── */
.game-screen {
  padding: 0 1rem 2rem;
  animation: fadeIn 0.35s ease;
  min-height: calc(100vh - 50px);
}

/* ── Title Screen ── */
.title-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1.5rem;
  text-align: center;
  position: relative;
}

.title-screen__ornament {
  font-size: 1.2rem;
  color: var(--gold);
  letter-spacing: 1em;
  opacity: 0.5;
  margin: 0.5rem 0;
}

.title-screen__rule {
  width: 40%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ink), transparent);
  opacity: 0.2;
  margin: 0.75rem auto;
}

.title-screen__rule--thick {
  height: 3px;
  width: 30%;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.4;
}

.title-screen__title {
  font-family: var(--font-title);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

@media (max-width: 480px) {
  .title-screen__title { font-size: 1.6rem; letter-spacing: 0.06em; }
}

.title-screen__subtitle {
  font-size: 0.85rem;
  font-style: italic;
  opacity: 0.55;
  max-width: 320px;
  margin: 0 auto 0.5rem;
}

.title-screen__author {
  font-size: 0.75rem;
  opacity: 0.35;
  font-style: italic;
}

.title-screen__emblem {
  width: 80px;
  height: 80px;
  margin: 1rem auto;
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  opacity: 0.6;
}

/* ── Journey Map (full screen) ── */
.journey-scroll {
  position: relative;
  width: 100%;
  padding: 0 0.5rem;
}

.journey-scroll svg {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Stage Cards (overlay on map) ── */
.stage-card {
  position: relative;
  background: white;
  border: 2px solid var(--ink);
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stage-card:hover {
  transform: translateX(4px);
  box-shadow: 2px 2px 0 var(--ink-glow);
}

.stage-card--current {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-soft);
}

.stage-card--completed {
  opacity: 0.6;
}

.stage-card--completed .stage-card__check {
  opacity: 1;
}

.stage-card--locked {
  opacity: 0.35;
  cursor: not-allowed;
}
.stage-card--locked:hover { transform: none; box-shadow: none; }

.stage-card__icon {
  font-size: 1.5rem;
  width: 2rem;
  text-align: center;
  flex-shrink: 0;
}

.stage-card__info { flex: 1; }

.stage-card__name {
  font-weight: 700;
  font-size: 0.9rem;
  font-family: var(--font-title);
}

.stage-card__theme {
  font-size: 0.75rem;
  opacity: 0.55;
  font-style: italic;
}

.stage-card__badge {
  font-size: 0.7rem;
  flex-shrink: 0;
}

.stage-card__arrow {
  font-size: 1.2rem;
  opacity: 0.3;
  flex-shrink: 0;
}

/* ── Pilgrim on map ── */
.pilgrim-on-path {
  text-align: center;
  margin: 1rem 0;
}

/* ── Card Screen (Pergaminho) ── */
.scroll-page {
  position: relative;
  padding: 1rem 1rem 2rem;
}

.scroll-page__header {
  text-align: center;
  margin-bottom: 1rem;
}

.scroll-page__id {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.3;
  margin-bottom: 0.25rem;
}

.scroll-page__pilgrim {
  width: 64px;
  margin: 0 auto 0.25rem;
  opacity: 0.7;
}

.dilema-scroll {
  background: white;
  border: 2px solid var(--ink);
  padding: 1.25rem 1.25rem 1rem;
  margin-bottom: 1rem;
  position: relative;
}

.dilema-scroll::before {
  content: '"';
  position: absolute;
  top: -0.2rem;
  left: 0.5rem;
  font-size: 3rem;
  line-height: 1;
  opacity: 0.15;
  color: var(--gold);
  font-family: var(--font-title);
}

.dilema-scroll__label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  opacity: 0.35;
  margin-bottom: 0.5rem;
}

.dilema-scroll__text {
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.8;
  padding-left: 0.5rem;
}

.dilema-scroll__text::first-letter {
  font-size: 2.8em;
  float: left;
  line-height: 0.75;
  margin-right: 0.2rem;
  padding-right: 0.15rem;
  font-weight: 700;
  font-family: var(--font-title);
  color: var(--wood);
}

/* ── Fundamentals (as sealed scrolls) ── */
.fundamentals-label {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.3;
  margin-bottom: 0.5rem;
}

.seal-scroll {
  border: 2px solid var(--ink);
  margin-bottom: 0.5rem;
  overflow: hidden;
  background: white;
  transition: border-color 0.3s;
}

.seal-scroll__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}
.seal-scroll__header:hover { background: var(--paper-dark); }
.seal-scroll__header--done { cursor: default; background: var(--paper-dark); }

.seal-scroll__icon { font-size: 1rem; width: 1.5rem; text-align: center; }
.seal-scroll__type { flex: 1; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.02em; }

.seal-scroll__status {
  font-size: 0.7rem;
  border: 1px solid var(--ink);
  padding: 0.1rem 0.4rem;
}
.seal-scroll__status--revealed {
  background: var(--success);
  color: var(--paper);
  border-color: var(--success);
}

.seal-scroll__body {
  border-top: 1px solid var(--ink);
  padding: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.7;
  animation: fadeIn 0.3s ease;
  background: rgba(255,255,255,0.85);
}

.seal-scroll__pearl {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border-left: 3px solid var(--gold);
  background: rgba(185,150,62,0.06);
  font-style: italic;
  font-size: 0.8rem;
}

.seal-scroll__resource {
  font-size: 0.75rem;
  margin-top: 0.375rem;
  opacity: 0.6;
}

/* ── Completion (Scroll + Seal) ── */
.completion-seal {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 0;
}

.completion-seal__wax {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--wood-light));
  border: 3px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin-bottom: 1rem;
  position: relative;
  animation: seal-stamp 0.8s ease-out both;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.completion-seal__wax::after {
  content: '';
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
}

@keyframes seal-stamp {
  0% { transform: scale(2.5) rotate(-20deg); opacity: 0; }
  50% { transform: scale(0.9) rotate(5deg); }
  70% { transform: scale(1.05) rotate(-2deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.completion-seal__scroll {
  background: white;
  border: 2px solid var(--ink);
  padding: 1.25rem;
  width: 100%;
  margin-bottom: 1rem;
  position: relative;
}

.completion-seal__title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.completion-seal__subtitle {
  text-align: center;
  font-size: 0.85rem;
  font-style: italic;
  opacity: 0.6;
  margin-bottom: 0.75rem;
}

.completion-seal__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--ink);
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.5);
}

.completion-seal__wisdom {
  text-align: center;
  margin-top: 0.75rem;
}

.completion-seal__wisdom-num {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--gold);
}

.completion-seal__wisdom-label {
  font-size: 0.8rem;
  opacity: 0.5;
}

/* ── Wooden / Game Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cream);
  background: var(--wood);
  border: 2px solid var(--ink);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: relative;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
}

.btn:hover {
  background: var(--ink);
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 rgba(0,0,0,0.2);
}

.btn:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

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

.btn--outline {
  background: transparent;
  color: var(--ink);
  box-shadow: none;
}
.btn--outline:hover {
  background: var(--ink);
  color: var(--cream);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.15);
}

.btn--small {
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
}

.btn--full {
  width: 100%;
}

.btn--link {
  background: none;
  border: none;
  color: var(--wood);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0.2rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: normal;
  text-transform: none;
  box-shadow: none;
}
.btn--link:hover { color: var(--ink); }

/* ── Language selector ── */
.lang-strip {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}

.lang-pill {
  padding: 0.2rem 0.5rem;
  font-size: 0.7rem;
  font-family: var(--font-body);
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0.35;
  letter-spacing: 0.05em;
}
.lang-pill--active { opacity: 1; background: var(--ink); color: var(--paper); }
.lang-pill:hover { opacity: 0.7; }

/* ── Form elements ── */
input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.5rem 0.65rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  background: white;
  border: 2px solid var(--ink);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--gold);
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  opacity: 0.6;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: normal;
  font-size: 0.8rem;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: normal;
  opacity: 1;
}
.checkbox-label input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  accent-color: var(--ink);
  cursor: pointer;
}

/* ── Age selector ── */
.selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(85px, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.selector-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.75rem;
  background: white;
  border: 2px solid var(--ink);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  line-height: 1.3;
  font-weight: 600;
}
.selector-btn:hover { background: var(--paper-dark); transform: translateY(-1px); }
.selector-btn--active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.selector-btn .emoji { font-size: 1.3rem; }

/* ── Progress bar ── */
.progress-track {
  height: 6px;
  background: var(--parchment-dark);
  border: 1px solid var(--ink);
  overflow: hidden;
  margin-bottom: 0.75rem;
}
.progress-track__fill {
  height: 100%;
  background: var(--ink);
  transition: width 0.5s ease;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--paper);
  border: 2px solid var(--ink);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.5rem;
  position: relative;
}

.modal__close {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--ink);
  line-height: 1;
}

/* ── Ornamental ── */
.ornament {
  text-align: center;
  font-size: 0.6rem;
  color: var(--gold);
  letter-spacing: 1.5em;
  opacity: 0.4;
  margin: 0.75rem 0;
  user-select: none;
}

/* ── Utilities ── */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.gap-1 { gap: 0.5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.error-msg { color: var(--error); font-size: 0.8rem; margin-top: 0.25rem; font-weight: 600; }

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* ── Confetti ── */
.confetti-container {
  position: fixed; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 100;
}
.confetti-piece {
  position: absolute;
  top: -12px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ── Pilgrim SVG ── */
.pilgrim { display: inline-flex; align-items: flex-end; justify-content: center; }
.pilgrim svg { overflow: visible; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--ink); }

/* ── Responsive ── */
@media (max-width: 400px) {
  .game-screen { padding: 0 0.75rem 1.5rem; }
  .title-screen { padding: 1.5rem 1rem; }
}
