/* ============================================================
   Design system — simple, rapide, mobile-first, sans webfont.
   ============================================================ */
:root {
  --encre: #1c2333;
  --encre-doux: #4a5468;
  --papier: #ffffff;
  --fond: #f6f7f9;
  --ligne: #e3e6ec;
  --accent: #1d4ed8;
  --accent-doux: #eaf0fe;
  --tuile: #f3e7cf;
  --tuile-bord: #d9c69e;
  --succes: #157347;
  --erreur: #b42318;
  --radius: 10px;
  --ombre: 0 1px 3px rgba(16, 24, 40, 0.08);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--encre);
  background: var(--papier);
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
main { min-height: 60vh; }

h1, h2, h3 { line-height: 1.25; font-weight: 750; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0.4em 0 0.5em; }
h2 { font-size: 1.4rem; margin: 1.8em 0 0.6em; }
h3 { font-size: 1.12rem; margin: 1.4em 0 0.4em; }
p { margin: 0.7em 0; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: #fff; padding: 8px 16px; z-index: 100; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ---------- En-tête ---------- */
.entete {
  border-bottom: 1px solid var(--ligne);
  background: var(--papier);
  position: sticky; top: 0; z-index: 20;
}
.entete-in {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 20px; max-width: 1200px; margin: 0 auto;
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.05rem; color: var(--encre); text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo .tuile-mini {
  width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center;
  background: var(--tuile); border: 1px solid var(--tuile-bord); font-size: 1rem; color: #5c4a22;
}
.nav { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; }
.nav a {
  color: var(--encre-doux); text-decoration: none; font-size: 0.9rem; font-weight: 600;
  padding: 7px 10px; border-radius: 8px; white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}
.nav a:hover { background: var(--fond); color: var(--encre); }
.nav a[aria-current="page"] { background: var(--accent-doux); color: var(--accent); }
/* Sous 1060 px : le menu passe proprement sur sa ligne, aligné à gauche, cibles tactiles agrandies */
@media (max-width: 1060px) {
  .entete-in { max-width: 960px; }
  .nav { width: 100%; margin-left: 0; }
  .nav a { padding: 9px 11px; }
}

/* ---------- Tuiles Scrabble ---------- */
.tuile {
  display: inline-grid; place-items: center; position: relative;
  background: linear-gradient(160deg, #f7edd8, #eeddb8);
  border: 1px solid var(--tuile-bord); border-radius: 7px;
  font-weight: 800; color: #4c3c17; box-shadow: inset 0 -2px 0 rgba(0,0,0,0.06);
  width: 44px; height: 44px; font-size: 1.25rem; user-select: none;
}
.tuile small { position: absolute; right: 4px; bottom: 2px; font-size: 0.62rem; font-weight: 700; }
.tuile.clivable { cursor: pointer; }
.tuile.clivable:hover { outline: 2px solid var(--accent); outline-offset: 1px; }
.tuile[data-mult="2"] { background: linear-gradient(160deg, #d8e8fd, #bcd4f7); border-color: #8fb3e8; }
.tuile[data-mult="3"] { background: linear-gradient(160deg, #fddede, #f7c1c1); border-color: #e8a0a0; }
.tuiles { display: flex; gap: 7px; flex-wrap: wrap; }

/* ---------- Cartes / sections ---------- */
.grille { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin: 22px 0; }
.carte {
  background: var(--papier); border: 1px solid var(--ligne); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--ombre); display: flex; flex-direction: column; gap: 8px;
  text-decoration: none; color: inherit;
}
a.carte:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); transition: 0.15s; }
.carte h3 { margin: 0; font-size: 1.08rem; }
.carte p { margin: 0; color: var(--encre-doux); font-size: 0.94rem; }
.carte .icone { font-size: 1.6rem; }

.panneau { background: var(--fond); border: 1px solid var(--ligne); border-radius: var(--radius); padding: 18px 20px; margin: 20px 0; }
.panneau.accent { background: var(--accent-doux); border-color: #c7d7fb; }

.badge {
  display: inline-block; background: var(--accent-doux); color: var(--accent);
  border-radius: 999px; padding: 2px 11px; font-size: 0.8rem; font-weight: 700;
}
.badge.score { background: #fff3d6; color: #8a6d1a; }

/* ---------- Formulaires ---------- */
.champ { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; }
.champ label { font-weight: 650; font-size: 0.95rem; }
.champ .aide { color: var(--encre-doux); font-size: 0.85rem; }
input[type="text"], input[type="email"], select, textarea {
  font: inherit; padding: 12px 14px; border: 1.5px solid var(--ligne); border-radius: 9px;
  background: #fff; color: var(--encre); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15); }
input.gros { font-size: 1.35rem; letter-spacing: 0.22em; text-transform: lowercase; font-weight: 600; }
.ligne-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.ligne-form > * { flex: 1; min-width: 140px; }

.btn {
  display: inline-block; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--accent); color: #fff; border: none; border-radius: 9px;
  padding: 12px 22px; text-decoration: none;
}
.btn:hover { background: #1740ad; }
.btn[disabled] { background: #9aa7bd; cursor: wait; }
.btn.secondaire { background: #fff; color: var(--accent); border: 1.5px solid var(--accent); }

/* ---------- Résultats ---------- */
.resultats { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; min-height: 44px; }
.mot-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: var(--tuile); border: 1px solid var(--tuile-bord); border-radius: 8px;
  padding: 5px 10px; font-weight: 650; font-size: 0.95rem; color: #4c3c17;
}
.mot-chip .pts { font-size: 0.72rem; font-weight: 700; color: #8a6d1a; background: #fff; border-radius: 6px; padding: 0 5px; }
.groupe-longueur { margin: 14px 0; }
.groupe-longueur h4 { margin: 0 0 6px; font-size: 0.9rem; color: var(--encre-doux); text-transform: uppercase; letter-spacing: 0.04em; }

.statut { font-size: 0.95rem; color: var(--encre-doux); }
.statut.ok { color: var(--succes); font-weight: 650; }
.statut.ko { color: var(--erreur); font-weight: 650; }
.gros-score { font-size: 2.6rem; font-weight: 800; line-height: 1; color: var(--accent); }

/* ---------- Tableaux ---------- */
table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 0.95rem; }
th, td { border: 1px solid var(--ligne); padding: 8px 12px; text-align: left; }
th { background: var(--fond); font-weight: 700; }
table.centre td, table.centre th { text-align: center; }
.defilement { overflow-x: auto; }

/* ---------- Fil d'Ariane ---------- */
.ariane { font-size: 0.86rem; color: var(--encre-doux); margin: 18px 0 0; }
.ariane a { color: var(--encre-doux); }
.ariane ol { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.ariane li + li::before { content: '›'; margin-right: 6px; color: #b6bcc9; }

/* ---------- Prose (guides) ---------- */
.prose { max-width: 720px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: 0.35em 0; }
.prose .chapo { font-size: 1.12rem; color: var(--encre-doux); }

/* ---------- FAQ ---------- */
.faq details { border: 1px solid var(--ligne); border-radius: 9px; margin: 9px 0; background: #fff; }
.faq summary { cursor: pointer; font-weight: 650; padding: 13px 16px; }
.faq details[open] summary { border-bottom: 1px solid var(--ligne); }
.faq .reponse { padding: 4px 16px 13px; color: var(--encre-doux); }

/* ---------- Publicité ---------- */
.ad-slot {
  margin: 26px auto; border: 1.5px dashed var(--ligne); border-radius: var(--radius);
  min-height: 100px; display: grid; place-items: center; color: #aab2c2; font-size: 0.82rem;
  background: #fcfcfd; overflow: hidden;
}

/* ---------- Bandeau cookies ---------- */
.consent {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50;
  background: #fff; border: 1px solid var(--ligne); border-radius: 12px;
  box-shadow: 0 8px 30px rgba(16,24,40,0.18); padding: 16px 18px;
  display: none; gap: 14px; align-items: center; flex-wrap: wrap;
  max-width: 640px; margin: 0 auto;
}
.consent.visible { display: flex; }
.consent p { margin: 0; font-size: 0.88rem; color: var(--encre-doux); flex: 1 1 260px; }
.consent .btns { display: flex; gap: 8px; }
.consent .btn { padding: 9px 16px; font-size: 0.9rem; }

/* ---------- Pied de page ---------- */
.pied { border-top: 1px solid var(--ligne); background: var(--fond); margin-top: 60px; padding: 36px 0 24px; font-size: 0.9rem; }
.pied .colonnes { display: grid; gap: 26px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.pied h4 { margin: 0 0 8px; font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--encre-doux); }
.pied ul { list-style: none; margin: 0; padding: 0; }
.pied li { margin: 5px 0; }
.pied a { color: var(--encre); text-decoration: none; }
.pied a:hover { color: var(--accent); text-decoration: underline; }
.pied .legal { margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--ligne); color: var(--encre-doux); font-size: 0.8rem; }

/* ---------- Champ principal & résultats au-dessus de la ligne de flottaison ---------- */
.input-hero {
  font-size: 1.5rem;
  letter-spacing: 0.18em;
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 14px 16px;
  box-shadow: 0 0 0 4px var(--accent-doux);
  background: #fff;
}
.input-hero:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 5px rgba(29, 78, 216, 0.28);
}
.btn-hero { padding: 14px 26px; font-size: 1.05rem; }
.filtres { margin-top: 10px; border-top: 1px solid var(--ligne); padding-top: 6px; }
.filtres summary {
  cursor: pointer; color: var(--encre-doux); font-size: 0.92rem; font-weight: 650;
  padding: 6px 0; list-style-position: inside;
}
.filtres summary:hover { color: var(--accent); }
.filtres[open] summary { margin-bottom: 4px; }
.zone-resultat { min-height: 52px; }

@media (max-width: 600px) {
  .panneau { padding: 14px 16px; }
  .input-hero { font-size: 1.3rem; padding: 13px 14px; }
  .btn-hero { width: 100%; }
  /* Le fil d'Ariane reste dans le HTML (JSON-LD BreadcrumbList pour Google)
     et sur ordinateur, mais il cède sa place mobile au contenu utile. */
  .ariane { display: none; }
}

@media (max-width: 600px) {
  body { font-size: 16px; }
  .entete-in { gap: 10px; }
  .nav { margin-left: 0; width: 100%; }
  .tuile { width: 38px; height: 38px; font-size: 1.1rem; }
}

/* ---------- Mot du Jour (jeu) ---------- */
.jeu { max-width: 520px; margin: 0 auto; }
.jeu-statut { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 700; color: var(--encre-doux); margin-bottom: 2px; }
.grille-jeu { display: flex; flex-direction: column; gap: 6px; width: min(330px, 86vw); margin: 6px auto 14px; }
.ligne-jeu { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.case-jeu {
  aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--ligne); border-radius: 6px; background: var(--papier); color: var(--encre);
  font-size: clamp(1.1rem, 5vw, 1.6rem); font-weight: 800; text-transform: uppercase;
}
.case-jeu.remplie { border-color: var(--tuile-bord); background: var(--tuile); }
.case-jeu.place { background: var(--succes); border-color: var(--succes); color: #fff; }
.case-jeu.present { background: #c09000; border-color: #c09000; color: #fff; }
.case-jeu.absent { background: #8b93a5; border-color: #8b93a5; color: #fff; }
#clavier { display: flex; flex-direction: column; gap: 6px; margin: 10px auto 0; }
.clavier-ligne { display: flex; gap: 5px; justify-content: center; }
.touche {
  flex: 1 1 0; max-width: 40px; height: 50px; padding: 0;
  border: 1px solid var(--ligne); border-radius: 6px; background: var(--papier); color: var(--encre);
  font: inherit; font-weight: 700; font-size: 0.95rem; text-transform: uppercase; cursor: pointer;
}
.touche:hover { background: var(--fond); }
.touche.large { max-width: 58px; font-size: 1.1rem; }
.touche.place { background: var(--succes); border-color: var(--succes); color: #fff; }
.touche.present { background: #c09000; border-color: #c09000; color: #fff; }
.touche.absent { background: #8b93a5; border-color: #8b93a5; color: #fff; }
#partager { display: none; }
#partager.visible { display: block; width: fit-content; margin: 0 auto 10px; }
.legende { display: inline-block; padding: 1px 8px; border-radius: 4px; font-weight: 700; font-size: 0.88em; }
.legende.place { background: var(--succes); color: #fff; }
.legende.present { background: #c09000; color: #fff; }
.legende.absent { background: #8b93a5; color: #fff; }
@keyframes secousse {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.grille-jeu.secoue { animation: secousse 0.45s; }

/* ---------- Finitions UX / accessibilité ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
