@font-face { font-family: "Lilita"; src: url(polices/lilita.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Nunito"; src: url(polices/nunito.woff2) format("woff2"); font-weight: 600 900; font-display: swap; }

:root {
  --fond: #ff5a3c;
  --ombre: #d93a1f;
  --encre: #231a2e;
  --blanc: #fffdf8;
  --pale: #f1ece4;
  --soleil: #ffd02e;
  --soleil-bas: #d9a400;
  --vert: #22c77a;
  --vert-bas: #139656;
  --rouge: #ff3d55;
  --rouge-bas: #c41c33;
  --ressort: cubic-bezier(.3, 1.6, .5, 1);
  --pas: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--fond); transition: background-color .6s; }
body { font: 800 16px/1.35 "Nunito", system-ui, sans-serif; color: var(--encre); min-height: 100dvh; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; border: 0; }
button { cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--encre); outline-offset: 3px; }

#fond { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; }
#fond span { position: absolute; font: 400 var(--t) "Lilita"; color: #fff; opacity: .13; animation: flotter var(--d) ease-in-out infinite alternate; }
@keyframes flotter { from { transform: translate(0, 0) rotate(var(--r)); } to { transform: translate(12px, -34px) rotate(calc(var(--r) * -1)); } }

#ecran { width: min(100%, 480px); margin: 0 auto; padding: calc(var(--pas) + env(safe-area-inset-top)) var(--pas) calc(var(--pas) + env(safe-area-inset-bottom)); min-height: 100dvh; display: flex; flex-direction: column; gap: var(--pas); }
#ecran.entree > * { animation: monter .45s var(--ressort) backwards; }
#ecran.entree > :nth-child(2) { animation-delay: .06s; }
#ecran.entree > :nth-child(3) { animation-delay: .12s; }
#ecran.entree > :nth-child(4) { animation-delay: .18s; }
#ecran.entree > :nth-child(n+5) { animation-delay: .24s; }
@keyframes monter { from { opacity: 0; transform: translateY(26px) scale(.96); } }

h1, h2, .gros { font-family: "Lilita"; font-weight: 400; letter-spacing: .01em; }
.titre { text-align: center; color: var(--blanc); font-size: clamp(56px, 19vw, 92px); line-height: .88; text-shadow: 0 6px 0 var(--ombre); padding: 18px 0 4px; }
.titre span { display: inline-block; animation: sauter 2.4s var(--ressort) infinite; animation-delay: calc(var(--i) * .08s); }
@keyframes sauter { 0%, 70%, 100% { transform: none; } 78% { transform: translateY(-12px) rotate(-6deg); } 88% { transform: translateY(0) scale(1.08, .92); } }
.accroche { text-align: center; color: var(--blanc); font-size: 17px; }
h2 { font-size: 30px; color: var(--blanc); text-align: center; text-shadow: 0 4px 0 var(--ombre); line-height: 1.05; }

.carte { background: var(--blanc); border-radius: 24px; padding: 18px; box-shadow: 0 7px 0 var(--ombre); display: flex; flex-direction: column; gap: 12px; }
.etiquette { font-size: 13px; opacity: .65; }

.champ { width: 100%; background: var(--pale); border-radius: 15px; padding: 14px 16px; font-size: 18px; box-shadow: inset 0 3px 0 rgba(35, 26, 46, .09); }
.champ::placeholder { color: rgba(35, 26, 46, .38); }
.champ:focus { outline: 3px solid var(--encre); outline-offset: 0; }

.bouton { --c: var(--soleil); --b: var(--soleil-bas); display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 15px 18px; border-radius: 18px; background: var(--c); box-shadow: 0 6px 0 var(--b); font: 400 22px "Lilita"; margin-bottom: 6px; transition: transform .08s, box-shadow .08s, opacity .2s; }
.bouton:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 var(--b); }
.bouton:disabled { opacity: .5; cursor: default; }
.bouton.vert { --c: var(--vert); --b: var(--vert-bas); }
.bouton.blanc { --c: var(--blanc); --b: rgba(35, 26, 46, .2); }
.bouton.encre { --c: var(--encre); --b: #000; color: var(--blanc); }
.bouton.petit { font-size: 17px; padding: 11px 14px; border-radius: 14px; }
.bouton.appel { animation: respirer 1.8s ease-in-out infinite; }
@keyframes respirer { 50% { scale: 1.025; } }
.rang { display: flex; gap: 10px; }
.rang > .champ { min-width: 0; }
.rang > .bouton.court { width: auto; flex: none; }

.avatars { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.avatars button { aspect-ratio: 1; border-radius: 12px; background: var(--pale); font-size: min(22px, 5.4vw); transition: transform .25s var(--ressort), background-color .15s; }
.avatars button[aria-pressed="true"] { background: var(--soleil); transform: scale(1.18) rotate(-8deg); }

.code { display: flex; justify-content: center; gap: 8px; }
.code b { width: 62px; height: 74px; display: grid; place-items: center; background: var(--blanc); border-radius: 16px; box-shadow: 0 6px 0 var(--ombre); font: 400 46px "Lilita"; animation: tomber .55s var(--ressort) backwards; animation-delay: calc(var(--i) * .09s); }
.code b:nth-child(odd) { rotate: -4deg; }
.code b:nth-child(even) { rotate: 3deg; }
@keyframes tomber { from { transform: translateY(-60px) scale(.5); opacity: 0; } }

.joueurs { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.joueur { position: relative; background: var(--pale); border-radius: 16px; padding: 10px 6px 8px; text-align: center; font-size: 13px; overflow-wrap: anywhere; }
.joueur i { display: block; font-style: normal; font-size: 38px; line-height: 1.15; animation: dandiner 2.2s ease-in-out infinite alternate; }
.joueur.neuf { animation: pop .5s var(--ressort); }
.joueur.absent { opacity: .4; }
.joueur.absent i { animation: none; }
.joueur .pastille { position: absolute; top: -8px; right: -6px; font-size: 20px; }
.joueur.vide { display: grid; place-items: center; background: none; border: 3px dashed rgba(35, 26, 46, .18); opacity: .7; min-height: 84px; }
@keyframes dandiner { from { rotate: -7deg; } to { rotate: 7deg; } }
@keyframes pop { from { transform: scale(0); } }

.puces { display: flex; flex-wrap: wrap; gap: 8px; }
.puce { background: var(--pale); border-radius: 99px; padding: 8px 13px; font-size: 14px; animation: pop .3s var(--ressort); }
button.puce::after { content: " ✕"; opacity: .45; }
button.puce.idee { background: none; box-shadow: inset 0 0 0 2px var(--pale); }
button.puce.idee::after { content: " ＋"; }
.choix { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; background: var(--pale); padding: 5px; border-radius: 15px; }
.choix button { padding: 9px 0; border-radius: 11px; background: none; }
.choix button[aria-pressed="true"] { background: var(--encre); color: var(--blanc); animation: pop .3s var(--ressort); }

.barre { position: sticky; top: 0; z-index: 5; background: var(--fond); padding: 8px 0 10px; display: flex; align-items: center; gap: 12px; transition: background-color .6s; }
.lettre { flex: none; width: 68px; height: 68px; border-radius: 20px; background: var(--blanc); box-shadow: 0 6px 0 var(--ombre); display: grid; place-items: center; font: 400 46px "Lilita"; rotate: -6deg; }
.temps { flex: 1; color: var(--blanc); }
.temps .ligne { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 14px; }
.temps .ligne b { font: 400 22px/1 "Lilita"; }
.jauge { height: 14px; background: rgba(35, 26, 46, .25); border-radius: 99px; overflow: hidden; }
.jauge i { display: block; height: 100%; background: var(--blanc); border-radius: 99px; transform-origin: left; }
.urgence .jauge i { background: var(--soleil); }
.urgence .lettre { animation: trembler .45s linear infinite; }
@keyframes trembler { 25% { rotate: -13deg; } 75% { rotate: 3deg; } }

.case { background: var(--blanc); border-radius: 20px; padding: 11px 12px 12px; box-shadow: 0 5px 0 var(--ombre); display: block; transition: transform .2s var(--ressort); }
.case:focus-within { transform: scale(1.025) rotate(-.6deg); }
.case .nom { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; font-size: 14px; }
.case .coche { font-size: 18px; scale: 0; transition: scale .3s var(--ressort); }
.case.ok .coche { scale: 1; }
.case.faux .champ { background: #ffe1e5; }

.pied { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.colle { position: sticky; bottom: 0; padding: 8px 0 env(safe-area-inset-bottom); }
.stop { --c: var(--encre); --b: #000; color: var(--blanc); font-size: 32px; letter-spacing: .06em; }
.stop:disabled { opacity: 1; --c: #4a4155; --b: #231a2e; font-size: 20px; letter-spacing: 0; }
.stop:not(:disabled) { --c: var(--soleil); --b: var(--soleil-bas); color: var(--encre); animation: respirer .8s ease-in-out infinite; }

.avance { display: flex; gap: 6px; }
.avance i { flex: 1; height: 8px; border-radius: 99px; background: rgba(35, 26, 46, .25); }
.avance i.fait { background: var(--blanc); }
.reponse { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--blanc); border-radius: 20px; padding: 12px 14px; box-shadow: 0 5px 0 var(--ombre); transition: transform .2s var(--ressort), background-color .2s; }
.reponse .qui { font-size: 32px; line-height: 1; }
.reponse .texte { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.reponse .texte b { display: block; font: 400 23px/1.15 "Lilita"; }
.reponse .texte small { font-size: 12px; opacity: .6; }
.reponse .verdict { font-size: 26px; text-align: center; min-width: 36px; }
.reponse .verdict small { display: block; font-size: 11px; }
button.reponse:active:not(:disabled) { transform: scale(.97); }
button.reponse:disabled { cursor: default; }
.reponse.contre { background: #ffd9de; animation: secouer .35s; }
.reponse.contre b { text-decoration: line-through 3px var(--rouge); }
.reponse.nulle { opacity: .55; }
@keyframes secouer { 25% { translate: -8px 0; } 60% { translate: 6px 0; } }

.classement { display: flex; flex-direction: column; gap: 9px; }
.place { position: relative; display: flex; align-items: center; gap: 11px; background: var(--pale); border-radius: 15px; padding: 9px 13px; overflow: hidden; isolation: isolate; }
.place::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--part); background: var(--soleil); z-index: -1; animation: remplir 1s var(--ressort) backwards; animation-delay: .35s; }
@keyframes remplir { from { width: 0; } }
.place .qui { font-size: 28px; line-height: 1; }
.place .nom { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.place .gain { background: var(--vert); border-radius: 99px; padding: 2px 9px; font-size: 13px; animation: pop .5s var(--ressort) .9s backwards; }
.place .total { font: 400 23px "Lilita"; min-width: 42px; text-align: right; }

details summary { cursor: pointer; text-align: center; color: var(--blanc); padding: 6px; list-style: none; }
details summary::after { content: " ▾"; }
details[open] summary::after { content: " ▴"; }
.detail { display: flex; flex-direction: column; gap: var(--pas); padding-top: 8px; }
.detail h3 { color: var(--blanc); font: 400 21px "Lilita"; margin-bottom: -4px; }

.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 9px; padding-top: 20px; }
.marche { text-align: center; color: var(--blanc); min-width: 0; overflow-wrap: anywhere; }
.marche i { display: block; font-style: normal; font-size: 52px; line-height: 1.2; animation: pop .6s var(--ressort) backwards, dandiner 1.4s ease-in-out infinite alternate; animation-delay: var(--att); }
.marche .socle { margin-top: 6px; border-radius: 16px 16px 0 0; background: var(--blanc); color: var(--encre); display: grid; place-content: center; height: var(--h); font: 400 30px "Lilita"; transform-origin: bottom; animation: pousser .6s var(--ressort) backwards; animation-delay: var(--att); }
.marche .socle small { font: 800 13px "Nunito"; }
@keyframes pousser { from { transform: scaleY(0); } }

.reactions { display: flex; justify-content: space-between; gap: 6px; }
.reactions button { flex: 1; font-size: 24px; padding: 7px 0; border-radius: 14px; background: rgba(255, 255, 255, .25); transition: transform .2s var(--ressort); }
.reactions button:active { transform: scale(1.35) rotate(-12deg); }

.attente { text-align: center; color: var(--blanc); padding: 6px; }
.attente::after { content: ""; display: inline-block; width: 1.4em; text-align: left; animation: points 1.2s steps(1) infinite; }
@keyframes points { 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.lien { background: none; color: var(--blanc); text-decoration: underline; padding: 6px; align-self: center; font-size: 14px; }
.tete { display: flex; justify-content: space-between; align-items: center; }

#voile { position: fixed; inset: 0; z-index: 20; display: none; place-content: center; justify-items: center; gap: 18px; text-align: center; padding: 20px; color: var(--blanc); }
#voile.roulette, #voile.tampon { display: grid; }
#voile.roulette { background: var(--fond); }
#voile .grosse { width: 220px; height: 220px; border-radius: 56px; background: var(--blanc); color: var(--encre); box-shadow: 0 12px 0 var(--ombre); display: grid; place-items: center; font: 400 160px "Lilita"; }
#voile .grosse.defile { animation: defiler .09s linear infinite; }
#voile .grosse.trouve { animation: atterrir .6s var(--ressort); }
@keyframes defiler { 50% { transform: translateY(7px) rotate(4deg); } }
@keyframes atterrir { from { transform: scale(1.7) rotate(22deg); } to { transform: rotate(-6deg); } }
#voile p { font: 400 30px "Lilita"; }
#voile.tampon { background: rgba(35, 26, 46, .9); }
#voile .cachet { background: var(--rouge); box-shadow: 0 10px 0 var(--rouge-bas); border-radius: 30px; padding: 14px 34px; font: 400 clamp(72px, 24vw, 130px)/1 "Lilita"; rotate: -9deg; animation: frapper .45s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes frapper { from { transform: scale(4); opacity: 0; } }
body.choc #ecran { animation: choc .4s .15s; }
@keyframes choc { 20% { translate: -9px 5px; } 45% { translate: 8px -4px; } 70% { translate: -5px -2px; } }

#pluie { position: fixed; inset: 0; pointer-events: none; z-index: 30; overflow: hidden; }
#pluie b { position: absolute; top: -30px; width: 11px; height: 17px; border-radius: 3px; animation: choir var(--d) cubic-bezier(.3, .4, .7, 1) forwards; }
@keyframes choir { to { transform: translate(var(--x), 108vh) rotate(var(--r)); } }
#pluie .envol { position: absolute; bottom: 70px; text-align: center; font-size: 46px; animation: envol 2.2s ease-out forwards; }
#pluie .envol small { display: block; font-size: 12px; color: var(--encre); background: var(--blanc); border-radius: 99px; padding: 1px 8px; }
@keyframes envol { 0% { transform: translateY(40px) scale(.3); opacity: 0; } 15% { opacity: 1; transform: scale(1.2); } 100% { transform: translateY(-62vh) rotate(14deg); opacity: 0; } }

#bulle { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); translate: -50% 0; background: var(--encre); color: var(--blanc); padding: 11px 18px; border-radius: 99px; z-index: 40; max-width: calc(100% - 28px); width: max-content; text-align: center; transition: transform .35s var(--ressort), opacity .2s; }
#bulle:not(.vu) { opacity: 0; transform: translateY(24px); pointer-events: none; }

.pub { position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 10px; align-items: center; margin-top: 8px; padding: 22px 14px 14px; border-radius: 20px; background: var(--soleil); border: 3px dashed var(--encre); rotate: -1.2deg; }
.pub .mention { position: absolute; top: -11px; left: 14px; background: var(--encre); color: var(--blanc); font-size: 11px; padding: 2px 9px; border-radius: 99px; }
.pub .croix { position: absolute; top: -13px; right: 8px; width: 30px; height: 30px; border-radius: 50%; background: var(--blanc); box-shadow: 0 3px 0 rgba(35, 26, 46, .3); font-size: 13px; transition: translate .25s var(--ressort); z-index: 1; }
.pub .objet { font-size: 46px; line-height: 1; animation: dandiner .9s ease-in-out infinite alternate; }
.pub b { display: block; font: 400 21px/1.1 "Lilita"; }
.pub p { font-size: 13px; }
.pub .achat { grid-column: 1 / -1; background: var(--rouge); color: var(--blanc); border-radius: 13px; padding: 9px; font: 400 18px "Lilita"; box-shadow: 0 4px 0 var(--rouge-bas); margin-bottom: 4px; animation: respirer 1.4s ease-in-out infinite; }
.pub .achat:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--rouge-bas); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
