/* Workshop Jewelry Box — Rue-access Building notes */

/* Brand + jewelry — jewelry hangs on the topbar gold line on purpose (charm on the rail) */
.wj-brand-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 9;
  min-width: 0;
  overflow: visible;
}

/* Top bar charm: sits on the border line, label is title-only (no text under the rule) */
.wj-prop {
  position: relative;
  left: auto;
  bottom: auto;
  z-index: 9;
  width: 56px;
  height: 48px;
  margin: 0 2px -10px 6px;
  flex-shrink: 0;
  align-self: flex-end;
  cursor: pointer;
  user-select: none;
  pointer-events: auto;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45));
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}
.wj-prop[hidden] { display: none !important; }
.wj-prop:focus-visible {
  outline: 2px solid #C8962A;
  outline-offset: 4px;
}

.wj-stool {
  position: absolute;
  left: 50%;
  bottom: 2px;
  transform: translateX(-50%);
  width: 48px;
  height: 12px;
  background: linear-gradient(180deg, #5a3d22 0%, #3a2514 100%);
  border-radius: 6px 6px 3px 3px;
  border: 1px solid rgba(200, 150, 42, 0.35);
}
.wj-stool::before,
.wj-stool::after {
  content: '';
  position: absolute;
  top: 11px;
  width: 4px;
  height: 8px;
  background: #2a1a0e;
  border-radius: 2px;
}
.wj-stool::before { left: 8px; }
.wj-stool::after { right: 8px; }

.wj-box {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: 40px;
  height: 30px;
  perspective: 90px;
  background: linear-gradient(160deg, #2a1840 0%, #1a0f28 55%, #3d2458 100%);
  border: 1.5px solid #C8962A;
  border-radius: 5px 5px 3px 3px;
  box-shadow: inset 0 0 10px rgba(233, 194, 90, 0.15);
  overflow: visible;
}
.wj-box-lid {
  position: absolute;
  top: -5px;
  left: 3px;
  right: 3px;
  height: 8px;
  background: linear-gradient(180deg, #4a2d6e, #2a1840);
  border: 1px solid rgba(200, 150, 42, 0.55);
  border-radius: 3px 3px 0 0;
}

/* Fairy: yaw spin in 3D (not flat 2D cartwheel) */
.wj-fairy {
  position: absolute;
  left: 50%;
  top: 3px;
  width: 16px;
  height: 24px;
  margin-left: -8px;
  transform-origin: 50% 70%;
  transform-style: preserve-3d;
  animation: wj-spin3d 4.8s linear infinite;
}
.wj-fairy-body {
  position: absolute;
  left: 4px;
  top: 7px;
  width: 8px;
  height: 12px;
  background: linear-gradient(180deg, #f3d6e8, #c89bc0);
  border-radius: 4px 4px 2px 2px;
  backface-visibility: visible;
}
.wj-fairy-head {
  position: absolute;
  left: 3px;
  top: 1px;
  width: 10px;
  height: 10px;
  background: #f6e6d8;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(255, 220, 240, 0.7);
}
.wj-fairy-skirt {
  position: absolute;
  left: 0;
  top: 14px;
  width: 16px;
  height: 9px;
  background: radial-gradient(ellipse at top, #e8b4d4, #9a5a8a);
  border-radius: 0 0 50% 50%;
}
.wj-fairy-wing {
  position: absolute;
  top: 8px;
  width: 9px;
  height: 7px;
  background: rgba(233, 220, 255, 0.55);
  border-radius: 50% 50% 40% 40%;
  transform-origin: center center;
}
.wj-fairy-wing.left {
  left: -4px;
  transform: rotate(-18deg);
  animation: wj-wing-l 0.55s ease-in-out infinite alternate;
}
.wj-fairy-wing.right {
  right: -4px;
  transform: rotate(18deg);
  animation: wj-wing-r 0.55s ease-in-out infinite alternate;
}

@keyframes wj-spin3d {
  from { transform: rotateY(0deg); }
  to { transform: rotateY(360deg); }
}
@keyframes wj-wing-l {
  from { transform: rotate(-18deg) scaleX(1); }
  to { transform: rotate(-28deg) scaleX(0.85); }
}
@keyframes wj-wing-r {
  from { transform: rotate(18deg) scaleX(1); }
  to { transform: rotate(28deg) scaleX(0.85); }
}

@media (prefers-reduced-motion: reduce) {
  .wj-fairy {
    animation: none;
    transform: none;
  }
  .wj-fairy-wing.left,
  .wj-fairy-wing.right {
    animation: none;
  }
}

.wj-prop-label {
  /* Label lives in title/aria only — hanging text under the gold rule looked broken */
  display: none !important;
}

/* Flyout */
.wj-flyout {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 96; /* above chat-under (80), with wall flyout */
  width: min(360px, 92%);
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  background: rgba(8, 12, 11, 0.94);
  border: 1px solid rgba(200, 150, 42, 0.42);
  border-radius: 12px;
  color: #e8d9ba;
  font-size: 0.78rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.wj-flyout[hidden] { display: none !important; }

.wj-flyout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(200, 150, 42, 0.28);
  font-family: Cinzel, Georgia, serif;
  font-size: 0.85rem;
  color: #C8962A;
}
.wj-flyout-head button {
  border: 1px solid rgba(200, 150, 42, 0.4);
  background: rgba(20, 16, 10, 0.8);
  color: #e8d9ba;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.wj-flyout-body {
  overflow: auto;
  padding: 10px 12px 14px;
  flex: 1;
}

.wj-lead {
  margin: 0 0 10px;
  color: #9EA39F;
  font-size: 0.72rem;
  line-height: 1.4;
}

.wj-form label {
  display: block;
  font-size: 0.65rem;
  color: #C8962A;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 8px 0 4px;
}
.wj-form input,
.wj-form textarea {
  width: 100%;
  box-sizing: border-box;
  border-radius: 8px;
  border: 1px solid rgba(200, 150, 42, 0.3);
  background: rgba(3, 6, 5, 0.75);
  color: #F6F4EC;
  padding: 8px 10px;
  font: inherit;
}
.wj-form textarea {
  min-height: 72px;
  resize: vertical;
}
.wj-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.wj-btn {
  border: 1px solid rgba(200, 150, 42, 0.45);
  background: rgba(28, 24, 14, 0.9);
  color: #C8962A;
  border-radius: 8px;
  padding: 7px 12px;
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
}
.wj-btn.primary {
  background: linear-gradient(180deg, #3a2e14, #1a1408);
  color: #fff;
  border-color: #C8962A;
}
.wj-btn.danger {
  color: #e07070;
  border-color: rgba(224, 112, 112, 0.45);
}

.wj-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wj-slip {
  border: 1px solid rgba(200, 150, 42, 0.28);
  background: rgba(12, 14, 13, 0.85);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
}
.wj-slip:hover {
  border-color: rgba(200, 150, 42, 0.55);
  background: rgba(20, 18, 12, 0.95);
}
.wj-slip-title {
  margin: 0 0 4px;
  font-weight: 700;
  color: #F6F4EC;
  font-size: 0.82rem;
}
.wj-slip-meta {
  margin: 0;
  font-size: 0.65rem;
  color: #9EA39F;
}
.wj-slip-preview {
  margin: 6px 0 0;
  font-size: 0.72rem;
  color: #c8c2b4;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.wj-empty {
  margin: 12px 0 0;
  color: #9EA39F;
  font-size: 0.72rem;
  font-style: italic;
}

.wj-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.wj-msg {
  margin-top: 8px;
  font-size: 0.72rem;
}
.wj-msg.err { color: #e07070; }
.wj-msg.ok { color: #5dcea0; }

body.wj-on .wj-prop { display: block; }
