.wallfacer-dev-page {
  color-scheme: dark;
}

.wallfacer-dev-screen {
  cursor: default;
}

.wallfacer-dev-screen.is-panning {
  cursor: grabbing;
}

#wallfacer-dev-stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 1px;
  transform-style: preserve-3d;
  transform: translate(-50%, -50%) translate(var(--stage-offset-x, 0px), var(--stage-offset-y, 0px));
}

.wallfacer-dev-tile {
  position: absolute;
  transform: translate(-50%, -50%) translate(var(--tile-x, 0px), var(--tile-y, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  text-align: center;
  touch-action: none;
  user-select: none;
}

.wallfacer-dev-tile img {
  border-radius: 10px;
  border: 1px solid rgba(20, 120, 140, 0.4);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55),
    0 0 14px rgba(0, 200, 255, 0.15);
  background: rgba(4, 10, 15, 0.75);
  max-width: clamp(160px, 30vw, 220px);
  max-height: clamp(160px, 30vh, 220px);
}

.wallfacer-dev-tile.is-dragging {
  z-index: 3;
  filter: brightness(1.1);
}

.wallfacer-dev-tile.is-selected img,
.wallfacer-dev-tile.is-selected .wallfacer-dev-text-block {
  border-color: rgba(100, 255, 210, 0.9);
  box-shadow: 0 0 0 2px rgba(100, 255, 210, 0.5),
    0 14px 30px rgba(0, 0, 0, 0.6);
}

.wallfacer-dev-tile.is-selected .wallfacer-dev-caption {
  color: rgba(140, 255, 220, 0.95);
}

.wallfacer-dev-caption {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(180, 255, 255, 0.8);
}

.wallfacer-dev-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(0, 200, 255, 0.25);
  color: rgba(190, 255, 255, 0.9);
}

.wallfacer-dev-text-block {
  max-width: clamp(160px, 30vw, 240px);
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 200, 255, 0.35);
  background: rgba(6, 14, 20, 0.9);
  color: rgba(210, 255, 255, 0.92);
  font-size: 0.8rem;
  line-height: 1.35;
  text-align: center;
}

#wallfacer-dev-hud {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-width: 320px;
}

#wallfacer-dev-hud h1 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #b7f7ff;
  text-shadow: 0 0 10px rgba(0, 200, 255, 0.3);
}

#wallfacer-dev-hud p {
  margin: 0;
  font-size: 0.85rem;
  color: rgba(180, 230, 240, 0.8);
}

.wallfacer-dev-controls {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: rgba(5, 12, 18, 0.7);
  border: 1px solid rgba(0, 200, 255, 0.2);
  padding: 0.65rem 0.8rem;
  border-radius: 10px;
}

.wallfacer-dev-control {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: rgba(180, 230, 240, 0.9);
}

.wallfacer-dev-control input[type="range"] {
  width: 100%;
}

.wallfacer-dev-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.wallfacer-dev-buttons button,
.wallfacer-dev-output-actions button {
  background: rgba(12, 30, 38, 0.8);
  color: rgba(190, 255, 255, 0.9);
  border: 1px solid rgba(0, 200, 255, 0.4);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.wallfacer-dev-buttons button:hover,
.wallfacer-dev-output-actions button:hover {
  background: rgba(20, 50, 60, 0.95);
}

#wallfacer-dev-message {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  background: rgba(5, 12, 18, 0.7);
  border: 1px solid rgba(0, 200, 255, 0.2);
  padding: 0.75rem 1.2rem;
  border-radius: 8px;
  font-size: 0.85rem;
  text-align: center;
  max-width: 90vw;
}

.wallfacer-dev-output-panel {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 6;
  width: min(360px, 90vw);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: rgba(5, 12, 18, 0.75);
  border: 1px solid rgba(0, 200, 255, 0.2);
  border-radius: 12px;
  padding: 0.7rem 0.8rem 0.9rem;
}

.wallfacer-dev-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.wallfacer-dev-output-panel h2 {
  margin: 0;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(190, 255, 255, 0.9);
}

.wallfacer-dev-output-actions {
  display: flex;
  gap: 0.4rem;
}

#wallfacer-dev-output {
  width: 100%;
  resize: vertical;
  min-height: 160px;
  border-radius: 8px;
  border: 1px solid rgba(0, 200, 255, 0.3);
  background: rgba(4, 12, 18, 0.85);
  color: rgba(220, 255, 255, 0.92);
  font-family: "Courier New", monospace;
  font-size: 0.72rem;
  padding: 0.55rem 0.6rem;
}

@media (max-width: 900px) {
  .wallfacer-dev-output-panel {
    position: static;
    width: min(420px, 92vw);
    margin: 0 auto 18px;
  }

  #wallfacer-dev-hud {
    position: static;
    margin: 18px auto 0;
  }

  .wallfacer-dev-screen {
    flex-direction: column;
    justify-content: flex-start;
    gap: 1rem;
    overflow-y: auto;
    padding-bottom: 40px;
  }
}
