/* Jeu « L'Écho du Tambour » / « Drum Echo » (fichier écrit par outils/jeu-echo-du-tambour.mjs, ne pas modifier à la main).
   Mobile d'abord ; plateau bleu nuit (écran clair, jamais tout noir) ; la chute du masque reprend celle de la galerie. */
.et-haut { padding-top: clamp(24px, 5vw, 48px); }
.et-chapeau { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.et-chapeau > span { flex: 1; min-width: 0; }
.et-ico { width: 24px; height: 24px; flex: none; }

/* Boutons haut-parleur (module voix.js) et réglages */
.et-hp.voix-bouton, .et-outil { flex: none; width: 48px; height: 48px; min-width: 48px; padding: 0; border-radius: 50%; }
.et-hp:empty:not(.voix-bouton) { display: none; }
.et-outils { display: flex; gap: 8px; }
.et-outil { display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--bord-fort); background: rgba(255, 248, 230, .08); color: var(--or); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.et-outil:hover { background: rgba(255, 248, 230, .16); }
.et-outil:focus-visible, .et-mode:focus-visible, .et-chrono:focus-visible, .et-action:focus-visible, .et-tambour:focus-visible, .et-hp:focus-visible { outline: 3px solid var(--creme); outline-offset: 3px; }
.et-outil .et-ico { width: 26px; height: 26px; }
.et-barre-son { display: none; }
.et-outil--sons[aria-pressed="false"] { color: var(--texte-doux); }
.et-outil--sons[aria-pressed="false"] .et-barre-son { display: inline; }

/* Le plateau */
.et-plateau {
  position: relative; max-width: 580px; margin: 0 auto; scroll-margin-bottom: 8px; padding: 12px 12px 16px; border-radius: 28px; isolation: isolate;
  background: radial-gradient(130% 90% at 50% 0%, #34477f 0%, #223164 45%, #18234a 100%);
  border: 2px solid rgba(243, 212, 138, .38); box-shadow: var(--ombre); transition: border-color .3s ease, box-shadow .3s ease;
}
.et-plateau[data-mode="deux"][data-main="0"] { border-color: #6fb0ff; box-shadow: var(--ombre), 0 0 0 3px rgba(111, 176, 255, .35); }
.et-plateau[data-mode="deux"][data-main="1"] { border-color: #ffa04a; box-shadow: var(--ombre), 0 0 0 3px rgba(255, 160, 74, .35); }
.et-haut-plateau { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; }
.et-etat { display: flex; align-items: center; gap: 10px; min-width: 0; }
.et-quoi { display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 248, 230, .1); color: var(--or); }
.et-quoi .et-ico { width: 30px; height: 30px; display: none; }
.et-plateau[data-etat="ecoute"] .et-quoi--ecoute { display: block; animation: et-respire 1.2s ease-in-out infinite; }
.et-plateau[data-etat="a-toi"] .et-quoi--toi { display: block; }
.et-plateau:not([data-etat="ecoute"]):not([data-etat="a-toi"]) .et-quoi { visibility: hidden; }
.et-long { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 10px; border-radius: 999px; background: rgba(18, 13, 10, .55); border: 2px solid var(--bord-fort); }
.et-long b { font: 800 1.35rem/1 var(--police-titre); color: var(--creme); font-variant-numeric: tabular-nums; }
.et-main { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 4px 12px 4px 8px; border-radius: 999px; font: 800 .95rem/1.1 var(--police-titre); color: var(--encre); }
.et-main[data-main="0"] { background: #6fb0ff; }
.et-main[data-main="1"] { background: #ffa04a; }
.et-main[hidden], .et-long[hidden] { display: none; }

/* Les points du rythme : un point par coup */
.et-points { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-height: 18px; margin: 6px auto 2px; padding: 0; max-width: 460px; }
.et-points li { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(243, 212, 138, .55); background: transparent; transition: background-color .15s ease, transform .15s ease; }
.et-points li.vu { background: var(--or); transform: scale(1.25); }
.et-points li.plein { background: var(--c, var(--or)); border-color: var(--creme); }
.et-points.reussi li { background: var(--or); border-color: var(--or); animation: et-sautille .5s ease; }
.et-points.secoue { animation: et-hesite .5s ease; }

/* Message (lu à voix haute avec le haut-parleur) */
.et-ligne-msg { display: flex; align-items: center; gap: 8px; min-height: 3.6em; max-width: 520px; margin: 0 auto 8px; }
.et-message { flex: 1; min-width: 0; margin: 0; font: 800 clamp(1.02rem, 3.6vw, 1.2rem)/1.3 var(--police-titre); color: var(--creme); text-align: center; }

/* Défi chrono : une barre qui se vide, sans chiffres */
.et-barre { height: 10px; max-width: 420px; margin: 0 auto 10px; border-radius: 99px; background: rgba(255, 248, 230, .15); overflow: hidden; }
.et-barre span { display: block; height: 100%; width: 100%; background: var(--or); border-radius: inherit; transform-origin: 0 50%; }

/* Les tambours : 2 x 2, à la hauteur de l'écran sur ordinateur */
.et-tambours { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 4vw, 26px); width: min(100%, max(280px, calc(100vh - 330px))); margin: 4px auto 0; }
@supports (height: 100svh) { .et-tambours { width: min(100%, max(280px, calc(100svh - 330px))); } }
.et-case { aspect-ratio: 1; min-width: 0; }
.et-tambour {
  position: relative; display: block; width: 100%; height: 100%; padding: 0; margin: 0; border: 0; border-radius: 50%; cursor: pointer; color: inherit; font: inherit;
  -webkit-appearance: none; appearance: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
  background: repeating-conic-gradient(from 6deg, #e0b04a 0 5deg, #7d3326 5deg 18deg);
  box-shadow: inset 0 0 0 3px #e0b04a, inset 0 0 0 7px #5c241b, 0 7px 0 #4a1c14, 0 14px 26px -8px rgba(0, 0, 0, .7);
  transition: transform .08s ease, box-shadow .08s ease;
}
.et-plateau[data-etat="ecoute"] .et-tambour, .et-plateau[data-etat="pause"] .et-tambour { cursor: default; }
.et-peau {
  position: absolute; inset: 9%; border-radius: 50%; background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, .38), transparent 62%), var(--c);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25), inset 0 -8px 16px rgba(0, 0, 0, .25); transition: filter .12s ease, box-shadow .12s ease;
}
.et-portrait { position: absolute; inset: 11% 11% 15%; border-radius: 50%; overflow: hidden; background: #1b2850; box-shadow: 0 0 0 3px rgba(18, 13, 10, .55); transition: box-shadow .4s ease; }
.et-p { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; -webkit-user-drag: none; }
.et-p--m { z-index: 2; transform-origin: 50% 0; transition: transform .8s cubic-bezier(.55, -0.3, .7, 1), opacity .45s ease .32s; }
.et-p--e { z-index: 1; transform: scale(1.07); filter: brightness(.45) saturate(.6); transition: transform 1s cubic-bezier(.2, .8, .2, 1) .2s, filter .7s ease .2s; }
.et-tambour.est-eveille .et-p--m { transform: translateY(40%) rotate(-8deg) scale(.92); opacity: 0; }
.et-tambour.est-eveille .et-p--e { transform: none; filter: none; }
.et-tambour.est-eveille .et-portrait { box-shadow: 0 0 0 3px var(--or), 0 0 18px rgba(243, 212, 138, .6); }
.et-tambours.sans-transition .et-p { transition: none !important; }
.et-sym { position: absolute; left: 50%; bottom: -3%; width: 26%; aspect-ratio: 1; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--c); color: #fff; box-shadow: 0 0 0 3px rgba(18, 13, 10, .7); z-index: 3; }
/* deux symboles : Tambour (le type de tous les batteurs) et le type de son son */
.et-sym--tambour { left: 30%; background: #8C3B2E; }
.et-sym--son { left: 70%; }
.et-sym__ico { width: 64%; height: 64%; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .55)); }
.et-ondes, .et-ondes::before { position: absolute; inset: 0; border-radius: 50%; pointer-events: none; }
.et-ondes::before { content: ""; border: 5px solid var(--c); opacity: 0; }
.et-tambour.est-allume { transform: translateY(3px) scale(.97); box-shadow: inset 0 0 0 3px #fff3c4, inset 0 0 0 7px #5c241b, 0 4px 0 #4a1c14, 0 0 34px 6px var(--c); }
.et-tambour.est-allume .et-peau { filter: brightness(1.35) saturate(1.25); box-shadow: inset 0 0 0 4px #fff8e6, 0 0 26px 6px var(--c); }
.et-tambour.est-allume .et-portrait { animation: et-saut .32s ease; }
.et-tambour.onde .et-ondes::before { animation: et-onde .7s ease-out; }
.et-tambour.est-indice .et-peau { animation: et-indice 1.1s ease-in-out infinite; }
.et-plateau.salue .et-portrait, .et-tambour.salue .et-portrait { animation: et-salut 1s ease; }

/* Actions pendant le jeu, et choix de l'écho */
.et-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 460px; margin: 18px auto 0; }
.et-actions[hidden] { display: none; }
.et-action {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 64px; padding: 6px 4px;
  border: 2px solid var(--bord-fort); border-radius: 16px; background: rgba(255, 248, 230, .08); color: var(--creme); cursor: pointer;
  font: 800 .86rem/1.1 var(--police-texte); touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.et-action .et-ico { width: 30px; height: 30px; color: var(--or); }
.et-action:hover { background: rgba(255, 248, 230, .16); }
.et-action[aria-disabled="true"] { opacity: .45; cursor: default; }
.et-action--fin .et-ico { color: var(--texte-doux); }
.et-depart { margin: 18px auto 0; max-width: 520px; text-align: center; }
.et-depart[hidden] { display: none; }
.et-depart__titre { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 10px; font: 800 1.15rem/1.2 var(--police-titre); color: var(--creme); }
.et-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.et-mode {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 112px; padding: 10px 4px;
  border: 2px solid var(--bord-fort); border-radius: 20px; background: rgba(255, 248, 230, .1); color: var(--creme); cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; transition: background-color .15s ease, transform .1s ease;
}
.et-mode:hover { background: rgba(255, 248, 230, .18); }
.et-mode:active { transform: translateY(2px); }
.et-mode__ico { width: 46px; height: 46px; color: var(--or); }
.et-mode b { font: 800 1.08rem/1.1 var(--police-titre); }
.et-mode__rec { display: inline-flex; align-items: center; gap: 4px; min-height: 1.2em; font: 700 .84rem/1.2 var(--police-texte); color: var(--texte-doux); }
.et-mode__rec svg { width: 16px; height: 16px; }
.et-chrono {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; margin-top: 12px; padding: 6px 16px; border: 2px solid var(--bord); border-radius: 999px;
  background: transparent; color: var(--texte-doux); font: 800 .95rem/1 var(--police-texte); cursor: pointer; touch-action: manipulation;
}
.et-chrono[aria-pressed="true"] { background: var(--or); border-color: var(--or); color: var(--encre); }

/* Voiles : chute du masque, concentration, salut (par-dessus le plateau) */
.et-voile {
  position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 18px 14px;
  border-radius: 26px; background: rgba(20, 29, 60, .94); text-align: center; animation: et-apparait .3s ease;
}
.et-voile[hidden] { display: none; }
.et-voile__titre { margin: 0; font: 800 clamp(1.25rem, 5vw, 1.6rem)/1.25 var(--police-titre); color: var(--creme); max-width: 22ch; }
.et-voile__titre:focus { outline: none; }
.et-gros { display: inline-flex; align-items: center; gap: 10px; min-height: 60px; padding: .5em 1.6em; font-size: 1.15rem; }
.et-gros .et-ico { width: 28px; height: 28px; }
.et-petit { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; }
.et-petit .et-ico { width: 20px; height: 20px; }
.et-chute__carte {
  position: relative; width: min(62%, 240px); aspect-ratio: 360 / 504; border-radius: 5.1% / 3.65%; overflow: hidden; isolation: isolate;
  box-shadow: var(--ombre), 0 0 0 1px var(--bord); background: var(--fond-3);
}
.et-chute__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.et-chute__m { z-index: 2; transform-origin: 50% 0; transition: transform .9s cubic-bezier(.55, -0.3, .7, 1) .2s, opacity .45s ease .55s; }
.et-chute__e { z-index: 1; transform: scale(1.07); filter: brightness(.45) saturate(.6); transition: transform 1s cubic-bezier(.2, .8, .2, 1) .4s, filter .7s ease .4s; }
.et-chute__carte::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(circle at 50% 30%, rgba(255, 236, 170, .7), transparent 62%); opacity: 0; }
.et-chute__carte.est-eveille .et-chute__m { transform: translateY(32%) rotate(-7deg) scale(.92); opacity: 0; }
.et-chute__carte.est-eveille .et-chute__e { transform: none; filter: none; }
.et-chute__carte.est-eveille::after { animation: eclat 1s ease-out .45s; }
.et-chute__carte.est-eveille { box-shadow: var(--ombre), 0 0 0 2px var(--or), 0 0 40px rgba(243, 212, 138, .55); transition: box-shadow .6s ease .6s; }
.et-concentre__portrait { width: min(52%, 200px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 4px var(--or); animation: et-concentre 1.5s ease-in-out infinite; }
.et-concentre__portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.et-salut__mains { margin: 0; }
.et-salut__ico { width: 110px; height: 110px; }
.et-salut__aide { margin: 0; color: var(--texte-doux); font-size: .95rem; max-width: 30ch; }
.et-plateau.salue .et-salut__ico { animation: et-salut 1s ease; }

/* Fin de l'écho */
.et-fin { max-width: 580px; margin: 16px auto 0; padding: clamp(16px, 4vw, 26px); text-align: center; background: var(--fond-2); border: 1px solid var(--bord-fort); border-radius: var(--rayon); box-shadow: var(--ombre); }
.et-fin__repos { margin: 0 0 10px; font: 800 1.2rem/1.35 var(--police-titre); color: var(--or); }
.et-fin__titre { display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; font-size: clamp(1.5rem, 5vw, 2.1rem); margin: 0 0 .3em; }
.et-fin__titre:focus { outline: none; }
.et-fin__titre > svg, .et-fin__titre .et-loupe svg { width: 1.1em; height: 1.1em; flex: none; color: var(--or); }
.et-fin__ligne { margin: 0 0 .4em; font-weight: 700; color: var(--creme); }
.et-fin__ligne:empty { display: none; }
.et-fin__salut { font-style: italic; color: var(--texte-doux); }
.et-loupe { display: inline-flex; vertical-align: middle; }
.et-loupe svg { width: 1em; height: 1em; }
.et-fin__h3 { font-size: 1.05rem; margin: 18px 0 10px; }
.et-fin__h3[hidden], .et-reveilles:empty { display: none; }
.et-reveilles { list-style: none; margin: 0 auto; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 130px), 1fr)); text-align: left; }
.et-reveilles li { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px; background: var(--fond-3); border: 1px solid var(--bord); border-radius: 12px; }
.et-reveilles img { flex: none; width: 40px; height: auto; border-radius: 4px; }
.et-reveilles b { display: block; font: 800 .95rem/1.15 var(--police-titre); color: var(--creme); overflow-wrap: anywhere; }
.et-reveilles small { display: block; font-size: .76rem; color: var(--texte-doux); }
.et-fin__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 18px 0 0; }
.et-fin__carnet { display: inline-flex; align-items: center; gap: 8px; }
.et-fin__carnet[hidden] { display: none; }
/* « <Nom> entre dans ton Carnet ! » (seulement la première fois) */
.et-carnet { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 14px; border-radius: 14px; background: rgba(243, 212, 138, .14); border: 1px solid var(--bord-fort); font: 800 1rem/1.3 var(--police-titre); color: var(--creme); max-width: 30ch; text-align: left; animation: et-apparait .4s ease; }
.et-carnet[hidden] { display: none; }
.et-carnet .et-ico { color: var(--or); }
.et-chute { overflow-y: auto; }
.et-chute:has(.et-carnet:not([hidden])) .et-chute__carte { width: min(50%, 210px); }
.et-repli { padding: 14px 16px; background: var(--fond-2); border: 1px solid var(--bord); border-radius: 14px; }

/* Comment jouer, liens */
.et-regles { margin-top: clamp(36px, 6vw, 56px); max-width: 72ch; }
.et-regles h2 { display: flex; align-items: center; gap: 10px; font-size: clamp(1.4rem, 3.6vw, 1.8rem); }
.et-regles ol { padding-left: 1.3em; margin: 0; }
.et-regles li { margin-bottom: .45em; }
.et-hors { margin: 14px 0 0; color: var(--texte-doux); }
.et-liens { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; }
.et-parents { margin: 18px 0 0; font-size: .88rem; }
.et-parents a { color: var(--texte-doux); }

@keyframes et-onde { 0% { opacity: .9; transform: scale(.92); } 100% { opacity: 0; transform: scale(1.32); } }
@keyframes et-saut { 0%, 100% { transform: none; } 45% { transform: translateY(-7%) scale(1.04); } }
@keyframes et-indice { 0%, 100% { box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25), 0 0 0 0 rgba(255, 248, 230, 0); filter: none; } 50% { box-shadow: inset 0 0 0 4px #fff8e6, 0 0 0 7px rgba(255, 248, 230, .55); filter: brightness(1.2); } }
@keyframes et-salut { 0%, 100% { transform: none; } 35% { transform: translateY(8%) rotate(-4deg) scale(.96); } 65% { transform: translateY(2%); } }
@keyframes et-respire { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes et-sautille { 0%, 100% { transform: none; } 50% { transform: translateY(-5px); } }
@keyframes et-hesite { 0%, 100% { transform: none; } 30% { transform: translateX(-5px); } 70% { transform: translateX(5px); } }
@keyframes et-concentre { 0%, 100% { transform: scale(1); box-shadow: 0 0 0 4px var(--or), 0 0 0 0 rgba(243, 212, 138, .5); } 50% { transform: scale(1.05); box-shadow: 0 0 0 4px var(--or), 0 0 0 18px rgba(243, 212, 138, 0); } }
@keyframes et-apparait { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 700px) {
  .et-plateau { padding: 16px 22px 22px; }
  .et-action { font-size: .95rem; }
}
@media (prefers-reduced-motion: reduce) {
  .et-p, .et-chute__img, .et-tambour, .et-peau { transition: opacity .25s ease !important; }
  .et-p, .et-chute__img { transform: none !important; }
  .et-tambour.est-allume { transform: none; }
  .et-tambour.est-allume .et-portrait, .et-tambour.onde .et-ondes::before, .et-plateau.salue .et-portrait, .et-plateau.salue .et-salut__ico,
  .et-points.reussi li, .et-points.secoue, .et-concentre__portrait, .et-quoi .et-ico, .et-chute__carte::after, .et-voile { animation: none !important; }
  .et-tambour.est-indice .et-peau { animation: none; box-shadow: inset 0 0 0 5px #fff8e6, 0 0 0 7px rgba(255, 248, 230, .7); }
}
