: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);
  --scelto: #e0784a;
  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 {
  min-height: 100vh;
  height: 100vh;
  display: grid;
  place-items: center;
  padding: min(4vh, 24px) 4vw;
}

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

.card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px 0;
  font-size: clamp(11px, 1.7vh, 13px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 640;
  font-stretch: 108%;
  letter-spacing: -0.01em;
}

.brand__mark { width: 14px; height: 14px; fill: var(--inchiostro); }

.card__file { color: var(--grigio); font-weight: 460; }

.photo {
  position: relative;
  height: min(50vh, calc(min(520px, 92vw) * 0.62));
  border-radius: 12px;
  overflow: hidden;
  background: #c9c3bb;
  touch-action: none;
  cursor: grab;
}

.photo.is-held { cursor: grabbing; }

.photo__img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; user-select: none; -webkit-user-drag: none; }

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

.photo__hint {
  position: absolute;
  left: 50%;
  bottom: 10px;
  translate: -50% 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: clamp(10px, 1.6vh, 12px);
  font-weight: 520;
  white-space: nowrap;
  pointer-events: none;
}

.pick {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 0 2px 2px;
}

.pick__now { display: flex; align-items: center; gap: 9px; }

.chip {
  position: relative;
  width: clamp(26px, 5vh, 34px);
  aspect-ratio: 1;
  border-radius: 9px;
  background: var(--scelto);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.chip__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 46%);
}

.pick__label { font-size: clamp(9px, 1.4vh, 11px); color: var(--grigio); font-weight: 520; letter-spacing: 0.02em; }

.pick__hex {
  font-size: clamp(13px, 2.3vh, 16px);
  font-weight: 620;
  font-stretch: 104%;
  letter-spacing: 0.01em;
  min-width: 7ch;
  display: flex;
  overflow: hidden;
  height: 1.25em;
}

.pick__hex .d { display: inline-block; }

.palette { display: flex; gap: 5px; justify-content: flex-end; }

.slot {
  width: clamp(16px, 3.4vh, 22px);
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px dashed rgba(23, 24, 26, 0.18);
}

.slot.is-full { border: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }

.add {
  appearance: none;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: clamp(28px, 5vh, 34px);
  padding: 0 12px 0 10px;
  border-radius: 999px;
  background: var(--inchiostro);
  color: #fff;
  font: inherit;
  font-size: clamp(11px, 1.8vh, 13px);
  font-weight: 600;
  cursor: pointer;
}

.add__icon { width: 12px; height: 12px; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; }

.fly {
  position: fixed;
  z-index: 5;
  border-radius: 9px;
  pointer-events: none;
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.35);
}

.finger {
  position: fixed;
  z-index: 6;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: 0 0 0 1.5px rgba(23, 24, 26, 0.55), 0 4px 10px -4px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  opacity: 0;
}

@media (hover: hover) {
  .add:hover { background: #2b2c30; }
}

@media (max-width: 420px) {
  .card__file { display: none; }
  .pick { gap: 8px; }
}
