/* styles-final.css — Jainism app merged stylesheet, burn job 6/7 */
/* Source: Grok styles-merge chat, reply finished 04/11/26 ~11:25 AEST */
/* Merge: scaffold styles.css (canonical base, A) + burn styles pack (B, features only). */
/* Verified by execution after saving — see daily log 04/11/26. */
:root {
  --cream: #fdf8ee;
  --cream-2: #f7eed9;
  --green: #2f6b4f;
  --green-soft: #e6f0e8;
  --gold: #c9a227;
  --ink: #24302a;
  --muted: #6b7a70;
  --card: #ffffff;
  --line: #e6ddc6;
  --shadow: 0 8px 30px rgba(47, 107, 79, 0.10);
  --radius: 18px;
  --focus: var(--gold);
  --touch: 48px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.15rem; /* scaffold base — zoom-100 must not shrink to 16px */
  line-height: 1.65;
  color: var(--ink);
  background: linear-gradient(180deg, #fdf8ee 0%, #f3ead2 100%);
  min-height: 100vh;
}

/* Class-based zoom (select-driven; no button rules) */
body.zoom-100 {
  font-size: 1.15rem;
}

body.zoom-130 {
  font-size: 1.5rem;
}

body.zoom-160 {
  font-size: 1.85rem;
}

/* High-contrast (B's block, variables adapted to A's palette so it actually affects the UI) */
body.high-contrast {
  --cream: #ffffff;
  --cream-2: #ffffff;
  --green: #0047ab;
  --green-soft: #e6f0ff;
  --gold: #000000;
  --ink: #000000;
  --muted: #111111;
  --card: #ffffff;
  --line: #000000;
  --shadow: 0 0 0 transparent;
  --focus: #000000;
  background: #ffffff;
  color: var(--ink);
}

body.high-contrast .card,
body.high-contrast .topic,
body.high-contrast .lesson,
body.high-contrast .memory-card,
body.high-contrast .tile {
  border-width: 3px;
}

/* Stronger focus (B) */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.btn:focus-visible,
.nav-btn:focus-visible,
.quiz-opt:focus-visible,
select:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 4px;
}

/* Reduced motion (B) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(253, 248, 238, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 20px 8px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.header h1 {
  margin: 0;
  font-size: 1.7rem;
  color: var(--green);
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.zoom-control {
  font-size: 0.95rem;
  color: var(--muted);
  white-space: nowrap;
}

.zoom-control select {
  margin-left: 6px;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.nav {
  max-width: 960px;
  margin: 0 auto;
  padding: 6px 20px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 9;
  background: rgba(253, 248, 238, 0.96);
  border-bottom: 2px solid var(--line);
  box-shadow: var(--shadow);
}

.nav-btn {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 9px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  min-height: var(--touch);
  min-width: var(--touch);
}

.nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.nav-btn.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.section {
  margin-bottom: 2.5rem;
}

.section h2 {
  margin-top: 0;
  color: var(--green);
}

.muted {
  color: var(--muted);
}

.topic {
  border-top: 1px solid var(--line);
  padding: 14px 0;
}

.topic h3 {
  margin: 8px 0 4px;
}

.lesson {
  background: var(--green-soft);
  border-radius: 12px;
  padding: 14px 16px;
  margin: 10px 0;
}

.badge {
  display: inline-block;
  background: #fff3c4;
  color: #7a5d00;
  border: 1px solid #ecd98a;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.btn {
  background: var(--green);
  color: #fff;
  border: none;
  padding: 11px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 1rem;
  margin: 6px 6px 6px 0;
  transition: transform 0.15s ease, filter 0.15s ease;
  min-height: var(--touch);
  min-width: var(--touch);
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn.secondary {
  background: #fff;
  color: var(--green);
  border: 1px solid var(--green);
}

select {
  font-size: 1rem;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  min-height: var(--touch);
}

.recite-box,
.quiz-box {
  background: var(--cream-2);
  border-radius: 14px;
  padding: 18px;
  margin: 14px 0;
}

.chunk {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--green);
}

.quiz-opt {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  min-height: var(--touch);
  min-width: var(--touch);
  padding: 11px 16px;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.quiz-opt[aria-pressed="true"] {
  background: var(--green-soft);
  border-color: var(--green);
  box-shadow: 0 0 0 2px var(--green);
}

.quiz-opt.correct {
  background: #d9ead9;
  border-color: #2f6b4f;
}

.quiz-opt.incorrect {
  background: #fbe3e3;
  border-color: #b94a4a;
}

p.correct {
  color: #2f6b4f;
  font-weight: 700;
}

p.incorrect {
  color: #8a2f2f;
  font-weight: 700;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.memory-card {
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  min-height: 6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  user-select: none;
}

.memory-card:hover {
  transform: translateY(-2px);
}

.memory-card.flipped {
  background: var(--green-soft);
  border-color: var(--green);
  font-weight: 700;
}

.practice-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.tile {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--green-soft);
  border: 1px solid var(--green);
  border-radius: 9px;
  color: var(--green);
  font-weight: 800;
}

.footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px 32px;
  color: var(--muted);
  text-align: center;
  font-size: 0.95rem;
}

@media (max-width: 640px) {
  body {
    font-size: 106%;
  }
  .header-inner {
    flex-direction: column;
  }
  .memory-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .main {
    padding: 18px 14px 30px;
  }
}
