/* Scenyo Game Over overlay — full-screen dramatic. Used both live (JS) and static (PHP-rendered when adventure ended). */

.gameover-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(ellipse at center, rgba(245,101,101,0.12), transparent 70%),
    rgba(5, 6, 10, 0.96);
  animation: fadeIn .4s ease-out;
  overflow-y: auto;
}
.gameover-overlay.static-ended {
  position: static;
  background: linear-gradient(180deg, var(--bg) 0%, #050609 100%);
  padding: 3rem 1rem 4rem;
}
.gameover-overlay.survived {
  background:
    radial-gradient(ellipse at center, rgba(72,187,120,0.15), transparent 70%),
    rgba(5, 6, 10, 0.96);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.gameover-card {
  max-width: 760px; width: 100%;
  background: rgba(20, 26, 46, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  text-align: center;
  animation: cardRise .6s cubic-bezier(.2,.8,.2,1);
}
@keyframes cardRise { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@media (max-width: 640px) { .gameover-card { padding: 2rem 1.25rem; } }

.gameover-headline {
  font-size: clamp(2.5rem, 10vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0 0 1.5rem;
  color: var(--danger);
  text-shadow: 0 0 40px rgba(245,101,101,0.6);
  line-height: 1;
}
.gameover-overlay.survived .gameover-headline {
  color: var(--success);
  text-shadow: 0 0 40px rgba(72,187,120,0.6);
}

.gameover-epitaph {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text);
  margin: 1.5rem auto 2rem;
  max-width: 560px;
  text-align: left;
  background: rgba(0,0,0,0.25);
  padding: 1.5rem 1.75rem;
  border-radius: 12px;
  border-left: 3px solid var(--danger);
}
.gameover-overlay.survived .gameover-epitaph { border-left-color: var(--success); }

.gameover-final {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .75rem;
  margin: 1.5rem 0 2rem;
  text-align: left;
}
.gameover-final > div {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  padding: .6rem .9rem;
  border-radius: 8px;
}
.gameover-final dt { color: var(--text-dim); font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; }
.gameover-final dd { color: var(--text); margin: .15rem 0 0; font-size: .95rem; font-weight: 600; }

.death-card-preview {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: 1.5rem auto;
  display: block;
}

.gameover-actions {
  display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center;
  margin-top: 1.5rem;
}

/* Live overlay (spawned by JS during play) */
.gameover-overlay.live {
  position: fixed;
}

/* For the live JS-created variant, a close/dismiss lives in a corner (hidden by default; users mostly use action buttons) */
.gameover-close {
  position: absolute; top: 1rem; right: 1rem;
  background: rgba(255,255,255,0.08); color: var(--text-muted);
  border: 0; width: 36px; height: 36px; border-radius: 10px; cursor: pointer;
}
.gameover-close:hover { color: var(--text); background: rgba(255,255,255,0.14); }
