:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --inchiostro: #18181b;
  --incerto: #a1a1aa;
  --secondario: #71717a;
  --linea: #ececef;
  --accento: #ff5a36;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(10px, 3vh, 28px) 16px;
  overflow: hidden;
}

.nota {
  position: relative;
  width: min(580px, 100%);
  background: var(--carta);
  border: 1px solid var(--linea);
  border-radius: 20px;
  padding: clamp(12px, 3vh, 22px) clamp(14px, 4vw, 24px) clamp(10px, 2.4vh, 18px);
  box-shadow: 0 24px 48px -30px rgba(24, 24, 27, .28), 0 2px 6px -3px rgba(24, 24, 27, .08);
}

.testa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: clamp(11px, min(2.8vw, 3vh), 13px);
  color: var(--secondario);
}

.marchio { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--inchiostro); font-variation-settings: "wdth" 96; }
.marchio svg { width: 1.45em; height: 1.45em; fill: var(--inchiostro); stroke: #fff; stroke-width: 1.6; stroke-linecap: round; }

.tempo { display: inline-flex; font-weight: 500; letter-spacing: .01em; }
.tempo span { display: inline-block; width: .62em; text-align: center; }
.tempo span.punti { width: .32em; }

.titolo {
  position: relative;
  margin-top: clamp(8px, 2.2vh, 16px);
  min-height: calc(2 * 1.04 * var(--tit));
  --tit: clamp(22px, min(6.2vw, 7vh), 36px);
  display: flex;
  align-items: flex-end;
}

.titolo__vuoto, .titolo__pieno {
  margin: 0;
  font-size: var(--tit);
  line-height: 1.04;
  letter-spacing: -.02em;
}

.titolo__vuoto { position: absolute; left: 0; bottom: 0; color: #d4d4d8; font-weight: 500; font-variation-settings: "wdth" 100; }
.titolo__pieno { font-weight: 650; font-variation-settings: "wdth" 100; }
.titolo__pieno .lettera { display: inline-block; white-space: pre; will-change: transform; }
.titolo__pieno .parola-t { display: inline-block; white-space: nowrap; }

.onda {
  margin-top: clamp(8px, 2vh, 14px);
  height: clamp(30px, 8vh, 52px);
  border-bottom: 1px solid var(--linea);
}
.onda svg { display: block; width: 100%; height: 100%; overflow: visible; }
.onda rect { fill: var(--inchiostro); }
.onda rect.viva { fill: var(--accento); }

.testo {
  margin: clamp(8px, 2.2vh, 16px) 0 0;
  min-height: calc(5 * 1.5em);
  font-size: clamp(13px, min(3.5vw, 3.7vh), 17px);
  line-height: 1.5;
  font-weight: 450;
  color: var(--incerto);
}

.parola {
  position: relative;
  display: inline-block;
  opacity: 0;
  cursor: default;
  border-radius: 4px;
  transition: background-color .2s;
}
.parola.fissa:hover { background: #f4f4f5; }
.parola.fissa:focus-visible { outline: 2px solid var(--accento); outline-offset: 1px; }

.parola--doppia { white-space: nowrap; vertical-align: baseline; }
.parola__ombra { visibility: hidden; }
.parola__giusta, .parola__sbagliata { position: absolute; left: 0; top: 0; white-space: nowrap; }
.parola__lampo {
  position: absolute;
  inset: .08em -.18em;
  border-radius: 5px;
  background: color-mix(in srgb, var(--accento) 16%, transparent);
  opacity: 0;
  z-index: -1;
}

.piede {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: clamp(8px, 2vh, 14px);
  padding-top: clamp(8px, 1.8vh, 12px);
  border-top: 1px solid var(--linea);
}

.stato { position: relative; display: grid; font-size: clamp(11px, min(2.9vw, 3.1vh), 13px); font-weight: 500; color: var(--secondario); }
.stato__voce { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 6px; opacity: 0; }
.stato__voce svg { width: 1.1em; height: 1.1em; fill: none; stroke: var(--inchiostro); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stato__voce [data-spunta] { stroke-dasharray: 1; stroke-dashoffset: 1; }
.stato__voce--luce {
  background: linear-gradient(90deg, var(--secondario) 0%, var(--secondario) 35%, #d4d4d8 50%, var(--secondario) 65%, var(--secondario) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tasto {
  position: relative;
  width: clamp(32px, 8vh, 40px);
  height: clamp(32px, 8vh, 40px);
  border-radius: 999px;
  border: 1px solid var(--linea);
  background: #fff;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(24, 24, 27, .06);
}
.tasto svg { grid-area: 1 / 1; width: 55%; height: 55%; }
.tasto__ferma { fill: var(--accento); }
.tasto__ancora { fill: none; stroke: var(--inchiostro); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.tasto:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
@media (hover: hover) {
  .tasto:hover { border-color: #d4d4d8; }
}

.nuvola {
  position: absolute;
  left: 0;
  top: 0;
  padding: 3px 7px;
  border-radius: 6px;
  background: var(--inchiostro);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  white-space: nowrap;
}
