/* Exit pop: "GAME OVER? ... CONTINUE?" Standalone, no dependencies. Matches the Oasis palette.
   Included on every page with: <link rel="stylesheet" href="/exitpop.css"> and <script src="/exitpop.js" defer></script>
   Colours fall back to the Oasis values when the page does not define the variables. */

.lm-exitpop {
  --xp-bg: #0b0814;
  --xp-surface: #171129;
  --xp-surface-2: #1f1836;
  --xp-line: #3a2f5c;
  --xp-text: #f4effc;
  --xp-muted: #cfc7e6;
  --xp-gold: var(--gold, #E6FF2E);
  --xp-gold-ink: var(--gold-ink, #1a1206);
  --xp-display: var(--font-display, "Bricolage Grotesque", "Arial Black", sans-serif);
  --xp-body: var(--font-body, "Instrument Sans", Arial, sans-serif);
  --xp-mono: var(--font-mono, "JetBrains Mono", ui-monospace, monospace);
  --xp-pixel: var(--font-pixel, "Press Start 2P", "JetBrains Mono", monospace);
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 16px;
  font-family: var(--xp-body); color: var(--xp-text);
}
.lm-exitpop[hidden] { display: none; }
.lm-exitpop *, .lm-exitpop *::before, .lm-exitpop *::after { box-sizing: border-box; }
.lm-exitpop__backdrop { position: absolute; inset: 0; background: rgba(11, 8, 20, 0.84); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.lm-exitpop__panel {
  position: relative; width: min(100%, 560px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; overscroll-behavior: contain;
  background: var(--xp-surface); border: 2px solid var(--xp-gold); border-radius: 24px;
  padding: 56px 24px 24px; text-align: center;
  box-shadow: inset 0 0 0 6px var(--xp-bg), 0 0 48px rgba(230, 255, 46, 0.16), 0 30px 80px -30px rgba(0, 0, 0, 0.9);
}
.lm-exitpop__panel::before { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: repeating-linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px); mix-blend-mode: overlay; }
@media (min-width: 600px) { .lm-exitpop__panel { padding: 56px 40px 32px; } }

.lm-exitpop__close {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; display: grid; place-items: center;
  border: 1px solid var(--xp-line); border-radius: 12px; background: var(--xp-surface-2); color: var(--xp-text); cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}
.lm-exitpop__close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; fill: none; }
.lm-exitpop__close:hover { border-color: var(--xp-gold); }
.lm-exitpop__close:active { transform: scale(0.94); }
.lm-exitpop :focus-visible { outline: 2px solid var(--xp-gold); outline-offset: 3px; border-radius: 6px; }

.lm-exitpop__pixel { margin: 0 0 16px; font-family: var(--xp-pixel); font-size: clamp(1rem, 0.8rem + 1.4vw, 1.6rem); line-height: 1.4; letter-spacing: 0.06em; text-transform: uppercase; color: var(--xp-gold); text-shadow: 0 0 18px rgba(230, 255, 46, 0.45); }
.lm-exitpop__continue { display: inline-flex; align-items: center; justify-content: center; gap: 16px; margin: 0 auto 24px; padding: 8px 16px; border: 1px dashed var(--xp-line); border-radius: 999px; font-family: var(--xp-mono); font-size: 0.8125rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--xp-muted); }
.lm-exitpop__continue b { display: inline-block; min-width: 2.2ch; font-family: var(--xp-display); font-weight: 800; font-size: 1.75rem; line-height: 1; letter-spacing: -0.03em; color: var(--xp-gold); font-variant-numeric: tabular-nums; text-align: center; }
.lm-exitpop__h { margin: 0 0 8px; font-family: var(--xp-display); font-weight: 800; font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem); line-height: 1.05; letter-spacing: -0.03em; text-wrap: balance; }
.lm-exitpop__p { margin: 0 auto 24px; max-width: 40ch; font-size: 1.05rem; line-height: 1.55; color: var(--xp-muted); }
.lm-exitpop__p b { color: var(--xp-text); font-weight: 600; }

.lm-exitpop__form { display: grid; gap: 8px; margin: 0 auto; max-width: 440px; }
@media (min-width: 600px) { .lm-exitpop__form { grid-template-columns: 1fr auto; } }
.lm-exitpop__form input {
  width: 100%; min-height: 48px; padding: 0 16px; border: 1px solid var(--xp-line); border-radius: 12px;
  background: var(--xp-bg); color: var(--xp-text); font: inherit; font-size: 1rem;
}
.lm-exitpop__form input::placeholder { color: #9d93bb; }
.lm-exitpop__form input:focus { border-color: var(--xp-gold); outline: none; }
.lm-exitpop__form input[aria-invalid="true"] { border-color: #ff3f9e; }
.lm-exitpop__btn {
  min-height: 48px; padding: 0 20px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--xp-gold); color: var(--xp-gold-ink); font: inherit; font-weight: 700; font-size: 1rem; white-space: nowrap;
  transition: transform 160ms ease, filter 160ms ease;
}
.lm-exitpop__btn:hover { filter: brightness(1.06); }
.lm-exitpop__btn:active { transform: translateY(1px) scale(0.99); }
.lm-exitpop__success { display: none; margin: 16px auto 0; max-width: 440px; padding: 16px; border: 1px solid var(--xp-gold); border-radius: 14px; background: var(--xp-bg); color: var(--xp-text); font-size: 0.95rem; line-height: 1.5; }
.lm-exitpop.is-done .lm-exitpop__form { display: none; }
.lm-exitpop.is-done .lm-exitpop__success { display: block; }
.lm-exitpop__note { margin: 16px 0 0; font-size: 0.875rem; color: var(--xp-muted); }
.lm-exitpop__skip { display: inline-flex; align-items: center; min-height: 44px; margin-top: 8px; padding: 0 12px; border: 0; background: transparent; color: var(--xp-muted); font: inherit; font-size: 0.95rem; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.lm-exitpop__skip:hover { color: var(--xp-text); }
.lm-exitpop__sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* entrance: transform and opacity only, skipped under reduced motion or the site's pause button */
.lm-exitpop__panel { animation: lm-exitpop-in 360ms cubic-bezier(0.16, 1, 0.3, 1) both; }
.lm-exitpop__backdrop { animation: lm-exitpop-fade 240ms ease both; }
@keyframes lm-exitpop-in { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes lm-exitpop-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lm-exitpop__panel, .lm-exitpop__backdrop { animation: none; } }
.motion-paused .lm-exitpop__panel, .motion-paused .lm-exitpop__backdrop { animation: none; }
