/* SPIDERVERSES WALL: a cork board in a dark room, red yarn everywhere, a detective who hasn't slept. */
:root {
  --paper: #f3ecda; --card: #fffaf0; --ink: #141210; --red: #d81f2a; --yarn: #c8141f; --cyan: #1fb7d6; --yellow: #ffe14d; --mute: #6d6556;
  --cork: #a8743f; --cork2: #8d5c2e;
  --display: 'Bangers', Impact, sans-serif; --marker: 'Permanent Marker', cursive; --type: 'Special Elite', 'Courier New', monospace; --mono: 'Space Mono', monospace; --body: 'Comic Neue', 'Comic Sans MS', sans-serif;
}
* { box-sizing: border-box; }
html, body { touch-action: none; margin: 0; height: 100%; overflow: hidden; background: #0d0b09; color: var(--ink); font: 700 15px/1.4 var(--body); overscroll-behavior: none; }
a { color: #3b6fe0; } button { font: inherit; cursor: pointer; color: inherit; }
.ic { width: 1em; height: 1em; vertical-align: -.14em; flex-shrink: 0; }
[hidden] { display: none !important; }

/* top bar */
.top { position: fixed; left: 0; right: 0; top: 0; z-index: 30; height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 22px; background: var(--ink); color: var(--paper); border-bottom: 5px solid var(--red); box-shadow: 0 6px 20px #000a; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--paper); text-decoration: none; flex-shrink: 0; }
.brand .mark { display: inline-flex; color: var(--red); filter: drop-shadow(2px 2px 0 #000); } .brand .mark .ic { width: 34px; height: 34px; }
.brand span:last-child { font: 400 30px/1 var(--display); letter-spacing: .04em; text-shadow: -2px 0 var(--cyan), 2px 0 var(--red); }
.brand b { font: 400 20px var(--marker); color: var(--yellow); text-shadow: none; margin-left: 4px; rotate: -4deg; display: inline-block; }
.case { min-width: 0; display: flex; flex-direction: column; border-left: 2px solid #ffffff22; padding-left: 14px; }
.case b { font: 400 22px/1 var(--display); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .04em; }
.case small { font: 700 11px var(--mono); color: #b5ab95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live { margin-left: auto; display: inline-flex; gap: 7px; align-items: center; font: 700 12px var(--mono); color: #cfc6b0; white-space: nowrap; }
.live i { width: 9px; height: 9px; border-radius: 50%; background: #3a3631; }
.live.on i { background: #2ee06a; box-shadow: 0 0 8px #2ee06a; }
.tb { display: inline-flex; gap: 7px; align-items: center; font: 400 19px/1 var(--display); letter-spacing: .05em; padding: 7px 12px 5px; background: var(--yellow); color: var(--ink); border: 2px solid var(--yellow); box-shadow: 3px 3px 0 var(--red); }

/* the room + board */
.vp { position: fixed; inset: 60px 0 0 0; overflow: hidden; cursor: grab; touch-action: none;
  background: radial-gradient(ellipse at 50% 35%, #2a1d12 0, #120d09 60%, #070605 100%); }
.vp.panning { cursor: grabbing; }
.world { position: absolute; left: 0; top: 0; width: 4800px; height: 3200px; transform-origin: 0 0;
  background:
    radial-gradient(ellipse at 50% 45%, transparent 40%, #00000088 100%),
    radial-gradient(circle at 20% 30%, #00000018 0 2px, transparent 2.5px) 0 0 / 23px 19px,
    radial-gradient(circle at 70% 60%, #ffffff10 0 1.5px, transparent 2px) 0 0 / 17px 13px,
    radial-gradient(circle at 40% 80%, #00000022 0 1px, transparent 1.6px) 0 0 / 11px 9px,
    linear-gradient(135deg, var(--cork), var(--cork2) 60%, #7a4e25);
  box-shadow: 0 0 0 26px #3b2414, 0 0 0 30px #1d1109, 0 30px 80px #000; }
/* lamp light that follows nothing: it's just moody */
.world::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 1600px 1100px at 52% 42%, #ffd9952a, transparent 70%); }
.yarn { position: absolute; left: 0; top: 0; z-index: 5; overflow: visible; pointer-events: none; }
.yarn path { fill: none; stroke: var(--yarn); stroke-width: 2.6; stroke-linecap: round; opacity: .92; filter: drop-shadow(1px 3px 1.5px #0006); }
.yarn path.hi { stroke: #ff3b47; stroke-width: 5; }
.yarn path.new { stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: draw 1s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.yarn .lbl { pointer-events: auto; cursor: pointer; }
.yarn .lbl rect { fill: #141210; }
.yarn .lbl text { font: 700 13px var(--mono); letter-spacing: .06em; fill: #f3ecda; text-transform: uppercase; }
.yarn .lbl:hover rect { fill: var(--red); }
#items { position: absolute; inset: 0; }

/* pins on the board */
.it { position: absolute; z-index: 3; rotate: var(--r, 0deg); transition: box-shadow .15s, scale .15s; filter: drop-shadow(3px 6px 4px #0008); user-select: none; -webkit-user-select: none; touch-action: none; }
.it.own { cursor: move; } .it:not(.own) { cursor: pointer; }
.it.sel { z-index: 8; scale: 1.04; filter: drop-shadow(0 0 0 #000) drop-shadow(5px 10px 8px #000c); }
.it.sel::after { content: ""; position: absolute; inset: -8px; border: 3px dashed var(--yellow); border-radius: 4px; pointer-events: none; }
.it.yfrom::after { content: ""; position: absolute; inset: -8px; border: 3px solid #ff3b47; border-radius: 4px; pointer-events: none; animation: blink .8s steps(2) infinite; }
@keyframes blink { 50% { opacity: .3; } }
.it.fresh { animation: slap .45s cubic-bezier(.2, 1.5, .4, 1); }
@keyframes slap { from { scale: 1.6; opacity: 0; } }
/* the pushpin */
.pin { position: absolute; left: 50%; top: -12px; translate: -50% 0; z-index: 4; width: 26px; height: 26px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at 35% 30%, #ff8a8f 0 18%, #d81f2a 40%, #7d0a10 100%); box-shadow: 2px 4px 3px #0009, inset -2px -3px 4px #0006; }
.it[data-c="blue"] .pin { background: radial-gradient(circle at 35% 30%, #9ad2ff 0 18%, #2a6fe0 40%, #0b2c66 100%); }
.it[data-c="green"] .pin { background: radial-gradient(circle at 35% 30%, #a5f5c0 0 18%, #1ea353 40%, #0a4422 100%); }
.it[data-c="yellow"] .pin, .it.t-note .pin { background: radial-gradient(circle at 35% 30%, #fff7b0 0 18%, #e8b80c 40%, #6b5104 100%); }
.tagx { position: absolute; z-index: 5; top: -8px; right: -10px; font: 700 10px/1 var(--mono); letter-spacing: .12em; padding: 4px 6px 3px; border: 2px solid var(--ink); rotate: 6deg; }
.tagx.EVIDENCE { background: #fff; color: var(--red); border-color: var(--red); }
.tagx.THEORY { background: var(--ink); color: var(--yellow); }
.tagx.CLAIM { background: #fff; color: var(--ink); }
.votes { position: absolute; z-index: 5; bottom: -12px; left: -10px; display: inline-flex; gap: 4px; align-items: center; font: 400 16px/1 var(--display); padding: 4px 7px 2px; background: var(--yellow); border: 2px solid var(--ink); rotate: -4deg; }
.votes .ic { width: 13px; height: 13px; }
.by { display: none; position: absolute; z-index: 5; bottom: -12px; right: -6px; font: 700 10px var(--mono); background: var(--ink); color: #cfc6b0; padding: 2px 6px; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* polaroid */
.t-photo { width: 280px; background: #fbf8f1; padding: 12px 12px 14px; }
.t-photo .ph { width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: #111; }
.t-photo .ph img { width: 100%; height: 100%; object-fit: cover; display: block; filter: contrast(1.05) saturate(1.05) sepia(.08); pointer-events: none; }
.t-photo .cp { margin-top: 10px; font: 400 19px/1.15 var(--marker); color: #1b1a3a; min-height: 22px; }
.t-photo::before { content: ""; position: absolute; left: 50%; top: -14px; translate: -50% 0; width: 110px; height: 30px; background: #f3edc8cc; rotate: -3deg; box-shadow: 0 1px 2px #0003; z-index: 2; }
/* index card */
.t-card { width: 300px; min-height: 180px; padding: 30px 18px 18px; background: repeating-linear-gradient(180deg, transparent 0 26px, #6fa8dc55 26px 27.5px), #fdfcf6; border-top: 30px solid #fdfcf6; }
.t-card::before { content: ""; position: absolute; left: 0; right: 0; top: -2px; height: 2px; background: #e66; }
.t-card .tx { font: 400 18px/27px var(--type); color: #1b1a28; }
/* sticky note */
.t-note { width: 220px; min-height: 210px; padding: 26px 18px 18px; background: linear-gradient(180deg, #fff59a, #ffe55a); clip-path: polygon(0 0, 100% 0, 100% 92%, 90% 100%, 0 100%); }
.t-note[data-c="pink"] { background: linear-gradient(180deg, #ffc4dd, #ff9bc6); } .t-note[data-c="blue"] { background: linear-gradient(180deg, #c3e6ff, #8dcbff); }
.t-note[data-c="green"] { background: linear-gradient(180deg, #ccf5c8, #9be59a); } .t-note[data-c="orange"] { background: linear-gradient(180deg, #ffd5a8, #ffb26b); }
.t-note .tx { font: 400 21px/1.2 var(--marker); color: #1b1a28; }
/* newspaper clipping */
.t-clip { width: 330px; padding: 16px 18px 18px; background: #e9e3d2; clip-path: polygon(2% 0, 30% 2%, 55% 0, 80% 1.5%, 100% 0, 98% 40%, 100% 70%, 98.5% 100%, 70% 98%, 40% 100%, 15% 98.5%, 0 100%, 1.5% 60%, 0 30%); }
.t-clip .hd { font: 400 30px/.95 var(--display); letter-spacing: .01em; color: #141210; text-transform: uppercase; border-bottom: 2px solid #14121055; padding-bottom: 8px; margin-bottom: 8px; }
.t-clip .tx { font: 400 15px/1.35 Georgia, 'Times New Roman', serif; color: #2a2620; columns: 1; text-align: justify; }
.t-clip .pin { top: 6px; }
/* rubber stamp */
.t-stamp { padding: 10px 18px 6px; border: 5px double var(--red); color: var(--red); font: 400 40px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; background: transparent; opacity: .85; filter: none; mix-blend-mode: multiply; }
.t-stamp .pin { display: none; }
/* scribbles + coffee rings (decoration, under the pins) */
/* the case title, pinned across the top of the board */
.plate { position: absolute; z-index: 2; left: 50%; top: 110px; translate: -50% 0; display: grid; justify-items: center; gap: 12px; pointer-events: none; text-align: center; }
.plate small { font: 700 18px var(--mono); letter-spacing: .3em; color: #141210; background: var(--yellow); border: 3px solid #141210; padding: 6px 16px 5px; rotate: -1.5deg; box-shadow: 4px 4px 0 #141210; }
.plate b { font: 400 112px/.9 var(--display); letter-spacing: .02em; color: #fff; -webkit-text-stroke: 3px #141210; text-shadow: -6px 0 var(--cyan), 6px 0 var(--red), 9px 9px 0 #141210; white-space: nowrap; }
.plate span { font: 400 28px/1.3 var(--marker); color: #1b1408; max-width: 1400px; }

/* tools */
.tools { position: fixed; left: 50%; bottom: 18px; translate: -50% 0; z-index: 25; display: flex; gap: 8px; padding: 10px; background: var(--paper); border: 4px solid var(--ink); box-shadow: 7px 7px 0 var(--ink); }
.tools button { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; min-width: 74px; padding: 8px 8px 6px; background: var(--card); color: var(--ink); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font: 400 16px/1 var(--display); letter-spacing: .05em; transition: translate .08s, box-shadow .08s; }
.tools button .ic { width: 22px; height: 22px; }
.tools button:hover { translate: -2px -2px; box-shadow: 5px 5px 0 var(--ink); background: #fff6c9; }
.tools button.on { background: var(--red); color: #fff; box-shadow: 3px 3px 0 var(--ink); }
.tools .sep { width: 3px; background: var(--ink); margin: 2px; }
.zoom { position: fixed; right: 18px; top: 78px; z-index: 25; display: grid; gap: 6px; }
.zoom button { width: 46px; height: 46px; display: grid; place-items: center; background: var(--paper); color: var(--ink); border: 3px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); padding: 0; }
.zoom button:hover { background: var(--yellow); }
.zoom button .ic { width: 20px; height: 20px; }
.mini { position: fixed; right: 18px; bottom: 18px; z-index: 25; width: 192px; height: 128px; border: 4px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); background: #2b1d10; cursor: pointer; }
.yarnHint { position: fixed; left: 50%; top: 76px; translate: -50% 0; z-index: 26; font: 400 20px/1 var(--display); letter-spacing: .05em; background: var(--red); color: #fff; border: 3px solid #000; padding: 8px 14px 6px; box-shadow: 4px 4px 0 #000; }

/* drawer (cases) */
.drawer { position: fixed; right: 0; top: 60px; bottom: 0; z-index: 35; width: min(420px, 100vw); overflow: auto; background: var(--paper); border-left: 5px solid var(--ink); box-shadow: -10px 0 40px #000a; padding: 18px; }
.drawer h2 { margin: 0 0 6px; font: 400 34px/1 var(--display); letter-spacing: .03em; }
.cs { display: block; margin: 10px 0; padding: 12px 14px; background: #fff; border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); color: var(--ink); text-decoration: none; }
.cs:hover { box-shadow: 4px 4px 0 var(--red); }
.cs.on { background: #fff6c9; }
.cs b { display: block; font: 400 20px/1.1 var(--type); text-transform: uppercase; }
.cs small { display: block; margin-top: 4px; color: var(--mute); font-size: 13px; }
.cs span { font: 700 11px var(--mono); color: var(--red); }

/* dialogs */
dialog { padding: 0; border: 5px solid var(--ink); background: var(--paper); color: var(--ink); width: min(620px, 94vw); max-height: 90vh; box-shadow: 14px 14px 0 #000a; }
dialog::backdrop { background: #0d0b09cc; }
.close { position: absolute; top: 10px; right: 10px; z-index: 5; width: 40px; height: 40px; display: grid; place-items: center; border: 3px solid var(--ink); background: var(--paper); box-shadow: 3px 3px 0 var(--ink); }
.close .ic { width: 18px; height: 18px; }
.dl { padding: 22px; }
.dl h3 { margin: 0 0 14px; display: inline-block; font: 400 30px/1 var(--display); letter-spacing: .04em; background: var(--yellow); border: 3px solid var(--ink); padding: 6px 14px 2px; box-shadow: 4px 4px 0 var(--ink); rotate: -1deg; }
.dl label { display: block; margin: 12px 0 4px; font: 700 11px var(--mono); letter-spacing: .12em; }
.dl input, .dl textarea { width: 100%; font: 400 18px/1.3 var(--type); border: 3px solid var(--ink); background: #fff; padding: 9px 10px; }
.dl textarea { min-height: 110px; resize: vertical; }
.dl .cnt { font: 700 11px var(--mono); color: var(--mute); text-align: right; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 3px solid var(--ink); background: #fff; color: var(--ink); font: 400 20px/1 var(--display); letter-spacing: .05em; padding: .45em .8em .35em; text-decoration: none; box-shadow: 4px 4px 0 var(--ink); }
.btn.red { background: var(--red); color: #fff; } .btn.y { background: var(--yellow); } .btn.x { background: var(--ink); color: #fff; }
.btn:disabled { opacity: .5; }
.sw { width: 34px; height: 34px; border: 3px solid var(--ink); padding: 0; } .sw.on { box-shadow: 0 0 0 3px var(--red); }
.sw.yellow { background: #ffe55a; } .sw.pink { background: #ff9bc6; } .sw.blue { background: #8dcbff; } .sw.green { background: #9be59a; } .sw.orange { background: #ffb26b; }
.seg { display: flex; gap: 0; } .seg button { font: 700 12px var(--mono); letter-spacing: .1em; padding: 8px 12px; border: 3px solid var(--ink); background: #fff; } .seg button + button { border-left: 0; } .seg button.on { background: var(--ink); color: #fff; }
.locker { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; max-height: 46vh; overflow: auto; padding: 4px; }
.locker button { padding: 0; border: 3px solid var(--ink); background: #000; aspect-ratio: 4 / 3; overflow: hidden; }
.locker button.on { box-shadow: 0 0 0 4px var(--red); }
.locker img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stamps { display: flex; flex-wrap: wrap; gap: 8px; }
.stamps button { font: 400 20px/1 var(--display); letter-spacing: .06em; color: var(--red); border: 4px double var(--red); background: #fff; padding: 8px 12px 5px; }
.stamps button.on { background: var(--red); color: #fff; }
.detail .it { position: relative; rotate: 0deg; margin: 12px auto 18px; filter: drop-shadow(3px 6px 4px #0005); }
.detail .meta { font: 700 12px var(--mono); color: var(--mute); }
.links { margin-top: 10px; display: grid; gap: 6px; }
.links button { text-align: left; display: flex; gap: 8px; align-items: center; background: #fff; border: 2px solid var(--ink); padding: 7px 10px; font: 400 16px var(--type); }
.links button .ic { color: var(--yarn); }

#toast { position: fixed; left: 50%; top: 76px; translate: -50% 0; z-index: 120; display: none; font: 400 19px var(--display); letter-spacing: .04em; background: var(--yellow); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); padding: 8px 16px 5px; white-space: nowrap; }
.foot { display: none; }

@media (max-width: 720px) {
  .top { height: 54px; gap: 8px; padding: 0 10px; } .vp { top: 54px; } .drawer { top: 54px; }
  .brand span:last-child { display: none; } .case b { font-size: 16px; } .case small { display: none; }
  .tb .lbl { display: none; }
  .tools { bottom: 10px; gap: 5px; padding: 6px; max-width: calc(100vw - 16px); overflow-x: auto; box-shadow: 4px 4px 0 var(--ink); }
  .tools button { min-width: 54px; font-size: 13px; padding: 6px 4px 4px; box-shadow: 2px 2px 0 var(--ink); } .tools button .ic { width: 20px; height: 20px; } .tools .sep { display: none; }
  .live #watch { display: none; } .top { padding: 0 10px; }
  .mini { display: none; } .zoom { top: 66px; right: 10px; } .zoom button { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) { .it.fresh, .yarn path.new { animation: none; stroke-dashoffset: 0; } }

.votes.zero { display: none; }
.it:hover .votes.zero { display: inline-flex; opacity: .85; }

/* phones: let dialogs and the case drawer scroll, buttons tap without zooming */
dialog, .drawer, .locker { touch-action: pan-y; }
button, a, input, textarea { touch-action: manipulation; }
@media (max-width: 720px) {
  /* all seven tools fit across the screen */
  .tools { left: 8px; right: 8px; translate: none; max-width: none; overflow: visible; gap: 4px; padding: 5px; }
  .tools button { flex: 1 1 0; min-width: 0; padding: 6px 0 4px; font-size: 11px; letter-spacing: .02em; }
  .tools button .ic { width: 19px; height: 19px; }
  .zoom { top: 64px; } .zoom button { width: 40px; height: 40px; }
  .yarnHint { top: 64px; font-size: 16px; white-space: nowrap; }
}
