/* Shared visual wand editor — scoped styles. All classes/vars are we-prefixed so
   they never collide with Tailwind, app.css, or the wd- debugger styles. Neutrals
   track the app's slate chrome (the editor sits inside a slate ui.Card); the accent
   is the app's sky-500. */
.we-editor {
  --we-bg: #020617;        /* slate-950 */
  --we-panel: #0b1220;
  --we-cell: #0f172a;      /* slate-900 */
  --we-hair: #1e293b;      /* slate-800 */
  --we-hair-2: #334155;    /* slate-700 */
  --we-ink: #e2e8f0;       /* slate-200 */
  --we-muted: #94a3b8;     /* slate-400 */
  --we-faint: #64748b;     /* slate-500 */
  --we-accent: #38bdf8;    /* sky-400 */
  --we-accent-2: #0ea5e9;  /* sky-500 */
  --we-sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --we-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 15rem;
  gap: 14px;
  font-family: var(--we-sans);
  color: var(--we-ink);
}
@media (max-width: 720px) {
  .we-editor { grid-template-columns: minmax(0, 1fr); }
}
.we-editor * { box-sizing: border-box; }
.we-editor img.we-ico {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ---- slot grid ---- */
.we-slotwrap { min-width: 0; }
.we-slot-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.we-slot-head .we-title { font-size: 12px; color: var(--we-muted); }
.we-slot-head .we-count {
  font-family: var(--we-mono);
  font-size: 11px;
  color: var(--we-faint);
  font-variant-numeric: tabular-nums;
}
.we-slots {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 4px;
}
@media (max-width: 900px) {
  .we-slots { grid-template-columns: repeat(9, minmax(0, 1fr)); }
}
.we-slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: border-color .1s, background .1s, box-shadow .1s;
}
.we-slot.empty {
  border: 1px dashed var(--we-hair-2);
  background: repeating-linear-gradient(-45deg, transparent, transparent 4px, #0b122055 4px, #0b122055 8px);
}
.we-slot.filled {
  border: 1px solid var(--we-hair-2);
  background: var(--we-cell);
  cursor: grab;
}
.we-slot.filled:hover { border-color: var(--we-accent); }
.we-slot.filled:active { cursor: grabbing; }
.we-slot.dragging { opacity: .35; }
.we-slot.we-insert { box-shadow: inset 3px 0 0 var(--we-accent); }
.we-slot:focus-visible { outline: 2px solid var(--we-accent); outline-offset: 1px; }
.we-slotn {
  position: absolute;
  bottom: 1px;
  right: 3px;
  font-family: var(--we-mono);
  font-size: 8px;
  color: var(--we-faint);
  pointer-events: none;
}
.we-slot.filled .we-slotn { color: #ffffff66; }
.we-ph {
  font-family: var(--we-mono);
  font-size: 9px;
  color: var(--we-muted);
  letter-spacing: .02em;
}
.we-x {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid var(--we-hair-2);
  background: #1e293b;
  color: var(--we-ink);
  font-size: 9px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.we-slot.filled:hover .we-x,
.we-slot.filled:focus-within .we-x { display: flex; }
.we-x:hover { background: #b91c1c; border-color: #b91c1c; }

/* ---- spell bank ---- */
.we-bankwrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--we-hair);
  border-radius: 8px;
  background: var(--we-panel);
  overflow: hidden;
}
.we-search {
  margin: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--we-hair-2);
  background: var(--we-bg);
  color: var(--we-ink);
  font-size: 12px;
  font-family: var(--we-sans);
}
.we-search:focus { outline: none; border-color: var(--we-accent); box-shadow: 0 0 0 2px #38bdf833; }
.we-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 0 8px 6px;
  border-bottom: 1px solid var(--we-hair);
}
.we-cat {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid var(--we-hair-2);
  background: transparent;
  color: var(--we-muted);
  cursor: pointer;
  font-family: var(--we-sans);
}
.we-cat:hover { border-color: var(--we-accent); color: var(--we-ink); }
.we-cat.on { background: var(--we-accent-2); border-color: var(--we-accent-2); color: #04121c; font-weight: 600; }
.we-cat:focus-visible { outline: 2px solid var(--we-accent); outline-offset: 1px; }
.we-bank {
  overflow-y: auto;
  max-height: 22rem;
  padding: 6px 8px 10px;
}
.we-cat-h {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--we-faint);
  margin: 8px 0 4px;
  border-bottom: 1px solid var(--we-hair);
  padding-bottom: 2px;
}
.we-cat-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
  gap: 4px;
}
.we-bi {
  aspect-ratio: 1;
  border: 1px solid var(--we-hair);
  border-radius: 5px;
  background: var(--we-cell);
  padding: 3px;
  cursor: grab;
  user-select: none; /* a div (not <button>) so Firefox will drag it */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .1s, transform .1s;
}
.we-bi:hover { border-color: var(--we-accent); transform: translateY(-1px); }
.we-bi:active { cursor: grabbing; }
.we-bi:focus-visible { outline: 2px solid var(--we-accent); outline-offset: 1px; }
.we-bank-empty { color: var(--we-faint); font-size: 12px; padding: 10px 2px; }

@media (prefers-reduced-motion: reduce) {
  .we-slot, .we-bi { transition: none; }
}
