:root {
  --fondo: #ecebe6;
  --carta: #ffffff;
  --inchiostro: #17181a;
  --grigio: #8a8b8f;
  --linea: rgba(23, 24, 26, 0.09);
  --ombra: 0 1px 2px rgba(23, 24, 26, 0.06), 0 18px 40px -18px rgba(23, 24, 26, 0.28);
  --accento: #2f3440;
  color-scheme: light;
}

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

html, body { height: 100%; }

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

.stage {
  height: 100vh;
  display: grid;
  place-items: center;
  padding: min(4vh, 24px) 4vw;
}

.card {
  width: min(460px, 92vw, 80vh);
  background: var(--carta);
  border-radius: 20px;
  box-shadow: var(--ombra);
  padding: clamp(8px, 1.6vh, 12px);
  display: grid;
  gap: clamp(8px, 1.6vh, 12px);
}

.photo {
  position: relative;
  width: 100%;
  height: min(54vh, calc(min(460px, 92vw, 80vh) * 0.78));
  border-radius: 14px;
  overflow: hidden;
  background: #efe9e0;
  cursor: pointer;
  touch-action: pan-y;
}

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

.photo__tag {
  position: absolute;
  left: 12px;
  top: 10px;
  font-size: clamp(10px, 1.6vh, 12px);
  font-weight: 560;
  letter-spacing: 0.01em;
  color: rgba(23, 24, 26, 0.62);
  pointer-events: none;
}

.arrow {
  position: absolute;
  top: 50%;
  width: clamp(28px, 5vh, 34px);
  height: clamp(28px, 5vh, 34px);
  margin-top: calc(clamp(28px, 5vh, 34px) / -2);
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 1px 2px rgba(23, 24, 26, 0.08), 0 6px 16px -8px rgba(23, 24, 26, 0.3);
  display: grid;
  place-items: center;
  color: var(--inchiostro);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.arrow svg { width: 55%; height: 55%; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.arrow--prev { left: 10px; }
.arrow--next { right: 10px; }

.info {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 0 4px;
}

.info__name {
  font-size: clamp(15px, 2.6vh, 19px);
  font-weight: 640;
  font-stretch: 105%;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.info__colour {
  font-size: clamp(11px, 1.8vh, 13px);
  color: var(--grigio);
  display: flex;
  gap: 5px;
  margin-top: 2px;
}

.roll {
  display: inline-block;
  overflow: hidden;
  height: 1.3em;
  line-height: 1.3em;
  vertical-align: bottom;
}

.roll__in {
  display: inline-block;
  color: var(--inchiostro);
  font-weight: 560;
}

.info__price {
  font-size: clamp(15px, 2.6vh, 19px);
  font-weight: 620;
}

.thumbs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 0 4px 4px;
}

.thumb {
  position: relative;
  border: 0;
  padding: 0;
  height: clamp(36px, 7.4vh, 54px);
  border-radius: 10px;
  overflow: hidden;
  background: #eee;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.thumb img {
  object-position: 50% 58%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s;
}

.thumb:not(.is-on) img { opacity: 0.72; }

@media (hover: hover) {
  .thumb:hover img { opacity: 1; }
  .arrow:hover { background: #fff; }
}

.thumbs__ring {
  position: absolute;
  left: 4px;
  top: -3px;
  height: calc(clamp(36px, 7.4vh, 54px) + 6px);
  border-radius: 13px;
  border: 1.5px solid var(--accento);
  pointer-events: none;
}

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

/* la foto ferma, solo quando WebGL non può leggere le foto (aperta da file://) */
.photo__still {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #e6e4e0;
  display: block;
}
