/* Feuille de style commune du site Grignotte Games */

@font-face { font-family: "Anton"; src: url("../fonts/anton.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --mer: #0c4f86;
  --mer-fonce: #083a64;
  --lagon: #8fe3ef;
  --papier: #fff6dc;
  --blanc: #fffdf7;
  --encre: #1d1b2a;
  --gris: #4f4a5c;
  --or: #ffc21a;
  --corail: #c8321b;
  --vert: #1f7a3a;
  --lien: #0b4f8f;
  --trait: 3px solid var(--encre);
  --ombre: 5px 5px 0 var(--encre);
  --large: 1120px;
  --texte: 42rem;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font: 400 1.125rem/1.6 "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--lien); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--corail); }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; box-shadow: 0 0 0 6px var(--encre); border-radius: 4px; }
strong { font-weight: 600; }

h1, h2, .anton { font-family: "Anton", Impact, "Arial Narrow", sans-serif; font-weight: 400; letter-spacing: .01em; }
h1 { font-size: clamp(2.1rem, 6.4vw, 4.2rem); line-height: 1.04; margin: 0 0 .4em; text-wrap: balance; }
h2 { font-size: clamp(1.75rem, 4.4vw, 2.5rem); line-height: 1.1; margin: 2.2em 0 .5em; text-wrap: balance; }
h3 { font-size: 1.3rem; line-height: 1.3; font-weight: 600; margin: 1.8em 0 .4em; }
p, ul, ol { margin: 0 0 1em; }
li { margin-bottom: .35em; }

.passer { position: absolute; left: -9999px; top: 8px; background: var(--or); color: var(--encre); padding: 10px 16px; z-index: 10; font-weight: 600; }
.passer:focus { left: 8px; }

.cadre { width: 100%; max-width: var(--large); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 768px) { .cadre { padding-inline: 32px; } }

/* En-tete */
.entete { background: var(--blanc); border-bottom: var(--trait); }
.entete .cadre { display: flex; align-items: center; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; padding-block: 8px; }
.marque { display: inline-flex; align-items: center; gap: 10px; color: var(--encre); text-decoration: none; min-height: 48px; }
.marque img { width: 44px; height: 44px; }
.marque span { font-family: "Anton", Impact, sans-serif; font-size: 1.4rem; letter-spacing: .02em; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0; padding: 0; list-style: none; }
.nav li { margin: 0; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--encre); text-decoration: none; font-weight: 600; border-radius: 6px; }
.nav a:hover { background: var(--papier); color: var(--encre); }
.nav a[aria-current="page"] { box-shadow: inset 0 -4px 0 var(--or); border-radius: 0; }
.entete nav { margin-left: auto; }
.langue { order: 3; display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 44px; padding: 0 10px; border: 2px solid var(--encre); border-radius: 6px; color: var(--encre); text-decoration: none; font-weight: 600; }
.langue:hover { background: var(--or); color: var(--encre); }
@media (max-width: 759.98px) {
  .entete .cadre { padding-block: 6px 2px; }
  .marque img { width: 38px; height: 38px; }
  .marque span { font-size: 1.25rem; }
  .langue { order: 0; margin-left: auto; }
  .entete nav { order: 1; flex-basis: 100%; margin: 0 -8px; }
  .nav { justify-content: space-between; flex-wrap: nowrap; }
  .nav a { padding: 0 8px; font-size: 1rem; }
}

/* Boutons */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px; padding: 10px 24px;
  font-family: "Anton", Impact, sans-serif; font-size: 1.35rem; letter-spacing: .03em; line-height: 1.1;
  text-decoration: none; text-align: center;
  border: var(--trait); border-radius: 8px; box-shadow: 4px 4px 0 var(--encre);
  transition: transform .12s ease, box-shadow .12s ease;
}
.bouton:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--encre); }
.bouton:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--encre); }
.bouton-play { background: var(--corail); color: #fff; }
.bouton-play:hover { color: #fff; }
.bouton-or { background: var(--or); color: var(--encre); }
.bouton-or:hover { color: var(--encre); }
.bouton-clair { background: var(--blanc); color: var(--encre); }
.bouton-clair:hover { color: var(--encre); }
.bouton svg { width: 22px; height: 22px; flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; margin: 1.4em 0 .8em; }
.mention { font-size: .98rem; color: var(--gris); }
.hero .mention { color: #e8f3ff; }

/* Bandeau d'ouverture (accueil, page du jeu) */
.hero { background: var(--mer); color: #fff; border-bottom: var(--trait); overflow: hidden; }
.hero .cadre { display: grid; gap: 28px; padding-block: 36px 40px; align-items: center; }
.hero h1 { color: #fff; text-shadow: 3px 3px 0 var(--encre); }
.hero p { font-size: 1.15rem; line-height: 1.5; max-width: 36rem; }
.hero h1 > span { display: block; }
.hero .cadre > div:first-child { min-width: 0; }
.hero a:not(.bouton) { color: #fff; }
.hero .logo-jeu { width: min(62%, 380px); margin: 0 0 14px; filter: drop-shadow(0 4px 0 rgba(0,0,0,.25)); }
.panneau {
  position: relative; border: var(--trait); box-shadow: 7px 7px 0 var(--encre);
  background: var(--mer-fonce); overflow: hidden; border-radius: 4px;
  clip-path: polygon(6% 0, 100% 0, 100% 94%, 94% 100%, 0 100%, 0 6%);
}
.panneau img { width: 100%; height: 100%; object-fit: cover; }
.hero .panneau { aspect-ratio: 4 / 5; max-height: 560px; }
.hero .panneau img { object-position: 30% 30%; }
@media (min-width: 860px) {
  .hero .cadre { grid-template-columns: 1.15fr .85fr; gap: 48px; padding-block: 56px 64px; }
  .hero .panneau { transform: rotate(1.5deg); }
}
@media (max-width: 859.98px) {
  .hero .panneau { aspect-ratio: 16 / 11; }
  .hero .panneau img { object-position: 30% 28%; }
}

/* Sections */
.section { padding-block: 8px 24px; }
.section > .cadre > h2:first-child { margin-top: 1.4em; }
.prose { max-width: var(--texte); }
.chapo { font-size: 1.25rem; line-height: 1.5; max-width: var(--texte); }
.bande { background: var(--blanc); border-block: var(--trait); margin-top: 48px; padding-bottom: 32px; }

/* Bande de captures, defilement horizontal interne */
.captures { list-style: none; margin: 8px 0 0; padding: 12px 4px 20px; display: flex; gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; }
.captures li { flex: 0 0 auto; width: min(62vw, 240px); scroll-snap-align: center; margin: 0; }
.captures img { border: var(--trait); border-radius: 10px; box-shadow: var(--ombre); width: 100%; height: auto; background: var(--mer); }
.captures li:nth-child(odd) img { transform: rotate(-1.2deg); }
.captures li:nth-child(even) img { transform: rotate(1.2deg); }
.captures figcaption { font-weight: 600; font-size: 1rem; margin-top: 12px; text-align: center; }
@media (min-width: 1100px) { .captures { flex-wrap: wrap; justify-content: center; overflow: visible; } }

/* Points du jeu : liste en deux colonnes avec un pictogramme d'operation */
.points { display: grid; gap: 4px 40px; margin-top: 12px; }
@media (min-width: 860px) { .points { grid-template-columns: 1fr 1fr; } }
.point h3 { display: flex; align-items: baseline; gap: 12px; margin-top: 1.4em; }
.point h3 .signe { font-family: "Anton", Impact, sans-serif; font-size: 1.6rem; line-height: 1; color: var(--corail); min-width: 1.4em; text-align: center; }
.point h3 .signe.op, .guides .num.op { font-family: "Barlow", system-ui, sans-serif; font-weight: 600; font-size: 2.3rem; line-height: .7; }

/* Liste des guides */
.guides { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; }
@media (min-width: 700px) { .guides { grid-template-columns: 1fr 1fr; gap: 16px 28px; } }
.guides li { margin: 0; }
.guides a { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: start; text-decoration: none; color: var(--encre); padding: 12px 8px; border-radius: 8px; min-height: 64px; }
.guides a:hover { background: var(--blanc); color: var(--encre); }
.guides .num { font-family: "Anton", Impact, sans-serif; font-size: 1.7rem; line-height: 1; text-align: center; background: var(--or); border: var(--trait); border-radius: 8px; padding: 10px 0 8px; }
.guides strong { display: block; font-size: 1.15rem; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; color: var(--lien); }
.guides span.desc { display: block; font-size: 1rem; color: var(--gris); margin-top: 2px; }

/* Encadre vers le jeu */
.encart { display: grid; gap: 20px; align-items: center; background: var(--mer); color: #fff; border: var(--trait); box-shadow: var(--ombre); border-radius: 8px; padding: 22px 20px; margin: 40px 0; max-width: 820px; }
.encart h2 { color: #fff; margin: 0 0 .3em; font-size: clamp(1.6rem, 4vw, 2.1rem); text-shadow: 2px 2px 0 var(--encre); }
.encart p { margin-bottom: .8em; }
.encart .bouton { font-size: 1.15rem; padding-inline: 16px; }
.encart a:not(.bouton) { color: #fff; }
.encart img { border: var(--trait); border-radius: 10px; width: 160px; margin-inline: auto; }
@media (min-width: 640px) { .encart { grid-template-columns: 170px 1fr; padding: 26px 28px; } .encart img { width: 170px; } }

/* Fil d'Ariane */
.ariane { font-size: .98rem; margin: 20px 0 6px; }
.ariane ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0; }
.ariane li { margin: 0; display: inline-flex; align-items: center; }
.ariane li + li::before { content: "/"; margin: 0 8px 0 4px; color: var(--gris); }
.ariane a { display: inline-flex; align-items: center; min-height: 44px; }

/* Article de contenu */
.article { padding-bottom: 32px; }
.article h1 { margin-top: .2em; }
.article .prose h2 { margin-top: 1.8em; }
.article table.faits { border-collapse: collapse; margin: 12px 0 20px; font-size: 1.05rem; background: var(--blanc); border: var(--trait); }
.article table.faits th, .article table.faits td { border: 1px solid #c9bfa3; padding: 6px 12px; text-align: left; }
.article table.faits th { background: var(--or); }
.encadre { background: var(--blanc); border-left: 6px solid var(--or); padding: 14px 18px; margin: 18px 0; border-radius: 0 8px 8px 0; }
.encadre p:last-child { margin-bottom: 0; }
.maj { font-size: .95rem; color: var(--gris); }
.voir-aussi { margin-top: 32px; }
.voir-aussi ul { padding-left: 1.2em; }
.voir-aussi li { margin-bottom: .5em; }
.voir-aussi a { display: inline-block; padding: 6px 0; }

/* FAQ */
.faq { max-width: var(--texte); }
.faq details { border: var(--trait); border-radius: 8px; background: var(--blanc); margin: 0 0 12px; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 1.12rem; padding: 14px 44px 14px 16px; min-height: 52px; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-52%); font-family: "Barlow", system-ui, sans-serif; font-weight: 600; font-size: 1.7rem; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 16px 6px; }

/* Exercices interactifs */
.exo { background: var(--blanc); border: var(--trait); box-shadow: var(--ombre); border-radius: 10px; padding: 18px 16px 20px; margin: 24px 0 32px; max-width: 30rem; }
.exo h2, .exo h3, .article .prose .exo h2 { margin: 0 0 .3em; font-size: 1.6rem; font-family: "Anton", Impact, sans-serif; font-weight: 400; }
.exo .consigne { font-size: 1rem; color: var(--gris); margin-bottom: .8em; }
.exo-tables { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; padding: 0; border: 0; }
.exo-tables legend { font-weight: 600; font-size: 1rem; margin-bottom: 6px; padding: 0; }
.exo-tables button { min-width: 48px; min-height: 48px; font: 600 1.05rem "Barlow", sans-serif; border: 2px solid var(--encre); border-radius: 8px; background: var(--blanc); color: var(--encre); cursor: pointer; }
.exo-tables button[aria-pressed="true"] { background: var(--or); }
.exo-etat { display: flex; justify-content: space-between; font-size: 1rem; font-weight: 600; margin-bottom: 8px; color: var(--gris); }
.exo-calcul { font-family: "Anton", Impact, sans-serif; font-size: clamp(2.4rem, 11vw, 3.2rem); line-height: 1.1; text-align: center; background: var(--mer); color: #fff; border: var(--trait); border-radius: 8px; padding: 14px 8px; margin: 0 0 10px; letter-spacing: .02em; }
.exo-calcul .op { font-family: "Barlow", system-ui, sans-serif; font-weight: 600; font-size: .95em; margin: 0 .1em; }
.exo-calcul .rep { display: inline-block; min-width: 2.2ch; border-bottom: 4px solid var(--or); color: var(--or); }
.exo-retour { min-height: 2.8em; font-size: 1.05rem; font-weight: 600; margin: 0 0 8px; text-align: center; }
.exo-retour.juste { color: var(--vert); }
.exo-retour.faux { color: var(--corail); }
.pave { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pave button { min-height: 54px; font: 400 1.6rem "Anton", Impact, sans-serif; border: var(--trait); border-radius: 8px; background: var(--blanc); color: var(--encre); cursor: pointer; box-shadow: 0 3px 0 var(--encre); touch-action: manipulation; }
.pave button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--encre); }
.pave .ok { background: var(--corail); color: #fff; }
.pave .eff { font-family: "Barlow", sans-serif; font-weight: 600; font-size: 1.05rem; }
.exo-fin { text-align: center; }
.exo-fin .score { font-family: "Anton", Impact, sans-serif; font-size: 2.4rem; margin: 4px 0; }
.exo-fin ul { text-align: left; display: inline-block; margin: 0 0 12px; }
.exo-fin .bouton { margin: 6px 6px 0; font-size: 1.15rem; min-height: 50px; }
.exo noscript p { margin: 0; }

/* Table de 9 sur les doigts : dix barres, une par doigt */
.doigts { display: flex; justify-content: center; gap: 6px; margin: 12px 0 8px; }
.doigts .main { display: flex; gap: 6px; align-items: flex-end; }
.doigts .main + .main { margin-left: 18px; }
.doigts button { width: 30px; min-height: 96px; display: flex; flex-direction: column; justify-content: flex-start; align-items: center; padding: 6px 0; border: var(--trait); border-radius: 15px 15px 6px 6px; background: var(--or); color: var(--encre); font: 600 1rem "Barlow", sans-serif; cursor: pointer; transition: min-height .15s ease; }
.doigts button.baisse { min-height: 40px; background: var(--corail); color: #fff; }
@media (min-width: 420px) { .doigts button { width: 34px; } }
.doigts-legende { text-align: center; font-size: 1.05rem; min-height: 3.2em; }
.doigts-legende strong { font-family: "Anton", Impact, sans-serif; font-weight: 400; font-size: 1.5rem; }

/* Table de Pythagore */
.pytha-zone { overflow-x: auto; margin: 8px 0; }
table.pytha { border-collapse: collapse; margin: 0 auto; font-variant-numeric: tabular-nums; }
table.pytha th, table.pytha td { width: 36px; height: 36px; text-align: center; padding: 0; border: 1px solid #c9bfa3; font-size: .98rem; }
table.pytha th { background: var(--or); font-family: "Anton", Impact, sans-serif; font-weight: 400; font-size: 1.05rem; }
table.pytha td button { width: 100%; height: 100%; min-height: 36px; border: 0; background: transparent; font: inherit; color: inherit; cursor: pointer; }
table.pytha td.ligne, table.pytha td.colonne { background: #ffe7a3; }
table.pytha td.choisi { background: var(--corail); color: #fff; }
table.pytha.reduite td.double button, table.pytha.reduite td.unite button { visibility: hidden; }
table.pytha.reduite td.double, table.pytha.reduite td.unite { background: #ece4cc; }
.pytha-legende { text-align: center; min-height: 3em; font-weight: 600; }
.bascule { display: flex; align-items: center; gap: 10px; min-height: 48px; font-weight: 600; cursor: pointer; }
.bascule input { width: 24px; height: 24px; accent-color: var(--corail); }

/* Pied de page */
.pied { background: var(--mer-fonce); color: #fff; border-top: var(--trait); margin-top: 56px; padding: 36px 0 28px; font-size: 1rem; }
.pied a { color: #fff; }
.pied a:hover { color: var(--or); }
.pied .cadre { display: grid; gap: 24px; }
@media (min-width: 760px) { .pied .cadre { grid-template-columns: 1.3fr 1fr 1fr; } }
.pied h2 { font-size: 1.3rem; margin: 0 0 .5em; color: #fff; }
.pied ul { list-style: none; padding: 0; margin: 0; }
.pied li { margin: 0; }
.pied li a { display: inline-flex; align-items: center; min-height: 44px; }
.pied .courriel { user-select: all; font-weight: 600; }
.pied .bas { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.3); padding-top: 16px; color: #d6e6f5; font-size: .95rem; }
.pied img { width: 56px; height: 56px; margin-bottom: 8px; }

/* Studio */
.studio { display: grid; gap: 28px; align-items: start; }
@media (min-width: 860px) { .studio { grid-template-columns: 1fr 300px; gap: 56px; } }
.studio .lockup { width: min(100%, 360px); }
.engagements { list-style: none; padding: 0; margin: 12px 0; }
.engagements li { padding-left: 34px; position: relative; margin-bottom: .6em; }
.engagements li::before { content: "×"; position: absolute; left: 0; top: -2px; font-family: "Anton", Impact, sans-serif; font-size: 1.45rem; color: var(--corail); }

/* Page 404 */
.perdu { text-align: center; padding: 56px 0 24px; }
.perdu h1 { font-size: clamp(3rem, 12vw, 6rem); }

/* Politique de confidentialite habillee */
.doc { max-width: 46rem; margin: 0 auto; padding: 28px 16px 8px; }
.doc table { border-collapse: collapse; width: 100%; margin: 1rem 0; background: var(--blanc); }
.doc th, .doc td { text-align: left; padding: .45rem .6rem; border-bottom: 1px solid #c9bfa3; vertical-align: top; font-size: 1rem; }
.doc code { font-size: .9em; background: rgba(0,0,0,.07); padding: .1em .35em; border-radius: 3px; }
.doc hr { margin: 3rem 0 2rem; border: 0; border-top: 2px solid var(--encre); }
.doc h1 { font-size: clamp(2rem, 6vw, 3rem); }
.doc h2 { font-size: 1.6rem; }
.doc .date { color: var(--gris); font-size: .95rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
