:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --surface: #15181d;
  --surface-2: #1d2127;
  --line: #2b3038;
  --text: #e9ecf0;
  --muted: #8b939e;
  --accent: #7b6cff;
  --live: #3ddc84;
  --warn: #f2b84b;
  --danger: #ff6b5f;
  --gutter: 16px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { background: var(--bg); }
body {
  margin: 0 auto;
  max-width: 560px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding:
    calc(env(safe-area-inset-top) + 12px)
    calc(env(safe-area-inset-right) + var(--gutter))
    calc(env(safe-area-inset-bottom) + 16px)
    calc(env(safe-area-inset-left) + var(--gutter));
  background: var(--bg);
  color: var(--text);
  font: 16px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

header { display: flex; align-items: center; gap: 10px; }
.wordmark { height: 22px; width: auto; }
.title { color: var(--muted); font-weight: 600; letter-spacing: .04em; }
.status {
  margin-left: auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.status::before { content: "● "; }
.status[data-state="live"] { color: var(--live); }
.status[data-state="sending"] { color: var(--warn); }
.status[data-state="offline"] { color: var(--danger); }

.who { display: flex; align-items: center; gap: 10px; overflow-x: auto; scrollbar-width: none; }
.who-label { flex: none; color: var(--muted); font-size: 14px; }
.chips { display: flex; gap: 6px; }
.chip {
  flex: none;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 15px;
  font-weight: 600;
}
.chip[aria-pressed="true"] { background: var(--accent); box-shadow: none; color: #fff; }

main { display: grid; place-items: center; }
#paper {
  width: min(100%, 58dvh);
  aspect-ratio: 1;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgb(0 0 0 / .45);
  touch-action: none; /* the finger draws instead of scrolling the page */
  cursor: crosshair;
}

.colors { display: flex; justify-content: space-between; gap: 6px; }
.color {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgb(255 255 255 / .15);
}
.color[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px #fff; }

.tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sizes { display: flex; gap: 6px; margin-right: auto; }
.size {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--surface);
}
.size span { display: block; border-radius: 50%; background: var(--text); }
.size[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.tool {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
}
.tool[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.tool.danger { color: var(--danger); }

.stickers {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 8px;
  border-radius: 16px;
  background: var(--surface);
}
.sticker { height: 46px; border-radius: 12px; font-size: 28px; }
.sticker[aria-pressed="true"] { background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--accent); }

.hint { margin: 0; color: var(--muted); font-size: 13px; text-align: center; }

.locked {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  padding: 32px;
  background: var(--bg);
  text-align: center;
  color: var(--muted);
}
.locked .wordmark { height: 32px; }
