/* Shared modal styling, used by every page's detail/quiz popups via
   <link rel="stylesheet" href="shared/modal.css">. Pages whose modal-card needs a
   different size add a one-line ".modal-card { max-width: ...px; }" override right
   after this include -- same pattern as nav.css's per-page ".topnav a.active" color. */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: #fff;
  border-radius: 14px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  border: none;
  background: none;
  font-size: 22px;
  cursor: pointer;
  color: #888;
  line-height: 1;
}
.modal-close:hover { color: #222; }
.modal-card h2 { margin: 0 0 6px; color: #222; }
.modal-card p.hint { color: #666; margin: 0 0 16px; font-size: 14px; }

/* Prev/Next nav bar used by "detail" popups (letter, preposition, number...) that
   flank a title -- pages whose nav bar flanks something else (e.g. GK/Computer/
   Geometry's item visual) define their own wrapper class instead of this one. */
.letter-modal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 14px 0 4px;
}
.nav-btn {
  flex: 0 0 auto;
  background: #f0f1f3;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 26px;
  color: #333;
  cursor: pointer;
}
.nav-btn:hover:not(:disabled) { background: #e2e4e8; }
.nav-btn:disabled { opacity: .35; cursor: default; }

/* Briefly highlights the level card a dashboard roadmap link ("Go to
   Levels") deep-linked to, via shared/level-scroll.js -- so a child
   landing on e.g. Level 12 sees which card just got scrolled to. A CSS
   animation (rather than a class removed by JS) so it always fades out
   cleanly even if the card re-renders before the timeout would fire. */
.level-card-deep-link-highlight {
  animation: level-card-deep-link-pulse 2.2s ease-out;
}
@keyframes level-card-deep-link-pulse {
  0% { outline: 3px solid #5e35b1; outline-offset: 2px; }
  100% { outline: 3px solid transparent; outline-offset: 2px; }
}
