/* ── Drawer Plugin — drawer.css ─────────────────────────────────────── */

#drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  display: none;
}

#drawer-overlay.visible {
  display: block;
}

#drawer-overlay.drawing {
  pointer-events: auto;
  cursor: crosshair;
}

#drawer-overlay canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ── Menu bar ────────────────────────────────────────────────────────── */

#drawer-menu {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: none;
  align-items: center;
  gap: 0;
  padding: 0 16px;
  height: 50px;
  background: rgba(15, 15, 19, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.45);
  font-family: system-ui, sans-serif;
}

#drawer-menu.visible {
  display: flex;
}

/* Pen icon */
.drawer-pen-wrap {
  display: flex;
  align-items: center;
  padding-right: 14px;
  margin-right: 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-pen-icon {
  width: 8px;
  height: 26px;
  background: #555;
  transform: rotate(30deg);
  border-radius: 2px 2px 0 0;
  transition: background 0.2s;
  position: relative;
}

.drawer-pen-icon::after {
  content: '';
  position: absolute;
  left: 1px;
  bottom: -5px;
  width: 6px;
  height: 6px;
  background: inherit;
  transform: rotate(45deg);
}

.drawer-pen-icon.active {
  background: var(--drawer-current-color, #fa1e0e);
}

/* Color swatches */
.drawer-color-list {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
  flex-shrink: 0;
}

.drawer-swatch:hover {
  transform: scale(1.15);
}

.drawer-swatch.selected {
  border-color: #fff;
  transform: scale(1.2);
}

/* Divider & buttons */
.drawer-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0 10px;
}

.drawer-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: #888;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  font-size: 15px;
}

.drawer-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #eee;
}

/* Toast */
#drawer-toast {
  position: fixed;
  bottom: 86px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: rgba(15, 15, 19, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 0.35rem 1rem;
  font-size: 0.75rem;
  color: #aaa;
  font-family: system-ui, sans-serif;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 10001;
  white-space: nowrap;
}

#drawer-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
