/* ── Progress Bar ─────────────────────────────────────── */

#progressBar {
  height: 3px;
  background: var(--border);
  flex-shrink: 0;
}
#progressFill {
  height: 100%;
  background: var(--green);
  width: 0%;
  transition: width 0.3s;
}
#progressFill.done {
  background: var(--blue);
}

/* ── Focus guide ─────────────────────────────────────── */

#focusGuide {
  position: absolute;
  left: 0;
  right: 0;
  top: 27%;
  height: 1px;
  background: var(--yellow);
  opacity: 0.12;
  pointer-events: none;
  z-index: 2;
}

/* ── Script display ───────────────────────────────────── */

#scriptWrap {
  flex: 1;
  position: relative;
  overflow: hidden;
}
.fade-top,
.fade-bot {
  position: absolute;
  left: 0;
  right: 0;
  height: 80px;
  pointer-events: none;
  z-index: 1;
}
.fade-top {
  top: 0;
  background: linear-gradient(var(--bg), transparent);
}
.fade-bot {
  bottom: 0;
  background: linear-gradient(transparent, var(--bg));
}

#scriptDisplay {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 90px 2.5rem 50vh;
  font-size: 1.5rem;
  line-height: 2.2;
  word-break: keep-all;
  overflow-wrap: normal;
}
#scriptDisplay .inner {
  max-width: 850px;
  margin: 0 auto;
}
@media (max-width: 640px) {
  #scriptDisplay {
    font-size: 1.15rem;
    padding: 70px 1rem 50vh;
  }
}

/* ── Word states ──────────────────────────────────────── */

.w {
  display: inline-block;
  white-space: nowrap;
  border-radius: 4px;
  padding: 2px 5px;
  margin: 0 1px 3px;
  cursor: pointer;
  transition:
    background 0.18s,
    color 0.18s,
    opacity 0.18s;
}
.w {
  color: var(--text);
  background: transparent;
}
.w.cur {
  background: rgba(234, 179, 8, 0.9);
  color: #0f1117;
  font-weight: 700;
}
.w.spk {
  color: var(--text-dim);
  opacity: 0.4;
}
.w.m {
  border-radius: 4px;
}
.w.skip {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  opacity: 0.85;
}
.w.u {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  opacity: 0.9;
}
.w.done-word {
  background: rgba(59, 130, 246, 0.25);
  color: var(--blue);
  opacity: 0.9;
}

#scriptHint {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 60%;
  gap: 0.8rem;
  color: var(--text-dim);
  text-align: center;
  font-size: 0.9rem;
}

/* ── "Ready to speak" overlay ─────────────────────────── */

#readyOverlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 3;
  background: rgba(15, 17, 23, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
#readyOverlay.show {
  opacity: 1;
  pointer-events: auto;
}
#readyOverlay .msg {
  font-size: 1.3rem;
  font-weight: 600;
  text-align: center;
}
#readyOverlay .sub {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-align: center;
}
.countdown {
  font-size: 3rem;
  font-weight: 700;
  color: var(--yellow);
  line-height: 1;
}
