/* ==================================================================
   DIVINE CROSS CODES — components
   ================================================================== */

/* ------------------------------------------------------------------ *
 * Buttons — large, unambiguous, always labelled with words
 * ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: var(--tap);
  padding: 0.9rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--cream);
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-align: center;
  transition: transform 0.12s ease, background 0.15s ease,
              border-color 0.15s ease, box-shadow 0.15s ease;
}
.btn:active { transform: translateY(1px) scale(0.995); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.btn--block { display: flex; width: 100%; }

.btn--gold {
  background: linear-gradient(180deg, var(--gold-400), var(--gold-600));
  color: #221A05;
  box-shadow: var(--shadow-gold);
  font-weight: 750;
}
.btn--gold:hover {
  background: linear-gradient(180deg, var(--gold-300), var(--gold-500));
  color: #221A05;
}

.btn--outline {
  border-color: var(--gold-600);
  color: var(--gold-300);
  background: rgba(212, 175, 55, 0.06);
}
.btn--outline:hover { background: var(--accent-soft); color: var(--gold-300); }

.btn--ghost {
  border-color: var(--line-soft);
  color: var(--cream);
  background: rgba(255, 255, 255, 0.04);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.08); color: var(--cream); }

.btn--quiet {
  color: var(--muted);
  min-height: 48px;
  padding: 0.6rem 0.9rem;
  font-weight: 600;
}
.btn--quiet:hover { color: var(--cream); }

.btn--danger {
  border-color: rgba(232, 131, 111, 0.5);
  color: var(--danger);
  background: rgba(232, 131, 111, 0.08);
}

.btn--hero {
  min-height: 68px;
  font-size: 1.1rem;
  border-radius: var(--r-lg);
}

/* ------------------------------------------------------------------ *
 * Cards
 * ------------------------------------------------------------------ */

.card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: var(--gap-3);
  box-shadow: var(--shadow-1);
}

.card--gold {
  border-color: var(--line);
  background:
    linear-gradient(180deg, rgba(212, 175, 55, 0.09), rgba(212, 175, 55, 0) 58%),
    var(--card);
}

.card--flat { box-shadow: none; background: var(--bg-raised); }

.card__title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.25;
}

/* A tappable row: icon + words + chevron. Used everywhere in Profile. */
.list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--card);
}

.list__item {
  display: flex;
  align-items: center;
  gap: var(--gap-2);
  min-height: 68px;
  padding: 0.9rem 1.1rem;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  color: var(--cream);
  text-align: left;
  width: 100%;
  transition: background 0.14s ease;
}
.list__item:last-child { border-bottom: 0; }
.list__item:hover { background: rgba(255, 255, 255, 0.045); color: var(--cream); }

.list__icon { color: var(--gold-500); flex: none; }
.list__label { flex: 1; font-weight: 600; min-width: 0; }
.list__hint {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0.1rem;
}
.list__chevron { color: var(--muted-2); flex: none; }
.list__value { color: var(--gold-400); font-weight: 650; flex: none; }

/* ------------------------------------------------------------------ *
 * Chips and selectable cards
 * ------------------------------------------------------------------ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 650;
  letter-spacing: 0.03em;
}
.chip--gold {
  border-color: var(--line);
  background: var(--accent-soft);
  color: var(--gold-300);
}
.chip--done {
  border-color: rgba(127, 199, 154, 0.4);
  background: rgba(127, 199, 154, 0.12);
  color: var(--success);
}
/* A chip acting as a selector — unmistakably chosen. */
.chip.is-on {
  background: linear-gradient(180deg, var(--gold-400), var(--gold-600));
  border-color: var(--gold-500);
  color: #221A05;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  min-height: 72px;
  padding: 1rem 1.1rem;
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--cream);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.choice:hover { border-color: var(--gold-700); }
.choice__icon { color: var(--gold-500); flex: none; }
.choice__check {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--line-soft);
  display: grid;
  place-items: center;
  color: transparent;
  flex: none;
}
.choice[aria-pressed="true"],
.choice.is-selected {
  border-color: var(--gold-500);
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.14), rgba(212, 175, 55, 0.04));
}
.choice[aria-pressed="true"] .choice__check,
.choice.is-selected .choice__check {
  background: var(--gold-500);
  border-color: var(--gold-500);
  color: #221A05;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}
@media (min-width: 420px) {
  .choice-grid { grid-template-columns: 1fr 1fr; }
  .choice { min-height: 84px; }
}

/* ------------------------------------------------------------------ *
 * Forms
 * ------------------------------------------------------------------ */

.field { display: flex; flex-direction: column; gap: 0.5rem; }

.field__label {
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--cream-2);
}

.field__hint { font-size: 0.85rem; color: var(--muted); }

.input, .textarea, .select {
  width: 100%;
  min-height: var(--tap);
  padding: 0.95rem 1.05rem;
  border: 1.5px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--navy-850);
  color: var(--cream);
  font-size: 1rem;
  line-height: 1.55;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--gold-500);
  background: var(--navy-800);
  outline: none;
}
.input:focus-visible, .textarea:focus-visible { outline: 2px solid var(--gold-400); outline-offset: 1px; }

.textarea {
  min-height: 140px;
  resize: vertical;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.7;
}

.select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold-500) 50%),
    linear-gradient(135deg, var(--gold-500) 50%, transparent 50%);
  background-position: right 1.35rem center, right 1.05rem center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.8rem;
}
.select option { background: var(--navy-800); color: var(--cream); }

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.85rem 0;
  cursor: pointer;
}
.check input {
  appearance: none;
  width: 28px; height: 28px;
  flex: none;
  margin: 0;
  border: 1.5px solid var(--line-soft);
  border-radius: 8px;
  background: var(--navy-850);
  display: grid;
  place-items: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.check input::after {
  content: "";
  width: 13px; height: 8px;
  border-left: 2.5px solid #221A05;
  border-bottom: 2.5px solid #221A05;
  transform: rotate(-45deg) translate(1px, -2px);
  opacity: 0;
}
.check input:checked {
  background: var(--gold-500);
  border-color: var(--gold-500);
}
.check input:checked::after { opacity: 1; }
.check__text { font-size: 0.98rem; line-height: 1.5; }

.switch {
  position: relative;
  width: 58px; height: 34px;
  flex: none;
  appearance: none;
  margin: 0;
  border-radius: 999px;
  background: var(--navy-600);
  border: 1px solid var(--line-soft);
  transition: background 0.18s ease;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--cream-2);
  transition: transform 0.18s ease, background 0.18s ease;
}
.switch:checked { background: var(--gold-600); }
.switch:checked::after { transform: translateX(24px); background: #FFF6DA; }

/* ------------------------------------------------------------------ *
 * Progress
 * ------------------------------------------------------------------ */

.pips { display: flex; gap: 0.42rem; }
.pips__pip {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  background: var(--navy-600);
  transition: background 0.3s ease;
}
.pips__pip.is-done {
  background: linear-gradient(90deg, var(--gold-600), var(--gold-400));
}

.progress__label {
  margin-top: 0.55rem;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}

/* ------------------------------------------------------------------ *
 * Notes and empty states
 * ------------------------------------------------------------------ */

.note {
  display: flex;
  gap: 0.75rem;
  padding: 0.95rem 1.05rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.035);
}
.note__icon { color: var(--muted); flex: none; margin-top: 1px; }
.note__text { font-size: 0.9rem; line-height: 1.6; color: var(--muted); }
.note--gold { border-color: var(--line); background: var(--accent-soft); }
.note--gold .note__icon, .note--gold .note__text { color: var(--gold-300); }
.note--care {
  border-color: rgba(127, 199, 154, 0.32);
  background: rgba(127, 199, 154, 0.09);
}
.note--care .note__icon, .note--care .note__text { color: #A8DBBC; }

.empty {
  text-align: center;
  padding: var(--gap-5) var(--gap-3);
  border: 1px dashed var(--line-soft);
  border-radius: var(--r-lg);
}
.empty__icon {
  width: 72px; height: 72px;
  margin: 0 auto var(--gap-2);
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--gold-500);
}
.empty__title { font-family: var(--serif); font-size: 1.25rem; font-weight: 500; }
.empty__body {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.94rem;
  max-width: 34ch;
  margin-inline: auto;
}
.empty .btn { margin-top: var(--gap-3); }

/* ------------------------------------------------------------------ *
 * Screen header
 * ------------------------------------------------------------------ */

.screen-head { padding: 1.4rem 0 0.9rem; }
.screen-head__row { display: flex; align-items: center; gap: 0.85rem; }
.screen-head__text { flex: 1; min-width: 0; }
.screen-head__title {
  font-family: var(--serif);
  font-size: 1.65rem;
  font-weight: 500;
}
.screen-head__sub {
  margin-top: 0.2rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* ------------------------------------------------------------------ *
 * Bottom navigation — five items, icons plus words
 * ------------------------------------------------------------------ */

.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: rgba(8, 16, 31, 0.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html[data-night="true"] .tabbar { background: rgba(6, 11, 22, 0.96); }

.tabbar__inner {
  max-width: var(--shell);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  min-height: var(--nav-h);
  padding: 0.5rem 0.15rem;
  color: var(--muted-2);
  /* Navigation chrome keeps a fixed size — the Text Size setting enlarges the
     content a member reads, not the five labels that have to fit side by side. */
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  transition: color 0.15s ease;
}
@media (max-width: 359px) {
  .tab { font-size: 9.5px; letter-spacing: 0; }
}
.tab:hover { color: var(--cream-2); }
.tab.is-active { color: var(--gold-400); }
.tab.is-active .tab__dot { opacity: 1; }
.tab__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold-400);
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* ------------------------------------------------------------------ *
 * Sheets
 * ------------------------------------------------------------------ */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.sheet.is-open { opacity: 1; }

.sheet__scrim {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 14, 0.72);
  backdrop-filter: blur(3px);
}

.sheet__panel {
  position: relative;
  width: 100%;
  max-width: var(--shell);
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 0.75rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-2);
  transform: translateY(24px);
  transition: transform 0.24s cubic-bezier(0.22, 0.9, 0.3, 1);
}
.sheet.is-open .sheet__panel { transform: none; }

.sheet__grip {
  width: 48px; height: 5px;
  border-radius: 999px;
  background: var(--navy-500);
  margin: 0.25rem auto 1rem;
}
.sheet__title {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 0.85rem;
}
.sheet__text { color: var(--muted); line-height: 1.65; }
.sheet__body { display: flex; flex-direction: column; gap: var(--gap-2); }
.sheet__actions {
  display: flex;
  gap: 0.7rem;
  margin-top: var(--gap-3);
}
.sheet__actions .btn { flex: 1; }

@media (min-width: 700px) {
  .sheet { align-items: center; }
  .sheet__panel {
    border-radius: var(--r-xl);
    border-bottom: 1px solid var(--line);
    margin: 1rem;
    max-height: 84dvh;
  }
}

/* ------------------------------------------------------------------ *
 * Toast
 * ------------------------------------------------------------------ */

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 1rem);
  transform: translate(-50%, 16px);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  width: min(92vw, 420px);
}
#toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.toast__inner {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.95rem 1.15rem;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--navy-700);
  color: var(--cream);
  box-shadow: var(--shadow-2);
  font-weight: 600;
  font-size: 0.94rem;
}
.toast__inner .icon { color: var(--gold-400); }

/* ------------------------------------------------------------------ *
 * Media players
 * ------------------------------------------------------------------ */

.player {
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  background: var(--navy-850);
  overflow: hidden;
}

.player__stage {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(212, 175, 55, 0.16), transparent 62%),
    linear-gradient(180deg, var(--navy-750), var(--navy-900));
  text-align: center;
  padding: 1.25rem;
}
.player__stage video { width: 100%; height: 100%; object-fit: contain; background: #000; }

.player__play {
  width: 92px; height: 92px;
  border-radius: 50%;
  border: 2px solid var(--gold-500);
  background: rgba(212, 175, 55, 0.14);
  color: var(--gold-400);
  display: grid; place-items: center;
  box-shadow: var(--shadow-gold);
}
.player__play:hover { background: rgba(212, 175, 55, 0.24); }

.player__meta {
  margin-top: 0.9rem;
  font-size: 0.86rem;
  color: var(--muted);
}

.player__bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.8rem 0.9rem;
  border-top: 1px solid var(--line-soft);
  background: var(--navy-800);
  flex-wrap: wrap;
}

.player__ctrl {
  min-width: 48px;
  height: 48px;
  padding: 0 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cream);
  font-size: 0.8rem;
  font-weight: 700;
}
.player__ctrl:hover { background: var(--accent-soft); color: var(--gold-300); }
.player__ctrl.is-on { border-color: var(--gold-500); color: var(--gold-300); }

.player__scrub {
  flex: 1 1 140px;
  height: 8px;
  appearance: none;
  border-radius: 999px;
  background: var(--navy-600);
}
.player__scrub::-webkit-slider-thumb {
  appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gold-400);
  border: 2px solid var(--navy-900);
}
.player__scrub::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gold-400);
  border: 2px solid var(--navy-900);
}

.player__time {
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 650;
  min-width: 88px;
  text-align: right;
}

.player__pending {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
}
.player__pending strong { color: var(--cream-2); font-size: 1rem; }
