/* prasinum-emoji: the sheet and the stickers. Colours and fonts come from prasinum-kit (kit.css). */
:root {
  --sheet: #fffdf6;
  --sheet-dot: rgba(22, 33, 12, 0.09);
  --cell: 68px;
  --glyph: 40px;
  --cut: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --sheet: #1d2513; --sheet-dot: rgba(243, 241, 228, 0.08); }
}
:root[data-theme="dark"] { --sheet: #1d2513; --sheet-dot: rgba(243, 241, 228, 0.08); }
@media (max-width: 720px) { :root { --cell: 54px; --glyph: 32px; } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.demo-note { background: color-mix(in srgb, var(--rust) 14%, transparent); color: var(--rust); padding: 6px 24px; font: 12px/1.4 var(--font-mono); }
.kit-bar .count { margin-left: auto; }

.wrap { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 24px 150px; }
@media (max-width: 720px) { .wrap { padding: 16px 12px 150px; } }

/* The sheet: backing paper with a faint dot grid, as on a real sticker sheet. */
.sheet {
  position: relative; min-height: 60vh; border-radius: 18px; padding: 22px;
  background: radial-gradient(var(--sheet-dot) 1.2px, transparent 1.4px) 0 0 / 22px 22px, var(--sheet);
  border: 1.5px solid var(--ink); box-shadow: var(--shadow);
}
@media (max-width: 720px) { .sheet { padding: 12px; border-radius: 14px; } }
.empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font-style: italic; color: var(--ink-soft); }

.stickers {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--cell), 1fr)); grid-auto-rows: var(--cell);
}
.sticker {
  display: grid; place-items: center; position: relative;
  /* Set per sticker from the server: --r rotation, --x/--y nudge, --s size. */
  transform: translate(calc(var(--x, 0) * 1px), calc(var(--y, 0) * 1px)) rotate(calc(var(--r, 0) * 1deg)) scale(var(--s, 1));
  transition: transform 0.18s cubic-bezier(.3,1.6,.5,1);
}
.sticker button {
  all: unset; cursor: pointer; display: block; line-height: 1;
  font-size: var(--glyph);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  /* The white die-cut edge and a soft shadow underneath. */
  filter:
    drop-shadow(2px 0 0 var(--cut)) drop-shadow(-2px 0 0 var(--cut))
    drop-shadow(0 2px 0 var(--cut)) drop-shadow(0 -2px 0 var(--cut))
    drop-shadow(0 3px 3px rgba(22, 33, 12, 0.28));
  -webkit-user-select: none; user-select: none;
}
.sticker button:focus-visible { outline: 2px solid var(--green); outline-offset: 6px; border-radius: 10px; }
.sticker:hover, .sticker.active { z-index: 2; transform: translate(calc(var(--x, 0) * 1px), calc(var(--y, 0) * 1px - 3px)) rotate(calc(var(--r, 0) * 0.4deg)) scale(calc(var(--s, 1) * 1.18)); }
/* A sticker you just put on: slapped down onto the sheet. */
.sticker.new { animation: slap 0.45s cubic-bezier(.2,1.4,.4,1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes slap {
  0% { opacity: 0; transform: translate(0, -18px) rotate(calc(var(--r, 0) * -2deg)) scale(calc(var(--s, 1) * 1.9)); }
  60% { opacity: 1; }
  100% { transform: translate(calc(var(--x, 0) * 1px), calc(var(--y, 0) * 1px)) rotate(calc(var(--r, 0) * 1deg)) scale(var(--s, 1)); }
}

/* Who put it there, and when. */
.tip {
  position: fixed; z-index: 60; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 7px 11px 8px; border-radius: 9px;
  font: 13px/1.35 var(--font-mono); white-space: nowrap; box-shadow: var(--shadow);
  transform: translate(-50%, calc(-100% - 10px));
}
.tip b { font-family: var(--font-display); font-size: 15px; font-weight: 700; display: block; }
.tip::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: var(--ink); transform: translateX(-50%) rotate(45deg); }
.tip.below { transform: translate(-50%, 10px); }
.tip.below::after { bottom: auto; top: -5px; }

/* Writing: always at the bottom of the window. */
.compose {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 14px 24px calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 90%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}
.compose-inner { max-width: 1180px; margin: 0 auto; display: flex; gap: 10px; }
.compose input {
  flex: 1; min-width: 0; font-size: 24px; padding: 10px 16px; border-radius: 12px;
  border: 1.5px solid var(--ink); background: var(--panel); color: var(--ink);
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", var(--font-body);
}
.compose input::placeholder { color: var(--ink-soft); opacity: .7; font-size: 18px; font-family: var(--font-body); }
.compose input:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.compose .kit-btn { flex: none; border-radius: 12px; padding: 0 22px; }
.hint { max-width: 1180px; margin: 6px auto 0; font: 12px/1.4 var(--font-mono); color: var(--ink-soft); display: flex; justify-content: space-between; gap: 12px; min-height: 17px; }
.hint .warn { color: var(--rust); }
@media (max-width: 720px) { .compose { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); } #keys { display: none; } }

/* Sign-in page. */
.login-page { display: grid; place-items: center; }
.login { max-width: 560px; padding: 48px 24px; }
.login .ms { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin: 8px 0 14px; }
.login .ms svg { width: 18px; height: 18px; }
.login .fine { font-size: 15px; }
.login-stickers { list-style: none; display: flex; gap: 14px; padding: 0; margin: 0 0 22px; font-size: 44px; }
.login-stickers li { filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 3px 3px rgba(22,33,12,.28)); }
.login-stickers li:nth-child(1) { transform: rotate(-12deg); }
.login-stickers li:nth-child(2) { transform: rotate(8deg) translateY(6px); }
.login-stickers li:nth-child(3) { transform: rotate(-4deg); }
.login-stickers li:nth-child(4) { transform: rotate(14deg) translateY(-4px); }
.login-stickers li:nth-child(5) { transform: rotate(-9deg) translateY(4px); }
