/* World Choir — Profile Page */

.profile-page {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

/* Hide legal footer until Profile content paints — avoids a flash of
   Privacy / Terms / Contact on an otherwise empty black page. */
.profile-page--booting .profile-legal-footer {
  visibility: hidden;
  pointer-events: none;
}

.profile-brand {
  text-align: center;
  margin-bottom: 28px;
}

/* Match Donate search trigger slot: 44×44, 20px icon, top-right of page
   (Donate: padding 14/20 + margin-right -8 → 14px top, 12px right). */
.profile-theme-toggle {
  position: absolute;
  top: 14px;
  right: 12px;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 50%;
  z-index: 5;
  transition: color 0.25s ease, background 0.25s ease;
}

.profile-theme-toggle:hover,
.profile-theme-toggle:focus-visible {
  color: var(--text-primary);
  background: var(--input-background);
  outline: none;
}

.profile-theme-toggle__icon {
  display: block;
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
}

.profile-section {
  margin-bottom: 14px;
}

.profile-logo {
  display: block;
  width: min(168px, 44vw);
  height: auto;
  margin: 0 auto 12px;
  object-fit: contain;
  filter: none !important;
}

.profile-voices-counter {
  margin: 0 auto;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent-aurora);
  font-variant-numeric: tabular-nums;
}

.profile-voices-counter--loading {
  opacity: 0.42;
  animation: profileVoicesPulse 1.6s ease-in-out infinite;
}

.profile-voices-counter--bump {
  animation: profileVoicesBump 0.9s cubic-bezier(0.22, 1.4, 0.36, 1);
}

.profile-legal-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
  padding: 4px 12px 6px;
  font-size: 0.52rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.48;
}

.profile-legal-footer__row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 5px;
  max-width: 100%;
  white-space: nowrap;
}

.profile-legal-footer__row--contact {
  white-space: normal;
}

.profile-legal-footer a,
.profile-legal-footer__btn {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.profile-legal-footer__btn {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.profile-legal-footer a:hover,
.profile-legal-footer__btn:hover,
.profile-legal-footer__btn:focus-visible {
  opacity: 1;
  color: var(--text-secondary);
  outline: none;
}

.profile-legal-footer span {
  opacity: 0.65;
  flex-shrink: 0;
}

@keyframes profileVoicesPulse {
  0%, 100% { opacity: 0.42; }
  50% { opacity: 0.68; }
}

@keyframes profileVoicesBump {
  0% {
    transform: scale(1);
    color: var(--accent-aurora);
    text-shadow: none;
    letter-spacing: 0.28em;
  }
  18% {
    transform: scale(1.22);
    color: var(--text-primary);
    text-shadow:
      0 0 12px rgba(78, 197, 232, 0.95),
      0 0 28px rgba(61, 124, 255, 0.7);
    letter-spacing: 0.34em;
  }
  42% {
    transform: scale(1.1);
    color: var(--accent-blue);
    text-shadow:
      0 0 10px rgba(61, 124, 255, 0.65),
      0 0 22px rgba(78, 197, 232, 0.45);
    letter-spacing: 0.3em;
  }
  100% {
    transform: scale(1);
    color: var(--accent-aurora);
    text-shadow: none;
    letter-spacing: 0.28em;
  }
}

/* Identity card */
.identity-card {
  text-align: center;
  padding: 32px 28px;
  background: var(--surface-gradient);
  border: 1px solid var(--df-line);
  box-shadow: var(--shadow-card), var(--inset-highlight);
}

.identity-name {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.identity-location {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.identity-location--empty {
  color: var(--text-muted);
  font-style: italic;
}

.identity-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.identity-actions .btn-ghost {
  width: 100%;
  max-width: 280px;
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  padding: 12px 24px;
  max-width: 100%;
}

.btn-ghost:hover {
  border-color: var(--border-glow);
  color: var(--text-primary);
}

/* Participation status */
.participation-card {
  text-align: center;
  padding: 28px 24px;
}

.participation-status {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.participation-status strong {
  color: var(--text-primary);
  font-weight: 500;
}

.participation-card .btn-primary.pledged {
  pointer-events: none;
}

.participation-card--loading {
  min-height: 148px;
}

.participation-card-skeleton {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.participation-card-skeleton__line {
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    var(--surface-lift) 0%,
    var(--border-mid) 50%,
    var(--surface-lift) 100%
  );
  background-size: 200% 100%;
  animation: participationSkeleton 1.4s ease-in-out infinite;
}

.participation-card-skeleton__line--wide {
  width: min(100%, 280px);
  height: 18px;
}

.participation-card-skeleton__line--btn {
  width: 160px;
  height: 44px;
}

@keyframes participationSkeleton {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Practice button — keep shared profile-section 14px bottom gap */
.practice-section {
  margin-top: 0;
}

.btn-practice {
  width: 100%;
  max-width: none;
  padding: 22px 32px;
  font-size: 1.1rem;
  flex-direction: column;
  color: #000000;
  -webkit-text-fill-color: #000000;
  background: linear-gradient(
    135deg,
    rgba(61, 124, 255, 0.95) 0%,
    rgba(107, 92, 231, 0.95) 50%,
    rgba(201, 169, 98, 0.85) 100%
  );
  box-shadow:
    0 12px 48px rgba(61, 124, 255, 0.35),
    inset 0 1px 0 var(--border-soft);
  border-radius: var(--radius-lg);
}

.btn-practice:hover {
  transform: translateY(-2px);
  box-shadow:
    0 16px 56px rgba(61, 124, 255, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  color: #000000;
  -webkit-text-fill-color: #000000;
}

.btn-practice-sub {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  margin-top: 4px;
  color: #000000;
  -webkit-text-fill-color: #000000;
  opacity: 0.78;
}

/* Promise card */
.promise-card {
  text-align: center;
  padding: 32px 28px;
  border-color: rgba(201, 169, 98, 0.15);
}

.promise-label {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 16px;
}

.promise-text {
  font-size: 1.2rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.promise-event {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* History */
.history-card {
  padding: 28px 24px;
}

.history-empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.6;
  padding: 8px 0;
}

.history-entry {
  padding: 20px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.history-entry:first-child {
  padding-top: 0;
}

.history-entry:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.history-entry-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.history-detail {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0;
  gap: 16px;
}

.history-detail-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.history-detail-value {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: right;
}

.history-promise {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.5;
}

.history-section-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

/* Invite */
.invite-section {
  margin-top: 8px;
  text-align: center;
}

.btn-invite {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  font-size: 0.95rem;
  padding: 14px 28px;
  max-width: none;
  width: 100%;
}

.btn-invite:hover {
  border-color: rgba(78, 197, 232, 0.35);
  color: var(--accent-aurora);
}

/* Daily Acts of Peace — Profile entry (banner/full UI in daily-peace.css) */
.daily-acts-section {
  margin-top: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-daily-acts {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  font-size: 0.95rem;
  padding: 14px 28px;
  max-width: none;
  width: 100%;
}

.btn-daily-acts:hover {
  border-color: rgba(78, 197, 232, 0.35);
  color: var(--accent-aurora);
}

/* ═══════════════════════════════════════════════════════════════════
   PRACTICE MODE — Premium World Choir visual redesign
   All functional logic is preserved in the JS layer.
   Only the visual presentation is updated here.
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Overlay container ─── */
.practice-mode {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #020508;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.practice-mode.active {
  display: flex;
  align-items: stretch;
}

/* Walkthrough lives inside #practice-mode — keep it above playing UI */
.practice-mode > .pm-wt {
  position: absolute;
  inset: 0;
  z-index: 500;
}

/* Ambient keeps the existing JS-injected element intact (no-op visually now) */
.practice-mode__ambient {
  display: none;
}

/* Ensure the mounted countdown/playing shells can fully fill the screen. */
.practice-mode #practice-mode-content {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  min-height: 0;
}

/* ─── Close X (floated top-right, injected by JS) ─── */
.pm-close-x {
  position: fixed;
  top: max(env(safe-area-inset-top, 16px), 16px);
  right: max(env(safe-area-inset-right, 20px), 20px);
  z-index: 400;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: rgba(244, 244, 246, 0.55);
  padding: 0;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.pm-close-x:hover,
.pm-close-x:focus-visible {
  color: var(--text-primary);
  outline: none;
}

.pm-close-x:active {
  opacity: 0.5;
}

/* ─── Countdown ─── */
.practice-countdown {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1;
}

.practice-countdown__number {
  font-size: clamp(6rem, 25vw, 12rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  text-shadow:
    0 0 60px rgba(61, 124, 255, 0.5),
    0 0 120px rgba(107, 92, 231, 0.3);
  animation: countdownPulse 1s ease-in-out;
}

@keyframes countdownPulse {
  0% { opacity: 0; transform: scale(0.6); }
  30% { opacity: 1; transform: scale(1.05); }
  70% { opacity: 1; transform: scale(1); }
  100% { opacity: 0.3; transform: scale(0.95); }
}

/* ─── Playing shell ─── */
.practice-playing {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-sizing: border-box;
  overflow: hidden;
}

/* ─── Background image ─── */
.pm-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('/images/practice/practice-song-background.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  /* Fallback when image is missing: deep navy atmosphere */
  background-color: #020810;
}

.pm-bg__overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(2, 5, 12, 0.72) 0%,
      rgba(2, 5, 12, 0.45) 30%,
      rgba(2, 5, 12, 0.45) 60%,
      rgba(2, 5, 12, 0.88) 85%,
      rgba(2, 5, 12, 0.97) 100%
    );
}

/* ─── Header / Logo ─── */
.pm-header {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 20px 60px 0;
  box-sizing: border-box;
  flex-shrink: 0;
}

.pm-logo {
  display: block;
  width: min(100px, 26vw);
  height: auto;
  object-fit: contain;
  opacity: 0.9;
}

/* ─── Lyrics hero ─── */
.pm-lyrics {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 24px 40px;
  box-sizing: border-box;
  text-align: center;
  min-height: 0;
}

/* Very subtle radial blue illumination behind active lyric */
.pm-lyrics__radial {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 40% at 50% 50%, rgba(61, 124, 255, 0.07) 0%, transparent 70%);
  pointer-events: none;
}

/* Row: waveform accent + current lyric + waveform accent */
.pm-lyrics__row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin: 10px 0;
}

/* ─── Decorative waveform accents ─── */
.pm-waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.pm-waveform--left {
  flex-direction: row-reverse;
}

.pm-waveform__bar {
  display: block;
  width: 2px;
  border-radius: 2px;
  background: var(--accent-blue);
  opacity: 0.45;
}

/* Three bars at different heights (purely decorative) */
.pm-waveform__bar:nth-child(1) { height: 10px; }
.pm-waveform__bar:nth-child(2) { height: 16px; opacity: 0.6; }
.pm-waveform__bar:nth-child(3) { height: 8px; }

/* ─── Lyric typography ─── */
.lyrics-display__current {
  font-size: clamp(1.3rem, 4.5vw, 1.85rem);
  font-weight: 600;
  color: var(--accent-blue);
  line-height: 1.35;
  min-height: 2.7em;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-shadow:
    0 0 28px rgba(61, 124, 255, 0.45),
    0 0 60px rgba(61, 124, 255, 0.2);
  transition: opacity 0.3s ease;
}

.lyrics-display__current.is-active {
  animation: lyricFadeIn 0.45s ease;
}

@keyframes lyricFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lyrics-display__prev,
.lyrics-display__next {
  font-size: clamp(0.85rem, 2.8vw, 1.05rem);
  color: var(--text-secondary);
  opacity: 0.38;
  line-height: 1.5;
  min-height: 1.5em;
  width: 100%;
  transition: opacity 0.4s ease;
}

.lyrics-display__prev { margin-bottom: 2px; }
.lyrics-display__next { margin-top: 2px; }

/* ─── Progress bar ─── */
.pm-progress-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 0 28px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.pm-progress-bar {
  position: relative;
  height: 3px;
  background: var(--border-mid);
  border-radius: 3px;
  overflow: visible;
  cursor: default;
}

.pm-progress-bar__fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--accent-blue);
  border-radius: 3px;
  transition: width 0.25s linear;
}

.pm-progress-bar__thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-blue);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px rgba(61, 124, 255, 0.6);
  transition: left 0.25s linear;
}

.pm-progress-times {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

.pm-time {
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ─── Song info ─── */
.pm-song-info {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 14px 28px 4px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.pm-song-info__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: 0 0 3px;
}

.pm-song-info__artist {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  letter-spacing: 0.02em;
}

/* ─── Playback controls ─── */
.pm-controls {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 16px 28px 12px;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
}

.pm-controls__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 0;
  transition: color 0.2s ease, opacity 0.2s ease;
  min-width: 44px;
  min-height: 44px;
}

.pm-controls__btn--secondary {
  color: rgba(244, 244, 246, 0.5);
}

.pm-controls__btn--secondary:hover,
.pm-controls__btn--secondary:focus-visible {
  color: var(--text-primary);
  outline: none;
}

.pm-controls__btn--secondary:active {
  opacity: 0.5;
}

.pm-controls__btn--primary {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid rgba(61, 124, 255, 0.4);
  background: rgba(61, 124, 255, 0.08);
  color: var(--accent-blue);
  box-shadow: 0 0 20px rgba(61, 124, 255, 0.2);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.pm-controls__btn--primary:hover,
.pm-controls__btn--primary:focus-visible {
  background: rgba(61, 124, 255, 0.18);
  box-shadow: 0 0 30px rgba(61, 124, 255, 0.35);
  outline: none;
}

.pm-controls__btn--primary:active {
  opacity: 0.7;
}

/* ─── Bottom community panel ─── */
.pm-community {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px max(env(safe-area-inset-bottom, 16px), 16px);
  box-sizing: border-box;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.pm-community__left {
  flex-shrink: 0;
  color: var(--accent-blue);
  opacity: 0.5;
  display: flex;
  align-items: center;
}

.pm-community__center {
  flex: 1;
  min-width: 0;
}

.pm-community__title {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-blue);
  opacity: 0.7;
  margin: 0 0 2px;
}

.pm-community__primary {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0 0 1px;
}

.pm-community__secondary {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0;
}

.pm-community__right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--text-muted);
}

.pm-community__count {
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ─── Practice complete ─── */
.practice-complete {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px;
  animation: fadeIn 0.6s ease;
}

.practice-complete__title {
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.practice-complete__copy {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 36px;
  line-height: 1.6;
}

.practice-complete .actions-row {
  max-width: 320px;
  margin: 0 auto;
}

/* ─── Practice error ─── */
.practice-error {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 32px;
  max-width: 400px;
}

.practice-error__title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.practice-error__copy {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.6;
}

/* Owner access trigger removed — use /owner directly. */

.ios-calendar-modal {
  max-width: 420px;
}

.ios-calendar-modal .modal-copy strong {
  color: var(--text-primary);
  font-weight: 600;
}
