/* World Studio — owner content creator chrome (Phase 0–1) */
.ws-enter-fab {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 40;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 200, 80, 0.55);
  background: rgba(20, 16, 10, 0.88);
  color: #f0d78c;
  font: 600 12px/1.2 system-ui, sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}
.ws-enter-fab:hover {
  background: rgba(40, 30, 12, 0.95);
}
.ws-enter-fab.is-hidden {
  display: none;
}

.ws-chrome {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  pointer-events: none;
}
.ws-chrome-bar {
  pointer-events: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 6px 10px;
  background: linear-gradient(180deg, rgba(18, 16, 22, 0.96), rgba(12, 10, 16, 0.92));
  border-bottom: 1px solid rgba(240, 215, 140, 0.22);
  color: #e8e0d0;
  font: 13px/1.3 system-ui, sans-serif;
}
.ws-brand {
  font-weight: 700;
  color: #f0d78c;
  margin-right: 4px;
}
.ws-menus {
  display: flex;
  gap: 2px;
}
.ws-menu {
  position: relative;
}
.ws-menu-btn {
  background: transparent;
  border: 0;
  color: #ddd4c4;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}
.ws-menu-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}
.ws-menu-dd {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: #1a1620;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 5;
}
.ws-menu-dd.is-open {
  display: flex;
  flex-direction: column;
}
.ws-menu-dd button {
  text-align: left;
  background: transparent;
  border: 0;
  color: #e8e0d0;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font: inherit;
}
.ws-menu-dd button:hover {
  background: rgba(240, 215, 140, 0.12);
}
.ws-menu-dd hr {
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 4px 0;
}
.ws-doc-title {
  flex: 1;
  min-width: 120px;
  opacity: 0.9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-workspaces {
  display: flex;
  gap: 2px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
  padding: 2px;
}
.ws-workspaces button {
  border: 0;
  background: transparent;
  color: #b8b0a0;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font: 600 12px system-ui, sans-serif;
}
.ws-workspaces button.is-on {
  background: rgba(240, 215, 140, 0.18);
  color: #f0d78c;
}
.ws-actions {
  display: flex;
  gap: 6px;
}
.ws-btn {
  border: 1px solid rgba(240, 215, 140, 0.45);
  background: rgba(240, 215, 140, 0.15);
  color: #f0d78c;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font: 600 12px system-ui, sans-serif;
}
.ws-btn:hover {
  background: rgba(240, 215, 140, 0.28);
}
.ws-btn-ghost {
  border-color: rgba(255, 255, 255, 0.15);
  background: transparent;
  color: #ccc4b4;
}
.ws-hint {
  pointer-events: none;
  padding: 4px 12px 6px;
  font: 11px/1.3 system-ui, sans-serif;
  color: rgba(232, 224, 208, 0.65);
  background: rgba(12, 10, 16, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.ws-studio-on .ws-enter-fab {
  display: none;
}
body.ws-studio-on #ws-chrome,
body.ws-playtest-on #ws-chrome {
  display: block;
}

/* Modal */
.ws-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 8vh 16px 16px;
  pointer-events: auto;
}
.ws-modal-card {
  width: min(520px, 100%);
  max-height: 80vh;
  overflow: auto;
  background: #1c1824;
  border: 1px solid rgba(240, 215, 140, 0.25);
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  color: #e8e0d0;
  padding: 14px 16px 12px;
  font: 13px/1.35 system-ui, sans-serif;
}
.ws-modal-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ws-modal-card h2 {
  margin: 0;
  font-size: 1.15rem;
  color: #f0d78c;
}
.ws-modal-x {
  border: 0;
  background: transparent;
  color: #aaa;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}
.ws-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #b8b0a0;
}
.ws-field input,
.ws-field select {
  background: #121018;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #f0ebe0;
  padding: 7px 9px;
  font: inherit;
}
.ws-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}
.ws-row .ws-field {
  flex: 1;
  min-width: 90px;
}
.ws-tpl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.ws-tpl {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  background: rgba(0, 0, 0, 0.2);
}
.ws-tpl input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ws-tpl strong {
  color: #f0ebe0;
  font-size: 13px;
}
.ws-tpl span {
  font-size: 11px;
  color: #958c7c;
}
.ws-tpl.is-on {
  border-color: rgba(240, 215, 140, 0.55);
  background: rgba(240, 215, 140, 0.1);
}
.ws-size-presets {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}
.ws-size-p {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #121018;
  color: #ccc;
  border-radius: 4px;
  padding: 6px 10px;
  cursor: pointer;
  font: 600 12px system-ui, sans-serif;
}
.ws-size-p:hover {
  border-color: rgba(240, 215, 140, 0.4);
}
.ws-modal-card footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.ws-open-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 50vh;
  overflow: auto;
}
.ws-open-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  width: 100%;
  border: 1px solid transparent;
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}
.ws-open-row:hover {
  border-color: rgba(240, 215, 140, 0.35);
  background: rgba(240, 215, 140, 0.08);
}
.ws-open-row span {
  font-size: 11px;
  color: #958c7c;
}
.ws-empty {
  opacity: 0.6;
  padding: 12px;
}

.ws-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  z-index: 1400;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(20, 18, 28, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e8e0d0;
  font: 13px system-ui, sans-serif;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.ws-toast.is-on {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.ws-toast.is-err {
  border-color: rgba(255, 100, 100, 0.5);
  color: #ffc8c8;
}
.ws-toast.is-ok {
  border-color: rgba(140, 220, 140, 0.4);
}

/* Nudge map under chrome when studio open */
body.ws-studio-on .forge-world-stage,
body.ws-playtest-on .forge-world-stage {
  padding-top: 0;
}
