/* style.css — Base commune, mobile-first, thème sombre sobre. */

:root {
  --bg: #0b0b0d;
  --bg-elev: #15151a;
  --bg-elev-2: #1d1d24;
  --text: #f2f2f5;
  --text-dim: #a2a2ad;
  --text-mute: #6f6f7a;
  --accent: #3b82f6;
  --accent-ink: #ffffff;
  --danger: #e5484d;
  --ok: #30a46c;
  --line: #2a2a33;
  --radius: 14px;
  --radius-sm: 10px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* L'attribut [hidden] doit toujours primer, même sur les éléments dont une
   classe (.btn, .card…) impose un display. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
}

a { color: var(--accent); text-decoration: none; }

/* Écrans (single-page) */
.screen { display: none; min-height: 100vh; min-height: 100dvh; }
.screen.is-active { display: block; }

.wrap {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding:
    calc(24px + var(--safe-top))
    calc(20px + var(--safe-right))
    calc(20px + var(--safe-bottom))
    calc(20px + var(--safe-left));
}

/* En-tête accueil */
.app-head { text-align: center; padding-top: 18px; }
.app-logo { color: var(--text); display: inline-flex; margin-bottom: 10px; opacity: .95; }
.app-title { font-size: 2.6rem; letter-spacing: .14em; margin: 0; font-weight: 700; }
.app-subtitle { margin: 4px 0 0; color: var(--text-dim); font-size: .98rem; letter-spacing: .02em; }

/* Corps accueil */
.home-main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.home-actions { display: flex; gap: 12px; }
.home-actions .btn { flex: 1; }

.btn-share-home { width: 100%; text-decoration: none; }
.hint { text-align: center; color: var(--text-mute); font-size: .88rem; margin: 6px 0 0; }

/* Pied */
.app-foot { text-align: center; color: var(--text-mute); font-size: .78rem; padding-top: 18px; }

/* En-tête de sous-pages */
.sub-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sub-head h2 { font-size: 1.3rem; margin: 0; font-weight: 600; }
.btn-back {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--line); font-size: 1.3rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; text-decoration: none; flex: 0 0 auto;
}

/* Boutons */
.btn {
  appearance: none; border: 1px solid transparent; cursor: pointer;
  font: inherit; font-weight: 600; border-radius: var(--radius-sm);
  padding: 13px 18px; text-align: center; transition: transform .06s ease, background .15s ease, opacity .15s ease;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--text); background: var(--bg-elev); user-select: none;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-ghost { background: var(--bg-elev); border-color: var(--line); color: var(--text); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-xl { padding: 18px 20px; font-size: 1.1rem; width: 100%; border-radius: var(--radius); }

kbd {
  background: var(--bg-elev-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 1px 6px; font-size: .85em; font-family: inherit;
}

/* Aide */
.help-content h3 { font-size: 1.05rem; margin: 20px 0 6px; }
.help-content p, .help-content li { color: var(--text-dim); }
.help-content ul { padding-left: 1.1rem; }
.muted { color: var(--text-mute); font-size: .85rem; margin-top: 24px; }
.note { color: var(--text-mute); font-size: .86rem; margin: 6px 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
