* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #000; color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  cursor: none;
}

#stage {
  position: fixed; inset: 0;
  transform-origin: center center;
}

.hidden { display: none !important; }

/* Wall canvas: sized to the full video wall, offset so this screen shows its slice. */
#wall {
  position: absolute; inset: 0;
  overflow: hidden;
}
#media { position: absolute; inset: 0; } /* sized/offset inline for video walls */

/* Multiview grid: a screen split into independent cells. */
#grid {
  position: absolute; inset: 0;
  display: grid; gap: 2px; background: #000;
}

/* A Surface holds crossfading .layer children; #media and grid cells are both surfaces. */
.surface { position: relative; overflow: hidden; }
#media.surface { position: absolute; } /* keep absolute positioning for wall offset */
.surface .layer {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  opacity: 1;
}
.surface .layer img, .surface .layer video {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
.surface.cover .layer img, .surface.cover .layer video { object-fit: cover; }
.surface.fill  .layer img, .surface.fill  .layer video { object-fit: fill; }

/* live-capture prompt (needs a user gesture to pick a window/screen) */
.capture-prompt { background: radial-gradient(circle at 50% 45%, #14203a 0%, #05070d 75%); }
.capbtn {
  padding: 14px 22px; border: 0; border-radius: 999px; cursor: pointer;
  background: #1e6bff; color: #fff; font-size: clamp(13px, 2.5vmin, 18px); font-weight: 600;
}

.overlay {
  position: fixed; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; text-align: center; padding: 40px;
  background: radial-gradient(circle at 50% 40%, #14203a 0%, #05070d 70%);
}
.overlay.hidden { display: none; }
.logo-mark { width: 84px; height: 84px; filter: drop-shadow(0 8px 30px rgba(61,123,255,0.35)); }
.name { font-size: clamp(28px, 6vw, 72px); font-weight: 700; }
.hint { font-size: 16px; opacity: .55; max-width: 520px; }

#identify { background: #1e6bff; }
.idnum { font-size: clamp(40px, 12vw, 160px); font-weight: 800; letter-spacing: 2px; }

.dot {
  position: fixed; top: 10px; right: 12px; z-index: 30;
  width: 10px; height: 10px; border-radius: 50%;
  background: #f04747; box-shadow: 0 0 8px #f04747; opacity: .7;
  transition: background .3s, box-shadow .3s;
}
.dot.online { background: #3ad07a; box-shadow: 0 0 8px #3ad07a; }

.enter-btn {
  position: fixed; left: 50%; bottom: 48px; transform: translateX(-50%); z-index: 40;
  padding: 16px 28px;
  border: 0; border-radius: 999px; cursor: pointer;
  background: #1e6bff; color: #fff; font-size: 17px; font-weight: 600;
  box-shadow: 0 8px 30px #0007;
}
.enter-btn.hidden { display: none; }

.cast-btn {
  position: fixed; top: 12px; left: 12px; z-index: 40;
  padding: 8px 14px; border: 0; border-radius: 8px; cursor: pointer;
  background: #0009; color: #fff; font-size: 14px; backdrop-filter: blur(4px);
}
.cast-btn.hidden { display: none; }
