/* Le Fil qui Nous Relie · styles */
  /* Layout concept: the Dakar 2026 template as a live stage. Each act sits on one of the four
     patterned brand gradients; text lives on the template's white cut-corner panel on the left;
     the six zones are white speech bubbles (the logo's bubble) along the bottom, and everything
     the room does happens in the open space on the right: tennis balls, a football, a twisted rope.
     Committed single look, set by the brand, not by the viewer's theme. */
  :root{
    color-scheme: light;
    --ink: #0B0B0B;
    --ink-2: #3A3A3A;
    --paper: #FFFFFF;
    --mist: #EEF0F2;
    --act: #0066BE;
    --bleu: #0066BE;
    --jaune: #FAB312;
    --rouge: #E2181F;
    --vert: #12924A;
    --notch: clamp(26px, 3.6vw, 64px);
    --cond: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
    --text: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  }
  *{ box-sizing: border-box; }
  [hidden]{ display: none !important; }
  html, body{ height: 100%; }
  body{
    margin: 0; background: var(--bleu); color: var(--ink); font-family: var(--text); overflow: hidden;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    -webkit-font-smoothing: antialiased;
  }
  button{ font: inherit; color: inherit; }
  button:focus-visible, input:focus-visible, select:focus-visible{ outline: 3px solid var(--ink); outline-offset: 2px; }

  /* ================= STAGE ================= */
  #stage{ position: fixed; inset: 0; background: var(--bleu); user-select: none; overflow: hidden; }
  .bg{
    position: absolute; inset: -4%; background-size: cover; background-position: center;
    opacity: 0; transition: opacity 1100ms ease;
    animation: drift 38s ease-in-out infinite alternate;
  }
  .bg.on{ opacity: 1; }
  .bg.noir{ background: #050505; animation: none; inset: 0; }
  @keyframes drift{ from{ transform: scale(1) translate(0, 0); } to{ transform: scale(1.06) translate(-1.2%, 0.8%); } }
  #sky{ position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 2; }

  .brandmark{
    position: absolute; z-index: 5; pointer-events: none;
    top: max(3.2vh, env(safe-area-inset-top, 0px));
    left: max(4vw, env(safe-area-inset-left, 0px));
    height: clamp(34px, 6.4vh, 74px); width: auto;
  }
  .signature{
    position: absolute; z-index: 5; pointer-events: none;
    top: max(3.6vh, env(safe-area-inset-top, 0px));
    right: max(4vw, env(safe-area-inset-right, 0px));
    width: clamp(160px, 24vw, 420px); height: auto; opacity: 0.95;
  }

  /* ---- the panel (template's white cut-corner frame) ---- */
  .card{
    position: absolute; z-index: 10; pointer-events: none;
    left: max(4vw, env(safe-area-inset-left, 0px)); top: 13vh;
    width: min(46vw, 840px); max-height: 57vh; overflow: hidden;
    background: var(--paper); color: var(--ink);
    clip-path: polygon(var(--notch) 0, 100% 0, 100% 100%, 0 100%, 0 var(--notch));
    padding: clamp(22px, 4.2vh, 52px) clamp(22px, 3vw, 56px) clamp(20px, 3.6vh, 44px);
    display: flex; flex-direction: column; gap: clamp(8px, 1.6vh, 20px);
    transition: opacity 280ms ease, transform 280ms ease;
  }
  .card.swap{ opacity: 0; transform: translateX(-18px); }
  .card.wide{ width: min(64vw, 1120px); top: 14vh; }
  .card.hero{
    background: none; color: var(--paper); clip-path: none; padding: 0;
    top: 15vh; width: min(62vw, 1100px); max-height: none;
  }
  .card.centre{ left: 50%; top: 50%; transform: translate(-50%, -54%); width: min(46vw, 760px); align-items: center; text-align: center; }
  .card.centre.swap{ transform: translate(-50%, -50%); }
  .card-logo{ height: clamp(40px, 7vh, 80px); width: auto; margin-bottom: 1vh; }
  #stage.final .brandmark, #stage.final .signature{ opacity: 0; transition: opacity 600ms ease; }
  .eyebrow{
    font-family: var(--cond); font-weight: 700; font-size: clamp(0.95rem, 1.5vw, 1.5rem);
    letter-spacing: 0.06em; text-transform: uppercase; color: var(--act);
  }
  .card.hero .eyebrow{ color: var(--paper); opacity: 0.9; }
  .title{
    font-family: var(--cond); font-weight: 800; text-transform: uppercase;
    font-size: clamp(2.3rem, 5.2vw, 6rem); line-height: 0.9; letter-spacing: -0.005em;
    margin: 0; text-wrap: balance;
  }
  .card.hero .title{ font-size: clamp(3rem, 7.6vw, 9rem); line-height: 0.86; text-shadow: 0 1px 0 rgba(0, 28, 90, 0.22), 0 3px 6px rgba(0, 28, 90, 0.18), 0 10px 22px rgba(0, 20, 70, 0.14); }
  .card.hero .sub{ text-shadow: 0 1px 2px rgba(0, 28, 90, 0.25); }
  .card.wide .title{ font-size: clamp(2rem, 4.2vw, 4.8rem); }
  .title em{ font-style: normal; color: var(--act); }
  .card.hero .title em{ color: var(--paper); }
  .title .num{ color: var(--act); font-variant-numeric: tabular-nums; }
  .sub{
    font-size: clamp(1rem, 1.55vw, 1.55rem); line-height: 1.38; color: var(--ink-2);
    max-width: 44ch; margin: 0; font-weight: 500; text-wrap: pretty;
  }
  .card.wide .sub{ max-width: 60ch; }
  .card.hero .sub{ color: var(--paper); font-size: clamp(1.1rem, 2vw, 2rem); max-width: 36ch; font-weight: 600; }
  .sub b{ font-weight: 700; color: var(--ink); }
  .card.hero .sub b{ color: var(--paper); }
  .widget{ display: flex; margin-top: 0.4vh; }
  .widget:empty{ display: none; }

  .legend{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 14px; width: 100%; }
  .legend .z{ display: flex; align-items: center; gap: 10px; font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: clamp(1rem, 1.5vw, 1.45rem); min-width: 0; }
  .legend .z.zin{ animation: zIn 0.55s cubic-bezier(.2,1.5,.4,1) both; }
  @keyframes zIn{ from{ opacity: 0; transform: translateY(14px) scale(0.85); } to{ opacity: 1; transform: none; } }
  @media (prefers-reduced-motion: reduce){ .legend .z.zin{ animation: none; } }
  .legend .k{ flex: none; width: 1.8em; height: 1.8em; display: grid; place-items: center; color: #fff; font-weight: 800; clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%, 0 30%); }

  .counter{ display: flex; align-items: flex-end; gap: clamp(14px, 2vw, 30px); }
  .counter .big{ font-family: var(--cond); font-weight: 800; font-size: clamp(4rem, 9vw, 10rem); line-height: 0.8; color: var(--act); font-variant-numeric: tabular-nums; }
  .counter .side{ display: flex; flex-direction: column; gap: 8px; padding-bottom: 6px; }
  .counter .lbl{ font-family: var(--cond); font-weight: 700; font-size: clamp(0.9rem, 1.3vw, 1.3rem); text-transform: uppercase; letter-spacing: 0.04em; }
  .zbars{ display: flex; align-items: flex-end; gap: 6px; height: 44px; }
  .zbars span{ width: clamp(12px, 1.8vw, 24px); height: 3px; transition: height 300ms ease; }

  .summary{ display: grid; gap: 12px; width: 100%; }
  .srow{ display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; align-items: end; }
  .srow .q{ font-size: clamp(0.88rem, 1.2vw, 1.15rem); color: var(--ink-2); min-width: 0; }
  .srow .n{ font-family: var(--cond); font-weight: 800; font-size: clamp(1.4rem, 2.4vw, 2.4rem); line-height: 1; color: var(--act); font-variant-numeric: tabular-nums; }
  .stack{ grid-column: 1 / -1; display: flex; height: 10px; background: var(--mist); }
  .stack span{ height: 100%; transition: width 400ms ease; }

  .pips{ display: flex; gap: clamp(10px, 1.8vw, 26px); flex-wrap: wrap; }
  .pip{ display: flex; align-items: center; gap: 8px; font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: clamp(0.85rem, 1.2vw, 1.2rem); color: #9097A0; }
  .pip i{ display: block; width: clamp(16px, 1.6vw, 24px); height: clamp(16px, 1.6vw, 24px); border: 3px solid currentColor; border-radius: 50%; transition: background 300ms ease, transform 300ms ease; }
  .pip.v{ color: var(--ink); }
  .pip.v i{ background: var(--zc); border-color: var(--zc); }
  .pip.h i{ transform: scale(1.3); box-shadow: 0 0 0 4px var(--paper), 0 0 0 6px var(--zc); }

  .gauge{ width: 100%; display: flex; flex-direction: column; gap: 10px; }
  .gtrack{ position: relative; height: clamp(22px, 3.2vh, 36px); background: var(--mist); }
  .gfill{ position: absolute; left: 0; top: 0; bottom: 0; display: flex; width: 0%; transition: width 220ms ease; }
  .gfill span{ height: 100%; transition: width 220ms ease; }
  .gtarget{ position: absolute; top: -7px; bottom: -7px; width: 4px; background: var(--ink); left: 83.33%; }
  .gmeta{ display: flex; justify-content: space-between; font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: clamp(0.95rem, 1.35vw, 1.35rem); font-variant-numeric: tabular-nums; }
  .gmeta b{ font-weight: 800; font-size: 1.3em; }

  .duo{ display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: end; gap: clamp(10px, 2vw, 30px); width: 100%; }
  .duo b{ display: block; font-family: var(--cond); font-weight: 800; font-size: clamp(2.4rem, 5vw, 5.2rem); line-height: 0.88; font-variant-numeric: tabular-nums; }
  .duo span{ display: block; font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: clamp(0.85rem, 1.25vw, 1.25rem); color: var(--ink-2); overflow-wrap: anywhere; }
  .duo .mid{ text-align: center; padding: 0 clamp(8px, 1.5vw, 22px); border-left: 2px solid var(--mist); border-right: 2px solid var(--mist); }
  .duo .mid b{ color: var(--act); }
  .duo .r{ text-align: right; }
  .rhy{ width: 100%; display: flex; flex-direction: column; gap: clamp(8px, 1.2vh, 14px); }
  .rhy-head{ display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
  .rhy-name{ font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: clamp(0.9rem, 1.3vw, 1.3rem); color: var(--ink-2); }
  .rhy-phase{ font-family: var(--cond); font-weight: 800; text-transform: uppercase; font-size: clamp(1.4rem, 2.6vw, 2.8rem); line-height: 1; color: var(--ink); }
  .rhy-tag{ font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: clamp(1rem, 1.6vw, 1.7rem); color: var(--ink-2); }
  .rhy-row{ display: grid; grid-template-columns: minmax(70px, 17%) repeat(4, minmax(0, 1fr)); gap: clamp(5px, 0.8vw, 12px); align-items: stretch; transition: opacity 250ms ease; }
  .rhy-row.dim{ opacity: 0.32; }
  .rhy-who{ display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; }
  .rhy-who small{ font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: clamp(0.72rem, 1vw, 1rem); color: var(--ink-2); letter-spacing: 0.04em; }
  .rhy-who b{ font-family: var(--cond); font-weight: 800; text-transform: uppercase; font-size: clamp(1rem, 1.7vw, 1.8rem); line-height: 0.95; overflow-wrap: anywhere; }
  .rhy-who i{ display: none; font-style: normal; font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: clamp(0.7rem, 0.95vw, 0.95rem); background: var(--ink); color: #fff; padding: 2px 7px; align-self: flex-start; }
  .rhy-row.listen{ opacity: 0.55; }
  /* hands and feet */
  .cell .ci{ display: block; width: 30%; max-width: 56px; flex: none; }
  .card.rnd .title{ font-size: clamp(1.6rem, 3.1vw, 3.4rem); }
  .card.rnd{ gap: clamp(6px, 1.1vh, 14px); }
  .cell .ci svg{ display: block; width: 100%; height: auto; overflow: visible; }
  .hl, .hr{ transform-box: fill-box; transform-origin: 50% 100%; }
  .ft{ transform-box: fill-box; transform-origin: 25% 95%; }
  .burst, .dust{ transform-box: fill-box; transform-origin: 50% 50%; opacity: 0; }
  #perf{
    position: absolute; z-index: 11; pointer-events: none; display: flex; flex-direction: column; align-items: center;
    width: clamp(110px, 12.5vw, 220px); transform: translate(-50%, -100%); transition: left 420ms cubic-bezier(.2,.8,.2,1), top 420ms cubic-bezier(.2,.8,.2,1), opacity 250ms ease;
  }
  #perf .pf-ico{ width: 100%; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.28)); }
  #perf .pf-ico svg{ display: block; width: 100%; height: auto; overflow: visible; }
  #perf .pf-word{
    font-family: var(--cond); font-weight: 800; text-transform: uppercase; font-size: clamp(1.6rem, 3vw, 3.2rem); line-height: 1;
    color: #fff; -webkit-text-stroke: 2px #0B0B0B; paint-order: stroke fill; text-shadow: 0 4px 0 #0B0B0B; opacity: 0; margin-bottom: -4px; white-space: nowrap;
  }
  .rhy-phase.syl{ font-size: clamp(1.8rem, 3.2vw, 3.4rem); }
  .rhy-head{ height: clamp(2.2rem, 3.8vw, 4rem); align-items: center; flex-wrap: nowrap; overflow: visible; }
  .rhy-tag{ text-align: right; min-width: 0; }
  .card.wide{ max-height: 64vh; }
  .cell.on{ transform: scale(1.16); filter: brightness(1.3); box-shadow: 0 0 0 4px #FFFFFF, 0 0 0 7px var(--ink); }
  .rhy-row.listen .rhy-who i{ display: inline-block; }
  .cell{
    aspect-ratio: 1 / 0.42; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 7%; background: var(--mist);
    font-family: var(--cond); font-weight: 800; text-transform: uppercase; font-size: clamp(0.95rem, 1.9vw, 2.1rem); line-height: 0.9; color: #fff;
    clip-path: polygon(16% 0, 100% 0, 100% 100%, 0 100%, 0 16%);
    transition: transform 90ms ease, filter 90ms ease;
  }
  .cell.c{ background: var(--act); }
  .cell.s{ background: var(--ink); }
  .cell.r{ color: #A7ADB5; }
  .cell small{ font-family: var(--text); font-weight: 600; text-transform: none; font-size: clamp(0.7rem, 0.95vw, 1rem); opacity: 0.85; }
  .cell.beat{ box-shadow: inset 0 -5px 0 rgba(11,11,11,0.18); }
  .cell.on{ transform: scale(1.12); filter: brightness(1.25); }
  .cell.r.on{ background: #D9DDE2; }
  .rhy.quiet .cell{ opacity: 0.5; }
  .rhy-count{ display: flex; justify-content: space-between; gap: 10px; font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: clamp(0.85rem, 1.2vw, 1.2rem); color: var(--ink-2); }
  .rhy-count b{ font-weight: 800; font-size: 1.5em; color: var(--ink); margin-right: 6px; font-variant-numeric: tabular-nums; }
  .vals{ display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 1.8vw, 26px); width: 100%; }
  .val{ display: flex; flex-direction: column; gap: 6px; opacity: 0.45; transition: opacity 300ms ease; min-width: 0; }
  .val.active, .val.win{ opacity: 1; }
  .vbar{ position: relative; height: clamp(60px, 11vh, 130px); background: var(--mist); overflow: hidden; }
  .vfill{ position: absolute; left: 0; right: 0; bottom: 0; height: 0%; background: var(--act); transition: height 250ms ease; }
  .vtimer{ position: absolute; left: 0; top: 0; height: 5px; width: 0; background: var(--ink); }
  .vscore{ font-family: var(--cond); font-weight: 800; font-size: clamp(1.3rem, 2.2vw, 2.2rem); line-height: 1; font-variant-numeric: tabular-nums; }
  .vname{ font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: clamp(0.8rem, 1.2vw, 1.3rem); line-height: 1; overflow-wrap: normal; word-break: normal; hyphens: manual; }

  .vu{ position: relative; height: clamp(14px, 2vh, 22px); background: var(--mist); overflow: hidden; }
  .vu span{ position: absolute; left: 0; top: 0; bottom: 0; width: 0%; background: linear-gradient(90deg, #12924A 0%, #FAB312 60%, #E2181F 100%); transition: width 80ms linear; }
  .vu-row{ display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: clamp(0.8rem, 1.1vw, 1.1rem); color: var(--ink-2); }
  .mic-test{ height: 16px; background: var(--mist); position: relative; overflow: hidden; }
  .mic-test span{ position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #12924A, #FAB312 60%, #E2181F); }
  .mic-test i{ position: absolute; top: -3px; bottom: -3px; width: 3px; background: var(--ink); left: 30%; }
  .stats{ display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 2vw, 28px); width: 100%; text-align: center; }
  .stat b{ display: block; font-family: var(--cond); font-weight: 800; font-size: clamp(1.8rem, 3.4vw, 3.4rem); line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
  .stat span{ font-family: var(--cond); font-weight: 600; text-transform: uppercase; font-size: clamp(0.72rem, 1vw, 1rem); color: var(--ink-2); }
  .solo-list{ display: grid; gap: 8px; width: 100%; }
  .solo-list div{ font-family: var(--cond); font-weight: 700; font-size: clamp(1rem, 1.4vw, 1.4rem); padding: 8px 12px; background: var(--mist); border-left: 5px solid var(--act); }
  .wave{ display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; width: 100%; margin-top: 4px; }
  .wave span{ position: relative; overflow: hidden; padding: 9px 4px 11px; text-align: center; font-family: var(--cond); font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; font-size: clamp(0.72rem, 0.95vw, 1rem); background: var(--mist); color: var(--ink-2); white-space: nowrap; text-overflow: ellipsis; transition: background 0.4s, color 0.4s, transform 0.4s; }
  .wave span.on{ background: var(--zc); color: var(--zt); }
  .wave span.now{ background: var(--zc); color: var(--zt); transform: translateY(-6px); box-shadow: 0 8px 0 -2px var(--ink); }
  .wave span i{ position: absolute; left: 0; bottom: 0; height: 4px; width: 0; background: var(--ink); transition: width 0.12s linear; }
  .cue{ font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; font-size: clamp(0.9rem, 1.3vw, 1.25rem); color: var(--ink); display: flex; align-items: center; gap: 10px; }
  .cue::before{ content: ""; width: 0; height: 0; border-left: 12px solid var(--act); border-top: 8px solid transparent; border-bottom: 8px solid transparent; }

  /* final: Merci / Jërëjëf / Thank you columns, as on the template's closing slide */
  .merci{ position: absolute; top: 0; bottom: 0; width: 25vw; z-index: 3; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity 900ms ease; }
  .merci.on{ opacity: 1; }
  .merci.l{ left: 0; } .merci.r{ right: 0; text-align: right; }
  .merci .roll{ display: flex; flex-direction: column; animation: roll 26s linear infinite; }
  .merci.r .roll{ animation-direction: reverse; }
  .merci span{ font-family: var(--cond); font-style: italic; font-weight: 800; text-transform: uppercase; white-space: nowrap; font-size: clamp(1.4rem, 3.4vw, 3.6rem); line-height: 1.12; padding: 0 1.4vw; }
  @keyframes roll{ from{ transform: translateY(0); } to{ transform: translateY(-50%); } }

  #toast{
    position: absolute; left: 50%; top: max(4vh, env(safe-area-inset-top, 0px)); z-index: 25;
    transform: translate(-50%, -14px); opacity: 0; pointer-events: none;
    background: var(--paper); color: var(--ink); font-family: var(--cond); font-weight: 800; text-transform: uppercase;
    font-size: clamp(1.1rem, 2vw, 2rem); padding: 10px 28px 10px 34px; white-space: nowrap;
    clip-path: polygon(18px 0, 100% 0, 100% 100%, 0 100%, 0 18px);
    transition: opacity 300ms ease, transform 300ms ease; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
  }
  #toast.show{ opacity: 1; transform: translate(-50%, 0); }

  /* ---- control strip: appears when the mouse moves, gone during the show ---- */
  .controls{
    position: absolute; z-index: 30; left: 50%; top: max(2.6vh, env(safe-area-inset-top, 0px));
    transform: translate(-50%, -8px); opacity: 0; pointer-events: none;
    display: flex; align-items: stretch; gap: 2px; background: rgba(11,11,11,0.86); padding: 4px;
    transition: opacity 250ms ease, transform 250ms ease; max-width: calc(100vw - 32px); overflow-x: auto;
  }
  .controls.show{ opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
  .controls button, .controls .stat-cap{
    background: none; border: none; color: #fff; cursor: pointer; white-space: nowrap;
    font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; font-size: 0.92rem;
    padding: 7px 11px;
  }
  .controls button:hover{ background: rgba(255,255,255,0.14); }
  .controls button.on{ background: var(--paper); color: var(--ink); }
  .controls .act-b{ font-variant-numeric: tabular-nums; opacity: 0.6; }
  .controls .act-b.cur{ opacity: 1; background: var(--act); }
  .controls .sep{ width: 1px; background: rgba(255,255,255,0.2); margin: 4px 4px; }
  .controls .stat-cap{ cursor: default; opacity: 0.85; display: flex; align-items: center; gap: 6px; }
  .controls .stat-cap i{ width: 8px; height: 8px; border-radius: 50%; background: #8a8f96; display: inline-block; }
  .controls .stat-cap.ok i{ background: #3DDC84; }

  /* ---- help + régie ---- */
  .overlay{
    position: absolute; inset: 0; z-index: 40; background: rgba(5,5,5,0.6);
    display: flex; align-items: center; justify-content: center;
    padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .sheet{ background: var(--paper); color: var(--ink); width: min(720px, 100%); max-height: 86vh; overflow: auto; padding: 30px 32px; clip-path: polygon(34px 0, 100% 0, 100% 100%, 0 100%, 0 34px); }
  .sheet h2, #regie h2{ font-family: var(--cond); font-weight: 800; text-transform: uppercase; font-size: 2rem; line-height: 1; margin: 0 0 16px; }
  .keys{ display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 18px; align-items: baseline; }
  .keys kbd{ font-family: var(--cond); font-weight: 700; font-size: 0.95rem; background: var(--mist); padding: 3px 9px; white-space: nowrap; }
  .keys span{ color: var(--ink-2); font-size: 0.96rem; line-height: 1.4; }

  #regie{
    position: absolute; top: 0; right: 0; bottom: 0; z-index: 45; width: min(460px, 100vw);
    background: var(--paper); color: var(--ink); overflow-y: auto; user-select: text;
    padding-top: max(24px, env(safe-area-inset-top, 0px)); padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
    padding-left: 26px; padding-right: max(26px, env(safe-area-inset-right, 0px));
    box-shadow: -24px 0 60px rgba(0,0,0,0.3);
  }
  .rhead{ display: flex; justify-content: space-between; align-items: center; gap: 10px; }
  .rhead h2{ margin: 0 !important; margin-right: auto !important; }
  .rhead .btn{ text-decoration: none; display: inline-flex; align-items: center; }
  #exit-exp{ background: var(--rouge); color: #fff; border-color: var(--rouge); }
  .rsec{ border-top: 2px solid var(--ink); padding: 16px 0 20px; margin-top: 18px; display: grid; gap: 10px; }
  .rsec h3{ font-family: var(--cond); font-weight: 800; text-transform: uppercase; font-size: 1.15rem; margin: 0; }
  .rsec p{ margin: 0; font-size: 0.9rem; color: var(--ink-2); line-height: 1.45; }
  .field{ display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; align-items: center; }
  .field .sw{ width: 30px; height: 30px; display: grid; place-items: center; color: #fff; font-family: var(--cond); font-weight: 800; clip-path: polygon(30% 0, 100% 0, 100% 100%, 0 100%, 0 30%); }
  .rsec input[type=text], .rsec input[type=number], .rsec select{
    width: 100%; background: var(--mist); border: 0; border-bottom: 2px solid transparent; color: var(--ink);
    padding: 9px 10px; font-family: var(--text); font-size: 0.98rem; min-width: 0;
  }
  .rsec input:focus{ border-bottom-color: var(--ink); outline: none; }
  .row2{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .row2 label, .lbl-s{ font-size: 0.84rem; color: var(--ink-2); display: grid; gap: 5px; }
  .qr{ display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 16px; align-items: center; }
  .qr .code{ width: 136px; height: 136px; background: #fff; border: 2px solid var(--ink); padding: 6px; display: grid; place-items: center; font-size: 0.8rem; text-align: center; }
  .qr .code svg{ width: 100%; height: 100%; display: block; }
  .link{ font-family: ui-monospace, Menlo, monospace; font-size: 0.74rem; word-break: break-all; background: var(--mist); padding: 8px; user-select: all; }
  .btn{ background: var(--paper); border: 2px solid var(--ink); padding: 8px 14px; cursor: pointer; font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: 0.98rem; }
  .btn.primary{ background: var(--ink); color: #fff; }
  .btn.danger{ border-color: var(--rouge); color: var(--rouge); }
  .btns{ display: flex; flex-wrap: wrap; gap: 8px; }
  .toggle{ display: flex; align-items: center; gap: 10px; font-size: 0.96rem; cursor: pointer; }
  .toggle input{ width: 18px; height: 18px; accent-color: var(--ink); }
  .cap-list{ display: flex; gap: 6px; flex-wrap: wrap; }
  .cap-list span{ font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: 0.85rem; padding: 4px 9px; background: var(--mist); color: #8a8f96; }
  .cap-list span.on{ color: #fff; }

  /* ---- act change: three brand bands sweep across, act name in between ---- */
  #wipe{ position: absolute; inset: 0; z-index: 35; pointer-events: none; overflow: hidden; visibility: hidden; }
  #wipe .band{
    position: absolute; top: -4%; bottom: -4%; left: -22%; width: 144%;
    clip-path: polygon(14vw 0, 100% 0, calc(100% - 14vw) 100%, 0 100%);
    transform: translateX(-130%); will-change: transform;
  }
  #wipe .b3{ background-color: var(--bleu); background-size: 100vw 100vh; background-position: 22% center; }
  #wipe .label{ position: absolute; left: calc(22% + 7vw); top: 50%; transform: translateY(-50%); color: #fff; font-family: var(--cond); font-weight: 800; text-transform: uppercase; }
  #wipe .label small{ display: block; font-size: clamp(1.2rem, 2.6vw, 2.8rem); letter-spacing: 0.08em; }
  #wipe .label b{ display: block; font-size: clamp(3.6rem, 12vw, 14rem); line-height: 0.85; }
  #wipe .label .ln{ display: block; overflow: hidden; }
  #wipe .label .ln > *{ display: block; }

  /* ---- finale: the template's closing slide, in motion ---- */
  #finale{ position: absolute; inset: 0; z-index: 36; background: #050505; overflow: hidden; opacity: 0; pointer-events: none; }
  .fin-rows{ position: absolute; inset: -1vh 0; display: flex; flex-direction: column; justify-content: space-between; }
  .fin-row{ white-space: nowrap; font-family: var(--cond); font-style: italic; font-weight: 800; text-transform: uppercase; font-size: 8.4vh; line-height: 1; will-change: transform; }
  .fin-row.r{ text-align: right; }
  .fin-row span{ padding: 0 0.18em; }
  .fin-word{
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; opacity: 0;
    background: #050505; padding: 3vh 6vw 3.4vh; min-width: min(70vw, 1100px);
    clip-path: polygon(4vh 0, 100% 0, 100% 100%, 0 100%, 0 4vh);
  }
  .fin-word b{ display: block; font-family: var(--cond); font-weight: 800; font-size: clamp(4rem, 15vw, 17rem); line-height: 0.84; color: #FFFFFF; white-space: nowrap; }
  .fin-word small{ display: block; margin-top: 1.4vh; font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.24em; font-size: clamp(1rem, 2vw, 2.1rem); color: #FAB312; }

  .card.ritual{ top: 20vh; width: min(40vw, 660px); }
  .card.pro{ visibility: hidden; }
  #pro{ position: absolute; z-index: 20; left: max(6vw, env(safe-area-inset-left, 0px)); top: 34vh; width: min(42vw, 680px); pointer-events: none; }
  #pro .pro-eye{ font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.32em; color: #FAB312; font-size: clamp(0.9rem, 1.4vw, 1.5rem); min-height: 1.4em; }
  #pro .pro-line{ margin-top: 2.2vh; font-family: var(--cond); font-weight: 700; color: #FFFFFF; font-size: clamp(1.9rem, 3.6vw, 4.2rem); line-height: 1.02; text-wrap: balance; text-shadow: 0 0 30px rgba(255,140,40,0.18); }
  #pro-hint{ position: absolute; z-index: 20; left: 50%; bottom: 5vh; transform: translateX(-50%); font-family: var(--cond); font-weight: 600; text-transform: uppercase; letter-spacing: 0.28em; font-size: 0.85rem; color: rgba(255,255,255,0.35); animation: hintPulse 2.4s ease-in-out infinite; pointer-events: none; }
  @keyframes hintPulse{ 0%, 100%{ opacity: 0.35; } 50%{ opacity: 0.8; } }
  #tcv{ position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 33; pointer-events: none; }
  #tcv[hidden]{ display: none !important; }
  #flash{ position: absolute; inset: 0; z-index: 34; background: #FFF6E0; opacity: 0; pointer-events: none; }
  @media (max-width: 760px){ #pro{ top: 14vh; width: calc(100vw - 32px); left: 16px; } }
  .card.ritual .title{ font-size: clamp(2.4rem, 5.4vw, 6rem); text-shadow: 0 0 24px rgba(255, 150, 50, 0.25), 0 2px 0 rgba(0,0,0,0.4); }
  .card.ritual .eyebrow{ color: #FAB312; opacity: 0.9; }
  .card.ritual .sub{ color: rgba(255,255,255,0.86); text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
  #stage .brandmark, #stage .signature{ transition: opacity 1600ms ease; }
  #stage.dark .brandmark, #stage.dark .signature{ opacity: 0.12; }
  @media (max-width: 760px){ .card.ritual{ top: 12vh; width: calc(100vw - 32px); } }
  .ign{ display: flex; align-items: baseline; gap: 6px; color: #fff; font-family: var(--cond); font-weight: 800; }
  .ign b{ font-size: clamp(3.4rem, 8vw, 8rem); line-height: 0.85; font-variant-numeric: tabular-nums; text-shadow: 0 2px 0 rgba(0,28,90,0.25), 0 8px 20px rgba(0,20,70,0.2); }
  .ign span{ font-size: clamp(1.6rem, 3vw, 3rem); }

  /* ---- words rising into place ---- */
  .wd{ display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
  .wd > span{ display: inline-block; }
  .title .num, .sub b, .vscore{ display: inline-block; }
  .title .num.hot{ color: var(--rouge); }

  /* ---- start-light countdown ---- */
  /* ---- one value, full screen, while the room applauds it ---- */
  #valfs{ position: absolute; inset: 0; z-index: 26; overflow: hidden; pointer-events: none; opacity: 0; visibility: hidden; background: #050a19; transition: opacity 600ms ease, visibility 0s linear 600ms; --vc: #0066BE; --p: 0; }
  #valfs.on{ opacity: 1; visibility: visible; transition: opacity 600ms ease, visibility 0s; }
  #valfs .vf-bg{ position: absolute; inset: -3%; background-size: cover; background-position: center; opacity: 0.16; filter: saturate(0.6); animation: drift 38s ease-in-out infinite alternate; }
  #valfs .vf-fill{ position: absolute; left: 0; right: 0; bottom: 0; height: calc(var(--p) * 100%); background-color: var(--vc); background-size: cover; background-position: center bottom; transition: height 350ms cubic-bezier(.2,.8,.2,1); box-shadow: 0 -30px 90px -10px var(--vc); }
  #valfs .vf-crest{ position: absolute; left: 0; right: 0; top: -3px; height: 6px; background: #fff; opacity: 0.85; box-shadow: 0 0 24px 6px rgba(255,255,255,0.55); }
  #valfs .vf-mark{ position: absolute; left: 0; right: 0; bottom: calc(var(--m, 0) * 100%); border-top: 3px dashed rgba(255,255,255,0.75); opacity: 0; transition: opacity 400ms ease, bottom 350ms ease; }
  #valfs .vf-mark.on{ opacity: 1; }
  #valfs .vf-mark span{ position: absolute; right: max(4vw, 16px); bottom: 8px; font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: clamp(0.9rem, 1.6vw, 1.4rem); color: #fff; background: rgba(5,10,25,0.55); padding: 0.25em 0.7em; }
  #valfs .vf-time{ position: absolute; left: 0; right: 0; top: 0; height: 10px; background: rgba(255,255,255,0.12); }
  #valfs .vf-time i{ display: block; height: 100%; width: 100%; background: #fff; transform-origin: left center; transform: scaleX(var(--t, 1)); }
  #valfs .vf-time.hot i{ background: var(--rouge); }
  #valfs .vf-body{ position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff; padding: 0 5vw; text-shadow: 0 6px 40px rgba(0,0,0,0.45); }
  #valfs .vf-eye{ font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.3em; font-size: clamp(1rem, 2.2vw, 2rem); opacity: 0.85; }
  #valfs .vf-name{ font-family: var(--cond); font-weight: 800; text-transform: uppercase; line-height: 0.85; font-size: min(26vh, 19vw); letter-spacing: -0.01em; margin: 0.08em 0 0.12em; overflow-wrap: anywhere; }
  #valfs .vf-score{ font-family: var(--cond); font-weight: 800; font-variant-numeric: tabular-nums; font-size: min(14vh, 11vw); line-height: 1; }
  #valfs .vf-sub{ margin-top: 0.6em; font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.14em; font-size: clamp(1rem, 2.4vw, 2.2rem); min-height: 1.2em; }
  #valfs.done .vf-score{ animation: vfPop 700ms cubic-bezier(.2,.8,.2,1); }
  @keyframes vfPop{ 0%{ transform: scale(1.5); } 100%{ transform: scale(1); } }

  #count{ position: absolute; inset: 0; z-index: 28; display: grid; place-items: center; pointer-events: none; background: radial-gradient(circle at center, rgba(5,10,25,0.5) 0%, rgba(5,10,25,0.28) 45%, rgba(5,10,25,0) 75%); }
  #count .cflash{ position: absolute; inset: 0; opacity: 0; }
  #count .cbox{ position: relative; width: min(58vh, 82vw); aspect-ratio: 1; display: grid; place-items: center; }
  #count svg{ position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
  #count .trk{ fill: rgba(11,11,11,0.38); stroke: rgba(255,255,255,0.28); stroke-width: 6; }
  #count .arc{ fill: none; stroke-width: 12; stroke-dasharray: 565.5; stroke-dashoffset: 0; }
  #count .cnum{ position: relative; font-family: var(--cond); font-weight: 800; color: #fff; font-size: min(36vh, 48vw); line-height: 0.8; text-shadow: 0 10px 40px rgba(0,0,0,0.35); font-variant-numeric: tabular-nums; text-align: center; }
  #count .cnum.go{ font-size: min(15vh, 13vw); text-transform: uppercase; line-height: 0.9; max-width: 90vw; }
  #count .clbl{ position: absolute; left: 0; right: 0; top: calc(50% - min(29vh, 41vw) - 2.6em); text-align: center; font-family: var(--cond); font-weight: 700; text-transform: uppercase; color: #fff; font-size: clamp(1rem, 2.2vw, 2rem); letter-spacing: 0.06em; }
  .merci.l{ transform: translateX(-40px); } .merci.r{ transform: translateX(40px); }
  .merci{ transition: opacity 900ms ease, transform 1100ms cubic-bezier(.2,.8,.2,1); }
  .merci.on{ transform: none; }

  @media (max-width: 760px){
    .card, .card.wide{ width: calc(100vw - 32px); left: 16px; top: 13vh; }
    .card.centre{ width: calc(100vw - 32px); }
    .card.hero{ width: calc(100vw - 32px); }
    .signature{ display: none; }
    .legend{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  @media (prefers-reduced-motion: reduce){
    .bg{ animation: none; }
    .merci .roll{ animation: none; }
    .card, #toast, .vfill, .gfill, .gfill span{ transition-duration: 1ms; }
  }

  /* ================= CAPTEUR (helper phone) ================= */
  #capteur{ position: fixed; inset: 0; background: var(--paper); display: flex; flex-direction: column; }
  .cap-head{
    position: relative; overflow: hidden; background: var(--bleu) url(img/fond-bleu.jpg) center / cover;
    padding-top: max(14px, env(safe-area-inset-top, 0px)); padding-bottom: 16px;
    padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
    display: flex; justify-content: space-between; align-items: center; gap: 10px; color: #fff;
  }
  .cap-head img{ height: 38px; width: auto; }
  .cap-status{ font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: 0.85rem; display: flex; align-items: center; gap: 6px; }
  .cap-status i{ width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.5); display: inline-block; }
  .cap-status.ok i{ background: #3DDC84; }
  .cap-body{
    flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px;
    padding-top: 18px; padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .cap-h{ font-family: var(--cond); font-weight: 800; text-transform: uppercase; font-size: clamp(1.9rem, 8vw, 2.6rem); line-height: 0.95; margin: 0; }
  .cap-p{ margin: 0; color: var(--ink-2); font-size: 1rem; line-height: 1.45; }
  .zgrid{ display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
  .ztile{
    border: none; cursor: pointer; min-height: 92px; padding: 12px 14px; background: var(--mist);
    display: flex; align-items: center; gap: 12px; text-align: left;
    clip-path: polygon(18px 0, 100% 0, 100% 100%, 0 100%, 0 18px);
  }
  .ztile .n{ font-family: var(--cond); font-weight: 800; font-size: 3rem; line-height: 0.8; }
  .ztile .t{ font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: 1.15rem; line-height: 1; color: var(--ink); }
  #cap-play{ display: flex; flex-direction: column; flex: 1; gap: 12px; min-height: 0; }
  .cap-zone{ display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .cap-zone b{ font-family: var(--cond); font-weight: 800; text-transform: uppercase; font-size: 1.6rem; line-height: 1; }
  .cap-act{ font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: 0.95rem; color: var(--ink-2); }
  #cap-btn{
    position: relative; overflow: hidden; flex: 1; border: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 10px;
    padding: 24px; text-align: left; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
    clip-path: polygon(36px 0, 100% 0, 100% 100%, 0 100%, 0 36px);
    transition: transform 80ms ease, filter 200ms ease;
  }
  #cap-btn:active{ transform: scale(0.98); }
  #cap-btn.wait{ filter: grayscale(1) brightness(1.15) contrast(0.6); }
  #cap-btn .l{ font-family: var(--cond); font-weight: 800; text-transform: uppercase; font-size: clamp(2.6rem, 14vw, 4.4rem); line-height: 0.88; }
  #cap-btn .s{ font-weight: 600; font-size: 1.02rem; line-height: 1.35; max-width: 26ch; opacity: 0.9; }
  #cap-btn .ripple{ position: absolute; border-radius: 50%; background: rgba(255,255,255,0.45); transform: scale(0); animation: rip 520ms ease-out forwards; pointer-events: none; }
  @keyframes rip{ to{ transform: scale(1); opacity: 0; } }
  .cap-foot{ display: flex; justify-content: space-between; align-items: center; font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: 0.95rem; color: var(--ink-2); }
  .cap-foot b{ color: var(--ink); font-size: 1.3rem; font-weight: 800; }
  .cap-msg{ font-size: 0.92rem; color: var(--rouge); line-height: 1.4; font-weight: 600; }
  .cap-msg:empty{ display: none; }
  .chip{ background: none; border: 2px solid var(--ink); padding: 5px 10px; cursor: pointer; font-family: var(--cond); font-weight: 700; text-transform: uppercase; font-size: 0.9rem; }
