:root {
  --fondo: #f2f2f2;
  --carta: #ffffff;
  --bordo: rgba(17, 17, 19, 0.07);
  --testo: #18181b;
  --testo-2: #71717a;
  --testo-3: #a1a1aa;
  --rosso: #e5484d;
  --rosso-scuro: #c8353a;
  --rosso-tenue: #fdeceb;
  --rosso-bordo: rgba(229, 72, 77, 0.2);
  --rosso-testo: #cd2b31;
}

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

html, body { height: 100%; }

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

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(14px, 4vmin, 40px);
}

.pezzo {
  width: min(300px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  justify-items: center;
  row-gap: clamp(12px, 2.6vh, 18px);
}

/* the file the button deletes */
.file {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.04), 0 10px 30px -18px rgba(17, 17, 19, 0.25);
  overflow: hidden;
}

.file__icon {
  position: relative;
  flex: none;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eef6f0;
  color: #2f8a4c;
}

.file__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.file__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file__name {
  font-size: 14px;
  font-weight: 560;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  position: relative;
}

.file__meta {
  font-size: 12px;
  color: var(--testo-2);
  font-variant-numeric: tabular-nums;
}

.file__name { display: inline-block; max-width: 100%; align-self: flex-start; }

.file__strike {
  position: absolute;
  left: 0;
  right: 0;
  top: 54%;
  height: 1.5px;
  border-radius: 1px;
  background: var(--testo-3);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.file__metas { display: grid; }

.file__meta, .file__gone { grid-area: 1 / 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.file__gone {
  font-size: 12px;
  color: var(--rosso-testo);
  opacity: 0;
}

/* the hold button and the undo button share the same place */
.hold, .undo {
  grid-row: 2;
  grid-column: 1;
}

.hold {
  position: relative;
  appearance: none;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  border-radius: 14px;
  outline: none;
}

.hold:focus-visible .hold__body {
  box-shadow: 0 0 0 3px var(--fondo), 0 0 0 5px rgba(229, 72, 77, 0.45);
}

/* GSAP moves .hold__body (scale), the layers inside are plain CSS */
.hold__body {
  position: relative;
  display: block;
  border-radius: 14px;
  background: var(--rosso-tenue);
  border: 1px solid var(--rosso-bordo);
  box-shadow: 0 1px 1px rgba(205, 43, 49, 0.06), 0 6px 16px -10px rgba(205, 43, 49, 0.35);
  overflow: hidden;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}

@media (hover: hover) {
  .hold:hover .hold__body { background: #fbe1df; border-color: rgba(229, 72, 77, 0.3); }
}

.hold.is-ghosthover .hold__body { background: #fbe1df; border-color: rgba(229, 72, 77, 0.3); }

.hold__layer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 20px 0 16px;
  height: 48px;
  color: var(--rosso-testo);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.hold__layer--top {
  position: absolute;
  inset: 0;
  color: #ffffff;
  background: linear-gradient(180deg, #ec5a5f, var(--rosso) 55%, var(--rosso-scuro));
  clip-path: inset(0 100% 0 0 round 0);
}

.bin {
  flex: none;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.bin__lid { transform-box: fill-box; transform-origin: 85% 100%; }
.bin__can { transform-box: fill-box; transform-origin: 50% 100%; }

.hold__labels {
  position: relative;
  display: grid;
  white-space: nowrap;
}

.lab {
  grid-area: 1 / 1;
  text-align: left;
}

.lab[data-lab="busy"], .lab[data-lab="done"] { opacity: 0; }

/* undo */
.undo {
  position: relative;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 20px 0 16px;
  border-radius: 14px;
  border: 1px solid var(--bordo);
  background: var(--carta);
  color: var(--testo);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.05), 0 8px 20px -14px rgba(17, 17, 19, 0.3);
  opacity: 0;
  visibility: hidden;
}

.undo svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) {
  .undo:hover { background: #fafafa; }
}

.undo:focus-visible { outline: 2px solid rgba(24, 24, 27, 0.35); outline-offset: 3px; }

.undo__bar {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 5px;
  height: 2px;
  border-radius: 2px;
  background: rgba(24, 24, 27, 0.14);
  transform-origin: 0 50%;
}

.hint {
  font-size: 12px;
  color: var(--testo-3);
  letter-spacing: 0.005em;
  height: 1.3em;
}

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

@media (max-height: 460px) {
  .pezzo { row-gap: 10px; }
  .file { padding: 10px 12px; }
}
