/* ---------- Reset léger & structure ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: radial-gradient(120% 90% at 50% 0%, var(--night-700), var(--night-950));
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--gold); }
img, svg { display: block; max-width: 100%; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 8px;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ---------- Couches ---------- */
#bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--night-900); }
#fx { position: fixed; inset: 0; z-index: 1; width: 100%; height: 100%; pointer-events: none; }
#fx-top { position: fixed; inset: 0; z-index: 60; width: 100%; height: 100%; pointer-events: none; }

#app {
  position: fixed;
  inset: 0;
  z-index: 2;
  width: min(100%, 480px);
  margin: 0 auto;
}

/* Sur grand écran, l'app devient une colonne façon téléphone sur le décor */
@media (min-width: 700px) {
  #app {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 120px rgba(0, 0, 0, 0.45);
    background: linear-gradient(180deg, rgba(4, 21, 17, 0.28), rgba(4, 21, 17, 0.5));
    backdrop-filter: blur(2px);
  }
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 14px) 18px calc(var(--safe-bottom) + 14px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.screen::-webkit-scrollbar { display: none; }

/* ---------- Typo ---------- */
.display { font-family: var(--font-display); font-weight: 800; letter-spacing: 0.01em; line-height: 1.05; }
.h-title { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.7rem, 7vw, 2.2rem); line-height: 1.05; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25); }
.h-sub { color: var(--text-dim); font-weight: 600; }
.dim { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.center { text-align: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Pied de page discret ---------- */
.footer {
  margin-top: auto;
  padding-top: 18px;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-faint);
}
.footer a { color: var(--text-dim); text-decoration: none; font-weight: 700; }
.footer a:hover, .footer a:focus-visible { color: var(--gold); text-decoration: underline; }
.footer img { display: inline-block; height: 14px; width: auto; vertical-align: -2px; margin-right: 6px; opacity: 0.85; }
