/* Coptic Deacon Training — design tokens & global styles */

:root {
  /* Liturgical palette — burgundy, gold, deep navy, parchment */
  --bg:           #FBF6EC;          /* Parchment */
  --bg-warm:      #F4ECD8;
  --surface:      #FFFFFF;
  --surface-alt:  #FFFAF0;
  --ink:          #1A0F1F;          /* Near-black with violet hint */
  --ink-2:        #4A3848;
  --ink-3:        #7B6878;
  --ink-4:        #B0A29F;
  --line:         #E8DDC8;
  --line-2:       #D9CBB1;

  --burgundy:     #8B2E2E;          /* Liturgical red */
  --burgundy-dk:  #5C1818;
  --burgundy-lt:  #F4E0DD;
  --gold:         #C9A961;          /* Iconographic gold */
  --gold-dk:      #A8763E;
  --gold-lt:      #FAF1DC;
  --navy:         #2A1B4A;          /* Deep liturgical purple-navy */
  --navy-dk:      #190E33;
  --teal:         #2E6B6B;          /* Coptic teal accent */
  --green:        #2E7D5B;
  --green-lt:     #E1F0E7;
  --error:        #C0392B;
  --error-lt:     #FBE5E1;

  /* Type — Cormorant for serif headings, EB Garamond fallback for body, Inter for UI */
  --font-display: 'Cormorant Garamond', 'Cormorant', 'EB Garamond', Georgia, serif;
  --font-serif:   'EB Garamond', 'Cormorant Garamond', Georgia, serif;
  --font-ui:      'Inter', -apple-system, system-ui, sans-serif;
  --font-coptic:  'Noto Sans Coptic', 'New Athena Unicode', serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 22px;
  --r-2xl: 28px;

  --s-shadow-1: 0 1px 2px rgba(60,30,10,.06), 0 1px 3px rgba(60,30,10,.08);
  --s-shadow-2: 0 4px 12px rgba(60,30,10,.10), 0 2px 4px rgba(60,30,10,.06);
  --s-shadow-3: 0 12px 32px rgba(60,30,10,.16), 0 4px 8px rgba(60,30,10,.08);
}

[data-theme="dark"] {
  --bg:           #14101A;
  --bg-warm:      #1B1626;
  --surface:      #1F1828;
  --surface-alt:  #261E33;
  --ink:          #F4E9D6;
  --ink-2:        #D2C4B0;
  --ink-3:        #948776;
  --ink-4:        #5E5448;
  --line:         #2E2638;
  --line-2:       #3A3046;
  --burgundy-lt:  #3A1A1A;
  --gold-lt:      #2E2410;
  --green-lt:     #1A2E22;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; padding: 0; }
input { font-family: inherit; }
.cop, .lyric-cop, .hymn-cop, .tone-cop, .rp-cop, .vestment-cop, .reading-cop,
.title-cop, .player-title-cop, .ref-cop, .quiz-coptic-display, .player-art-cop, .lesson-cop,
.track-art-glyph, .pp-cop, .hymn-tile-cop, .chip-cop, .hymn-art span, .hymn-tile-glyph {
  font-family: var(--font-coptic);
}

.overline {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}

/* ---------- App shell ---------- */
.app-root {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background:
    radial-gradient(ellipse at top right, rgba(201,169,97,.08), transparent 60%),
    radial-gradient(ellipse at bottom left, rgba(139,46,46,.06), transparent 50%),
    var(--bg);
}
.app-shell {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
@media (min-width: 900px) {
  .app-root { padding: 24px; gap: 24px; }
  .app-shell {
    max-width: 440px;
    border-radius: 32px;
    box-shadow: var(--s-shadow-3);
    overflow: hidden;
    min-height: calc(100vh - 48px);
    border: 1px solid var(--line);
  }
}

.app-top {
  position: sticky;
  top: 0;
  z-index: 30;
  background: linear-gradient(to bottom, var(--bg) 80%, transparent);
  padding: 14px 18px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-brand-mark {
  width: 38px; height: 38px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: var(--s-shadow-2);
  flex-shrink: 0;
}
.app-brand-mark img {
  width: 100%; height: 100%;
  display: block;
  object-fit: cover;
}
.app-brand-mark::after {
  content: none;
}
.app-brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .01em;
  line-height: 1.1;
}
.app-brand-sub {
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.app-top-actions { display: flex; gap: 4px; }
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-2);
  transition: all .15s ease;
}
.icon-btn:hover { background: var(--bg-warm); color: var(--ink); }
.icon-btn.lg { width: 48px; height: 48px; }
.icon-btn.on { color: var(--burgundy); }

/* ---------- Bottom nav ---------- */
.app-nav {
  position: sticky;
  bottom: 0;
  z-index: 30;
  background: var(--surface);
  border-top: 1px solid var(--line);
  display: flex;
  padding: 8px 4px 12px;
  gap: 4px;
  box-shadow: 0 -8px 24px rgba(60,30,10,.06);
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: var(--r-md);
  color: var(--ink-3);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .03em;
  transition: color .15s ease;
  position: relative;
}
.nav-btn.active { color: var(--burgundy); }
.nav-btn.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px; height: 3px;
  background: var(--burgundy);
  border-radius: 0 0 4px 4px;
}

/* ---------- Screen base ---------- */
.screen { padding: 4px 18px 0; flex: 1; animation: fade-in .3s ease; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.screen-pad { height: 32px; }
.screen-head { padding: 16px 0 12px; }
.screen-h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 600;
  margin: 0;
  color: var(--ink);
  letter-spacing: -.01em;
  line-height: 1;
}
.screen-sub { font-size: 14px; color: var(--ink-3); margin: 6px 0 0; }

/* Section header */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 22px 0 10px;
  gap: 12px;
  flex-wrap: wrap;
}
.section-header > div:first-child { min-width: 0; flex: 1; }
.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -.005em;
}
.section-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.section-link {
  font-size: 12px;
  color: var(--burgundy);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 2px;
  letter-spacing: .02em;
  text-transform: uppercase;
}

/* ---------- Today screen ---------- */
.date-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0 4px;
}
.date-coptic {
  width: 56px; height: 56px;
  border-radius: 12px;
  background: var(--burgundy);
  color: var(--gold);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-coptic);
  position: relative;
  box-shadow: var(--s-shadow-2);
}
.date-coptic::after {
  content: '';
  position: absolute; inset: 3px;
  border-radius: 9px;
  border: 1px solid rgba(201,169,97,.3);
}
.date-cop-script {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: .04em;
  line-height: 1;
  font-weight: 600;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.date-cop-num { font-family: var(--font-ui); font-size: 18px; font-weight: 700; line-height: 1.1; margin-top: 2px; }
.date-meta { flex: 1; min-width: 0; }
.date-greg { font-size: 13px; color: var(--ink-3); }
.date-season {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  display: flex; align-items: center; gap: 6px;
}
.season-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.streak-pill {
  display: flex; align-items: center; gap: 5px;
  background: linear-gradient(135deg, #FFF1D6, #F8E2B3);
  color: var(--burgundy);
  border: 1px solid var(--gold);
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
}

.tone-hero {
  margin-top: 18px;
  border-radius: var(--r-2xl);
  background: linear-gradient(135deg, var(--burgundy) 0%, var(--burgundy-dk) 60%, var(--navy-dk) 100%);
  color: var(--gold-lt);
  position: relative;
  overflow: hidden;
  padding: 24px 22px 22px;
  box-shadow: var(--s-shadow-3);
}
.tone-hero-bg {
  position: absolute; inset: 0;
  color: var(--gold);
  opacity: .65;
}
.tone-hero-content { position: relative; z-index: 1; }
.tone-hero .overline { color: var(--gold); opacity: .9; }
.tone-name-large {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 6px 0 4px;
  row-gap: 2px;
}
.tone-cop {
  font-family: var(--font-coptic);
  font-size: 36px;
  color: var(--gold);
  line-height: 1;
}
.tone-en {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
  color: #fff;
  line-height: 1;
}
.tone-desc {
  font-family: var(--font-serif);
  font-size: 15px;
  color: rgba(255,255,255,.78);
  font-style: italic;
}
.tone-btn {
  margin-top: 18px;
  background: rgba(255,255,255,.12);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(201,169,97,.4);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(8px);
  transition: all .15s ease;
}
.tone-btn:hover { background: rgba(255,255,255,.2); }

/* Lesson card */
.lesson-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 14px;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: var(--s-shadow-1);
}
.lesson-card:hover { border-color: var(--gold); box-shadow: var(--s-shadow-2); transform: translateY(-1px); }
.lesson-card-art {
  width: 64px; height: 64px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--gold-lt), var(--gold));
  display: grid; place-items: center;
  flex-shrink: 0;
  position: relative;
}
.lesson-card-art::after {
  content: ''; position: absolute; inset: 3px; border-radius: 7px;
  border: 1px solid rgba(255,255,255,.4);
}
.lesson-cop { font-size: 32px; color: var(--burgundy-dk); position: relative; z-index: 1; }
.lesson-card-body { flex: 1; min-width: 0; overflow: hidden; }
.lesson-eyebrow { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.lesson-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; line-height: 1.05; margin: 2px 0 1px; }
.lesson-sub { font-family: var(--font-serif); font-size: 14px; color: var(--ink-3); font-style: italic; }
.lesson-progress { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.lesson-progress-bar { flex: 1; height: 5px; background: var(--line); border-radius: 999px; overflow: hidden; }
.lesson-progress-fill { height: 100%; background: var(--burgundy); border-radius: 999px; }
.lesson-progress-text { font-size: 11px; color: var(--ink-2); font-weight: 700; }

/* Quick actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 18px;
}
.quick-action {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 6px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: all .15s ease;
}
.quick-action:hover { transform: translateY(-2px); border-color: var(--gold); box-shadow: var(--s-shadow-2); }
.quick-action.highlight { background: linear-gradient(135deg, var(--gold-lt), #fff); border-color: var(--gold); }
.qa-icon {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-warm);
  display: grid; place-items: center;
  color: var(--burgundy);
}
.quick-action.highlight .qa-icon { background: var(--gold); color: var(--burgundy-dk); }
.qa-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.qa-sub { font-size: 10px; color: var(--ink-3); }

/* Readings */
.readings-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--s-shadow-1);
}
.reading-row {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .15s ease;
}
.reading-row:hover { background: var(--bg-warm); }
.reading-row:last-child { border-bottom: 0; }
.reading-cop {
  font-size: 16px;
  color: var(--burgundy);
  width: 96px;
  flex-shrink: 0;
  line-height: 1.15;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.reading-meta { flex: 1; min-width: 0; }
.reading-type { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.reading-ref { font-family: var(--font-serif); font-size: 15px; color: var(--ink); margin-top: 1px; }

/* Streak card */
.streak-card {
  margin-top: 22px;
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, #FFF8E5 0%, #FBEDC8 100%);
  border: 1px solid var(--gold);
  border-radius: var(--r-xl);
  padding: 16px;
  cursor: pointer;
}
.streak-flame {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F5C24A, #C9882B);
  color: #fff;
  display: grid; place-items: center;
  position: relative;
  box-shadow: 0 4px 12px rgba(201,136,43,.4);
}
.streak-count {
  position: absolute; bottom: -4px; right: -4px;
  background: var(--burgundy);
  color: var(--gold);
  width: 26px; height: 26px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px;
  font-weight: 700;
  border: 2px solid #FFF8E5;
}
.streak-body { flex: 1; }
.streak-title { font-family: var(--font-display); font-size: 22px; font-weight: 600; color: var(--burgundy-dk); }
.streak-sub { font-family: var(--font-serif); font-size: 13px; color: var(--ink-2); font-style: italic; }
.streak-week { display: flex; gap: 5px; margin-top: 8px; }
.streak-day {
  flex: 1;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255,255,255,.5);
  border: 1.5px solid var(--gold);
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 700;
  display: grid; place-items: center;
}
.streak-day.done { background: var(--burgundy); color: var(--gold); border-color: var(--burgundy); }
.streak-day.today { background: var(--gold); color: var(--burgundy-dk); border-color: var(--burgundy); }

/* ---------- Lessons screen ---------- */
.rank-ladder {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 8px 4px 18px;
  gap: 0;
}
.rank-pip {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer;
}
.rank-pip-circle {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--rank-color, var(--ink-4));
  color: var(--rank-color, var(--ink-3));
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 16px;
  font-family: var(--font-display);
  transition: all .2s ease;
}
.rank-pip.done .rank-pip-circle { background: var(--rank-color); color: #fff; }
.rank-pip.active .rank-pip-circle {
  transform: scale(1.12);
  box-shadow: 0 0 0 4px rgba(139,46,46,.15);
}
.rank-pip.locked .rank-pip-circle { background: var(--bg-warm); border-style: dashed; opacity: .6; }
.rank-pip-label { font-size: 10.5px; color: var(--ink-2); font-weight: 600; text-align: center; max-width: 60px; }
.rank-rail {
  flex: 1;
  height: 2px;
  background: var(--line);
  margin-top: 21px;
  border-radius: 2px;
  position: relative;
  top: 0;
}
.rank-rail.done { background: var(--gold); }

.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 12px;
  margin: 0 -18px;
  padding-left: 18px; padding-right: 18px;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 500;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip-cop { font-size: 14px; color: var(--burgundy); }
.chip.on { background: var(--burgundy); color: #fff; border-color: var(--burgundy); }
.chip.on .chip-cop { color: var(--gold); }

.tracks-list { display: flex; flex-direction: column; gap: 12px; }
.track-card {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: var(--s-shadow-1);
}
.track-card:hover { transform: translateY(-1px); box-shadow: var(--s-shadow-2); border-color: var(--rank-color, var(--gold)); }
.track-art {
  width: 88px;
  background: linear-gradient(135deg, var(--rank-color), color-mix(in srgb, var(--rank-color) 60%, black));
  color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 12px 8px;
  position: relative;
}
.track-art::after {
  content: ''; position: absolute; inset: 4px; border: 1px solid rgba(255,255,255,.2); border-radius: 6px;
}
.track-art-glyph { font-size: 36px; line-height: 1; }
.track-art-rank { font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; margin-top: 6px; opacity: .85; }
.track-body { flex: 1; padding: 14px; min-width: 0; }
.track-title { font-family: var(--font-display); font-size: 19px; font-weight: 600; line-height: 1.15; }
.track-desc { font-family: var(--font-serif); font-size: 13px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }
.track-progress-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.track-pbar { flex: 1; height: 5px; background: var(--line); border-radius: 999px; overflow: hidden; }
.track-pfill { height: 100%; border-radius: 999px; }
.track-pcount { font-size: 11px; color: var(--ink-2); font-weight: 700; }

/* ---------- Hymns screen ---------- */
.search-row { display: flex; gap: 8px; align-items: center; padding: 4px 0 12px; }
.search-box {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  height: 40px;
  color: var(--ink-3);
}
.search-box input {
  flex: 1;
  border: 0; outline: 0; background: transparent;
  font-size: 14px;
  color: var(--ink);
}
.view-toggle {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-3);
  display: grid; place-items: center;
}
.view-toggle.on { background: var(--burgundy); color: var(--gold); border-color: var(--burgundy); }

.hymn-list { display: flex; flex-direction: column; gap: 8px; }
.hymn-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 10px;
  cursor: pointer;
  transition: all .15s ease;
}
.hymn-row:hover { border-color: var(--gold); box-shadow: var(--s-shadow-1); }
.hymn-art {
  width: 56px; height: 56px;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  color: #fff;
  font-size: 28px;
  position: relative;
  flex-shrink: 0;
}
.hymn-art::after {
  content: ''; position: absolute; inset: 3px; border: 1px solid rgba(255,255,255,.25); border-radius: 7px;
}
.hymn-meta { flex: 1; min-width: 0; }
.hymn-title { font-family: var(--font-display); font-size: 18px; font-weight: 600; line-height: 1.1; }
.hymn-cop { font-size: 14px; color: var(--burgundy); margin-top: 1px; }
.hymn-sub { font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.hymn-en { font-style: italic; }
.hymn-dot { color: var(--ink-4); }
.diff-dots { display: inline-flex; gap: 2px; }
.diff-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--line-2); }
.diff-dot.on { background: var(--gold); }
.bookmark-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-4); transition: color .15s; }
.bookmark-btn:hover { color: var(--ink-2); }
.bookmark-btn.on { color: var(--burgundy); }

.hymn-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.hymn-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 12px;
  cursor: pointer;
  transition: all .15s ease;
}
.hymn-tile:hover { transform: translateY(-1px); box-shadow: var(--s-shadow-2); }
.hymn-tile-art {
  aspect-ratio: 1;
  border-radius: var(--r-md);
  display: grid; place-items: center;
  color: #fff;
  margin-bottom: 10px;
  position: relative;
}
.hymn-tile-art::after { content: ''; position: absolute; inset: 4px; border: 1px solid rgba(255,255,255,.25); border-radius: 7px; }
.hymn-tile-glyph { font-size: 56px; }
.hymn-tile-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1.1; }
.hymn-tile-cop { font-size: 13px; color: var(--burgundy); margin-top: 1px; }

/* ---------- Hymn Player ---------- */
.player-screen {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--burgundy-dk) 0%, var(--navy-dk) 60%, #0E0518 100%);
  color: #fff;
  z-index: 50;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
@media (min-width: 900px) {
  .player-screen { border-radius: 32px; }
}
.player-screen .icon-btn { color: rgba(255,255,255,.85); }
.player-screen .icon-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.player-screen .icon-btn.on { color: var(--gold); }
.player-head { display: flex; align-items: center; padding: 16px; gap: 8px; }
.player-head-meta { flex: 1; text-align: center; }
.player-head-eyebrow { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); font-weight: 600; }

.player-art {
  display: grid;
  place-items: center;
  padding: 8px 24px 12px;
  position: relative;
}
.player-art-disc {
  width: 200px; height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--gold), var(--gold-dk) 70%, #5a3a18);
  display: grid; place-items: center;
  position: relative;
  box-shadow: 0 12px 60px rgba(201,169,97,.3), inset 0 0 60px rgba(0,0,0,.3);
}
.player-art-cop {
  font-size: 100px;
  color: var(--burgundy-dk);
  text-shadow: 0 2px 0 rgba(255,255,255,.2);
  z-index: 2;
}
.player-art-ring, .player-art-ring.r2, .player-art-ring.r3 {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(201,169,97,.3);
  pointer-events: none;
}
.player-art-ring   { inset: -16px; }
.player-art-ring.r2 { inset: -32px; opacity: .6; }
.player-art-ring.r3 { inset: -48px; opacity: .3; }

.player-titles { text-align: center; padding: 10px 24px 16px; }
.player-title { font-family: var(--font-display); font-size: 28px; font-weight: 600; }
.player-title-cop { font-size: 22px; color: var(--gold); margin-top: 2px; }
.player-title-en { font-family: var(--font-serif); font-size: 14px; color: rgba(255,255,255,.65); font-style: italic; margin-top: 4px; }
.player-occasion { font-size: 11.5px; color: rgba(255,255,255,.5); margin-top: 8px; letter-spacing: .04em; }

.lyrics {
  padding: 8px 24px 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.lyric-line {
  text-align: center;
  opacity: .35;
  transition: opacity .3s ease, transform .3s ease;
  cursor: pointer;
}
.lyric-line.past { opacity: .25; }
.lyric-line.active { opacity: 1; transform: scale(1.02); }
.lyric-cop { font-size: 22px; color: var(--gold); font-family: var(--font-coptic); line-height: 1.3; }
.lyric-tr { font-family: var(--font-display); font-size: 18px; font-weight: 500; margin-top: 2px; }
.lyric-en { font-family: var(--font-serif); font-size: 14px; color: rgba(255,255,255,.7); font-style: italic; margin-top: 2px; }
.lyric-line.active .lyric-cop { color: #FFD978; text-shadow: 0 0 24px rgba(201,169,97,.5); }

.player-controls { padding: 16px 24px 28px; }
.player-progress { padding: 0 4px; }
.player-progress input[type="range"] {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,.15);
  border-radius: 999px;
  outline: 0;
}
.player-progress input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}
.player-times { display: flex; justify-content: space-between; font-size: 11px; color: rgba(255,255,255,.6); margin-top: 4px; font-variant-numeric: tabular-nums; }
.player-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}
.play-btn {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dk));
  color: var(--burgundy-dk);
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(201,169,97,.4);
  transition: transform .15s ease;
}
.play-btn:hover { transform: scale(1.05); }
.play-btn:active { transform: scale(.96); }

/* ---------- Quiz ---------- */
.quiz-screen { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }
.quiz-head { display: flex; align-items: center; gap: 14px; padding: 14px 18px 12px; }
.quiz-progress { flex: 1; display: flex; gap: 4px; }
.qp-pip { flex: 1; height: 6px; background: var(--line); border-radius: 999px; transition: background .3s; }
.qp-pip.done { background: var(--green); }
.qp-pip.active { background: var(--burgundy); }
.quiz-streak { display: flex; align-items: center; gap: 4px; color: var(--burgundy); font-weight: 700; font-size: 14px; }

.quiz-body { flex: 1; padding: 24px 18px; display: flex; flex-direction: column; }
.quiz-eyebrow { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.quiz-prompt { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.2; margin: 6px 0 22px; }
.quiz-coptic-display {
  font-size: 96px;
  color: var(--burgundy);
  text-align: center;
  margin: 0 0 24px;
  font-family: var(--font-coptic);
  text-shadow: 0 2px 12px rgba(139,46,46,.15);
}
.quiz-audio {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--burgundy), var(--burgundy-dk));
  color: var(--gold);
  padding: 18px 24px;
  border-radius: var(--r-xl);
  margin-bottom: 24px;
}
.quiz-audio-wave { display: flex; align-items: center; gap: 3px; height: 32px; flex: 1; }
.quiz-wave-bar {
  width: 3px;
  background: var(--gold);
  border-radius: 999px;
  animation: wave 1.2s ease-in-out infinite;
}
@keyframes wave { 0%, 100% { height: 20%; } 50% { height: 80%; } }

.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  text-align: left;
  transition: all .2s ease;
  font-size: 15px;
  color: var(--ink);
}
.quiz-option:hover:not(:disabled) { border-color: var(--burgundy); transform: translateY(-1px); }
.quiz-option .qo-letter {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--bg-warm);
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-2);
  flex-shrink: 0;
}
.qo-text { flex: 1; font-family: var(--font-serif); }
.quiz-option.correct { border-color: var(--green); background: var(--green-lt); color: var(--green); }
.quiz-option.correct .qo-letter { background: var(--green); color: #fff; }
.quiz-option.wrong { border-color: var(--error); background: var(--error-lt); color: var(--error); }
.quiz-option.wrong .qo-letter { background: var(--error); color: #fff; }
.quiz-option.dim { opacity: .5; }

.quiz-explain {
  margin-top: 18px;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border-left: 4px solid var(--green);
}
.quiz-explain.wrong { border-left-color: var(--error); }
.qe-title { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--green); font-size: 13px; }
.quiz-explain.wrong .qe-title { color: var(--error); }
.qe-text { font-family: var(--font-serif); font-size: 14px; color: var(--ink-2); margin-top: 4px; line-height: 1.45; }

.quiz-footer { padding: 16px 18px 28px; }
.btn-primary {
  background: var(--burgundy);
  color: #fff;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all .15s ease;
}
.btn-primary:hover { background: var(--burgundy-dk); }
.btn-primary.lg { width: 100%; justify-content: center; padding: 16px; font-size: 16px; }
.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--ink);
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
}

.quiz-result { padding: 60px 24px 24px; text-align: center; flex: 1; display: flex; flex-direction: column; align-items: center; }
.quiz-result-glyph { color: var(--gold); margin-bottom: 18px; }
.quiz-result-title { font-family: var(--font-display); font-size: 32px; font-weight: 600; }
.quiz-result-score { font-family: var(--font-display); font-size: 64px; font-weight: 700; color: var(--burgundy); margin: 18px 0 0; line-height: 1; }
.quiz-result-pct { color: var(--ink-3); font-size: 14px; }
.quiz-result-actions { display: flex; gap: 12px; margin-top: 32px; width: 100%; max-width: 320px; }
.quiz-result-actions button { flex: 1; }

/* ---------- Practice ---------- */
.practice-selector { padding: 8px 0 0; }
.practice-selector .overline { display: block; margin-bottom: 8px; }
.practice-pills {
  display: flex; gap: 6px;
  overflow-x: auto;
  margin: 0 -18px;
  padding: 4px 18px;
  scrollbar-width: none;
}
.practice-pills::-webkit-scrollbar { display: none; }
.practice-pill {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}
.practice-pill .pp-cop { font-size: 16px; color: var(--burgundy); }
.practice-pill.on { background: var(--burgundy); color: #fff; border-color: var(--burgundy); }
.practice-pill.on .pp-cop { color: var(--gold); }

.reference-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 16px 18px;
  margin-top: 14px;
  box-shadow: var(--s-shadow-1);
}
.reference-card .overline { display: block; margin-bottom: 10px; }
.ref-line { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.ref-line:last-child { border-bottom: 0; }
.ref-cop { font-size: 20px; color: var(--burgundy); }
.ref-tr { font-family: var(--font-display); font-size: 16px; font-weight: 500; margin-top: 1px; }
.ref-en { font-family: var(--font-serif); font-size: 13px; color: var(--ink-3); font-style: italic; margin-top: 1px; }

.recorder {
  margin-top: 18px;
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-dk) 100%);
  border-radius: var(--r-2xl);
  padding: 24px 20px;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--s-shadow-3);
}
.rec-waveform {
  display: flex; align-items: center; justify-content: center; gap: 3px;
  height: 80px;
  margin-bottom: 4px;
}
.rec-bar {
  width: 4px;
  background: var(--gold);
  border-radius: 999px;
  height: 12%;
  transition: height .1s ease;
  opacity: .9;
}
.recorder:not(.on) .rec-bar { opacity: .35; }
.rec-time { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold); font-family: var(--font-display); }
.rec-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 14px; }
.rec-btn-sm {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  color: #fff;
  display: grid; place-items: center;
}
.rec-btn-main {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: var(--burgundy);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(139,46,46,.5);
  transition: all .2s ease;
}
.rec-btn-main.on {
  background: var(--gold);
  color: var(--burgundy-dk);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 6px 20px rgba(201,169,97,.5); }
  50% { box-shadow: 0 6px 32px rgba(201,169,97,.8); }
}
.rec-status { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .7; margin-top: 12px; font-weight: 600; }

.sessions-list { display: flex; flex-direction: column; gap: 8px; }
.session-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 12px 14px;
}
.session-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--bg-warm); display: grid; place-items: center; color: var(--burgundy); }
.session-meta { flex: 1; }
.session-hymn { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.session-sub { font-size: 12px; color: var(--ink-3); }
.session-score { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.session-score.good { color: var(--green); }
.session-score.ok   { color: var(--gold-dk); }
.session-score.low  { color: var(--error); }

/* ---------- Profile ---------- */
.profile-head { text-align: center; padding: 20px 0 16px; }
.profile-avatar { display: inline-block; position: relative; }
.profile-avatar-inner {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--burgundy), var(--burgundy-dk));
  color: var(--gold);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  box-shadow: var(--s-shadow-3);
  position: relative;
}
.profile-avatar-inner::after {
  content: ''; position: absolute; inset: 4px; border: 2px solid rgba(201,169,97,.4); border-radius: 50%;
}
.profile-rank-badge {
  position: absolute; bottom: -4px; right: -4px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--rank-color);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 13px;
  border: 3px solid var(--bg);
}
.profile-name { font-family: var(--font-display); font-size: 28px; font-weight: 600; margin-top: 12px; }
.profile-rank-name { color: var(--burgundy); font-size: 14px; font-weight: 600; margin-top: 2px; }
.profile-parish { font-family: var(--font-serif); font-size: 13px; color: var(--ink-3); font-style: italic; margin-top: 1px; }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 16px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent);
}
.stat-icon { width: 32px; height: 32px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); display: grid; place-items: center; }
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--ink); margin-top: 6px; line-height: 1; }
.stat-label { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; letter-spacing: .02em; }

.rank-progress-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 6px 14px;
  box-shadow: var(--s-shadow-1);
}
.rp-row { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.rp-row:last-child { border-bottom: 0; }
.rp-circle {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--rank-color);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
  font-family: var(--font-display);
  flex-shrink: 0;
}
.rp-meta { flex: 1; min-width: 0; }
.rp-row-top { display: flex; justify-content: space-between; align-items: center; }
.rp-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; line-height: 1; }
.rp-cop { font-size: 13px; color: var(--burgundy); margin-top: 1px; }
.rp-pct { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--ink-2); }
.rp-bar { height: 5px; background: var(--line); border-radius: 999px; margin-top: 6px; overflow: hidden; }
.rp-bar-fill { height: 100%; border-radius: 999px; }
.rp-en { font-family: var(--font-serif); font-size: 12.5px; color: var(--ink-3); margin-top: 4px; font-style: italic; }

.vestments-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.vestment-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px;
  text-align: center;
}
.vestment-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-lt), var(--gold));
  color: var(--burgundy-dk);
  display: grid; place-items: center;
  margin: 0 auto 8px;
}
.vestment-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.vestment-cop { font-size: 14px; color: var(--burgundy); margin-top: 1px; }
.vestment-en { font-family: var(--font-serif); font-size: 12px; color: var(--ink-3); font-style: italic; margin-top: 1px; }

/* Tweaks panel — minor overrides for our theme */
.tweaks-panel-default {
  font-family: var(--font-ui);
}
