/* ============ neighbourhoodz — comic-sansy cartoon skin ============ */
:root {
  --paper: #fffdf5;
  --ink: #2b2b2b;
  --msn-blue-1: #7db9e8;
  --msn-blue-2: #2989d8;
  --msn-green: #7ac142;
  --wobble-border: 3px solid var(--ink);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: "Comic Neue", "Comic Sans MS", "Chalkboard SE", cursive;
  color: var(--ink);
  overflow: hidden;
}

#map { position: absolute; inset: 0; background: #d6ebc9; }

/* cartoonify the base tiles */
.leaflet-tile-pane { filter: saturate(1.5) contrast(0.92) brightness(1.05); }

/* ============ splash: the HOODZ sticker ============ */
#splash {
  position: absolute; inset: 0; z-index: 8000;
  perspective: 1200px; background: #000;
}
#splashInner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4vh; padding: 4vh 16px;
}
#splashSticker {
  max-width: min(92vw, 560px); max-height: 72vh; object-fit: contain;
  animation: sticker-arrive 0.55s cubic-bezier(0.2, 1.5, 0.4, 1);
}
@keyframes sticker-arrive {
  from { transform: rotate(8deg) scale(0.6); opacity: 0; }
  to { transform: rotate(0) scale(1); opacity: 1; }
}
.splash-start {
  position: relative; transform: rotate(-2deg);
  font-size: 26px; padding: 14px 44px;
  border-width: 4px; border-radius: 22px 14px 20px 12px;
  animation: start-bob 1.6s ease-in-out infinite;
}
@keyframes start-bob {
  0%, 100% { transform: rotate(-2deg) scale(1); }
  50% { transform: rotate(1deg) scale(1.05); }
}

/* card flip between splash and welcome */
.overlay { perspective: 1200px; }
.flip-out { animation: flip-out 0.4s ease-in forwards; }
.flip-in { animation: flip-in 0.4s ease-out; }
@keyframes flip-out { from { transform: rotateY(0); } to { transform: rotateY(90deg); } }
@keyframes flip-in { from { transform: rotateY(-90deg); } to { transform: rotateY(0); } }

/* ============ windows (MSN chic) ============ */
.window {
  background: var(--paper);
  border: var(--wobble-border);
  border-radius: 14px 16px 14px 18px; /* slightly uneven = hand-drawn */
  box-shadow: 6px 6px 0 rgba(43, 43, 43, 0.25);
  overflow: hidden;
}

.titlebar {
  background: linear-gradient(180deg, var(--msn-blue-1), var(--msn-blue-2));
  color: #fff;
  font-weight: 700;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.25);
  cursor: default;
  user-select: none;
}
.titlebar.mini { font-size: 14px; padding: 5px 10px; }
.titlebar-icon { font-size: 18px; }
.win-btns { margin-left: auto; display: flex; gap: 6px; }
.win-btns i {
  font-style: normal; background: rgba(255,255,255,0.25); border: 1px solid rgba(255,255,255,0.6);
  border-radius: 5px; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; cursor: pointer;
}
.win-btns i:hover { background: rgba(255,255,255,0.5); }

.hidden { display: none !important; }

/* ============ buttons & inputs ============ */
.btn {
  font-family: inherit; font-weight: 700; font-size: 15px;
  background: var(--msn-green); color: #fff;
  border: 2px solid var(--ink); border-radius: 12px 10px 12px 10px;
  padding: 8px 16px; cursor: pointer;
  box-shadow: 3px 3px 0 rgba(43,43,43,0.3);
  transition: transform 0.08s;
}
.btn:hover { transform: translate(-1px, -1px) rotate(-1deg); }
.btn:active { transform: translate(2px, 2px); box-shadow: none; }
.btn.small { font-size: 13px; padding: 5px 10px; }
.btn.big { font-size: 20px; padding: 12px 30px; margin-top: 14px; }

input {
  font-family: inherit; font-size: 15px;
  border: 2px solid var(--ink); border-radius: 10px 8px 10px 8px;
  padding: 8px 10px; background: #fff; outline: none;
}
input:focus { box-shadow: 0 0 0 3px rgba(122,193,66,0.4); }

/* ============ onboarding ============ */
.overlay {
  position: absolute; inset: 0; z-index: 5000;
  background: repeating-linear-gradient(45deg, #bfe3f7 0 24px, #cdeafc 24px 48px);
  display: flex; align-items: center; justify-content: center;
  overflow-y: auto; padding: 16px;
}
.onboard-window { width: 400px; max-width: 96vw; }
.onboard-body { padding: 14px 22px 20px; text-align: center; }
.onboard-body h1 {
  margin: 4px 0 0; font-family: "Patrick Hand", "Comic Sans MS", cursive;
  font-size: 42px; letter-spacing: 1px; transform: rotate(-1.5deg);
  color: var(--msn-blue-2); text-shadow: 2px 2px 0 #fce38a;
}
.tagline { margin: 2px 0 16px; font-size: 14px; }
.field-label { display: block; text-align: left; font-size: 13px; font-weight: 700; margin: 12px 0 5px; }
.nick-row { display: flex; gap: 8px; }
.nick-row input { flex: 1; }

.easel { position: relative; width: 150px; height: 190px; margin: 0 auto; }
.easel canvas {
  position: absolute; inset: 0;
  border: 2px dashed #9db8a0; border-radius: 10px; background: transparent;
}
#guideCanvas { background: #fff; }
#drawCanvas { touch-action: none; cursor: crosshair; }

.easel-tools { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 10px; flex-wrap: wrap; }
.swatch {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink);
  cursor: pointer; display: inline-block;
}
.swatch.selected { outline: 3px solid #fce38a; }
.fineprint { font-size: 11px; color: #777; margin-top: 12px; }

/* ============ avatar dock ============ */
#dock {
  position: absolute; left: 14px; bottom: 172px; z-index: 3000;
  background: var(--paper); border: var(--wobble-border);
  border-radius: 16px 14px 18px 14px; box-shadow: 5px 5px 0 rgba(43,43,43,0.25);
  padding: 10px 14px; text-align: center; width: 150px;
}
#dockAvatar { display: none; } /* your character lives on the map now, not in the dock */
#dock { width: 132px; padding: 8px 10px; }
#dock .btn.small { width: 100%; margin-top: 4px; }
.dock-nick { font-weight: 700; font-size: 14px; margin: 2px 0 6px; }
.dock-hint {
  position: absolute; bottom: 105%; left: 0; width: 190px; pointer-events: none;
  background: #fce38a; border: 2px solid var(--ink); border-radius: 12px;
  padding: 7px 10px; font-size: 13px; font-weight: 700;
  animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-2deg);} 50% { transform: translateY(-6px) rotate(1deg);} }

/* pre-join bubble */
#placeBubble {
  position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%);
  z-index: 3600; text-align: center;
  background: var(--paper); border: 3px solid var(--ink);
  border-radius: 18px 16px 18px 16px; box-shadow: 5px 5px 0 rgba(43,43,43,0.25);
  padding: 12px 18px 10px;
  animation: bob 1.8s ease-in-out infinite;
}
#placeBubbleAvatar { width: 68px; height: 86px; cursor: grab; user-select: none; -webkit-user-drag: none; touch-action: none; }
#placeBubbleAvatar:active { cursor: grabbing; }
.pb-text { font-size: 13px; font-weight: 700; margin-top: 4px; }

/* ghost avatar that follows pointer while dragging */
#dragGhost {
  position: fixed; z-index: 9000; pointer-events: none;
  width: 70px; opacity: 0.85; transform: translate(-50%, -50%) rotate(4deg);
  filter: drop-shadow(3px 4px 2px rgba(0,0,0,0.3));
}

.ghost-btn { background: #eee; color: #555; padding: 4px 8px; margin-left: 4px; }

/* ============ neighbourhood labels & markers ============ */
.hood-label {
  background: none; border: none; box-shadow: none;
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  font-size: 15px; font-weight: 700; color: #4a4a4a;
  text-shadow: 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff;
  text-align: center; white-space: nowrap;
}
.hood-label .pop { color: var(--msn-blue-2); font-size: 13px; }

.avatar-marker { background: none; border: none; }
.avatar-marker .fig { position: relative; text-align: center; }
.avatar-marker img {
  width: 52px; height: 66px;
  filter: drop-shadow(2px 3px 1px rgba(0,0,0,0.25));
}
.avatar-marker.me img { animation: bob 2s ease-in-out infinite; }
.avatar-marker .who {
  font-size: 12px; font-weight: 700; background: #fff; border: 2px solid var(--ink);
  border-radius: 8px; padding: 0 5px; display: inline-block; white-space: nowrap;
}
.avatar-marker .bubble {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-30%);
  background: #fff; border: 2px solid var(--ink); border-radius: 12px;
  padding: 4px 9px; font-size: 12px; white-space: nowrap; max-width: 220px;
  overflow: hidden; text-overflow: ellipsis;
}
.avatar-marker .bubble::after {
  content: ""; position: absolute; top: 100%; left: 22px;
  border: 6px solid transparent; border-top-color: var(--ink);
}

/* ============ hood card ============ */
#hoodCard { position: absolute; z-index: 3500; width: 250px; top: 80px; right: 16px; }
.hood-card-body { padding: 12px 14px; }
.hood-count-line { font-size: 14px; margin-bottom: 8px; }
.hood-links { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.hood-links a { font-size: 13px; color: var(--msn-blue-2); font-weight: 700; }

/* map credits */
#creditsBtn {
  position: absolute; right: 5px; bottom: 162px; z-index: 3100;
  width: 20px; height: 20px; border-radius: 50%;
  border: none; background: rgba(255, 253, 245, 0.75); color: #666;
  font-size: 13px; line-height: 1; cursor: pointer; padding: 0;
}
#creditsPop {
  position: absolute; right: 8px; bottom: 30px; z-index: 3100;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 10px;
  padding: 8px 12px; font-size: 11.5px; max-width: 240px;
  box-shadow: 3px 3px 0 rgba(43,43,43,0.25);
}
#creditsPop a { color: var(--msn-blue-2); }

/* floating block-chat button */
#chatFab {
  position: absolute; right: 16px; bottom: 172px; z-index: 3900;
  font-size: 16px; padding: 12px 18px;
}
#chatFab.shake { animation: shake 0.5s linear; }
.fab-badge {
  background: #e0245e; color: #fff; font-size: 12px; font-weight: 700;
  border: 2px solid #fff; border-radius: 50%; min-width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-left: 6px; padding: 0 4px;
}

/* ============ chat window ============ */
#chatWindow {
  position: absolute; right: 16px; bottom: 16px; z-index: 4000;
  width: 440px; max-width: 94vw; height: 340px;
  display: flex; flex-direction: column;
}
#chatWindow.minimized { height: auto; }
#chatWindow.minimized .chat-inner { display: none; }
#chatWindow.shake { animation: shake 0.5s linear; }
@keyframes shake {
  0%,100% { transform: translate(0,0); }
  10% { transform: translate(-8px,-4px) rotate(-1deg); } 20% { transform: translate(7px,5px) rotate(1deg); }
  30% { transform: translate(-6px,3px); } 40% { transform: translate(8px,-5px) rotate(1deg); }
  50% { transform: translate(-7px,-3px) rotate(-1deg); } 60% { transform: translate(5px,6px); }
  70% { transform: translate(-8px,2px) rotate(-1deg); } 80% { transform: translate(6px,-4px); }
  90% { transform: translate(-4px,4px); }
}

.hood-places {
  display: flex; gap: 6px; overflow-x: auto; padding: 7px 8px;
  background: #f4fbee; border-bottom: 2px dashed #ccc; flex: 0 0 auto;
}
.hp-chip {
  flex: 0 0 auto; white-space: nowrap; cursor: pointer;
  font-size: 12.5px; font-weight: 700;
  background: #fff; border: 2px solid var(--ink); border-radius: 14px; padding: 3px 9px;
}
.hp-chip.user-built { background: #fce38a; }

/* tables strip */
.table-strip {
  display: flex; gap: 6px; overflow-x: auto; padding: 6px 8px;
  background: #fffbe8; border-bottom: 2px dashed #ccc; flex: 0 0 auto;
}
.t-chip {
  flex: 0 0 auto; white-space: nowrap; cursor: pointer;
  font-size: 12.5px; font-weight: 700;
  background: #fff; border: 2px solid var(--ink); border-radius: 14px; padding: 3px 9px;
}
.t-chip.on { background: var(--msn-blue-2); color: #fff; }
.t-chip.new { background: #d9f2c4; }
.t-chip b { color: var(--msn-blue-2); }
.t-chip.on b { color: #fce38a; }

/* porch light */
.avatar-marker.porch img {
  filter: drop-shadow(0 0 5px #ffd23f) drop-shadow(0 0 11px #ffd23f) drop-shadow(2px 3px 1px rgba(0,0,0,0.25));
}
#porchBtn.porch-on { background: #f39c12; animation: porch-glow 1.8s ease-in-out infinite; }
@keyframes porch-glow {
  0%, 100% { box-shadow: 3px 3px 0 rgba(43,43,43,0.3); }
  50% { box-shadow: 3px 3px 0 rgba(43,43,43,0.3), 0 0 14px #ffd23f; }
}

.chat-inner { display: flex; flex: 1; min-height: 0; }
.chat-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
#messages { flex: 1; overflow-y: auto; padding: 10px 12px; font-size: 14px; background: #fff; }
#messages .msg { margin-bottom: 6px; word-wrap: break-word; }
#messages .msg .nick { font-weight: 700; color: var(--msn-blue-2); }
#messages .msg.mine .nick { color: #18a558; }
#messages .msg.system { color: #999; font-size: 12.5px; font-style: italic; }
#messages .msg .time { color: #bbb; font-size: 11px; margin-left: 5px; }

.chat-compose {
  display: flex; gap: 6px; padding: 8px; border-top: 2px dashed #ccc; background: var(--paper);
}
.chat-compose input { flex: 1; min-width: 0; }

.chat-roster {
  width: 110px; border-left: 2px dashed #ccc; background: #f4fbee;
  overflow-y: auto; padding: 6px;
}
.roster-title { font-size: 11px; font-weight: 700; color: #777; text-transform: uppercase; margin-bottom: 4px; }
.roster-item { text-align: center; margin-bottom: 8px; cursor: pointer; }
.roster-item img { width: 34px; height: 43px; }
.roster-item .rn { font-size: 11px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-item .rs { font-size: 10px; color: #888; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============ person card / street cred ============ */
#personCard {
  position: absolute; z-index: 4450; left: 50%; top: 7vh; transform: translateX(-50%);
  width: 320px; max-width: 94vw; max-height: 84vh; display: flex; flex-direction: column;
}
.pc-body { padding: 12px 16px 16px; text-align: center; overflow-y: auto; }
#pcAvatar { width: 76px; height: 96px; }
.pc-name { font-family: "Patrick Hand", "Comic Sans MS", cursive; font-size: 26px; }
.pc-meta { font-size: 12.5px; color: #555; margin: 2px 0 8px; }
.pc-irl {
  font-size: 13px; font-weight: 700; background: #d9f2c4;
  border: 2px dashed var(--ink); border-radius: 10px; padding: 6px 8px; margin-bottom: 8px;
}
.pc-cred-title { font-family: "Patrick Hand", "Comic Sans MS", cursive; font-size: 20px; margin-top: 12px; }
.pc-cred { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.pc-cred .big-stars { color: #f39c12; font-size: 19px; letter-spacing: 2px; }
.pc-reviews { text-align: left; max-height: 160px; overflow-y: auto; margin-bottom: 8px; }
.pc-review { border-bottom: 2px dashed #eee; padding: 6px 2px; font-size: 12.5px; }
.pc-review .rv-stars { color: #f39c12; }
.pc-review .rv-meta { color: #999; font-size: 11px; }
.pc-stars { font-size: 26px; cursor: pointer; user-select: none; margin-bottom: 4px; }
.pc-stars span { padding: 0 2px; }
.pc-stars span.on { color: #f39c12; }
#pcRate input { width: 100%; margin-bottom: 6px; }

/* ============ shoutouts ============ */
#shoutToast {
  position: absolute; z-index: 4850; top: 14px; left: 50%; transform: translateX(-50%);
  width: 300px; max-width: 92vw;
  animation: shout-drop 0.4s cubic-bezier(0.2, 1.5, 0.4, 1);
}
@keyframes shout-drop { from { transform: translate(-50%, -120%); } to { transform: translate(-50%, 0); } }
.shout-body { padding: 10px 14px; text-align: center; }
#shoutText { font-size: 13.5px; margin-bottom: 8px; }
.msg .at { color: var(--msn-blue-2); font-weight: 700; }
.msg.mentioned { background: #fff3b0; border-radius: 8px; padding: 2px 5px; }

/* ============ status popup ============ */
#statusPopup { position: absolute; z-index: 4500; left: 14px; bottom: 190px; width: 270px; }
.status-body { padding: 12px; display: flex; gap: 6px; }
.status-body input { flex: 1; min-width: 0; }

/* ============ the rolodex ============ */
#rolodex {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3200;
}
.rolodex-hint {
  text-align: center; font-size: 14px; font-weight: 700; margin-bottom: 2px;
  color: #fff; text-shadow: 1px 1px 0 var(--ink), -1px 1px 0 var(--ink), 1px -1px 0 var(--ink), -1px -1px 0 var(--ink);
  animation: bob 1.8s ease-in-out infinite;
}
#rolo {
  display: flex; gap: 14px; overflow-x: auto; align-items: center;
  padding: 14px 50vw 16px; scroll-snap-type: x mandatory; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; perspective: 700px;
}
#rolo::-webkit-scrollbar { display: none; }
.rolo-card {
  flex: 0 0 auto; scroll-snap-align: center; cursor: pointer;
  width: 138px; height: 120px; text-align: center;
  border: 3px solid var(--ink); border-radius: 14px 11px 14px 11px;
  box-shadow: 4px 5px 0 rgba(0, 0, 0, 0.35);
  padding: 8px 6px; will-change: transform;
  display: flex; flex-direction: column; justify-content: center;
  transition: box-shadow 0.15s;
}
.rolo-card .rc-art {
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  font-size: 34px; line-height: 1; opacity: 0.35;
}
.rolo-card .rc-art img { width: 100%; height: 56px; object-fit: contain; }
.rolo-card .rc-name {
  font-family: "Patrick Hand", "Comic Sans MS", cursive;
  font-size: 17px; line-height: 1.15;
}
.rolo-card .rc-count { font-size: 12px; font-weight: 700; color: var(--msn-blue-2); min-height: 15px; }
.rolo-card.focus { box-shadow: 0 0 0 3px #fce38a, 4px 5px 0 rgba(0, 0, 0, 0.35); }

/* ============ the hood room ============ */
#hoodScreen {
  position: absolute; inset: 0; z-index: 3700;
  display: flex; flex-direction: column;
  animation: room-in 0.32s ease-out;
  border: 3px solid var(--ink);
  transition: height 0.28s ease, width 0.28s ease, border-radius 0.28s ease;
}
@keyframes room-in {
  from { opacity: 0; transform: scale(1.06); }
  to { opacity: 1; transform: scale(1); }
}
/* peek mode: the zoomed hood stays visible, the room docks to the side/bottom */
#hoodScreen.peek {
  top: auto; bottom: 0; height: 68vh;
  border-radius: 22px 18px 0 0; border-bottom: none;
  box-shadow: 0 -6px 0 rgba(43, 43, 43, 0.2);
  animation: room-up 0.35s cubic-bezier(0.2, 1.2, 0.4, 1);
}
@keyframes room-up {
  from { transform: translateY(60%); opacity: 0.4; }
  to { transform: translateY(0); opacity: 1; }
}
@media (min-width: 820px) {
  #hoodScreen.peek {
    top: 0; bottom: 0; left: auto; right: 0; width: 420px; height: auto;
    border-radius: 22px 0 0 22px; border-bottom: 3px solid var(--ink); border-right: none;
    box-shadow: -6px 0 0 rgba(43, 43, 43, 0.2);
    animation: room-side 0.35s cubic-bezier(0.2, 1.2, 0.4, 1);
  }
  @keyframes room-side {
    from { transform: translateX(60%); opacity: 0.4; }
    to { transform: translateX(0); opacity: 1; }
  }
}
.hs-header {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px 8px; border-bottom: 3px solid var(--ink);
  background: rgba(255, 253, 245, 0.6);
}
.hs-header h2 {
  margin: 0; font-family: "Patrick Hand", "Comic Sans MS", cursive;
  font-size: 34px; transform: rotate(-1.2deg); text-shadow: 2px 2px 0 #fff;
}
.hs-count { font-size: 13.5px; font-weight: 700; width: 100%; }
.hs-body { flex: 1; overflow-y: auto; padding: 14px 16px 90px; }
.hs-actions { display: flex; gap: 8px; margin-bottom: 14px; }
.hs-actions .btn { flex: 1; font-size: 14px; padding: 9px 6px; }
.hs-section-title {
  font-family: "Patrick Hand", "Comic Sans MS", cursive; font-size: 21px;
  margin: 16px 0 6px; transform: rotate(-0.6deg);
}
.hs-people { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px; margin-bottom: 12px; }
.hs-person {
  flex: 0 0 auto; width: 110px; text-align: center; cursor: pointer;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 12px 10px 12px 10px;
  padding: 8px 6px; box-shadow: 3px 3px 0 rgba(43,43,43,0.2);
}
.hs-person img { width: 44px; height: 56px; }
.hsp-nick { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hsp-status { font-size: 11px; color: #666; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hsp-irl {
  font-size: 11px; font-weight: 700; background: #d9f2c4; border: 2px dashed var(--ink);
  border-radius: 8px; padding: 2px 4px; margin-top: 3px;
}
.hsp-irl.quiet { background: #e7edf2; }
.hs-empty { font-size: 13.5px; color: #555; background: rgba(255,255,255,0.5); border-radius: 10px; padding: 10px 12px; }
.hs-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.hs-chip {
  font-size: 12.5px; font-weight: 700; cursor: pointer;
  background: #fffbe8; border: 2px dashed var(--ink); border-radius: 14px; padding: 4px 10px;
}
.hs-boards { display: flex; flex-direction: column; gap: 7px; }
.hs-board-line {
  font-size: 14px; font-weight: 700; cursor: pointer;
  background: #fce38a; border: 2px solid var(--ink); border-radius: 12px; padding: 10px 12px;
  box-shadow: 3px 3px 0 rgba(43,43,43,0.2);
}
.hs-board-line[data-board="service"] { background: #e0d4f7; }
.hs-board-line[data-board="activity"] { background: #ffd6e0; }
.hs-board-line[data-board="event"] { background: #c9e9f6; }
.hs-board-line[data-board="lostfound"] { background: #f6d5c3; }
.hs-board-line[data-board="headsup"] { background: #ffc9c9; }
#hsChatLine { background: #d9f2c4; }
.hsb-count { font-weight: 700; color: #555; font-size: 12.5px; }
.profile-nick-locked {
  font-weight: 700; font-size: 17px; background: #eee; border: 2px dashed #bbb;
  border-radius: 10px; padding: 7px 10px;
}
.hs-spots { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px; }
.hs-spot {
  flex: 0 0 auto; width: 130px; text-align: center;
  background: #fff; border: 2px solid var(--ink); border-radius: 12px 10px 12px 10px;
  padding: 8px 6px; box-shadow: 3px 3px 0 rgba(43,43,43,0.2);
}
.hs-spot img { width: 100px; height: 75px; object-fit: contain; }
.hss-name { font-size: 12.5px; font-weight: 700; }
.hss-who { font-size: 11px; color: var(--msn-blue-2); font-weight: 700; }
.hss-btns { display: flex; gap: 4px; justify-content: center; margin-top: 4px; }
.hss-btns .btn { font-size: 10.5px; padding: 3px 5px; }
.hs-spot.build { cursor: pointer; font-size: 30px; background: #f4fbee; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 110px; }
.hs-todos { font-size: 13px; }
.hs-todo { background: rgba(255,255,255,0.55); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; }
.hs-perks { color: #666; font-size: 12px; }
.hs-links { display: flex; gap: 16px; margin-top: 16px; }
.hs-links a { font-size: 13px; font-weight: 700; color: var(--msn-blue-2); }

/* smaller characters on the fixed city map */
.avatar-marker.mini img { width: 30px; height: 38px; }
.avatar-marker.mini .who { font-size: 9.5px; border-width: 1.5px; }
.avatar-marker.mini .bubble { font-size: 11px; }

/* nameless crowd figures on the city view */
.anon-figure { background: none; border: none; cursor: pointer; }
.anon-figure img {
  width: 26px; height: 34px;
  filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, 0.3));
}

/* ============ character mover ============ */
#mover {
  position: absolute; z-index: 4400; left: 50%; top: 12vh; transform: translateX(-50%);
  width: 300px; max-width: 92vw; max-height: 72vh; display: flex; flex-direction: column;
}
.mover-body { padding: 12px 14px; display: flex; flex-direction: column; min-height: 0; }
.mover-note { font-size: 12px; color: #777; margin: 8px 0; text-align: center; }
.mover-list { overflow-y: auto; border: 2px dashed #ccc; border-radius: 10px; }
.mover-item {
  display: flex; justify-content: space-between; padding: 8px 12px;
  font-weight: 700; font-size: 14px; cursor: pointer; border-bottom: 2px dashed #eee;
}
.mover-item:hover { background: #fce38a; }
.mover-item.current { background: #d9f2c4; cursor: default; }
.mover-item .mc { color: var(--msn-blue-2); font-size: 12.5px; }

/* ============ places carousel ============ */
.places-carousel { border: 2px dashed #bbb; border-radius: 12px; padding: 8px; margin-bottom: 10px; text-align: center; background: #fff; }
.carousel-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.place-title { flex: 1; font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#placeArt { width: 140px; height: 105px; object-fit: contain; background: #fff; border: 2px solid var(--ink); border-radius: 8px; }
.place-who { font-size: 12px; margin: 6px 0; min-height: 16px; }
.place-who img { width: 20px; height: 25px; vertical-align: middle; }
.no-places { font-size: 13px; color: #888; margin-bottom: 10px; text-align: center; }
.hood-card-btns { display: flex; gap: 6px; }
.hood-card-btns .btn { flex: 1; font-size: 13px; padding: 7px 6px; }

/* ============ spot builder ============ */
.builder-window { width: 460px; max-width: 96vw; }
.builder-body { padding: 12px 18px 18px; text-align: center; }
.builder-blurb { font-size: 13px; margin: 4px 0 10px; }
.builder-row { display: flex; gap: 10px; align-items: flex-start; justify-content: center; }
#paintCanvas { border: 2px solid var(--ink); border-radius: 8px; background: #fff; touch-action: none; cursor: crosshair; }
.paint-tools { display: flex; flex-direction: column; gap: 6px; width: 100px; }
.paint-swatches { display: flex; flex-wrap: wrap; gap: 5px; }
.pswatch { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--ink); cursor: pointer; }
.pswatch.selected { outline: 3px solid #fce38a; }
.ptool.selected { background: var(--msn-blue-2); }
.builder-meta { display: flex; gap: 8px; margin-top: 12px; }
.builder-meta input { flex: 1; min-width: 0; }
select {
  font-family: inherit; font-size: 14px; border: 2px solid var(--ink);
  border-radius: 10px 8px 10px 8px; padding: 8px; background: #fff;
}

#placeBanner {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 4600;
  background: #fce38a; border: 3px solid var(--ink); border-radius: 14px;
  padding: 10px 18px; font-size: 15px; font-weight: 700;
  animation: bob 1.6s ease-in-out infinite;
}

/* place markers on the map */
.place-marker { background: none; border: none; }
.place-marker .pm { text-align: center; }
.place-marker img {
  width: 58px; height: 44px; object-fit: contain; background: rgba(255,255,255,0.85);
  border: 2px solid var(--ink); border-radius: 8px;
  filter: drop-shadow(2px 3px 1px rgba(0,0,0,0.2));
}
.place-marker .pn {
  font-size: 11px; font-weight: 700; background: #fff; border: 2px solid var(--ink);
  border-radius: 8px; padding: 0 4px; display: inline-block; white-space: nowrap;
}
.place-marker .pc { font-size: 11px; color: var(--msn-blue-2); font-weight: 700; }

/* zoomed-out presence dots */
.avatar-dot { background: none; border: none; }
.avatar-dot .dot {
  width: 14px; height: 14px; border-radius: 50%;
  border: 3px solid var(--ink); background: var(--msn-green);
  box-shadow: 2px 2px 0 rgba(0,0,0,0.25);
}
.avatar-dot.virtual .dot { background: var(--msn-blue-2); }
.avatar-dot.me .dot { outline: 3px solid #fce38a; }

/* "coming later" plan markers — a translucent promise of a person */
.avatar-marker.plan { opacity: 0.62; }
.avatar-marker.plan img { filter: grayscale(0.4) drop-shadow(2px 3px 1px rgba(0,0,0,0.15)); }
.avatar-marker.plan .who { border-style: dashed; }
.avatar-marker.plan .bubble { border-style: dashed; background: #fffbe8; }

/* parks + libraries */
.poi-marker { font-size: 18px; text-align: center; text-shadow: 1px 1px 0 #fff; }
.leaflet-popup-content-wrapper { font-family: "Comic Neue", "Comic Sans MS", cursive; border: 2px solid var(--ink); border-radius: 12px; }

.dock-plan {
  font-size: 12px; font-weight: 700; background: #fffbe8; border: 2px dashed var(--ink);
  border-radius: 8px; padding: 3px 6px; margin-bottom: 6px;
}
.dock-plan span { cursor: pointer; color: #e0245e; }
.dock-invite { background: #d9f2c4; }
.invite-btn { background: #f39c12; margin-top: 4px; }

.invite-bubble {
  background: #d9f2c4 !important; font-weight: 700; white-space: normal !important;
  width: max-content; max-width: 200px !important;
  animation: invite-pulse 1.8s ease-in-out infinite;
}
.join-hint { font-weight: 700; color: #18a558; font-size: 11px; }
.invite-bubble.no-join { background: #e7edf2 !important; animation: none; }
.join-row { margin-top: 12px; }
.join-row .ichip { font-size: 13px; padding: 5px 12px; }
@keyframes invite-pulse {
  0%, 100% { transform: translateX(-30%) scale(1); }
  50% { transform: translateX(-30%) scale(1.06); }
}
#invitePopup {
  position: absolute; z-index: 4550; left: 50%; top: 10vh; transform: translateX(-50%);
  width: 330px; max-width: 94vw; max-height: 80vh; overflow-y: auto;
}
.invite-composer { padding: 10px 14px 14px; }
.invite-composer input { width: 100%; }
.invite-composer .field-label { margin-top: 10px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
.ichip {
  font-size: 12.5px; font-weight: 700; cursor: pointer;
  background: #fff; border: 2px solid var(--ink); border-radius: 20px; padding: 3px 10px;
  user-select: none;
}
.ichip.selected { background: var(--msn-green); color: #fff; }
.invite-preview {
  margin-top: 12px; min-height: 20px; font-size: 13.5px;
  background: #d9f2c4; border: 2px dashed var(--ink); border-radius: 10px; padding: 8px 10px;
}
#inviteSave { margin-top: 10px; width: 100%; }

#planPopup { position: absolute; z-index: 4550; left: 50%; top: 40%; transform: translateX(-50%); width: 300px; }

/* ============ mod panel ============ */
#modPanel { position: absolute; z-index: 4800; top: 70px; left: 14px; width: 300px; max-height: 70vh; display: flex; flex-direction: column; }
.mod-list { overflow-y: auto; padding: 10px; }
.mod-item { border-bottom: 2px dashed #ddd; padding: 8px 0; text-align: center; }
.mod-item img { width: 130px; height: 98px; object-fit: contain; border: 2px solid var(--ink); border-radius: 8px; background: #fff; }
.mod-item .mi-name { font-weight: 700; font-size: 14px; }
.mod-item .mi-meta { font-size: 12px; color: #888; margin-bottom: 5px; }
.mod-item .btn { margin: 0 3px; }
.mod-empty { font-size: 13px; color: #888; text-align: center; padding: 10px; }

/* ============ DM windows ============ */
.dm-window {
  position: absolute; z-index: 4200; width: 300px; height: 240px;
  display: flex; flex-direction: column; bottom: 30px; left: 200px;
}
.dm-window .dm-messages { flex: 1; overflow-y: auto; background: #fff; padding: 8px 10px; font-size: 13.5px; }
.dm-window .chat-compose { padding: 6px; }
.dm-window .titlebar { background: linear-gradient(180deg, #f7a8c4, #d84f8b); }


/* ============ auth + home screen ============ */
.auth-tabs { display: flex; gap: 8px; margin: 12px 0 4px; justify-content: center; }
.atab {
  font-weight: 700; font-size: 15px; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 20px; padding: 5px 16px; background: #fff;
}
.atab.selected { background: var(--msn-blue-2); color: #fff; }
#authStep input { width: 100%; }
.auth-err { color: #e0245e; font-weight: 700; font-size: 13px; min-height: 18px; margin-top: 8px; }
.draw-cancel { font-size: 13px; font-weight: 700; color: #888; cursor: pointer; display: inline-block; margin-top: 10px; }

#home { position: absolute; top: 62px; left: 14px; z-index: 4760; width: 320px; max-height: 82vh; overflow-y: auto; }
.home-body { padding: 12px 16px 16px; }
.home-chars { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px; }
.char-card {
  flex: 0 0 auto; width: 96px; text-align: center;
  border: 2px solid var(--ink); border-radius: 12px 10px 12px 10px; padding: 8px 6px; background: #fff;
}
.char-card.active { background: #fce38a; }
.char-card img { width: 52px; height: 66px; }
.char-card .cc-nick { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.char-card .cc-btns { display: flex; justify-content: center; gap: 4px; margin-top: 4px; }
.char-card .cc-btns span {
  cursor: pointer; font-size: 12px; border: 2px solid var(--ink); border-radius: 8px;
  padding: 1px 5px; background: var(--paper);
}
.char-card .cc-active-tag { font-size: 11px; font-weight: 700; color: #7a5426; }
textarea {
  font-family: inherit; font-size: 14px; width: 100%;
  border: 2px solid var(--ink); border-radius: 10px 8px 10px 8px; padding: 8px 10px; resize: vertical;
}
#homeHoodSel { width: 100%; }
#homeSave { margin-top: 12px; }

/* ============ hamburger menu + profile ============ */
#menuBtn { position: absolute; top: 14px; left: 14px; z-index: 3300; padding: 6px 13px; font-size: 18px; }

#zoomDock {
  position: absolute; top: 66px; left: 18px; z-index: 3250;
  background: var(--paper); border: 3px solid var(--ink);
  border-radius: 14px; box-shadow: 3px 3px 0 rgba(43,43,43,0.3);
  padding: 14px 9px;
}
#zTrack {
  position: relative; width: 8px; height: 88px;
  background: #fff; border: 2px solid var(--ink); border-radius: 6px;
  touch-action: none; cursor: pointer;
}
.zdot {
  position: absolute; left: 50%; transform: translate(-50%, -50%);
  width: 4px; height: 4px; border-radius: 50%; background: var(--ink);
  pointer-events: none;
}
#zThumb {
  position: absolute; left: 50%; transform: translate(-50%, -50%);
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--msn-blue-2); border: 3px solid var(--ink);
  box-shadow: 2px 2px 0 rgba(43,43,43,0.3);
  transition: top 0.25s; pointer-events: none;
}

#menuPanel { position: absolute; top: 62px; left: 14px; z-index: 4700; width: 180px; }
.menu-item { padding: 10px 14px; font-weight: 700; font-size: 15px; cursor: pointer; border-bottom: 2px dashed #ddd; }
.menu-item:last-child { border-bottom: none; }
.menu-item:hover { background: #fce38a; }

#profile { position: absolute; top: 62px; left: 14px; z-index: 4750; width: 280px; max-height: 82vh; overflow-y: auto; }
.profile-body { padding: 12px 16px 16px; text-align: center; }
#profileAvatar { width: 84px; height: 106px; }
.profile-body .field-label { text-align: left; }
.profile-body input { width: 100%; }
#profileSave { margin-top: 12px; }
#profileEasel .easel { margin: 0 auto; }

/* ============ corkboard ============ */
#boardBtn { position: absolute; top: 14px; right: 16px; z-index: 3200; }

#board {
  position: absolute; z-index: 4300; top: 60px; right: 16px;
  width: 420px; max-width: 95vw; height: min(520px, 76vh);
  display: flex; flex-direction: column;
  background:
    radial-gradient(circle at 20% 30%, rgba(160,110,60,0.16) 0 3px, transparent 4px),
    radial-gradient(circle at 70% 60%, rgba(160,110,60,0.13) 0 2px, transparent 3px),
    #d9a86b;
}
.board-filters {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 10px; background: rgba(255,253,245,0.85); border-bottom: 2px dashed #b58449;
}
.chip {
  font-size: 12.5px; font-weight: 700; cursor: pointer;
  background: #fff; border: 2px solid var(--ink); border-radius: 20px; padding: 3px 9px;
}
.chip.selected { background: var(--msn-blue-2); color: #fff; }
#boardHood { margin-left: auto; font-size: 12.5px; padding: 4px 6px; max-width: 140px; }

.board-posts { flex: 1; overflow-y: auto; padding: 12px; }
.postit {
  position: relative;
  border: 2px solid var(--ink); border-radius: 3px 14px 6px 12px;
  padding: 10px 12px 8px; margin-bottom: 12px;
  box-shadow: 3px 4px 0 rgba(60,30,0,0.25);
  font-size: 14px;
}
.postit:nth-child(odd) { transform: rotate(-1.2deg); }
.postit:nth-child(even) { transform: rotate(1deg); }
.postit::before {
  content: "📌"; position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  font-size: 16px;
}
.postit.buysell { background: #fff3b0; }
.postit.service { background: #e0d4f7; }
.postit.activity { background: #ffd6e0; }
.postit.event { background: #c9e9f6; }
.postit.lostfound { background: #f6d5c3; }
.postit.headsup { background: #ffc9c9; }
.p-att { font-size: 12px; font-weight: 700; color: #2b6e2f; margin-top: 4px; }
.p-imin { margin-top: 5px; }
.postit .p-meta { font-size: 11.5px; color: #666; margin-top: 6px; }
.postit .p-meta b { color: var(--msn-blue-2); }
.postit .p-when { font-size: 12.5px; font-weight: 700; margin-top: 3px; }
.postit .p-actions { position: absolute; top: 4px; right: 7px; font-size: 12px; }
.postit .p-actions span { cursor: pointer; margin-left: 6px; }
.board-empty { text-align: center; color: #7a5426; font-weight: 700; padding: 30px 10px; }

.board-compose {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px;
  background: rgba(255,253,245,0.9); border-top: 2px dashed #b58449;
}
.board-compose select { font-size: 12.5px; padding: 5px; }
.board-compose input { flex: 1; min-width: 120px; font-size: 13.5px; }

.hood-board-peek { margin-bottom: 10px; }
.hood-board-peek .peek-line { font-size: 12.5px; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hood-board-peek .peek-open { font-size: 13px; font-weight: 700; color: var(--msn-blue-2); cursor: pointer; }

/* mobile */
@media (max-width: 640px) {
  #chatWindow { width: 96vw; height: 46vh; right: 2vw; bottom: 2vw; }
  .chat-roster { width: 84px; }
  #hoodCard { width: 220px; top: 66px; right: 8px; }
}
