.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--overlay-bg);
  backdrop-filter: blur(3px) saturate(1.1);
  -webkit-backdrop-filter: blur(3px) saturate(1.1);
  text-align: center;
  padding: calc(24px + env(safe-area-inset-top)) calc(20px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(20px + env(safe-area-inset-left));
  overflow-y: auto;
  z-index: 3;
  transition: background 0.25s ease, color 0.25s ease;
}

.overlay.spotlight::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 28%, rgba(200, 169, 110, 0.16), transparent 62%);
  pointer-events: none;
  z-index: -1;
}

.logo {
  width: clamp(38px, 9vw, 50px);
  height: auto;
  opacity: 0.95;
  filter: drop-shadow(0 0 10px rgba(200, 169, 110, 0.35));
  margin-bottom: 2px;
}

.brand {
  font-family: var(--font-retro);
  font-size: 16px;
  letter-spacing: 5px;
  color: var(--gold);
  opacity: 0.9;
}

.overlay h1 {
  font-family: var(--font-pixel);
  font-weight: normal;
  font-size: clamp(18px, 5.4vw, 30px);
  line-height: 1.5;
  letter-spacing: 1px;
  color: var(--text);
  text-shadow:
    2px 2px 0 var(--gold-deep),
    4px 4px 0 rgba(0, 0, 0, 0.35),
    0 0 26px var(--bg);
}

.overlay h1 em {
  display: block;
  color: var(--gold-bright);
  font-style: normal;
  text-shadow:
    2px 2px 0 var(--gold-deep),
    4px 4px 0 rgba(0, 0, 0, 0.35),
    0 0 20px rgba(226, 201, 142, 0.5);
}

.incentive-badge {
  position: relative;
  font-family: var(--font-retro);
  font-size: 16px;
  letter-spacing: 1px;
  color: var(--gold-bright);
  background: rgba(226, 201, 142, 0.1);
  border: 1px solid rgba(226, 201, 142, 0.45);
  border-radius: 999px;
  padding: 6px 18px;
  margin: -4px 0 2px;
}

/* Opacity-only pulse (compositor-only, no repaint) instead of animating box-shadow directly */
.incentive-badge::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: inherit;
  box-shadow: 0 0 18px rgba(226, 201, 142, 0.45);
  opacity: 0;
  animation: badge-glow 1.8s ease-in-out infinite;
  pointer-events: none;
}

@keyframes badge-glow {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.overlay h2 {
  font-family: var(--font-pixel);
  font-weight: normal;
  font-size: clamp(15px, 4vw, 20px);
  line-height: 1.6;
  letter-spacing: 1px;
  color: var(--gold-bright);
  margin-bottom: 4px;
  text-shadow:
    2px 2px 0 var(--gold-deep),
    3px 3px 0 rgba(0, 0, 0, 0.35),
    0 0 20px var(--bg);
}

.overlay .sub {
  font-family: var(--font-retro);
  font-size: 17px;
  opacity: 0.92;
  letter-spacing: 0.3px;
  line-height: 1.45;
  max-width: 380px;
  color: var(--text-dim);
  text-shadow: 0 1px 10px var(--bg), 0 0 20px var(--bg);
}

.overlay .sub .mystery {
  color: var(--gold-bright);
  font-style: italic;
  font-family: var(--font-display);
  font-size: 19px;
}

.overlay .muted {
  opacity: 0.5;
}

.back-link {
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted-text);
  text-decoration: none;
  letter-spacing: 0.5px;
}

.back-link:hover {
  color: var(--gold);
}

.howto-list {
  font-family: var(--font-retro);
  list-style: none;
  text-align: left;
  max-width: 380px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-dim);
  margin: 6px 0 10px;
}

.howto-list li::before {
  content: '▸ ';
  color: var(--gold);
}

.howto-list strong {
  color: var(--gold-bright);
}

#countdown-number {
  font-family: var(--font-pixel);
  font-size: clamp(56px, 18vw, 88px);
  color: var(--gold-bright);
  text-shadow:
    4px 4px 0 var(--gold-deep),
    8px 8px 0 rgba(0, 0, 0, 0.35),
    0 0 40px rgba(226, 201, 142, 0.6);
}

.gameover-title {
  font-family: var(--font-pixel);
  font-size: clamp(28px, 9vw, 52px);
  letter-spacing: 2px;
  color: var(--danger);
  text-shadow:
    3px 3px 0 #6e1c12,
    6px 6px 0 rgba(0, 0, 0, 0.4),
    0 0 30px rgba(194, 59, 43, 0.6);
  animation: gameover-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}

@keyframes gameover-in {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
