/* Le verger de velours : interface claire, dessin en temps réel, grandes cibles tactiles. */
.bouc-page {
  background: #f1eadb;
  color: #2d4133;
  --b-encre: #263c32;
  --b-creme: #fff7df;
  --b-or: #efc278;
  --b-sauge: #567451;
}
.bouc-entete {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 22px;
}
.bouc-entete a {
  font-size: 0.8rem;
  color: #577050;
  text-decoration: none;
}
.bouc-entete h1 {
  font-size: clamp(1.65rem, 3vw, 2.65rem);
  line-height: 1.08;
  margin: 10px 0 0;
  letter-spacing: -0.035em;
}
.bouc-entete > p {
  text-align: right;
  font-size: 1.03rem;
  font-weight: 650;
  margin: 0;
  color: #47604d;
}
.bouc-entete > p span {
  display: block;
  font-size: 0.74rem;
  font-weight: 400;
  margin-top: 4px;
}
.bouc-jeu {
  font-family: var(--sans, Arial, sans-serif);
  isolation: isolate;
  position: relative;
  background: #c8c699;
  border-radius: 24px;
  overflow: hidden;
  height: clamp(530px, 71svh, 740px);
  width: 100%;
  color: var(--b-encre);
  box-shadow: 0 22px 65px #263c3225;
  touch-action: pan-y;
  container-type: inline-size;
}
.bouc-canvas,
.bouc-affiche,
.bouc-vignette {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.bouc-affiche {
  object-fit: cover;
  opacity: 1;
  transition: opacity 0.7s;
}
.bouc-jeu[data-pret] .bouc-affiche {
  opacity: 0;
  pointer-events: none;
}
.bouc-canvas {
  outline: 0;
  touch-action: none;
}
.bouc-canvas:focus-visible {
  outline: 3px solid #fff2c2;
  outline-offset: -5px;
}
.bouc-vignette {
  pointer-events: none;
  background: linear-gradient(
    180deg,
    #294f4525,
    transparent 25%,
    transparent 70%,
    #34423145
  );
}
.bouc-jeu button {
  font-family: inherit;
  cursor: pointer;
}
.bouc-jeu button:focus-visible,
.bouc-jeu a:focus-visible {
  outline: 3px solid #985632;
  outline-offset: 4px;
}
.bouc-jeu button:disabled {
  cursor: wait;
}
.bouc-outils {
  position: absolute;
  top: 19px;
  left: 24px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
  gap: 12px;
}
.bouc-lieu {
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 750;
  color: #263c32;
}
.bouc-lieu i {
  font-style: normal;
  opacity: 0.4;
  margin: 0 7px;
}
.bouc-outils > div {
  display: flex;
  gap: 6px;
}
.bouc-outils button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #fff6;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  background: #fff5dcbd;
  color: #324c3b;
  padding: 0;
  font-size: 24px;
  backdrop-filter: blur(9px);
}
.bouc-outils button:first-child {
  border-radius: 24px;
  width: auto;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
}
.bouc-outils svg {
  width: 17px;
  height: 17px;
}
.bouc-outils button:disabled {
  opacity: 0.4;
  cursor: default;
}
.bouc-outils button[aria-pressed="false"][data-g-son] {
  opacity: 0.65;
}
.bouc-hud {
  position: absolute;
  inset: 82px 27px auto;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.bouc-score small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.16em;
  font-weight: 750;
}
.bouc-score strong {
  font-size: clamp(32px, 5cqw, 54px);
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.bouc-coeurs {
  color: #b35c42;
  letter-spacing: 3px;
  font-size: 22px;
  margin-top: 5px;
  text-shadow: 0 1px #fff8;
}
.bouc-situation {
  text-align: right;
}
.bouc-situation > b {
  display: block;
  font-size: 28px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.bouc-situation small {
  font-size: 11px;
  display: block;
  margin-top: 1px;
}
.bouc-situation > span {
  display: block;
  color: #846124;
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
}
.bouc-bas {
  position: absolute;
  bottom: 20px;
  left: 24px;
  right: 24px;
  z-index: 4;
  pointer-events: none;
}
.bouc-itineraire {
  position: relative;
  display: flex;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 2px solid #fff6;
  margin-bottom: 18px;
  color: #233b2b;
  font-size: 9px;
  letter-spacing: 0.1em;
  font-weight: 700;
  text-transform: uppercase;
}
.bouc-itineraire > i {
  position: absolute;
  left: 0;
  top: -2px;
  background: #365839;
  height: 3px;
  width: 0;
  box-shadow: 0 0 8px #fff4;
  transition: width 0.1s linear;
}
.bouc-commandes {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bouc-action {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #fff6;
  border-bottom: 4px solid #24392f49;
  border-radius: 16px;
  padding: 15px 22px;
  min-height: 76px;
  background: #fff4dce8;
  color: #2f4636;
  box-shadow: 0 5px 16px #29382422;
  pointer-events: auto;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overflow: hidden;
}
.bouc-action:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}
.bouc-action > svg {
  width: 29px;
  height: 29px;
  flex-shrink: 0;
}
.bouc-action > span {
  text-align: left;
  display: block;
  font-weight: 800;
  font-size: 17px;
  line-height: 1.2;
}
.bouc-action small {
  display: block;
  font-size: 10px;
  font-weight: 450;
  margin-top: 3px;
}
.bouc-action kbd {
  margin-left: 18px;
  border: 1px solid #28472e30;
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 10px;
  font-family: inherit;
}
.bouc-ruee {
  background: #e8bb7ee8;
}
.bouc-ruee > i {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #93532e;
  width: 100%;
  pointer-events: none;
}
.bouc-ruee[aria-disabled="true"] {
  filter: saturate(0.45);
}
.bouc-serie {
  text-align: center;
  line-height: 1.1;
  color: #fff8e0;
  text-shadow: 0 1px 6px #3e4b35;
}
.bouc-serie b {
  display: block;
  font-size: 27px;
}
.bouc-serie span {
  font-size: 10px;
  letter-spacing: 0.06em;
}
.bouc-message {
  position: absolute;
  top: 32%;
  left: 50%;
  transform: translate(-50%, -10px);
  opacity: 0;
  background: #fff6e7ec;
  padding: 12px 20px;
  border: 1px solid #fff9;
  border-radius: 14px;
  color: #384d35;
  text-align: center;
  max-width: 440px;
  width: max-content;
  max-width: min(88%, 440px);
  font-size: 13px;
  box-shadow: 0 8px 25px #25372615;
  pointer-events: none;
  transition:
    opacity 0.25s,
    transform 0.25s;
  z-index: 6;
}
.bouc-message.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.bouc-message b {
  display: block;
  font-size: 18px;
  margin-bottom: 3px;
}
.bouc-decompte {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  font-size: 100px;
  font-weight: 750;
  color: #fff7df;
  text-shadow: 0 3px 30px #45533666;
  pointer-events: none;
  z-index: 7;
}
.bouc-decompte small {
  display: block;
  font-size: 15px;
  letter-spacing: 0.09em;
  text-shadow: 0 1px 5px #243a3b;
}
.bouc-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 64px 42px 26px;
  background: linear-gradient(90deg, #e9e0c6df, #e9e0c6b0 34%, transparent 72%);
  z-index: 3;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.bouc-carte {
  max-width: 385px;
  width: 100%;
  position: relative;
  padding: 14px 0;
}
.bouc-surtitre {
  letter-spacing: 0.2em;
  font-size: 10px;
  font-weight: 750;
  color: #697957;
  margin: 0 0 13px;
}
.bouc-carte h2 {
  font-size: clamp(44px, 6cqw, 70px);
  font-weight: 650;
  letter-spacing: -0.055em;
  line-height: 0.98;
  color: #314331;
  margin: 0 0 18px;
}
.bouc-carte > p:not(.bouc-surtitre, .bouc-identite) {
  font-size: 13px;
  line-height: 1.65;
  color: #506049;
  max-width: 330px;
}
.bouc-regles {
  display: flex;
  gap: 25px;
  margin: 21px 0 23px;
}
.bouc-regles > span {
  display: grid;
  grid-template-columns: 25px auto;
  column-gap: 8px;
  align-items: center;
}
.bouc-regles svg {
  width: 24px;
  height: 24px;
  grid-row: span 2;
  color: #805f39;
}
.bouc-regles b {
  font-size: 11px;
  white-space: nowrap;
}
.bouc-regles small {
  font-size: 9px;
  margin-top: 2px;
  white-space: nowrap;
}
.bouc-jouer {
  border: 0;
  border-bottom: 4px solid #233829;
  padding: 15px 22px;
  border-radius: 12px;
  background: #496244;
  color: #fff8df;
  box-shadow: 0 7px 18px #33442721;
  width: 100%;
  max-width: 335px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
  min-height: 54px;
}
.bouc-jouer:hover {
  background: #3b573a;
}
.bouc-jouer:disabled {
  opacity: 0.65;
}
.bouc-identite {
  font-size: 10px !important;
  color: #637059 !important;
  margin: 11px 0 0;
  line-height: 1.4 !important;
}
.bouc-pseudo {
  font-size: 10px;
  color: #546c4b;
  display: inline-block;
  margin-top: 8px;
  text-underline-offset: 3px;
}
.bouc-chargement {
  height: 2px;
  width: 100%;
  max-width: 335px;
  background: #ffffff66;
  margin-top: 9px;
  overflow: hidden;
}
.bouc-chargement i {
  display: block;
  width: 3%;
  height: 100%;
  background: #57724e;
  transition: width 0.3s;
}
.bouc-sous-jeu {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 34px;
  margin: 24px 4px 32px;
  color: #46533f;
  font-size: 12px;
  line-height: 1.7;
}
.bouc-sous-jeu p {
  margin: 0 0 10px;
}
.bouc-sous-jeu b {
  color: #3f5841;
}
.bouc-sous-jeu summary {
  cursor: pointer;
  color: #456441;
  font-weight: 650;
}
.bouc-sous-jeu details p {
  margin-top: 10px;
}
.bouc-sous-jeu kbd {
  font-family: inherit;
  border: 1px solid #d6dbc9;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 11px;
}
.bouc-reglages {
  display: flex;
  gap: 20px;
  align-items: center;
}
.bouc-reglages label {
  display: grid;
  gap: 4px;
  font-size: 12px;
}
.bouc-reglages select {
  font-size: 12px;
  padding: 6px;
  min-height: 36px;
}
.bouc-reglages input {
  accent-color: #54734b;
  max-width: 145px;
}
.bouc-jeu[data-etat="pause"] .bouc-overlay,
.bouc-jeu[data-etat="fin"] .bouc-overlay,
.bouc-jeu[data-etat="erreur"] .bouc-overlay {
  background: #36493675;
  backdrop-filter: blur(7px);
  justify-content: center;
  padding: 68px 20px 22px;
}
.bouc-jeu[data-etat="pause"] .bouc-carte,
.bouc-jeu[data-etat="fin"] .bouc-carte,
.bouc-jeu[data-etat="erreur"] .bouc-carte {
  border: 1px solid #fff8;
  background: #f4eddbef;
  border-radius: 22px;
  padding: 28px;
  text-align: center;
  max-width: 410px;
  box-shadow: 0 20px 50px #20302533;
}
.bouc-jeu[data-etat="pause"] h2,
.bouc-jeu[data-etat="fin"] h2,
.bouc-jeu[data-etat="erreur"] h2 {
  font-size: 38px;
  line-height: 1.08;
  margin-bottom: 12px;
}
.bouc-secondaire {
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
  font-size: 12px;
  padding: 12px;
  color: #53664b;
}
.bouc-resultat {
  font-size: 51px;
  font-weight: 750;
  letter-spacing: -0.05em;
  color: #456244;
  line-height: 1;
  margin: 18px 0;
}
.bouc-resultat small {
  font-size: 12px;
  display: block;
  letter-spacing: 0.05em;
  font-weight: 500;
  margin-top: 5px;
}
.bouc-bilan {
  display: flex;
  justify-content: space-evenly;
  gap: 15px;
  margin: 19px 0;
  color: #506245;
}
.bouc-bilan b {
  display: block;
  font-size: 21px;
}
.bouc-bilan span {
  font-size: 10px;
}
.bouc-etoiles {
  font-size: 28px;
  letter-spacing: 8px;
  color: #ad733a;
  margin: 12px 0;
}
.bouc-statut-score {
  font-size: 11px !important;
  min-height: 30px;
  margin: 10px auto !important;
}
.bouc-jeu[data-etat="course"] .bouc-outils .bouc-lieu {
  opacity: 0.8;
}
.bouc-jeu[data-etat="course"] {
  touch-action: none;
}
.bouc-sans-js {
  position: absolute;
  inset: 40%;
  width: 60%;
  z-index: 20;
  background: #fff;
  padding: 20px;
}
.bouc-jeu [hidden] {
  display: none !important;
}
.bouc-grand {
  position: fixed !important;
  inset: 0 !important;
  z-index: 10000 !important;
  width: 100vw !important;
  height: 100dvh !important;
  border-radius: 0 !important;
}
.bouc-grand .bouc-outils {
  top: max(16px, env(safe-area-inset-top));
}
.bouc-grand .bouc-bas {
  bottom: max(20px, env(safe-area-inset-bottom));
}
.bouc-grand .bouc-sous-jeu {
  display: none;
}
@media (max-width: 700px) {
  .bouc-entete {
    display: block;
    margin-bottom: 17px;
  }
  .bouc-entete > p {
    text-align: left;
    font-size: 12px;
    margin-top: 10px;
  }
  .bouc-entete > p span {
    display: inline;
    margin-left: 8px;
    font-size: 10px;
  }
  .bouc-jeu {
    height: clamp(510px, 73svh, 670px);
    border-radius: 18px;
  }
  .bouc-outils {
    top: 12px;
    left: 15px;
    right: 12px;
  }
  .bouc-lieu {
    font-size: 8px;
    letter-spacing: 0.11em;
  }
  .bouc-outils button {
    width: 36px;
    height: 36px;
  }
  .bouc-outils button:first-child {
    padding: 0 10px;
  }
  .bouc-outils button:first-child span {
    display: none;
  }
  .bouc-hud {
    inset: 65px 18px auto;
  }
  .bouc-score strong {
    font-size: 34px;
  }
  .bouc-score small {
    font-size: 8px;
  }
  .bouc-coeurs {
    font-size: 19px;
  }
  .bouc-situation > b {
    font-size: 25px;
  }
  .bouc-situation small {
    font-size: 10px;
  }
  .bouc-bas {
    bottom: 15px;
    left: 13px;
    right: 13px;
  }
  .bouc-action {
    padding: 13px 14px;
    gap: 7px;
    min-height: 68px;
    border-radius: 14px;
  }
  .bouc-action > svg {
    width: 23px;
    height: 23px;
  }
  .bouc-action > span {
    font-size: 14px;
  }
  .bouc-action small {
    font-size: 8px;
  }
  .bouc-action kbd {
    display: none;
  }
  .bouc-commandes {
    gap: 7px;
  }
  .bouc-serie b {
    font-size: 22px;
  }
  .bouc-serie span {
    font-size: 8px;
  }
  .bouc-itineraire {
    margin-bottom: 14px;
    font-size: 8px;
    letter-spacing: 0.06em;
  }
  .bouc-overlay {
    align-items: end;
    padding: 70px 25px 24px;
    background: linear-gradient(
      0deg,
      #e9e1c8f5,
      #e9e1c8eb 38%,
      #e9e1c89a 68%,
      transparent 94%
    );
  }
  .bouc-carte {
    max-width: 100%;
    padding: 0;
  }
  .bouc-carte h2 {
    font-size: 46px;
    line-height: 0.94;
    margin-bottom: 12px;
  }
  .bouc-carte > p:not(.bouc-surtitre, .bouc-identite) {
    font-size: 12px;
    line-height: 1.5;
  }
  .bouc-carte > p:not(.bouc-surtitre, .bouc-identite) br {
    display: none;
  }
  .bouc-surtitre {
    font-size: 8px;
    margin-bottom: 9px;
  }
  .bouc-regles {
    margin: 17px 0;
    gap: 23px;
  }
  .bouc-regles b {
    font-size: 10px;
  }
  .bouc-regles small {
    font-size: 8px;
  }
  .bouc-jouer {
    max-width: 100%;
    padding: 13px 18px;
    min-height: 51px;
    font-size: 15px;
  }
  .bouc-sous-jeu {
    display: block;
    font-size: 11px;
    margin-top: 19px;
  }
  .bouc-sous-jeu details {
    margin-top: 16px;
  }
  .bouc-message {
    font-size: 11px;
    padding: 10px 14px;
    top: 30%;
    width: max-content;
  }
  .bouc-message b {
    font-size: 15px;
  }
  .bouc-jeu[data-etat="pause"] .bouc-overlay,
  .bouc-jeu[data-etat="fin"] .bouc-overlay,
  .bouc-jeu[data-etat="erreur"] .bouc-overlay {
    align-items: center;
    padding: 62px 16px 16px;
  }
  .bouc-jeu[data-etat="fin"] .bouc-carte {
    padding: 22px;
  }
  .bouc-jeu[data-etat="fin"] h2 {
    font-size: 32px;
  }
  .bouc-etoiles {
    font-size: 23px;
    margin: 8px 0;
  }
  .bouc-resultat {
    font-size: 44px;
    margin: 12px 0;
  }
}
@media (max-width: 360px) {
  .bouc-action {
    padding: 12px 10px;
  }
  .bouc-action > svg {
    width: 18px;
  }
  .bouc-action > span {
    font-size: 13px;
  }
  .bouc-action small {
    font-size: 7px;
  }
  .bouc-serie {
    display: none;
  }
  .bouc-regles {
    gap: 15px;
  }
  .bouc-overlay {
    padding-left: 19px;
    padding-right: 19px;
  }
  .bouc-lieu {
    font-size: 7px;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .bouc-grand .bouc-overlay {
    align-items: center;
    padding: 50px 38px 16px;
    background: linear-gradient(
      90deg,
      #e9e1c8fa,
      #e9e1c8bb 48%,
      transparent 80%
    );
  }
  .bouc-grand .bouc-carte {
    max-width: 340px;
  }
  .bouc-grand .bouc-carte h2 {
    font-size: 38px;
  }
  .bouc-grand .bouc-carte > p:not(.bouc-surtitre, .bouc-identite) {
    display: none;
  }
  .bouc-grand .bouc-regles {
    margin: 12px 0;
  }
  .bouc-grand .bouc-action {
    min-height: 54px;
    padding: 9px 14px;
  }
  .bouc-grand .bouc-itineraire {
    display: none;
  }
  .bouc-grand .bouc-bilan {
    margin: 10px 0;
  }
  .bouc-grand .bouc-resultat {
    margin: 8px 0;
    font-size: 36px;
  }
  .bouc-grand .bouc-etoiles {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bouc-jeu * {
    transition: none !important;
  }
  .bouc-action:active {
    transform: none;
  }
}

.bouc-hud small {
  color: inherit;
}
.bouc-regles small,
.bouc-action small {
  color: inherit;
  opacity: 0.75;
}
.bouc-jeu[data-chapitre="3"] .bouc-hud,
.bouc-jeu[data-chapitre="3"] .bouc-lieu,
.bouc-jeu[data-chapitre="3"] .bouc-itineraire {
  color: #fff2d5;
}
.bouc-jeu[data-chapitre="3"] .bouc-itineraire > i {
  background: #edc58a;
}
.bouc-jeu[data-chapitre="3"] .bouc-coeurs {
  color: #ffb189;
}

.bouc-jeu {
  scroll-margin-top: 80px;
}
.bouc-jeu[data-etat="fin"] .bouc-carte,
.bouc-jeu[data-etat="pause"] .bouc-carte {
  max-height: 100%;
  overflow-y: auto;
}
@media (max-width: 700px) {
  .bouc-jeu[data-etat="fin"] .bouc-carte {
    padding: 20px;
  }
  .bouc-jeu[data-etat="fin"] h2 {
    font-size: 28px;
    line-height: 1.05;
    margin-bottom: 8px;
  }
  .bouc-jeu[data-etat="fin"] .bouc-etoiles {
    font-size: 20px;
    line-height: 1;
    margin: 6px 0;
  }
  .bouc-jeu[data-etat="fin"] .bouc-resultat {
    font-size: 38px;
    margin: 10px 0;
  }
  .bouc-jeu[data-etat="fin"] .bouc-resultat small {
    font-size: 9px;
    color: inherit;
  }
  .bouc-jeu[data-etat="fin"] .bouc-bilan {
    margin: 12px 0;
    line-height: 1.2;
  }
  .bouc-jeu[data-etat="fin"] .bouc-bilan b {
    font-size: 18px;
    margin-bottom: 4px;
  }
  .bouc-jeu[data-etat="fin"] .bouc-bilan span {
    font-size: 9px;
  }
  .bouc-jeu[data-etat="fin"] .bouc-statut-score {
    font-size: 10px !important;
    min-height: 25px;
    margin: 8px auto !important;
  }
  .bouc-jeu[data-etat="fin"] .bouc-secondaire {
    font-size: 11px;
    padding: 8px;
  }
}
/* Garder tout le jeu sous la navigation, même sur un petit téléphone. */
.bouc-jeu {
  max-height: calc(100svh - 86px);
}
.bouc-grand {
  max-height: none !important;
}

/* Lecture de la vitesse et anticipation des obstacles sur téléphone. */
.bouc-vitesse {
  align-self: start;
  text-align: center;
  min-width: 70px;
  margin-top: 2px;
  padding: 7px 12px;
  border: 1px solid #fff8;
  border-radius: 14px;
  background: #fff6dbd9;
  color: #6c4a23;
  box-shadow: 0 4px 20px #53331612;
}
.bouc-vitesse b {
  display: block;
  font-size: clamp(21px, 3cqw, 30px);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.bouc-vitesse small {
  font-size: 8px;
  letter-spacing: 0.16em;
  font-weight: 800;
}
.bouc-vitesse > i {
  display: block;
  height: 3px;
  background: #dac7a4;
  margin-top: 6px;
  border-radius: 3px;
  overflow: hidden;
}
.bouc-vitesse em {
  display: block;
  height: 100%;
  background: #c77935;
}
.bouc-danger {
  position: absolute;
  z-index: 5;
  bottom: 125px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 18px;
  border: 1px solid #fff7;
  border-radius: 12px;
  background: #314a38ed;
  color: #fff4d6;
  box-shadow: 0 5px 22px #15251b2b;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}
.bouc-danger b {
  font-size: 17px;
  display: block;
  line-height: 1.2;
}
.bouc-danger span {
  display: block;
  font-size: 10px;
  opacity: 0.85;
  margin-top: 2px;
}
.bouc-danger[data-proche="true"] {
  background: #8b4d29f0;
}
.bouc-jeu [hidden] {
  display: none !important;
}
@container (max-width: 480px) {
  .bouc-vitesse {
    min-width: 60px;
    padding: 6px 8px;
  }
  .bouc-vitesse b {
    font-size: 21px;
  }
  .bouc-danger {
    bottom: 112px;
    padding: 6px 14px;
  }
  .bouc-danger b {
    font-size: 15px;
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  .bouc-danger {
    bottom: 92px;
  }
}

.bouc-serie {
  flex: 0 0 55px;
}
.bouc-serie span {
  display: block;
  max-width: 55px;
  margin: 4px auto 0;
}

/* Le téléphone se joue en paysage ; la rotation ne consomme ni temps ni cœur. */
.bouc-orientation {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  background: #f3ecd9;
  color: #304b39;
}
.bouc-orientation svg { width: 110px; height: 88px; margin-bottom: 14px; }
.bouc-orientation h2 { font-size: 30px; line-height: 1.1; margin: 0 0 15px; }
.bouc-orientation p { font-size: 15px; line-height: 1.6; }
.bouc-orientation button { margin-top: 20px; font-size: 15px; }
.bouc-jeu[data-etat="course"] .bouc-outils button { backdrop-filter: none; background: #fff4d9eb; }
@media (pointer: coarse) and (orientation: landscape) {
  .bouc-grand .bouc-outils { top: max(8px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right)); }
  .bouc-grand .bouc-hud { top: 55px; left: max(22px, env(safe-area-inset-left)); right: max(22px, env(safe-area-inset-right)); }
  .bouc-grand .bouc-score strong { font-size: 30px; }
  .bouc-grand .bouc-coeurs { font-size: 18px; margin-top: 2px; }
  .bouc-grand .bouc-bas { left: max(18px, env(safe-area-inset-left)); right: max(18px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); }
  .bouc-grand .bouc-commandes { justify-content: space-between; }
  .bouc-grand .bouc-action { padding: 10px 20px; min-height: 58px; font-size: 19px; }
  .bouc-grand .bouc-action svg { width: 26px; height: 26px; }
  .bouc-grand .bouc-action kbd { display: none; }
  .bouc-grand .bouc-danger { bottom: 85px; padding: 5px 14px; }
  .bouc-grand .bouc-message { top: 12px; max-width: 38%; padding: 6px 10px; font-size: 11px; line-height: 1.25; }
  .bouc-grand .bouc-lieu { max-width: 24%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
  .bouc-grand .bouc-vitesse { padding: 4px 10px; }
  .bouc-grand .bouc-vitesse b { font-size: 23px; }
  .bouc-grand .bouc-situation { font-size: 11px; }
}

.bouc-orientation small { margin-top: 14px; font-size: 13px; color: #46533f; }
.bouc-jeu:not(.bouc-grand) [data-g-quitter-paysage] { display: none; }

/* Vue plongeante : les commandes bordent le paysage, la diagonale reste libre. */
.bouc-jeu[data-etat="course"] .bouc-lieu { display: none; }
.bouc-jeu[data-etat="course"] .bouc-outils { left: auto; }
.bouc-jeu .bouc-hud { inset: max(14px, env(safe-area-inset-top)) auto auto max(18px, env(safe-area-inset-left)); gap: 14px; align-items: center; background: #304b39e8; color: #fff7df; padding: 9px 15px; border: 1px solid #fff7; border-radius: 18px; z-index: 5; }
.bouc-jeu .bouc-score { display: flex; flex-direction: row-reverse; align-items: center; gap: 14px; }
.bouc-jeu .bouc-score strong { font-size: 27px; line-height: 1; }
.bouc-jeu .bouc-score > small { display: none; }
.bouc-jeu .bouc-coeurs { font-size: 21px; color: #f3a17f; margin: 0; white-space: nowrap; }
.bouc-jeu .bouc-vitesse { min-width: 0; padding: 0 0 0 12px; margin: 0; background: none; color: #fff7df; border: 0; border-left: 1px solid #fff5; border-radius: 0; box-shadow: none; }
.bouc-jeu .bouc-vitesse b { font-size: 16px; }
.bouc-jeu .bouc-vitesse small { font-size: 7px; }
.bouc-jeu .bouc-vitesse > i { display: none; }
.bouc-jeu .bouc-situation { position: absolute; left: 8px; top: calc(100% + 6px); text-align: left; color: #304b39; }
.bouc-jeu .bouc-situation > small { display: none; }
.bouc-jeu .bouc-situation > span:not(:empty) { background: #fff7dfed; padding: 5px 10px; border-radius: 20px; margin: 0; }
.bouc-jeu .bouc-danger { left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); padding: 6px 14px; border-radius: 24px; box-shadow: none; }
.bouc-jeu .bouc-danger b { font-size: 14px; }
.bouc-jeu .bouc-danger span { font-size: 10px; }
.bouc-jeu .bouc-message { top: 16px; left: 50%; max-width: 30%; font-size: 12px; padding: 8px 12px; }
.bouc-jeu .bouc-serie { position: absolute; bottom: 68px; right: 12px; background: #fff7dfe8; border-radius: 12px; padding: 5px 8px; }
.bouc-jeu .bouc-serie b { font-size: 19px; }
.bouc-jeu .bouc-serie { color: #304b39; text-shadow: none; }
.bouc-jeu .bouc-serie span { font-size: 8px; }
.bouc-jeu .bouc-commandes { justify-content: space-between; }
.bouc-jeu .bouc-action { min-height: 62px; border-radius: 32px; padding: 10px 19px; background: #304b39ed; color: #fff7df; }
.bouc-jeu .bouc-action small { font-size: 9px; }
.bouc-jeu .bouc-action kbd { display: none; }
.bouc-jeu .bouc-action > svg { width: 24px; height: 24px; }
@media (pointer: coarse) and (orientation: landscape) {
  .bouc-grand .bouc-hud { top: max(9px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); right: auto; padding: 7px 12px; gap: 10px; }
  .bouc-grand .bouc-score strong { font-size: 23px; }
  .bouc-grand .bouc-coeurs { font-size: 18px; }
  .bouc-grand .bouc-vitesse { padding: 0 0 0 10px; }
  .bouc-grand .bouc-vitesse b { font-size: 15px; }
  .bouc-grand .bouc-outils { left: auto; }
  .bouc-grand .bouc-outils button { width: 34px; height: 34px; }
  .bouc-grand .bouc-outils button:first-child { padding: 0 8px; }
  .bouc-grand .bouc-outils button span { display: none; }
  .bouc-grand .bouc-action { min-height: 54px; padding: 8px 15px; }
  .bouc-grand .bouc-action small { display: none; }
  .bouc-grand .bouc-action > span { font-size: 15px; }
  .bouc-grand .bouc-danger { bottom: max(12px, env(safe-area-inset-bottom)); padding: 5px 12px; }
  .bouc-grand .bouc-message { top: 85px; left: max(16px, env(safe-area-inset-left)); transform: none; max-width: 27%; font-size: 10px; text-align: left; }
  .bouc-grand .bouc-serie { bottom: 62px; }
}

/* Trois gestes accessibles au pouce, sans masquer le chemin devant le bouc. */
.bouc-jeu .bouc-commandes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.bouc-jeu .bouc-action { min-width: 0; justify-content: center; }
.bouc-jeu .bouc-glisse { background: #29483e; color: #fff4d9; }
.bouc-jeu .bouc-glisse[data-active="true"] { background: #95632d; box-shadow: 0 0 22px #ffc76866; }
.bouc-jeu .bouc-danger { bottom: max(86px, calc(env(safe-area-inset-bottom) + 80px)); }
@media (max-height: 520px) and (orientation: landscape) {
  .bouc-jeu .bouc-danger { bottom: max(72px, calc(env(safe-area-inset-bottom) + 66px)); }
  .bouc-jeu .bouc-commandes { gap: 8px; }
}
