:root { --fridge: #ffffff; --fridge2: #eef0f0; --ink: #1b1b1b; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #fff; overflow: hidden; color: var(--ink);
  font-family: "IBM Plex Mono", ui-monospace, monospace; }
#wrap { position: fixed; inset: 0; display: grid; place-items: center; }
#stage { position: fixed; inset: 0; }

/* the door */
#fridge { position: absolute; inset: 0; background: #fff; overflow: hidden; touch-action: none; }
.handle { position: absolute; right: 26px; top: 300px; width: 22px; height: 420px; border-radius: 11px;
  background: linear-gradient(90deg, #8f9a95, #f4f7f5 40%, #a9b3ae 70%, #6f7874);
  box-shadow: -3px 4px 10px rgba(0,0,0,.25); }
.note { position: absolute; left: 1290px; top: -64px; width: 300px; padding: 16px 16px 10px; transform: rotate(2deg);
  background: #fffdf4; font: 12px/1.4 "IBM Plex Mono", monospace; box-shadow: 0 8px 16px rgba(0,0,0,.18); }
.note::before { content: ""; position: absolute; left: 50%; top: -12px; width: 30px; height: 30px; margin-left: -15px;
  border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ff8a7a, #d02c1f 60%, #8e1a11);
  box-shadow: 0 3px 4px rgba(0,0,0,.3); }
.note b { font-size: 20px; letter-spacing: .08em; }
.note ol { list-style: none; padding: 0; margin: 10px 0 8px; }
.note i { font-style: normal; font-weight: 600; color: #d02c1f; }
.note .credit { font-size: 12px; opacity: .6; }
#board { position: absolute; left: 0; top: 0; width: 0; height: 0; overflow: visible; }

/* magnets */
.mag { position: absolute; left: 0; top: 0; white-space: nowrap; user-select: none; -webkit-user-select: none;
  touch-action: none; cursor: grab; transform-origin: 50% 50%; will-change: transform; }
.mag.drag { cursor: grabbing; }
.mag.w, .mag.b { font: 32px/1 "Libre Caslon Text", Georgia, serif; padding: 9px 13px 8px; background: #fff;
  box-shadow: 1px 2px 0 rgba(0,0,0,.16), 0 5px 9px rgba(0,0,0,.12); }
.mag.b { background: #fff3b8; font-style: italic; }
.mag.l { font: 600 34px/1 "Fredoka", "Arial Rounded MT Bold", sans-serif; padding: 2px 3px; color: var(--c);
  text-shadow: 0 -1px 0 rgba(255,255,255,.55), 0 2px 0 rgba(0,0,0,.25), 0 6px 7px rgba(0,0,0,.22); }
.mag.drag.w, .mag.drag.b { box-shadow: 3px 10px 0 rgba(0,0,0,.08), 0 18px 24px rgba(0,0,0,.22); }
.mag.drag.l { text-shadow: 0 -1px 0 rgba(255,255,255,.55), 0 2px 0 rgba(0,0,0,.25), 0 16px 14px rgba(0,0,0,.25); }
.mag.held { outline: 3px dashed var(--peer); outline-offset: 3px; }
.mag.pop { animation: pop .18s ease-out; }
@keyframes pop { 50% { filter: brightness(1.15); } }

/* the tray */
#tray { position: fixed; right: 12px; top: 12px; transform-origin: 100% 0; z-index: 3; width: 264px; height: 1080px; padding: 20px 16px 14px;
  display: flex; flex-direction: column; gap: 14px; background: #f1ece2; border-radius: 26px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 8px 30px rgba(0,0,0,.14); }
#tray h1 { margin: 0; font: 600 40px/1 "Fredoka", sans-serif; letter-spacing: .04em; }
#tray h1 { background: linear-gradient(90deg, #e63b2e 0 20%, #e0a100 20% 40%, #2a6fdb 40% 60%, #2fa84f 60% 80%, #f28b1e 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
#tray p { margin: 6px 0 0; font-size: 12px; }
.who #count { font-weight: 600; }
.me { display: block; margin-top: 8px; font-size: 12px; }
.me input { font: inherit; width: 150px; border: 0; border-bottom: 2px solid #0002; background: transparent; padding: 2px 0; }
.hint { opacity: .7; line-height: 1.45; }
kbd { font: inherit; border: 1px solid #0003; border-radius: 4px; padding: 0 5px; background: #fff; }
nav { display: flex; gap: 8px; }
nav button { flex: 1; font: 600 16px "IBM Plex Mono", monospace; padding: 8px 0; border-radius: 10px; border: 2px solid #0002;
  background: transparent; cursor: pointer; }
nav button.on { background: #1b1b1b; color: #fff; border-color: #1b1b1b; }
#supply { flex: 1; overflow-y: auto; overflow-x: hidden; display: flex; flex-wrap: wrap; align-content: flex-start;
  gap: 6px 4px; padding: 6px 2px; position: relative; }
#supply .mag { position: relative; transform: none; }
#supply .mag.l { font-size: 44px; width: 52px; text-align: center; cursor: grab; }
#supply .mag.l.bit { font-size: 24px; width: auto; padding: 4px 6px; }
#supply .mag.w, #supply .mag.b { font-size: 24px; }
#mint { display: flex; gap: 8px; }
#mint input { flex: 1; min-width: 0; font: 17px "Libre Caslon Text", serif; padding: 8px 12px; border: 2px solid #0002; border-radius: 10px; background: #fff; }
#mint button { width: 54px; font: 600 28px "Fredoka", sans-serif; border: 0; border-radius: 10px; background: #2fa84f; color: #fff; cursor: pointer; }
footer { font-size: 12px; opacity: .55; }
#tray.bin { box-shadow: inset 0 0 0 5px #e63b2e, 0 8px 30px rgba(0,0,0,.14); }

/* cursors */
#cursors { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
.cur { position: absolute; left: 0; top: 0; transition: transform .06s linear; }
.cur svg { display: block; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.cur .tag { position: absolute; left: 20px; top: 24px; padding: 3px 9px; border-radius: 10px; font: 600 15px "IBM Plex Mono", monospace;
  color: #fff; white-space: nowrap; }
.cur .say { position: absolute; left: 20px; top: 56px; padding: 7px 12px; border-radius: 14px; background: #fff;
  font: 18px "IBM Plex Mono", monospace; white-space: nowrap; box-shadow: 0 4px 10px rgba(0,0,0,.2); }
.cur .say:empty { display: none; }
#chat { position: fixed; z-index: 10; font: 16px "IBM Plex Mono", monospace; padding: 6px 10px; border-radius: 12px;
  border: 2px solid #1b1b1b; background: #fff; width: 260px; }
#status { position: fixed; left: 12px; bottom: 10px; font: 12px "IBM Plex Mono", monospace; color: #1b1b1b; }

#marquee { position: absolute; border: 2px solid #2a6fdb; background: rgba(42,111,219,.08); border-radius: 4px; pointer-events: none; z-index: 999999; }
.mag.sel { background: rgba(42,111,219,.16); border-radius: 6px; }
#supply .mag sup { position: absolute; right: 2px; top: 2px; font: 600 11px "IBM Plex Mono", monospace; color: #1b1b1b; opacity: .6; }
#supply .mag.out { opacity: .2; pointer-events: none; }

.mag.n { width: 200px; height: 200px; padding: 14px 12px 22px; display: flex; align-items: center; justify-content: center;
  background: #fff38a; color: #1b1b1b; font-family: Inter, system-ui, sans-serif; border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 8px 16px -8px rgba(0,0,0,.3); }
.mag.n .txt { width: 100%; max-height: 168px; text-align: center; white-space: pre-wrap; word-break: break-word;
  line-height: 1.2; outline: none; overflow: hidden; }
.mag.n .txt:empty::after { content: "double-click to write"; opacity: .4; font-size: 15px; }
.mag.n .by { position: absolute; left: 10px; bottom: 6px; font: 400 11px Inter, sans-serif; opacity: 0; transition: opacity .15s; }
.mag.n:hover .by { opacity: .55; }
.mag.n.editing { cursor: text; box-shadow: 0 0 0 3px #2a6fdb, 0 8px 16px -8px rgba(0,0,0,.3); }
.mag.n.editing .txt { user-select: text; -webkit-user-select: text; cursor: text; }
.mag.n.sel { box-shadow: 0 0 0 3px #2a6fdb; }
#padrow { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
#swatches { display: grid; grid-template-columns: repeat(2, 22px); gap: 6px; }
#swatches button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #0002; cursor: pointer; padding: 0; }
#swatches button.on { border-color: #1b1b1b; }
#pad { width: 130px; height: 130px; padding: 12px; cursor: grab; touch-action: none; user-select: none;
  display: flex; flex-direction: column; justify-content: center; text-align: center;
  font: 600 16px/1.2 Inter, sans-serif; background: #fff38a; border-radius: 2px;
  box-shadow: 3px 3px 0 #0000000d, 6px 6px 0 #0000000a, 0 10px 14px -6px rgba(0,0,0,.25); }
#pad small { font-weight: 400; font-size: 11px; opacity: .6; margin-top: 6px; }

footer { display: flex; justify-content: space-between; align-items: center; opacity: 1; }
footer span { opacity: .6; }
footer a { color: inherit; }
#histBtn { font: 600 12px "IBM Plex Mono", monospace; border: 2px solid #0002; border-radius: 8px; background: transparent; padding: 4px 10px; cursor: pointer; }
#hist { position: absolute; right: 12px; bottom: 50px; width: 240px; max-height: 520px; overflow-y: auto; padding: 12px 14px; z-index: 5;
  background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 12px; }
#hist small { display: block; opacity: .6; margin: 4px 0 8px; }
#histList { list-style: none; padding: 0; margin: 0; }
#histList li { padding: 6px 4px; border-top: 1px solid #0001; cursor: pointer; display: flex; justify-content: space-between; }
#histList li:hover { background: #2a6fdb14; }
#histList li.sure { background: #e63b2e; color: #fff; }

.sticker { position: fixed; z-index: 2; right: calc(var(--trayw, 276px) + 26px); bottom: 22px; transform-origin: 100% 100%; margin: 0; padding: 9px 13px 10px 10px; transform: rotate(4deg) scale(var(--ts, 1));
  font: 10px/1.1 ui-monospace, Menlo, monospace; font-weight: 700; color: #3a1c2a; background: #ffd3e4; pointer-events: none;
  border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.18), 0 4px 10px rgba(0,0,0,.08);
  clip-path: polygon(0 0, 100% 0, 100% 90%, 82% 100%, 0 100%); }
/* the peeled corner: its curled-back underside */
.sticker::after { content: ""; position: absolute; right: 0; bottom: 0; width: 18%; height: 10%;
  background: linear-gradient(135deg, #e9a9c2 0%, #fff0f6 45%, #f3c4d6 52%, transparent 53%);
  box-shadow: -3px -3px 6px rgba(0,0,0,.12); border-top-left-radius: 40% 60%; }
#zoom { position: fixed; left: 16px; bottom: 16px; display: flex; gap: 2px; padding: 4px; border-radius: 10px; background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.15); z-index: 2; }
#zoom button { min-width: 36px; height: 32px; border: 0; border-radius: 7px; background: transparent; cursor: pointer;
  font: 600 16px "IBM Plex Mono", monospace; }
#zoom button:hover { background: #0000000d; }
#zpct { font-size: 12px !important; }
#phone { position: fixed; left: 10px; right: 10px; top: 10px; z-index: 20; padding: 12px 14px; border-radius: 12px; background: #1b1b1b; color: #fff;
  font: 14px/1.4 "IBM Plex Mono", monospace; display: flex; gap: 12px; align-items: center; }
#phone[hidden] { display: none; }
#phone button { font: inherit; border: 0; border-radius: 8px; padding: 6px 12px; background: #fff; cursor: pointer; }

.sticker .flag { background: #e63b2e; color: #fff; padding: 0 2px; }

footer { gap: 6px; flex-wrap: wrap; }
footer button { font: 600 12px "IBM Plex Mono", monospace; border: 2px solid #0002; border-radius: 8px; background: transparent; padding: 4px 8px; cursor: pointer; }
footer .by { width: 100%; text-align: right; }
#card { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; background: rgba(0,0,0,.18); }
#card > .in { position: relative; width: min(420px, 92vw); max-height: 80vh; overflow-y: auto; padding: 22px 24px 24px;
  background: #fff; border-radius: 12px; box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 12px 40px rgba(0,0,0,.18); font: 15px/1.5 Inter, system-ui, sans-serif; }
#card h2 { margin: 8px 0 6px; font: 600 34px/1.05 "Fredoka", sans-serif; word-break: break-word; }
#card .chip { font: 600 11px "IBM Plex Mono", monospace; padding: 3px 8px; border-radius: 20px; background: #eee; }
#card .chip.canon { background: #2fa84f; color: #fff; } #card .chip.established { background: #2a6fdb; color: #fff; }
#card .chip.open, #card .chip.new { background: #e0a100; color: #fff; }
#card .def { margin: 0 0 8px; } #card .root { margin: 0 0 8px; font-style: italic; opacity: .7; }
#card .src { display: inline-block; margin-bottom: 10px; color: #2a6fdb; }
#card .notes b { font-size: 12px; }
#card ul { list-style: none; padding: 0; margin: 6px 0 12px; display: grid; gap: 6px; }
#card li { padding: 8px 10px; font-size: 14px; border-radius: 2px; }
#card .leave { font: 600 14px Inter, sans-serif; border: 0; border-radius: 8px; padding: 9px 14px; background: #1b1b1b; color: #fff; cursor: pointer; }
.x { position: absolute; right: 10px; top: 8px; border: 0; background: transparent; font-size: 22px; cursor: pointer; opacity: .5; }
#fb { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.25); display: grid; place-items: center; }
#fb[hidden], #card[hidden] { display: none; }
#fb form { position: relative; width: min(440px, 92vw); padding: 22px; border-radius: 14px; background: #fff; display: grid; gap: 10px;
  font: 14px Inter, system-ui, sans-serif; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
#fb b { font: 600 20px "Fredoka", sans-serif; } #fb small { opacity: .6; }
#fb select, #fb textarea { font: 15px Inter, sans-serif; padding: 8px 10px; border: 2px solid #0002; border-radius: 8px; }
#fb .send { font: 600 15px Inter, sans-serif; border: 0; border-radius: 8px; padding: 10px; background: #2fa84f; color: #fff; cursor: pointer; }
#fb .out { font-size: 13px; }
#help { position: absolute; right: 12px; bottom: 50px; width: 240px; padding: 12px 14px; z-index: 5; background: #fff; border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 12px; line-height: 1.45; }
#help ul { margin: 6px 0 0; padding-left: 16px; }
#help[hidden] { display: none; }
.mag.n .done { position: absolute; left: 50%; bottom: -44px; transform: translateX(-50%); font: 600 14px Inter, sans-serif;
  border: 0; border-radius: 8px; padding: 8px 14px; background: #1b1b1b; color: #fff; cursor: pointer; white-space: nowrap; }
.mag.n.editing .txt:empty::after { content: "type, then press enter"; }
#card .notes { border-top: 1px solid #0001; padding-top: 10px; margin-top: 4px; }
#card ul { max-height: 46vh; overflow-y: auto; }
#card li { cursor: pointer; display: grid; gap: 4px; }
#card li small { font-size: 11px; opacity: .55; }
#card li:hover { filter: brightness(.97); }
#card .defby { margin: -2px 0 8px; font-size: 12px; opacity: .6; }
#card .pen { display: inline-block; margin: 0 0 10px; border: 0; background: transparent; color: #2a6fdb; font: 600 14px Inter, sans-serif; cursor: pointer; padding: 0; }
#card .pen[hidden], #card .defedit[hidden], #card .defby[hidden] { display: none; }
#card .defedit textarea { width: 100%; font: 15px Inter, sans-serif; padding: 8px 10px; border: 2px solid #2a6fdb; border-radius: 8px; }
#card .defedit button { margin-top: 6px; font: 600 14px Inter, sans-serif; border: 0; border-radius: 8px; padding: 7px 12px; cursor: pointer; }
#card .defedit .save { background: #2a6fdb; color: #fff; }
#tips { position: fixed; left: 16px; top: 16px; z-index: 5; width: 280px; padding: 14px 16px; border-radius: 12px; background: #1b1b1b; color: #fff;
  font: 14px/1.45 Inter, system-ui, sans-serif; box-shadow: 0 10px 30px rgba(0,0,0,.2); }
#tips[hidden] { display: none; }
#tips ul { margin: 6px 0 10px; padding-left: 18px; }
#tips button { font: 600 13px Inter, sans-serif; border: 0; border-radius: 8px; padding: 6px 12px; background: #fff; cursor: pointer; }
#pins { position: absolute; left: 0; top: 0; }
.pin { position: absolute; left: 0; top: 0; width: 20px; height: 20px; padding: 0; border-radius: 50%; cursor: pointer;
  font: 700 11px/18px Inter, sans-serif; text-align: center; z-index: 999998; }
.pin.has { background: #2a6fdb; color: #fff; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.pin.needs { background: #fff; border: 2.5px solid #e0a100; width: 16px; height: 16px; }
.pin:hover { transform-origin: center; filter: brightness(1.1); }
#key .pin { position: static; display: inline-block; vertical-align: middle; margin: 0 4px 0 10px; cursor: default; }
#key .pin:first-child { margin-left: 0; }
#key { position: fixed; left: 160px; bottom: 22px; z-index: 2; padding: 8px 12px; border-radius: 10px; background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); font: 12px Inter, system-ui, sans-serif; }
#key .k { opacity: .5; margin-left: 10px; }
#card .addform textarea { width: 100%; font: 15px Inter, sans-serif; padding: 8px 10px; border: 2px solid #2a6fdb; border-radius: 8px; }
#card .addform button { margin-top: 6px; font: 600 14px Inter, sans-serif; border: 0; border-radius: 8px; padding: 7px 12px; cursor: pointer; }
#card .addform .save { background: #2a6fdb; color: #fff; }
#card .addform[hidden], #card .leave[hidden] { display: none; }
#card li { background: #f4f6fb; border-left: 3px solid #2a6fdb; cursor: default; }
@media (max-width: 900px) { #key { display: none; } }
#card .chip.new { background: #8a4fd8; color: #fff; }
#card .def.empty { opacity: .55; font-style: italic; }
#tips .tname { display: block; margin: 8px 0 4px; font-size: 13px; opacity: .9; }
#tips .tname input { display: block; width: 100%; margin-top: 4px; font: 600 15px Inter, sans-serif; padding: 7px 10px; border-radius: 8px; border: 0; }
