/* The single overlay used for the intro and every stage outcome. */

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 12, 8, 0.6);
  backdrop-filter: blur(3px);
}

.modal-card {
  position: relative;
  width: min(100%, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: clamp(24px, 5vw, 36px);
  text-align: center;
  background: var(--paper);
  border-radius: 24px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
  animation: pop-in 0.28s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.94);
  }
}

.modal-icon-slot {
  display: grid;
  place-items: center;
  width: clamp(64px, 18vw, 88px);
  height: clamp(64px, 18vw, 88px);
  border-radius: 50%;
  background: rgba(87, 171, 76, 0.16);
}

.modal-icon {
  width: 70%;
  height: 70%;
}

.modal-title {
  margin: 0;
  font-size: clamp(1.3rem, 5vw, 1.8rem);
  line-height: 1.2;
}

.modal-message {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.5;
}

.modal .btn {
  margin-top: 6px;
}

/* Per-outcome accents on the icon halo. */
.modal--time-up .modal-icon-slot {
  background: rgba(240, 160, 47, 0.2);
}

.modal--game-over .modal-icon-slot,
.modal--error .modal-icon-slot {
  background: rgba(217, 79, 79, 0.18);
}

.modal--victory .modal-icon-slot {
  background: rgba(245, 197, 66, 0.28);
}

.modal--error .modal-message {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
  text-align: left;
  color: var(--danger);
}
