:root {
  --sky: #bfeaf0; --sky2: #d8f6e6; --leaf: #7ac74f; --leaf-d: #4e9e3e;
  --sun: #ffd85e; --pink: #ff8fb1; --cream: #fff6e0; --ink: #5a4633;
  --shadow: 0 6px 0 rgba(90,70,51,.15), 0 12px 24px rgba(90,70,51,.18);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Baloo 2", "Quicksand", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(120% 100% at 50% 0%, var(--sky) 0%, var(--sky2) 70%, #eafbe9 100%);
  overflow: hidden;
}
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; font-weight: 800;
}
.brand { font-size: 20px; }
.distance {
  margin-left: auto; background: var(--cream); border-radius: 999px;
  padding: 8px 16px; box-shadow: var(--shadow); font-weight: 800;
}
.ghost { border: none; background: transparent; font-size: 20px; cursor: pointer; opacity: .6; }
.globe { position: fixed; inset: 0; }
.float-layer { position: fixed; inset: 0; pointer-events: none; z-index: 4; overflow: hidden; }

.dock {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 6;
  width: min(560px, 94vw);
  background: var(--cream); border-radius: 28px; padding: 14px;
  box-shadow: var(--shadow);
}
.reaction-bar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.reaction-bar button {
  font-size: 26px; border: none; background: #fff; border-radius: 18px;
  width: 52px; height: 52px; cursor: pointer; box-shadow: 0 3px 0 rgba(90,70,51,.15);
  transition: transform .12s ease;
}
.reaction-bar button:active { transform: scale(.86) translateY(2px); }
.note-form { display: flex; gap: 8px; margin-top: 10px; }
.note-form input {
  flex: 1; border: none; border-radius: 16px; padding: 12px 16px;
  background: #fff; font: inherit; box-shadow: inset 0 2px 6px rgba(90,70,51,.1);
}
.send-btn, .who-btn {
  border: none; border-radius: 16px; padding: 12px 18px; font: inherit; font-weight: 800;
  background: var(--pink); color: #fff; cursor: pointer; box-shadow: 0 4px 0 var(--leaf-d);
}
.send-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--leaf-d); }
.feed {
  list-style: none; margin: 12px 0 0; padding: 0; max-height: 22vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.feed li { background: #fff; border-radius: 14px; padding: 8px 12px; box-shadow: 0 2px 0 rgba(90,70,51,.1); }
.feed .who { font-weight: 800; margin-right: 6px; }

.geo-note {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; gap: 10px;
  background: var(--cream); border-radius: 18px; padding: 10px 14px;
  box-shadow: var(--shadow); font-weight: 700; font-size: 14px;
}
.geo-note.hidden { display: none; }
.geo-retry {
  border: none; border-radius: 12px; padding: 6px 12px; font: inherit; font-weight: 800;
  background: var(--pink); color: #fff; cursor: pointer; box-shadow: 0 3px 0 var(--leaf-d);
}
.geo-retry:active { transform: translateY(1px); box-shadow: 0 2px 0 var(--leaf-d); }

.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center;
  background: rgba(90,70,51,.35); backdrop-filter: blur(3px); }
.modal.hidden { display: none; }
.modal .card { background: var(--cream); border-radius: 28px; padding: 28px; text-align: center;
  box-shadow: var(--shadow); width: min(420px, 90vw); }
.who-buttons { display: flex; gap: 12px; justify-content: center; margin-top: 16px; }

.floating { position: absolute; font-size: 34px; animation: floatUp 2.6s ease-out forwards; }
@keyframes floatUp {
  0% { transform: translateY(0) scale(.4); opacity: 0; }
  20% { transform: translateY(-10px) scale(1.2); opacity: 1; }
  100% { transform: translateY(-160px) scale(1); opacity: 0; }
}
.pop-in { animation: popIn .4s cubic-bezier(.34,1.56,.64,1); }
@keyframes popIn { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* Hand-drawn avatar hovering above each globe pin. globe.gl controls the
   anchor's transform (centres it on the coordinate); the bubble lifts itself
   fully above that point via its own transform. */
.avatar-anchor { position: absolute; }
.avatar-bubble {
  position: absolute; left: 50%; top: 0;
  transform: translate(-50%, calc(-100% - 12px));
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  pointer-events: none; user-select: none;
  animation: popIn .45s cubic-bezier(.34,1.56,.64,1);
}
.avatar-img {
  width: 54px; height: 54px; border-radius: 50%; display: block;
  border: 3px solid var(--ring, var(--cream));
  background: var(--cream);
  box-shadow: 0 4px 0 rgba(90,70,51,.18), 0 8px 16px rgba(90,70,51,.22);
}
/* little pointer/tail from the bubble down toward the pin */
.avatar-bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -6px;
  width: 12px; height: 12px; background: var(--ring, var(--cream));
  transform: translateX(-50%) rotate(45deg); border-radius: 2px;
  box-shadow: 0 3px 6px rgba(90,70,51,.18);
}
.avatar-name {
  position: relative; z-index: 1;
  font-size: 12px; font-weight: 800; color: var(--ink);
  background: var(--cream); padding: 1px 8px; border-radius: 999px;
  box-shadow: 0 2px 0 rgba(90,70,51,.12);
}
