html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000;
  cursor: none;
  overscroll-behavior: none;
  touch-action: none;
}

* {
  box-sizing: border-box;
}

.wall {
  position: fixed;
  inset: 0;
  display: grid;
  gap: 0;
  background: #000;
}

.wall.layout-columns {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
}

.wall.layout-rows {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: repeat(4, minmax(0, 1fr));
}

.wall.layout-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.wall.single {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.cell {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  background: #000;
}

.cell > .led-stage {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  will-change: transform;
}

/* Debug / status overlay — only visible with ?debug=1 or Shift+D. */
.debug {
  position: fixed;
  z-index: 50;
  left: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(5, 8, 13, 0.86);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.78);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  cursor: auto;
  backdrop-filter: blur(6px);
}

.debug[hidden] {
  display: none;
}

.dbg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #54e08a;
  box-shadow: 0 0 10px rgba(84, 224, 138, 0.7);
}

.dbg-dot.offline {
  background: #ffb347;
  box-shadow: 0 0 10px rgba(255, 179, 71, 0.65);
}

.dbg-sep {
  width: 1px;
  height: 14px;
  background: rgba(255, 255, 255, 0.14);
}

.dbg-btn {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
  font: inherit;
  cursor: pointer;
}

.dbg-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .cell > .led-stage {
    will-change: auto;
  }
}