/* The left drawer: a PSA-styled overlay over the shop canvas. The palette
   custom properties are set at mount from @unroh/shop-renderer's palette, so
   the drawer and the sheet share one ink. */

#drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  display: flex;
  z-index: 1000;
  font-family: "DejaVu Sans Mono", monospace;
  color: var(--ink, #1c1917);
  --panel-w: 310px;
}

#drawer .drawer-panel {
  width: var(--panel-w);
  height: 100%;
  background: var(--page, #dedbc5);
  border-right: 2px solid var(--ink, #1c1917);
  box-shadow: 4px 0 14px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#drawer.collapsed .drawer-panel { display: none; }

#drawer .drawer-handle {
  width: 26px;
  background: var(--page, #dedbc5);
  border: 2px solid var(--ink, #1c1917);
  border-left: none;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  align-self: center;
  height: 120px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  user-select: none;
}

#drawer .drawer-tabs {
  display: flex;
  border-bottom: 2px solid var(--ink, #1c1917);
}

#drawer .drawer-tabs button {
  flex: 1;
  padding: 8px 0 6px;
  background: var(--page, #dedbc5);
  color: var(--label, #34302a);
  border: none;
  border-right: 1px solid var(--label, #34302a);
  font: bold 13px "DejaVu Sans Mono", monospace;
  cursor: pointer;
}

#drawer .drawer-tabs button:last-child { border-right: none; }

#drawer .drawer-tabs button.active {
  background: var(--ink, #1c1917);
  color: var(--page, #dedbc5);
}

#drawer .drawer-title {
  padding: 10px 12px 6px;
  border-bottom: 2px solid var(--ink, #1c1917);
  font-weight: bold;
  letter-spacing: 0.04em;
}

#drawer .drawer-title small {
  display: block;
  font-weight: normal;
  opacity: 0.65;
  letter-spacing: 0;
}

#drawer .drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

#drawer h3 {
  margin: 12px 0 4px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.75;
}

#drawer label { display: block; margin: 4px 0; }
#drawer input[type="text"] {
  width: 100%;
  font: 13px "DejaVu Sans Mono", monospace;
  background: #fffef4;
  color: var(--ink, #1c1917);
  border: 1.5px solid var(--ink, #1c1917);
  padding: 4px 6px;
  box-sizing: border-box;
}
#drawer button.action {
  font: bold 12px "DejaVu Sans Mono", monospace;
  background: var(--page, #dedbc5);
  color: var(--ink, #1c1917);
  border: 1.5px solid var(--ink, #1c1917);
  border-radius: 3px;
  padding: 3px 8px;
  cursor: pointer;
}
#drawer button.action:hover { background: var(--ink, #1c1917); color: var(--page, #dedbc5); }

/* swatch pickers (avatar tab) */
#drawer .swatches { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 8px; }
#drawer .swatches .swatch {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--label, #34302a);
  border-radius: 3px;
  cursor: pointer;
  padding: 0;
}
#drawer .swatches .swatch.selected { outline: 3px solid var(--select, #54708a); }
#drawer .swatches .swatch.labelled {
  width: auto;
  padding: 0 8px;
  height: 22px;
  font: 12px "DejaVu Sans Mono", monospace;
  background: var(--page, #dedbc5);
}

#drawer #avatar-preview {
  display: block;
  margin: 6px auto;
  background: var(--page, #dedbc5);
  border: 1.5px solid var(--label, #34302a);
}

/* game tab */
#drawer .game-facts div { margin: 2px 0; }
#drawer .tables-dir { margin-top: 6px; }
#drawer .tables-dir .row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0;
}
#drawer .tables-dir .row .addr { flex: 1; }

/* chat tab */
#drawer .chat { display: flex; flex-direction: column; height: 100%; }
#drawer .chat .messages {
  flex: 1;
  overflow-y: auto;
  border: 1.5px solid var(--label, #34302a);
  background: #fffef4;
  padding: 6px;
  margin-bottom: 8px;
  min-height: 120px;
}
#drawer .chat .message { margin: 2px 0; word-break: break-word; }
#drawer .chat .message .sender { font-weight: bold; margin-right: 6px; }
#drawer .chat .send { display: flex; gap: 6px; }
#drawer .chat .send input { flex: 1; }
#drawer .chat .participants { margin-top: 8px; opacity: 0.85; }

/* audio tab */
#drawer .volumes .vol { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
#drawer .volumes .vol span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#drawer .volumes input[type="range"] { flex: 2; }

/* The invite prompt: a small PSA-styled toast, bottom-center, over the canvas.
   Shown when you walk up to an avatar (invite, or the standing cooldown). */
#invite-prompt {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 90vw;
  padding: 8px 10px 8px 14px;
  background: var(--page, #dedbc5);
  color: var(--ink, #1c1917);
  border: 2px solid var(--ink, #1c1917);
  font: 13px/1.3 "DejaVu Sans Mono", monospace;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
#invite-prompt .invite-action {
  background: var(--ink, #1c1917);
  color: var(--page, #dedbc5);
  border: none;
  padding: 5px 12px;
  font: bold 12px "DejaVu Sans Mono", monospace;
  cursor: pointer;
}
#invite-prompt .invite-dismiss {
  background: none;
  border: none;
  color: var(--ink, #1c1917);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
