/**------- Enveloppe de la page : sur un téléphone l'application prend tout l'écran ; sur un écran large elle garde la largeur d'un téléphone, au centre -------*/
@font-face {
  font-family: "Titan One";
  font-weight: 400;
  font-display: swap;
  src: url("../polices/titan-one.woff2") format("woff2");
}

/**------- La police du bouton Google, imposée par sa charte ; seules les lettres latines sont livrées -------*/
@font-face {
  font-family: "Google Sans";
  font-weight: 500;
  font-display: swap;
  src: url("../polices/google-sans-medium.woff2") format("woff2");
}

@font-face {
  font-family: "Comic Neue";
  font-weight: 400;
  font-display: swap;
  src: url("../polices/comic-neue-400.woff2") format("woff2");
}

@font-face {
  font-family: "Comic Neue";
  font-weight: 700;
  font-display: swap;
  src: url("../polices/comic-neue-700.woff2") format("woff2");
}

html, body { height: 100%; margin: 0; }

body {
  background: #33281B;
  /**------- Ni rebond de page ni zoom au double toucher : ce sont des gestes de lecture, pas de jeu -------*/
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

.cadre {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  /**------- L'encoche et la barre du bas du téléphone restent hors du jeu, sur le fond de la page d'album -------*/
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: #FFF1D6;
  box-sizing: border-box;
}

@media (min-width: 520px) {
  .cadre { box-shadow: 0 0 0 4px #161616, 0 20px 60px rgba(0, 0, 0, 0.5); }
}

noscript {
  display: block;
  padding: 24px;
  color: #FFFFFF;
  font-family: system-ui, sans-serif;
  text-align: center;
}

/**------- Le jeu se joue à la verticale. Un téléphone couché ne montre plus la table, écrasée dans sa largeur, mais cette invitation à le redresser. Elle ne vaut que pour un écran qu'on touche, large et bas à la fois : un clavier ouvert à la verticale laisse l'écran étroit et ne la fait pas apparaître -------*/
.tourner {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  background: #FFF1D6;
  color: #161616;
  text-align: center;
}

.tourner__dessin {
  width: 64px;
  height: 64px;
  fill: none;
  stroke: #161616;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(90deg);
}

.tourner__titre { margin: 0; font-family: "Titan One", "Arial Black", sans-serif; font-size: 26px; line-height: 1.1; }
.tourner__phrase { margin: 0; font-family: "Comic Neue", "Comic Sans MS", "Segoe UI", sans-serif; font-size: 16px; font-weight: 700; }

@media (orientation: landscape) and (pointer: coarse) and (min-width: 480px) and (max-height: 540px) {
  .tourner { display: flex; }
}

/**------- Le dessin se redresse lentement, pour montrer le geste -------*/
@media (prefers-reduced-motion: no-preference) {
  .tourner__dessin { animation: tourner-redresse 2.4s ease-in-out infinite; }
}

@keyframes tourner-redresse {
  0%, 25% { transform: rotate(90deg); }
  60%, 100% { transform: rotate(0deg); }
}

/**------- Le cadre du défi anti-robot : hors de l'application, au bas de l'écran, visible seulement quand un geste est demandé -------*/
.defi {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 90;
  transform: translateX(-50%);
}
