:root { --acid: #d2f059; --ink: #050505; --rule: rgba(210, 240, 89, .38); }
body.build-page { background: var(--ink); color: var(--acid); overflow: hidden; padding: 0; }

.build-page .lighting-launcher {
  left: 2.5%;
  transform: none;
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--viewport-offset-bottom, 0px) + 58px + 5vh);
  align-items: flex-start;
  gap: 12px;
}

@media (max-width: 900px) {
  .build-page .lighting-launcher {
    left: 2.5%;
    transform: none;
    align-items: flex-start;
    z-index: 1;
  }

  .build-page .lighting-controls {
    z-index: 1;
  }
}

.build-page header { mix-blend-mode: normal; }
.build-page header a { color: var(--acid); }
.build-page nav a.is-active { text-decoration: underline; text-underline-offset: 5px; }

.build-mode-toggle {
  padding: 10px 18px;
  border-radius: 0;
  border: none;
  background: #D2F059;
  color: #000;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease;
  backdrop-filter: blur(6px);
}

.build-mode-toggle:hover,
.build-mode-toggle:focus-visible,
.build-mode-toggle[aria-pressed="true"] {
  background: #000;
  color: #D2F059;
  outline: none;
}

.build-shell {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.build-shell.is-active {
  opacity: 1;
  visibility: visible;
  /* Stops browser double-tap zoom without interfering with the canvas's pinch controls. */
  touch-action: manipulation;
}

.build-stage {
  position: absolute;
  inset: 0;
  cursor: crosshair;
}

.build-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.build-panel {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: min(320px, 25vw);
  padding: 88px 24px 20px;
  border-right: 1px solid var(--rule);
  background: rgba(5, 5, 5, .84);
  backdrop-filter: blur(13px);
  pointer-events: auto;
  overflow-x: hidden;
}

.build-panel--left {
  left: 0;
}

.build-panel--right {
  right: 0;
  left: auto;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--rule);
  border-right: 0;
  gap: 18px;
  overflow-y: auto;
}

.build-page footer {
  z-index: 1;
}

.build-mobile-room-toggle {
  display: none;
}

.build-room-menu {
  display: contents;
}

.build-eyebrow, .build-label, .build-hud, .build-help, .build-status, .build-button, .build-input-row input, .build-selection {
  font-size: 10px;
  letter-spacing: .12em;
  line-height: 1.35;
}

.build-eyebrow, .build-label {
  margin: 0 0 10px;
  color: rgba(210, 240, 89, .6);
}

.build-room-directory {
  display: grid;
  gap: 18px;
  width: 100%;
}

.build-share {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

.build-public-rooms {
  min-height: 0;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

.build-public-rooms__list {
  display: grid;
  margin-top: 18px;
  max-height: 112px;
  overflow-y: auto;
  border-top: 1px solid var(--rule);
}

.build-public-room,
.build-public-rooms__empty {
  width: 100%;
  padding: 9px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
  color: var(--acid);
  font: 10px Inter, sans-serif;
  letter-spacing: .1em;
  text-align: left;
}

.build-public-room {
  cursor: pointer;
}

.build-public-room:hover {
  padding-left: 8px;
  background: var(--acid);
  color: var(--ink);
}

.build-public-rooms__empty {
  margin: 0;
  color: rgba(210, 240, 89, .48);
}

.build-share__status {
  min-height: 1.35em;
  margin: 0;
  color: rgba(210, 240, 89, .65);
  font-size: 9px;
  letter-spacing: .1em;
  line-height: 1.35;
}

.build-panel h1 {
  margin: 0 0 22px;
  font-size: clamp(34px, 4vw, 60px);
  line-height: .84;
  letter-spacing: -.06em;
  font-weight: 300;
}

.build-copy {
  max-width: 210px;
  margin: 0;
  color: rgba(210, 240, 89, .85);
  font-size: 12px;
  line-height: 1.5;
}

.build-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
}

.build-status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 12px var(--acid);
}

.build-parts {
  border-top: 1px solid var(--rule);
  padding-top: 13px;
}

.build-part {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 11px 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: none;
  color: var(--acid);
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.build-part::before {
  content: '';
  width: 12px;
  height: 12px;
  margin-right: 10px;
  background: var(--part-color);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.2);
}

.build-part:hover, .build-part.is-selected {
  padding-left: 8px;
  background: var(--acid);
  color: var(--ink);
}

.build-hud {
  position: absolute;
  top: 92px;
  left: calc(min(320px, 25vw) + 20px);
  right: calc(min(320px, 25vw) + 20px);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.build-help {
  position: absolute;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(210, 240, 89, .65);
  pointer-events: none;
}

.build-button {
  padding: 10px 11px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--acid);
  cursor: pointer;
  font-family: Inter, sans-serif;
}

.build-button:hover:not(:disabled) {
  background: var(--acid);
  color: var(--ink);
}

.build-button:disabled {
  opacity: .28;
  cursor: not-allowed;
}

.build-button--primary {
  width: 100%;
  background: var(--acid);
  color: var(--ink);
}

.build-button--danger:hover:not(:disabled) {
  background: #ed4c5c;
  border-color: #ed4c5c;
}

.build-room-form {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
}

.build-input-row {
  display: flex;
}

.build-input-row input {
  min-width: 0;
  flex: 1;
  padding: 10px;
  border: 1px solid var(--rule);
  border-right: 0;
  outline: 0;
  background: transparent;
  color: var(--acid);
  font-family: Inter, sans-serif;
}

.build-input-row input::placeholder {
  color: rgba(210, 240, 89, .42);
}

.build-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  margin-top: 12px;
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.build-actions .build-button {
  flex: 0 0 auto;
}

.build-selection {
  min-height: 28px;
  margin: -17px 0 0;
  color: rgba(210, 240, 89, .6);
}

.build-reset {
  align-self: flex-start;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  background: none;
  color: rgba(210, 240, 89, .65);
  cursor: pointer;
  font: 10px Inter, sans-serif;
  letter-spacing: .1em;
}

@media (max-width: 900px) {
  .build-panel {
    width: auto;
    padding: 82px 16px 15px;
  }

  .build-panel--left,
  .build-panel--right {
    left: 0;
    right: 0;
    top: 0;
    bottom: auto;
    border: 0;
    background: linear-gradient(#050505, transparent);
  }

  .build-panel--right {
    top: auto;
    bottom: 0;
    padding-top: 0;
    background: linear-gradient(transparent, #050505 30%);
    align-items: flex-end;
    gap: 8px;
  }

  .build-copy,
  .build-share,
  .build-reset,
  .build-room-heading .build-label {
    display: none;
  }

  .build-panel--right .build-button {
    pointer-events: auto;
  }

  .build-mobile-room-toggle {
    display: block;
    width: 100%;
  }

  .build-room-menu {
    display: none;
    width: 100%;
  }

  .build-room-menu.is-open {
    display: grid;
    gap: 14px;
  }

  .build-room-heading,
  .build-room-form {
    display: block;
    width: 100%;
  }

  .build-room-heading .build-button {
    width: 100%;
  }

  .build-room-form {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .build-room-form .build-label {
    display: block;
    margin: 4px 0 8px;
  }

  .build-room-menu .build-share {
    display: grid;
    margin: 0;
    padding-top: 14px;
  }

  .build-status {
    margin: 14px 0;
  }

  .build-actions {
    display: flex;
    align-self: stretch;
    margin-top: 0;
  }

  .build-hud {
    top: 82px;
    left: 16px;
    right: 16px;
  }

  .build-help {
    bottom: calc(env(safe-area-inset-bottom, 0px) + var(--viewport-offset-bottom, 0px) + 90px);
    left: 16px;
    right: 16px;
    transform: none;
    font-size: 8px;
  }

  .build-selection {
    display: block;
    margin: 0 0 8px;
  }

  .build-parts {
    display: block;
    border-top: 0;
    padding-top: 0;
  }

  .build-parts .build-label {
    display: none;
  }

  .build-room-directory {
    display: block;
    width: 100%;
  }

  .build-public-rooms {
    display: block;
    width: 100%;
    padding-top: 0;
    border-top: 0;
  }

  .build-public-rooms .build-label {
    display: block;
    margin: 4px 0 8px;
  }

  .build-public-rooms__list {
    display: flex;
    max-height: none;
    margin-top: 0;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .build-public-rooms__list::-webkit-scrollbar {
    display: none;
  }

  .build-public-room,
  .build-public-rooms__empty {
    flex: 0 0 auto;
    width: auto;
    padding: 10px 12px;
    border-bottom: 0;
    border-right: 1px solid var(--rule);
  }

  .build-parts > div {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .build-parts > div::-webkit-scrollbar {
    display: none;
  }

  .build-part {
    flex: 0 0 auto;
    width: auto;
    padding: 10px 12px;
    border-bottom: 0;
    border-right: 1px solid var(--rule);
    font-size: 10px;
    letter-spacing: .08em;
  }

  .build-part::before {
    margin-right: 8px;
  }
}

/* Mobile floating touch controls */
.hero-model__canvas,
.hero-model__canvas canvas {
  touch-action: none;
}

.build-floating-controls {
  display: none;
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(env(safe-area-inset-bottom, 0px) + var(--viewport-offset-bottom, 0px) + 112px);
  z-index: 1005;
  pointer-events: auto;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

@media (max-width: 900px) {
  .build-floating-controls.is-visible {
    display: flex;
  }
}

.build-dpad {
  display: grid;
  grid-template-columns: repeat(3, 48px);
  grid-template-rows: repeat(3, 48px);
  gap: 4px;
}

.build-dpad__btn {
  width: 48px;
  height: 48px;
  border: 1px solid var(--rule);
  background: rgba(5, 5, 5, .84);
  color: var(--acid);
  font: inherit;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.build-dpad__btn--up { grid-column: 2; grid-row: 1; }
.build-dpad__btn--left { grid-column: 1; grid-row: 2; }
.build-dpad__btn--center { grid-column: 2; grid-row: 2; background: rgba(210, 240, 89, .08); cursor: default; }
.build-dpad__btn--right { grid-column: 3; grid-row: 2; }
.build-dpad__btn--down { grid-column: 2; grid-row: 3; }

.build-dpad__btn:disabled {
  opacity: .28;
  cursor: not-allowed;
}

.build-floating-actions {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  max-width: 100%;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
}

.build-floating-actions .build-button {
  flex: 0 0 auto;
}

.build-button--rotate {
  min-width: 48px;
  min-height: 48px;
}
