/* Styles partagés par toutes les pages : variables, reset, composants communs. */

:root {
  --bg: #1a1530;
  --panel: #241d44;
  --ink: #f1ecff;
  --dim: #a097cc;
  --line: #3d3470;
  --cool: #6cc4ff;
  --bad: #ff6fae;
  --warn: #ffd84d;
  --good: #62e3a0;
  --tint: var(--cool);
  --font: "Avenir Next Rounded", "Arial Rounded MT Bold", ui-rounded, "Trebuchet MS", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
/* L'attribut hidden doit toujours gagner, même sur un élément dont une classe fixe `display`. */
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); }
body { min-height: 100dvh; padding: max(12px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom)); }
h1, h2, p { margin: 0; }
a { color: inherit; }

/* En-tête commun des pages de jeu */
.topbar { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 14px; }
.topbar .back { flex-basis: 100%; color: var(--dim); font-size: 14px; text-decoration: none; }
.topbar .back:hover { color: var(--ink); text-decoration: underline; }
.topbar h1 { font-size: clamp(20px, 4vw, 28px); font-weight: 800; letter-spacing: -.01em; }
.topbar .sub { margin-left: auto; color: var(--dim); font-size: 14px; white-space: nowrap; }

/* Boutons */
.btn {
  font: inherit; font-weight: 700; font-size: 15px; padding: 10px 16px; border-radius: 12px; cursor: pointer;
  background: transparent; color: var(--ink); border: 2px solid var(--line); text-decoration: none; display: inline-block;
}
.btn:hover:not(:disabled) { border-color: var(--dim); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--tint); outline-offset: 2px; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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