/* ===================================================
   AngelGotchi Companion App — style.css
   Visual language: 1333covenant.neocities.org
   =================================================== */

/* ── CSS Variables ──────────────────────────────────── */
:root {
  /* 1333covenant palette */
  --primary-purple:   #8B5CF6;
  --primary-lavender: #C4B5FD;
  --accent-pink:      #FF6B9D;
  --accent-magenta:   #E879F9;
  --chrome-purple:    #7C3AED;
  --deep-purple:      #1a0a2e;
  --window-lavender:  #DDD6FE;
  --bg-cream:         #FDF4FF;
  --border-purple:    #A78BFA;

  /* Functional */
  --green:    #22c55e;
  --green-lt: rgba(34, 197, 94, 0.15);
  --orange:   #f97316;
  --orange-lt:rgba(249, 115, 22, 0.15);
  --red:      #ef4444;

  /* Text */
  --text:       #1a0a2e;
  --text-light: #EDE9FE;
  --muted:      #A78BFA;
  --muted-dark: #6d54a0;

  /* Aliases used in inline HTML styles */
  --indigo: #8B5CF6;
  --border: rgba(167, 139, 250, 0.35);
  --card:   #FDF4FF;
  --bg:     #1a0a2e;

  /* Layout */
  --radius:    12px;
  --radius-sm: 6px;
  --safe-top:  env(safe-area-inset-top);
  --safe-bot:  env(safe-area-inset-bottom);
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

/* ── Body / dark gradient background ────────────────── */
body {
  font-family: 'VT323', 'MS UI Gothic', monospace;
  font-size: 18px;
  background: linear-gradient(135deg, #2d1b4e 0%, #1a0a2e 50%, #0d001a 100%);
  background-attachment: fixed;
  color: var(--text-light);
  min-height: 100dvh;
  padding-top: var(--safe-top);
  padding-bottom: calc(var(--safe-bot) + 72px);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Page wrapper ────────────────────────────────────── */
.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 12px 20px;
}

/* ── Typography ─────────────────────────────────────── */
h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.9rem;
  line-height: 1.4;
}
h2 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.7rem;
  line-height: 1.5;
  color: var(--deep-purple);
}
h3 {
  font-family: 'VT323', monospace;
  font-size: 1.25rem;
  font-weight: normal;
  color: var(--deep-purple);
}
p { line-height: 1.6; }
a { color: var(--accent-pink); text-decoration: none; }
a:hover { color: var(--accent-magenta); }
.serif { font-family: Georgia, 'Times New Roman', serif; }
.muted { color: var(--muted-dark); font-size: 0.85rem; }

/* ── Custom scrollbar ────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--deep-purple); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent-pink), var(--accent-magenta));
  border-radius: 4px;
  border: 1px solid var(--deep-purple);
}

/* ── Rainbow keyframe (shared everywhere) ────────────── */
@keyframes rainbowMove {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ── App topbar ──────────────────────────────────────── */
.app-topbar {
  background: linear-gradient(90deg,
    var(--accent-pink) 0%,
    var(--accent-magenta) 45%,
    var(--primary-purple) 100%);
  border-bottom: 3px solid var(--deep-purple);
  box-shadow: 0 4px 0 var(--deep-purple), 0 8px 24px rgba(232,121,249,0.35);
  padding: calc(12px + var(--safe-top)) 14px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 50;
}
/* Rainbow stripe under topbar */
.app-topbar::after {
  content: '';
  position: absolute;
  bottom: -7px; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    #C4B5FD, #E879F9, #A78BFA, #8B5CF6,
    #7C3AED, #6D28D9, #C4B5FD);
  background-size: 200% 100%;
  animation: rainbowMove 3s linear infinite;
}
.app-topbar h1 {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.6rem;
  color: #fff;
  text-shadow: 2px 2px 0 var(--deep-purple), 0 0 12px rgba(255,255,255,0.4);
  flex: 1;
  text-align: center;
}
.topbar-back {
  color: rgba(255,255,255,0.95);
  text-decoration: none;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  padding: 6px 8px;
  background: rgba(26,10,46,0.45);
  border: 2px solid rgba(255,255,255,0.45);
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 2px 2px 0 rgba(26,10,46,0.5);
  transition: all 0.15s;
}
.topbar-back:hover { background: rgba(26,10,46,0.7); color: #fff; }

/* ── Window card (base style for all content panels) ─── */
.card {
  background: linear-gradient(180deg, var(--bg-cream) 0%, #FFF5F8 100%);
  border: 3px solid var(--border-purple);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 4px 4px 0 var(--deep-purple), 0 0 16px rgba(167,139,250,0.2);
  position: relative;
  overflow: hidden;
  color: var(--text);
}
/* Animated rainbow stripe at top of every card */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--accent-pink), var(--accent-magenta), var(--primary-lavender), var(--accent-pink));
  background-size: 200% 100%;
  animation: rainbowMove 4s linear infinite;
}

/* ── Page header ─────────────────────────────────────── */
.page-header {
  padding: 20px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.page-header h1 {
  font-size: 0.75rem;
  color: var(--primary-lavender);
  text-shadow: 0 0 12px var(--accent-magenta);
}

/* ── Utility layout ──────────────────────────────────── */
.stack { display: flex; flex-direction: column; gap: 12px; }
.row   { display: flex; align-items: center; gap: 12px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-20 { margin-top: 20px; }
.mb-4  { margin-bottom: 4px; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-green  { color: var(--green); }
.text-pink   { color: var(--accent-pink); }
.text-muted  { color: var(--muted-dark); }
.text-indigo { color: var(--primary-lavender); }

/* ── Unlock banner ───────────────────────────────────── */
.banner {
  border: 3px solid var(--border-purple);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 4px 4px 0 var(--deep-purple);
  margin-top: 16px;
  position: relative;
  overflow: hidden;
}
.banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--accent-pink), var(--accent-magenta), var(--primary-lavender), var(--accent-pink));
  background-size: 200% 100%;
  animation: rainbowMove 3s linear infinite;
}
.banner.locked {
  background: linear-gradient(135deg, #1e1040, #2d1b4e);
}
.banner.unlocked {
  background: linear-gradient(135deg, #052e16, #064e3b);
  border-color: var(--green);
}
.banner.unlocked::before {
  background: linear-gradient(90deg, #22c55e, #4ade80, #22c55e);
  background-size: 200% 100%;
  animation: rainbowMove 3s linear infinite;
}
.banner-icon { font-size: 1.75rem; flex-shrink: 0; }
.banner h2 {
  font-size: 0.6rem;
  color: var(--primary-lavender);
  margin-bottom: 6px;
}
.banner.unlocked h2 { color: #4ade80; }
.banner p { font-size: 1rem; color: var(--primary-lavender); opacity: 0.8; }
.banner.unlocked p { color: #86efac; }

/* ── Task cards ──────────────────────────────────────── */
.task-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(180deg, var(--bg-cream) 0%, #FFF5F8 100%);
  border: 3px solid var(--border-purple);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: var(--text);
  box-shadow: 4px 4px 0 var(--deep-purple), 0 0 12px rgba(167,139,250,0.15);
  transition: transform 0.1s, box-shadow 0.1s;
  position: relative;
  overflow: hidden;
}
.task-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--accent-pink), var(--accent-magenta), var(--primary-lavender), var(--accent-pink));
  background-size: 200% 100%;
  animation: rainbowMove 4s linear infinite;
}
.task-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--deep-purple), 0 0 20px rgba(232,121,249,0.2);
}
.task-card:active, .card-link:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--deep-purple);
}

.task-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  border: 2px solid var(--border-purple);
  box-shadow: 2px 2px 0 var(--deep-purple);
}
.task-icon.blue   { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.task-icon.indigo { background: linear-gradient(135deg, var(--window-lavender), #C4B5FD); }
.task-icon.pink   { background: linear-gradient(135deg, #fce7f3, #fbcfe8); }

.task-body { flex: 1; min-width: 0; }
.task-body h3 {
  font-family: 'VT323', monospace;
  font-size: 1.3rem;
  color: var(--deep-purple);
}
.task-body .sub {
  font-family: 'VT323', monospace;
  font-size: 0.95rem;
  color: var(--muted-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.task-check { font-size: 1.4rem; flex-shrink: 0; }
.task-check.done {
  filter: drop-shadow(0 0 8px var(--green));
}

/* ── Progress bar ────────────────────────────────────── */
.progress-bar {
  height: 8px;
  background: rgba(167,139,250,0.25);
  border-radius: 99px;
  margin-top: 6px;
  overflow: hidden;
  border: 1px solid rgba(167,139,250,0.3);
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg,
    var(--accent-pink), var(--accent-magenta), var(--primary-lavender), var(--accent-pink));
  background-size: 200% 100%;
  animation: rainbowMove 3s linear infinite;
  transition: width 0.4s ease;
}

/* ── Steps display ───────────────────────────────────── */
.steps-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}
.steps-count {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  color: var(--primary-purple);
}

/* ── Streak card ─────────────────────────────────────── */
.streak-card {
  background: linear-gradient(135deg, var(--deep-purple), #1e0a3c);
  border: 3px solid var(--accent-magenta);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 4px 4px 0 var(--deep-purple), 0 0 20px rgba(232,121,249,0.3);
  position: relative;
  overflow: hidden;
}
.streak-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--accent-pink), var(--accent-magenta), var(--primary-lavender), var(--accent-pink));
  background-size: 200% 100%;
  animation: rainbowMove 3s linear infinite;
}
.streak-flame { font-size: 1.75rem; }
.streak-num {
  font-family: 'Press Start 2P', monospace;
  font-size: 1.4rem;
  color: var(--accent-magenta);
  text-shadow: 0 0 16px var(--accent-magenta), 2px 2px 0 var(--deep-purple);
}
.streak-card .muted { color: var(--primary-lavender); opacity: 0.8; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px;
  border: 3px solid var(--deep-purple);
  border-radius: var(--radius);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.55rem;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 4px 4px 0 var(--deep-purple);
  letter-spacing: 0.02em;
}
.btn:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--deep-purple);
}
.btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--deep-purple);
}
.btn:disabled { opacity: 0.45; cursor: default; }
.btn-primary {
  background: linear-gradient(180deg, var(--primary-lavender) 0%, var(--chrome-purple) 100%);
  color: var(--deep-purple);
}
.btn-pink {
  background: linear-gradient(180deg, var(--accent-pink) 0%, var(--accent-magenta) 100%);
  color: var(--deep-purple);
}
.btn-green {
  background: linear-gradient(180deg, #4ade80 0%, #16a34a 100%);
  color: var(--deep-purple);
}
.btn-ghost {
  background: rgba(167,139,250,0.15);
  border-color: var(--border-purple);
  color: var(--primary-lavender);
  box-shadow: 3px 3px 0 var(--deep-purple);
}

/* ── Scripture reader ────────────────────────────────── */
.verse-card {
  background: linear-gradient(135deg, var(--deep-purple), #2a1060);
  border: 3px solid var(--primary-lavender);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 4px 4px 0 var(--deep-purple), 0 0 24px rgba(167,139,250,0.35);
  margin-top: 16px;
  position: relative;
  overflow: hidden;
}
.verse-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--accent-pink), var(--accent-magenta), var(--primary-lavender), var(--accent-pink));
  background-size: 200% 100%;
  animation: rainbowMove 4s linear infinite;
}
.verse-card .verse-text {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.1rem;
  font-style: italic;
  line-height: 1.8;
  color: var(--primary-lavender);
  margin-bottom: 10px;
}
.verse-card .verse-ref {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--accent-pink);
}
.verse-card p.muted {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: var(--accent-magenta);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
  opacity: 0.9;
}

.passage-card {
  background: linear-gradient(180deg, var(--bg-cream) 0%, #FFF5F8 100%);
  border: 3px solid var(--border-purple);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 4px 4px 0 var(--deep-purple), 0 0 12px rgba(167,139,250,0.15);
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.passage-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--primary-lavender), var(--accent-magenta), var(--accent-pink), var(--primary-lavender));
  background-size: 200% 100%;
  animation: rainbowMove 4s linear infinite;
}
.passage-ref {
  font-family: 'Press Start 2P', monospace;
  color: var(--primary-purple);
  font-size: 0.5rem;
  margin-bottom: 14px;
  display: block;
}
.passage-text {
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.9;
  white-space: pre-wrap;
  color: var(--text);
  font-size: 1rem;
}

/* ── Reflection exercise ─────────────────────────────── */
.exercise-header {
  background: linear-gradient(180deg, var(--bg-cream) 0%, #FFF5F8 100%);
  border: 3px solid var(--border-purple);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: 4px 4px 0 var(--deep-purple), 0 0 12px rgba(167,139,250,0.15);
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.exercise-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--accent-pink), var(--accent-magenta), var(--primary-lavender), var(--accent-pink));
  background-size: 200% 100%;
  animation: rainbowMove 4s linear infinite;
}
.exercise-type {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-pink);
  margin-bottom: 8px;
}
.exercise-header h2 { color: var(--deep-purple); margin-bottom: 6px; }
.exercise-anchor {
  font-family: Georgia, serif;
  font-style: italic;
  color: var(--muted-dark);
  font-size: 0.95rem;
  margin: 8px 0;
  line-height: 1.6;
}
.exercise-ref {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  color: var(--accent-magenta);
}
.exercise-instruction {
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  margin-top: 12px;
  line-height: 1.6;
  color: var(--deep-purple);
}

.prompt-header {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-lavender);
  padding: 8px 4px 0;
  text-shadow: 0 0 8px var(--accent-magenta);
}
.prompt-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(180deg, var(--bg-cream) 0%, #FFF5F8 100%);
  border: 3px solid var(--border-purple);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: 3px 3px 0 var(--deep-purple);
  position: relative;
  overflow: hidden;
}
.prompt-block::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg,
    var(--accent-magenta), var(--primary-lavender), var(--accent-magenta));
  background-size: 200% 100%;
  animation: rainbowMove 4s linear infinite;
}
.prompt-label {
  font-family: 'VT323', monospace;
  font-size: 1.15rem;
  color: var(--deep-purple);
  font-weight: bold;
}
textarea {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  background: rgba(221,214,254,0.25);
  border: 2px solid var(--border-purple);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'VT323', monospace;
  font-size: 1.05rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea:focus {
  outline: none;
  border-color: var(--accent-magenta);
  box-shadow: 0 0 10px rgba(232,121,249,0.3);
}

/* ── Settings ────────────────────────────────────────── */
.settings-group { display: flex; flex-direction: column; gap: 6px; }
.settings-group-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-lavender);
  padding: 18px 4px 8px;
  text-shadow: 0 0 10px var(--accent-magenta);
}
.setting-row {
  background: linear-gradient(180deg, var(--bg-cream) 0%, #FFF5F8 100%);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 3px solid var(--border-purple);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--deep-purple);
  color: var(--text);
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.setting-row::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    var(--accent-pink), var(--accent-magenta), var(--primary-lavender), var(--accent-pink));
  background-size: 200% 100%;
  animation: rainbowMove 4s linear infinite;
}
.setting-row:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--deep-purple), 0 0 16px rgba(232,121,249,0.15);
}
.setting-label {
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  color: var(--text);
}
.setting-value {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  color: var(--primary-purple);
}
input[type=range] {
  width: 100px;
  accent-color: var(--accent-magenta);
}
input[type=text], input[type=number] {
  padding: 8px 12px;
  background: rgba(221,214,254,0.25);
  border: 2px solid var(--border-purple);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'VT323', monospace;
  font-size: 1.05rem;
  width: 150px;
  text-align: right;
  transition: border-color 0.15s;
}
input[type=text]:focus, input[type=number]:focus {
  outline: none;
  border-color: var(--accent-magenta);
  box-shadow: 0 0 8px rgba(232,121,249,0.3);
}

/* ── History calendar ────────────────────────────────── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-day {
  aspect-ratio: 1;
  border-radius: 4px;
  background: rgba(167,139,250,0.15);
  border: 1px solid rgba(167,139,250,0.2);
}
.cal-day.complete {
  background: var(--green);
  box-shadow: 0 0 8px rgba(34,197,94,0.6);
  border-color: var(--green);
}
.cal-day.today {
  outline: 2px solid var(--accent-magenta);
  outline-offset: 1px;
  box-shadow: 0 0 10px rgba(232,121,249,0.5);
}
.cal-day.future { background: transparent; border-color: transparent; }

/* ── Completed badge ─────────────────────────────────── */
.complete-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #052e16, #064e3b);
  border: 3px solid var(--green);
  border-radius: var(--radius);
  padding: 16px;
  color: #4ade80;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  line-height: 1.8;
  box-shadow: 4px 4px 0 var(--deep-purple), 0 0 16px rgba(34,197,94,0.3);
}
.complete-badge .badge-icon { font-size: 1.5rem; }

/* ── Bottom navigation ───────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(62px + var(--safe-bot));
  padding-bottom: var(--safe-bot);
  background: linear-gradient(180deg, #1a0a2e, #0d001a);
  border-top: 3px solid var(--border-purple);
  box-shadow: 0 -4px 0 var(--deep-purple), 0 -8px 24px rgba(167,139,250,0.25);
  display: flex;
  align-items: stretch;
  z-index: 100;
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: rgba(167,139,250,0.55);
  font-family: 'Press Start 2P', monospace;
  font-size: 0.35rem;
  padding: 8px 4px;
  transition: color 0.15s, background 0.15s;
  border-right: 1px solid rgba(167,139,250,0.12);
}
.nav-item:last-child { border-right: none; }
.nav-item .nav-icon { font-size: 1.3rem; line-height: 1; }
.nav-item.active {
  color: var(--accent-pink);
  text-shadow: 0 0 10px var(--accent-magenta);
  background: rgba(232,121,249,0.07);
}

/* ── Manual step entry modal ─────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 0, 26, 0.78);
  display: flex;
  align-items: flex-end;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal-sheet {
  background: linear-gradient(180deg, #2a1550, #1a0a2e);
  border: 3px solid var(--border-purple);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 24px 20px calc(24px + var(--safe-bot));
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  box-shadow: 0 -4px 0 var(--deep-purple), 0 -10px 30px rgba(167,139,250,0.4);
  color: var(--text-light);
  position: relative;
  overflow: hidden;
}
.modal-sheet::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg,
    var(--accent-pink), var(--accent-magenta), var(--primary-lavender), var(--accent-pink));
  background-size: 200% 100%;
  animation: rainbowMove 3s linear infinite;
}
.modal-overlay.open .modal-sheet { transform: translateY(0); }
.modal-handle {
  width: 40px; height: 4px;
  background: var(--border-purple);
  border-radius: 99px;
  margin: 0 auto 20px;
}
.modal-sheet h2 {
  color: var(--primary-lavender);
  margin-bottom: 8px;
}
.modal-sheet p { color: var(--primary-lavender); opacity: 0.7; font-size: 1rem; }
.modal-sheet input[type=number] {
  width: 100%;
  text-align: left;
  background: rgba(167,139,250,0.15);
  border-color: var(--border-purple);
  color: var(--text-light);
  margin-bottom: 12px;
  font-size: 1.5rem;
}

/* ── Setup guide ─────────────────────────────────────── */
.guide-step {
  display: flex;
  gap: 14px;
  background: linear-gradient(180deg, var(--bg-cream) 0%, #FFF5F8 100%);
  border: 3px solid var(--border-purple);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 3px 3px 0 var(--deep-purple);
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.guide-step::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-pink), var(--accent-magenta), var(--primary-lavender));
  background-size: 200% 100%;
  animation: rainbowMove 4s linear infinite;
}
.guide-num {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-magenta));
  color: var(--deep-purple);
  border: 2px solid var(--deep-purple);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.5rem;
  flex-shrink: 0;
  box-shadow: 2px 2px 0 var(--deep-purple);
}
.guide-body h3 { color: var(--deep-purple); margin-bottom: 4px; }
.guide-body p { font-size: 0.9rem; color: var(--muted-dark); line-height: 1.5; }

/* ── AngelGotchi status line ─────────────────────────── */
#gotchiStatus {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.4rem;
  color: var(--primary-lavender);
  text-align: center;
  padding: 10px;
  text-shadow: 0 0 8px var(--accent-magenta);
  line-height: 2;
}

/* ── Falling sparkles ────────────────────────────────── */
.sparkle {
  font-size: 14px;
  position: fixed;
  top: -10%;
  z-index: 1;
  user-select: none;
  pointer-events: none;
  animation: sparkleFall 10s linear infinite, sparkleShake 3s ease-in-out infinite;
}
@keyframes sparkleFall {
  0%   { top: -10%; }
  100% { top: 105%; }
}
@keyframes sparkleShake {
  0%, 100% { transform: translateX(0); }
  50%       { transform: translateX(50px); }
}
.sparkle:nth-child(1)  { left: 5%;  animation-delay: 0s,   0s;    animation-duration: 12s, 4s; }
.sparkle:nth-child(2)  { left: 15%; animation-delay: 2s,   1s;    animation-duration: 9s,  3s; }
.sparkle:nth-child(3)  { left: 28%; animation-delay: 4s,   2s;    animation-duration: 11s, 3.5s; }
.sparkle:nth-child(4)  { left: 42%; animation-delay: 1s,   0.5s;  animation-duration: 8s,  2s; }
.sparkle:nth-child(5)  { left: 55%; animation-delay: 6s,   2.5s;  animation-duration: 13s, 4s; }
.sparkle:nth-child(6)  { left: 68%; animation-delay: 3s,   1.5s;  animation-duration: 10s, 3s; }
.sparkle:nth-child(7)  { left: 82%; animation-delay: 5s,   3s;    animation-duration: 9s,  2.5s; }
.sparkle:nth-child(8)  { left: 92%; animation-delay: 7s,   0.5s;  animation-duration: 11s, 3s; }

/* ── Glow pulse animation ────────────────────────────── */
@keyframes glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(232,121,249,0.4)); }
  50%       { filter: drop-shadow(0 0 16px rgba(232,121,249,0.9)); }
}

/* ── Welcome / onboarding screen ─────────────────────── */
.welcome-hero {
  text-align: center;
  padding: 36px 16px 28px;
}
.welcome-logo {
  font-size: 4.5rem;
  display: block;
  margin-bottom: 18px;
  animation: glow 2.5s ease-in-out infinite;
}
.welcome-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 0.75rem;
  color: #fff;
  text-shadow: 3px 3px 0 var(--deep-purple), 0 0 20px var(--accent-magenta);
  line-height: 2.2;
  margin-bottom: 16px;
}
.welcome-tagline {
  font-family: 'VT323', monospace;
  font-size: 1.2rem;
  color: var(--primary-lavender);
  line-height: 1.7;
  opacity: 0.85;
}
.welcome-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent 0%, #0d001a 35%);
  z-index: 100;
  max-width: 480px;
  margin: 0 auto;
}
.welcome-skip {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.38rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.welcome-skip:hover { color: var(--primary-lavender); }
