:root {
  --violet-deep: #1a0738;
  --lilac-glow: #e9d8ff;
  --frost-white: #ffffff;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000000;
  color: var(--frost-white);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

.led-viewport {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  overflow: hidden;
}

/* Sized directly to fitted screen pixels (no nested CSS transform: scale() jank!) */
.led-frame {
  position: relative;
  overflow: hidden;
  background: #2b1058;
}

body.mode-full .led-frame {
  width: 100vw !important;
  height: 100vh !important;
}

.led-frame.show-guide {
  outline: 2px solid #00ff9d;
  outline-offset: -2px;
}

.led-frame.show-guide::after {
  content: "ACTIVE LED 788 × 1080 px (HD SDI 1080)";
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 60;
  font-size: 12px;
  font-weight: 700;
  color: #00ff9d;
  background: rgba(0, 0, 0, 0.8);
  padding: 3px 8px;
  border-radius: 6px;
}

/* Signature violet impasto winter swirl artwork */
.bg-artwork {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("./assets/bg-newyear-violet.jpg");
  background-size: cover;
  background-position: center center;
  filter: saturate(1.06) contrast(1.04) brightness(0.92);
}

/* Concert-hall cinematic lighting depth & rich royal-violet framing */
.bg-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(
      180deg,
      rgba(18, 5, 42, 0.56) 0%,
      rgba(36, 12, 78, 0.14) 20%,
      rgba(36, 12, 78, 0.06) 66%,
      rgba(22, 6, 48, 0.58) 88%,
      rgba(14, 3, 34, 0.82) 100%
    ),
    radial-gradient(
      ellipse at 50% 42%,
      rgba(255, 255, 255, 0.04) 0%,
      rgba(20, 6, 46, 0.34) 100%
    );
  pointer-events: none;
}

/* Soft pearlescent moonlight corona behind the top 3D crystalline blossom */
.bg-top-aura {
  position: absolute;
  top: -55px;
  left: 50%;
  transform: translateX(-50%);
  width: 68%;
  height: 240px;
  z-index: 2;
  border-radius: 50%;
  background: radial-gradient(
    ellipse at 50% 32%,
    rgba(255, 248, 225, 0.28) 0%,
    rgba(216, 180, 254, 0.16) 44%,
    transparent 74%
  );
  pointer-events: none;
}

/* Subtle seamless dark-violet depth floor under the petal mound (no muddy oval artifact) */
.mound-glow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 200px;
  z-index: 3;
  background: linear-gradient(
    180deg,
    rgba(22, 6, 48, 0) 0%,
    rgba(22, 6, 48, 0.28) 55%,
    rgba(16, 4, 38, 0.56) 100%
  );
  pointer-events: none;
}

/* Single native-DPI WebGL2 3D Canvas — zero DOM/SVG layout thrashing! */
#webgl-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 10;
  pointer-events: none;
}

.screen-header {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  z-index: 26;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.screen-header h1 {
  font-family: "Georgia", "Palatino Linotype", "Times New Roman", serif;
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 0.05em;
  color: #ffffff;
  text-shadow: 0 2px 16px rgba(18, 4, 46, 0.9);
}

.screen-header h1:empty {
  display: none;
}

/* Engineer controls stay completely invisible when idle */
.screen-controls {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.88;
  transition: opacity 0.35s ease;
}

.screen-controls.idle {
  opacity: 0;
}

.screen-controls:hover {
  opacity: 1;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.7);
}

.live-dot.offline {
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

.mode-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(233, 216, 255, 0.92);
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(36, 14, 76, 0.9);
  border: 1px solid rgba(233, 216, 255, 0.28);
}

.ctrl-btn {
  background: rgba(30, 12, 64, 0.92);
  border: 1px solid rgba(233, 216, 255, 0.35);
  color: #ffffff;
  border-radius: 9px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.ctrl-btn:hover {
  background: rgba(139, 92, 246, 0.58);
  border-color: #ffffff;
}

/* Optional QR Dock (hidden by default; QR lives on separate screen) */
.qr-dock {
  position: absolute;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px 12px 12px;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(40, 14, 84, 0.92), rgba(20, 6, 48, 0.95));
  border: 1.5px solid rgba(255, 255, 255, 0.42);
  box-shadow: 0 16px 38px rgba(12, 3, 32, 0.56);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

body.mode-portal .qr-dock {
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
}

body.mode-portal .qr-dock.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(18px);
  pointer-events: none;
}

body.mode-full .qr-dock {
  right: 28px;
  bottom: 26px;
  flex-direction: column;
  padding: 14px;
  gap: 10px;
}

body.mode-full .qr-dock.hidden {
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
}

.qr-frame {
  width: 112px;
  height: 112px;
  padding: 7px;
  border-radius: 15px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qr-frame img {
  width: 100%;
  height: 100%;
  display: block;
}

.qr-caption {
  display: flex;
  flex-direction: column;
  gap: 4px;
  white-space: nowrap;
}

body.mode-full .qr-caption {
  text-align: center;
}

.qr-caption strong {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
}

.qr-caption span {
  font-size: 13.5px;
  color: rgba(243, 232, 255, 0.88);
}
