/* Public scripture sheet — books pages */

/* Rainbow tokens — default listen sheet chrome */
:root {
  --rain-1: #ff0040;
  --rain-2: #ff8c00;
  --rain-3: #ffd400;
  --rain-4: #3bbb33;
  --rain-5: #00c4f5;
  --rain-6: #2b6cff;
  --rain-7: #e047bf;
  --rain-spin: 0deg;
}

#yh-verse-scrim {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(20, 24, 28, 0.75);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
#yh-verse-scrim.is-open {
  opacity: 1;
  pointer-events: auto;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #yh-verse-scrim { background: rgba(20, 24, 28, 0.72); }
}

/* Shell: sizing + room for glow outside the scrolling sheet */
.yh-verse-shell {
  position: relative;
  width: 100%;
  max-width: 36rem;
  z-index: 0;
}
#yh-verse-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: min(88vh, 40rem);
  overflow: auto;
  background: rgba(255, 255, 255, 0.7);
  color: #1b1b1b;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
  padding: 1rem 1.15rem 1.35rem;
  transform: translateY(12px);
  transition: transform 0.18s ease;
}
#yh-verse-scrim.is-open #yh-verse-sheet {
  transform: translateY(0);
}
@media (min-width: 720px) {
  #yh-verse-scrim { align-items: center; padding: 1.5rem; }
  #yh-verse-sheet {
    border-radius: 10px;
    max-height: 80vh;
  }
  .yh-verse-shell {
    /* desktop: allow halo to breathe */
    margin: 0.5rem;
  }
}

/* ------------------------------------------------------------------ */
/* Rainbow: AWS-ish bloom + conic travelling ring (all overlay pages)   */
/* ------------------------------------------------------------------ */
@property --rain-spin {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.yh-verse-shell::after {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 18px;
  background: conic-gradient(
    from var(--rain-spin),
    var(--rain-1),
    var(--rain-2),
    var(--rain-3),
    var(--rain-4),
    var(--rain-5),
    var(--rain-6),
    var(--rain-7),
    var(--rain-1)
  );
  filter: blur(22px);
  opacity: 0.55;
  z-index: -1;
  pointer-events: none;
  animation: yh-rain-spin 8s linear infinite;
}

.yh-verse-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px 12px 0 0;
  padding: 2px;
  background: conic-gradient(
    from var(--rain-spin),
    var(--rain-1),
    var(--rain-2),
    var(--rain-3),
    var(--rain-4),
    var(--rain-5),
    var(--rain-6),
    var(--rain-7),
    var(--rain-1)
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: 2;
  pointer-events: none;
  animation: yh-rain-spin 8s linear infinite;
}

@media (min-width: 720px) {
  .yh-verse-shell::before {
    border-radius: 10px;
  }
  .yh-verse-shell::after {
    border-radius: 16px;
  }
}

/* Stronger focus on the audio strip */
#yh-verse-sheet .yh-player {
  position: relative;
  border: 1px solid transparent;
  border-radius: 8px;
  background:
    linear-gradient(#f3efe8, #f3efe8) padding-box,
    conic-gradient(
      from var(--rain-spin),
      var(--rain-1),
      var(--rain-3),
      var(--rain-5),
      var(--rain-7),
      var(--rain-1)
    ) border-box;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.4) inset,
    0 0 18px rgba(0, 196, 245, 0.25),
    0 0 28px rgba(224, 71, 191, 0.2);
}

@keyframes yh-rain-spin {
  to { --rain-spin: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
  .yh-verse-shell::before,
  .yh-verse-shell::after {
    animation: none;
  }
  .yh-verse-shell::after {
    opacity: 0.4;
    filter: blur(16px);
  }
}

#yh-verse-sheet .yh-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}
#yh-verse-sheet .yh-ref {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #24616b;
  line-height: 1.25;
}
#yh-verse-sheet .yh-meta {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: #5a5a5a;
}
#yh-verse-sheet .yh-close {
  appearance: none;
  border: 1px solid #ccc;
  background: #f7f3ed;
  color: #1b1b1b;
  border-radius: 6px;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 auto;
}
#yh-verse-sheet .yh-text {
  margin: 0.75rem 0 1rem;
  font-size: 1.05rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
#yh-verse-sheet .yh-player {
  margin: 0 0 0.85rem;
  padding: 0.45rem 0.55rem;
}
#yh-verse-sheet .yh-player audio {
  width: 100%;
  height: 2.25rem;
  display: block;
}
#yh-verse-sheet .yh-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
#yh-verse-sheet .yh-nav button,
#yh-verse-sheet .yh-ext {
  appearance: none;
  border: 1px solid #c8c4bc;
  background: #f7f3ed;
  color: #009bc2;
  border-radius: 6px;
  padding: 0.45rem 0.75rem;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
}
#yh-verse-sheet .yh-ext.yh-ext-primary {
  background: #009bc2;
  border-color: #009bc2;
  color: #fff;
  font-weight: 600;
}
#yh-verse-sheet .yh-nav button:disabled {
  opacity: 0.4;
  cursor: default;
}
#yh-verse-sheet .yh-status {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  color: #5a5a5a;
}
#yh-verse-sheet .yh-warn {
  color: #8b0000;
}
body.yh-verse-open {
  overflow: hidden;
}
