:root {
  --fondo: #ffffff;
  --inchiostro: #121214;
  --tenue: #8a8a92;
  --riga: #ececef;
  --accento: #4b3cff;          /* the only strong colour: you */
  --persona-0: #7fa6e6;        /* Ana, soft blue */
  --persona-1: #e6a77f;        /* Kofi, apricot */
  --persona-2: #8fbf86;        /* Lena, sage */
}

* { 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;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.palco {
  position: relative;
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: clamp(14px, 3.4vh, 30px) clamp(16px, 5vw, 56px);
  overflow: hidden;
}
@media (hover: hover) and (pointer: fine) { .palco.con-tu { cursor: none; } }

.barra {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: clamp(10px, 2vh, 16px);
  border-bottom: 1px solid var(--riga);
  font-size: 13px;
}
.doc { display: inline-flex; align-items: center; gap: 8px; color: var(--inchiostro); font-weight: 520; }
.doc svg { width: 18px; height: 18px; fill: none; stroke: var(--tenue); stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }

.presenti { display: inline-flex; align-items: center; }
.avatar {
  position: relative;
  width: 28px; height: 28px;
  margin-left: -7px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600;
  color: #1b1b1f;
  background: var(--c, #ddd);
  box-shadow: 0 0 0 2px var(--fondo);
}
.avatar::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--c, #ddd);
  opacity: 0;
  transform: scale(.85);
  transition: opacity .25s ease, transform .35s cubic-bezier(.3,1.6,.5,1);
}
.avatar.scrive::after { opacity: 1; transform: scale(1); }
.avatar[data-avatar="0"] { --c: var(--persona-0); }
.avatar[data-avatar="1"] { --c: var(--persona-1); }
.avatar[data-avatar="2"] { --c: var(--persona-2); }
.avatar--tu { --c: var(--accento); color: #fff; font-size: 9px; width: 0; margin-left: 0; opacity: 0; overflow: hidden; }

.foglio {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: clamp(10px, 3vh, 30px) 0;
}
.etichetta { font-size: 12px; letter-spacing: .02em; color: var(--tenue); margin-bottom: clamp(8px, 1.6vh, 14px); }

.titolo {
  font-size: clamp(28px, min(7.4vw, 10.5vh), 82px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 600;
  font-variation-settings: 'wdth' 100;
  max-width: 13em;
}
.parola { display: inline-block; position: relative; transform-origin: 50% 85%; white-space: pre; }
.parola__sel {
  position: absolute;
  left: -0.04em; right: -0.04em; top: 0.08em; bottom: 0.02em;
  border-radius: 0.08em;
  background: var(--c);
  opacity: .28;
  transform-origin: 0 50%;
  transform: scaleX(0);
  pointer-events: none;
  z-index: -1;
}
.lettera { display: inline; }

.stato {
  margin-top: clamp(12px, 2.4vh, 22px);
  height: 18px;
  overflow: hidden;
  font-size: 13px;
  color: var(--tenue);
}
.stato__riga { display: inline-flex; align-items: center; gap: 6px; }
.stato__riga svg { width: 13px; height: 13px; fill: none; stroke: var(--inchiostro); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.cursore {
  position: absolute;
  left: 0; top: 0;
  pointer-events: none;
  opacity: 0;
  will-change: transform;
}
.cursore__asta {
  position: absolute;
  left: -1px; top: 0;
  width: 2px;
  height: var(--h, 60px);
  border-radius: 1px;
  background: var(--c);
}
.cursore__nome {
  position: absolute;
  left: -1px;
  bottom: calc(100% + 1px);
  padding: 2px 6px 3px;
  border-radius: 4px 4px 4px 0;
  background: var(--c);
  color: #17171a;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  max-width: 8em;
  transform-origin: 0 100%;
  transition: max-width .32s cubic-bezier(.3,1.3,.5,1), padding .32s cubic-bezier(.3,1.3,.5,1), color .18s ease, height .32s ease;
}
/* idle: the tag folds into a small flag so it never covers the title */
.cursore.quieto .cursore__nome { max-width: 6px; height: 9px; padding: 0; color: transparent; border-radius: 1px 2px 2px 0; }
.cursore[data-cursore="0"] { --c: var(--persona-0); }
.cursore[data-cursore="1"] { --c: var(--persona-1); }
.cursore[data-cursore="2"] { --c: var(--persona-2); }

.strumenti {
  position: absolute;
  left: 0; top: 0;
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 9px;
  background: #18181b;
  box-shadow: 0 10px 24px -10px rgba(0,0,0,.45), 0 2px 4px rgba(0,0,0,.12);
  opacity: 0;
  pointer-events: none;
  transform-origin: 50% 100%;
}
.strumenti__tasto {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: #f2f2f4;
  font-size: 13px;
  font-weight: 700;
}
.strumenti__tasto--i { font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-weight: 400; font-size: 15px; }
.strumenti__tasto svg { width: 14px; height: 14px; fill: none; stroke: #f2f2f4; stroke-width: 1.4; stroke-linecap: round; }
.strumenti__tasto.premuto { background: rgba(255,255,255,.16); }

.tu {
  position: absolute;
  left: 0; top: 0;
  pointer-events: none;
  opacity: 0;
  z-index: 5;
}
.tu svg { display: block; width: 16px; height: 20px; fill: var(--accento); stroke: #fff; stroke-width: 1.2; stroke-linejoin: round; }
.tu__nome {
  position: absolute;
  left: 12px; top: 17px;
  padding: 2px 6px 3px;
  border-radius: 0 4px 4px 4px;
  background: var(--accento);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}
