/* LA DÉMO DU DÉFI SILENCE (`js/classe-demo.js`), en tête de `classe.html` et
   des comparaisons : le tableau projeté, sa scène, son chrono, son œuf et sa
   jauge, comme dans l'outil (`ui/classe/classe.css`, § « Le défi projeté »),
   à la taille d'une carte de page.

   UNE FEUILLE À PART, comme l'affiche et les comparaisons : une ligne de plus
   dans `styles.css` changerait son empreinte, donc l'adresse qu'en donnent les
   onze mille pages du site, pour quelques dizaines qui s'en servent.

   LE TABLEAU EST UN ÎLOT : ses couleurs sont celles du défi au tableau (une
   prairie claire, des encarts blancs), pas celles de la page. Avant que la
   scène ne tourne — ou si ses données manquent —, le décor peint en fond et le
   tableau au repos tiennent sa place ; sans JavaScript, l'image de la classe
   au calme (`noscript`) les couvre. Ses tailles suivent la largeur du tableau
   (`cqw`) : la carte d'un téléphone et celle d'un grand écran se lisent de
   même. */

.cldemo{max-width:960px;margin:0 auto}
.cldemo-board{position:relative;container-type:inline-size;aspect-ratio:16/9;border-radius:22px;overflow:hidden;
  background:#9fd3f2 url('/classe/decor/meadow-day.png') center bottom/cover no-repeat;image-rendering:pixelated;
  box-shadow:0 30px 60px -28px rgba(44,26,74,.55),0 0 0 1px rgba(124,58,237,.16)}
.cldemo-scene{position:absolute;inset:0;width:100%;height:100%;display:block}
.cldemo-poster{position:absolute;inset:0;z-index:3;width:100%;height:100%;object-fit:cover;image-rendering:auto}

.cldemo-hud{position:absolute;top:3cqw;left:3cqw;right:3cqw;display:flex;justify-content:space-between;align-items:flex-start;
  gap:2cqw;pointer-events:none;font-family:var(--font-display);color:#2c1a4a}
.cldemo-box{background:rgba(255,255,255,.9);border-radius:2cqw;padding:1cqw 1.8cqw;box-shadow:0 .8cqw 2.4cqw -1.2cqw rgba(0,0,0,.5)}
.cldemo-clock{display:grid;gap:.9cqw;min-width:30cqw}
.cldemo-track{position:relative;height:1.6cqw;border-radius:1cqw;background:rgba(124,58,237,.18)}
.cldemo-fill{position:absolute;inset:0 auto 0 0;width:0;border-radius:1cqw;background:linear-gradient(90deg,#fde68a,#f59e0b)}
.cldemo-sun{position:absolute;top:50%;left:0;width:3.4cqw;height:3.4cqw;margin:-1.7cqw 0 0 -1.7cqw;border-radius:50%;
  background:radial-gradient(circle at 40% 40%,#fff7cc,#fbbf24 58%,#f59e0b);box-shadow:0 0 0 .6cqw rgba(251,191,36,.32)}
.cldemo-time{font-weight:600;font-size:clamp(10px,2.1cqw,20px);font-variant-numeric:tabular-nums;min-height:1.2em}
.cldemo-right{display:flex;gap:1.4cqw;align-items:flex-start}
.cldemo-egg{display:flex;align-items:center;gap:1.1cqw}
.cldemo-eggdot{width:2.6cqw;height:3.3cqw;border-radius:50% 50% 46% 46%/58% 58% 42% 42%;background:radial-gradient(circle at 38% 30%,#ccfbf1,#2dd4bf 60%,#0f766e)}
.cldemo-bar{width:11cqw;height:1.6cqw;border-radius:1cqw;background:rgba(124,58,237,.16);overflow:hidden}
.cldemo-bar span{display:block;height:100%;width:0;border-radius:1cqw;background:linear-gradient(90deg,#5eead4,#14b8a6)}
.cldemo-gauge{display:grid;justify-items:center;gap:.9cqw;min-width:11cqw}
.cldemo-gaugebar{position:relative;width:3.6cqw;height:17cqw;border-radius:2cqw;background:rgba(0,0,0,.1);overflow:hidden;box-shadow:inset 0 0 0 .25cqw rgba(255,255,255,.6)}
.cldemo-level{position:absolute;left:0;right:0;bottom:0;height:0;background:linear-gradient(0deg,#15803d,#4ade80);transition:background .2s}
.cldemo-gauge[data-state="near"] .cldemo-level{background:linear-gradient(0deg,#b45309,#fbbf24)}
.cldemo-gauge[data-state="loud"] .cldemo-level{background:linear-gradient(0deg,#b91c1c,#f87171)}
.cldemo-mark{position:absolute;left:-.5cqw;right:-.5cqw;bottom:56%;height:.45cqw;background:#2c1a4a;border-radius:.3cqw}
.cldemo-gaugetext{font-weight:600;font-size:clamp(9px,1.7cqw,17px);text-align:center;max-width:9em;min-height:1.2em}

.cldemo-banner{position:absolute;left:50%;top:24%;transform:translateX(-50%);margin:0;max-width:72%;padding:1.2cqw 2.8cqw;
  border-radius:999px;background:rgba(255,255,255,.92);color:#2c1a4a;text-align:center;font:600 clamp(11px,2.5cqw,24px)/1.25 var(--font-display);
  box-shadow:0 1.2cqw 3cqw -1.4cqw rgba(0,0,0,.55);opacity:0;transition:opacity .3s;pointer-events:none}
.cldemo-banner.show{opacity:1}

/* L'œuf du bilan, dans le ciel, là où passe le bandeau : l'herbe où marchent
   les Toplings reste visible, et le nouveau venu y entre. */
.cldemo-hatch{position:absolute;left:50%;top:20%;transform:translateX(-50%);display:flex;align-items:center;gap:1.2cqw;
  max-width:70cqw;padding:.8cqw 2.6cqw .8cqw 1cqw;border-radius:999px;background:rgba(255,255,255,.95);color:#2c1a4a;
  box-shadow:0 1.2cqw 3cqw -1.4cqw rgba(0,0,0,.55)}
.cldemo-hatch[hidden]{display:none}
.cldemo-hatch canvas{flex:none;width:9cqw;height:9cqw;image-rendering:pixelated}
.cldemo-hatch p{margin:0;font:600 clamp(11px,2.3cqw,22px)/1.25 var(--font-display)}
.cldemo-hatch p:empty{display:none}

.cldemo-board.fading .cldemo-scene,.cldemo-board.fading .cldemo-hud,.cldemo-board.fading .cldemo-hatch{opacity:0}
.cldemo-scene,.cldemo-hud,.cldemo-hatch{transition:opacity .6s}

.cldemo figcaption{margin-top:18px}
.cldemo-steps{list-style:none;margin:0;padding:0;display:grid;gap:10px;grid-template-columns:repeat(3,1fr);text-align:start}
.cldemo-steps li{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border-radius:16px;background:rgba(255,255,255,.72);
  border:1px solid rgba(124,58,237,.14);color:#5b4a7d;font-size:15px;line-height:1.4;transition:background .3s,color .3s,box-shadow .3s}
.cldemo-steps .num{flex:none;display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:#ece3ff;color:#5b21b6;
  font:600 14px/1 var(--font-display)}
.cldemo-steps li.on{background:#fff;color:#2c1a4a;box-shadow:0 10px 26px -16px rgba(91,33,182,.55);border-color:rgba(124,58,237,.4)}
.cldemo-steps li.on .num{background:#7c3aed;color:#fff}

@media(max-width:700px){
  .cldemo-board{border-radius:16px}
  .cldemo-steps{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){
  .cldemo-banner,.cldemo-steps li,.cldemo-scene,.cldemo-hud,.cldemo-hatch,.cldemo-level{transition:none}
}
