/* Nera Interactive Draw: the player's stage.

   A 16:9 frame the operator shares into their stream. All sizes are container
   units (cqw, cqh) against .nd-frame, so it holds at any size and fullscreen.
   Colours, font and positions come from the pack as custom properties set on
   .nd-stage by nera-draw.js. Nothing in here is client specific. */

.nd-stage {
  --nd-accent: #E8C46A;
  --nd-accent-soft: #F4DCA4;
  --nd-text: #F2F7F4;
  --nd-muted: #A9BDB4;
  --nd-live: #A6FF3D;
  --nd-bg: #050A08;
  --nd-font: system-ui, sans-serif;

  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
  font-family: var(--nd-font);
  color: var(--nd-text);
  -webkit-font-smoothing: antialiased;
}
.nd-stage:fullscreen { width: 100vw; height: 100vh; }

.nd-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  container-type: size;
  overflow: hidden;
  background: var(--nd-bg);
}
.nd-stage:fullscreen .nd-frame { width: min(100vw, 177.78vh); }

.nd-video, .nd-hud { position: absolute; inset: 0; }
.nd-hud { pointer-events: none; }
.nd-v {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--nd-bg);
}

/* ---- Before the draw ---- */

.nd-live {
  position: absolute;
  top: 4.2cqh;
  left: 3cqw;
  display: flex;
  align-items: center;
  gap: 0.8cqw;
  font-weight: 700;
  font-size: 1.15cqw;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: 0 0 1cqh rgba(0, 0, 0, 0.8);
}
.nd-live::before {
  content: "";
  width: 0.8cqw;
  height: 0.8cqw;
  border-radius: 50%;
  background: var(--nd-live);
  box-shadow: 0 0 1cqw var(--nd-live);
  animation: nd-pulse 1.6s ease-in-out infinite;
}
@keyframes nd-pulse { 50% { opacity: 0.35; } }

.nd-logo {
  position: absolute;
  top: 3cqh;
  right: 3cqw;
  width: 6.4cqw;
  filter: drop-shadow(0 0.4cqw 1cqw rgba(0, 0, 0, 0.6));
}

.nd-idle {
  position: absolute;
  left: 50%;
  top: 30%;
  translate: -50% -50%;
  width: 80%;
  text-align: center;
  transition: opacity 500ms ease, translate 500ms ease;
}
.nd-idle__eyebrow {
  font-weight: 700;
  font-size: 1.25cqw;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--nd-accent);
  text-shadow: 0 0 1cqh rgba(0, 0, 0, 0.8);
}
.nd-idle__title {
  margin-top: 1.4cqh;
  font-weight: 800;
  font-size: 4.6cqw;
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  text-shadow: 0 0.6cqh 3cqh rgba(0, 0, 0, 0.75);
}
.nd-idle__meta {
  margin-top: 2cqh;
  font-weight: 600;
  font-size: 1.4cqw;
  color: var(--nd-muted);
  text-shadow: 0 0 1cqh rgba(0, 0, 0, 0.8);
}
.nd-frame:not([data-state="idle"]) .nd-idle { opacity: 0; translate: -50% -60%; }

.nd-press {
  position: absolute;
  left: 50%;
  bottom: 9cqh;
  translate: -50% 0;
  font-weight: 700;
  font-size: 1.1cqw;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(242, 247, 244, 0.6);
  text-shadow: 0 0 1cqh rgba(0, 0, 0, 0.8);
  transition: opacity 300ms ease;
}
.nd-frame:not([data-state="idle"]) .nd-press { opacity: 0; }

/* ---- The draw ---- */

.nd-count {
  position: absolute;
  left: 50%;
  top: var(--nd-count-y, 16%);
  translate: -50% -50%;
  font-weight: 800;
  font-size: var(--nd-count-size, 17cqh);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 5cqh rgba(0, 0, 0, 0.75), 0 0 1.2cqh color-mix(in srgb, var(--nd-accent) 40%, transparent);
  opacity: 0;
}

.nd-label {
  position: absolute;
  left: 50%;
  top: var(--nd-label-y, 60%);
  translate: -50% 0;
  font-weight: 800;
  font-size: 2.3cqw;
  letter-spacing: 0.42em;
  padding-left: 0.42em;
  text-transform: uppercase;
  color: var(--nd-accent);
  text-shadow: 0 0 2cqh rgba(0, 0, 0, 0.85);
  opacity: 0;
}

/* The name on the reveal surface, tilted to lie on it. */
.nd-reveal {
  position: absolute;
  left: var(--nd-rx, 50%);
  top: var(--nd-ry, 80%);
  width: var(--nd-rw, 30%);
  translate: -50% -50%;
  transform: perspective(70cqw) rotateX(var(--nd-rtilt, 45deg));
  text-align: center;
}
.nd-reveal__name,
.nd-reveal__ticket {
  white-space: nowrap;
  text-transform: uppercase;
  line-height: 1;
  opacity: 0;
}
.nd-reveal__name {
  font-weight: 800;
  font-size: var(--nd-name-size, 3.6cqw);
  letter-spacing: -0.01em;
  color: var(--nd-accent);
  text-shadow: 0 0.06em 0 rgba(0, 0, 0, 0.7), 0 0 1.4cqw color-mix(in srgb, var(--nd-accent) 45%, transparent);
}
.nd-reveal__ticket {
  margin-top: 0.6cqw;
  font-weight: 700;
  font-size: var(--nd-ticket-size, 1.9cqw);
  letter-spacing: 0.1em;
  color: var(--nd-accent-soft);
  text-shadow: 0 0.06em 0 rgba(0, 0, 0, 0.75), 0 0 1cqw color-mix(in srgb, var(--nd-accent) 35%, transparent);
}

/* ---- After ---- */

.nd-end {
  position: absolute;
  left: 50%;
  top: var(--nd-end-y, 7%);
  translate: -50% 0;
  width: 84%;
  text-align: center;
  opacity: 0;
}
.nd-end__eyebrow {
  font-weight: 700;
  font-size: 1.5cqw;
  letter-spacing: 0.38em;
  padding-left: 0.38em;
  text-transform: uppercase;
  color: var(--nd-accent);
  text-shadow: 0 0 1cqh rgba(0, 0, 0, 0.8);
}
.nd-end__name {
  margin-top: 1.2cqh;
  font-weight: 800;
  font-size: 5.4cqw;
  line-height: 1;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  text-shadow: 0 0.6cqh 3cqh rgba(0, 0, 0, 0.75);
}
.nd-end__ticket {
  margin-top: 1.4cqh;
  font-weight: 700;
  font-size: 1.8cqw;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--nd-muted);
  text-shadow: 0 0 1cqh rgba(0, 0, 0, 0.8);
}
.nd-end__ticket b { color: var(--nd-accent); font-weight: 800; }

/* Fingerprints before the draw, the revealed seed after. */
.nd-proof {
  position: absolute;
  left: 3cqw;
  right: 3cqw;
  bottom: 2.6cqh;
  text-align: center;
  font: 500 0.95cqw/1.5 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color: rgba(214, 224, 219, 0.8);
  text-shadow: 0 0 1cqh rgba(0, 0, 0, 0.95);
  transition: opacity 400ms ease;
}
.nd-proof b { color: var(--nd-text); font-weight: 600; }
.nd-frame[data-state="running"] .nd-proof { opacity: 0; }
