:root {
  --bg: #0a0a0b;
  --card: #121214;
  --card-edge: rgba(255, 255, 255, 0.07);
  --ink: #f4f4f5;
  --muted: #8b8b93;
  --faint: #5b5b63;
  --line: rgba(255, 255, 255, 0.08);
  --soft: #1b1b1f;
  --accent: #8b7bff;
  --accent-2: #5ee0ff;
  --ok: #4ade80;
  --av: clamp(84px, 24vh, 124px);
  --fuoco: 86% 46%; /* dove sta il viso nella foto: il ritaglio tondo lo tiene al centro */
}

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

html, body { height: 100%; }

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

.stage {
  position: relative;
  min-height: 100vh;
  overflow: clip;
  display: grid;
  place-items: center;
  padding: 16px;
}

.card {
  position: relative;
  width: min(392px, 100%);
  padding: clamp(14px, 3.4vh, 22px) clamp(16px, 4vw, 22px) clamp(16px, 3.6vh, 22px);
  border-radius: 20px;
  background: linear-gradient(180deg, #151518, var(--card));
  border: 1px solid var(--card-edge);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: clamp(12px, 2.6vh, 16px);
  border-bottom: 1px solid var(--line);
}

.card__title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.card__sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); }

.mini {
  position: relative;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(140deg, #2a2a31, #1d1d22);
  box-shadow: 0 0 0 1px var(--line);
  display: grid;
  place-items: center;
}
.mini__ini { font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }
.mini__photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--fuoco); opacity: 0; }

.body {
  display: flex;
  align-items: center;
  gap: clamp(16px, 4.4vw, 22px);
  padding-top: clamp(14px, 3.4vh, 22px);
}

.avatar {
  position: relative;
  flex: none;
  width: var(--av);
  height: var(--av);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.avatar__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.avatar__disc {
  position: absolute;
  inset: 9%;
  border-radius: 50%;
  overflow: hidden;
  background: radial-gradient(circle at 32% 25%, #2d2d35, #18181c 72%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 10px 24px -12px rgba(0, 0, 0, 0.9);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.avatar__ini {
  font-size: calc(var(--av) * 0.24);
  font-weight: 600;
  font-stretch: 112%;
  letter-spacing: 0.01em;
  color: #6e6e78;
}

.avatar__photo {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.avatar__pic, .avatar__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar__pic { object-position: var(--fuoco); }
.avatar__img { display: none; }

.avatar__sheen {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%);
  opacity: 0;
  mix-blend-mode: screen;
}

.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.ring circle { fill: none; }
.ring__track { stroke: rgba(255, 255, 255, 0.06); stroke-width: 1.5; }
.ring__dash { stroke: rgba(255, 255, 255, 0.22); stroke-width: 1.5; stroke-dasharray: 3 6; opacity: 0; }
.ring__glow { stroke-width: 7; stroke-linecap: round; opacity: 0; }
.ring__line { stroke-width: 2.4; stroke-linecap: round; opacity: 0; }

.badge {
  position: absolute;
  right: 4%;
  bottom: 4%;
  width: 28%;
  height: 28%;
  border-radius: 50%;
  background: #f4f4f5;
  box-shadow: 0 0 0 3px var(--card), 0 6px 14px -6px rgba(0, 0, 0, 0.8);
  display: grid;
  place-items: center;
  pointer-events: none;
}
.badge svg { width: 54%; height: 54%; fill: none; stroke: #18181b; stroke-width: 1.8; stroke-linejoin: round; }

.info { min-width: 0; flex: 1; }
.info__name { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.info__state {
  position: relative;
  height: 18px;
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
  overflow: hidden;
  font-variant-numeric: lining-nums;
}
.info__state span { display: block; white-space: nowrap; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(10px, 2.4vh, 14px); }

.btn {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  height: 32px;
  padding: 0 13px;
  border-radius: 10px;
  border: 0;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, opacity 0.2s, box-shadow 0.2s;
}
.btn--main { background: #f4f4f5; color: #111113; box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.12); }
.btn--ghost { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn:focus-visible, .avatar__input:focus-visible + .avatar__disc { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (hover: hover) {
  .btn--main:hover { background: #ffffff; }
  .btn--ghost:not(:disabled):hover { color: var(--ink); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
}
.btn.is-pressed { transform: scale(0.96); }

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(-1 * clamp(44px, 11vh, 56px));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: #18181b;
  border: 1px solid var(--card-edge);
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.9);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%);
}
.toast svg { width: 18px; height: 18px; fill: none; stroke: var(--ok); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.toast circle { stroke-opacity: 0.35; }

.drag {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(64px, 17vh, 86px);
  padding: 5px 5px 7px;
  border-radius: 12px;
  background: #1c1c20;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 22px 40px -16px rgba(0, 0, 0, 0.9);
  opacity: 0;
  pointer-events: none;
  will-change: transform;
}
.drag__img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; object-position: var(--fuoco); border-radius: 8px; }
.drag__name { display: block; margin-top: 5px; font-size: 9.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

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

@media (max-width: 380px) {
  .body { gap: 14px; }
  .card__sub { font-size: 11.5px; }
  .btn { padding: 0 11px; }
}
