/* ── MODAL / POP-UP ── */
.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(10,7,2,0.75);
  z-index: 500;
  align-items: center; justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-backdrop.open { display: flex; animation: fadeIn 0.2s ease; }

.modal {
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 32px 36px;
  max-width: 540px; width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 16px 64px rgba(0,0,0,0.7);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp { from{transform:translateY(12px);opacity:0} to{transform:none;opacity:1} }

.modal-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; cursor: pointer;
  font-size: 1.3rem; color: var(--ink-light); line-height: 1;
  opacity: 0.5; transition: opacity 0.15s;
}
.modal-close:hover { opacity: 1; }

.modal-word {
  font-family: Arial, sans-serif;
  font-size: 1.3rem;
  color: var(--ink);
  margin-bottom: 4px;
}
.modal-divider {
  width: 40px; height: 2px;
  background: var(--gold);
  margin: 10px 0 16px;
}
.modal-body {
  font-size: 0.97rem;
  line-height: 1.8;
  color: var(--ink-light);
}
.modal-body strong { color: var(--red); font-weight: 600; }
.modal-loading { font-style: italic; opacity: 0.5; animation: pulse 1.4s infinite; }

/* translation / commentary selector modals */
.selector-modal .modal { max-width: 380px; }
.selector-modal h3 {
  font-family: Arial, sans-serif;
  font-size: 1rem; letter-spacing: 0.1em;
  color: var(--ink); margin-bottom: 18px;
}
.bv-section-title {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  font-family: Arial, sans-serif;
  font-weight: 600;
  margin: 18px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.bv-section-title:first-child { margin-top: 0; }
.option-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.option-list li {
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.15s;
  color: var(--ink-light);
}
.option-list li:hover { background: var(--gold-pale); border-color: var(--gold); color: var(--ink); }
.option-list li.selected { background: var(--gold); color: var(--ink); border-color: var(--gold-light); font-weight: 600; }
.option-list .opt-desc {
  display: block; font-size: 0.76rem;
  font-style: italic; margin-top: 2px; opacity: 0.7;
}

/* ── AI LABEL ── */
.ai-label {
  display: inline-block;
  font-size: 0.6rem;
  font-family: Arial, sans-serif;
  letter-spacing: 0.05em;
  color: var(--ink-light);
  opacity: 0.6;
  padding: 2px 6px;
  border: 1px solid var(--ink-light);
  border-radius: 3px;
  margin-bottom: 8px;
}

#wordModal { z-index: 600; }
