/* Layout: une colonne pensée pour le téléphone — en-tête, pupitre « lecteur »
   (onde sous verre de montre → aide → A/lecture/B → boucle → tempo sous verre bombé),
   respiration, pupitre « métronome » (voyants sous verre → fenêtre centrale entourée des ±
   → réglette → subdivisions → volume). Centrée et limitée à 520 px sur grand écran.
   Univers : un objet de studio sombre et précis, verre, lumière bleue des voyants. */
:root {
  /* Fonds et neutres (graphite légèrement bleuté) */
  /* Nuit indigo plutôt que noir : plus chaleureux, le verre et la lumière ressortent */
  --ink: #141833;
  --ink-2: #0D1026;
  --deck: #1B2042;
  --line: rgba(255, 255, 255, .09);
  --fg: #F1F3FC;
  --ice: #D6E2FA;
  --dim: #9CA3C9;
  --faint: #676E9A;
  --idle: #343A66;
  --violet: #8B6CFF;
  --coral: #FF6F91;

  /* Tempo du morceau (la valeur courante de --zone est posée par le script) */
  --gold: #F5BD41;
  --zone: var(--gold);
  --on-zone: #0A0C11;
  --zone-tint: rgba(0, 0, 0, 0);
  --zone-a: rgba(245, 189, 65, .38);

  /* Lumière du métronome */
  --light: #56C1FF;
  --light-deep: #2A7BF0;
  --light-soft: rgba(86, 193, 255, .35);
  /* Premier temps : ambre, plus orangé que l'or du tempo original */
  --amber: #FFA63D;
  --amber-deep: #E86A12;
  --amber-hot: #FFF1D6;
  --zone-glow: rgba(245, 189, 65, .07);

  /* Repères de boucle */
  --loop-a: #B9A7FF;
  --loop-b: #EBA6F5;

  /* Typo */
  --f-num: "Unbounded", "Manrope", system-ui, sans-serif;
  --f-ui: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  color-scheme: dark;
}

/* La lueur d'ambiance change de couleur en douceur avec la vitesse */
@property --zone-glow { syntax: "<color>"; inherits: true; initial-value: rgba(245, 189, 65, .07); }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--ink); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  background-color: var(--ink);
  transition: --zone-glow .6s ease;
  color: var(--fg);
  font: 500 15px/1.35 var(--f-ui);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
[hidden] { display: none !important; }

/* Ambiance : une lumière haute qui prend la couleur de la vitesse, et un reflet bleu nuit en bas */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(110% 48% at 50% -6%, var(--zone-glow), rgba(20, 24, 51, 0) 70%),
    radial-gradient(70% 45% at 0% 18%, rgba(139, 108, 255, .30), rgba(20, 24, 51, 0) 70%),
    radial-gradient(65% 42% at 100% 42%, rgba(86, 193, 255, .20), rgba(20, 24, 51, 0) 70%),
    radial-gradient(80% 40% at 15% 92%, rgba(255, 111, 145, .16), rgba(20, 24, 51, 0) 70%),
    radial-gradient(70% 38% at 95% 105%, rgba(255, 166, 61, .16), rgba(20, 24, 51, 0) 70%);
  background-size: 140% 140%;
  animation: aurora 26s ease-in-out infinite alternate;
}
/* Aurore : les lumières dérivent très lentement */
@keyframes aurora {
  0% { background-position: 0% 0%; }
  50% { background-position: 60% 30%; }
  100% { background-position: 100% 70%; }
}

button, input { font: inherit; color: inherit; }
button {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}
button:disabled { cursor: default; opacity: .36; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--light); outline-offset: 2px; }
svg { display: block; }

.app {
  max-width: 520px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: max(10px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--dim);
}
.unit {
  font: 700 10px/1 var(--f-ui);
  letter-spacing: .16em;
  color: var(--dim);
}

/* Verre bombé, réutilisable */
.glass {
  position: relative;
  background:
    radial-gradient(130% 75% at 50% -22%, rgba(255, 255, 255, .10), rgba(255, 255, 255, .02) 48%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .012) 50%, rgba(0, 0, 0, .14));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .14),
    inset 0 0 0 1px rgba(255, 255, 255, .06),
    inset 0 -14px 26px -14px rgba(0, 0, 0, .65),
    0 14px 28px -18px rgba(0, 0, 0, .85);
}
.glass::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  top: 2px;
  height: 42%;
  border-radius: 50% / 100% 100% 0 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, 0));
  pointer-events: none;
}

/* ---------- En-tête ---------- */
.top { display: flex; justify-content: center; padding: 6px 0 4px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* En-tête QUART DE TEMPS : capitales gravées, QU ivoire, ART laiton, le A-balancier clé de voûte */
.wordmark {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-weight: 400;
  --f-mark: "EB Garamond", Garamond, "Times New Roman", serif;
}
.wm-line1 {
  display: flex;
  align-items: flex-end;
  font: 600 40px/1 var(--f-mark);
  letter-spacing: .1em;
  padding-left: .1em;
}
.wm-qu { color: #F3E6C8; }
.wm-rt {
  background: linear-gradient(180deg, #FBE3A6 0%, #E3BC6C 55%, #B98A3E 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* Le A : environ 20 % plus haut que les autres capitales, il ne grandit que vers le haut */
.wm-a { position: relative; display: inline-block; width: .9em; height: 1.02em; margin: 0 .1em 0 0; flex: none; }
.wm-a svg { position: absolute; left: 0; bottom: -.04em; width: 100%; height: 100%; overflow: visible; }
.wm-halo {
  position: absolute;
  left: 50%;
  top: 55%;
  width: 2.1em;
  height: 2.1em;
  margin: -1.05em 0 0 -1.05em;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 201, 120, .34), rgba(255, 176, 80, .1) 55%, rgba(255, 176, 80, 0));
  pointer-events: none;
}
.wm-line2 {
  margin-top: 6px;
  font: 500 14px/1 var(--f-mark);
  letter-spacing: .5em;
  padding-left: .5em;
  color: #F3E6C8;
}
.wm-rule { display: flex; align-items: center; gap: 7px; width: 210px; margin-top: 9px; }
.wm-rule i { flex: 1; height: 1px; background: linear-gradient(90deg, rgba(217, 178, 106, 0), #D9B26A); }
.wm-rule i:last-child { background: linear-gradient(90deg, #D9B26A, rgba(217, 178, 106, 0)); }
.wm-rule b { width: 6px; height: 6px; background: #E3C27F; transform: rotate(45deg); }
.wm-devise { margin-top: 7px; font: italic 500 17px/1 var(--f-mark); letter-spacing: .02em; color: #E3C27F; }

.btn-change {
  display: none;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, .08);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  flex: none;
}
body.has-track .btn-change { display: inline-flex; }
.btn-change svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn-change:active { background: rgba(255, 255, 255, .1); }

/* ---------- Pupitres ---------- */
.deck {
  background:
    radial-gradient(120% 50% at 0% 0%, rgba(139, 108, 255, .14), rgba(139, 108, 255, 0) 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  background-color: rgba(27, 32, 66, .82);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 20px 40px -24px rgba(5, 6, 20, .8);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-radius: 24px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.metro {
  margin-top: 14px;
  background:
    radial-gradient(110% 45% at 100% 0%, rgba(86, 193, 255, .16), rgba(86, 193, 255, 0) 60%),
    radial-gradient(90% 45% at 0% 100%, rgba(255, 130, 70, .24), rgba(255, 130, 70, 0) 62%),
    radial-gradient(70% 35% at 100% 100%, rgba(255, 94, 126, .14), rgba(255, 94, 126, 0) 60%),
    radial-gradient(70% 30% at 0% 40%, rgba(255, 150, 80, .08), rgba(255, 150, 80, 0) 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  background-color: rgba(27, 32, 66, .82);
}

/* ---------- Lecteur ---------- */
/* Morceau chargé : titre sur sa ligne, puis « Changer de morceau » et « Retirer le morceau » */
.track-row { display: none; flex-direction: column; gap: 8px; min-width: 0; }
body.has-track .track-row { display: flex; }
.track-line { display: flex; align-items: center; gap: 10px; min-width: 0; }
.track-actions { display: flex; justify-content: space-between; gap: 8px; }
.track-actions .btn-change { font-size: 12.5px; }
.track-ic {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .05);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--zone);
  transition: color .3s;
}
.track-ic svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.track-title {
  flex: 1;
  min-width: 0;
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.remove {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  flex: none;
  border-radius: 999px;
  border: 1px dashed rgba(255, 255, 255, .16);
  background: transparent;
  color: var(--dim);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.remove svg { width: 13px; height: 13px; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.remove .short { display: none; }
.remove:active { color: #FF9C9C; border-color: rgba(255, 156, 156, .5); }

/* Onde sous verre de montre */
.wave-wrap {
  position: relative;
  height: 116px;
  border-radius: 20px;
  background:
    radial-gradient(70% 90% at 50% 120%, rgba(139, 108, 255, .22), rgba(139, 108, 255, 0) 70%),
    radial-gradient(120% 150% at 50% 0%, #20275A 0%, var(--ink-2) 75%);
  overflow: hidden;
  transition: height .3s ease;
}
#wave {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}
#wave:active { cursor: grabbing; }
.wave-glass {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  overflow: hidden;
  /* Une vitre plane : reflet diagonal doux sur toute la largeur + voile clair en haut */
  background:
    linear-gradient(112deg,
      rgba(255, 255, 255, 0) 14%,
      rgba(255, 255, 255, .075) 27%,
      rgba(255, 255, 255, .025) 37%,
      rgba(255, 255, 255, 0) 44%,
      rgba(255, 255, 255, 0) 63%,
      rgba(255, 255, 255, .04) 69%,
      rgba(255, 255, 255, 0) 74%),
    linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, 0) 32%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .24),
    inset 0 0 0 1px rgba(255, 255, 255, .07),
    inset 0 -1px 0 rgba(0, 0, 0, .45),
    inset 0 14px 20px -18px rgba(0, 0, 0, .75),
    inset 0 -18px 26px -16px rgba(0, 0, 0, .65);
}
/* Reflet qui balaie la vitre une fois au lancement de la lecture */
.wave-glass::before {
  content: "";
  position: absolute;
  top: -10%;
  bottom: -10%;
  left: 0;
  width: 38%;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .13) 50%, rgba(255, 255, 255, 0));
  transform: translateX(-110%) skewX(-12deg);
  opacity: 0;
}
.wave-glass.sweep::before { animation: glass-sweep 1.3s cubic-bezier(.4, .1, .3, 1); }
@keyframes glass-sweep {
  0% { transform: translateX(-110%) skewX(-12deg); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translateX(300%) skewX(-12deg); opacity: 0; }
}
.player[data-state="empty"] .wave-glass { background: none; }

.playhead {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 40%;
  width: 2px;
  margin-left: -1px;
  border-radius: 2px;
  background: var(--fg);
  box-shadow: 0 0 10px rgba(255, 255, 255, .45);
  pointer-events: none;
}
.playhead::before, .playhead::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  background: var(--fg);
  transform: rotate(45deg);
  border-radius: 1px;
}
.playhead::before { top: -3px; }
.playhead::after { bottom: -3px; }

.zoom-chip {
  position: absolute;
  top: 8px;
  right: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(10, 12, 17, .72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ice);
  opacity: 0;
  transition: opacity .25s;
  pointer-events: none;
}
.zoom-chip.show { opacity: 1; }

.player[data-state="empty"] #wave,
.player[data-state="empty"] .playhead,
.player[data-state="loading"] .playhead { visibility: hidden; }

/* Fenêtre vide : verre bombé */
.player[data-state="empty"] .wave-wrap {
  height: 156px;
  background:
    /* Coucher de soleil : horizon orange-rose sous un ciel indigo */
    radial-gradient(90% 70% at 50% 125%, rgba(255, 140, 60, .42), rgba(255, 140, 60, 0) 70%),
    radial-gradient(60% 70% at 12% 110%, rgba(255, 94, 126, .34), rgba(255, 94, 126, 0) 70%),
    radial-gradient(60% 70% at 90% 110%, rgba(255, 94, 126, .22), rgba(255, 94, 126, 0) 70%),
    radial-gradient(80% 70% at 50% -10%, rgba(120, 90, 220, .30), rgba(120, 90, 220, 0) 75%),
    var(--ink-2);
}

/* Onde décorative qui ondule derrière le bouton d'import */
.wave-empty .deco {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 10px;
  height: 52px;
  z-index: -1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  opacity: .38;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 25%, #000 75%, transparent);
}
.wave-empty .deco i {
  width: 3px;
  height: var(--h, 40%);
  border-radius: 3px;
  background: linear-gradient(180deg, #FFE1A0, #FFA347 55%, #FF5E7E);
  transform-origin: 50% 100%;
  animation: deco 1.6s ease-in-out infinite;
  animation-delay: var(--d, 0s);
}
@keyframes deco { 0%, 100% { transform: scaleY(.45); } 50% { transform: scaleY(1); } }
.wave-empty, .wave-loading {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 8px;
  z-index: 2;
}
.player[data-state="empty"] .wave-empty { display: flex; padding-bottom: 46px; }
.player[data-state="empty"] .wave-wrap { height: 184px; }
/* Le dôme bombé, réservé à l'écran d'import */
.wave-empty::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 4px;
  height: 46%;
  z-index: -1;
  border-radius: 50% / 100% 100% 0 0;
  /* Jonc de laiton qui souligne l'arche, comme la moulure d'un poste TSF */
  border-top: 1.5px solid rgba(233, 205, 140, .75);
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, .25);
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0) 75%);
  pointer-events: none;
}
.wave-empty::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(130% 70% at 50% -20%, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 60%);
  pointer-events: none;
}
/* Toile de haut-parleur tissée, sable doré, vue à travers le verre */
.tsf-cloth {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    repeating-linear-gradient(45deg, rgba(240, 205, 145, .15) 0 1px, rgba(0, 0, 0, 0) 1px 4px),
    repeating-linear-gradient(-45deg, rgba(240, 205, 145, .12) 0 1px, rgba(0, 0, 0, 0) 1px 4px),
    repeating-linear-gradient(0deg, rgba(255, 220, 160, .04) 0 1px, rgba(0, 0, 0, 0) 1px 3px);
  -webkit-mask-image: radial-gradient(120% 95% at 50% 60%, #000 55%, rgba(0, 0, 0, .35) 85%, transparent 100%);
  mask-image: radial-gradient(120% 95% at 50% 60%, #000 55%, rgba(0, 0, 0, .35) 85%, transparent 100%);
}
/* Lueur des lampes qui chauffent, derrière la toile */
.wave-empty .tsf-cloth::after {
  content: "";
  position: absolute;
  inset: 20% 15% -10%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 160, 80, .22), rgba(255, 160, 80, 0));
  animation: tsf-warm 4.5s ease-in-out infinite;
}
@keyframes tsf-warm { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.wave-empty .deco { z-index: -3; }
/* Plaque de marque en laiton, vissée sur la grille */
.tsf-plate {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  padding: 4px 14px 3px;
  border-radius: 3px;
  background: linear-gradient(180deg, #F7E6BC, #C9A15A 55%, #A9823F);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .6);
  color: #3A2810;
  font: 600 8.5px/1 var(--f-num);
  letter-spacing: .32em;
  pointer-events: none;
}
.tsf-plate::before, .tsf-plate::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 3px;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 50%;
  background: #6B4E22;
}
.tsf-plate::before { left: 4px; }
.tsf-plate::after { right: 3px; }
.player[data-state="loading"] .wave-loading { display: flex; }

.cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 50px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background:
    radial-gradient(120% 90% at 30% -20%, rgba(255, 255, 255, .45), rgba(255, 255, 255, 0) 55%),
    linear-gradient(110deg, #FFC15A 0%, #FF8A3D 45%, #FF4F7B 100%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(120, 30, 20, .35);
  font-weight: 800;
  font-size: 15.5px;
  box-shadow: inset 0 -2px 4px rgba(120, 20, 40, .25), inset 0 1px 0 rgba(255, 255, 255, .5), 0 12px 30px -10px rgba(255, 110, 70, .7);
  background-size: 100% 100%, 160% 100%;
  animation: cta-shine 5s ease-in-out infinite alternate, cta-beat 1.25s ease-in-out infinite;
}
@keyframes cta-shine { from { background-position: 0 0, 0% 0; } to { background-position: 0 0, 100% 0; } }
/* Un battement doux, comme une enceinte, tant qu'aucun morceau n'est chargé */
@keyframes cta-beat {
  0%, 100% { transform: scale(1); box-shadow: inset 0 -2px 4px rgba(120, 20, 40, .25), inset 0 1px 0 rgba(255, 255, 255, .5), 0 12px 30px -10px rgba(255, 110, 70, .7); }
  12% { transform: scale(1.035); box-shadow: inset 0 -2px 4px rgba(120, 20, 40, .25), inset 0 1px 0 rgba(255, 255, 255, .5), 0 14px 38px -8px rgba(255, 110, 70, .95); }
  30% { transform: scale(1); }
}
.cta svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.cta:active { transform: translateY(1px); filter: brightness(.96); }
.empty-note { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .14em; color: var(--ice); opacity: .8; }
.empty-lead { margin: 0 0 -4px; padding: 0 12px; text-align: center; font: italic 500 15px/1.25 "EB Garamond", Garamond, serif; letter-spacing: .02em; color: #F3E6C8; opacity: .92; }

.wave-loading { color: var(--dim); font-size: 13px; font-weight: 600; flex-direction: row; gap: 12px; }
.eq { display: flex; align-items: center; gap: 3px; height: 26px; }
.eq i { width: 4px; height: 100%; border-radius: 2px; background: linear-gradient(180deg, #FFE1A0, #FFA347 55%, #FF5E7E); animation: eq .9s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.7s; }
.eq i:nth-child(3) { animation-delay: -.4s; }
.eq i:nth-child(4) { animation-delay: -.2s; }
.eq i:nth-child(5) { animation-delay: -.55s; }
@keyframes eq { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }

.info-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-top: -4px;
  min-height: 18px;
}
/* Avant import : seul l'appel à importer est visible ; le reste du lecteur s'ouvre ensuite */
.player[data-state="empty"] .info-row,
.player[data-state="empty"] .transport,
.player[data-state="empty"] .loop-row { display: none; }
.player:not([data-state="empty"]) .transport { animation: rise .45s ease both; }
.player:not([data-state="empty"]) .loop-row { animation: rise .45s .06s ease both; }

/* Haut du poste : deux boutons TSF gravés de la spirale */
/* Barre du poste : bouton gauche · VITESSE · médaillon spirale · témoin · bouton droit */
.radio-top { display: grid; grid-template-columns: 38px 1fr 38px 1fr 38px; align-items: center; gap: 8px; min-height: 42px; margin-bottom: 5px; }
.radio-label { min-width: 0; }
.knob-wrap { position: relative; width: 38px; height: 38px; }
.knob {
  position: relative;
  width: 38px;
  height: 38px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 30%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 45%),
    conic-gradient(from 200deg, #8A6F3E, #F4E3B8, #B08A47, #F7EBCB, #8A6F3E, #E1C68C, #8A6F3E);
  box-shadow: 0 4px 8px -2px rgba(0, 0, 0, .7), inset 0 -2px 3px rgba(60, 40, 10, .45), 0 0 0 2px #12162F, 0 0 0 3px rgba(233, 211, 160, .35);
  transition: transform .5s cubic-bezier(.3, 1.4, .5, 1), opacity .3s, box-shadow .3s;
}
.knob svg { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); overflow: visible; }
.knob-spiral { fill: none; stroke: #4A3412; stroke-width: 9; stroke-linecap: round; opacity: .75; }
.knob-notch { stroke: #2B1E08; stroke-width: 14; stroke-linecap: round; }
.knob[aria-disabled="true"] { opacity: .45; }
/* Repères gravés sous les boutons : ▾ ouvrir · ▴ fermer ; celui qui sert maintenant s'allume */
.knob-mark { position: absolute; left: 50%; top: 44px; width: 10px; height: 6px; margin-left: -5px; fill: none; stroke: #D9B26A; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; opacity: .35; transition: opacity .4s, filter .4s; pointer-events: none; }
.player:not(.tempo-open) .mark-open, .player.tempo-open .mark-close { opacity: .95; filter: drop-shadow(0 0 3px rgba(242, 208, 138, .7)); }
#knobOpen.turned { transform: rotate(90deg); }
#knobClose.turned { transform: rotate(-90deg); }
/* Vitesse modifiée volet fermé : le bouton gauche s'allume de la couleur de la zone */
.player.speed-off #knobOpen { opacity: 1; box-shadow: 0 4px 8px -2px rgba(0, 0, 0, .7), inset 0 -2px 3px rgba(60, 40, 10, .45), 0 0 0 2px #12162F, 0 0 0 3px var(--zone), 0 0 14px 2px var(--zone); }
/* Pastille-voyant accrochée au bouton gauche (vitesse différente de 100 %) */
.speed-witness {
  position: absolute;
  left: 26px;
  bottom: -5px;
  padding: 3px 6px 2px;
  border-radius: 999px;
  background: var(--zone);
  color: var(--on-zone);
  font: 600 9.5px/1 var(--f-num);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  box-shadow: 0 0 0 2px #1B2042, 0 2px 6px rgba(0, 0, 0, .5);
  pointer-events: none;
}
.radio-label.lit { color: var(--ice); }

/* Volet du ralentisseur : replié par défaut, il descend en douceur */
.tempo-wrap { display: grid; grid-template-rows: 0fr; margin-top: -12px; transition: grid-template-rows .5s cubic-bezier(.3, .9, .3, 1), margin-top .5s; }
.tempo-wrap.open { grid-template-rows: 1fr; margin-top: 0; }
.tempo-in { min-height: 0; overflow: hidden; }
.tempo-wrap .tempo { transform: translateY(-14px); opacity: 0; transition: transform .5s cubic-bezier(.3, .9, .3, 1), opacity .35s; }
.tempo-wrap.open .tempo { transform: none; opacity: 1; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.time { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--fg); }
.time.end { color: var(--dim); }
.help {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--dim);
  min-width: 0;
}
.help b { color: var(--fg); font-weight: 800; }
.help.ok { color: var(--ice); }

/* Transport */
.transport {
  display: grid;
  grid-template-columns: 1fr 66px 1fr;
  gap: 12px;
  align-items: center;
}
.mark {
  --c: var(--loop-a);
  height: 54px;
  border: 0;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 8px;
  min-width: 0;
  background: rgba(255, 255, 255, .04);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, .07);
  transition: background-color .2s, box-shadow .2s;
}
.mark-b { --c: var(--loop-b); }
.mark .mk { font: 600 22px/1 var(--f-num); color: var(--c); }
.mk-txt { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
.mk-l { font-size: 13.5px; font-weight: 700; color: var(--fg); white-space: nowrap; }
.mk-t { font-size: 10.5px; font-weight: 700; color: var(--c); font-variant-numeric: tabular-nums; }
.mk-t:empty { display: none; }
.mark.set {
  background: color-mix(in srgb, var(--c) 12%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 50%, transparent), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.mark:not(:disabled):active, .pill:not(:disabled):active, .nudge:active, .step:active, .sub:active { transform: scale(.96); }

.play {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 0;
  justify-self: center;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 36% 26%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 44%),
    var(--zone);
  color: var(--on-zone);
  box-shadow:
    inset 0 -5px 10px rgba(0, 0, 0, .22),
    inset 0 1px 1px rgba(255, 255, 255, .6),
    0 10px 20px -10px rgba(0, 0, 0, .9);
  transition: background-color .3s, transform .1s;
}
.play svg { width: 28px; height: 28px; fill: currentColor; }
.play .i-pause { display: none; }
.play.is-playing .i-play { display: none; }
.play.is-playing .i-pause { display: block; }
.play:not(:disabled):active { transform: scale(.95); }
.play:disabled { opacity: 1; background: #232833; color: var(--faint); box-shadow: inset 0 0 0 1px var(--line); }

.loop-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pill {
  height: 40px;
  border: 0;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  background: rgba(255, 255, 255, .04);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
  font-weight: 700;
  color: var(--dim);
  white-space: nowrap;
  min-width: 0;
}
.pill svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.loop { color: var(--fg); }
.loop[aria-pressed="true"] {
  background: linear-gradient(90deg, color-mix(in srgb, var(--loop-a) 26%, transparent), color-mix(in srgb, var(--loop-b) 26%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--loop-a) 60%, transparent);
  color: #fff;
}
.loop.ready { animation: ready 1.8s ease-in-out infinite; }
@keyframes ready {
  0%, 100% { box-shadow: inset 0 0 0 1px var(--line), 0 0 0 0 rgba(185, 167, 255, 0); }
  50% { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--loop-a) 70%, transparent), 0 0 0 4px rgba(185, 167, 255, .12); }
}

/* Tempo du morceau : verre bombé, teinte neutre (pas de mélange avec l'or) */
.tempo {
  border-radius: 20px;
  padding: 12px 14px 12px;
  background:
    linear-gradient(var(--zone-tint), var(--zone-tint)),
    radial-gradient(130% 75% at 50% -22%, rgba(255, 255, 255, .10), rgba(255, 255, 255, .02) 48%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015) 50%, rgba(0, 0, 0, .12));
  background-color: #20264F;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tempo-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.tempo-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bpm-now { display: flex; align-items: baseline; gap: 8px; }
.bpm-now output {
  font: 500 46px/0.95 var(--f-num);
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: var(--fg);
}
.tempo-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-bottom: 3px; }
.zone-chip {
  padding: 4px 9px 3px;
  border-radius: 999px;
  background: var(--zone);
  color: var(--on-zone);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background-color .3s;
}
.pct {
  font: 500 15px/1 var(--f-num);
  font-variant-numeric: tabular-nums;
  color: var(--zone);
  transition: color .3s;
}

.speed-row { display: grid; grid-template-columns: 42px 1fr 42px; gap: 10px; align-items: center; }
.nudge {
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .045);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255, 255, 255, .07);
  font: 500 12.5px/1 var(--f-num);
  color: var(--ice);
  padding: 0;
}
.speed-track { position: relative; min-width: 0; }
.speed-track::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 22px;
  margin: -11px 0 0 -1px;
  border-radius: 1px;
  background: var(--gold);
  pointer-events: none;
}
.speed-track::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 8px;
  margin-top: -4px;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .22)) 9px 0 / 1px 100% no-repeat,
    linear-gradient(90deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .22)) calc(100% - 9px) 0 / 1px 100% no-repeat;
}

.tempo-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.orig-tempo {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(245, 189, 65, .1);
  box-shadow: inset 0 0 0 1px rgba(245, 189, 65, .55);
  color: var(--gold);
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
  min-width: 0;
}
.orig-tempo svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.orig-tempo small { font-size: 10.5px; font-weight: 700; opacity: .75; font-variant-numeric: tabular-nums; }
.orig-tempo:disabled { opacity: 1; background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--faint); }

.orig-field {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  cursor: text;
  min-width: 0;
}
.orig-lbl { font-size: 9.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.orig-val {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 4px 0 8px;
  border-radius: 8px;
  border-bottom: 1px dashed rgba(255, 255, 255, .22);
}
.orig-val svg { width: 13px; height: 13px; fill: none; stroke: var(--dim); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.orig-val input {
  width: 52px;
  height: 100%;
  border: 0;
  background: transparent;
  text-align: right;
  font: 500 16px/1 var(--f-num);
  font-variant-numeric: tabular-nums;
  padding: 0;
}
.orig-val input::placeholder { color: var(--faint); }
.orig-field:focus-within .orig-val { background: var(--ink-2); border-bottom-color: var(--zone); }

/* ---------- Curseurs ---------- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  --lo: 0%;
  --hi: 50%;
  --fill: var(--light);
  --track: rgba(255, 255, 255, .1);
  touch-action: pan-y;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--track) var(--lo), var(--fill) var(--lo), var(--fill) var(--hi), var(--track) var(--hi));
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  margin-top: -8px;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle at 38% 30%, #FFFFFF 0%, #DCE6F2 45%, #9AA8BB 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25), 0 3px 8px rgba(0, 0, 0, .6);
}
input[type="range"]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--track); }
input[type="range"]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--fill); }
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle at 38% 30%, #FFFFFF 0%, #DCE6F2 45%, #9AA8BB 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .25), 0 3px 8px rgba(0, 0, 0, .6);
}
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--light); outline-offset: 3px; }

/* Vitesse : losange facetté, semi-transparent */
#speed { --fill: var(--zone); --track: rgba(255, 255, 255, .13); }
#speed::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  margin-top: -6.5px;
  border-radius: 3px;
  transform: rotate(45deg);
  background:
    conic-gradient(from 0deg,
      rgba(255, 255, 255, .78) 0 25%,
      rgba(255, 255, 255, .30) 0 50%,
      rgba(255, 255, 255, .10) 0 75%,
      rgba(255, 255, 255, .50) 0),
    var(--zone-a);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .75), 0 0 0 2.5px var(--zone), 0 4px 10px rgba(0, 0, 0, .55);
}
#speed::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  transform: rotate(45deg);
  background:
    conic-gradient(from 0deg,
      rgba(255, 255, 255, .78) 0 25%,
      rgba(255, 255, 255, .30) 0 50%,
      rgba(255, 255, 255, .10) 0 75%,
      rgba(255, 255, 255, .50) 0),
    var(--zone-a);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .75), 0 0 0 2.5px var(--zone), 0 4px 10px rgba(0, 0, 0, .55);
}
#speed::-moz-range-progress { background: transparent; }

/* ---------- Métronome ---------- */
.metro-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 34px; }
.metro-title { display: flex; align-items: center; gap: 9px; }

/* Mesure : chiffres en laiton dans une petite fenêtre de verre, à molette */
.meter {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 54px;
  height: 62px;
  padding: 0;
  border: 1.5px solid transparent;
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(0, 0, 0, .18)) padding-box,
    linear-gradient(#171B3C, #171B3C) padding-box,
    conic-gradient(from 210deg, #6E7183, #E9E2D2, #8C7A5C, #F4EBDA, #6E7183, #CDBB98, #6E7183) border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 6px 14px -6px rgba(0, 0, 0, .8);
  flex: none;
}
.meter-num {
  font: 600 20px/1 var(--f-num);
  font-variant-numeric: tabular-nums;
  background-image: linear-gradient(180deg, #FFF1CF, #D9B26A);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.meter-bar { width: 26px; height: 2px; border-radius: 1px; background: linear-gradient(90deg, #9C7434, #F6E1AE, #9C7434); }

/* Figure de note : même fenêtre laiton que la mesure ; un toucher ouvre le petit menu des 4 figures */
.fig-wrap { flex: none; margin-left: -2px; }
.metro-head { position: relative; }
.figure .fig-ic { display: flex; align-items: center; justify-content: center; }
.figure .fig-ic svg { width: 34px; height: auto; fill: #E6C27A; filter: drop-shadow(0 0 4px rgba(242, 208, 138, .35)); }
.figure[aria-expanded="true"] { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 0 2px rgba(242, 208, 138, .35), 0 6px 14px -6px rgba(0, 0, 0, .8); }
.fig-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 64px);
  padding: 4px;
  border-radius: 18px;
  background-color: #1A1F45;
  animation: fig-in .22s ease-out both;
}
.fig-menu[hidden] { display: none; }
.fig-menu .sub { height: 58px; }
@keyframes fig-in { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 380px) { .fig-menu { grid-template-columns: repeat(4, 58px); } }

/* Panneau « Mesure » qui monte du bas de l'écran */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 20, .55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .25s ease;
}
.sheet-panel {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(520px, 100%);
  transform: translate(-50%, 100%);
  transition: transform .32s cubic-bezier(.2, .9, .3, 1);
  padding: 8px max(18px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  border-radius: 26px 26px 0 0;
  background:
    radial-gradient(90% 60% at 0% 0%, rgba(139, 108, 255, .18), rgba(139, 108, 255, 0) 60%),
    radial-gradient(80% 50% at 100% 100%, rgba(255, 130, 70, .14), rgba(255, 130, 70, 0) 60%),
    linear-gradient(180deg, #232955, #171B3A);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 -20px 50px rgba(0, 0, 0, .55);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet.open .sheet-panel { transform: translate(-50%, 0); }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .22); align-self: center; }
.sheet-head { display: flex; align-items: center; gap: 12px; }
.sheet-title { font: 600 16px/1 var(--f-num); letter-spacing: .02em; }
.sheet-now {
  font: 600 16px/1 var(--f-num);
  background-image: linear-gradient(180deg, #FFF1CF, #D9B26A);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  flex: 1;
}
.sheet-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 0 0 1px var(--line);
  display: grid;
  place-items: center;
}
.sheet-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
/* Bac à disques : 8 pochettes, le disque sort de celle qu'on choisit */
.sleeves { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 10px; padding-top: 6px; }
.sleeve {
  position: relative;
  border: 0;
  padding: 26px 0 0;
  background: none;
  display: block;
  width: 100%;
  min-width: 0;
}
.sleeve .disc {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 26px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, #0B0D1E 0 3px, rgba(0, 0, 0, 0) 3.5px),
    radial-gradient(circle, var(--tint) 0 22%, rgba(0, 0, 0, 0) 23%),
    repeating-radial-gradient(circle, #121530 0 1.5px, #22274A 1.5px 2.4px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 4px 10px rgba(0, 0, 0, .5);
  transition: transform .45s cubic-bezier(.2, .9, .25, 1.15);
}
.sleeve .cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  width: 100%;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .10) 0%, rgba(255, 255, 255, 0) 40%),
    radial-gradient(120% 80% at 100% 100%, color-mix(in srgb, var(--tint) 30%, transparent), rgba(0, 0, 0, 0) 65%),
    linear-gradient(180deg, #232955, #161A38);
  box-shadow:
    inset 0 0 0 1px rgba(233, 211, 160, .22),
    inset 0 6px 6px -6px rgba(0, 0, 0, .9),
    0 8px 16px -8px rgba(0, 0, 0, .9);
  transition: box-shadow .3s;
}
.sleeve .cover::before {
  content: "";
  position: absolute;
  left: 10%;
  right: 10%;
  top: 0;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: rgba(0, 0, 0, .55);
}
.frac { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.frac b {
  font: 600 19px/1 var(--f-num);
  font-variant-numeric: tabular-nums;
  background-image: linear-gradient(180deg, #FFF1CF, #D9B26A);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.frac i { width: 22px; height: 1.5px; border-radius: 1px; background: linear-gradient(90deg, #9C7434, #F6E1AE, #9C7434); }
.sleeve[aria-pressed="true"] .disc { transform: translateY(-24px) rotate(40deg); }
.sleeve[aria-pressed="true"] .cover {
  box-shadow:
    inset 0 0 0 1.5px #E9D3A0,
    inset 0 6px 6px -6px rgba(0, 0, 0, .9),
    0 0 22px -4px color-mix(in srgb, var(--tint) 70%, transparent),
    0 8px 16px -8px rgba(0, 0, 0, .9);
}
.sleeve:active .cover { transform: scale(.97); }

/* Mesure personnalisée : un chiffre à gauche, la baguette, un chiffre à droite */
.custom { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 6px; border-top: 1px solid rgba(233, 211, 160, .14); }
.custom .eyebrow { margin-top: 10px; }
.custom-row { display: flex; align-items: center; gap: 14px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.st-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  padding: 0;
  background:
    radial-gradient(circle at 40% 30%, #2A3060 0%, #191D3D 70%) padding-box,
    conic-gradient(from 210deg, #6E7183, #E9E2D2, #8C7A5C, #F4EBDA, #6E7183, #CDBB98, #6E7183) border-box;
  color: var(--ice);
  font: 500 20px/1 var(--f-ui);
}
.st-val {
  min-width: 34px;
  text-align: center;
  font: 600 24px/1 var(--f-num);
  font-variant-numeric: tabular-nums;
  background-image: linear-gradient(180deg, #FFF1CF, #D9B26A);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stick.big { width: 16px; height: 26px; filter: drop-shadow(0 0 4px rgba(255, 200, 140, .35)); }

/* En-tête du métronome : pendule de Newton + bouton Mute, et cartouche gravé avec la devise */
.cradle-col { display: flex; flex-direction: column; align-items: center; gap: 12px; flex: none; }
.cradle { width: 48px; height: 74px; overflow: visible; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); }
.cb-thread { fill: none; stroke: rgba(240, 225, 190, .7); stroke-width: .8; }
.cb-flash { fill: var(--amber); opacity: 0; transform-box: fill-box; transform-origin: center; pointer-events: none; filter: blur(.6px); }
.mute {
  width: 42px;
  height: 28px;
  padding: 0;
  border: 1.2px solid transparent;
  border-radius: 999px;
  background:
    linear-gradient(#171B3C, #171B3C) padding-box,
    conic-gradient(from 210deg, #6E7183, #E9E2D2, #8C7A5C, #F4EBDA, #6E7183, #CDBB98, #6E7183) border-box;
  display: grid;
  place-items: center;
  color: #D9B26A;
  transition: box-shadow .3s, color .3s;
}
.mute svg { width: 19px; height: 19px; }
.mute .spk { fill: currentColor; }
.mute .wv, .mute .x { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.mute .x { display: none; }
/* Son coupé : pastille « feutre » sombre, icône barrée, léger halo ambre */
.mute[aria-pressed="true"] {
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .04) 0 1px, rgba(0, 0, 0, 0) 1px 3px) padding-box,
    linear-gradient(#2A1D16, #1C1410) padding-box,
    conic-gradient(from 210deg, #6E7183, #E9E2D2, #8C7A5C, #F4EBDA, #6E7183, #CDBB98, #6E7183) border-box;
  color: var(--amber);
  box-shadow: 0 0 12px -2px rgba(255, 166, 61, .6);
}
.mute[aria-pressed="true"] .wv { display: none; }
.mute[aria-pressed="true"] .x { display: block; }
.cartouche { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cartouche .eyebrow { color: #D9B26A; }
.devise {
  font: italic 500 14px/1.1 "EB Garamond", Garamond, "Times New Roman", serif;
  letter-spacing: .01em;
  color: #F1E2BF;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0, 0, 0, .5);
}
@media (max-width: 380px) {
  .devise { font-size: 13px; }
  .rpm { width: 62px; }
  .meter { width: 48px; }
  .figure { width: 44px; }
  .figure .fig-ic svg { width: 30px; }
}

/* Sons du métronome : quatre pastilles cerclées de laiton */
.sounds { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.snd {
  height: 40px;
  padding: 0 4px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background:
    radial-gradient(circle at 40% 20%, #262C5A 0%, #191D3D 75%) padding-box,
    conic-gradient(from 210deg, #6E7183, #E9E2D2, #8C7A5C, #F4EBDA, #6E7183, #CDBB98, #6E7183) border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  color: #8F98BE;
  font-size: 11.5px;
  font-weight: 700;
  transition: color .2s, box-shadow .2s;
}
.snd svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.snd[aria-checked="true"] {
  color: #fff;
  background:
    radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--light) 45%, transparent), rgba(0, 0, 0, 0) 70%) padding-box,
    radial-gradient(circle at 40% 20%, #262C5A 0%, #191D3D 75%) padding-box,
    conic-gradient(from 210deg, #6E7183, #E9E2D2, #8C7A5C, #F4EBDA, #6E7183, #CDBB98, #6E7183) border-box;
  box-shadow: 0 0 16px -4px var(--light);
}
.snd[aria-checked="true"] svg { color: var(--light); filter: drop-shadow(0 0 4px var(--light)); }

/* Emblème en bas de l'appli : spirale à quatre centres, en laiton */
/* Médaillon : la spirale dans un petit disque de verre cerclé de laiton, « sillon » en miroir à côté */
.sig { display: flex; align-items: center; gap: 4px; }
.sig-emblem {
  position: relative;
  width: 38px;
  height: 38px;
  border: 1.2px solid transparent;
  padding: 3.5px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 40% 30%, #262C5A 0%, #11152F 75%) padding-box,
    conic-gradient(from 210deg, #6E7183, #E9E2D2, #8C7A5C, #F4EBDA, #6E7183, #CDBB98, #6E7183) border-box;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6), 0 3px 8px -3px rgba(0, 0, 0, .7), 0 0 0 2px #12162F, 0 0 14px 1px rgba(242, 208, 138, .22);
}
/* Fin reflet de verre : un anneau de lumière et un éclat en arc, qui tourne doucement quand la musique ou le métronome joue */
.sig-emblem::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 300deg, rgba(255, 236, 190, 0) 0deg, rgba(255, 236, 190, .55) 28deg, rgba(255, 236, 190, 0) 70deg, rgba(255, 236, 190, 0) 200deg, rgba(255, 236, 190, .22) 225deg, rgba(255, 236, 190, 0) 250deg);
  -webkit-mask: radial-gradient(circle, transparent 0 calc(50% - 1.2px), #000 calc(50% - 1px) 50%, transparent calc(50% + .5px));
  mask: radial-gradient(circle, transparent 0 calc(50% - 1.2px), #000 calc(50% - 1px) 50%, transparent calc(50% + .5px));
  animation: spin 9s linear infinite;
  animation-play-state: paused;
  pointer-events: none;
}
.sig-emblem::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 7%;
  height: 34%;
  border-radius: 50% 50% 45% 45% / 70% 70% 30% 30%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0));
  pointer-events: none;
}
body.spinning .sig-emblem::before { animation-play-state: running; }
.sig-emblem svg { width: 100%; height: 100%; overflow: visible; }
.sig-circle { fill: none; stroke: #D9B26A; stroke-width: 1.2; stroke-dasharray: 4 6; opacity: .45; }
.sig-square { fill: none; stroke: #D9B26A; stroke-width: 5; }
.sig-spiral { fill: none; stroke: #E3C27F; stroke-width: 9; stroke-linecap: round; }
.sig-circle { display: none; }
/* Le quart doré du logo : de midi à trois heures */
.sig-quarter { fill: none; stroke: #F2D08A; stroke-width: 13; stroke-linecap: round; }
.sig-dot { fill: #FFB547; filter: drop-shadow(0 0 4px rgba(255, 181, 71, .9)); opacity: .55; transition: opacity .4s; }
body.spinning .sig-dot { opacity: 1; }
.sig-word {
  display: block;
  margin: 10px auto 0;
  border: 0;
  padding: 4px 10px;
  background: none;
  font: italic 500 18px/1.2 "EB Garamond", Georgia, "Times New Roman", serif;
  letter-spacing: .06em;
  color: #C9A86A;
  perspective: 200px;
}
.sig-word > span { display: inline-block; position: relative; }
.sig-word .ltr { display: inline-block; }

/* Page de carnet (s'ouvre en touchant l'emblème) */
.carnet { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; padding: 16px; }
.carnet .sheet-backdrop { opacity: 0; transition: opacity .3s; }
.carnet.open .sheet-backdrop { opacity: 1; }
.carnet-card {
  position: relative;
  width: min(440px, 100%);
  padding: 14px 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, #232955, #171B3A);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 30px 60px rgba(0, 0, 0, .6);
  transform: translateY(16px) scale(.97);
  opacity: 0;
  transition: transform .35s cubic-bezier(.2, .9, .3, 1), opacity .3s;
}
.carnet.open .carnet-card { transform: none; opacity: 1; }
.carnet-page { display: block; width: 100%; height: auto; border-radius: 10px; }
/* Le tracé de la spirale (de l'extérieur vers le centre) et le retournement des lettres sont animés par le script */
.carnet-cap { margin: 12px 4px 0; font-size: 13px; line-height: 1.5; color: var(--ice); }
.carnet-close { position: absolute; top: -12px; right: -8px; background: #232955; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 4px 10px rgba(0, 0, 0, .5); }

/* Pied de page discret */
.site-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; padding: 18px 0 6px; }
.foot-sign { flex-basis: 100%; margin: 0 0 4px; text-align: center; font: italic 500 15px/1.2 "EB Garamond", Garamond, serif; letter-spacing: .02em; color: #E3C27F; opacity: .85; }
.foot-link {
  border: 0;
  background: none;
  padding: 6px 2px;
  font: 600 12px/1.2 var(--f-ui);
  color: var(--faint);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, .15);
  text-underline-offset: 3px;
}
.foot-link:hover, .foot-link:focus-visible { color: var(--dim); }

/* Bouton « Installer l'application » : pastille flottante en bas de l'écran */
.install-pill {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 6px;
  border-radius: 999px;
  background: rgba(23, 27, 58, .94);
  box-shadow: inset 0 0 0 1px rgba(233, 211, 160, .35), 0 12px 30px rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform .45s cubic-bezier(.2, .9, .3, 1), opacity .35s;
}
.install-pill.show { transform: translate(-50%, 0); opacity: 1; }
.install-go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #F7E6BC, #C9A15A 60%, #A9823F);
  color: #2E1F0A;
  font: 800 13.5px/1 var(--f-ui);
  white-space: nowrap;
}
.install-go svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.install-x { width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--dim); display: grid; place-items: center; }
.install-x svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.install-steps { margin: 0; padding: 0 0 4px 22px; display: flex; flex-direction: column; gap: 12px; font-size: 14.5px; line-height: 1.45; color: var(--ice); }
.install-steps b { color: #F3E6C8; }
.ios-share { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; fill: none; stroke: var(--light); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Aide discrète au ralentisseur (une seule fois) */
.knob-hint {
  position: absolute;
  left: 44px;
  top: 50%;
  transform: translateY(-50%);
  padding: 5px 9px 4px;
  border-radius: 8px;
  background: #F3E6C8;
  color: #2E1F0A;
  font: 800 11.5px/1 var(--f-ui);
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
  pointer-events: none;
  animation: hint-in .4s ease-out both;
  z-index: 2;
}
.knob-hint::before { content: ""; position: absolute; left: -4px; top: 50%; margin-top: -4px; width: 8px; height: 8px; background: #F3E6C8; transform: rotate(45deg); }
@keyframes hint-in { from { opacity: 0; transform: translate(-6px, -50%); } }
#knobOpen.hint { animation: knob-call 1.1s ease-in-out 3; }
@keyframes knob-call {
  0%, 100% { box-shadow: 0 4px 8px -2px rgba(0, 0, 0, .7), inset 0 -2px 3px rgba(60, 40, 10, .45), 0 0 0 2px #12162F, 0 0 0 3px rgba(233, 211, 160, .35); }
  50% { box-shadow: 0 4px 8px -2px rgba(0, 0, 0, .7), inset 0 -2px 3px rgba(60, 40, 10, .45), 0 0 0 2px #12162F, 0 0 0 4px rgba(243, 230, 200, .9), 0 0 18px 4px rgba(243, 208, 138, .55); }
}

/* Mode allégé pour les appareils modestes : moins de flou et d'animations de fond */
body.lite .deck, body.lite .install-pill { -webkit-backdrop-filter: none; backdrop-filter: none; }
body.lite::before { animation: none; }
body.lite .cta { animation: none; }
body.lite .wave-empty .deco i { animation-duration: 3.2s; }

/* Toile de l'étincelle, posée sur le disque, sous les commandes */
.spark { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }

/* Repose-bras : petit plot métal où le bras se range à l'arrêt */
.ta-rest {
  position: absolute;
  left: var(--rest-x, 95%);
  top: var(--rest-y, 50%);
  width: 10px;
  height: 18px;
  margin: -9px 0 0 -5px;
  z-index: -1;
  border-radius: 3px;
  background: linear-gradient(90deg, #7C7F90, #F4EEE1 45%, #8A8D9C);
  box-shadow: 0 3px 6px rgba(0, 0, 0, .5);
  pointer-events: none;
}

.beats { --lamp: 36px; --bgap: 18px; --ggap: 18px; display: flex; justify-content: center; gap: var(--ggap); }
.beat-group { display: flex; gap: var(--bgap); }
.beats[data-size="m"] { --lamp: 31px; --bgap: 12px; --ggap: 22px; }
.beats[data-size="s"] { --lamp: 26px; --bgap: 7px; --ggap: 16px; }
.beats[data-size="xs"] { --lamp: 20px; --bgap: 4px; --ggap: 10px; }
.beats[data-size="xs"] .beat, .beats[data-size="s"] .beat { padding: 2px 0; }
.beats[data-size="xs"] .beat-n { font-size: 8.5px; }
.beat {
  border: 0;
  background: none;
  padding: 2px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  border-radius: 12px;
}
/* Couleur de lumière de chaque temps : bleu, et ambre pour le 1 */
.beat { --lc: var(--light); --lc-deep: var(--light-deep); --lc-hot: #F2FBFF; }
.beat[data-i="0"] { --lc: var(--amber); --lc-deep: var(--amber-deep); --lc-hot: var(--amber-hot); }
.beat-mark { height: 8px; display: grid; place-items: center; }
.beat-mark svg { width: 13px; height: 8px; fill: none; stroke: var(--lc); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .2s; }
.beat[data-state="accent"] .beat-mark svg { opacity: 1; }

.lamp {
  position: relative;
  width: var(--lamp);
  height: var(--lamp);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 62%, #131B28 0%, #070A0F 78%);
  box-shadow:
    inset 0 1px 1.5px rgba(255, 255, 255, .22),
    inset 0 -2px 5px rgba(0, 0, 0, .7),
    0 0 0 1px rgba(255, 255, 255, .07),
    0 4px 8px -3px rgba(0, 0, 0, .9);
  transition: box-shadow .25s ease-out;
}
.lamp::before {
  content: "";
  position: absolute;
  inset: calc(var(--lamp) * .26);
  border-radius: 50%;
  /* Veille : une braise de la couleur du temps, comme une LED en attente */
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--lc) 45%, #0B0F16) 0%, color-mix(in srgb, var(--lc) 18%, #0B0F16) 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5), 0 0 7px color-mix(in srgb, var(--lc) 28%, transparent);
  transition: background .22s ease-out, box-shadow .3s ease-out, inset .2s;
}
.lamp::after {
  content: "";
  position: absolute;
  left: 16%;
  right: 16%;
  top: 6%;
  height: 46%;
  border-radius: 50% 50% 45% 45% / 70% 70% 30% 30%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .02));
  pointer-events: none;
}
.lamp i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 72%;
  height: 1.5px;
  margin: -.75px 0 0 -36%;
  border-radius: 1px;
  background: rgba(255, 255, 255, .28);
  transform: rotate(-45deg);
  opacity: 0;
}
.beat-n { font: 500 10px/1 var(--f-num); color: var(--faint); transition: color .2s; }

/* États au repos */
.beat[data-i="0"] .beat-n { color: color-mix(in srgb, var(--amber) 65%, var(--faint)); }
.beat[data-state="accent"] .lamp::before { inset: calc(var(--lamp) * .22); background: color-mix(in srgb, var(--lc) 18%, #0B0F16); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--lc) 65%, transparent); }
.beat[data-state="accent"] .beat-n { color: var(--ice); }
.beat[data-i="0"][data-state="accent"] .beat-n { color: var(--amber); }
.beat[data-state="mute"] .lamp::before { background: transparent; box-shadow: inset 0 0 0 1.2px rgba(255, 255, 255, .16); }
.beat[data-state="mute"] .lamp i { opacity: 1; }
.beat[data-state="mute"] .beat-n { opacity: .55; }

/* Allumé */
.beat.on .lamp::before {
  background: radial-gradient(circle at 50% 38%, var(--lc-hot) 0%, var(--lc) 48%, var(--lc-deep) 100%);
  box-shadow: 0 0 10px 2px color-mix(in srgb, var(--lc) 60%, transparent);
  transition: none;
}
.beat.on .lamp { box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, .3), inset 0 -2px 5px rgba(0, 0, 0, .5), 0 0 0 1px color-mix(in srgb, var(--lc) 35%, transparent), 0 0 18px color-mix(in srgb, var(--lc) 30%, transparent); transition: none; }
.beat.on[data-state="accent"] .lamp::before { inset: calc(var(--lamp) * .16); box-shadow: 0 0 14px 5px color-mix(in srgb, var(--lc) 80%, transparent); }
.beat.on[data-state="accent"] .lamp { box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, .35), 0 0 0 1px color-mix(in srgb, var(--lc) 60%, transparent), 0 0 26px 2px color-mix(in srgb, var(--lc) 45%, transparent); }
.beat.on[data-state="mute"] .lamp::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--lc); }
.beat.on[data-state="mute"] .lamp { box-shadow: inset 0 1px 1.5px rgba(255, 255, 255, .22), inset 0 -2px 5px rgba(0, 0, 0, .7), 0 0 0 1px color-mix(in srgb, var(--lc) 30%, transparent); }
.beat.on .beat-n { color: var(--lc); }

/* Petit éclat quand on change l'état d'un temps */
.beat.flash .lamp::before { animation: lamp-flash .38s ease-out; }
@keyframes lamp-flash {
  from { background: var(--lc); box-shadow: 0 0 12px 3px color-mix(in srgb, var(--lc) 70%, transparent); }
}

/* Lueurs du pupitre métronome : bleu quand il tourne, pulsation ambre sur le 1 */
.metro { position: relative; isolation: isolate; overflow: hidden; }
.metro::before, .metro-glow {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
}
.metro::before {
  background:
    radial-gradient(75% 38% at 50% 14%, rgba(86, 193, 255, .16), rgba(86, 193, 255, 0) 72%),
    radial-gradient(90% 40% at 50% 100%, rgba(86, 193, 255, .07), rgba(86, 193, 255, 0) 70%);
  opacity: 0;
  transition: opacity .7s ease;
}
.metro.running::before { opacity: 1; }
.metro-glow {
  background: radial-gradient(60% 34% at 50% 12%, rgba(255, 166, 61, .22), rgba(255, 166, 61, 0) 72%);
  opacity: 0;
}

/* Sélecteur 33 / 45 tours : un levier en laiton qui glisse */
.rpm {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 70px;
  height: 30px;
  margin-left: auto;
  padding: 2px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  background:
    linear-gradient(#11152F, #11152F) padding-box,
    conic-gradient(from 210deg, #6E7183, #E9E2D2, #8C7A5C, #F4EBDA, #6E7183, #CDBB98, #6E7183) border-box;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, .6);
  flex: none;
}
.rpm-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  border-radius: 999px;
  background: linear-gradient(180deg, #F7E6BC, #C9A15A 55%, #A9823F);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .6);
  transition: transform .3s cubic-bezier(.3, 1.4, .5, 1);
}
.metro[data-rpm="45"] .rpm-knob { transform: translateX(100%); }
.rpm-opt {
  position: relative;
  border: 0;
  padding: 0;
  background: none;
  font: 600 11px/1 var(--f-num);
  color: var(--dim);
  transition: color .3s;
}
.rpm-opt[aria-checked="true"] { color: #2E1F0A; }
.metro-head { gap: 10px; }

/* Ambiance 45 tours : « lampe d'ampli » — cuivre ambré, champagne doré, soupçon d'or rose */
.metro[data-rpm="45"] {
  --light: #FFC56E;
  --light-deep: #C7762A;
  --light-soft: rgba(255, 197, 110, .35);
  --amber: #FF8A3D;
  --amber-deep: #A6461A;
  --amber-hot: #FFE6C4;
  background:
    radial-gradient(110% 45% at 100% 0%, rgba(255, 205, 130, .13), rgba(255, 205, 130, 0) 60%),
    radial-gradient(90% 45% at 0% 100%, rgba(255, 122, 58, .2), rgba(255, 122, 58, 0) 62%),
    radial-gradient(70% 35% at 100% 100%, rgba(232, 140, 130, .13), rgba(232, 140, 130, 0) 60%),
    linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  background-color: rgba(30, 30, 60, .82);
}
.metro[data-rpm="45"]::before {
  background:
    radial-gradient(75% 38% at 50% 14%, rgba(255, 197, 110, .16), rgba(255, 197, 110, 0) 72%),
    radial-gradient(90% 40% at 50% 100%, rgba(255, 122, 58, .1), rgba(255, 122, 58, 0) 70%);
}
.metro[data-rpm="45"] .metro-glow { background: radial-gradient(60% 34% at 50% 12%, rgba(255, 138, 61, .24), rgba(255, 138, 61, 0) 72%); }
.metro[data-rpm="45"] .record-sheen {
  background: conic-gradient(from 300deg,
    rgba(255, 138, 61, 0) 0deg, rgba(255, 138, 61, .26) 22deg, rgba(232, 140, 130, .15) 40deg, rgba(255, 138, 61, 0) 62deg,
    rgba(255, 210, 140, 0) 170deg, rgba(255, 210, 140, .18) 195deg, rgba(255, 210, 140, 0) 222deg,
    rgba(255, 138, 61, 0) 360deg);
}
.metro[data-rpm="45"] .go-ic { background: radial-gradient(circle at 40% 30%, #FFE6C4 0%, var(--light) 45%, var(--light-deep) 100%); color: #2A1406; box-shadow: 0 0 0 1px rgba(255, 255, 255, .2), 0 0 12px rgba(255, 170, 80, .4); }
.metro[data-rpm="45"] .bpm-input { background-image: linear-gradient(180deg, #FFFFFF 10%, #FFD9A0 100%); }
.metro[data-rpm="45"].running .bpm-input { filter: drop-shadow(0 0 10px rgba(255, 170, 80, .5)); }
.metro[data-rpm="45"] .tempo-win.dragging::before { filter: drop-shadow(0 0 6px rgba(255, 170, 80, .7)); }

.beats-hint { margin: -4px 0 0; height: 16px; }  /* simple espace : garde le disque à sa place */

/* Fenêtre centrale entourée des ± */
.mctl {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) 50px;
  grid-template-rows: auto auto;
  column-gap: 16px;
  row-gap: 50px;
  align-items: center;
  justify-items: center;
  padding: 4px 4px 0;
}
.step {
  width: 48px;
  height: 48px;
  border: 0;
  padding: 0;
  font: 500 13px/1 var(--f-num);
  font-variant-numeric: tabular-nums;
}
/* Molettes hi-fi : un fin cerclage de métal brossé autour d'un verre sombre */
.step.s1 {
  border-radius: 50%;
  border: 1.5px solid transparent;
  background:
    radial-gradient(circle at 40% 30%, #2A3060 0%, #191D3D 70%) padding-box,
    conic-gradient(from 210deg, #6E7183, #E9E2D2, #8C7A5C, #F4EBDA, #6E7183, #CDBB98, #6E7183) border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 4px 10px -4px rgba(0, 0, 0, .7);
  color: var(--ice);
}
.step.s5 {
  border-radius: 15px;
  border: 1.5px solid transparent;
  background:
    radial-gradient(circle at 40% 30%, #1F3E6E 0%, #182448 75%) padding-box,
    conic-gradient(from 210deg, #6E7183, #E9E2D2, #8C7A5C, #F4EBDA, #6E7183, #CDBB98, #6E7183) border-box;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 4px 10px -4px rgba(0, 0, 0, .7);
  color: #8FD3FF;
}

/* Grand vinyle derrière les commandes, centré sur l'étiquette Tempo */
.record {
  position: absolute;
  left: var(--rx, 50%);
  top: var(--ry, 50%);
  width: 640px;
  height: 640px;
  margin: -320px 0 0 -320px;
  z-index: -1;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(circle, transparent 0 70px, #000 76px, #000 170px, rgba(0, 0, 0, .35) 240px, transparent 300px);
  mask-image: radial-gradient(circle, transparent 0 70px, #000 76px, #000 170px, rgba(0, 0, 0, .35) 240px, transparent 300px);
}
.record-disc, .record-sheen { position: absolute; inset: 0; border-radius: 50%; }
.record-disc {
  background:
    repeating-radial-gradient(circle, rgba(255, 255, 255, 0) 0 2.6px, rgba(255, 255, 255, .1) 2.6px 3.4px),
    radial-gradient(circle, rgba(255, 255, 255, 0) 0 118px, rgba(255, 255, 255, .09) 119px 121px, rgba(255, 255, 255, 0) 122px),
    conic-gradient(from 0deg,
      rgba(255, 255, 255, 0) 0deg, rgba(255, 255, 255, .09) 30deg, rgba(255, 255, 255, 0) 60deg,
      rgba(255, 255, 255, 0) 180deg, rgba(255, 255, 255, .065) 210deg, rgba(255, 255, 255, 0) 240deg),
    radial-gradient(circle, rgba(6, 8, 22, .64) 0, rgba(6, 8, 22, .42) 60%, rgba(6, 8, 22, 0) 72%);
  will-change: transform;
}
/* Lumière de scène fixe posée sur le disque : couchant d'un côté, bleu de l'autre */
.record-sheen {
  background:
    conic-gradient(from 300deg,
      rgba(255, 160, 80, 0) 0deg, rgba(255, 160, 80, .30) 22deg, rgba(255, 94, 126, .16) 40deg, rgba(255, 160, 80, 0) 62deg,
      rgba(86, 193, 255, 0) 170deg, rgba(86, 193, 255, .16) 195deg, rgba(86, 193, 255, 0) 222deg,
      rgba(255, 160, 80, 0) 360deg);
}

/* Bras de platine : rangé hors du disque à l'arrêt, posé sur les sillons quand ça tourne */
.tonearm {
  position: absolute;
  left: var(--px, 90%);
  top: var(--py, 80px);
  width: 0;
  height: 0;
  z-index: -1;
  pointer-events: none;
}
.ta-arm {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  transform: rotate(var(--rest, -12deg));
  transition: none;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .55));
}
.tonearm.ready .ta-arm { transition: transform 1.15s cubic-bezier(.45, .05, .25, 1); }
.metro.running .ta-arm { transform: rotate(var(--play, 4deg)); transition-delay: .15s; }
.ta-arm svg { position: absolute; left: -22px; top: -36px; overflow: visible; }
.ta-led { fill: var(--light); opacity: .35; filter: drop-shadow(0 0 3px currentColor); }
.metro.running .ta-led { opacity: .9; }
.ta-base {
  position: absolute;
  left: -14px;
  top: -14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #20254A 0 4px, rgba(0, 0, 0, 0) 4.5px),
    radial-gradient(circle, rgba(0, 0, 0, 0) 0 8px, rgba(0, 0, 0, .35) 8.5px 9.5px, rgba(0, 0, 0, 0) 10px),
    conic-gradient(from 200deg, #6E7183, #EFE8D8, #8C7A5C, #F7EFDF, #707487, #D3C19E, #6E7183);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .6), inset 0 1px 1px rgba(255, 255, 255, .6);
}

/* L'étiquette du disque : la fenêtre Tempo, ronde, cerclée de métal */
.tempo-win {
  width: 136px;
  height: 136px;
  border-radius: 50%;
  padding: 0 6px;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0) 0 9px, rgba(255, 255, 255, .06) 9.5px 10px, rgba(255, 255, 255, 0) 10.5px),
    radial-gradient(120% 90% at 30% 0%, rgba(255, 170, 90, .22), rgba(255, 170, 90, 0) 60%),
    radial-gradient(110% 90% at 80% 110%, rgba(255, 79, 123, .22), rgba(255, 79, 123, 0) 60%),
    radial-gradient(circle, #252B5C 0%, #171B3A 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .16),
    inset 0 -10px 20px -10px rgba(0, 0, 0, .6),
    0 0 0 2px #0E1128,
    0 10px 26px -10px rgba(0, 0, 0, .9);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: default;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
/* Anneau de métal brossé autour de l'étiquette */
.tempo-win::before {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(from 200deg, #6E7183, #EFE8D8, #8C7A5C, #F7EFDF, #707487, #D3C19E, #6E7183);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
  opacity: .85;
}
.tempo-win::after { left: 14%; right: 14%; top: 4px; height: 40%; }
.tempo-win > * { position: relative; z-index: 1; }
.tempo-win .bpm-input { pointer-events: none; cursor: inherit; }
.tempo-win.editing .bpm-input { pointer-events: auto; cursor: text; }
.tempo-win.dragging::before { opacity: 1; filter: drop-shadow(0 0 6px rgba(86, 193, 255, .7)); }
.tempo-win .eyebrow { font-size: 9px; }
.bpm-input {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: center;
  font: 500 35px/1.1 var(--f-num);
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  color: var(--ice);
  background: linear-gradient(180deg, #FFFFFF 10%, #9FD8FF 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding: 0;
  border-radius: 10px;
  caret-color: var(--light);
  transition: text-shadow .3s, color .3s;
}
.bpm-input:focus { background: rgba(0, 0, 0, .3); -webkit-text-fill-color: #fff; color: #fff; }
.metro.running .bpm-input { filter: drop-shadow(0 0 10px rgba(86, 193, 255, .5)); }

.go {
  height: 44px;
  padding: 0 18px 0 7px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 60%) padding-box,
    linear-gradient(#1B2045, #151937) padding-box,
    conic-gradient(from 210deg, #6E7183, #E9E2D2, #8C7A5C, #F4EBDA, #6E7183, #CDBB98, #6E7183) border-box;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 800;
  color: var(--fg);
}
.go-ic {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 40% 30%, #8FDBFF 0%, var(--light) 45%, var(--light-deep) 100%);
  color: #04111F;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .2), 0 0 12px rgba(86, 193, 255, .35);
}
.go-ic svg { width: 14px; height: 14px; fill: currentColor; }
.go .i-stop { display: none; }
.go.running .i-play { display: none; }
.go.running .i-stop { display: block; }
.go.running { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 22px -4px rgba(86, 193, 255, .6); }
.go:active { transform: scale(.97); }

input.metro-slider { --fill: var(--ice); --track: rgba(255, 255, 255, .08); }
/* Réglette du tempo isolée sur sa ligne, avec ses bornes ; plus d'air autour des commandes */
.mslider-row { display: grid; grid-template-columns: 22px 1fr 28px; align-items: center; gap: 8px; margin-top: 10px; }
.mslider-row span { font: 500 10px/1 var(--f-num); color: var(--faint); font-variant-numeric: tabular-nums; }
.mslider-row span:last-child { text-align: right; }
.metro { gap: 16px; }
.metro .subdiv { margin-top: 4px; }
.metro .sounds { margin-top: 2px; }
.metro .vol { margin-top: 2px; }
/* Boutons de réglette en métal brossé, comme une molette de platine */
input.metro-slider::-webkit-slider-thumb, #mVol::-webkit-slider-thumb {
  width: 24px;
  height: 24px;
  margin-top: -10px;
  background:
    radial-gradient(circle, #20254A 0 2.5px, rgba(0, 0, 0, 0) 3px),
    radial-gradient(circle, rgba(0, 0, 0, 0) 0 7px, rgba(0, 0, 0, .3) 7.5px 8px, rgba(0, 0, 0, 0) 8.5px),
    conic-gradient(from 200deg, #6E7183, #EFE8D8, #8C7A5C, #F7EFDF, #707487, #D3C19E, #6E7183);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .45), 0 3px 8px rgba(0, 0, 0, .6), inset 0 1px 1px rgba(255, 255, 255, .6);
}
input.metro-slider::-moz-range-thumb, #mVol::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background:
    radial-gradient(circle, #20254A 0 2.5px, rgba(0, 0, 0, 0) 3px),
    conic-gradient(from 200deg, #6E7183, #EFE8D8, #8C7A5C, #F7EFDF, #707487, #D3C19E, #6E7183);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .45), 0 3px 8px rgba(0, 0, 0, .6);
}

.subdiv {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-radius: 18px;
  padding: 3px;
  overflow: hidden;
}
.sub {
  position: relative;
  height: 58px;
  border: 0;
  background: transparent;
  color: #697285;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 2px;
  min-width: 0;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  border-radius: 14px;
  transition: color .2s;
}
.sub + .sub::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: rgba(255, 255, 255, .08);
}
/* Échelle de bleus : plus on découpe le temps, plus le bleu est profond (afficheur d'ampli) */
.sub[data-sub="1"] { --sc: #A8E2FF; }
.sub[data-sub="2"] { --sc: #6FC2FF; }
.sub[data-sub="3"] { --sc: #4C94FF; }
.sub[data-sub="4"] { --sc: #6A6CFF; }
.sub { color: color-mix(in srgb, var(--sc, #697285) 48%, #4A5070); }
.sub svg { height: 21px; width: auto; fill: currentColor; flex: none; }
.sub[aria-checked="true"] {
  color: #fff;
  background: radial-gradient(90% 100% at 50% 120%, color-mix(in srgb, var(--sc) 38%, transparent), rgba(0, 0, 0, 0) 70%);
}
.sub[aria-checked="true"] svg { color: var(--sc); filter: drop-shadow(0 0 7px color-mix(in srgb, var(--sc) 75%, transparent)); }
.sub[aria-checked="true"]::after {
  content: "";
  position: absolute;
  left: 30%;
  right: 30%;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  background: var(--sc);
  box-shadow: 0 0 8px var(--sc);
}
.sub[aria-checked="true"] + .sub::before, .sub[aria-checked="true"]::before { opacity: 0; }

.vol { display: flex; align-items: center; gap: 10px; padding: 0 2px; }
.vol-ic { width: 24px; height: 24px; flex: none; color: var(--light); }
.vol-ic .spk { fill: currentColor; }
.vol-ic path:not(.spk) { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; transition: opacity .2s; }
.vol-ic .mute { opacity: 0; }
.vol-ic.v0 { color: var(--faint); }
.vol-ic.v0 .w1, .vol-ic.v0 .w2, .vol-ic.v0 .w3 { opacity: 0; }
.vol-ic.v0 .mute { opacity: 1; }
.vol-ic.v1 .w2, .vol-ic.v1 .w3, .vol-ic.v2 .w3 { opacity: .15; }
.vol-wrap { position: relative; flex: 1; min-width: 0; }
.vol-meter {
  position: absolute;
  left: 0;
  top: 50%;
  height: 8px;
  margin-top: -4px;
  width: 0;
  border-radius: 6px;
  background: var(--light);
  filter: blur(4px);
  opacity: 0;
  pointer-events: none;
}

/* ---------- Toast & dépôt ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 20px);
  max-width: min(92vw, 420px);
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(238, 242, 248, .96);
  color: var(--ink);
  font-weight: 700;
  font-size: 13.5px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.drop {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(10, 12, 17, .84);
  z-index: 30;
  font-weight: 800;
  font-size: 20px;
}
.drop span { padding: 40px 50px; border: 2px dashed var(--light); border-radius: 24px; }
.drop.show { display: grid; }

/* ---------- Écrans courts / étroits ---------- */
@media (max-height: 760px) {
  .wave-wrap { height: 104px; }
  .bpm-now output { font-size: 40px; }
  .bpm-input { font-size: 33px; }
  .sub { height: 54px; }
}
@media (max-width: 380px) {
  .btn-change svg { display: none; }
  .btn-change { padding: 0 12px; font-size: 12.5px; }
  .brand-name { font-size: 14px; }
  .remove .long { display: none; }
  .remove .short { display: inline; }
  .mctl { column-gap: 10px; }
  .orig-tempo svg { display: none; }
  .beats { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* En-tête du métronome sur téléphone : titre · 33/45 · mesure · figure tiennent sur une ligne */
@media (max-width: 430px) {
  .metro-head { gap: 8px; }
  .metro .metro-title { gap: 7px; }
  .metro .rpm { width: 60px; }
  .metro .meter { width: 46px; }
  .fig-wrap { margin-left: 0; }
  .figure .fig-ic svg { width: 30px; }
}

/* Titre du métronome : plein centre, entre deux filets laiton à losange */
.metro-plaque { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 0 -6px; font: 600 15px/1 "EB Garamond", Garamond, serif; letter-spacing: .34em; text-transform: uppercase; }
.metro-plaque span { padding-left: .34em; background: linear-gradient(180deg, #FBE3A6, #E3BC6C 55%, #B98A3E); -webkit-background-clip: text; background-clip: text; color: transparent; }
.metro-plaque i { width: 52px; height: 1px; background: linear-gradient(90deg, rgba(217, 178, 106, 0), #D9B26A); }
.metro-plaque i:last-child { background: linear-gradient(90deg, #D9B26A, rgba(217, 178, 106, 0)); }
.metro-plaque b { width: 5px; height: 5px; background: #E3C27F; transform: rotate(45deg); flex: none; }
/* En-tête : pendule et Mute à gauche ; 33/45 · mesure · figure groupés à droite */
.metro-head { justify-content: flex-start; }
.metro-head .rpm { margin-left: auto; }
/* Devise gravée sur le vinyle */
.record-label { position: absolute; left: var(--rx, 50%); top: var(--ry, 50%); width: 640px; height: 640px; margin: -320px 0 0 -320px; z-index: -1; pointer-events: none; overflow: visible; }
.record-label text { font: italic 500 14px "EB Garamond", Garamond, serif; letter-spacing: .14em; fill: rgba(241, 226, 191, .5); transition: fill .9s ease, filter .9s ease; }
/* Métronome en marche : la gravure attrape doucement la lumière */
.metro.running .record-label text { fill: rgba(255, 233, 186, .82); filter: drop-shadow(0 0 4px rgba(255, 196, 110, .45)); }

/* Bouton Démarrer : un peu plus bas, détaché du vinyle par un anneau sombre et un liseré laiton */
.go { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 0 6px rgba(12, 15, 36, .62), 0 0 0 7px rgba(217, 178, 106, .28), 0 10px 22px -8px rgba(0, 0, 0, .85); }
.go.running { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 0 6px rgba(12, 15, 36, .62), 0 0 0 7px rgba(86, 193, 255, .45), 0 0 26px -2px rgba(86, 193, 255, .55); }

/* Barre des figures : plus fine, sous une vitre (translucide, dépolie, liseré clair) */
.metro .subdiv {
  border-radius: 16px;
  padding: 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .025) 55%, rgba(255, 255, 255, .04));
  -webkit-backdrop-filter: blur(8px) saturate(1.3);
  backdrop-filter: blur(8px) saturate(1.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 0 0 1px rgba(255, 255, 255, .12), inset 0 -8px 14px -10px rgba(0, 0, 0, .5), 0 8px 18px -14px rgba(0, 0, 0, .9);
}
.metro .subdiv::after { top: 1px; height: 46%; background: linear-gradient(180deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, 0)); }
.metro .subdiv .sub { height: 42px; gap: 2px; font-size: 9.5px; border-radius: 12px; }
.metro .subdiv .sub svg { height: 16px; }
.metro .subdiv .sub + .sub::before { top: 10px; bottom: 10px; }
body.lite .metro .subdiv { -webkit-backdrop-filter: none; backdrop-filter: none; }
.metro[data-rpm="45"].running .go { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 0 6px rgba(12, 15, 36, .62), 0 0 0 7px rgba(255, 170, 80, .5), 0 0 26px -2px rgba(255, 150, 70, .5); }

/* Le petit batteur de l'étiquette : caché à l'arrêt, il apparaît quand le métronome tourne */
.tempo-win > .tw-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.tw-art .tw-dr-pos { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s cubic-bezier(.3, 1.2, .4, 1); }
.metro.running .tw-art .tw-dr-pos { opacity: .55; transform: none; }
.dr .star { fill: #FFD58A; }
.dr .body { fill: #E9DDC0; }
.dr .head, .dr .hand { fill: #F6ECD5; }
.dr .arm { fill: none; stroke: #E9DDC0; stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.dr .stick { fill: none; stroke: #F2D08A; stroke-width: .7; stroke-linecap: round; }
.dr .shell { fill: #C98B4A; }
.dr .lug { stroke: #F2D08A; stroke-width: .35; }
.dr .drumhead { fill: #FFF6E0; }
.dr .stand { fill: none; stroke: #B9A27A; stroke-width: .55; stroke-linecap: round; }
.dr .hitfx { fill: none; stroke: #FFD38A; stroke-width: .55; stroke-linecap: round; display: none; }
.dr .star { fill: #FFC56E; display: none; }
.dr.hit .hitfx, .dr.one .star { display: inline; }
.dr [class^="aL"], .dr [class^="aR"] { display: none; }
.dr.L0 .aL0, .dr.L1 .aL1, .dr.L2 .aL2, .dr.L3 .aL3, .dr.R0 .aR0, .dr.R1 .aR1, .dr.R2 .aR2, .dr.R3 .aR3 { display: inline; }
/* En marche : le chiffre glisse en haut de l'étiquette pour laisser la place au batteur */
.tempo-win .bpm-input, .tempo-win .eyebrow, .tempo-win .unit { transition: transform .7s cubic-bezier(.3, 1.2, .4, 1), opacity .5s ease, text-shadow .3s, color .3s; }
.metro.running .tempo-win .bpm-input { transform: translateY(-27px) scale(.66); }
.metro.running .tempo-win .eyebrow, .metro.running .tempo-win .unit { opacity: 0; }
/* ±1 / ±5 ou saisie pendant la marche : le chiffre revient au centre le temps de le lire */
.metro.running .tempo-win.peek .bpm-input, .metro.running .tempo-win.editing .bpm-input { transform: none; transition-duration: .25s; }
.metro.running .tempo-win.peek .eyebrow, .metro.running .tempo-win.peek .unit, .metro.running .tempo-win.editing .eyebrow, .metro.running .tempo-win.editing .unit { opacity: 1; transition-duration: .2s; }
.metro.running .tempo-win.peek .tw-dr-pos, .metro.running .tempo-win.editing .tw-dr-pos { opacity: .12; transition-duration: .25s; }
/* En marche, le petit anneau central de l'étiquette s'efface (il passerait derrière la tête du batteur) */
.metro.running .tempo-win {
  background:
    radial-gradient(120% 90% at 30% 0%, rgba(255, 170, 90, .22), rgba(255, 170, 90, 0) 60%),
    radial-gradient(110% 90% at 80% 110%, rgba(255, 79, 123, .22), rgba(255, 79, 123, 0) 60%),
    radial-gradient(circle, #252B5C 0%, #171B3A 100%);
}

/* Second gros sillon : anneau de laiton brossé, comme le bord d'un plateau de platine, avec ses points stroboscopiques */
.record-ring, .record-strobe { position: absolute; left: 50%; top: 50%; border-radius: 50%; pointer-events: none; }
.record-ring {
  width: 344px; height: 344px; margin: -172px 0 0 -172px;
  border: 2.5px solid transparent;
  background: conic-gradient(from 210deg, #7A5A2A, #F3D9A0, #A87A36, #FFF0C8, #8C6A32, #E8C27C, #7A5A2A) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) padding-box exclude, linear-gradient(#000 0 0);
  opacity: .62;
  box-shadow: 0 0 6px rgba(255, 200, 120, .12);
}
.record-strobe {
  width: 330px; height: 330px; margin: -165px 0 0 -165px;
  background: repeating-conic-gradient(rgba(255, 228, 170, .55) 0 .7deg, rgba(255, 228, 170, 0) .7deg 3deg);
  -webkit-mask: radial-gradient(circle, transparent 0 161px, #000 161.5px 164px, transparent 164.5px);
  mask: radial-gradient(circle, transparent 0 161px, #000 161.5px 164px, transparent 164.5px);
  opacity: .5;
}


/* BPM d'origine en lecture seule : pas de curseur de saisie tant qu'on n'a pas double-touché */
#origBpm[readonly] { cursor: default; -webkit-user-select: none; user-select: none; caret-color: transparent; }
