@font-face {
  font-family: "Shippori Mincho";
  src: url("polices/shippori-mincho-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Shippori Mincho";
  src: url("polices/shippori-mincho-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "Zen Kaku Gothic New";
  src: url("polices/zen-kaku-gothic-new-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --encre: rgba(33, 29, 26, 0.9);
  --encre-2: rgba(33, 29, 26, 0.55);
  --texte: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --etiquette: "Zen Kaku Gothic New", "Hiragino Sans", "Helvetica Neue", Arial, sans-serif;
}
body.nuit {
  --encre: rgba(240, 234, 222, 0.92);
  --encre-2: rgba(240, 234, 222, 0.55);
}

html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; touch-action: none; }
body {
  background: #C6D4DA;
  color: var(--encre);
  font-family: var(--texte);
  -webkit-font-smoothing: antialiased;
  transition: background-color 2s;
}
#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#mots { position: fixed; inset: 0; pointer-events: none; }

.mot {
  position: absolute;
  margin: 0;
  max-width: min(74vw, 30rem);
  opacity: 0;
}
.mot.droite { text-align: right; }
.mot blockquote {
  margin: 0;
  font-size: calc(clamp(1.08rem, 4.6vw, 1.5rem) * var(--taille, 1));
  line-height: 1.55;
  font-weight: 400;
  text-wrap: pretty;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.25);
}
body.nuit .mot blockquote { text-shadow: 0 0 18px rgba(0, 0, 0, 0.35); }
.mot figcaption {
  margin-top: 0.7em;
  font-family: var(--etiquette);
  font-size: calc(0.66rem * var(--taille, 1));
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--encre-2);
}
.mot.guide { max-width: min(62vw, 24rem); }

noscript p {
  position: fixed; left: 8%; right: 8%; top: 20%;
  font-size: 1.3rem; line-height: 1.6; color: rgba(33, 29, 26, 0.9);
}

/* la micro-saison, en petit, comme le titre d'une estampe */
#cartouche {
  position: fixed; left: 50%; bottom: calc(46px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); width: max-content; max-width: 86vw; margin: 0;
  text-align: center; font-size: 0.8rem; letter-spacing: 0.02em; color: var(--encre-2);
  opacity: 0; transition: opacity 1.2s ease; pointer-events: none;
}
#cartouche.visible { opacity: 1; }

/* le signe du direct : un cercle qui se trace pendant chaque citation ; plein au direct, creux en arrière */
#direct {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); width: 30px; height: 30px; padding: 0;
  border: 0; background: none; color: var(--encre); cursor: pointer; opacity: 0.55;
  -webkit-tap-highlight-color: transparent;
}
#direct svg { display: block; width: 30px; height: 30px; overflow: visible; }
#direct .piste { fill: none; stroke: currentColor; stroke-opacity: 0.25; stroke-width: 1; }
#direct .avance { fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 15px 15px; }
#direct .point { fill: currentColor; stroke: currentColor; stroke-width: 1; transition: fill 0.4s; }
#direct.derriere .point { fill: transparent; }
#direct.tenu { opacity: 0.85; }
#direct.tenu .avance { stroke-width: 1.5; }
#direct:focus-visible { outline: 1px solid currentColor; outline-offset: 3px; border-radius: 50%; }

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

/* le panneau de réglages, seulement avec ?reglages */
.panneau {
  position: fixed; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 10; max-width: min(92vw, 22rem);
  font-family: var(--etiquette); font-size: 13px; color: #221F1C;
}
.panneau button {
  font: inherit; color: inherit; background: rgba(250, 248, 243, 0.92);
  border: 1px solid rgba(34, 31, 28, 0.25); border-radius: 999px; padding: 6px 12px;
}
.panneau-bascule { display: block; margin-left: auto; }
.panneau-corps {
  margin-top: 8px; padding: 12px; max-height: 70vh; overflow-y: auto;
  background: rgba(250, 248, 243, 0.94); border-radius: 10px; display: grid; gap: 10px;
}
.panneau-corps[hidden] { display: none; }
.panneau-corps { touch-action: pan-y; }
.panneau .ligne { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.panneau .ligne input { grid-column: 1 / -1; width: 100%; }
.panneau output { font-variant-numeric: tabular-nums; color: #5F5850; }
.panneau .boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.panneau textarea { width: 100%; font: 12px ui-monospace, monospace; }
.panneau .note-essai { margin: 0; color: #5F5850; font-size: 12px; }
.panneau .montre { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.panneau .case { display: flex; gap: 8px; align-items: center; }
