/* ══════════════════════════════════════════════
   OVERLAYS — game-over, prompts, banners, spell staging
   ══════════════════════════════════════════════ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,7,20,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.overlay-box {
  background: linear-gradient(160deg, #101530 0%, #050714 100%);
  border: 2px solid var(--gold);
  border-radius: 16px;
  padding: 32px 40px;
  text-align: center;
  max-width: 420px;
  box-shadow: 0 0 60px rgba(201,168,76,0.3);
}
.overlay-title {
  font-family: var(--f-heading);
  font-size: 28px;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 12px;
  letter-spacing: 0.2em;
}
.overlay-subtitle {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 24px;
  opacity: 0.8;
  line-height: 1.6;
}
.overlay-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(180deg, var(--damage), #450a0a);
  border: 2px solid var(--gold);
  border-radius: 10px;
  color: var(--parchment);
  font-family: var(--f-heading);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.2em;
  cursor: pointer;
  transition: all 0.2s;
}
.overlay-btn:hover { filter: brightness(1.15); box-shadow: 0 0 20px rgba(192,57,43,0.5); }
.overlay-btn.ghost-btn {
  margin-top: 10px;
  background: transparent;
  border-color: rgba(201,168,76,0.5);
  color: var(--gold);
  font-size: 13px;
}
.overlay-btn.ghost-btn:hover { box-shadow: 0 0 16px rgba(201,168,76,0.4); }
.gameover-stats {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Hermione bonus lesson prompt ── */
#hermione-prompt {
  position: fixed;
  bottom: 22vh;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-dark);
  border: 2px solid var(--gold);
  border-radius: 10px;
  padding: 8px 14px;
  z-index: 500;
  font-size: 12px;
  color: var(--gold);
  display: none;
  align-items: center;
  gap: 8px;
  box-shadow: 0 0 20px rgba(201,168,76,0.4);
  font-family: var(--f-body);
}
#hermione-prompt.visible { display: flex; }
.hermione-btn {
  padding: 3px 8px;
  background: rgba(201,168,76,0.1);
  border: 1px solid rgba(201,168,76,0.4);
  color: var(--gold);
  border-radius: 4px;
  cursor: pointer;
  font-size: 10px;
  font-family: var(--f-heading);
}
.hermione-btn:hover { background: rgba(201,168,76,0.2); }

/* ── Take Root: forced opponent creature-discard prompt ── */
#take-root-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(74, 20, 140, 0.92);
  border: 2px solid var(--gold);
  border-radius: 10px;
  padding: 8px 20px;
  z-index: 500;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--f-heading);
  color: var(--text);
  display: none;
  align-items: center;
  gap: 10px;
}
#take-root-banner.visible { display: flex; }

/* ── Target selection banner ── */
#target-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(192,57,43,0.92);
  border: 2px solid var(--gold);
  border-radius: 10px;
  padding: 8px 20px;
  z-index: 500;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--f-heading);
  color: var(--text);
  display: none;
  align-items: center;
  gap: 10px;
}
#target-banner.visible { display: flex; }

/* ── Flying card play animation ── */
.flying-card {
  position: fixed;
  pointer-events: none;
  z-index: 2000;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.35s ease 0.1s;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7), 0 0 0 2px rgba(201,168,76,0.4);
}
.flying-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.flying-card.horizontal img {
  position: absolute;
  top: 50%; left: 50%;
  width: 71.43%;
  height: 140%;
  transform: translate(-50%, -50%) rotate(90deg);
  object-fit: cover;
}
.flying-card-back-inner {
  width: 100%;
  height: 100%;
  background: url('../assets/cards/cardback.webp') center/cover no-repeat;
}

/* ── Spell staging overlay ── */
.spell-spotlight {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 400;
  pointer-events: none;
  animation: spell-appear 2.5s forwards;
}
@keyframes spell-appear {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.7) translateY(40px); filter: brightness(2) blur(5px); }
  15%  { opacity: 1; transform: translate(-50%, -50%) scale(1.1) translateY(0);    filter: brightness(1.2) blur(0); }
  25%  { transform: translate(-50%, -50%) scale(1); filter: brightness(1); }
  85%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -80%) scale(0.9); filter: blur(10px); }
}
