@font-face { font-family: "Bebas"; src: url("/polices/BebasNeue-Regular.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Machine"; src: url("/polices/SpecialElite-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --nuit: #0b1015;
  --nuit-2: #141c23;
  --papier: #efe5cf;
  --texte: #e9e3d3;
  --pale: #9aa5ad;
  --orange: #f0a04b;
  --jaune: #f6c51c;
}
* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--nuit); color: var(--texte); font: 17px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; touch-action: pan-y pinch-zoom; -webkit-text-size-adjust: 100%; }
a { color: inherit; }

/* la scène 3D, fixée derrière tout */
#scene { position: fixed; inset: 0; width: 100vw; height: 100svh; display: none; }
.vignette { position: fixed; inset: 0; pointer-events: none; display: none; background: radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, .55) 100%); }
html.has3d #scene, html.has3d .vignette { display: block; }

.entete { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: calc(14px + env(safe-area-inset-top)) 20px 14px; pointer-events: none; }
.entete a { pointer-events: auto; text-decoration: none; }
.marque { font-family: "Bebas", sans-serif; font-size: 30px; letter-spacing: .04em; color: var(--papier); }
.petit-jouer { font-family: "Bebas", sans-serif; font-size: 22px; letter-spacing: .06em; padding: 6px 16px; border: 1px solid rgba(240, 160, 75, .7); border-radius: 6px; color: var(--orange); }

/* le récit épinglé */
.recit { position: relative; height: 100svh; overflow: visible; }
html:not(.has3d) .recit { display: none; }
.recit-ui { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.titre { position: absolute; left: 0; right: 0; top: 13svh; margin: 0; text-align: center; font-family: "Bebas", sans-serif; font-weight: normal; font-size: clamp(64px, 14vw, 190px); line-height: .9; letter-spacing: .02em; color: var(--papier); text-shadow: 0 6px 40px rgba(0, 0, 0, .6); }
.titre span { font-size: .45em; vertical-align: .55em; color: var(--orange); margin-right: .1em; }
.caption { position: absolute; left: 50%; bottom: calc(15svh + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(92vw, 860px); margin: 0; text-align: center; font-family: "Machine", monospace; font-size: clamp(19px, 2.4vw, 30px); line-height: 1.35; color: #fff; text-shadow: 0 2px 16px rgba(0, 0, 0, .95), 0 0 4px rgba(0, 0, 0, .8); opacity: 0; }
.etiquettes { position: absolute; inset: 0; }
.etiquette { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); font-family: "Bebas", sans-serif; font-size: clamp(18px, 2vw, 26px); letter-spacing: .05em; color: var(--nuit); background: var(--papier); padding: 3px 10px 1px; border-radius: 4px; box-shadow: 0 4px 18px rgba(0, 0, 0, .5); opacity: 0; white-space: nowrap; }
.etiquette::after { content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 22px; background: var(--papier); transform: translateX(-50%); }
.crans { position: absolute; right: calc(9vw + env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); display: flex; gap: 6px; opacity: 0; }
.crans span { width: 16px; height: 34px; border-radius: 2px; background: #e0782c; border: 1px solid #f3a05a; box-shadow: 0 0 12px rgba(224, 120, 44, .6); transition: background .25s, box-shadow .25s; }
.crans span.use { background: #3a444c; border-color: #55616a; box-shadow: none; }
.rail { position: absolute; right: calc(14px + env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 14px; pointer-events: auto; }
.rail button { all: unset; cursor: pointer; display: flex; align-items: center; justify-content: flex-end; gap: 10px; font-family: "Bebas", sans-serif; font-size: 17px; letter-spacing: .05em; color: var(--pale); }
.rail button i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--pale); display: block; }
.rail button span { opacity: 0; transition: opacity .3s; }
.rail button.on { color: var(--papier); }
.rail button.on span { opacity: 1; }
.rail button.on i, .rail button.done i { background: var(--orange); border-color: var(--orange); }
.defiler { position: absolute; left: 0; right: 0; bottom: calc(5svh + env(safe-area-inset-bottom)); margin: 0; text-align: center; font-family: "Bebas", sans-serif; letter-spacing: .1em; color: var(--pale); }

/* le contenu */
.contenu { position: relative; z-index: 6; background: linear-gradient(transparent, var(--nuit) 120px); padding-top: 120px; }
html:not(.has3d) .contenu { padding-top: 90px; }
.bloc { max-width: 1080px; margin: 0 auto; padding: 40px 18px; }
h2 { font-family: "Bebas", sans-serif; font-weight: normal; font-size: clamp(40px, 6vw, 64px); letter-spacing: .03em; margin: 0 0 10px; color: var(--papier); }
h3 { font-family: "Bebas", sans-serif; font-weight: normal; font-size: 26px; letter-spacing: .03em; margin: 0 0 6px; color: var(--orange); }
.chapeau { color: var(--pale); margin: 0 0 18px; }
.boutons { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.bouton { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; border-radius: 10px; text-decoration: none; background: var(--nuit-2); border: 1px solid #2c3944; font-family: "Bebas", sans-serif; font-size: 28px; letter-spacing: .04em; color: var(--papier); }
.bouton small { font-family: system-ui, sans-serif; font-size: 14px; letter-spacing: 0; color: var(--pale); }
.bouton.principal { background: var(--orange); border-color: var(--orange); color: var(--nuit); }
.bouton.principal small { color: #3b2410; }
.bouton.discret { background: transparent; }
.bouton:hover { filter: brightness(1.08); }
.notes { color: var(--pale); font-size: 15px; padding-left: 20px; margin: 18px 0 0; }
.notes li { margin: 5px 0; }
code { background: var(--nuit-2); padding: 1px 6px; border-radius: 4px; }
.regles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.regles article { background: var(--nuit-2); border: 1px solid #222d36; border-radius: 10px; padding: 18px 20px; }
.regles p { margin: 0; color: #cfd5d8; }
.galerie { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.galerie img { width: 100%; height: auto; display: block; border-radius: 10px; border: 1px solid #222d36; }
figure { margin: 0; }
figcaption { color: var(--pale); font-size: 15px; margin-top: 6px; }
.pied { max-width: 1080px; margin: 0 auto; padding: 30px 18px 140px; color: #6f7a82; font-size: 14px; }

.barre { position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translate(-50%, 140%); z-index: 30; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px; background: rgba(11, 16, 21, .92); border: 1px solid #2c3944; border-radius: 12px; transition: transform .45s cubic-bezier(.2, .9, .3, 1.2); max-width: calc(100vw - 24px); }
.barre.visible { transform: translate(-50%, 0); }
.barre-nom { font-family: "Bebas", sans-serif; font-size: 24px; letter-spacing: .04em; color: var(--papier); white-space: nowrap; }
.barre .bouton { flex-direction: row; padding: 9px 16px; font-size: 20px; white-space: nowrap; }

@media (max-width: 700px) {
  .galerie { grid-template-columns: 1fr; }
  .rail button span { display: none; }
  .barre-nom { display: none; }
  .crans { right: 50%; transform: translate(50%, 0); top: auto; bottom: calc(34svh + env(safe-area-inset-bottom)); }
  .crans span { width: 12px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
