/* Little Disciple — design system.
   Two registers: a playful "kid" mode (Fredoka, bright realm gradients, big touch targets)
   and a plain "parent" mode (Inter, quiet neutrals) so the two audiences read as distinct apps. */

:root {
  --ink: #241634;
  --ink-soft: #4a3a63;
  --paper: #fff8ef;
  --paper-card: #ffffff;
  --line: #e7ddf5;

  --realm1: #f2a03d;   /* Realm of Beginnings — Theology Proper & Anthropology */
  --realm1-soft: #fff3d6;
  --realm2: #e8546b;   /* Realm of Rescue — Christology & Soteriology */
  --realm2-soft: #ffe1e6;
  --realm3: #3fb6c9;   /* Realm of the Spirit — Pneumatology, Ecclesiology, Eschatology */
  --realm3-soft: #d9f5f7;

  --accent: #8c5cf2;
  --accent-soft: #ece2ff;
  --good: #34b27a;
  --bad: #e0475a;

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-soft: 0 8px 24px rgba(36, 22, 52, 0.12);
  --shadow-pop: 0 12px 0 rgba(36, 22, 52, 0.18);

  --font-display: 'Fredoka', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}
#app { min-height: 100vh; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
.hidden { display: none !important; }

/* ── Buttons ─────────────────────────────────────────────────────────── */

.btn {
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.4rem;
  font-weight: 600;
  font-size: 1rem;
  transition: transform 0.08s ease;
}
.btn:active { transform: translateY(2px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 4px 0 #6d3fd1; }
.btn-primary:active { box-shadow: 0 2px 0 #6d3fd1; }
.btn-ghost { background: transparent; color: var(--ink-soft); }
.btn-block { width: 100%; }
.btn-lg { padding: 1rem 1.75rem; font-size: 1.15rem; border-radius: var(--radius-md); }

/* ── Auth screens (parent) ──────────────────────────────────────────── */

.auth-shell {
  max-width: 380px;
  margin: 8vh auto;
  padding: 2rem;
  background: var(--paper-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}
.auth-shell h1 { font-family: var(--font-display); font-size: 1.6rem; margin-bottom: 0.25rem; }
.auth-shell p.sub { color: var(--ink-soft); margin-top: 0; margin-bottom: 1.5rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.3rem; color: var(--ink-soft); }
.field input {
  width: 100%; padding: 0.65rem 0.8rem; border: 1px solid var(--line);
  border-radius: var(--radius-sm); font-size: 1rem;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.auth-switch { margin-top: 1rem; text-align: center; font-size: 0.9rem; color: var(--ink-soft); }
.auth-switch a { color: var(--accent); cursor: pointer; font-weight: 600; }
.error { color: var(--bad); font-size: 0.85rem; }

/* ── Profile picker (passwordless, Netflix-style) ───────────────────── */

.picker-shell {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at top, #3a2358, var(--ink));
  color: #fff;
  padding: 2rem;
}
.picker-shell h1 { font-family: var(--font-display); font-size: 2rem; margin-bottom: 2rem; }
.picker-grid { display: flex; gap: 1.75rem; flex-wrap: wrap; justify-content: center; }
.profile-tile {
  width: 140px; display: flex; flex-direction: column; align-items: center; gap: 0.6rem;
  background: none; border: none; color: #fff;
}
.profile-avatar {
  width: 120px; height: 120px; border-radius: 24px; display: flex; align-items: center; justify-content: center;
  font-size: 3.2rem; background: var(--accent-soft); box-shadow: var(--shadow-pop);
  transition: transform 0.12s ease;
}
.profile-tile:hover .profile-avatar, .profile-tile:focus .profile-avatar { transform: scale(1.05); }
.profile-name { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.profile-tile.add .profile-avatar { background: rgba(255,255,255,0.08); font-size: 2rem; color: #fff; }
.profile-tile.parent .profile-avatar { background: rgba(255,255,255,0.14); }

/* ── Adventure map (kid mode) ───────────────────────────────────────── */

.map-shell { min-height: 100vh; font-family: var(--font-body); padding-bottom: 3rem; }
.map-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.5rem; background: var(--paper-card); box-shadow: var(--shadow-soft);
}
.map-topbar .who { font-family: var(--font-display); font-size: 1.3rem; }
.map-realm {
  padding: 3rem 1.5rem 2rem;
  transition: background 0.3s ease;
}
.map-realm[data-part="1"] { background: linear-gradient(180deg, var(--realm1-soft), var(--paper)); }
.map-realm[data-part="2"] { background: linear-gradient(180deg, var(--realm2-soft), var(--paper)); }
.map-realm[data-part="3"] { background: linear-gradient(180deg, var(--realm3-soft), var(--paper)); }
.realm-title { font-family: var(--font-display); font-size: 1.6rem; text-align: center; margin-bottom: 2rem; }
.realm-title.part-1 { color: var(--realm1); }
.realm-title.part-2 { color: var(--realm2); }
.realm-title.part-3 { color: var(--realm3); }

.trail { display: flex; flex-direction: column; align-items: center; gap: 0; max-width: 420px; margin: 0 auto; }
.trail-node {
  width: 82px; height: 82px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: #fff;
  background: var(--line); box-shadow: var(--shadow-pop); position: relative;
}
.trail-node.done { background: var(--good); }
.trail-node.current { background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.trail-node.locked { background: #cfc4e3; color: #fff9; box-shadow: none; }
.trail-connector { width: 6px; height: 34px; background: var(--line); }
.trail-connector.done { background: var(--good); }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.session-card {
  max-width: 480px; margin: 2rem auto 0; background: var(--paper-card); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft); padding: 1.75rem;
}
.session-card h2 { font-family: var(--font-display); margin-top: 0; }
.session-card .verse { font-style: italic; color: var(--ink-soft); border-left: 4px solid var(--accent); padding-left: 0.8rem; }
.session-card .activity { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 0.9rem; margin-top: 1rem; }

/* ── Companions ─────────────────────────────────────────────────────── */

.companions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1.2rem; max-width: 700px; margin: 2rem auto; padding: 0 1.5rem; }
.companion-card {
  background: var(--paper-card); border-radius: var(--radius-md); box-shadow: var(--shadow-soft);
  padding: 1.2rem; text-align: center; border: 3px solid transparent;
}
.companion-card.active { border-color: var(--accent); }
.companion-card .avatar { font-size: 2.6rem; margin-bottom: 0.4rem; }
.companion-card .name { font-family: var(--font-display); font-weight: 600; }
.companion-card.locked { opacity: 0.45; }
.companion-card.locked .avatar { filter: grayscale(1); }

/* ── Parent dashboard ───────────────────────────────────────────────── */

.dash-shell { max-width: 760px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.dash-header h1 { font-size: 1.4rem; }
.dash-section { background: var(--paper-card); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 1.4rem; margin-bottom: 1.4rem; }
.dash-section h2 { font-size: 1.05rem; margin-top: 0; }
.kid-row { display: flex; justify-content: space-between; align-items: center; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.kid-row:last-child { border-bottom: none; }
.pill { display: inline-block; background: var(--accent-soft); color: var(--accent); font-size: 0.78rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 999px; }
textarea, .dash-section input {
  width: 100%; padding: 0.6rem 0.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 0.95rem; margin-top: 0.25rem;
}
textarea { min-height: 70px; resize: vertical; }
.form-grid { display: grid; gap: 0.9rem; }
.form-grid label { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); display: block; }

/* ── Parent Gate modal ──────────────────────────────────────────────── */

.modal { position: fixed; inset: 0; background: rgba(36,22,52,0.55); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-card { background: var(--paper-card); border-radius: var(--radius-md); padding: 1.75rem; width: 300px; text-align: center; box-shadow: var(--shadow-soft); }
.modal-card h2 { font-family: var(--font-display); margin-top: 0; }
.modal-card input { width: 100%; text-align: center; font-size: 1.4rem; letter-spacing: 0.3rem; padding: 0.6rem; border-radius: var(--radius-sm); border: 1px solid var(--line); margin: 0.75rem 0; }
.modal-actions { display: flex; gap: 0.6rem; margin-top: 0.5rem; }
.modal-actions .btn { flex: 1; }
