:root {
  --fondo: #f2f2f2;
  --pannello: #ffffff;
  --inchiostro: #111113;
  --grigio: #6f6f77;
  --grigio-chiaro: #a9a9b1;
  --bordo: rgba(17, 17, 19, 0.08);
  --tasto: #f5f5f6;
  --tasto-premuto: #e7e7ea;
  --traccia: #e4e4e8;
  --accento: #111113;
  --errore: #e5484d;
  --aperto: #1f9d55;
}

* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }

body {
  background: var(--fondo);
  color: var(--inchiostro);
  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: 12px;
}

.pad {
  --k: clamp(38px, min(14vw, 9.4vh), 62px);
  position: relative;
  width: min(300px, 100%);
  background: var(--pannello);
  border: 1px solid var(--bordo);
  border-radius: 26px;
  padding: clamp(12px, 3.4vh, 22px) clamp(14px, 5vw, 22px) clamp(12px, 3.2vh, 20px);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.04), 0 28px 56px -32px rgba(17, 17, 19, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pad__head { display: flex; align-items: center; gap: 7px; align-self: stretch; }
.pad__mark {
  width: 22px; height: 22px; padding: 4px;
  border-radius: 7px; background: var(--inchiostro);
  fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.pad__brand { font-size: 13px; font-weight: 650; letter-spacing: -0.01em; }

.pad__titles { margin-top: clamp(6px, 2vh, 14px); text-align: center; }
.pad__title {
  font-size: clamp(16px, min(5.4vw, 4.4vh), 19px);
  font-weight: 680;
  letter-spacing: -0.02em;
  line-height: 1.2;
  overflow: hidden;
}
.pad__sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--grigio);
  overflow: hidden;
  line-height: 1.35;
}
.roll { display: inline-block; }

.code {
  display: block;
  width: clamp(100px, 32vw, 128px);
  height: auto;
  margin-top: clamp(2px, 1vh, 8px);
  overflow: visible;
}
.dash__track { fill: var(--traccia); }
.dash__fill { fill: var(--accento); }
.lock { opacity: 0; }
.lock__shackle {
  fill: none; stroke: var(--accento); stroke-width: 4.4; stroke-linecap: round;
}
.lock__body { fill: var(--accento); }
.lock__hole { stroke: #fff; stroke-width: 2.6; stroke-linecap: round; }

.pad__msg {
  min-height: 16px;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 560;
  color: var(--errore);
  text-align: center;
  opacity: 0;
}

.keys {
  margin-top: clamp(4px, 1.6vh, 12px);
  display: grid;
  grid-template-columns: repeat(3, var(--k));
  gap: clamp(6px, 1.5vh, 12px) clamp(12px, 5vw, 22px);
}

.key {
  position: relative;
  width: var(--k);
  height: var(--k);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
.key__face {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: var(--tasto);
  box-shadow: inset 0 -1px 0 rgba(17, 17, 19, 0.06), 0 1px 1.5px rgba(17, 17, 19, 0.06);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
}
.key__face b {
  font-size: calc(var(--k) * 0.38);
  font-weight: 560;
  line-height: 1;
  letter-spacing: -0.02em;
}
.key__face i {
  font-style: normal;
  font-size: calc(var(--k) * 0.14);
  font-weight: 620;
  letter-spacing: 0.12em;
  color: var(--grigio-chiaro);
  margin-top: 1px;
  line-height: 1;
}
.key:focus-visible .key__face { box-shadow: 0 0 0 2px var(--fondo), 0 0 0 3.5px var(--inchiostro); }
.ripple {
  position: absolute;
  width: 100%; height: 100%;
  left: 0; top: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  pointer-events: none;
  mix-blend-mode: soft-light;
}
.ripple--ombra { background: rgba(17, 17, 19, 0.09); mix-blend-mode: normal; }

.key--text { font-size: 12.5px; font-weight: 560; color: var(--grigio); }
.key--text svg {
  width: 24px; height: 24px;
  fill: none; stroke: var(--inchiostro); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
@media (hover: hover) {
  .key:hover .key__face { background: #eeeef0; }
  .key--text:hover { color: var(--inchiostro); }
}

.keys.is-off { pointer-events: none; }

.ghost {
  position: absolute; left: 0; top: 0;
  width: 22px; height: 22px;
  fill: var(--inchiostro); stroke: #fff; stroke-width: 1.4; stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));
  pointer-events: none;
  opacity: 0;
  z-index: 5;
}

@media (max-height: 460px) {
  .pad__sub { font-size: 11px; }
  .key__face i { display: none; }
}
