:root {
  --fondo: #f5f3ee;
  --carta: #ffffff;
  --inchiostro: #191a17;
  --grigio: #6f706a;
  --linea: rgba(25, 26, 23, 0.1);
  --accento: #e5484d;
  --raggio: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--inchiostro);
  font-family: 'Geist Variable', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.palco {
  position: relative;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: 3vh 4vw;
}

/* ---- the card ---- */
.card {
  position: relative;
  width: min(25rem, 86vw, calc((92vh - 7.4rem) / 0.75));
  background: var(--carta);
  border-radius: calc(var(--raggio) + 6px);
  padding: 6px 6px 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 0 0 1px var(--linea), 0 18px 40px -26px rgba(25, 26, 23, 0.45);
}
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 28px 60px -28px rgba(25, 26, 23, 0.55);
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}
.card.is-su::after { opacity: 1; }

/* ---- the photo frame ---- */
.foto {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--raggio);
  overflow: hidden;
  isolation: isolate;
  cursor: ew-resize;
  touch-action: pan-y;
  background: #d9d6cf;
}
.foto__pila { position: absolute; inset: 0; }
.lastra { position: absolute; inset: 0; overflow: hidden; }
.lastra img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}
.foto__velo {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(10, 12, 8, 0.28), rgba(10, 12, 8, 0) 30%),
    linear-gradient(to top, rgba(10, 12, 8, 0.5), rgba(10, 12, 8, 0) 34%);
  pointer-events: none;
  z-index: 5;
}
.foto__luce {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--lx, 50%) var(--ly, 40%), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 42%);
  mix-blend-mode: soft-light;
  opacity: 0;
  pointer-events: none;
  z-index: 6;
}

/* ---- the badge ---- */
.distintivo {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px 6px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  backdrop-filter: blur(10px) saturate(1.4);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 4px 14px -6px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.distintivo svg { width: 12px; height: 12px; fill: var(--inchiostro); }

/* ---- the heart ---- */
.cuore {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 8;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cuore:focus-visible { outline: 2px solid #fff; outline-offset: -2px; border-radius: 50%; }
.cuore__segno { width: 24px; height: 24px; overflow: visible; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); }
.cuore__segno path {
  fill: rgba(20, 20, 20, 0.35);
  stroke: #fff;
  stroke-width: 1.8;
  stroke-linejoin: round;
}
.cuore.is-salvato .cuore__segno path { fill: var(--accento); }
.cuore__anello {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  border: 1.5px solid var(--accento);
  opacity: 0;
}
.cuore__schegge { position: absolute; inset: 0; pointer-events: none; }
.scheggia {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 6px;
  margin: -3px 0 0 -1px;
  border-radius: 2px;
  background: var(--accento);
  opacity: 0;
}

/* ---- caption and segments ---- */
.didascalia {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 22px;
  z-index: 8;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  color: #fff;
  font-size: 13px;
  font-weight: 560;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.didascalia span { display: inline-block; }
.didascalia em {
  font-style: normal;
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}
.tacche {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 11px;
  z-index: 8;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  pointer-events: none;
}
.tacca {
  position: relative;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.36);
  overflow: hidden;
}
.tacca i {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
}

/* ---- the text ---- */
.testo { padding: 12px 10px 14px; }
.testo__riga { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.titolo { font-size: 15px; font-weight: 620; letter-spacing: -0.012em; }
.voto { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 520; font-variant-numeric: tabular-nums; }
.voto svg { width: 12px; height: 12px; fill: var(--inchiostro); }
.sotto { margin-top: 2px; font-size: 13px; color: var(--grigio); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prezzo { margin-top: 7px; font-size: 13px; color: var(--grigio); }
.prezzo strong { color: var(--inchiostro); font-size: 14px; font-weight: 640; }
.prezzo span { color: var(--grigio); }

/* ---- the drawn pointer of the demo ---- */
.puntatore {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
}
.puntatore path { fill: var(--inchiostro); stroke: #fff; stroke-width: 1.4; stroke-linejoin: round; }

@media (max-height: 460px) {
  .testo { padding: 9px 8px 10px; }
  .sotto + .sotto { display: none; }
}
