body {
  margin: 0;
  background: black;
  color: white;
  font-family: Arial;
  overflow: hidden;
}

/* ✅ auth overlay (shown by default until JS confirms a session) */
#auth {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #0b0b0b;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  width: 320px;
  max-width: calc(100% - 40px);
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 26px 24px 20px;
  box-sizing: border-box;
  text-align: center;
}
.auth-logo { width: 220px; max-width: 100%; height: auto; margin-bottom: 18px; }
.auth-view input {
  width: 100%;
  box-sizing: border-box;
  margin: 6px 0;
  padding: 11px 12px;
  font-size: 15px;
  background: #1f1f1f;
  color: #fff;
  border: 1px solid #333;
  border-radius: 6px;
}
.auth-view input:focus { outline: none; border-color: #39ff14; }
.auth-view button {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  font-size: 16px;
  font-weight: 700;
  color: #000;
  background: #39ff14;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.auth-view button:hover { background: #2fd60f; }
.auth-links {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 13px;
}
.auth-links a { color: #39ff14; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }
#authMsg { min-height: 18px; margin-top: 12px; font-size: 13px; }

#menu {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;            /* top+bottom pins it to exactly the viewport height */
  width: 200px;
  background: #111;
  padding: 10px;
  z-index: 10;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;     /* the script list scrolls inside; menu never overflows */
}

/* script/episode list grows and scrolls when it overflows */
#scriptList {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

/* floating top-right header (Script Builder / Log out) — hidden in play mode */
#topbar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 20;
  display: none;            /* shown by JS once logged in & not playing */
  gap: 20px;
  padding: 12px 20px;
}
#topbar a {
  color: #39ff14;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
}
#topbar a:hover { text-decoration: underline; }
#topbar i { margin-right: 6px; }

#logo {
  display: block;
  width: 100%;
  height: auto;
  margin-bottom: 8px;
}

#menu button {
  width: 100%;
  margin: 5px 0;
  padding: 10px;
  background: #f0f0f0;
  color: black;
  border: none;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
  font-size: 16px;
}

/* keep the teleprompter view immune to Bootstrap's global border-box reset */
#content, #inner, .line { box-sizing: content-box; }

#content {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1200px;
  font-size: 60px;
  line-height: 1.6;
  padding: 0 40px;
}

#inner {
  transform-origin: center center;
  will-change: transform;
  visibility: hidden;
}

#controls {
  position: fixed;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 1200px; /* match #content width */
  max-width: calc(100% - 40px);
  box-sizing: border-box;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: nowrap; /* prevent buttons from wrapping */
}

/* flip the control bar to match mirror mode so it reads in the reflection */
#controls.mirrored {
  transform: translateX(-50%) scaleX(-1);
}

#controls button {
  padding: 12px 0;      /* no horizontal padding; flex sizing handles width */
  font-size: 20px;      /* keeps text + icon readable */
  font-weight: 600;
  text-transform: uppercase;
  flex: 1 1 auto;       /* make buttons stretch evenly */
  min-width: 0;         /* allow flex shrinking to avoid overflow */
  white-space: nowrap;  /* keep icon+label on one line */
  margin: 0;
  background: #fff;     /* white bg / black text+icons (Bootstrap-proof) */
  color: #000;
  border: 1px solid #adadad;
  border-radius: 4px;
}
#controls button i { color: #000; }


.line {
  width: 100%;
  padding: 6px 20px;
  color: rgba(255,255,255,0.45);
}

.line.active {
  color: #fff;
  background: rgba(0,150,255,0.35);
  border-radius: 6px;
}

/* ✅ series menu */
.series-header {
  width: 100%;
  margin: 6px 0 2px;
  padding: 8px;
  background: #222;
  color: #fff;
  border: none;
  cursor: pointer;
  text-align: left;
  font-weight: 700;
  font-size: 15px;
}

.series-scripts {
  display: none;
  padding-left: 8px;
}

.series-scripts.open {
  display: block;
}

.series-scripts button {
  font-size: 15px;
  padding: 7px;
}

/* ✅ builder (Bootstrap-styled modal; a few app-specific bits remain) */
#builder textarea { font-family: monospace; }
#builder.shorts #b_meta { display: none; }

/* dynamic rows created by JS keep their dark styling inside the modal */
.sponsor-row { display: flex; gap: 6px; align-items: flex-start; margin-bottom: 6px; }
.sponsor-row textarea { flex: 1; }
.sponsor-row button {
  padding: 8px 12px; background: #a33; color: #fff;
  border: none; border-radius: 6px; cursor: pointer; font-size: 15px;
}
.script-row {
  display: flex; justify-content: space-between; align-items: center;
  background: #222; padding: 6px 10px; margin: 4px 0; border-radius: 6px;
}
.script-row button {
  margin: 0 0 0 6px; padding: 4px 10px; background: #a33; color: #fff;
  border: none; border-radius: 6px; cursor: pointer; font-size: 15px;
}
.script-row button.edit-btn { background: #357; }
