@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --nuit: #0D0716;
  --clair: #E6DCFF;
  --encre: #160A33;
  --jaune: #FFE14A;
  --pad: clamp(18px, 3.2vw, 44px);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--nuit);
  color: var(--clair);
  font-family: "Bricolage", "Trebuchet MS", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* L'entrée de dictionnaire */
.entry {
  position: fixed;
  left: var(--pad);
  bottom: calc(var(--pad) + env(safe-area-inset-bottom));
  max-width: min(21rem, 58vw);
  pointer-events: none;
  user-select: none;
}
.entry h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.045em;
}
.entry .gram {
  margin-top: 0.55rem;
  font-size: 0.82rem;
  font-weight: 400;
  font-style: italic;
  opacity: 0.72;
}
.entry .def {
  margin-top: 0.5rem;
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.3;
}
.entry .quote {
  margin-top: 0.3rem;
  font-size: 1.02rem;
  font-weight: 300;
  line-height: 1.3;
}

/* Le bouton pour ranger */
.tidy {
  position: fixed;
  right: var(--pad);
  bottom: calc(var(--pad) + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.8rem;
}
#tally {
  max-width: 11rem;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: right;
  pointer-events: none;
}
#ranger {
  width: clamp(5.6rem, 11vw, 7.4rem);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: var(--jaune);
  color: var(--encre);
  font: inherit;
  font-size: clamp(1.05rem, 1.9vw, 1.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  rotate: -8deg;
  transition: scale 0.18s cubic-bezier(.3, 1.6, .5, 1), rotate 0.18s ease;
  touch-action: manipulation;
}
#ranger:hover { scale: 1.07; rotate: 4deg; }
#ranger:active { scale: 0.9; }
#ranger:focus-visible { outline: 3px solid var(--clair); outline-offset: 4px; }
#ranger[disabled] { cursor: default; opacity: 0.55; scale: 0.94; }

#nogl, .fallback {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  font-size: 1.2rem;
  font-weight: 500;
  text-align: center;
}
#nogl[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  #ranger { transition: none; }
}
