/* Jeu : Poisson ou poison ? */

/* Repli pour les navigateurs sans color-mix() (Safari avant 16.2, vieux iPad) : sous chaque règle qui mélange
   des couleurs, un petit bloc @supports not redonne une couleur simple de base.css (la plus présente du mélange).
   Une ligne de repli écrite juste avant ne suffirait pas : une valeur qui contient var() est jugée trop tard,
   elle devient « unset » (le noir d'un SVG, un fond transparent). */

.bocal__choix {
  justify-content: center;
}

.bocal__filtre.est-fini::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-left: 0.45em;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
  vertical-align: 0.1em;
}

/* ---------- La carte : l'image dans son bocal, et le mot centrés dans l'axe ---------- */

.bocal__carte {
  scroll-margin-top: 5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--espace-3);
  width: 100%;
  max-width: 36rem;
  padding: var(--espace-4) var(--espace-4);
  border-radius: var(--rayon-grand);
  background: var(--surface-2);
  box-shadow: inset 0 0 0 2px var(--trait);
  transition: box-shadow var(--duree);
}

.bocal__carte--epreuve {
  box-shadow: inset 0 0 0 3px var(--jaune);
}

.bocal__carte--reussie {
  /* le code des couleurs : c'est juste, vert pâle et une coche dans le coin */
  position: relative;
  background: var(--fn-juste);
  color: var(--fn-juste-texte);
  box-shadow: inset 0 0 0 4px var(--accent);
}

.bocal__carte--reussie::after {
  content: '\2713';
  position: absolute;
  top: var(--espace-2);
  right: var(--espace-3);
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--fn-juste-texte);
}

.bocal__plaque {
  position: relative;
  display: grid;
  place-items: center;
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 46% 46% 50% 50% / 40% 40% 60% 60%;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.55) 0 7%, transparent 8%),
    color-mix(in srgb, var(--encre-2) 10%, var(--surface)); /* un verre gris : plus de vert pâle en décor (le vert pâle dit « c'est juste ») */
  box-shadow: inset 0 -6px 0 color-mix(in srgb, var(--accent) 22%, transparent), 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent);
  cursor: pointer;
}
@supports not (color: color-mix(in srgb, red 50%, blue)) { .bocal__plaque { background: radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.55) 0 7%, transparent 8%), var(--surface); } }

/* le col du bocal */
.bocal__plaque::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 22%;
  right: 22%;
  height: 8px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 45%, var(--surface));
}
@supports not (color: color-mix(in srgb, red 50%, blue)) { .bocal__plaque::before { background: var(--surface); } }

.bocal__image {
  display: grid;
  place-items: center;
  width: 2.8rem;
  height: 2.8rem;
  font-size: 2.8rem;
  line-height: 1;
}

.bocal__image > .icone {
  width: 2.8rem;
  height: 2.8rem;
}

.bocal__image--mystere {
  font-family: var(--police-titre);
  font-weight: 800;
  color: var(--encre-2);
  opacity: 0.7;
}

.bocal__choix-images {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace-3);
  align-items: center;
}

.bocal__image-choix {
  display: grid;
  place-items: center;
  width: 4.8rem;
  height: 4.8rem;
  padding: var(--espace-2);
  border: 0;
  border-radius: var(--rayon);
  background: var(--surface);
  box-shadow: inset 0 0 0 3px var(--trait), 0 4px 0 var(--ombre);
  font-size: 2.8rem;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.bocal__image-choix > .icone {
  width: 2.8rem;
  height: 2.8rem;
}

.bocal__image-choix:hover,
.bocal__image-choix:focus-visible {
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 3px var(--accent), 0 6px 0 var(--ombre);
}

.bocal__image-choix:active {
  transform: translateY(2px);
}

.bocal__image--tourne {
  animation: bocal-tourne 420ms cubic-bezier(0.2, 0.9, 0.3, 1.25);
}

@keyframes bocal-tourne {
  from { transform: rotateY(90deg) scale(0.7); opacity: 0.2; }
  to { transform: none; opacity: 1; }
}

.bocal__texte {
  display: grid;
  gap: var(--espace-3);
  justify-items: center;
  min-width: 0;
  width: 100%;
}

.bocal__ligne {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--espace-3);
  flex-wrap: wrap;
}

.bocal__mot {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0;
  cursor: pointer;
}

.bocal__tuile:first-child:not(:last-child) {
  border-radius: 10px 0 0 10px;
}
.bocal__tuile:not(:first-child):not(span:nth-last-child(2)) {
  border-radius: 0;
}
.bocal__tuile:nth-last-child(2):not(:first-child) {
  border-radius: 0 10px 10px 0;
}

.bocal__tuile {
  --taille: clamp(2.2rem, 1.4rem + 2.6vw, 2.9rem);
  padding: 0 0.3em;
}

/* le code des couleurs : le s ou les ss du mot, ce qu'on regarde, en jaune surligné (au lieu de la couleur du jeu) */
.bocal__tuile.tuile--allumee {
  background: var(--fn-piege);
  color: var(--fn-piege-texte);
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.18), 0 0 0 3px var(--fn-piege-texte);
}

/* les deux voyelles qui entourent le s ou ss : mises en valeur dès la question */
.bocal__tuile--voyelle {
  text-decoration: underline;
  text-decoration-thickness: 0.14em;
  text-underline-offset: 0.14em;
  box-shadow: inset 0 -6px 0 var(--bois-flanc), 0 0 0 2px var(--accent);
}

.bocal__repere {
  max-width: 30rem;
  margin: 0;
  padding: var(--espace-1) var(--espace-3);
  border-radius: var(--rayon);
  background: var(--surface);
  border: 2px solid var(--trait);
  font-size: 0.98rem;
  line-height: 1.4;
  color: var(--encre);
}

.bocal__voyelle-tag {
  display: inline-block;
  padding: 0 0.3em;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--accent);
  font-weight: 800;
}

.bocal__tuile--arrive {
  animation: bocal-arrive 380ms cubic-bezier(0.2, 0.9, 0.3, 1.4);
}

@keyframes bocal-arrive {
  from { transform: translateY(-1.4em) scale(0.3); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.bocal__tuile--serre {
  animation: bocal-serre 360ms ease-out;
}

@keyframes bocal-serre {
  0% { transform: scaleX(1.5); }
  60% { transform: scaleX(0.9); }
  100% { transform: none; }
}

.bocal__tuile--change {
  animation: bocal-change 420ms ease-out;
}

@keyframes bocal-change {
  from { transform: rotateX(90deg); }
  to { transform: none; }
}

.bocal__chant {
  display: flex;
  align-items: center;
  gap: var(--espace-2);
  font-weight: 700;
  font-size: 1.05rem;
}

.bocal__chant .icone {
  font-size: 1.8rem;
}

.bocal__sens {
  font-size: 1.1rem;
  max-width: 28rem;
}

.bocal__remarque {
  font-size: 1rem;
  color: var(--encre-2);
  max-width: 28rem;
}

/* ---------- L'interrupteur ---------- */

.bocal__commande {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--espace-2);
  padding-block: var(--espace-1);
}

.bocal__inter {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 12rem;
  height: 5rem;
  padding: 6px;
  border: 0;
  border-radius: 2.5rem;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 3px var(--trait), inset 0 6px 10px var(--ombre);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.bocal__inter-cote {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  font-family: var(--police-titre);
  font-size: 1.9rem;
  line-height: 1;
  color: var(--encre-2);
  transition: color var(--duree);
}

.bocal__bouton {
  position: absolute;
  z-index: 1;
  top: 6px;
  left: 6px;
  width: calc(50% - 6px);
  height: calc(100% - 12px);
  border-radius: 2.1rem;
  background: var(--accent);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.22), 0 3px 6px var(--ombre);
  transition: transform 260ms cubic-bezier(0.3, 0.9, 0.3, 1.25);
}

.bocal__inter.est-ss .bocal__bouton {
  transform: translateX(100%);
}

.bocal__inter:not(.est-ss) .bocal__inter-cote--s,
.bocal__inter.est-ss .bocal__inter-cote--ss {
  color: var(--sur-accent);
}

.bocal__inter:active .bocal__bouton {
  filter: brightness(1.08);
}

.bocal__consigne {
  font-size: 1rem;
  margin: 0;
}

.bocal__consigne:empty,
.bocal__consigne.est-cachee {
  display: none;
}

.bocal__suite {
  flex-direction: column;
  text-align: center;
  gap: var(--espace-2);
}

.bocal__actions {
  min-height: 2.8rem;
}

.bocal__invitation {
  max-width: 28rem;
  font-weight: 700;
}

.bocal__truc {
  display: grid;
  justify-items: center;
  width: 100%;
}

/* ---------- Les autres mots ---------- */

.bocal__autres {
  display: grid;
  gap: var(--espace-3);
  width: 100%;
  max-width: 44rem;
}

.bocal__autres:empty {
  display: none;
}

.bocal__autres-titre {
  font-family: var(--police-titre);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--encre-2);
  text-align: center;
}

.bocal__colonnes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: var(--espace-4);
}

.bocal__colonne {
  display: grid;
  align-content: start;
  gap: var(--espace-2);
  padding: var(--espace-4);
  border-radius: var(--rayon);
  background: var(--surface-2);
}

.bocal__colonne-titre {
  display: flex;
  align-items: center;
  gap: var(--espace-2);
  font-weight: 700;
}

.bocal__colonne-titre .icone {
  font-size: 1.6rem;
}

.bocal__puces {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espace-2);
}

.bocal__puce {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 3rem;
  padding: 0.3rem 0.8rem;
  border: 0;
  border-radius: 10px;
  background: var(--surface);
  color: var(--encre);
  font-size: 1.1rem;
  box-shadow: inset 0 0 0 2px var(--trait);
}

.bocal__puce .icone {
  font-size: 1.5rem;
}

.bocal__s {
  /* le code des couleurs : le s ou les ss qu'on regarde, en jaune surligné */
  background: var(--fn-piege);
  color: var(--fn-piege-texte);
  border-radius: 0.2em;
  font-weight: 700;
}

/* ---------- Les deux dessins faits à la main ---------- */

.bocal__dessin {
  width: 1.3em;
  height: 1.3em;
}

.bocal-d__bouchon { fill: var(--bois-flanc); }
.bocal-d__verre { fill: color-mix(in srgb, var(--surface) 75%, var(--violet)); stroke: var(--encre); stroke-width: 3; stroke-linejoin: round; }
@supports not (color: color-mix(in srgb, red 50%, blue)) { .bocal-d__verre { fill: var(--surface); } }
.bocal-d__liquide { fill: var(--violet); }
.bocal-d__bulle { fill: var(--surface); opacity: 0.8; }
.bocal-d__etiquette { fill: var(--surface); stroke: var(--encre); stroke-width: 2.5; }
.bocal-d__os { fill: none; stroke: var(--encre); stroke-width: 4; stroke-linecap: round; }
.bocal-d__tete { fill: var(--surface); stroke: var(--encre); stroke-width: 2.5; }
.bocal-d__oeil { fill: var(--encre); }

.bocal-d__tissu { fill: var(--rouge); stroke: var(--encre); stroke-width: 3; stroke-linejoin: round; }
.bocal-d__couture { fill: none; stroke: var(--surface); stroke-width: 2; stroke-dasharray: 4 4; opacity: 0.85; }
.bocal-d__pli { fill: none; stroke: var(--encre); stroke-width: 2; stroke-linecap: round; opacity: 0.35; }
.bocal-d__bouton { fill: var(--jaune); stroke: var(--encre); stroke-width: 2.5; }
.bocal-d__houppe { fill: none; stroke: var(--jaune); stroke-width: 5; stroke-linecap: round; }

/* L'affiche de l'accueil */
.bocal__glyphe-ou {
  font-size: 0.8em;
  opacity: 0.8;
}

@media (max-width: 560px) {
  .bocal__carte {
    padding: var(--espace-3);
  }
}
