/* ═══ ✦ mode Découverte ══════════════════════════════════════════════════
 * Le monde, rien que le monde : plein cadre, une barre d'actions en verre qui
 * s'efface au calme, le nom du monde en titre. Hors de body.user, rien de tout
 * cela n'existe (studio, labos, fabrique vidéo). */
#u-haut, #u-coin, #u-aide, #u-dock, #f-decouverte { display: none; }
body.user header, body.user .controls, body.user #f-mhud, body.user #f-room { display: none !important; }
body:not(.user):not(.lab) #f-decouverte {
  display: inline-block;
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  border-radius: 6px;
  padding: 3px 10px;
  cursor: pointer;
  white-space: nowrap;
}
body:not(.user) #f-decouverte:hover { border-color: var(--accent); }

body.user {
  --verre: rgba(12, 14, 20, 0.5);
  --verre-bord: rgba(255, 255, 255, 0.1);
  --encre: rgba(238, 242, 248, 0.95);
  --encre-douce: rgba(238, 242, 248, 0.6);
  --lueur: #a9d4ff;
}
body.user #u-coin svg, body.user #u-dock svg {
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

/* le titre du monde, en haut à gauche */
body.user #u-haut { display: block; position: absolute; top: 24px; left: 28px; z-index: 5; pointer-events: none; max-width: 46vw; }
#u-marque {
  font: 600 0.72rem/1 "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--encre-douce);
  transition: opacity 0.8s ease;
}
#u-titre { margin-top: 12px; display: flex; flex-direction: column; gap: 5px; opacity: 0.5; transition: opacity 1.8s ease; }
#u-titre.frais { opacity: 1; transition: opacity 0.6s ease; }
#u-titre .nom { font: italic 400 2rem/1.1 Georgia, "Times New Roman", serif; color: var(--encre); text-shadow: 0 2px 22px rgba(0, 0, 0, 0.7); }
#u-titre .auteur { font-size: 0.8rem; letter-spacing: 0.05em; color: var(--encre-douce); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8); }
#u-titre .salle { font: italic 0.84rem Georgia, serif; color: var(--encre-douce); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8); }
#u-titre .auteur:empty, #u-titre .salle:empty { display: none; }

/* le coin : plein écran, studio */
body.user #u-coin { display: flex; gap: 8px; position: absolute; top: 18px; right: 20px; z-index: 6; transition: opacity 0.8s ease; }
#u-coin button {
  display: flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 13px;
  border-radius: 19px;
  background: var(--verre);
  border: 1px solid var(--verre-bord);
  color: var(--encre);
  font-size: 0.84rem;
  cursor: pointer;
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  transition: background 0.2s;
}
#u-coin button:hover { background: rgba(40, 46, 60, 0.7); }
#u-coin svg { width: 18px; height: 18px; }

/* la barre d'actions */
body.user #u-dock {
  display: flex; align-items: center; gap: 2px;
  position: absolute; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 6;
  padding: 7px;
  border-radius: 26px;
  background: var(--verre);
  border: 1px solid var(--verre-bord);
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
#u-dock button {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: 80px; height: 64px;
  border-radius: 19px;
  background: transparent;
  border: none;
  color: var(--encre);
  cursor: pointer;
  transition: background 0.2s, transform 0.12s;
}
#u-dock button:hover { background: rgba(255, 255, 255, 0.08); }
#u-dock button:active { transform: scale(0.95); }
#u-dock svg { width: 25px; height: 25px; }
#u-dock span { font-size: 0.7rem; letter-spacing: 0.03em; color: var(--encre-douce); white-space: nowrap; }
#u-dock button:hover span { color: var(--encre); }
#u-dock kbd {
  position: absolute; top: 6px; right: 9px;
  font: 600 0.56rem/1 Consolas, monospace;
  color: rgba(238, 242, 248, 0.3);
}
#u-dock button.majeur { background: linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0.05)); }
#u-dock button.majeur:hover { background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08)); }
#u-dock button.majeur span { color: var(--encre); }
#u-dock button.bascule.on { background: rgba(140, 200, 255, 0.15); }
#u-dock button.bascule.on svg { stroke: var(--lueur); }
#u-dock button.bascule.on span { color: var(--lueur); }
#u-dock .sep { width: 1px; height: 36px; background: var(--verre-bord); margin: 0 5px; }

/* l'aide, une fois : au-dessus de la barre */
body.user #u-aide {
  display: block;
  position: absolute; left: 50%; bottom: calc(116px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 5;
  font-size: 0.84rem;
  color: var(--encre-douce);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 1.4s ease;
  pointer-events: none;
}
#u-aide.on { opacity: 1; }
#u-aide b { color: var(--encre); font-weight: 600; }
#u-aide svg { width: 15px; height: 15px; vertical-align: -3px; fill: none; stroke: var(--encre); stroke-width: 1.8; }

/* les messages du moteur : une pastille de verre, en haut au centre */
body.user #f-flash {
  top: 22px;
  font: 500 0.9rem/1.2 "Segoe UI", system-ui, sans-serif;
  color: var(--encre);
  text-shadow: none;
  padding: 10px 18px;
  border-radius: 19px;
  background: var(--verre);
  border: 1px solid var(--verre-bord);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* le calme : sans geste, tout se retire ; aux commandes, plus rien */
body.user.calme #u-dock, body.user.pilote #u-dock { opacity: 0; transform: translateX(-50%) translateY(16px); pointer-events: none; }
body.user.calme #u-coin, body.user.calme #u-marque,
body.user.pilote #u-coin, body.user.pilote #u-marque { opacity: 0; pointer-events: none; }
body.user.calme #f-canvas { cursor: none; }

/* l'accueil : un titre sur le monde, un seul geste */
body.user #f-intro { background: radial-gradient(ellipse at center, rgba(4, 5, 8, 0.2), rgba(2, 3, 5, 0.82)); gap: 18px; }
body.user #f-intro .t { font: 300 3.4rem/1 "Segoe UI", system-ui, sans-serif; letter-spacing: 0.36em; text-transform: uppercase; margin-left: 0.36em; }
body.user #f-intro .s { font: italic 1.08rem Georgia, serif; color: var(--encre-douce); }
body.user #f-intro .k { display: none; }
body.user #f-intro .choices { flex-direction: column; align-items: center; gap: 12px; margin-top: 10px; }
body.user #f-goExplore {
  font-size: 0.98rem; letter-spacing: 0.08em;
  padding: 13px 40px; border-radius: 26px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  backdrop-filter: blur(10px);
}
body.user #f-goExplore:hover { background: rgba(255, 255, 255, 0.18); }
body.user #f-goGod { background: none; border: none; color: var(--encre-douce); font-size: 0.8rem; text-decoration: underline; text-underline-offset: 3px; }

/* 📱 la découverte au pouce : la barre sur toute la largeur, des icônes seules */
body.user.mobile #u-haut { top: calc(16px + env(safe-area-inset-top)); left: 18px; max-width: 70vw; }
body.user.mobile #u-titre .nom { font-size: 1.45rem; }
body.user.mobile #u-coin { top: calc(12px + env(safe-area-inset-top)); right: 12px; }
body.user.mobile #u-coin span { display: none; }
body.user.mobile #u-coin button { width: 38px; padding: 0; justify-content: center; }
body.user.mobile #u-dock {
  left: 10px; right: 10px; transform: none;
  justify-content: space-between;
  padding: 6px; border-radius: 24px;
  bottom: calc(12px + env(safe-area-inset-bottom));
}
body.user.mobile #u-dock button { flex: 1; width: auto; height: 54px; }
body.user.mobile #u-dock span, body.user.mobile #u-dock kbd, body.user.mobile #u-dock .sep { display: none; }
body.user.mobile.calme #u-dock, body.user.mobile.pilote #u-dock { transform: translateY(16px); }
body.user.mobile #u-aide { bottom: calc(84px + env(safe-area-inset-bottom)); white-space: normal; text-align: center; width: 86vw; }
body.user.mobile #f-intro .t { font-size: 2.3rem; }

/* la galerie, en Découverte : au-dessus de tout, rien par-dessus */
body.user #f-gallery { z-index: 8; background: rgba(4, 5, 9, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding: 28px 28px 20px; }
body.user:has(#f-gallery:not(.hidden)) #u-dock,
body.user:has(#f-gallery:not(.hidden)) #u-haut,
body.user:has(#f-gallery:not(.hidden)) #u-coin { opacity: 0; pointer-events: none; }
body.user #f-gsearch { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.14); border-radius: 22px; padding: 11px 18px; }
body.user #f-gclose { border-radius: 50%; width: 42px; }
body.user .gcard { background: rgba(255, 255, 255, 0.04); border-color: rgba(255, 255, 255, 0.08); border-radius: 14px; }
body.user .gcard:hover { border-color: rgba(169, 212, 255, 0.6); }
body.user .gcard .gname { font: italic 1rem Georgia, serif; color: var(--encre); }
body.user .gcard .gauthor { color: var(--encre-douce); }
