:root {
  --fondo: #000000;
  --card: #111113;
  --bordo: rgba(255, 255, 255, 0.075);
  --testo: #ededf0;
  --grigio: #8c8c95;
  --grigio-scuro: #4a4a52;
  --pulsante: #18181b;
  --scritta-scura: #141518;
  --accento: #b3a4ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 14px;
  overflow: hidden;
}

.tool {
  position: relative;
  width: min(340px, 100%);
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 60%),
    var(--card);
  border: 1px solid var(--bordo);
  border-radius: 22px;
  padding: min(16px, 3.2vh) min(16px, 4vw);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 2px 6px rgba(0, 0, 0, 0.5),
    0 24px 48px -18px rgba(0, 0, 0, 0.9),
    0 60px 90px -40px rgba(120, 100, 255, 0.12);
}

.tool__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: min(12px, 2.4vh);
}

.tool__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 640;
  font-stretch: 108%;
  letter-spacing: -0.01em;
}

.tool__logo {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 7px;
  background: linear-gradient(160deg, #2b2b30, #19191c);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.tool__logo svg { width: 16px; height: 16px; fill: none; stroke: var(--accento); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.tool__chip {
  font-size: 11px;
  font-weight: 560;
  color: var(--grigio);
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--bordo);
}

/* ---- the track ---- */
.track {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: min(10px, 2vh);
}

.track__cover {
  width: min(44px, 9vh);
  height: min(44px, 9vh);
  flex: none;
  object-fit: cover;
  object-position: 50% 45%;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 6px 14px -6px rgba(0, 0, 0, 0.9);
}

.track__meta { min-width: 0; flex: 1; }

.track__title { font-size: 14px; font-weight: 620; letter-spacing: -0.01em; }

.track__sub {
  font-size: 11.5px;
  color: var(--grigio);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track__lufs {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.05;
}

.track__num {
  min-width: 3.3em;
  text-align: right;
  font-size: 17px;
  font-weight: 640;
  font-stretch: 92%;
  letter-spacing: -0.02em;
  color: var(--testo);
}

.track__unit { font-size: 9.5px; font-weight: 600; letter-spacing: 0.08em; color: var(--grigio); margin-top: 2px; }

/* ---- the waveform ---- */
.wave {
  position: relative;
  height: min(74px, 15vh);
  border-radius: 12px;
  background: linear-gradient(180deg, #0b0b0d, #0e0e11);
  border: 1px solid var(--bordo);
  overflow: hidden;
}

.wave__bars { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.wave__ceil {
  position: absolute;
  left: 8px; right: 8px;
  height: 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.09);
  pointer-events: none;
}

.wave__ceil--top { top: 9%; }

.wave__ceil--bottom { bottom: 9%; }

.legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 2px min(6px, 1.2vh);
  font-size: 10px;
  font-weight: 560;
  letter-spacing: 0.02em;
  color: var(--grigio-scuro);
}

.legend__ceil { display: inline-flex; align-items: center; gap: 6px; }

.legend__ceil::before { content: ""; width: 14px; border-top: 1px dashed rgba(255, 255, 255, 0.22); }

.wave__head {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #f4f1ff 20%, #ffffff 50%, #f4f1ff 80%, rgba(255, 255, 255, 0));
  box-shadow: 0 0 12px 2px rgba(179, 164, 255, 0.6);
  opacity: 0;
  pointer-events: none;
}

.roll {
  position: relative;
  display: inline-flex;
  overflow: hidden;
  vertical-align: bottom;
}

.roll__in { display: inline-block; white-space: nowrap; }

/* ---- the button ---- */
.master-wrap {
  position: relative;
  margin-top: min(14px, 2.8vh);
  height: min(60px, 12vh);
  perspective: 600px;
}

.master {
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #202024, var(--pulsante));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -2px 6px rgba(0, 0, 0, 0.55), 0 10px 24px -12px rgba(0, 0, 0, 0.95);
  color: var(--testo);
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

/* the chrome rim: a gradient masked to a one-pixel ring, its light band follows the pointer */
.master::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(105deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.1) calc(var(--sheen, -30%) - 16%), rgba(255, 255, 255, 0.95) var(--sheen, -30%), rgba(255, 255, 255, 0.1) calc(var(--sheen, -30%) + 16%), rgba(255, 255, 255, 0.1) 100%);
  -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 exclude, linear-gradient(#000 0 0);
  pointer-events: none;
  z-index: 4;
}

.master:focus-visible { box-shadow: 0 0 0 2px var(--fondo), 0 0 0 4px rgba(179, 164, 255, 0.7); }

.master__metal { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; }

.master__ripple {
  position: absolute;
  left: 0; top: 0;
  width: 120px; height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0) 55%, rgba(255, 255, 255, 0.3) 78%, rgba(255, 255, 255, 0) 100%);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.master__label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 620;
  font-stretch: 104%;
  letter-spacing: -0.005em;
  pointer-events: none;
  z-index: 3;
}

.master__label--dark { color: var(--scritta-scura); clip-path: inset(100% 0 0 0); }

.pct { display: inline-block; min-width: 2.6em; text-align: left; color: inherit; opacity: 0.7; }

.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.ic__bars path { transform-box: fill-box; transform-origin: 50% 50%; }

.ic__ok { stroke-dasharray: 22; stroke-dashoffset: 22; }

.tool__hint {
  margin-top: min(10px, 2vh);
  text-align: center;
  font-size: 12px;
  color: var(--grigio);
}

.pointer {
  position: absolute; left: 0; top: 0;
  width: 20px; height: 20px;
  fill: #fff; stroke: #111; stroke-width: 1.4; stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
  opacity: 0;
  pointer-events: none;
  z-index: 50;
}

@media (max-height: 360px) {
  .tool__hint, .legend { display: none; }
}
