.world-builder {
  --wb-border: #ffffff15;
  --wb-gold: #d6bd85;
  color: #e5e9ed;
  max-width: 1600px;
  margin: auto;
  padding: 32px 36px 70px;
  font-family: "DM Sans", sans-serif;
}
.world-builder * {
  box-sizing: border-box;
}
.world-builder button,
.uv-chooser button {
  cursor: pointer;
  background: #19252d;
  color: #eee5cd;
  border: 1px solid #d6bd8538;
  border-radius: 7px;
  padding: 11px 17px;
  font: inherit;
}
.world-builder button:hover,
.world-builder button:focus-visible {
  background: #283a43;
  border-color: var(--wb-gold);
}
.world-builder button:disabled {
  opacity: 0.45;
  cursor: wait;
}
.world-builder small {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.7px;
  color: #a7bac3;
}
.wb-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--wb-border);
}
.wb-heading button {
  padding: 6px 10px;
  font-size: 12px;
  margin-bottom: 24px;
}
.wb-heading h1 {
  font:
    400 clamp(24px, 3vw, 40px) / 1.2 Manrope,
    sans-serif;
  margin: 12px 0 0;
  letter-spacing: -1px;
}
.wb-heading h1 em {
  color: var(--wb-gold);
  font-style: normal;
}
.wb-library {
  padding-top: 40px;
}
.wb-library > div:first-child {
  max-width: 640px;
}
.wb-library p,
.wb-hint,
.wb-preview-panel p {
  color: #9faeb8;
  font-size: 13px;
  line-height: 1.8;
}
.wb-library h2,
.wb-map-title h2 {
  font-size: 30px;
  font-weight: 500;
}
.wb-map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 20px;
  margin-top: 32px;
}
.wb-map-grid article {
  background: linear-gradient(135deg, #1a2b35, #10151d);
  padding: 28px;
  border: 1px solid var(--wb-border);
  border-radius: 14px;
}
.wb-map-grid h3 {
  font-size: 24px;
  font-weight: 500;
  margin: 18px 0;
}
.wb-empty {
  padding: 30px;
  border: 1px dashed #ffffff20;
  border-radius: 10px;
  color: #a1b0bc;
  font-size: 13px;
  line-height: 1.8;
}
.wb-map-title,
.wb-selected,
.wb-flow header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.wb-map-title {
  padding: 30px 0;
}
.wb-map-title h2 {
  margin: 8px 0;
}
.wb-map-title p {
  color: #9faeb8;
  font-size: 12px;
}
.wb-workspace {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  border: 1px solid var(--wb-border);
  border-radius: 12px;
  overflow: hidden;
  background: #0d141b;
}
.wb-workspace > aside {
  padding: 22px 16px;
  border-right: 1px solid var(--wb-border);
  background: #111a22;
}
.world-builder label,
.uv-chooser label {
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 12px;
  color: #bac8ce;
}
.world-builder input,
.world-builder select,
.uv-chooser select {
  background: #0b131b;
  border: 1px solid #ffffff22;
  color: #e6ebed;
  border-radius: 6px;
  min-width: 0;
  width: 100%;
  padding: 12px;
  font: inherit;
  color-scheme: dark;
}
.wb-workspace nav {
  display: grid;
  gap: 6px;
  margin-top: 20px;
  max-height: 70vh;
  overflow: auto;
}
.wb-workspace nav button {
  text-align: left;
  border-color: transparent;
  background: transparent;
  overflow-wrap: anywhere;
}
.wb-workspace nav button[aria-current="location"] {
  background: #263b45;
  border-color: #d6bd8560;
}
.wb-workspace nav small {
  letter-spacing: 0.3px;
  margin-top: 8px;
  font-weight: 400;
}
.wb-workspace > main {
  min-width: 0;
  padding: 24px;
}
.wb-selected h3 {
  font-size: 24px;
  margin: 8px 0 22px;
  font-weight: 500;
}
.wb-stage {
  border: 1px solid #ffffff15;
  border-radius: 8px;
  aspect-ratio: 16/9;
}
.wb-preview-tools {
  display: flex;
  gap: 8px;
  margin: 12px 0 30px;
}
.wb-preview-tools button {
  font-size: 11px;
}
.wb-flow h3 {
  font-size: 20px;
  font-weight: 500;
}
.wb-path {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px 0;
  border-top: 1px solid var(--wb-border);
  flex-wrap: wrap;
}
.wb-path > span {
  flex: 1;
  min-width: 110px;
  font-size: 13px;
  color: #e4ddca;
}
.wb-path small {
  letter-spacing: 0.4px;
  font-size: 10px;
  margin-top: 8px;
}
.wb-path > div {
  font-size: 12px;
  color: var(--wb-gold);
}
.wb-path button {
  font-size: 11px;
  padding: 8px 12px;
}
.wb-author {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(0, 1.1fr);
  gap: 48px;
  padding-top: 32px;
}
.wb-author form {
  display: grid;
  gap: 22px;
  max-width: 640px;
  align-content: start;
}
.wb-author header h2 {
  font-size: 30px;
  font-weight: 500;
  margin: 10px 0;
}
.wb-author header p {
  font-size: 13px;
  line-height: 1.7;
  color: #9faeb8;
}
.wb-author [data-new-location] {
  display: grid;
  gap: 22px;
  padding: 20px;
  border: 1px solid var(--wb-border);
  border-radius: 10px;
}
.world-builder [hidden] {
  display: none !important;
}
.wb-author-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.wb-author-actions button[type="submit"],
.wb-library > div > button,
.living-world-builder {
  background: #d6bd85 !important;
  color: #121b20 !important;
  border-color: #d6bd85 !important;
  font-weight: 600;
}
.wb-preview-panel {
  align-self: start;
  position: sticky;
  top: 20px;
}
.wb-preview-panel > small {
  margin-bottom: 16px;
}
.wb-preview-panel .uv-stage {
  aspect-ratio: 16/9;
}
.wb-author [data-feedback] {
  font-size: 13px;
  color: #d6bd85;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.uv-chooser {
  display: flex;
  gap: 16px;
  align-items: end;
  padding: 10px 0 30px;
  flex-wrap: wrap;
}
.uv-chooser label {
  flex: 1;
  min-width: 160px;
}
.world-builder .uv-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.world-builder :focus-visible {
  outline: 2px solid #d6bd85;
  outline-offset: 3px;
}
@media (max-width: 850px) {
  .world-builder {
    padding: 22px 16px 50px;
  }
  .wb-author {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .wb-preview-panel {
    position: static;
    grid-row: 1;
  }
  .wb-workspace {
    grid-template-columns: 180px minmax(0, 1fr);
  }
  .wb-workspace > main {
    padding: 16px;
  }
  .wb-heading {
    align-items: start;
  }
  .wb-heading > button {
    white-space: nowrap;
  }
  .wb-flow header {
    align-items: start;
    flex-wrap: wrap;
  }
}
@media (max-width: 600px) {
  .wb-workspace {
    grid-template-columns: 1fr;
  }
  .wb-workspace > aside {
    border-right: 0;
    border-bottom: 1px solid var(--wb-border);
  }
  .wb-workspace nav {
    max-height: 180px;
  }
  .wb-heading {
    display: block;
  }
  .wb-heading > button {
    margin: 20px 0 0;
  }
  .wb-map-title,
  .wb-selected {
    align-items: start;
    flex-wrap: wrap;
  }
  .wb-path {
    gap: 12px;
  }
  .wb-author-actions button {
    width: 100%;
  }
  .wb-preview-tools {
    flex-wrap: wrap;
  }
}

.wb-map-actions,
.wb-destination-tools {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.wb-destination-tools small {
  flex: 1;
  line-height: 1.7;
}
.wb-destination-tools button {
  font-size: 12px;
}

.world-builder input[type="checkbox"] {
  width: auto;
  align-self: start;
  accent-color: #d6bd85;
}
.world-builder [data-wb="delete-location"] {
  color: #e7aaa3;
  border-color: #b7645d66;
}

/* Character identity remains separate from location and map settings. */
.world-builder .character-prompt-editor {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 32px;
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid #d6bd8538;
  border-radius: 16px;
  background: linear-gradient(125deg, #253039, #141d24 65%);
  box-shadow: 0 16px 44px #0003;
}
.world-builder .character-prompt-editor header,
.world-builder .character-prompt-editor label,
.world-builder .character-prompt-editor > p,
.world-builder .character-prompt-editor output { grid-column: 1 / -1; }
.world-builder .character-prompt-editor header small { color: var(--wb-gold); letter-spacing: .15em; }
.world-builder .character-prompt-editor h2 { margin: 8px 0; font-size: clamp(24px, 3vw, 36px); }
.world-builder .character-prompt-editor p { color: #b3bec6; margin: 0 0 8px; line-height: 1.6; }
.world-builder .character-prompt-editor label { display: grid; gap: 10px; font-size: 12px; letter-spacing: .08em; }
.world-builder .character-prompt-editor textarea { min-height: 180px; line-height: 1.7; letter-spacing: normal; border-radius: 10px; }
.world-builder .character-prompt-editor output { min-height: 1.5em; color: var(--wb-gold); }
.world-builder .character-prompt-editor :focus-visible { outline: 2px solid var(--wb-gold); outline-offset: 3px; }
@media (max-width: 600px) {
  .world-builder .character-prompt-editor { grid-template-columns: 1fr; }
}
.wb-production{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.wb-production span{padding:7px 10px;border:1px solid #8fc4d344;border-radius:8px;background:#28435444;color:#cbe5eb;font-size:12px;font-variant-numeric:tabular-nums}

/* Ticket 134: geographic grounding and a short, keyboard-friendly journey. */
.wb-area-image { display:block; width:100%; max-height:260px; object-fit:contain; border-radius:16px; background:#101822; margin:12px 0; }
.wb-growth { color:#bed9c7; padding:8px 0; }
.wb-author fieldset { border:1px solid #ffffff26; border-radius:12px; padding:20px; min-width:0; }
.wb-author fieldset[hidden] { display:none; }
.wb-author legend { padding:0 8px; font-weight:600; }
.wb-steps { font-size:13px; line-height:1.8; color:#bed9c7; }
@media (max-width:700px) { .wb-author fieldset { padding:12px; } .wb-author-actions { flex-wrap:wrap; } .wb-area-image { max-height:180px; } }
