:root {
  color-scheme: dark;
  --bg: #000;
  --box-color: #111111;
  --camera-led-height: 59px;
  --camera-width: 100%;
  --grid-color: #323232;
  --led-height: 59px;
  --mobile-led-height: 44px;
  --mobile-stack-gap: 16px;
  --shell-pad-x: 4px;
  --shell-pad-y: 4px;
  --sign-scale: 0.5;
  --text-color: #ff0000;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
}

body {
  position: relative;
  overflow: hidden;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
}

.center-stage {
  position: relative;
  display: grid;
  gap: 0;
  align-content: center;
  place-items: center;
  contain: layout paint;
  width: 100vw;
  min-height: 100vh;
  padding: clamp(28px, 3.9vw, 48px) clamp(15px, 1.5vw, 30px);
  background: #000;
}

.marquee-shell {
  width: min(calc(1970px * var(--sign-scale)), 100%);
  border: 0;
  border-radius: 9px;
  contain: layout paint;
  padding: var(--shell-pad-y) var(--shell-pad-x);
  background: var(--box-color);
  box-shadow: 0 34px 80px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.mobile-marquee-stack {
  display: none;
  contain: layout paint;
  order: 2;
}

.camera-marquee-shell[hidden] {
  display: none;
}

.camera-marquee-shell {
  order: 1;
  justify-self: center;
  width: min(calc(1970px * var(--sign-scale)), var(--camera-width));
  max-width: 100%;
  margin-block-end: var(--mobile-stack-gap);
}

.desktop-marquee-shell {
  order: 2;
}

.center-stage.camera-below .camera-marquee-shell {
  order: 3;
  margin-block-start: var(--mobile-stack-gap);
  margin-block-end: 0;
}

.camera-led-canvas {
  contain: strict;
  display: block;
  width: 100%;
  height: var(--camera-led-height);
}

led-row {
  contain: strict;
  display: block;
  width: 100%;
  height: var(--led-height);
}

led-row canvas {
  contain: strict;
  display: block;
  width: 100%;
  height: 100%;
}

.leva-panel {
  position: fixed;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 7px;
  width: 232px;
  border: 1px solid #262626;
  border-radius: 9px;
  padding: 10px;
  background: rgba(18, 18, 18, 0.92);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.42);
  color: #e8e8e8;
  font: 11px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.camera-panel {
  width: 126px;
  padding: 9px 10px;
}

.leva-title {
  color: #f1f1f1;
  font-weight: 700;
}

.leva-row,
.leva-switch-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 26px;
  color: #a9a9a9;
}

.leva-slider-row {
  display: grid;
  gap: 6px;
  min-height: 34px;
  color: #a9a9a9;
}

.leva-slider-row span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.leva-slider-row output {
  color: #e2e2e2;
  font-variant-numeric: tabular-nums;
}

.leva-row input[type="color"] {
  width: 48px;
  height: 22px;
  border: 1px solid #343434;
  border-radius: 5px;
  padding: 0;
  background: #1d1d1d;
  cursor: pointer;
}

.leva-slider-row input[type="range"] {
  width: 100%;
  height: 16px;
  margin: 0;
  accent-color: var(--text-color);
  cursor: pointer;
}

.leva-switch-row input {
  appearance: none;
  width: 34px;
  height: 18px;
  border: 1px solid #3a3a3a;
  border-radius: 99px;
  background: #252525;
  cursor: pointer;
}

.leva-switch-row input::before {
  display: block;
  width: 14px;
  height: 14px;
  margin: 1px;
  border-radius: 50%;
  background: #7a7a7a;
  content: "";
  transition: transform 160ms ease, background 160ms ease;
}

.leva-switch-row input:checked {
  border-color: var(--text-color);
  background: color-mix(in srgb, var(--text-color) 28%, #252525);
}

.leva-switch-row input:checked::before {
  transform: translateX(16px);
  background: var(--text-color);
}

input:focus-visible {
  outline: 2px solid var(--text-color);
  outline-offset: 3px;
}

@media (max-width: 620px) {
  .center-stage {
    min-height: 100svh;
    padding: 16px;
  }

  .desktop-marquee-shell {
    display: none;
  }

  .mobile-marquee-stack {
    display: grid;
    gap: var(--mobile-stack-gap);
    width: 100%;
  }

  .mobile-marquee-stack .marquee-shell {
    width: 100%;
    padding: var(--shell-pad-y) var(--shell-pad-x);
  }

  .camera-marquee-shell {
    width: var(--camera-width);
    max-width: 100%;
  }

  .mobile-marquee {
    height: var(--mobile-led-height);
  }

  .leva-panel {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100svh - 24px);
    overflow: auto;
  }

  .camera-panel {
    left: auto;
    width: 126px;
  }
}
