/* Title, caught, win and start-error screens. */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 40px;
  padding: 24px;
  box-sizing: border-box;
  text-align: center;
  pointer-events: auto;
}

.screen-title {
  background: var(--bg);
}

.screen-caught {
  background: radial-gradient(ellipse at center, #3a0a0f 0%, #140306 60%, #000 100%);
}

.screen-win {
  background: radial-gradient(ellipse at center, #0c1a12 0%, #050a07 70%, #000 100%);
}

.screen-error {
  background: var(--bg);
}

.screen-heading {
  margin: 0;
  font-weight: 700;
  line-height: 1.1;
  font-size: clamp(36px, 9vw, 96px);
}

.screen-title .screen-heading {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.08em;
  text-shadow: 0 0 18px rgba(196, 38, 46, 0.5);
  animation: title-flicker 5s infinite;
}

.screen-caught .screen-heading {
  color: var(--text);
  text-shadow: 0 0 22px var(--danger), 0 0 6px var(--danger);
}

.screen-win .screen-heading {
  color: #b9f0cc;
}

.screen-prompt {
  margin: 0;
  font-size: clamp(20px, 3.5vw, 32px);
  letter-spacing: 0.12em;
  animation: prompt-pulse 1.8s ease-in-out infinite;
}

.screen-message {
  margin: 0;
  max-width: 28em;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.4;
}

.screen-button {
  min-height: 64px;
  min-width: 220px;
  padding: 16px 40px;
  border: 3px solid var(--text);
  border-radius: 18px;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  font-size: 28px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}

.screen-button:active {
  background: var(--bg);
  color: var(--text);
  transform: scale(0.96);
}

@keyframes prompt-pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

@keyframes title-flicker {
  0%, 100% { opacity: 1; }
  91% { opacity: 1; }
  92% { opacity: 0.4; }
  93% { opacity: 1; }
  95% { opacity: 0.6; }
  96% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .screen-title .screen-heading,
  .screen-prompt {
    animation: none;
  }
}
