/* Surface docs + vandalism layers (percent positions scale with window)
 *
 * Stack in .center-col:
 *   0  .room-bg-layer   (JPEG plate)
 *   2  .rz-vandalism-layer  (paint ABOVE background, BELOW avatars)
 *   5  #scene           (avatars / wall pins / speech)
 */

.rz-vandalism-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.rz-vandalism-layer .rz-vandalism-piece {
  position: absolute;
  inset: 8% 10%;
  width: 80%;
  height: 70%;
  pointer-events: auto;
  opacity: 0.92;
  mix-blend-mode: normal;
}

/* Feature off: keep chrome out of the room until VANDALISM_ENABLED=1 */
.rz-vandalism-plaque[hidden],
.rz-vandalism-layer[hidden],
.rz-vandalism-tip[hidden] {
  display: none !important;
}

.rz-vandalism-plaque {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  z-index: 55; /* above vandalism paint + avatars strip chrome */
  max-width: min(520px, 90%);
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(8, 12, 11, 0.55);
  border: 1px solid rgba(200, 150, 42, 0.35);
  color: rgba(230, 220, 200, 0.9);
  font-size: 0.68rem;
  text-align: center;
  pointer-events: none;
}

.rz-vandalism-tip {
  position: fixed;
  z-index: 9000;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(10, 14, 12, 0.95);
  border: 1px solid rgba(200, 150, 42, 0.45);
  color: #e8d9ba;
  font-size: 0.72rem;
  pointer-events: none;
  max-width: 260px;
}

.rz-surface-docs-layer {
  position: absolute;
  inset: 0;
  z-index: 84;
  pointer-events: none;
}

.rz-surf-doc {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  background: transparent;
  border: none;
  padding: 0;
  cursor: grab;
  color: #e8d9ba;
  text-align: center;
  min-width: 72px;
}

.rz-surf-doc:active,
.rz-surf-doc.is-dragging {
  cursor: grabbing;
}

.rz-surf-doc.is-focus .rz-surf-card {
  box-shadow:
    0 0 0 2px rgba(200, 150, 42, 0.85),
    0 8px 28px rgba(0, 0, 0, 0.55);
}

.rz-surf-card {
  display: block;
  width: 100%;
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(12, 16, 14, 0.92), rgba(6, 10, 9, 0.94));
  border: 1px solid rgba(200, 150, 42, 0.4);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  padding: 6px 6px 8px;
  box-sizing: border-box;
}

.rz-surf-preview {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 5px;
  overflow: hidden;
  background: #0a0e0c;
  border: 1px solid rgba(200, 150, 42, 0.28);
  margin-bottom: 6px;
  position: relative;
}

.rz-surf-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rz-surf-preview-paper {
  display: block;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, transparent 70%, rgba(0, 0, 0, 0.12) 70%),
    linear-gradient(#f2e8d0, #e0d2b4);
}

.rz-surf-preview-empty {
  display: block;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--fold, #c8962a) 70%, #222), var(--fold, #c8962a));
}

/* Legacy icon classes kept for any old markup */
.rz-surf-paper {
  display: block;
  width: 48px;
  height: 58px;
  margin: 0 auto 4px;
  border-radius: 4px 8px 4px 4px;
  background:
    linear-gradient(135deg, transparent 60%, rgba(0, 0, 0, 0.15) 60%),
    linear-gradient(#f2e8d0, #e0d2b4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(200, 150, 42, 0.35);
}

.rz-surf-folder {
  display: block;
  width: 56px;
  height: 44px;
  margin: 0 auto 4px;
  position: relative;
  border-radius: 4px;
  background: var(--fold, #c8962a);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.rz-surf-folder::before {
  content: "";
  position: absolute;
  left: 4px;
  top: -8px;
  width: 40%;
  height: 10px;
  border-radius: 3px 3px 0 0;
  background: color-mix(in srgb, var(--fold, #c8962a) 80%, #000);
}

.rz-surf-thumb {
  position: absolute;
  inset: 6px 6px 4px;
  width: calc(100% - 12px);
  height: calc(100% - 10px);
  object-fit: cover;
  border-radius: 3px;
}

.rz-surf-fold-face {
  display: block;
  height: 100%;
}

.rz-surf-label {
  display: block;
  font-size: 0.62rem;
  max-width: 100%;
  margin: 0 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 6px #000;
  color: #e8d9ba;
}

/* Place ghost (wall-sign style) */
.surf-drop-ghost {
  position: fixed;
  z-index: 9800;
  pointer-events: none;
  width: 120px;
}
.surf-drop-ghost-card {
  background: rgba(10, 14, 12, 0.94);
  border: 1px solid rgba(200, 150, 42, 0.55);
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  color: #e8d9ba;
  font-size: 0.62rem;
  text-align: center;
}
.surf-drop-ghost-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  display: block;
  margin-bottom: 4px;
}
.surf-drop-ghost-card .rz-surf-preview-paper {
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  margin-bottom: 4px;
}
.center-col.surf-dropping #scene {
  cursor: crosshair;
}

/* Workshop Documents holder prop + flyout */
.wd-prop {
  position: absolute;
  left: 14px;
  bottom: calc(var(--rz-chat-pane-pct, 38%) + 16px);
  /* Above chat pane; user can still drag chat edge independently */
  z-index: 86;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 56px;
  padding: 8px 6px;
  border: 1px solid rgba(200, 150, 42, 0.4);
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(14, 18, 16, 0.92), rgba(6, 10, 9, 0.94));
  color: #e8d9ba;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.wd-prop[hidden] { display: none !important; }
.wd-prop:hover {
  border-color: rgba(200, 150, 42, 0.75);
  color: #fff;
}
.wd-prop-icon {
  display: block;
  width: 36px;
  height: 32px;
  position: relative;
}
.wd-prop-stack {
  position: absolute;
  left: 4px;
  right: 4px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(200, 150, 42, 0.45);
  background: linear-gradient(#efe4c8, #d8c9a4);
}
.wd-prop-stack:nth-child(1) { top: 2px; transform: rotate(-4deg); }
.wd-prop-stack:nth-child(2) { top: 10px; }
.wd-prop-stack:nth-child(3) { top: 18px; transform: rotate(3deg); background: linear-gradient(#f6eed8, #e4d6b0); }
.wd-prop-label {
  font: 700 0.58rem/1 Cinzel, Georgia, serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-soft, #e8b84a);
}

.wd-flyout {
  position: absolute;
  top: 56px;
  left: 12px;
  width: min(340px, 42vw);
  max-height: min(70vh, 560px);
  z-index: 97;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(200, 150, 42, 0.42);
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(8, 12, 11, 0.97), rgba(4, 8, 7, 0.98));
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.wd-flyout[hidden] { display: none !important; }
.wd-flyout.is-dropping { opacity: 0.72; }
.wd-flyout-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid rgba(200, 150, 42, 0.25);
}
.wd-flyout-head strong {
  display: block;
  font-family: Cinzel, Georgia, serif;
  color: #e8b84a;
  font-size: 0.95rem;
}
.wd-flyout-head span {
  display: block;
  font-size: 0.62rem;
  color: #8a9088;
  margin-top: 2px;
}
.wd-flyout-head button {
  border: 0;
  background: transparent;
  color: #c9cfcb;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}
.wd-flyout-body {
  padding: 10px 12px 14px;
  overflow: auto;
  min-height: 0;
}
.wd-lead {
  font-size: 0.68rem;
  color: #9ea39f;
  line-height: 1.4;
  margin: 0 0 10px;
}
.wd-form label {
  display: block;
  font-size: 0.62rem;
  color: #b8b4a8;
  margin: 8px 0 3px;
}
.wd-form input,
.wd-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 8px;
  border-radius: 6px;
  border: 1px solid rgba(200, 150, 42, 0.3);
  background: rgba(3, 6, 5, 0.9);
  color: #f6f4ec;
  font: inherit;
  font-size: 0.8rem;
}
.wd-form textarea { min-height: 56px; resize: vertical; }
.wd-form-actions { margin-top: 10px; }
.wd-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid rgba(200, 150, 42, 0.4);
  background: rgba(8, 12, 11, 0.8);
  color: #e8d9ba;
  font: 700 0.72rem/1 Cinzel, Georgia, serif;
  letter-spacing: 0.06em;
  cursor: pointer;
}
.wd-btn.primary {
  background: linear-gradient(180deg, rgba(200, 150, 42, 0.35), rgba(120, 90, 20, 0.45));
  color: #fff;
}
.wd-msg { font-size: 0.68rem; min-height: 1em; margin-top: 6px; }
.wd-msg.err { color: #e07070; }
.wd-msg.ok { color: #6ecf8a; }
.wd-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.wd-empty { font-size: 0.68rem; color: #7f8984; }
.wd-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.wd-row-main {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(200, 150, 42, 0.25);
  border-radius: 7px;
  background: rgba(8, 12, 11, 0.55);
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.wd-row-main:hover {
  border-color: rgba(200, 150, 42, 0.55);
  background: rgba(200, 150, 42, 0.08);
}
.wd-row-thumb {
  width: 44px;
  height: 34px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(200, 150, 42, 0.3);
  background: #111;
}
.wd-row-thumb--empty {
  display: block;
  background: linear-gradient(#efe4c8, #d8c9a4);
}
.wd-row-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.wd-row-text b {
  font-size: 0.78rem;
  color: #f0e6d0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wd-row-text small {
  font-size: 0.58rem;
  color: #7f8984;
}
.wd-place-btn {
  flex: 0 0 auto;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(41, 196, 192, 0.4);
  background: rgba(41, 196, 192, 0.1);
  color: #9ee8e4;
  font: 700 0.62rem/1 ui-monospace, Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.wd-place-btn:hover {
  background: rgba(41, 196, 192, 0.22);
  color: #fff;
}

.rz-surf-reader-thumb {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 12px;
  background: #050807;
}

.rz-surf-edit-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 5;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(200, 150, 42, 0.85);
  background: rgba(0, 0, 0, 0.35);
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(200, 150, 42, 0.3);
  pointer-events: none;
}

.rz-surf-reader {
  position: fixed;
  inset: 12vh 12vw;
  z-index: 8500;
  background: rgba(10, 14, 12, 0.96);
  border: 1px solid rgba(200, 150, 42, 0.4);
  border-radius: 12px;
  padding: 16px;
  color: #e8d9ba;
  overflow: auto;
}

.rz-surf-reader header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.rz-surf-reader .rz-surf-close {
  background: transparent;
  border: 1px solid rgba(200, 150, 42, 0.4);
  color: #e8d9ba;
  border-radius: 6px;
  cursor: pointer;
}

.rz-surf-meta {
  font-size: 0.7rem;
  color: #8a8494;
}

#scene {
  position: relative;
}
