/* ---------------------------------------------------------------------------
   Promo Harness — global styles
   Palette: bg #0a0a1a  navy #2c3e50  teal #1abc9c  gold #f1c40f  coral #e74c3c
--------------------------------------------------------------------------- */

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

html, body {
  height: 100%;
  background: #0a0a1a;
  font-family: 'Montserrat', sans-serif;
  color: #e8e8f0;
  overflow: hidden;
}

/* ---------------------------------------------------------------------------
   Viewport — fills the window, centres the stage
--------------------------------------------------------------------------- */

#viewport {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  gap: 12px;
}

/* ---------------------------------------------------------------------------
   Stage — fixed aspect-ratio container that scales to fit the window.
   Actual pixel dimensions and transform-based scaling are applied by JS.
--------------------------------------------------------------------------- */

#stage-wrapper {
  /* JS sets width/height to match the scaled stage footprint */
}

#stage {
  position: absolute;
  top: 0;
  left: 0;
  background: #000;
  /* JS sets explicit width/height and transform */
  transform-origin: top left;
}

#sim-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Overlay canvas and cue layer sit on top of the iframe */

#overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#cue-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* ---------------------------------------------------------------------------
   Control bar
--------------------------------------------------------------------------- */

#control-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #2c3e50;
  border: 1px solid #1abc9c33;
  border-radius: 8px;
  padding: 8px 16px;
  flex-shrink: 0;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid #1abc9c;
  color: #1abc9c;
  font-family: 'Montserrat', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 14px;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}

.ctrl-btn:hover {
  background: #1abc9c;
  color: #0a0a1a;
}

.ctrl-btn:hover svg polygon,
.ctrl-btn:hover svg path {
  fill: #0a0a1a;
}

.ctrl-btn svg {
  flex-shrink: 0;
}

#clock-display {
  font-size: 13px;
  font-weight: 600;
  color: #f1c40f;
  letter-spacing: 0.06em;
  min-width: 48px;
  text-align: right;
}

/* ---------------------------------------------------------------------------
   Cue — Title card
--------------------------------------------------------------------------- */

.cue-title {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: opacity, transform;
  transition: none;
  z-index: 2;
}

.cue-title[data-pos='lower'] {
  align-items: flex-end;
  padding-bottom: 8%;
}

.cue-title__panel {
  background: rgba(10, 10, 26, 0.88);
  border: 1px solid rgba(26, 188, 156, 0.25);
  border-radius: 6px;
  max-width: 78%;
  text-align: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.cue-title__rule {
  background: #1abc9c;
  width: 72px;
  margin: 0 auto 20px;
  border-radius: 2px;
}

.cue-title__text {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  color: #e8e8f0;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

.cue-title__sub {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  color: #f1c40f;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 16px;
  line-height: 1.3;
}

/* ---------------------------------------------------------------------------
   Cue — Full-stage fade overlay
--------------------------------------------------------------------------- */

.cue-fade {
  position: absolute;
  inset: 0;
  background: #0a0a1a;
  will-change: opacity;
  /* sits above sim iframe but below other cue elements */
  z-index: 1;
}

/* Bump title and caption above the fade overlay */
.cue-title  { z-index: 2; }
.cue-caption { z-index: 2; }

/* ---------------------------------------------------------------------------
   Cue — Caption (lower-third strip)
--------------------------------------------------------------------------- */

.cue-caption {
  position: absolute;
  display: flex;
  align-items: stretch;
  gap: 0;
  background: rgba(10, 10, 26, 0.82);
  border: 1px solid rgba(26, 188, 156, 0.20);
  border-left: none;
  border-radius: 4px;
  /* position (left/bottom/maxWidth/padding) set by JS from stage-px constants */
  will-change: opacity, transform;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2;
}

.cue-caption__bar {
  /* width set by JS */
  background: #1abc9c;
  border-radius: 4px 0 0 4px;
  flex-shrink: 0;
  align-self: stretch;
  min-height: 100%;
}

.cue-caption__text {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  color: #e8e8f0;
  line-height: 1.4;
  letter-spacing: 0.01em;
  padding-left: 18px;
  /* font-size set by JS */
}

/* ---------------------------------------------------------------------------
   Record mode — hide all harness chrome
--------------------------------------------------------------------------- */

body.record-mode #control-bar {
  display: none;
}

body.record-mode #viewport {
  gap: 0;
  justify-content: flex-start;
}
