/* Page hôte : marges des écrans à encoche, éléments masqués */
:root { padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0); box-sizing: border-box; }
[hidden] { display: none !important; }

/* Layout : en-tête, scène (titre ou jeu), commandes tactiles, pied. Univers nocturne assumé : un seul thème sombre. */
:root {
  color-scheme: dark;
  --bg: #121416;
  --night: #0c1621;
  --stone: #33474f;
  --ivory: #ece5d3;
  --muted: #a7aaa8;
  --gold: #c9b68a;
  --gold-hi: #dfcc9d;
  --blood: #d9777a;
  --mist: #8fb3ad;
  --line: #55564f;
  --display: "Bodoni Moda", Didot, "Bodoni 72", "Playfair Display", Georgia, serif;
  --body: "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: radial-gradient(120% 70% at 50% 0%, #1b1f22 0%, var(--bg) 60%) var(--bg); color: var(--ivory); font-family: var(--body); overflow: hidden; -webkit-text-size-adjust: 100%; }
p, h1, h2, h3 { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }

.app { height: 100%; max-width: 1240px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand-name { font-family: var(--display); font-weight: 400; font-size: clamp(24px, 7vw, 32px); letter-spacing: .38em; line-height: 1; }
.brand-sub { margin-top: 6px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; }
.top-actions { display: flex; align-items: center; gap: 14px; }
.sound-top { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); min-height: 40px; white-space: nowrap; }
.sound-top b { color: var(--gold); font-weight: 400; margin-left: .5em; }
.round { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 1px solid #3a3d3f; font-size: 18px; color: var(--muted); }

.stage { position: relative; flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; background: var(--night); border: 1px solid var(--line); overflow: hidden; container: stage / size; }
.view { position: relative; flex: 1; min-height: 0; }
#game { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; image-rendering: pixelated; }
.stage[data-mode="title"] .hud, .stage[data-mode="title"] .keys { display: none; }
