:root {
  --fondo: #0b0b0c;
  --card: #141416;
  --bordo: rgba(255, 255, 255, 0.07);
  --testo: #ececef;
  --grigio: #8b8b93;
  --grigio-scuro: #55555c;
  --pulsante: #19191c;
  --scritta-scura: #17181b;
  --caldo: #ff7a1a;
}

* { 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 {
  width: min(330px, 100%);
  background: var(--card);
  border: 1px solid var(--bordo);
  border-radius: 22px;
  padding: min(16px, 3.2vh) min(16px, 4vw);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.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, #2a2a2e, #1b1b1e);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tool__logo svg { width: 16px; height: 16px; fill: none; stroke: var(--caldo); 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 photo: a pixelated copy under a sharp one, cut by the same front as the metal ---- */
.shot {
  position: relative;
  width: 100%;
  height: min(176px, 34vh);
  border-radius: 14px;
  overflow: hidden;
  background: #241814;
  border: 1px solid var(--bordo);
}

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

.shot__hi { clip-path: inset(0 100% 0 0); }

.shot__scan {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 2px;
  margin-left: -1px;
  background: linear-gradient(180deg, rgba(255, 236, 200, 0), #ffe6bf 18%, #fff4e2 50%, #ffe6bf 82%, rgba(255, 236, 200, 0));
  box-shadow: 0 0 14px 3px rgba(255, 140, 50, 0.55);
  opacity: 0;
  pointer-events: none;
}

.shot__cap {
  position: absolute;
  left: 8px; right: 8px; bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 520;
  color: rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.shot__name, .shot__cap > .roll {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(12, 10, 10, 0.5);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

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

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

/* ---- the button ---- */
.cast-wrap {
  position: relative;
  margin-top: min(16px, 3vh);
  height: min(58px, 11.5vh);
  perspective: 600px;
}

.cast__glow {
  position: absolute;
  top: 50%; left: 0;
  width: 110px; height: 90px;
  margin: -45px 0 0 -55px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 150, 60, 0.75), rgba(255, 106, 26, 0.32) 55%, rgba(255, 106, 26, 0));
  filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.cast {
  position: relative;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #1f1f23, var(--pulsante));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 -2px 6px rgba(0, 0, 0, 0.5), 0 10px 24px -12px rgba(0, 0, 0, 0.9);
  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 */
.cast::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;
}

.cast:focus-visible { box-shadow: 0 0 0 2px var(--fondo), 0 0 0 4px rgba(255, 255, 255, 0.5); }

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

.cast__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.32) 78%, rgba(255, 255, 255, 0) 100%);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}

.cast__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;
}

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

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

.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 { display: none; }
}
