/* Lamma : papier, encre, tapis de cartes. Aplats, traits nets, pas d'ombres.
   Compatibilité : pas de flex gap, pas d'aspect-ratio, pas de inset,
   propriétés logiques en forme longue (Safari 13, vieux Chrome Android). */

:root {
  --papier: #f5efe3;
  --papier-2: #eae1cf;
  --encre: #17201b;
  --encre-2: #4d5850;
  --tapis: #0e3b2f;
  --tapis-2: #0a2c23;
  --brique: #b53a23;
  --jasmin: #f0c14b;

  --trait: 1.5px solid var(--encre);
  --display: 'Bricolage Grotesque Variable', 'Alexandria Variable', system-ui, -apple-system,
    'Segoe UI', sans-serif;
  --corps: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --arabe: 'Alexandria Variable', 'Segoe UI', Tahoma, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--corps);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* L'arabe : sa propre police, plus d'interligne, jamais d'interlettrage. */
[lang^='ar'] {
  font-family: var(--arabe);
  line-height: 1.85;
  letter-spacing: 0 !important;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

a:focus-visible,
select:focus-visible {
  outline: 3px solid var(--jasmin);
  outline-offset: 2px;
}

.cadre {
  max-width: 1040px;
  margin: 0 auto;
  padding-left: 18px;
  padding-right: 18px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- en-tête ---------- */

.entete {
  border-bottom: var(--trait);
  background: var(--papier);
}

.entete .cadre {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding-top: 12px;
  padding-bottom: 0;
}

.marque {
  display: inline-block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.marque svg {
  width: 0.62em;
  height: 0.62em;
  fill: var(--brique);
  margin-inline-end: 0.22em;
}

.langue {
  display: inline-block;
  padding: 8px 4px;
  font-size: 14px;
  font-weight: 600;
  text-underline-offset: 4px;
}

.langue:hover {
  text-decoration-thickness: 2px;
}

.nav {
  grid-column: 1 / -1;
  display: block;
  margin-top: 10px;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav a {
  display: inline-block;
  padding: 10px 0 11px;
  margin-inline-end: 22px;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

.nav a:hover,
.nav a[aria-current='page'] {
  border-bottom-color: var(--brique);
}

/* ---------- héros + compteur ---------- */

.hero {
  background: var(--tapis);
  color: var(--papier);
  padding: 34px 0 40px;
}

.surtitre {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--jasmin);
}

.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 40px;
  font-size: clamp(34px, 8.6vw, 76px);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-top: 10px;
  max-width: 13em;
}

[lang^='ar'] .hero h1 {
  line-height: 1.3;
  font-weight: 700;
}

.compteur {
  margin-top: 30px;
  border: 1.5px solid var(--papier);
  border-radius: 14px;
  max-width: 560px;
}

.compteur-tete {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1.5px solid rgba(245, 239, 227, 0.35);
  font-size: 15px;
  font-weight: 600;
}

.compteur select {
  font: inherit;
  font-size: 16px; /* évite le zoom auto de Safari iOS */
  color: var(--papier);
  background: var(--tapis-2);
  border: 1.5px solid var(--papier);
  border-radius: 999px;
  padding: 6px 12px;
  max-width: 46vw;
}

.compteur-valeur {
  padding: 18px 16px 14px;
  font-family: var(--display);
  font-weight: 800;
  color: var(--jasmin);
  font-size: 58px;
  font-size: clamp(50px, 15vw, 92px);
  line-height: 1;
  letter-spacing: -0.02em;
}

[dir='rtl'] .compteur-valeur {
  text-align: right;
}

/* Liste des villes : un vrai bouton, flèche dessinée côté fin de ligne. */
.compteur select.choix-ville {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  min-width: 150px;
  max-width: 52vw;
  margin: 0;
  padding: 9px 40px 9px 16px;
  font-weight: 600;
  font-size: 16px; /* pas de zoom automatique sur Safari iOS */
  line-height: 1.2;
  color: var(--encre);
  background-color: var(--papier);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%2317201b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 12px 8px;
  border: 1.5px solid var(--papier);
  border-radius: 999px;
  cursor: pointer;
}

[dir='rtl'] .compteur select.choix-ville {
  padding: 9px 16px 9px 40px;
  background-position: left 15px center;
}

.compteur select.choix-ville:hover {
  background-color: #fffdf8;
}

.compteur select.choix-ville:focus-visible {
  outline: 3px solid var(--jasmin);
  outline-offset: 2px;
}

.compteur select.choix-ville option,
.compteur select.choix-ville optgroup {
  color: var(--encre);
  background: #fffdf8;
}

.compteur-date {
  display: block;
  margin-top: 3px;
  font-family: var(--corps);
  font-weight: 500;
  font-size: 13px;
  line-height: 1.3;
  opacity: 0.85;
}

[lang^='ar'] .compteur-date {
  font-family: var(--arabe);
}

.compteur-valeur .seg {
  display: inline-block;
  min-width: 1.22em;
  text-align: center;
}

.compteur-valeur .sep {
  opacity: 0.55;
}

.compteur-unite {
  font-size: 0.34em;
  letter-spacing: 0;
  color: var(--papier);
  margin-inline-start: 0.3em;
}

.compteur-pied {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  border-top: 1.5px solid rgba(245, 239, 227, 0.35);
}

.compteur-pied > div {
  padding: 11px 16px 12px;
  border-inline-end: 1.5px solid rgba(245, 239, 227, 0.35);
}

.compteur-pied > div:last-child {
  border-inline-end: 0;
}

.compteur-pied dt {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.75;
}

.compteur-pied dd {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
}

.suite {
  display: inline-block;
  margin-top: 16px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1.5px;
}

/* ---------- sections ---------- */

.bloc {
  padding: 38px 0 8px;
}

.bloc:last-of-type {
  padding-bottom: 48px;
}

.bloc-tete {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  padding-bottom: 12px;
  border-bottom: var(--trait);
  margin-bottom: 20px;
}

.bloc-tete h2,
.page-tete h1 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.05;
}

.bloc-tete h2 {
  font-size: 30px;
  font-size: clamp(26px, 6vw, 40px);
}

[lang^='ar'] .bloc-tete h2,
[lang^='ar'] .page-tete h1 {
  line-height: 1.35;
  font-weight: 700;
}

.bloc-tete a {
  font-size: 15px;
  font-weight: 600;
  text-underline-offset: 4px;
}

.page-tete {
  padding: 34px 0 6px;
}

.page-tete h1 {
  font-size: 40px;
  font-size: clamp(34px, 8vw, 64px);
}

.page-tete p {
  margin-top: 10px;
  max-width: 34em;
  color: var(--encre-2);
}

.fil {
  display: inline-block;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 600;
  text-underline-offset: 4px;
}

/* ---------- tables de jeu (cartes à jouer) ---------- */

.jeux {
  display: block;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-left: -18px;
  margin-right: -18px;
  padding: 2px 18px 14px;
}

.jeu {
  display: inline-block;
  vertical-align: top;
  width: 136px;
  margin-inline-end: 14px;
  white-space: normal;
}

.jeu:last-child {
  margin-inline-end: 0;
}

.carte {
  position: relative;
  display: block;
  height: 0;
  padding-top: 138%;
  background: #fffdf8;
  border: var(--trait);
  border-radius: 12px;
  color: var(--encre);
  direction: ltr;
}

.carte.rouge {
  color: var(--brique);
}

.carte .coin {
  position: absolute;
  top: 9px;
  left: 10px;
  width: 22px;
  text-align: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1;
}

.carte .coin svg {
  display: block;
  width: 15px;
  height: 15px;
  margin: 3px auto 0;
  fill: currentColor;
}

.carte .coin.bas {
  top: auto;
  left: auto;
  bottom: 9px;
  right: 10px;
  transform: rotate(180deg);
}

.carte .milieu {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44%;
  transform: translate(-50%, -50%);
  text-align: center;
  font-family: var(--display);
  font-weight: 800;
  font-size: 64px;
  line-height: 1;
}

.carte .milieu svg {
  display: block;
  width: 100%;
  height: auto;
  fill: currentColor;
}

.jeu h3 {
  margin-top: 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.jeu p {
  font-size: 14px;
  color: var(--encre-2);
  line-height: 1.35;
}

.bientot {
  display: inline-block;
  margin-top: 7px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--jasmin);
  color: var(--encre);
}

@media (min-width: 760px) {
  .jeux {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-gap: 20px;
    overflow: visible;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
  }
  .jeu {
    width: auto;
    margin-inline-end: 0;
  }
}

/* ---------- liste de recettes ---------- */

.recettes li {
  border-bottom: 1px solid rgba(23, 32, 27, 0.22);
}

.recettes a {
  display: grid;
  grid-template-columns: 2.2em 1fr auto;
  align-items: baseline;
  padding: 14px 0;
  text-decoration: none;
}

.recettes .num {
  font-family: var(--display);
  font-weight: 700;
  font-size: 14px;
  color: var(--brique);
}

.recettes .nom {
  font-family: var(--display);
  font-weight: 700;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.recettes a:hover .nom {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.recettes .alias {
  display: block;
  font-family: var(--corps);
  font-weight: 400;
  font-size: 14.5px;
  letter-spacing: 0;
  color: var(--encre-2);
}

.recettes .alias[lang^='ar'] {
  font-family: var(--arabe);
  line-height: 1.7;
}

/* Le nom dans l'autre langue reste aligné sous le titre, quel que soit son sens d'écriture. */
html[dir='ltr'] .recettes .alias {
  text-align: left;
}

html[dir='rtl'] .recettes .alias {
  text-align: right;
}

.recettes .temps {
  font-size: 14px;
  color: var(--encre-2);
  white-space: nowrap;
  padding-inline-start: 12px;
}

.categorie {
  margin-top: 30px;
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brique);
}

/* ---------- fiche recette ---------- */

.fiche-meta {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  margin-top: 18px;
  border: var(--trait);
  border-radius: 12px;
  width: -webkit-fit-content;
  width: fit-content;
  max-width: 100%;
}

.fiche-meta > div {
  padding: 9px 16px 10px;
  border-inline-end: var(--trait);
}

.fiche-meta > div:last-child {
  border-inline-end: 0;
}

.fiche-meta dt {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--encre-2);
}

.fiche-meta dd {
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.25;
}

.fiche-corps {
  padding: 30px 0 54px;
}

.fiche-corps h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -0.015em;
  padding-bottom: 8px;
  border-bottom: var(--trait);
  margin-bottom: 6px;
}

[lang^='ar'] .fiche-corps h2 {
  font-weight: 700;
}

.ingredients li {
  display: grid;
  grid-template-columns: 7.2em 1fr;
  padding: 8px 0;
  border-bottom: 1px solid rgba(23, 32, 27, 0.16);
}

.ingredients .qte {
  font-weight: 700;
  color: var(--brique);
}

.etapes {
  counter-reset: pas;
}

.etapes li {
  position: relative;
  counter-increment: pas;
  padding: 12px 0 12px 0;
  padding-inline-start: 2.4em;
  border-bottom: 1px solid rgba(23, 32, 27, 0.16);
}

.etapes li::before {
  content: counter(pas);
  position: absolute;
  top: 10px;
  inset-inline-start: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.3;
  color: var(--brique);
}

/* Repli pour les navigateurs sans inset-inline-start. */
@supports not (inset-inline-start: 0) {
  .etapes li::before {
    left: 0;
  }
  [dir='rtl'] .etapes li::before {
    left: auto;
    right: 0;
  }
}

.astuce {
  margin-top: 26px;
  padding: 16px 18px 18px;
  background: var(--tapis);
  color: var(--papier);
  border-radius: 12px;
}

.astuce h2 {
  border: 0;
  padding: 0;
  margin-bottom: 4px;
  font-size: 13px;
  font-family: var(--corps);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--jasmin);
}

[lang^='ar'] .astuce h2 {
  font-family: var(--arabe);
  font-size: 15px;
}

.colonnes > * + * {
  margin-top: 30px;
}

@media (min-width: 760px) {
  .colonnes {
    display: grid;
    grid-template-columns: 5fr 7fr;
    grid-gap: 44px;
    align-items: start;
  }
  .colonnes > * + * {
    margin-top: 0;
  }
}

/* ---------- horaires ---------- */

.villes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 10px;
}

@media (min-width: 620px) {
  .villes {
    grid-template-columns: repeat(4, 1fr);
  }
}

.villes a {
  display: block;
  padding: 12px 14px 13px;
  border: var(--trait);
  border-radius: 12px;
  text-decoration: none;
  background: #fffdf8;
}

.villes a:hover,
.villes a[aria-current='page'] {
  background: var(--encre);
  color: var(--papier);
}

.villes b {
  display: block;
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.25;
}

.villes span {
  font-size: 13.5px;
  opacity: 0.75;
}

.imsakia {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.imsakia th {
  text-align: start;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--encre-2);
  padding: 10px 6px;
  border-bottom: var(--trait);
}

.imsakia td {
  padding: 11px 6px;
  border-bottom: 1px solid rgba(23, 32, 27, 0.16);
}

.imsakia td.n {
  font-family: var(--display);
  font-weight: 800;
  color: var(--brique);
  width: 2.6em;
}

.imsakia td.h {
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
}

.imsakia tr.aujourdhui td {
  background: var(--jasmin);
}

.note {
  margin-top: 22px;
  font-size: 14.5px;
  color: var(--encre-2);
  max-width: 44em;
}

/* ---------- pied ---------- */

.pied {
  border-top: var(--trait);
  padding: 22px 0 34px;
  font-size: 14px;
  color: var(--encre-2);
}

.pied .cadre {
  display: grid;
  grid-gap: 4px 20px;
}

@media (min-width: 620px) {
  .pied .cadre {
    grid-template-columns: 1fr auto;
    align-items: baseline;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- images des recettes ---------- */

.fiche-image {
  margin-top: 22px;
  border: var(--trait);
  border-radius: 12px;
  overflow: hidden;
  background: var(--papier-2);
  max-width: 720px;
}

.fiche-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 460px;
  object-fit: cover;
}

.fiche-image figcaption {
  padding: 6px 12px 7px;
  font-size: 12.5px;
  color: var(--encre-2);
  border-top: 1px solid rgba(23, 32, 27, 0.2);
}

.recettes.avec-images a {
  grid-template-columns: 2.2em 68px 1fr auto;
  align-items: center;
}

.recettes .vignette {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 9px;
  border: var(--trait);
  object-fit: cover;
  background: var(--papier-2);
}

picture.vignette {
  overflow: hidden;
}

picture.vignette img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Grille de cartes avec photo, à partir de la tablette (page Cuisine et favoris). */
@media (min-width: 768px) {
  .recettes.grille {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    grid-gap: 22px 18px;
    margin-top: 12px;
  }

  .recettes.grille li {
    border-bottom: 0;
  }

  .recettes.grille a {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      'img img'
      'nom nom'
      'num temps';
    align-items: baseline;
    padding: 0;
  }

  .recettes.grille .vignette {
    grid-area: img;
    width: 100%;
    height: auto;
    border-radius: 14px;
    margin-bottom: 10px;
  }

  /* 4:3, y compris sur les navigateurs sans aspect-ratio */
  .recettes.grille picture.vignette,
  .recettes.grille .vignette.vide {
    position: relative;
    height: 0;
    padding-bottom: 75%;
  }

  .recettes.grille picture.vignette img {
    position: absolute;
    top: 0;
    left: 0;
  }

  .recettes.grille a:hover .vignette {
    box-shadow: 4px 4px 0 var(--encre);
  }

  .recettes.grille .nom {
    grid-area: nom;
    font-size: 19px;
  }

  .recettes.grille .num {
    grid-area: num;
    margin-top: 6px;
    margin-inline-end: 10px;
  }

  .recettes.grille .temps {
    grid-area: temps;
    padding-inline-start: 0;
  }
}

/* Un bloc à cadre glissé dans une page qui a déjà son cadre : pas de double marge. */
.cadre .cadre {
  padding-left: 0;
  padding-right: 0;
}

/* ---------- prières du jour ---------- */

.prieres-date {
  font-size: 14px;
  color: var(--encre-2);
}

/* Sur téléphone, la date (ville · date hégirienne) passe sous le titre au lieu de s'y coincer. */
.prieres-tete {
  grid-template-columns: 1fr;
}

.prieres-tete .prieres-date {
  margin-top: 4px;
}

@media (min-width: 620px) {
  .prieres-tete {
    grid-template-columns: 1fr auto;
    grid-column-gap: 20px;
  }

  .prieres-tete .prieres-date {
    margin-top: 0;
    padding-bottom: 6px;
    text-align: end;
  }
}

.prieres-carte {
  border: var(--trait);
  border-radius: 14px;
  background: #fffdf8;
  overflow: hidden;
}

.prieres-prochaine {
  min-height: 58px;
  padding: 14px 16px;
  background: var(--tapis);
  color: var(--papier);
  font-size: 15px;
}

.prieres-prochaine b {
  font-family: var(--display);
  font-weight: 800;
  font-size: 24px;
  color: var(--jasmin);
  margin: 0 4px;
}

.prieres-dans {
  white-space: nowrap;
}

.prieres-liste {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.prieres-liste li {
  padding: 11px 14px 12px;
  border-top: 1px solid rgba(23, 32, 27, 0.14);
  border-inline-start: 1px solid rgba(23, 32, 27, 0.14);
}

.prieres-liste li:nth-child(3n + 1) {
  border-inline-start: 0;
}

.prieres-liste li span {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--encre-2);
}

.prieres-liste li b {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
}

.prieres-liste li.passee b {
  font-weight: 500;
  color: var(--encre-2);
}

.prieres-liste li.prochaine {
  background: var(--jasmin);
}

.prieres-liste li.prochaine span {
  color: var(--encre);
}

.prieres-liste li.secondaire b {
  font-size: 18px;
}

@media (min-width: 760px) {
  .prieres-liste {
    grid-template-columns: repeat(6, 1fr);
  }
  .prieres-liste li:nth-child(3n + 1) {
    border-inline-start: 1px solid rgba(23, 32, 27, 0.14);
  }
  .prieres-liste li:first-child {
    border-inline-start: 0;
  }
}

/* ---------- en-tête : compte ---------- */

.entete .cadre {
  grid-template-columns: 1fr auto;
}

.entete-outils {
  display: flex;
  align-items: center;
}

.entete-outils > * {
  margin-inline-start: 8px;
}

.compte {
  display: block;
  width: 36px;
  height: 36px;
  border: var(--trait);
  border-radius: 50%;
  overflow: hidden;
  text-decoration: none;
}

.compte img,
.avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.initiales {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
  color: var(--papier);
  background: var(--tapis);
}

/* Déconnexion, à côté de l'avatar : icône seule sur les petits écrans, icône + mot au-delà */
.sortie {
  margin-top: 0;
  margin-bottom: 0;
  margin-inline-start: 10px;
}

.sortie button {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--encre);
  background: transparent;
  border: var(--trait);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.sortie button:hover {
  background: var(--encre);
  color: var(--papier);
}

.sortie button:focus-visible {
  outline: 3px solid var(--jasmin);
  outline-offset: 2px;
}

.sortie svg {
  flex: 0 0 auto;
}

/* Le pictogramme « sortie » pointe vers la fin de la ligne : on le retourne en arabe. */
[dir='rtl'] .sortie svg {
  transform: scaleX(-1);
}

.sortie span {
  margin-inline-start: 6px;
}

@media (max-width: 420px) {
  .sortie button {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .sortie span {
    display: none;
  }
}

.compte-lien {
  display: inline-block;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  border: var(--trait);
  border-radius: 999px;
}

.compte-lien:hover {
  background: var(--encre);
  color: var(--papier);
}

/* ---------- messages ---------- */

.bandeau-ok {
  margin-top: 16px;
  padding: 11px 16px;
  border: var(--trait);
  border-radius: 12px;
  background: #e3efe0;
  font-weight: 600;
}

/* ---------- formulaires ---------- */

.etroit {
  max-width: 620px;
}

.formulaire {
  margin: 8px 0 34px;
}

.formulaire + .formulaire {
  padding-top: 26px;
  border-top: var(--trait);
}

.formulaire h2 {
  margin: 26px 0 4px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
}

.formulaire h2:first-child,
.formulaire h2:first-of-type {
  margin-top: 8px;
}

.champ {
  display: block;
  margin-top: 14px;
  border: 0;
  padding: 0;
  min-width: 0;
}

.champ > span,
.champ > legend {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  padding: 0;
}

.champ input[type='text'],
.champ input[type='email'],
.champ input[type='password'],
.champ input[type='number'],
.champ select,
.champ textarea {
  display: block;
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: 17px; /* 16 px au moins : pas de zoom sur Safari iOS */
  color: var(--encre);
  background: #fffdf8;
  border: var(--trait);
  border-radius: 10px;
}

.champ textarea {
  line-height: 1.5;
  resize: vertical;
}

.champ input[type='file'] {
  display: block;
  max-width: 100%;
  font-size: 15px;
}

.champ input:focus,
.champ select:focus,
.champ textarea:focus {
  outline: 3px solid var(--jasmin);
  outline-offset: 1px;
}

.champ small,
.champ-aide {
  display: block;
  margin-top: 5px;
  font-size: 13.5px;
  color: var(--encre-2);
}

.champ-erreur {
  display: block;
  margin-top: 5px;
  font-style: normal;
  font-size: 14px;
  font-weight: 600;
  color: var(--brique);
}

.champs-ligne {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: 0 12px;
}

.case {
  display: flex;
  align-items: flex-start;
  margin-top: 14px;
  font-size: 15.5px;
  line-height: 1.45;
}

.case input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
  margin-inline-end: 10px;
  accent-color: var(--tapis);
}

.bouton {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 22px;
  font: inherit;
  font-family: var(--display);
  font-weight: 800;
  font-size: 17px;
  color: var(--encre);
  text-decoration: none;
  background: var(--jasmin);
  border: var(--trait);
  border-radius: 999px;
  cursor: pointer;
}

.bouton.secondaire {
  background: transparent;
}

.bouton.petit {
  margin-top: 14px;
  padding: 8px 16px;
  font-size: 15px;
}

.bouton.danger {
  color: #fff;
  background: var(--brique);
  border-color: var(--brique);
}

.bouton:focus-visible {
  outline: 3px solid var(--jasmin);
  outline-offset: 2px;
}

/* « Continuer avec Google » (au-dessus des formulaires de connexion et d'inscription) */
.connexion-google {
  margin-top: 8px;
}

.bouton-google {
  display: -webkit-box;
  display: flex;
  -webkit-box-align: center;
  align-items: center;
  -webkit-box-pack: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 18px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  color: var(--encre);
  text-decoration: none;
  background: #fff;
  border: var(--trait);
  border-radius: 999px;
}

.bouton-google svg {
  flex: 0 0 auto;
  margin-inline-end: 12px;
}

.bouton-google:hover {
  background: var(--papier-2);
}

.bouton-google:focus-visible {
  outline: 3px solid var(--jasmin);
  outline-offset: 2px;
}

.separateur-ou {
  display: flex;
  align-items: center;
  margin: 22px 0 6px;
  font-size: 14px;
  color: var(--encre-2);
}

.separateur-ou::before,
.separateur-ou::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: var(--papier-2);
  background: currentColor;
  opacity: 0.3;
}

.separateur-ou span {
  padding: 0 12px;
}

.formulaire.danger p {
  color: var(--encre-2);
}

.formulaire-liens {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 15px;
}

.formulaire-liens > * {
  margin-top: 6px;
}

.formulaire-liens a {
  font-weight: 600;
  text-underline-offset: 3px;
}

.avatar-ligne {
  display: flex;
  align-items: center;
  margin-top: 10px;
}

.avatar {
  display: block;
  flex: 0 0 auto;
  width: 88px;
  height: 88px;
  border: var(--trait);
  border-radius: 50%;
  overflow: hidden;
  margin-inline-end: 16px;
}

.avatar .initiales {
  font-size: 28px;
}

/* ---------- espace personnel ---------- */

.onglets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 4px 0 6px;
  border-bottom: var(--trait);
}

.onglets a,
.onglets button {
  display: inline-block;
  margin-inline-end: 18px;
  padding: 10px 0 11px;
  font: inherit;
  font-weight: 600;
  font-size: 15.5px;
  color: inherit;
  text-decoration: none;
  background: none;
  border: 0;
  border-bottom: 3px solid transparent;
  cursor: pointer;
}

.onglets a[aria-current='page'] {
  border-bottom-color: var(--brique);
}

.onglets form {
  margin-inline-start: auto;
}

.onglets button {
  margin-inline-end: 0;
  color: var(--encre-2);
}

.vide {
  margin: 22px 0 6px;
  color: var(--encre-2);
}

.mes-recettes li {
  display: flex;
  align-items: flex-start;
  padding: 14px 0;
  border-bottom: 1px solid rgba(23, 32, 27, 0.18);
}

.mes-recettes .vignette {
  flex: 0 0 auto;
  margin-inline-end: 14px;
}

.mes-recettes b {
  display: block;
  font-family: var(--display);
  font-size: 19px;
  line-height: 1.25;
}

.mes-recettes small {
  display: block;
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--encre-2);
}

.mes-recettes a {
  display: inline-block;
  margin-top: 4px;
  font-weight: 600;
  font-size: 14.5px;
}

.statut {
  display: inline-block;
  margin-top: 5px;
  padding: 2px 10px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid currentColor;
}

.statut-pending,
.statut-draft {
  color: #8a5a00;
  background: #fbefd0;
}

.statut-published {
  color: var(--tapis);
  background: #e3efe0;
}

.statut-rejected {
  color: var(--brique);
  background: #f6dcd5;
}

/* ---------- recette : favori ---------- */

.titre-favori {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.titre-favori h1 {
  flex: 1 1 auto;
}

.favori {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-top: 4px;
  margin-inline-start: 12px;
  padding: 0;
  color: var(--encre);
  background: #fffdf8;
  border: var(--trait);
  border-radius: 50%;
  cursor: pointer;
}

.favori svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.favori.actif {
  color: var(--brique);
}

.favori.actif svg {
  fill: currentColor;
}

/* ---------- pages de texte ---------- */

.texte h2 {
  margin-top: 26px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
}

.texte p {
  margin-top: 8px;
}

.texte {
  padding-bottom: 40px;
}

.pied a {
  display: inline-block;
  padding: 4px 0;
  color: inherit;
  text-underline-offset: 3px;
}

.avatar-ligne > div {
  flex: 1 1 auto;
  min-width: 0;
}

/* ---------- lien d'évitement (clavier) ---------- */

.evitement {
  position: absolute;
  top: -60px;
  inset-inline-start: 12px;
  z-index: 50;
  padding: 10px 16px;
  font-weight: 700;
  color: var(--encre);
  background: var(--jasmin);
  border: var(--trait);
  border-radius: 999px;
}

.evitement:focus {
  top: 12px;
}

main:focus {
  outline: none;
}

/* ---------- « D'où viennent ces horaires ? » ---------- */

.note-details {
  margin-top: 12px;
  font-size: 14px;
  color: var(--encre-2);
}

.note-details summary {
  display: inline-block;
  padding: 4px 0;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.note-details summary::-webkit-details-marker {
  display: none;
}

.note-details p {
  margin-top: 6px;
  max-width: 62ch;
}

/* ---------- publicité ---------- */

/* Place réservée à l'annonce : la page ne saute pas quand elle arrive. */
.pub {
  position: relative;
  max-width: 760px;
  margin: 28px auto;
  padding: 22px 0 10px;
  min-height: 300px;
  border-top: 1px solid rgba(23, 32, 27, 0.15);
  border-bottom: 1px solid rgba(23, 32, 27, 0.15);
  text-align: center;
}

.pub-etiquette {
  position: absolute;
  top: 4px;
  inset-inline-start: 0;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--encre-2);
}



/* ---------- pièces ---------- */

/* Solde dans l'en-tête, à côté de l'avatar */
.pieces {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 10px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 14px;
  color: var(--encre);
  text-decoration: none;
  background: var(--jasmin);
  border: var(--trait);
  border-radius: 999px;
}

.pieces svg {
  width: 18px;
  height: 18px;
  margin-inline-end: 5px;
  fill: none;
  stroke: var(--encre);
  stroke-width: 2;
}

.pieces.bouge {
  animation: pieces-bouge 0.6s ease-out;
}

@keyframes pieces-bouge {
  30% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

.pieces-gros {
  display: flex;
  align-items: center;
  margin-top: 8px;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 800;
}

[lang^='ar'] .pieces-gros {
  font-family: var(--arabe);
  font-weight: 700;
}

.pieces-gros svg {
  width: 34px;
  height: 34px;
  margin-inline-end: 10px;
  fill: var(--jasmin);
  stroke: var(--encre);
  stroke-width: 1.5;
}

.pieces-boutique,
.pieces-regles,
.pieces-historique {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pieces-boutique li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 14px 0;
  border-bottom: 1px solid rgba(23, 32, 27, 0.15);
}

.pieces-boutique li > div {
  flex: 1 1 220px;
  margin-inline-end: 12px;
}

.pieces-boutique b,
.pieces-boutique .champ-aide {
  display: block;
}

.pieces-boutique .bouton[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.pieces-regles li {
  padding: 6px 0;
}

.pieces-historique li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(23, 32, 27, 0.1);
}

.pieces-historique small {
  display: block;
  font-size: 13px;
  color: var(--encre-2);
}

.pieces-historique .plus {
  color: #2f7d4f;
}

.pieces-historique .moins {
  color: var(--brique);
}

/* Annonce d'un gain sur une page de jeu */
.pieces-toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  padding: 10px 16px;
  font-weight: 700;
  color: var(--encre);
  background: var(--jasmin);
  border: var(--trait);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}

.pieces-toast a {
  margin-inline-start: 10px;
  font-weight: 600;
  color: inherit;
}

@media (prefers-reduced-motion: reduce) {
  .pieces.bouge {
    animation: none;
  }
}
