/**
 * Homepage hero — teleprompter-style stage preview (matches /stage/{id} viewer).
 */
.homepage-stage-preview {
  --hsp-chord: rgba(255, 210, 60, 0.95);
  --hsp-gold: #fec70c;
  --hsp-font-base: clamp(0.95rem, 1.2vw + 0.5rem, 1.15rem);
  --hsp-font-active-ratio: 1.12;
  --hsp-viewport-height: clamp(16rem, 38vh, 22rem);
  background: #000;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 80px rgba(254, 199, 12, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  text-align: center;
  width: 100%;
  max-width: none;
}

.homepage-stage-preview__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: #111;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.homepage-stage-preview__header img {
  height: 30px;
  width: auto;
  flex-shrink: 0;
}

.homepage-stage-preview__song {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.5rem;
  margin-left: auto;
  text-align: right;
}

.homepage-stage-preview__song .musica-nome {
  color: var(--hsp-gold);
  font-weight: 700;
  font-size: 1.05rem;
}

.homepage-stage-preview__song .musica-banda {
  color: rgba(254, 199, 12, 0.7);
  font-size: 0.9rem;
}

.homepage-stage-preview__song .chord-meta-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  line-height: 1.2;
  white-space: nowrap;
}

.homepage-stage-preview__song .chord-meta-badge--key {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.homepage-stage-preview__song .chord-meta-badge--capo {
  color: #fde68a;
  background: rgba(254, 199, 12, 0.15);
  border: 1px solid rgba(254, 199, 12, 0.45);
}

.homepage-stage-preview__body {
  position: relative;
  padding: 0;
}

.homepage-stage-preview__viewport {
  position: relative;
  height: var(--hsp-viewport-height);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.35) 8%,
    #000 18%,
    #000 82%,
    rgba(0, 0, 0, 0.35) 92%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    rgba(0, 0, 0, 0.35) 8%,
    #000 18%,
    #000 82%,
    rgba(0, 0, 0, 0.35) 92%,
    transparent 100%
  );
}

.homepage-stage-preview__viewport::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: clamp(4.5rem, 14vh, 6.5rem);
  background: radial-gradient(
    ellipse at center,
    rgba(255, 165, 0, 0.16) 0%,
    rgba(255, 165, 0, 0.06) 45%,
    transparent 72%
  );
  pointer-events: none;
  z-index: 1;
}

.homepage-stage-preview__scroll {
  padding: calc(var(--hsp-viewport-height) * 0.38) 28px calc(var(--hsp-viewport-height) * 0.38);
  will-change: transform;
  transition: transform 1s cubic-bezier(0.33, 1, 0.68, 1);
}

.homepage-stage-preview__side {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 3;
}

.homepage-stage-preview__side-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  pointer-events: none;
}

.homepage-stage-preview__side-btn.is-active {
  background: rgba(245, 158, 11, 0.95);
  border-color: #f59e0b;
  color: #111;
}

.homepage-stage-preview .linha-secao {
  text-align: center;
  margin: 0 0 18px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #ffa500;
  opacity: 0.85;
}

.homepage-stage-preview .linha-cifra {
  color: rgba(255, 255, 255, 0.28);
  line-height: 1.85;
  margin-bottom: 18px;
  padding: 12px 16px;
  position: relative;
  max-width: 92%;
  margin-left: auto;
  margin-right: auto;
  font-size: var(--hsp-font-base);
  transition: color 0.45s ease, transform 0.45s ease, opacity 0.45s ease;
  transform: scale(0.96);
  opacity: 0.55;
}

.homepage-stage-preview .linha-cifra.destacada {
  color: #fff;
  font-weight: 600;
  font-size: calc(var(--hsp-font-base) * var(--hsp-font-active-ratio));
  transform: scale(1);
  opacity: 1;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 165, 0, 0.22) 0%,
    rgba(255, 165, 0, 0.08) 50%,
    transparent 78%
  );
  text-shadow: 0 0 24px rgba(255, 180, 40, 0.25);
}

.homepage-stage-preview .linha-acordes-inline {
  display: block;
  color: var(--hsp-chord);
  font-weight: 700;
  font-family: "Courier New", Courier, monospace;
  line-height: 1.25;
  margin-bottom: 6px;
  letter-spacing: 0.1em;
  font-size: 0.92em;
}

.homepage-stage-preview .linha-cifra.destacada .linha-acordes-inline {
  color: #ffd84d;
  text-shadow: 0 0 12px rgba(255, 200, 60, 0.35);
}

.homepage-stage-preview .letra-segmentada {
  font-family: "Courier New", Courier, monospace;
  white-space: normal;
  line-height: 1.2;
  display: inline;
}

.homepage-stage-preview .acorde-segmento {
  display: inline-block;
  vertical-align: top;
  text-align: left;
  line-height: normal;
}

.homepage-stage-preview .acorde-nome {
  display: block;
  color: var(--hsp-chord);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 3px;
  min-height: 1.2em;
  white-space: nowrap;
}

.homepage-stage-preview .linha-cifra.destacada .acorde-nome {
  color: #ffd84d;
}

.homepage-stage-preview .acorde-nome-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5em;
  max-width: 100%;
  margin-bottom: 3px;
}

.homepage-stage-preview .acorde-texto,
.homepage-stage-preview .linha-texto-inline {
  display: block;
  white-space: pre-wrap;
  line-height: 1.55;
  font-family: "Courier New", Courier, monospace;
  word-break: normal;
  overflow-wrap: break-word;
}

.homepage-stage-preview .letra-inline {
  display: block;
  font-family: "Courier New", Courier, monospace;
}

.homepage-stage-preview .linha-letra-target {
  position: relative;
  z-index: 2;
}

.homepage-stage-preview .linha-progress-container {
  position: absolute;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: transparent;
  border-radius: 2px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.homepage-stage-preview .linha-progress-top {
  top: 0;
}

.homepage-stage-preview .linha-progress-bottom {
  bottom: 0;
}

.homepage-stage-preview .linha-cifra.destacada .linha-progress-container {
  opacity: 1;
  background-color: rgba(255, 255, 255, 0.06);
}

.homepage-stage-preview .linha-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(255, 165, 0, 0.65) 0%, rgba(255, 220, 80, 1) 100%);
  box-shadow: 0 0 10px rgba(255, 165, 0, 0.55);
  animation: hsp-progress 3.2s ease-in-out infinite;
}

@keyframes hsp-progress {
  0% {
    width: 8%;
  }
  45% {
    width: 88%;
  }
  100% {
    width: 8%;
  }
}

.homepage-stage-preview__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px 14px;
  background: rgba(17, 17, 17, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.45);
}

.homepage-stage-preview__footer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.7);
  animation: hsp-pulse 2s ease-in-out infinite;
}

@keyframes hsp-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.65;
    transform: scale(0.85);
  }
}

.homepage-stage-preview__footer-label {
  color: rgba(254, 199, 12, 0.9);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (min-width: 992px) {
  .homepage-stage-preview {
    --hsp-viewport-height: clamp(15rem, 28vh, 20rem);
    --hsp-font-base: clamp(0.9rem, 0.75vw + 0.55rem, 1.1rem);
  }
}

@media (min-width: 1200px) {
  .homepage-stage-preview {
    --hsp-viewport-height: clamp(16rem, 30vh, 21rem);
    --hsp-font-active-ratio: 1.1;
  }
}

@media (max-width: 768px) {
  .homepage-stage-preview {
    --hsp-viewport-height: clamp(18rem, 52vw, 22rem);
    --hsp-font-base: clamp(0.95rem, 3.8vw, 1.15rem);
    border-radius: 14px;
  }

  .homepage-stage-preview__scroll {
    padding-left: 14px;
    padding-right: 14px;
  }

  .homepage-stage-preview__side {
    display: none;
  }

  .homepage-stage-preview .linha-cifra {
    max-width: 100%;
    padding-left: 10px;
    padding-right: 10px;
    margin-bottom: 14px;
  }

  .homepage-stage-preview .linha-acordes-inline {
    font-size: 0.88em;
    letter-spacing: 0.05em;
    overflow-x: auto;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
  }

  .homepage-stage-preview .linha-texto-inline {
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .homepage-stage-preview__scroll {
    transition: none;
  }

  .homepage-stage-preview .linha-progress-bar,
  .homepage-stage-preview__footer-dot {
    animation: none;
  }
}
