:root {
  --bg: #000;
  --text: #9fefff;
  --text-dim: #4f8a96;
}

* {
  box-sizing: border-box;
  margin: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#face {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

/* La vidéo reste dans la page (sinon certains navigateurs n'envoient plus d'images) mais invisible. */
#camera {
  position: fixed;
  width: 2px;
  height: 2px;
  opacity: 0;
  pointer-events: none;
}

#subtitle {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 4vh;
  padding: 0 8vw;
  text-align: center;
  font-size: clamp(14px, 3.4vh, 22px);
  color: var(--text-dim);
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#subtitle:empty {
  opacity: 0;
}

#wake {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5vh;
  border: 0;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.wake-title {
  font-size: clamp(18px, 5vh, 32px);
}

.wake-help {
  font-size: clamp(12px, 2.8vh, 18px);
  color: var(--text-dim);
  max-width: 80vw;
  text-align: center;
}

#wake[hidden] {
  display: none;
}

/* Galerie d'essai des expressions (?gallery=1) */
#gallery {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85) 30%);
}

#gallery.hidden {
  display: none;
}

#gallery .row {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  touch-action: pan-x;
}

#gallery button {
  flex: none;
  padding: 6px 10px;
  border: 1px solid rgba(159, 239, 255, 0.35);
  border-radius: 14px;
  background: rgba(10, 30, 40, 0.8);
  color: var(--text);
  font: 600 12px/1 system-ui, sans-serif;
}

#gallery button.on {
  background: #3fe0ff;
  color: #000;
}

#gallery button.clip {
  border-color: rgba(255, 209, 102, 0.5);
  color: #ffe2a0;
}

#gallery button.tool {
  border-color: rgba(255, 255, 255, 0.3);
  color: #ddd;
}

#gallery .group {
  flex: none;
  align-self: center;
  padding: 0 2px 0 8px;
  color: var(--text-dim);
  font: 600 10px/1 system-ui, sans-serif;
  text-transform: uppercase;
}

#gallery .version {
  color: #ffe2a0;
  font: 600 11px/1.2 system-ui, sans-serif;
  padding: 0 4px;
}
