/* ===== RESET MINIMAL ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* Fond global : dégradé épuré sur base #FCF9F1 */
html, body {
  height: 100%;
  font-family: Arial, sans-serif; /* Police standardisée */
  background: #D0F5FE; /* Fond uni mis à jour */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Variables globales pour tailles fluides */
:root {
  /* Largeur logique de la machine (même formule que .stage) */
  --stage-w: min(100vw, 100vh * 0.672131);
  --social-icon-min: 30px;
  --social-icon-max: 56px;
  --social-icon-fallback: 42px;
  --social-gap: 16px;
  --stage-scale: 1; /* mis à jour dynamiquement via JS */
  /* (Option B) plus de scale JS pour les icônes sociales */
}


/* Viewport */
/* ===== MAIN (scoped to app index only, not blog) ===== */
main:not(.blog-main) {
  position: relative;
  width: 100vw;
  height: 100vh;      /* fallback */
  overflow: hidden;
}
/* (obsolete) top-left login styles removed */
/* Use dynamic viewport unit when supported to avoid gap when URL bar hides */
@supports (height: 100dvh) {
  main:not(.blog-main) { height: 100dvh; }
}

/* Boîte image = taille EXACTE et centrée (ratio 902/1342) */
.stage {
  position: absolute;  /* important: fait de .stage le contexte parent */
  inset: 0;
  margin: auto;
  width: var(--stage-w); /* 902/1342 = 0.672131 */
  aspect-ratio: 902 / 1342;
  background: url("../images/distributeurRb.png") no-repeat center / 100% 100%;
}

/* Boot zoom-in (index only, class-driven) */
.stage.boot-pre {
  opacity: 0;
  transform: translateY(-24px) scale(0.96);
  transform-origin: center center;
}
.stage.boot-pre.boot-play {
  transition: transform 320ms cubic-bezier(.2,.8,.2,1), opacity 320ms cubic-bezier(.2,.8,.2,1);
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Interior image container */
.interior-image {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  cursor: pointer;
}

.interior-image img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}


/* Footer (scoped so blog footer is not forced absolute) */
footer:not(.blog-footer){
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #111; color: #fff;
  padding: 10px 16px;
  font-size: 14px;
  opacity: .9;
  display: flex;
  align-items: center;
  justify-content: center; /* center baseline */
  gap: 12px;
  z-index: 400; /* above stage hotspots but below modal (modal overlay 1000) */
  -webkit-backdrop-filter: blur(0px);
  backdrop-filter: none;
  /* Safe-area support */
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}

footer:not(.blog-footer) .footer-copy{ pointer-events: none; }

footer:not(.blog-footer) .login-link{
  margin-left: auto; /* push to far right */
  display: inline-flex;
  width: 28px; height: 28px;
  align-items: center; justify-content: center;
  color: #fff; text-decoration: none;
  position: relative;
  border-radius: 6px;
  background: linear-gradient(145deg,#222,#050505);
  box-shadow: 0 2px 4px -1px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.05) inset;
  transition: background .25s ease, transform .18s ease, box-shadow .25s ease;
}
footer:not(.blog-footer) .login-link svg{ width: 65%; height: 65%; fill: currentColor; opacity:.9; }
footer:not(.blog-footer) .login-link:hover svg{ opacity:1; }
footer:not(.blog-footer) .login-link:hover{ transform: translateY(-2px); background: linear-gradient(145deg,#272727,#0c0c0c); }
footer:not(.blog-footer) .login-link:active{ transform: translateY(0); }
footer:not(.blog-footer) .login-link:focus-visible{ outline:2px solid #fff; outline-offset:2px; }

@media (max-width: 520px){
  footer:not(.blog-footer){ font-size: 12px; padding: 8px 10px; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  footer:not(.blog-footer) .login-link{ width: 26px; height: 26px; }
}

/* Landscape very short viewport: compress footer */
@media (max-height: 420px) and (orientation: landscape){
  footer:not(.blog-footer){ font-size: 11px; padding: 6px 10px; }
}

/* Optional social icons for global footer */
footer .social-links{ display:inline-flex; gap:12px; margin-left:12px; vertical-align:middle; }
footer .social-links a{ width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; color:inherit; }
footer .social-links svg{ width:100%; height:100%; fill: currentColor; opacity:.9; }
footer .social-links a:hover svg{ opacity:1; transform: translateY(-1px); transition: transform .15s ease, opacity .15s ease; }

/* (Optionnel) Masquer le footer sur petits écrans si tu veux 100% d’immersion */
/*
@media (max-width: 480px){
  footer { display: none; }
}
*/

/* ===== Global image fade-in ===== */
img.img-fade { opacity: 0; transition: opacity .25s ease; }
img.img-fade.is-loaded { opacity: 1; }

/* ===== Full app loader overlay ===== */
.app-loader {
  position: fixed;
  inset: 0;
  background: #D0F5FE; /* même fond pour éviter flash */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000; /* au-dessus de tout */
  transition: opacity .3s ease, visibility .3s ease;
}
.app-loader.is-hidden { opacity: 0; visibility: hidden; }
.app-loader .loader-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 12px;
  background: rgba(255,255,255,.6);
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
  border: 1px solid rgba(0,0,0,.05);
}
.app-loader .loader-text { font-size: 14px; color: #0b2130; letter-spacing: .2px; }
.loader-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(0,0,0,.12);
  border-top-color: #0a65d4;
  animation: spin 900ms linear infinite;
}
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

