/* ── Back button ── */
.back-btn {
  position: absolute;
  right: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
  padding: 0;
  line-height: 1;
}
.back-btn:hover {
  background: var(--accent-bg);
  border-color: var(--accent);
}

/* ── Transcript container ── */
#interactive {
  padding: 0 0 6rem;
}

/* ── Interactive words ── */
.iw {
  transition: background 0.1s, color 0.15s;
  border-radius: 2px;
  cursor: pointer;
}

.iw.active {
  background: rgba(45,106,79,0.18);
}
.iw.active.mismatch {
  background: rgba(200,55,55,0.22);
}

[data-theme="dark"] .iw.active {
  background: rgba(82,183,136,0.22);
}
[data-theme="dark"] .iw.active.mismatch {
  background: rgba(255,100,100,0.25);
}

/* ── Ayah markers ── */
.ayah-marker {
  color: var(--accent);
  font-size: 0.85em;
  opacity: 0.7;
  pointer-events: none;
  user-select: none;
}

/* ── Row completion ── */
.item.row-done .iw {
  color: var(--text);
}

/* ── xN badge ── */
.item .item-count {
  cursor: pointer;
  transition: opacity 0.3s;
}

/* ── Player bar ── */
#player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem;
  z-index: 10;
}

#audio {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  display: block;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  #interactive { padding: 0 0 5rem; }
  #player-bar { padding: 0.5rem 0.75rem; }
  .iw.active {
    background: rgba(45,106,79,0.24);
  }
  .iw.active.mismatch {
    background: rgba(200,55,55,0.28);
  }
  [data-theme="dark"] .iw.active {
    background: rgba(82,183,136,0.28);
  }
  [data-theme="dark"] .iw.active.mismatch {
    background: rgba(255,100,100,0.30);
  }
}
