/* ---------- "Christian sulla mappa": the cursor of the live replica (js/live.js) ---------- */
:root { --live: #7c4dff; } /* LIVE.color in data.js overrides it */

/* the cursor: above the map, under the HUD and the panels */
.live-cursor {
  position: fixed; left: 0; top: 0; z-index: 9; pointer-events: none; color: var(--live);
  opacity: 0; transition: opacity .35s ease; will-change: transform;
}
.live-cursor.on { opacity: 1; }
.live-body { position: absolute; left: 0; top: 0; }
.live-cursor svg { position: absolute; display: none; overflow: visible; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .35)); }
.live-cursor[data-icon="arrow"] .l-arrow, .live-cursor[data-icon="open"] .l-open, .live-cursor[data-icon="shut"] .l-shut { display: block; }
.l-arrow { left: -3px; top: -2px; width: 26px; height: 26px; }    /* tip of the arrow on the point */
.l-open, .l-shut { left: -16px; top: -20px; width: 32px; height: 32px; } /* between the prongs on the point */

/* he can be hovered and clicked: the arrow and his name tag */
.live-hit { position: absolute; left: -10px; top: -10px; width: 40px; height: 40px; border-radius: 50%; }
.live-cursor.on .live-hit, .live-cursor.on .live-name { pointer-events: auto; cursor: var(--cur-pointer); }
@media (hover: none) and (pointer: coarse) { .live-hit { left: -18px; top: -18px; width: 56px; height: 56px; } } /* a finger is bigger */

/* name tag, which opens into a chat bubble when he talks */
.live-name {
  position: absolute; left: 16px; top: 19px; display: grid; gap: 5px; padding: 5px 9px; border-radius: 3px 10px 10px 10px; white-space: nowrap;
  background: var(--live); color: #fff; font: 700 11px/1 var(--f-mono); letter-spacing: .06em; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .5);
  transition: transform .2s cubic-bezier(.2, .9, .3, 1.4);
}
.live-name b { font-weight: 700; }
.live-say { display: none; max-width: 220px; white-space: normal; font: 600 14px/1.3 var(--f-body); letter-spacing: 0; }
.live-cursor.talking .live-name { padding: 7px 12px 9px; border-radius: 3px 14px 14px 14px; }
.live-cursor.talking .live-name b { opacity: .75; font-size: 10px; }
.live-cursor.talking .live-say { display: block; min-width: 120px; animation: live-say .25s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes live-say { from { opacity: 0; transform: translateY(4px); } }
.live-cursor[data-icon="open"] .live-name, .live-cursor[data-icon="shut"] .live-name { transform: translate(4px, -6px); }

/* clicked: a jump and a few sparks */
.live-cursor.hop .live-body { animation: live-hop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes live-hop { 35% { transform: translateY(-12px) rotate(-12deg) scale(1.15); } 70% { transform: translateY(2px) rotate(6deg); } }
.live-spark { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 2px; background: var(--live); box-shadow: 0 0 0 1.5px #fff; pointer-events: none; }
.live-ping { /* where he clicks */
  position: absolute; left: -14px; top: -14px; width: 28px; height: 28px; border-radius: 50%; box-sizing: border-box;
  border: 2px solid var(--live); animation: live-ping .5s ease-out forwards;
}
@keyframes live-ping { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }

/* out of sight: a marker on the edge of the screen pointing at him (click: the map goes to him) */
.live-edge {
  position: fixed; left: 0; top: 0; z-index: 11; width: 42px; height: 42px; margin: -21px 0 0 -21px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; background: var(--live); color: #fff; font: 700 15px/1 var(--f-mono); cursor: var(--cur-pointer);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 10px 22px -8px rgba(0, 0, 0, .6);
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility 0s .25s; will-change: transform;
}
.live-edge.on { opacity: 1; visibility: visible; transition: opacity .25s ease; }
.live-edge b { position: relative; z-index: 1; }
.live-edge i { position: absolute; inset: 0; transform: rotate(var(--a, 0rad)); pointer-events: none; }
.live-edge i::after { /* the arrow, on the side of the circle that faces him */
  content: ""; position: absolute; right: -13px; top: 50%; margin-top: -7px;
  border: 7px solid transparent; border-left: 10px solid var(--live); filter: drop-shadow(1px 0 0 #fff);
}
.live-edge::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid var(--live); animation: live-edge 1.8s ease-out infinite; }
@keyframes live-edge { from { transform: scale(1); opacity: .8; } to { transform: scale(1.7); opacity: 0; } }
.live-edge:hover { box-shadow: 0 0 0 3px #fff, 0 0 0 7px color-mix(in srgb, var(--live) 40%, transparent), 0 10px 22px -8px rgba(0, 0, 0, .6); }

/* the card he is looking at, or holding */
.card.live-sel { outline-color: var(--live); }
.card.live-held {
  scale: 1.04; outline-color: var(--live);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 40px 60px -22px var(--shadow);
  transition: scale .2s cubic-bezier(.2, .9, .3, 1.4), box-shadow .2s, outline-color .15s;
}

/* his notes: signposts written by hand (same size and type as the signs on the routes), signed with his initial */
.live-note {
  position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 10px; height: 44px; box-sizing: border-box;
  padding: 0 16px 0 8px; border-radius: 10px; border: 2px dashed var(--live); white-space: nowrap; pointer-events: none;
  transform-origin: 0 0; background: var(--bg-2); background: color-mix(in srgb, var(--live) 12%, var(--bg-2)); color: var(--ink);
  font: 600 16px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase;
}
.live-au {
  display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--live); color: #fff; font: 700 12px/1 var(--f-mono); font-style: normal; letter-spacing: 0;
}
.live-note.typing span::after { /* the caret while he types */
  content: ""; display: inline-block; width: 2px; height: 1em; margin-left: 3px; vertical-align: -.12em;
  background: var(--live); animation: live-caret .9s steps(1) infinite;
}
@keyframes live-caret { 50% { opacity: 0; } }
