:root {
  --fondo: #ffffff;
  --carta: #ffffff;
  --bordo: rgba(17, 17, 19, 0.09);
  --bordo-forte: rgba(17, 17, 19, 0.18);
  --testo: #18181b;
  --testo-2: #6b6b73;
  --testo-3: #a1a1aa;
  --nero: #111113;
  --accento: #2f6bff;
}

* { 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 {
  overflow: hidden;
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(14px, 4vmin, 40px);
}

.card {
  width: min(400px, 100%);
  background: var(--carta);
  border: 1px solid var(--bordo);
  border-radius: 18px;
  padding: clamp(16px, 4.4vmin, 22px);
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.04), 0 12px 32px -12px rgba(17, 17, 19, 0.12);
}

.head { display: flex; align-items: center; gap: 11px; }

.avatar {
  width: 38px; height: 38px; flex: none;
  border-radius: 50%;
  background: linear-gradient(160deg, #eef2ff, #dfe6f7);
  overflow: hidden;
  display: grid; place-items: end center;
}
.avatar svg { width: 38px; height: 38px; fill: #b7c3dc; }

.who { display: grid; gap: 1px; min-width: 0; }
.who b { font-size: 14.5px; font-weight: 640; letter-spacing: -0.01em; }
.meta { font-size: 12.5px; color: var(--testo-2); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.sep { width: 1px; height: 10px; background: var(--bordo-forte); }

.text {
  position: relative;
  display: grid;
  margin-top: 14px;
  overflow: hidden;
}

.lang {
  grid-area: 1 / 1;
  font-size: clamp(15px, min(4.3vw, 4vh), 17px);
  line-height: 1.5;
  letter-spacing: -0.006em;
  align-self: start;
}

.lang--to { visibility: hidden; }

.w {
  display: inline-block;
  white-space: pre;
  will-change: transform, opacity, filter;
}

.sheen {
  position: absolute;
  inset: -10% auto -10% 0;
  width: 46%;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(47, 107, 255, 0), rgba(47, 107, 255, 0.13) 45%, rgba(255, 255, 255, 0.5) 52%, rgba(47, 107, 255, 0.1) 60%, rgba(47, 107, 255, 0));
  mix-blend-mode: multiply;
  opacity: 0;
  transform: translateX(-110%);
}

.foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--bordo);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.from {
  position: relative;
  display: grid;
  font-size: 12.5px;
  color: var(--testo-2);
  min-width: 0;
}
.from__a, .from__b { grid-area: 1 / 1; white-space: nowrap; }
.from__b { opacity: 0; color: var(--accento); }

.tipwrap { position: relative; flex: none; }

.tr {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px 0 11px;
  border-radius: 999px;
  border: 1px solid var(--bordo-forte);
  background: #fff;
  color: var(--testo);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(17, 17, 19, 0.06);
  transition: border-color 0.2s, background-color 0.2s;
}
.tr:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; }
.tr.is-on { border-color: rgba(47, 107, 255, 0.35); background: #f4f7ff; color: #1d4fd6; }

@media (hover: hover) {
  .tr:hover { border-color: rgba(17, 17, 19, 0.3); }
  .tr.is-on:hover { border-color: rgba(47, 107, 255, 0.55); }
}

.tr__icon, .tr__arc { width: 17px; height: 17px; flex: none; }
.tr__icon { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tr__arc { position: absolute; left: 11px; top: 50%; margin-top: -8.5px; fill: none; stroke: var(--accento); stroke-width: 2; stroke-linecap: round; opacity: 0; }

.tr__labels { position: relative; display: grid; overflow: hidden; height: 21px; }
.tr__label { grid-area: 1 / 1; justify-self: start; width: max-content; line-height: 21px; white-space: nowrap; font-variation-settings: "wdth" 100; }
.tr__label--2, .tr__label--3 { opacity: 0; }

.tip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--nero);
  color: #fff;
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(3px);
}
.tip::after {
  content: "";
  position: absolute;
  right: 22px; top: 100%;
  border: 4px solid transparent;
  border-top-color: var(--nero);
}

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

@media (max-width: 360px) {
  .from { font-size: 11.5px; }
  .tr { padding: 0 12px 0 10px; font-size: 13px; }
}
