/* Copie (lecture seule) des styles de la cinématique Dai Enjin, extraits de css/game01.css,
   pour lire l'intro du jeu sur le site (bouton « Voir l'intro ») sans charger ni modifier les fichiers du jeu. */
.cine {
  --u: 7.6px; --w: 13.5px;
  position: fixed; z-index: 100000; display: none; overflow: hidden;
  background: #000; color: #fff; cursor: pointer; user-select: none;
}
.cine-shots, .cine-shot, .cine-shot-bg, .cine-fx, .cine-tint, .cine-vignette, .cine-grain,
.cine-flash, .cine-fade, .cine-leak { position: absolute; inset: 0; pointer-events: none; }
.cine-shot { overflow: hidden; transition: opacity 1.3s ease; }
.cine-shot.out { opacity: 0; }
.cine-shot-bg {
  inset: -8%; background-size: cover; background-position: center;
  filter: blur(calc(var(--u) * 3.5)) brightness(.42) saturate(1.25);
}
/* l'image nette, fondue dans le décor flou (pas de bord visible) */
.cine-shot-frame {
  position: absolute; top: 0; bottom: 0; aspect-ratio: 1 / 1; height: 100%; overflow: hidden;
  -webkit-mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 72%, transparent 100%);
}
.layout-left .cine-shot-frame { left: calc(var(--w) * 1); }
.layout-right .cine-shot-frame { right: calc(var(--w) * 1); }
.layout-center .cine-shot-frame { left: 50%; transform: translateX(-50%); }
.layout-full .cine-shot-frame {
  left: 0; right: 0; width: 100%; height: 100%; aspect-ratio: auto;
  -webkit-mask-image: none; mask-image: none;
}
.cine-cam { position: absolute; inset: 0; will-change: transform; }
.cine-cam img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grade-ash .cine-cam img { filter: saturate(.35) contrast(1.12) brightness(.9); }
.grade-ash .cine-shot-bg { filter: blur(calc(var(--u) * 3.5)) brightness(.35) saturate(.2); }

/* glitch (écrans qui se figent) */
.cine-shot.glitch .cine-cam { animation: cine-glitch .7s steps(2) both; }
@keyframes cine-glitch {
  0%   { clip-path: inset(10% 0 70% 0); transform: translate(-3%, 0) scale(1.4); filter: hue-rotate(90deg) saturate(3); }
  20%  { clip-path: inset(55% 0 20% 0); transform: translate(4%, 0) scale(1.4); filter: invert(.2) saturate(2); }
  40%  { clip-path: inset(30% 0 40% 0); transform: translate(-2%, 1%) scale(1.42); }
  60%  { clip-path: inset(0 0 85% 0);  transform: translate(2%, 0) scale(1.4); filter: hue-rotate(-60deg); }
  80%  { clip-path: inset(70% 0 5% 0); transform: translate(-4%, 0) scale(1.41); }
  100% { clip-path: inset(0); }
}

/* lumière, teintes, vignettage, grain */
.cine-leak { opacity: 0; transition: opacity 2s ease; mix-blend-mode: screen; }
.cine-leak.leak-warm {
  opacity: 1;
  background: radial-gradient(60% 80% at 0% 10%, rgba(255,140,60,.45), transparent 70%),
              radial-gradient(50% 60% at 100% 100%, rgba(255,60,120,.25), transparent 70%);
  animation: cine-leak 6s ease-in-out infinite alternate;
}
.cine-leak.leak-sun {
  opacity: 1;
  background: radial-gradient(35% 45% at 88% 8%, rgba(255,250,220,.75), rgba(255,200,120,.25) 40%, transparent 70%);
  animation: cine-leak 5s ease-in-out infinite alternate;
}
@keyframes cine-leak { from { filter: brightness(.8); transform: translateX(-2%); } to { filter: brightness(1.25); transform: translateX(2%); } }
.cine-tint { opacity: 0; transition: opacity 1s; mix-blend-mode: multiply; }
.cine-tint.tint-fire { opacity: 1; background: radial-gradient(circle at 50% 60%, rgba(255,170,120,.0), rgba(255,40,0,.35)); animation: cine-pulse 1.3s ease-in-out infinite; }
@keyframes cine-pulse { 50% { opacity: .55; } }
.cine-vignette { background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,.75) 100%); }
.cine-grain { opacity: .5; mix-blend-mode: overlay; animation: cine-grain .5s steps(4) infinite; }
@keyframes cine-grain { 0% { background-position: 0 0; } 25% { background-position: -40px 25px; } 50% { background-position: 30px -60px; } 75% { background-position: -70px -20px; } }
.cine-flash { opacity: 0; }
.cine-fade { background: #000; opacity: 0; transition: opacity 1.4s ease; }
.cine-fade.on { opacity: 1; }

/* bandes cinéma */
.cine-bar { position: absolute; left: 0; right: 0; height: 0; background: #000; z-index: 5; transition: height 1.2s cubic-bezier(.6,0,.2,1); pointer-events: none; }
.cine-bar-top { top: 0; }
.cine-bar-bottom { bottom: 0; }
.cine.is-on .cine-bar { height: calc(var(--u) * 9); }

/* ---------------------------------------------------------------- texte du récit */
.cine-text {
  position: absolute; z-index: 4; pointer-events: none;
  font-family: 'Exo 2', 'Segoe UI', system-ui, sans-serif; font-weight: 600;
  font-size: clamp(17px, calc(var(--u) * 3.7), 44px); line-height: 1.45; letter-spacing: .01em;
  color: #fff; text-shadow: 0 2px 2px #000, 0 0 18px rgba(0,0,0,.9);
}
.cine-text p { margin: 0; }
.cine-text.pos-right, .cine-text.pos-left {
  top: 50%; transform: translateY(-50%); width: calc(var(--w) * 40);
  padding: calc(var(--u) * 3.2) calc(var(--u) * 3.6);
  background: linear-gradient(135deg, rgba(5,8,20,.78), rgba(5,8,20,.55));
  border-left: 3px solid #ff7a2f; border-radius: 4px;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 10px 40px rgba(0,0,0,.6);
}
.cine-text.pos-right { right: calc(var(--w) * 5); }
.cine-text.pos-left { left: calc(var(--w) * 5); }
.cine-text.pos-bottom {
  left: 0; right: 0; bottom: calc(var(--u) * 10); text-align: center;
  padding: calc(var(--u) * 5) calc(var(--w) * 12) calc(var(--u) * 2.4);
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.6) 55%, transparent 100%);
}
.cine-text .w { display: inline-block; opacity: 0; filter: blur(8px); transform: translateY(.45em); }
.cine-text.on .w { animation: cine-word .55s cubic-bezier(.2,.7,.3,1) forwards; }
.cine-text .em { color: #ffb347; text-shadow: 0 2px 2px #000, 0 0 14px rgba(255,120,30,.75); }
@keyframes cine-word { to { opacity: 1; filter: blur(0); transform: translateY(0); } }
.cine-text.off { animation: cine-text-out .6s ease forwards; }
.cine-text.off .w { opacity: 1; filter: none; transform: none; }
@keyframes cine-text-out { to { opacity: 0; filter: blur(6px); margin-top: calc(var(--u) * -2); } }

/* ---------------------------------------------------------------- cartons titres */
.cine-title { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; text-align: center; }
.cine-title .l { display: inline-block; opacity: 0; animation: cine-letter .9s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes cine-letter { from { opacity: 0; filter: blur(10px); transform: scale(1.6); } to { opacity: 1; filter: blur(0); transform: none; } }
.cine-title.leave { animation: cine-title-out 1s ease forwards; }
@keyframes cine-title-out { to { opacity: 0; transform: scale(1.08); filter: blur(8px); } }

.is-card-text .card-line { font-family: 'Exo 2', sans-serif; font-weight: 300; letter-spacing: .3em; text-transform: uppercase; }
.is-card-text .card-line-0 { font-size: calc(var(--u) * 4.4); color: #fff; text-shadow: 0 0 20px rgba(120,180,255,.6); }
.is-card-text .card-line-1 { font-size: calc(var(--u) * 2.4); color: #9fc4ff; margin-top: calc(var(--u) * 1.6); }
.is-card-text .card-line-1 .l { animation-delay: 1.2s !important; animation-duration: 1.6s; }

.is-logo .logo-pre { font-family: 'Exo 2', sans-serif; font-weight: 300; font-style: italic; font-size: calc(var(--u) * 4); letter-spacing: .2em; margin-bottom: calc(var(--u) * 2); }
.is-logo .logo-main { position: relative; opacity: 0; }
.is-logo .logo-word {
  position: relative; display: block; font-family: 'Orbitron', 'Audiowide', sans-serif; font-weight: 900;
  font-size: calc(var(--u) * 15); letter-spacing: .08em; line-height: 1;
  background: linear-gradient(180deg, #fff6d8 0%, #ffb347 45%, #ff4b1f 75%, #a8120a 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 calc(var(--u) * 2) rgba(255,90,20,.7)) drop-shadow(0 4px 0 #3a0700);
}
.is-logo.slam .logo-main { animation: cine-slam .75s cubic-bezier(.15,.9,.25,1.2) forwards; }
@keyframes cine-slam { 0% { opacity: 0; transform: scale(3.2); filter: blur(20px); } 60% { opacity: 1; filter: blur(0); } 100% { opacity: 1; transform: scale(1); } }
.is-logo.slam .logo-word { animation: cine-glow 2.4s ease-in-out .8s infinite; }
@keyframes cine-glow { 50% { filter: drop-shadow(0 0 calc(var(--u) * 4) rgba(255,140,40,.95)) drop-shadow(0 4px 0 #3a0700); } }
.is-logo .logo-flare {
  position: absolute; left: 50%; top: 50%; width: 0; height: 3px; transform: translate(-50%, -50%);
  background: linear-gradient(90deg, transparent, #fff 45%, #fff 55%, transparent);
  box-shadow: 0 0 20px 6px rgba(255,190,120,.8);
}
.is-logo.slam .logo-flare { animation: cine-flare 1.6s ease-out .1s forwards; }
@keyframes cine-flare { 0% { width: 0; opacity: 1; } 40% { width: 140%; opacity: 1; } 100% { width: 180%; opacity: 0; } }
.is-logo .logo-ring { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); border: 4px solid rgba(255,190,110,.9); opacity: 0; }
.is-logo.slam .logo-ring { animation: cine-ring 1.2s ease-out forwards; }
@keyframes cine-ring { from { opacity: 1; width: 10px; height: 10px; } to { opacity: 0; width: calc(var(--w) * 120); height: calc(var(--w) * 120); border-width: 1px; } }
.is-logo .logo-sub {
  margin-top: calc(var(--u) * 3); font-family: 'Exo 2', sans-serif; font-weight: 600; text-transform: uppercase;
  font-size: calc(var(--u) * 3); letter-spacing: .1em; color: #fff; opacity: 0; text-shadow: 0 0 16px rgba(255,120,40,.8);
}
.is-logo.show-sub .logo-sub { animation: cine-sub 1.8s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes cine-sub { from { opacity: 0; letter-spacing: .6em; filter: blur(8px); } to { opacity: 1; letter-spacing: .14em; filter: blur(0); } }

.is-final .final-title {
  font-family: 'Orbitron', 'Audiowide', sans-serif; font-weight: 900; font-size: calc(var(--u) * 8.5); letter-spacing: .06em;
  color: #ffe6a8; text-shadow: 0 0 calc(var(--u) * 3) rgba(255,170,50,.85), 0 4px 0 #5a2a00;
}
.is-final .final-sub { margin-top: calc(var(--u) * 1.5); font-family: 'Exo 2', sans-serif; font-weight: 600; font-size: calc(var(--u) * 3.4); text-transform: uppercase; letter-spacing: .12em; opacity: 0; animation: cine-sub 1.6s ease 1s forwards; text-shadow: 0 2px 2px #000; }
.is-final .final-score-box { margin-top: calc(var(--u) * 5); opacity: 0; transform: translateY(20px); transition: all .8s cubic-bezier(.2,.7,.3,1); }
.is-final.show-score .final-score-box { opacity: 1; transform: none; }
.is-final .final-score-label { font-family: 'Exo 2', sans-serif; font-size: calc(var(--u) * 2.2); letter-spacing: .4em; text-transform: uppercase; color: #9fd8ff; }
.is-final .final-score-value { font-family: 'Orbitron', sans-serif; font-weight: 800; font-size: calc(var(--u) * 7); color: #fff; text-shadow: 0 0 20px rgba(80,200,255,.8); }
.is-final .final-score-value.done { animation: cine-score-pop .6s cubic-bezier(.2,.9,.3,1.4); color: #ffd23f; text-shadow: 0 0 26px rgba(255,190,40,.95); }
@keyframes cine-score-pop { 50% { transform: scale(1.25); } }

.is-credits { justify-content: flex-start; overflow: hidden; }
.credits-roll { position: absolute; top: 100%; left: 0; right: 0; animation: cine-roll linear forwards; }
@keyframes cine-roll { to { transform: translateY(calc(-100% - var(--u) * 100)); } }
.credit { margin-bottom: calc(var(--u) * 12); }
.credit-role { font-family: 'Exo 2', sans-serif; font-size: calc(var(--u) * 2.2); letter-spacing: .4em; text-transform: uppercase; color: #ffb347; }
.credit-name { font-family: 'Exo 2', sans-serif; font-weight: 700; font-size: calc(var(--u) * 4); text-shadow: 0 2px 2px #000; }
.credit.big .credit-name { font-family: 'Orbitron', sans-serif; font-weight: 900; font-size: calc(var(--u) * 8); color: #ffd9a0; text-shadow: 0 0 24px rgba(255,140,40,.8); }

/* indication pour passer */
.cine-skip {
  position: absolute; right: calc(var(--w) * 2); bottom: calc(var(--u) * 2.6); z-index: 6;
  font-family: 'Exo 2', sans-serif; font-size: clamp(10px, calc(var(--u) * 1.6), 15px); letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.55); opacity: 0; animation: cine-skip-in 1s ease 2s forwards; pointer-events: none;
}
.cine-skip span { color: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 3px; padding: 0 .4em; }
@keyframes cine-skip-in { to { opacity: 1; } }

@media (max-aspect-ratio: 1/1) {
  .layout-left .cine-shot-frame, .layout-right .cine-shot-frame { left: 50%; right: auto; transform: translateX(-50%); }
  .cine-text.pos-right, .cine-text.pos-left { left: 5%; right: 5%; width: auto; top: auto; bottom: calc(var(--u) * 11); transform: none; }
}
