/* Rime Time, on the common charter: rows of four beats, the last one a word, and a ball that bounces along them. */
html,body{overflow:hidden;overscroll-behavior:none}

.rime{position:relative;display:flex;flex-direction:column;align-items:center;height:100%;height:100dvh;padding:max(12px,env(safe-area-inset-top)) 16px max(14px,env(safe-area-inset-bottom))}
.manche{position:absolute;top:max(22px,env(safe-area-inset-top));left:16px;margin:0;color:var(--jg-marine);font-size:17px;font-weight:800;line-height:1.4}
.outils{position:absolute;top:max(10px,env(safe-area-inset-top));right:16px;z-index:3;display:flex;gap:10px}
#micro .barre-micro{display:none}
#micro[aria-pressed=true]{background:#ffe3e3;color:var(--jg-rouge)}
#micro[aria-pressed=true] .barre-micro{display:inline}

.jeu{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;gap:clamp(10px,2.4vh,24px);width:100%;min-height:0}
.consigne{margin:0;color:var(--jg-marine);font-size:18px;font-weight:800;line-height:1.3;text-align:center;text-wrap:balance}

/* Whose turn it is, above the rows; the same room is kept for everyone, so that nothing moves when the turn changes. */
.tour{display:flex;flex-direction:column;align-items:center;gap:4px;margin:0;text-align:center}
.qui-joue{padding:3px 24px;border:2px solid transparent;border-radius:999px;color:var(--jg-marine);font:700 clamp(34px,6vh,52px)/1.05 var(--jg-manuscrit);letter-spacing:.02em}
.tour[data-moi=true] .qui-joue{border-color:var(--jg-marine);background:var(--jg-bleu);color:#fff}
.ensuite{min-height:1.35em;color:var(--jg-gris);font-size:15px;font-weight:700;line-height:1.35}

/* Everything before and after a song: creating, joining, the players, the beat. */
.panneau{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;gap:clamp(12px,2.4vh,20px);width:100%;min-height:0;text-align:center}
.salon{display:flex;flex-direction:column;align-items:center;gap:clamp(12px,2.4vh,20px);width:min(520px,100%)}
.salon-gens,.salon-beat{display:flex;flex-direction:column;align-items:center;gap:clamp(10px,2vh,16px);width:100%}
.invitation{margin:0;color:var(--jg-encre);font-size:clamp(36px,4.2vw,48px);line-height:1;text-wrap:balance}
.places{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;width:100%;margin:0;padding:0;list-style:none}
.place{display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;min-height:58px;padding:6px 10px;border:var(--jg-contour);border-radius:14px;background:#fff}
.place .nom{max-width:100%;overflow:hidden;color:var(--jg-marine);font:700 28px/1.05 var(--jg-manuscrit);letter-spacing:.02em;text-overflow:ellipsis;white-space:nowrap}
.place .etat{color:var(--jg-gris);font-size:13px;font-weight:700;line-height:1.3}
.place.ok .etat{color:var(--jg-juste)}
.place.vide{border:2px dashed var(--jg-ligne);background:none;color:#8d93a1;font-size:15px;font-weight:700}
.reponse{display:flex;align-items:center;gap:8px;width:min(340px,100%);height:58px;padding:5px 5px 5px 22px;border:var(--jg-contour);border-radius:999px;background:#fff;box-shadow:var(--jg-ombre)}
.reponse input{flex:1;min-width:0;height:100%;border:0;background:none;color:var(--jg-encre);font:800 22px/1 var(--jg-police)}
.reponse input::placeholder{color:#8d93a1;font-size:18px;font-weight:700}
.reponse input:focus-visible{outline:none}
.reponse .jg-bouton{height:100%;min-height:0;padding:0 20px}
.reponse.lien{width:100%;box-shadow:none}
.reponse.lien input{font-size:14px;font-weight:700;text-overflow:ellipsis}
.erreur{margin:0;color:var(--jg-rate);font-weight:800}
.erreur:empty{display:none}
.reprise{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:10px;margin:0;padding:8px 18px;border:var(--jg-contour);border-radius:22px;background:#fff6cf;font-weight:800}
.reprise .jg-bouton{min-height:38px;padding:0 16px;font-size:15px}

/* The ball flies in the room left above the rows, and the row being played is always the first one. */
.scene{--rang:clamp(46px,8.6vh,68px);--ecart:8px;--saut:clamp(52px,10vh,92px);--balle:clamp(22px,3.4vh,30px);--mot:clamp(22px,min(6.2vh,6.8vw),54px);position:relative;width:min(760px,100%);padding-top:var(--saut)}
.balle{position:absolute;left:0;top:0;z-index:2;width:var(--balle);height:var(--balle);margin:calc(var(--saut) - var(--balle) - 2px) 0 0 calc(var(--balle) / -2);border:var(--jg-contour);border-radius:50%;background:var(--jg-rouge);transform-origin:50% 100%;will-change:transform}
/* The little trail of the ball, only while it is moving. */
.trace{position:absolute;left:0;top:0;z-index:1;width:var(--balle);height:var(--balle);margin:calc(var(--saut) - var(--balle) - 2px) 0 0 calc(var(--balle) / -2);border-radius:50%;background:var(--jg-rouge);opacity:.28;will-change:transform}
.trace + .trace{opacity:.18}
.trace + .trace + .trace{opacity:.1}
@media(prefers-reduced-motion:reduce){.trace{display:none}}
.lignes{height:calc(var(--rang) * 5 + var(--ecart) * 4);overflow:hidden}
.pile{display:grid;gap:var(--ecart);will-change:transform}
.ligne{position:relative;display:grid;grid-template-columns:repeat(3,1fr) 2.4fr;gap:var(--ecart);height:var(--rang)}
/* Who raps this row, written across its three cells. */
.qui{position:absolute;top:0;bottom:0;left:0;z-index:1;display:flex;align-items:center;justify-content:center;width:calc((100% - var(--ecart) * 3) * 3 / 5.4 + var(--ecart) * 2);overflow:hidden;color:#8d93a1;font:700 calc(var(--mot) * .8)/1 var(--jg-manuscrit);letter-spacing:.02em;white-space:nowrap;pointer-events:none}
.a-moi .case{border-color:var(--jg-marine);background:#e6ecff}
.a-moi .qui{color:var(--jg-marine)}
.case{display:flex;align-items:center;justify-content:center;min-width:0;border:2px solid var(--jg-ligne);border-radius:14px;background:#f4f6ff;color:var(--jg-marine);font:700 calc(var(--mot) * .9)/1 var(--jg-manuscrit)}
.mot{display:flex;align-items:center;justify-content:center;min-width:0;padding:0 8px;border:var(--jg-contour);border-radius:14px;color:var(--jg-marine);font:700 calc(var(--mot) * var(--k,1))/1 var(--jg-manuscrit);letter-spacing:.02em;white-space:nowrap}
.mot[data-teinte=bleu]{background:var(--jg-bleu);color:#fff}
.mot[data-teinte=orange]{background:var(--jg-orange)}
.mot[data-teinte=jaune]{background:var(--jg-jaune)}
.mot[data-teinte=vert]{background:var(--jg-vert)}
.mot[data-teinte=rose]{background:var(--jg-rose)}
.mot[data-teinte=neutre]{background:#fff}
/* Where the ball lands lights up, then fades. */
.case.touche{animation:touche .55s ease-out}
.mot.touche{animation:mot .6s ease-out}
@keyframes touche{from{border-color:var(--jg-marine);background:var(--jg-bleu);color:#fff}}
@keyframes mot{from{background:#fff;color:var(--jg-marine)}}

.commandes{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:12px;min-height:52px}
.beats{display:flex;flex-wrap:wrap;justify-content:center;gap:6px}
.beats .jg-bouton{min-height:40px;padding:0 16px;font-size:15px}
.beats .jg-bouton[aria-pressed=true]{background:var(--jg-marine);color:#fff}

/* End of the song. */
.fin-titre{margin:0;color:var(--jg-encre);font-size:clamp(46px,8vh,72px);line-height:1}
.duree{margin:-6px 0 0;color:var(--jg-gris);font-size:15px;font-weight:700}
.ligne-boutons{display:flex;flex-wrap:wrap;justify-content:center;gap:10px}

.confirmation{width:min(380px,calc(100% - 32px));padding:30px 28px 26px;border:var(--jg-contour);border-radius:22px;box-shadow:var(--jg-ombre);text-align:center}
.confirmation[open]{display:flex;flex-direction:column;align-items:center}
.confirmation::backdrop{background:rgba(23,36,65,.35)}
.question{margin:0;font:800 22px/1.2 var(--jg-police)}
.aide{margin:0;color:var(--jg-gris);font-size:15px;line-height:1.45}
.confirmation .aide{margin-top:10px}
.confirmation .ligne-boutons{flex-wrap:nowrap;width:100%;margin-top:24px}
.confirmation .ligne-boutons .jg-bouton{flex:1;max-width:150px}

/* Narrow screens: the round on the first line beside the ×, the rows under them. */
@media(max-width:1000px){
  .jeu,.panneau{padding-top:48px}
}
/* Phones upright: the round centred at the top, between the room kept for the two buttons on each side. */
@media(max-width:760px) and (min-height:521px){
  .manche{top:max(14px,env(safe-area-inset-top));left:122px;right:122px;font-size:14px;line-height:1.25;text-align:center}
}
@media(max-width:600px){
  .scene{--ecart:6px}
  .case,.mot{border-radius:11px}
  .mot{padding:0 5px}
}
/* Short landscape screens: the turn and the notices beside the rows, the salon in two columns. */
@media(max-height:520px){
  .jeu{display:grid;grid-template-columns:minmax(0,1fr) 170px;grid-template-rows:1fr auto auto 1fr;justify-items:center;align-content:stretch;gap:6px 14px;padding-top:44px}
  .scene{grid-row:1/-1;grid-column:1;align-self:center;--rang:clamp(32px,10.5vh,44px);--ecart:5px;--saut:36px;--balle:18px;--mot:clamp(20px,6.4vh,28px)}
  .tour{grid-row:2;grid-column:2}
  .qui-joue{padding:2px 14px;font-size:30px}
  .ensuite{font-size:13px}
  .commandes{grid-row:3;grid-column:2;min-height:0}
  .reprise{padding:6px 10px;font-size:13px}
  .panneau{justify-content:flex-start;padding-top:44px}
  .salon{flex-direction:row;align-items:flex-start;gap:16px;width:min(760px,100%)}
  .salon-gens,.salon-beat{flex:1;min-width:0;gap:8px}
  .salon .consigne{font-size:14px}
  .salon .aide{font-size:13px;line-height:1.3}
  .place{min-height:44px;padding:3px 8px}
  .place .nom{font-size:22px}
  .place .etat{font-size:12px}
  .reponse{height:46px}
  .fin-titre{font-size:34px}
  .duree{margin:-4px 0 0;font-size:13px}
  .beats .jg-bouton{min-height:36px;padding:0 12px;font-size:14px}
  .salon-beat > .jg-bouton{min-height:42px}
}
