/* The board. Bubblegum's ground and colors, one typeface (Google Sans Flex), rounded everything,
   no outlines, no glow, no gradients. */
:root {
  --ground: #F7F4EE;
  --ink: #0B0A0A;
  --font: 'Google Sans Flex', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --vv-top: 0px;      /* where the visible part of the screen starts and ends, kept up to date by board.js */
  --vv-gap: 0px;      /* how much of the page bottom is hidden (Safari's bar, the keyboard) */
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ground); color: var(--ink);
  font-family: var(--font); letter-spacing: -0.03em; overscroll-behavior: none; }
body { position: fixed; inset: 0; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
button { touch-action: manipulation; font: inherit; letter-spacing: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }

#view { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
#grid { position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, rgba(11,10,10,.16) 1.1px, transparent 1.4px); }
#world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
#ink { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
#ink path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
#overlay { position: absolute; inset: 0; pointer-events: none; }

/* notes */
.note { position: absolute; width: 220px; min-height: 220px; padding: 20px 20px 40px; border-radius: 18px;
  font-size: 22px; line-height: 1.22; font-weight: 420; white-space: pre-wrap; overflow-wrap: anywhere;
  cursor: grab; transition: transform .18s cubic-bezier(.3,1.5,.5,1); }
.note .text { outline: none; min-height: 1.22em; }
.note .text:empty::before { content: attr(data-empty); color: var(--deep); }
.note .by { position: absolute; left: 20px; bottom: 14px; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.note.lifted { transform: scale(1.04) rotate(-1.5deg); cursor: grabbing; }
.note.editing { cursor: text; -webkit-user-select: text; user-select: text; }
.note.editing .text { -webkit-user-select: text; user-select: text; }
.note.doomed { transform: scale(.6); opacity: .5; }

/* other people's pointers */
.cursor { position: absolute; left: 0; top: 0; will-change: transform; transition: opacity .3s; }
.cursor .d { width: 14px; height: 14px; border-radius: 50%; margin: -7px 0 0 -7px; }
.cursor .n { position: absolute; left: 10px; top: 6px; padding: 4px 10px 5px; border-radius: 999px; font-size: 13px;
  font-weight: 500; white-space: nowrap; letter-spacing: -0.01em; }
.cursor.off { opacity: 0; }

/* reactions */
.emote { position: absolute; left: 0; top: 0; font-size: 44px; line-height: 1; pointer-events: none;
  animation: float 1.6s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes float { 0% { transform: translate(-50%,-50%) scale(.3); opacity: 0 }
  15% { transform: translate(-50%,-60%) scale(1.15); opacity: 1 }
  100% { transform: translate(-50%,-260%) scale(1); opacity: 0 } }

/* people here */
#people { position: absolute; right: 16px; top: calc(16px + var(--safe-t) + var(--vv-top)); display: flex; flex-direction: row-reverse; }
#people .p { width: 34px; height: 34px; border-radius: 50%; margin-left: -8px; display: grid; place-items: center;
  font-size: 13px; font-weight: 600; box-shadow: 0 0 0 3px var(--ground); }

/* tools */
#tools { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b) + var(--vv-gap)); transform: translateX(-50%);
  display: flex; gap: 6px; padding: 6px; border-radius: 999px; background: var(--ink); }
#tools button { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 14px; border-radius: 999px;
  color: var(--ground); font-size: 16px; font-weight: 500; transition: background .15s, color .15s; }
#tools button.on { background: var(--ground); color: var(--ink); }
#tools i { display: block; width: 18px; height: 18px; }
.ico-note { border-radius: 5px; background: currentColor; }
.ico-pen { position: relative; }
.ico-pen::before { content: ''; position: absolute; left: 1px; right: 1px; top: 8px; height: 3px; border-radius: 3px;
  background: currentColor; transform: rotate(-35deg); }
.ico-pen::after { content: ''; position: absolute; left: 0; bottom: 1px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.ico-react { border-radius: 50%; background: currentColor; position: relative; }
.ico-react::after { content: ''; position: absolute; left: 4px; right: 4px; top: 9px; height: 5px; border-radius: 0 0 6px 6px; background: var(--btn-bg, var(--ink)); }
#tools button.on .ico-react::after { background: var(--ground); }

#reacts { position: absolute; left: 50%; bottom: calc(86px + var(--safe-b) + var(--vv-gap)); transform: translateX(-50%) translateY(10px);
  display: flex; gap: 4px; padding: 6px; border-radius: 999px; background: var(--ink); opacity: 0; pointer-events: none;
  transition: opacity .16s, transform .16s; }
#reacts.open { opacity: 1; pointer-events: auto; transform: translateX(-50%); }
#reacts button { width: 48px; height: 48px; border-radius: 50%; font-size: 26px; display: grid; place-items: center; }
#reacts button:active { transform: scale(.88); }

/* the bin that appears while you carry a note */
#bin { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b) + var(--vv-gap)); width: 64px; height: 64px; margin-left: -32px;
  border-radius: 50%; background: var(--ink); opacity: 0; transform: scale(.6); pointer-events: none;
  transition: opacity .16s, transform .2s cubic-bezier(.3,1.6,.5,1); display: grid; place-items: center; }
#bin span { position: absolute; bottom: 76px; white-space: nowrap; font-size: 14px; font-weight: 500; color: var(--ink); }
#bin.show { opacity: 1; transform: scale(1); }
#bin.hot { transform: scale(1.35); }
body.carrying #tools, body.writing #tools { opacity: 0; pointer-events: none; }
#tools { transition: opacity .18s; }

/* joining */
#hello { position: absolute; inset: 0; display: flex; justify-content: center; align-items: flex-start; background: var(--ground);
  padding: max(9vh, calc(28px + var(--safe-t))) 24px 24px; z-index: 10; }
body.hello { position: static; touch-action: manipulation; }
body.hello #view, body.hello #tools, body.hello #people, body.hello #intro { visibility: hidden; }
#hello[hidden] { display: none; }
#hello-card { width: min(360px, 100%); display: flex; flex-direction: column; gap: 14px; }
#hello-card .dot { width: 44px; height: 44px; border-radius: 50%; margin-bottom: 10px; background: #F4B7F5; }
#hello-card label { font-size: 30px; line-height: 1.12; font-weight: 450; }
#hello-card input { font: inherit; letter-spacing: inherit; font-size: 22px; padding: 16px 20px; border: 0; border-radius: 16px;
  background: #EBE6DC; color: var(--ink); outline: none; -webkit-user-select: text; user-select: text; }
#hello-card input::placeholder { color: #71329D; }
#hello-card button { height: 56px; border-radius: 999px; background: var(--ink); color: var(--ground); font-size: 18px; font-weight: 500; }

#status { position: absolute; left: 16px; top: calc(20px + var(--safe-t) + var(--vv-top)); font-size: 14px; font-weight: 500; opacity: 0;
  transition: opacity .3s; }
#status.show { opacity: 1; }

/* stamps: they stay where they're dropped, riding on a note if dropped on one */
.stamp { position: absolute; width: 0; height: 0; cursor: grab; }
.stamp .e { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); font-size: 40px; line-height: 1;
  padding: 6px; transition: transform .16s cubic-bezier(.3,1.6,.5,1); }
.stamp .who { position: absolute; left: 14px; top: 8px; width: 12px; height: 12px; border-radius: 50%;
  box-shadow: 0 0 0 2px var(--ground); pointer-events: none; }
.stamp.lifted .e { transform: translate(-50%, -50%) scale(1.3); }
.stamp.doomed .e { opacity: .45; transform: translate(-50%, -50%) scale(.7); }
.ghost { position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none; font-size: 46px; line-height: 1;
  margin: -23px 0 0 -23px; }

/* following someone */
#people .p { cursor: pointer; }
#people .p.followed { box-shadow: 0 0 0 3px var(--ground), 0 0 0 6px var(--c); }
#follow { position: absolute; left: 50%; top: calc(18px + var(--safe-t) + var(--vv-top)); transform: translate(-50%, -8px); height: 40px;
  padding: 0 18px; border-radius: 999px; font-size: 15px; font-weight: 500; white-space: nowrap; opacity: 0;
  pointer-events: none; transition: opacity .18s, transform .18s; }
#follow.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }

/* colours, while writing a note */
#colors { position: absolute; left: 50%; bottom: calc(12px + var(--vv-gap)); transform: translateX(-50%); display: flex; gap: 6px; padding: 7px;
  border-radius: 999px; background: var(--ink); opacity: 0; pointer-events: none; transition: opacity .18s; }
body.writing #colors { opacity: 1; pointer-events: auto; }
#colors button { width: 30px; height: 30px; border-radius: 50%; transition: transform .15s; display: grid; place-items: center; }
#colors button::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); transform: scale(0); transition: transform .15s; }
#colors button.on::after { transform: scale(1); }
#colors button.on { transform: scale(1.25); }

#intro { position: absolute; left: 24px; right: 24px; top: 40%; transform: translateY(-50%); text-align: center; pointer-events: none;
  transition: opacity .4s; }
#intro h1 { margin: 0 0 12px; font-size: 34px; line-height: 1.08; font-weight: 450; letter-spacing: -0.035em; }
#intro p { margin: 0 auto; max-width: 300px; font-size: 17px; line-height: 1.35; font-weight: 420; color: #71329D; }
#intro.gone { opacity: 0; transition: none; }   /* gone at once: never fading over the first note */
#bin::after { content: ''; width: 22px; height: 4px; border-radius: 4px; background: var(--ground); }

#debug { position: absolute; left: 8px; top: calc(60px + var(--safe-t) + var(--vv-top)); z-index: 50; margin: 0; padding: 8px 10px;
  border-radius: 12px; background: var(--ink); color: var(--ground); font: 500 11px/1.35 ui-monospace, monospace; letter-spacing: 0;
  pointer-events: none; white-space: pre; }
#debug[hidden] { display: none; }

/* no fades while the page is first drawn (the bin would flash in and out on arrival) */
body:not(.ready) *, body:not(.ready) *::before, body:not(.ready) *::after { transition: none !important; }
