:root { background: #000; }

html, body {
  margin: 0;
  height: 100%;
  background: #000;
  overflow: hidden;
}

.stage {
  position: fixed;
  inset: 0;
  /* Plain black — no static poster, so whatever you see is the live canvas. */
  background: #000;
}

/* Live tuning sliders (dev). */
#controls {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 20;
  width: 205px;
  max-height: calc(100vh - 20px);
  overflow-y: auto;
  padding: 8px 12px 10px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(120, 255, 120, 0.25);
  border-radius: 8px;
  font: 12px ui-monospace, Menlo, Consolas, monospace;
  color: #b8ffb8;
  backdrop-filter: blur(4px);
}
#controls .grp {
  margin: 9px 0 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(120, 255, 120, 0.2);
  color: #7fe89a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
}
#controls details.sect { margin-top: 6px; }
#controls details.sect > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 9px 0 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(120, 255, 120, 0.2);
  color: #7fe89a;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 10px;
  cursor: pointer;
  list-style-position: inside;
}
#controls details.sect > summary::-webkit-details-marker { color: #7fe89a; }
#controls label.act {
  display: inline-flex; align-items: center; gap: 4px; margin: 0;
  text-transform: none; letter-spacing: 0; color: #b8ffb8; cursor: pointer;
}
#controls label.act input { accent-color: #4fe06a; width: auto; }
#controls details.sect.sub { margin-left: 8px; }       /* nested Ember/Green under Appearance */
#controls details.sect.sub > summary { font-size: 9px; }
#controls label { display: block; margin: 4px 0 7px; }
#controls .crow { display: flex; justify-content: space-between; margin-bottom: 2px; }
#controls .crow b { color: #fff; font-weight: 600; }
#controls input[type="range"] { width: 100%; accent-color: #4fe06a; }
#controls label.chk { display: flex; align-items: center; gap: 7px; margin-top: 8px; cursor: pointer; }
#controls label.chk input { accent-color: #4fe06a; width: auto; }
#copybtn {
  display: block; width: 100%; margin-top: 12px; padding: 7px;
  background: rgba(79, 224, 106, 0.16); color: #cfffd6;
  border: 1px solid rgba(120, 255, 120, 0.4); border-radius: 6px;
  font: 12px ui-monospace, Menlo, Consolas, monospace; cursor: pointer;
}
#copybtn:hover { background: rgba(79, 224, 106, 0.28); }

/* Discreet sign-in affordance (owner only; everyone else is rejected by Google). */
.splash-signin {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 30;
  width: 24px;
  height: 24px;
  line-height: 20px;
  text-align: center;
  font-size: 26px;
  text-decoration: none;
  color: rgba(180, 255, 180, 0.22);
  border: 1px solid rgba(120, 255, 120, 0.18);
  border-radius: 50%;
  transition: color 0.2s, border-color 0.2s;
}
.splash-signin:hover { color: #cfffd6; border-color: rgba(120, 255, 120, 0.6); }

/* Fading "denied" toast shown after a rejected sign-in (?denied=true). */
.splash-toast {
  position: fixed;
  left: 50%;
  bottom: 48px;
  z-index: 40;
  padding: 10px 18px;
  background: rgba(24, 4, 4, 0.78);
  color: #ffdada;
  border: 1px solid rgba(255, 120, 120, 0.45);
  border-radius: 8px;
  font: 14px/1.3 ui-monospace, Menlo, Consolas, monospace;
  pointer-events: none;
  opacity: 0;
  animation: splash-toast 5s ease forwards;
}
@keyframes splash-toast {
  0%   { opacity: 0; transform: translate(-50%, 10px); }
  8%   { opacity: 1; transform: translate(-50%, 0); }
  78%  { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 0); }
}

/* Small diagnostic line; remove once everything's confirmed working. */
#status {
  position: fixed;
  left: 8px;
  bottom: 6px;
  z-index: 10;
  font: 12px/1.4 ui-monospace, Menlo, Consolas, monospace;
  color: #6f6;
  opacity: 0.5;
  white-space: pre;
  pointer-events: none;
  text-shadow: 0 0 3px #000;
}

/* All three layers fill the viewport and stretch (object-fit: fill) so they stay
   pixel-aligned with each other regardless of the window's aspect ratio. The
   WebGPU animation works in the same normalised image space, so it lines up too. */
.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.layer-mid { z-index: 1; }                          /* animation canvas (behind) */
.layer-top { object-fit: fill; z-index: 2; pointer-events: none; }  /* photo, screens cut out */
