/*
 * Static crisis fallback (index.html). Shown if the app has not started
 * after 1.5 s (old browser, script blocked or failing) and (via
 * <noscript>) immediately when JavaScript is disabled.
 * Self-contained on purpose: it must work without the app's own CSS.
 */

/*
 * A normal start mounts the app within a few hundred milliseconds and
 * removes #crisis-fallback (src/main.ts). Until 1.5 s have passed the block
 * stays invisible (also for screen readers), so it never flashes up. CSS
 * only – no inline script (CSP). The <noscript> copy is not delayed, and
 * noscript.css hides this block when JavaScript is off.
 */
#crisis-fallback {
  visibility: hidden;
  animation-name: fb-reveal;
  animation-duration: 0s;
  animation-delay: 1.5s;
  animation-fill-mode: forwards;
}

@keyframes fb-reveal {
  to {
    visibility: visible;
  }
}

body {
  margin: 0;
  background: #f3f7f2;
  color: #14231a;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  font-size: 1.0625rem;
  line-height: 1.55;
}

.fb {
  padding: max(1rem, env(safe-area-inset-top)) 1rem 1rem;
}

.fb-card {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.25rem;
  background: #ffffff;
  border: 2px solid #b42318;
  border-radius: 1rem;
}

.fb-app {
  margin: 0 0 0.5rem;
  font-weight: 700;
  color: #40554a;
}

.fb-info {
  margin: 1rem 0 0;
}

.fb-alert {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  line-height: 1.3;
}

.fb-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fb-list li {
  margin: 0 0 1rem;
}

.fb-label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.fb a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  min-width: 48px;
  margin: 0.25rem 0.5rem 0.25rem 0;
  padding: 0.5rem 1rem;
  border-radius: 0.625rem;
  background: #1b6b3a;
  color: #ffffff;
  font-weight: 700;
  font-size: 1.125rem;
  text-decoration: none;
  white-space: nowrap;
}

.fb .fb-alert a {
  background: #b42318;
  font-size: 1.5rem;
}

.fb a:focus-visible {
  outline: 3px solid #1a5fb4;
  outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  body {
    background: #111a14;
    color: #e8f1ea;
  }

  .fb-card {
    background: #18241c;
    border-color: #ff9b94;
  }

  .fb-app {
    color: #b0c4b5;
  }

  .fb a {
    background: #7fd69a;
    color: #0b1a10;
  }

  .fb .fb-alert a {
    background: #c4261d;
    color: #ffffff;
  }

  .fb a:focus-visible {
    outline-color: #9ccfff;
  }
}
