@font-face{font-family:"Fraunces";font-weight:500 700;font-display:swap;src:url("polices/fraunces-latin.woff2?v=5b223e46") format("woff2")}
@font-face{font-family:"Figtree";font-weight:400 700;font-display:swap;src:url("polices/figtree-latin.woff2?v=5b223e46") format("woff2")}
:root{--encre:#221C35;--creme:#FFF8EE;--petit:#FFC233;--grand:#3F74E8;--corail:#F0522F}
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%;overflow:hidden;background:#86CFF0;overscroll-behavior:none}
body{font-family:"Figtree",system-ui,sans-serif;color:var(--encre);-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none;touch-action:none}
button{font:inherit;color:inherit;border:0;background:none;cursor:pointer}
[hidden]{display:none!important}
#scene{position:fixed;inset:0;width:100%;height:100%;display:block}

/* ---------- Accueil ---------- */
#accueil{position:fixed;inset:0;display:flex;flex-direction:column;align-items:center;padding:clamp(10px,5vh,56px) 20px 0;text-align:center;transition:opacity .35s,visibility .35s}
body:not([data-etat="accueil"]) #accueil{opacity:0;visibility:hidden;pointer-events:none}
h1{font-family:"Fraunces",Georgia,serif;font-variation-settings:"SOFT" 100;font-weight:700;font-size:clamp(44px,13.5vh,128px);line-height:.95;letter-spacing:-.025em;color:#fff;text-shadow:0 .045em 0 var(--encre),0 .1em .22em rgba(34,28,53,.25);-webkit-text-stroke:.05em var(--encre);paint-order:stroke fill}
.quoi{margin-top:clamp(8px,2.2vh,20px);font-size:clamp(15px,2.6vh,21px);font-weight:600;line-height:1.35;max-width:36em;text-wrap:balance}
.choix{display:flex;gap:clamp(10px,2vw,22px);margin-top:clamp(12px,3.4vh,34px);justify-content:center;flex-wrap:nowrap}
.jouer{display:grid;grid-template-columns:auto auto;grid-template-rows:auto auto;align-items:center;justify-content:center;column-gap:14px;row-gap:clamp(4px,1vh,10px);min-width:min(300px,43vw);padding:clamp(10px,2vh,18px) clamp(16px,2.2vw,30px) clamp(10px,1.8vh,16px);border-radius:999px;background:var(--encre);color:#fff;box-shadow:0 6px 0 rgba(34,28,53,.28);transition:transform .12s,box-shadow .12s,background .12s}
.jouer:hover{background:#34294F;transform:translateY(-2px);box-shadow:0 8px 0 rgba(34,28,53,.28)}
.jouer:active{transform:translateY(4px);box-shadow:0 2px 0 rgba(34,28,53,.28)}
.jouer:focus-visible,.plein:focus-visible,.creux:focus-visible,.rondelle:focus-visible,#pierres button:focus-visible,#b-langue:focus-visible,#pied a:focus-visible{outline:4px solid #fff;outline-offset:3px}
.jouer .titre{font-weight:700;font-size:clamp(18px,3.2vh,25px);white-space:nowrap}
.tetes{display:flex;align-items:flex-end;gap:5px;justify-self:end}.jouer .titre{justify-self:start}
.tetes i{display:block;border-radius:50% 50% 46% 46%/58% 58% 42% 42%;position:relative}
.tetes i::before,.tetes i::after{content:"";position:absolute;top:38%;width:22%;aspect-ratio:1/1.25;border-radius:50%;background:#fff;box-shadow:inset -2px 1px 0 3px var(--encre)}
.tetes i::before{left:22%}.tetes i::after{right:18%}
.tetes .petit{width:28px;height:30px;background:var(--petit)}
.tetes .grand{width:34px;height:42px;background:var(--grand)}
.comment{grid-column:1/-1;display:flex;align-items:center;justify-content:center;gap:6px;font-size:clamp(12.5px,2vh,15px);font-weight:500;color:#D9D3EA;white-space:nowrap;min-height:26px}
.comment kbd{display:inline-grid;place-items:center;min-width:24px;height:24px;padding:0 6px;border-radius:7px;background:#fff;color:var(--encre);font:700 13px "Figtree",system-ui,sans-serif;box-shadow:0 2px 0 #A9A3BD}
.comment .pastille{display:inline-block;width:11px;height:11px;border-radius:50%;margin-right:1px}
.comment .ou{opacity:.7;margin:0 2px}
.comment .sep{width:1px;height:18px;background:rgba(255,255,255,.28);margin:0 6px}
.chemin{margin-top:clamp(10px,3vh,30px)}
.etape{font-size:clamp(13.5px,2.2vh,17px);font-weight:700;min-height:1.4em;text-shadow:0 1px 0 rgba(255,255,255,.5)}
#pierres{list-style:none;display:flex;justify-content:center;gap:clamp(4px,1vw,12px);margin-top:clamp(4px,1vh,10px)}
#pierres button{position:relative;width:clamp(34px,5.6vh,48px);aspect-ratio:1;border-radius:46% 54% 50% 50%/54% 48% 52% 46%;background:rgba(255,255,255,.72);font-weight:700;font-size:clamp(14px,2.3vh,18px);box-shadow:0 4px 0 rgba(34,28,53,.22);transition:transform .12s,background .12s}
#pierres li:nth-child(even) button{translate:0 7px;border-radius:54% 46% 48% 52%/48% 54% 46% 52%}
#pierres button:hover{transform:translateY(-3px);background:#fff}
#pierres button.fait{background:var(--petit)}
#pierres button[aria-current="true"]{background:var(--encre);color:#fff;transform:scale(1.14)}
#pierres button.fait::after{content:"";position:absolute;right:-5px;top:-6px;width:17px;height:17px;background:#fff;clip-path:polygon(50% 0,63% 34%,100% 38%,72% 62%,81% 100%,50% 79%,19% 100%,28% 62%,0 38%,37% 34%)}

/* ---------- Bandeau du jeu ---------- */
#haut{position:fixed;left:0;right:0;top:0;display:flex;align-items:flex-start;justify-content:space-between;padding:max(12px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) 0 max(14px,env(safe-area-inset-left));pointer-events:none;transition:opacity .3s}
body:not([data-etat="jeu"]):not([data-etat="pause"]) #haut{opacity:0;visibility:hidden}
#haut>*{pointer-events:auto}
#haut .droite,#pied .droite{display:flex;gap:10px;align-items:center}
.rondelle{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.86);box-shadow:0 3px 0 rgba(34,28,53,.2);transition:transform .12s,background .12s}
.rondelle:hover{background:#fff;transform:translateY(-1px)}
.rondelle svg{width:24px;height:24px;fill:none;stroke:var(--encre);stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.rondelle .barre{display:none}
body.muet .rondelle .ondes{display:none}
body.muet .rondelle .barre{display:block}
#ou{display:flex;flex-direction:column;align-items:center;gap:7px;padding-top:6px;pointer-events:none}
#points{list-style:none;display:flex;gap:7px;padding:8px 12px;border-radius:999px;background:rgba(255,255,255,.7)}
#points li{width:9px;height:9px;border-radius:50%;background:rgba(34,28,53,.22)}
#points li.fait{background:var(--petit)}
#points li.ici{background:var(--encre);transform:scale(1.35)}
#annonce{font-family:"Fraunces",Georgia,serif;font-variation-settings:"SOFT" 100;font-weight:600;font-size:clamp(18px,3.4vh,27px);color:#fff;text-shadow:0 2px 0 var(--encre),0 0 12px rgba(34,28,53,.35);-webkit-text-stroke:3px var(--encre);paint-order:stroke fill;opacity:0;transition:opacity .5s}
#annonce.vu{opacity:1}

/* ---------- Pause et fin ---------- */
.voile{position:fixed;inset:0;display:grid;place-items:center;padding:20px;background:rgba(34,28,53,.5)}
.voile.clair{background:none;place-items:start center;padding-top:clamp(14px,7vh,70px)}
.carton{display:flex;flex-direction:column;gap:12px;align-items:stretch;min-width:min(330px,86vw);padding:28px 30px 30px;border-radius:44px 40px 46px 38px/40px 46px 38px 44px;background:var(--creme);text-align:center;box-shadow:0 10px 0 rgba(34,28,53,.25)}
.carton h2,.bravo h2{font-family:"Fraunces",Georgia,serif;font-variation-settings:"SOFT" 100;font-weight:700}
.carton h2{font-size:34px;margin-bottom:6px}
.plein,.creux{height:54px;padding:0 28px;border-radius:999px;font-weight:700;font-size:18px;transition:transform .12s,background .12s}
.plein{background:var(--encre);color:#fff}.plein:hover{background:#34294F}
.creux{background:rgba(34,28,53,.08)}.creux:hover{background:rgba(34,28,53,.14)}
.plein:active,.creux:active{transform:translateY(2px)}
.carton .plein:focus-visible,.carton .creux:focus-visible{outline-color:var(--corail)}
.bravo{text-align:center;color:#fff;animation:arrive .7s cubic-bezier(.2,1.3,.4,1) both}
.bravo h2{font-size:clamp(50px,15vh,120px);line-height:1;text-shadow:0 .05em 0 var(--encre);-webkit-text-stroke:.05em var(--encre);paint-order:stroke fill;color:var(--petit)}
.bravo p{margin:clamp(6px,1.6vh,14px) auto clamp(12px,3vh,26px);font-size:clamp(16px,2.8vh,22px);font-weight:600;max-width:24em;text-wrap:balance;text-shadow:0 1px 0 var(--encre),0 0 10px rgba(19,26,75,.9)}
.bravo .plein{background:#fff;color:var(--encre)}
@keyframes arrive{from{opacity:0;transform:translateY(-20px) scale(.9)}}

/* ---------- Pied de l'accueil ---------- */
#pied{position:fixed;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:space-between;padding:0 max(16px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));transition:opacity .3s}
body:not([data-etat="accueil"]) #pied{opacity:0;visibility:hidden}
#pied a{color:#fff;font-weight:600;font-size:15px;text-decoration:none;padding:10px 4px;text-shadow:0 1px 2px rgba(34,28,53,.6)}
#pied a:hover{text-decoration:underline;text-underline-offset:4px}
#b-langue{height:46px;padding:0 16px;border-radius:999px;background:rgba(255,255,255,.86);font-weight:700;font-size:15px;box-shadow:0 3px 0 rgba(34,28,53,.2)}
#b-langue:hover{background:#fff}

/* ---------- Boutons tactiles ---------- */
#tactile{position:fixed;left:0;right:0;bottom:0;display:none;justify-content:space-between;align-items:flex-end;padding:0 max(14px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));pointer-events:none}
body.tactile[data-etat="jeu"] #tactile{display:flex}
#tactile .groupe{display:flex;gap:12px;align-items:flex-end;pointer-events:none}
#tactile .groupe.grand{display:none}
body.duo #tactile .groupe.grand{display:flex}
body:not(.duo) #tactile .groupe.petit{flex:1}
body:not(.duo) #tactile .groupe.petit .saut{margin-left:auto}
#tactile button{pointer-events:auto;width:clamp(62px,17vh,86px);aspect-ratio:1;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.62);border:3px solid rgba(34,28,53,.5);touch-action:none;transition:transform .08s,background .08s}
#tactile .saut{width:clamp(72px,20vh,100px)}
#tactile svg{width:46%;height:46%;fill:none;stroke:var(--encre);stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
#tactile .petit button{border-color:#C98F00;background:rgba(255,222,128,.74)}
#tactile .grand button{border-color:#2B55B8;background:rgba(160,190,255,.74)}
#tactile button.enfonce{transform:scale(.9);background:#fff}

/* ---------- Téléphone tenu debout ---------- */
#tourner{position:fixed;inset:0;display:none;flex-direction:column;align-items:center;justify-content:center;gap:18px;background:var(--encre);color:#fff;text-align:center;padding:30px}
#tourner svg{width:110px;height:110px;fill:none;stroke:#fff;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
#tourner rect{animation:tourne 2.4s ease-in-out infinite;transform-origin:32px 30px}
#tourner p{font-family:"Fraunces",Georgia,serif;font-variation-settings:"SOFT" 100;font-weight:600;font-size:26px;max-width:11em}
@keyframes tourne{0%,20%{transform:rotate(0)}60%,100%{transform:rotate(-90deg)}}
@media (orientation:portrait) and (max-width:700px){#tourner{display:flex}}

@media (max-height:460px){
  #accueil{padding-top:8px}
  h1{font-size:clamp(34px,13vh,56px)}
  .quoi{font-size:13.5px;margin-top:9px;max-width:44em}
  .choix{margin-top:11px}
  .jouer{padding:7px 18px 7px;row-gap:2px}
  .jouer .titre{font-size:17px}
  .tetes .petit{width:20px;height:22px}.tetes .grand{width:25px;height:31px}
  .comment{font-size:12px;min-height:22px}
  .chemin{margin-top:8px}
  #pierres button{width:32px;font-size:13.5px}
  #pierres li:nth-child(even) button{translate:0 4px}
  #pied a{font-size:13px}
  .rondelle,#b-langue{width:40px;height:40px}#b-langue{width:auto}
}
@media (prefers-reduced-motion:reduce){.bravo{animation:none}#tourner rect{animation:none}}
.comment kbd svg{width:13px;height:13px;fill:none;stroke:var(--encre);stroke-width:3.2;stroke-linecap:round;stroke-linejoin:round}
body.tactile.etroit .jouer[data-mode="duo"]{display:none}
