/* Studio Schmak — feuille unique, sans framework ni dépendance.
   Pourquoi : un site vitrine qui doit encore s'afficher dans cinq ans sans
   « npm install ». Les polices sont servies par le site lui-même (pas d'appel
   à Google Fonts : aucune donnée envoyée à un tiers, rien à déclarer au RGPD). */

@font-face { font-family: "Bowlby One"; src: url("/fonts/bowlby-one-400.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url("/fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

/* Palette : le zinc des toits de Paris (d'où sortent les rats de RATATAK),
   le jaune des panneaux de chantier, le rose d'une queue de rat. */
:root {
  --zinc: #3a4a5e;
  --zinc-clair: #dfe5ea;
  --encre: #1a2230;
  --jaune: #ffcb2e;
  --rose: #f2a0b4;
  --blanc: #ffffff;
  --mesure: 34rem;
}

* { box-sizing: border-box; }
/* Sans cette ligne, un .bouton caché par l'attribut hidden resterait visible. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 1.0625rem/1.55 "Atkinson", system-ui, sans-serif;
  color: var(--encre);
  background: var(--zinc-clair);
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--jaune); outline-offset: 3px; border-radius: 2px; }

.contenu { width: min(72rem, 100% - 2.5rem); margin-inline: auto; }

/* --- En-tête --- */
.entete {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1.1rem;
}
.marque { font-family: "Bowlby One", sans-serif; font-size: 1.25rem; text-decoration: none; letter-spacing: .01em; }
.nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.nav a { text-decoration: none; font-weight: 700; }
.nav a:hover, .nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; text-decoration-color: var(--rose); }

/* --- Ouverture : le mot SCHMAK est le seul élément animé du site.
   Il tombe et s'écrase une fois, comme un rat qui atterrit sur un toit. --- */
.ouverture { padding-block: clamp(2rem, 7vw, 5rem) clamp(2rem, 5vw, 3.5rem); }
.mot {
  font-family: "Bowlby One", sans-serif;
  /* 15vw : les six lettres de Bowlby tiennent dans un écran de 360 px. */
  font-size: clamp(3rem, 15vw, 15rem);
  line-height: .82;
  margin: 0;
  color: var(--zinc);
  display: flex;
}
.mot span { display: inline-block; transform-origin: 50% 100%; }
@media (prefers-reduced-motion: no-preference) {
  .mot span { animation: chute .9s cubic-bezier(.3, 0, .2, 1) both; }
  .mot span:nth-child(2) { animation-delay: .06s; }
  .mot span:nth-child(3) { animation-delay: .12s; }
  .mot span:nth-child(4) { animation-delay: .18s; }
  .mot span:nth-child(5) { animation-delay: .24s; }
  .mot span:nth-child(6) { animation-delay: .30s; }
}
@keyframes chute {
  0%   { transform: translateY(-120%) scale(.9, 1.15); opacity: 0; }
  55%  { transform: translateY(0) scale(1.18, .72); opacity: 1; }
  75%  { transform: translateY(-6%) scale(.95, 1.06); }
  100% { transform: none; }
}
.sous-titre { font-size: clamp(1.15rem, 2.4vw, 1.45rem); max-width: var(--mesure); margin: 1.4rem 0 0; }

/* --- Bloc « jouer » : la fenêtre du jeu, cadre épais façon écran de borne. --- */
.jouer {
  background: var(--zinc); color: var(--blanc);
  padding-block: clamp(2rem, 5vw, 3.5rem);
}
.jouer-grille { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: center; }
.ecran {
  position: relative; display: block; aspect-ratio: 16 / 9;
  border: 6px solid var(--encre); border-radius: 18px; overflow: hidden;
  background: var(--encre); box-shadow: 10px 10px 0 var(--jaune);
}
.ecran img { width: 100%; height: 100%; object-fit: cover; }
.ecran .lancer {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-family: "Bowlby One", sans-serif; font-size: clamp(1.1rem, 3vw, 1.6rem);
  background: var(--jaune); color: var(--encre); padding: .7em 1.2em; border-radius: 999px;
  border: 4px solid var(--encre);
}
.ecran:hover .lancer { background: var(--rose); }
.jouer h2 { font-family: "Bowlby One", sans-serif; font-weight: 400; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1; margin: 0 0 .8rem; }
.jouer p { max-width: var(--mesure); }
.note { font-size: .92rem; opacity: .85; }

/* --- Boutons --- */
.bouton {
  display: inline-block; font-weight: 700; text-decoration: none;
  padding: .75em 1.25em; border-radius: 999px; border: 3px solid var(--encre);
  background: var(--jaune); color: var(--encre);
}
.bouton:hover { background: var(--rose); }
.bouton.discret { background: transparent; color: inherit; border-color: currentColor; }
/* Le PNG officiel contient déjà la marge libre exigée par Google : ne pas le rogner. */
.badge-play img { height: 66px; width: auto; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-top: 1.2rem; }

/* --- Étagère des applis : pas trois cartes identiques. Le jeu phare prend la
   largeur, les carnets se partagent la ligne du dessous, chacun dans sa couleur. --- */
.etagere { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.etagere > h2, .section-titre {
  font-family: "Bowlby One", sans-serif; font-weight: 400;
  font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1; margin: 0 0 1.8rem;
}
.appli {
  display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 1.2rem;
  padding: 1.5rem; border: 3px solid var(--encre); border-radius: 14px; background: var(--blanc);
}
.appli .icone { width: 96px; height: 96px; border-radius: 22px; }
.appli h3 { font-family: "Bowlby One", sans-serif; font-weight: 400; font-size: 1.5rem; line-height: 1.05; margin: 0 0 .4rem; }
.appli p { margin: 0 0 .6rem; max-width: var(--mesure); }
.appli ul { margin: 0 0 .4rem; padding-left: 1.1rem; }
.appli h3 a { text-decoration: none; }
.appli h3 a:hover { text-decoration: underline; text-decoration-color: var(--rose); text-decoration-thickness: 4px; }
.appli-phare { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); padding: 0; overflow: hidden; margin-bottom: 1.5rem; }
.appli-phare .texte { padding: 1.8rem; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 1.2rem; align-content: start; }
.appli-phare .visuel { background: var(--encre); }
.appli-phare .visuel img { width: 100%; height: 100%; object-fit: cover; }
.carnets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: 1.5rem; }
.carnet-peche { background: #e3f1f6; }
.carnet-potager { background: #ecf4dc; }
.carnet-picpic { background: #fbecd2; }

/* --- Le studio --- */
.studio { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.studio p { max-width: var(--mesure); font-size: 1.15rem; }

/* --- Pages intérieures --- */
.page { padding-block: 2rem 4rem; }
.page h1 { font-family: "Bowlby One", sans-serif; font-weight: 400; font-size: clamp(2.2rem, 6vw, 3.8rem); line-height: 1; margin: 0 0 1rem; color: var(--zinc); }
.page h2 { font-size: 1.35rem; margin: 2.2rem 0 .6rem; }
.page p, .page li { max-width: var(--mesure); }
.captures { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 1rem; margin-block: 1.5rem; }
.captures img { border: 3px solid var(--encre); border-radius: 10px; }

/* --- Page de jeu en ligne --- */
.scene { background: var(--encre); color: var(--blanc); min-height: 100vh; display: flex; flex-direction: column; }
.scene .entete { width: min(72rem, 100% - 2.5rem); margin-inline: auto; }
.cadre-jeu { flex: 1; display: grid; place-items: center; padding: 0 1rem 1rem; }
.cadre-jeu iframe { width: min(100%, calc((100vh - 9rem) * 16 / 9)); aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; }
.ecran-attente {
  position: relative; width: min(100%, calc((100vh - 9rem) * 16 / 9)); aspect-ratio: 16 / 9;
  border-radius: 12px; overflow: hidden;
}
.ecran-attente > img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.45); }
.ecran-attente-texte {
  position: absolute; inset: 0; display: grid; place-content: center; justify-items: center;
  text-align: center; padding: 1.5rem; gap: .4rem;
}
.ecran-attente-texte h1 { font-family: "Bowlby One", sans-serif; font-weight: 400; font-size: clamp(2rem, 6vw, 4rem); line-height: 1; margin: 0; }
.ecran-attente-texte p { max-width: 34rem; margin: 0 0 .8rem; }
.ecran-attente .bouton { font-size: 1.15rem; cursor: pointer; }
.ecran-attente .bouton:disabled { cursor: progress; opacity: .8; }
.jouables { display: grid; gap: 1rem; max-width: 44rem; margin-block: 1.5rem 2rem; }
.captures.telephone { grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); }
.bandeau-play { width: min(72rem, 100% - 2.5rem); margin: 0 auto 1.5rem; display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.cadre-jeu { position: relative; }
/* Plein écran (jouer.js) : la page entière passe en plein écran, on n'y garde que le jeu. */
html:fullscreen .scene > .entete, html:fullscreen .bandeau-play, html:fullscreen .pied { display: none; }
html:fullscreen .cadre-jeu { padding: 0; }
html:fullscreen .cadre-jeu iframe { width: min(100vw, 100vh * 16 / 9); border-radius: 0; }
.pub-confirmation {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: min(26rem, 100% - 2rem); padding: 1.4rem; text-align: center;
  background: var(--zinc-clair); color: var(--encre); border: 4px solid var(--encre); border-radius: 14px;
  box-shadow: 8px 8px 0 var(--jaune);
}
.pub-confirmation p { margin: 0; font-weight: 700; }
.pub-confirmation .actions { justify-content: center; }
.avertissement { background: var(--jaune); color: var(--encre); border-radius: 12px; padding: 1rem 1.2rem; max-width: 40rem; }

/* --- Pied de page --- */
.pied { background: var(--encre); color: var(--zinc-clair); padding-block: 2rem; font-size: .95rem; }
.pied .contenu { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
.pied nav { display: flex; flex-wrap: wrap; gap: .2rem 1rem; }
/* Zone de toucher : un lien de pied de page fait 24 px de haut sans cela, trop fin pour un pouce. */
.pied nav a, .nav a { padding-block: .45rem; }

@media (max-width: 760px) {
  .jouer-grille, .appli-phare { grid-template-columns: 1fr; }
  .appli-phare .visuel { order: -1; aspect-ratio: 16 / 9; }
  .entete { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .nav { gap: .4rem 1rem; }
  .appli:not(.appli-phare), .appli-phare .texte { grid-template-columns: minmax(0, 1fr); gap: .8rem; padding: 1.1rem; }
  .appli .icone { width: 64px; height: 64px; border-radius: 15px; }
  .ecran { box-shadow: 6px 6px 0 var(--jaune); }
  .captures.telephone { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
}

/* --- Aiguillage téléphone / ordinateur (accueil).
   Par défaut (ordinateur) : le jeu d'abord, il se lance tout de suite.
   Sur un téléphone ou un écran étroit : les applis d'abord, car le jeu y est
   injouable et c'est une installation Play qu'on vient chercher.
   Tout en CSS : si une règle saute, les deux univers restent visibles. --- */
.aiguillage { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; padding-bottom: clamp(1.5rem, 4vw, 2.5rem); }
.porte {
  display: flex; align-items: center; gap: 1rem; padding: 1.1rem 1.3rem;
  border: 3px solid var(--encre); border-radius: 14px; background: var(--blanc);
  text-decoration: none; box-shadow: 6px 6px 0 var(--encre);
  transition: transform .12s, box-shadow .12s;
}
.porte:hover { transform: translate(2px, 2px); box-shadow: 4px 4px 0 var(--rose); }
.porte svg { flex: none; color: var(--zinc); }
.porte strong { display: block; font-family: "Bowlby One", sans-serif; font-weight: 400; font-size: 1.2rem; line-height: 1.1; }
.porte span span { font-size: .95rem; opacity: .8; }
.porte-ordinateur { order: -1; background: var(--jaune); }
.univers { display: flex; flex-direction: column; }
.univers-ordinateur { order: -1; }
.univers > section { scroll-margin-top: 1rem; }
.surtitre {
  margin: 0 0 .5rem; font-weight: 700; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--zinc);
}
.jouer .surtitre { color: var(--jaune); }
.plus-tard { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin-top: 1.2rem; }
.plus-tard .bouton { cursor: pointer; font: inherit; font-weight: 700; }
.plus-tard [data-retour] { flex-basis: 100%; margin: 0; }
.ecran-attente-texte .plus-tard { justify-content: center; margin-top: 0; }

@media (max-width: 760px), (hover: none) and (pointer: coarse) {
  .univers-ordinateur, .porte-ordinateur { order: 0; }
  .porte-ordinateur { background: var(--blanc); }
  .porte-telephone { background: var(--jaune); }
}
@media (max-width: 760px) {
  .aiguillage { grid-template-columns: 1fr; gap: .7rem; }
  .porte { padding: .8rem 1rem; box-shadow: 4px 4px 0 var(--encre); }
  .porte svg { width: 32px; height: 32px; }
  /* L'écran d'attente 16:9 ferait 220 px de haut sur un téléphone : le texte
     déborderait. On le laisse prendre la hauteur de son contenu. */
  .ecran-attente { aspect-ratio: auto; min-height: 70vh; }
  .ecran-attente > img { position: absolute; inset: 0; }
  .ecran-attente-texte { position: relative; min-height: 70vh; }
}
